Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix widgets overwrites from short to long-hand props #4935

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
79ef953
Merge remote-tracking branch 'remote/develop' into develop
LukasMasuch Nov 22, 2021
5bf6c41
Merge branch 'streamlit:develop' into develop
LukasMasuch Dec 1, 2021
5f179c5
Merge branch 'streamlit:develop' into develop
LukasMasuch Dec 7, 2021
e31d7cb
Merge branch 'streamlit:develop' into develop
LukasMasuch Dec 16, 2021
444a3ab
Merge branch 'streamlit:develop' into develop
LukasMasuch Dec 20, 2021
73504ac
Merge branch 'streamlit:develop' into develop
LukasMasuch Jan 19, 2022
a4865c6
Merge branch 'streamlit:develop' into develop
LukasMasuch Feb 8, 2022
7df7f14
Merge branch 'streamlit:develop' into develop
LukasMasuch Feb 15, 2022
2e8fded
Merge branch 'streamlit:develop' into develop
LukasMasuch Mar 1, 2022
11d7a6b
Merge branch 'streamlit:develop' into develop
LukasMasuch Mar 9, 2022
64c3652
Merge branch 'streamlit:develop' into develop
LukasMasuch Mar 14, 2022
bfacd3c
Merge branch 'streamlit:develop' into develop
LukasMasuch Mar 24, 2022
ba95c51
Merge branch 'streamlit:develop' into develop
LukasMasuch Apr 25, 2022
a42681a
Merge branch 'streamlit:develop' into develop
LukasMasuch May 19, 2022
be9efce
Merge branch 'streamlit:develop' into develop
LukasMasuch May 25, 2022
f4f7fe1
Merge branch 'streamlit:develop' into develop
LukasMasuch Jun 11, 2022
9415903
Merge remote-tracking branch 'remote/develop' into develop
LukasMasuch Jun 21, 2022
6bac312
Merge remote-tracking branch 'remote/develop' into develop
LukasMasuch Jun 26, 2022
18299f5
Merge remote-tracking branch 'remote/develop' into develop
LukasMasuch Jun 27, 2022
d69f0b0
Merge remote-tracking branch 'remote/develop' into develop
LukasMasuch Jul 6, 2022
4798eb1
Change short-hand props to long-hand
LukasMasuch Jul 7, 2022
8b0b80b
Remove text input snapshots
LukasMasuch Jul 7, 2022
f3765ce
Add snapshots
LukasMasuch Jul 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions frontend/src/components/shared/Dropdown/Selectbox.tsx
Expand Up @@ -185,7 +185,11 @@ class Selectbox extends React.PureComponent<Props, State> {

ControlContainer: {
style: () => ({
borderWidth: "1px",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
borderLeftWidth: "1px",
borderRightWidth: "1px",
borderTopWidth: "1px",
borderBottomWidth: "1px",
}),
},

Expand All @@ -197,7 +201,11 @@ class Selectbox extends React.PureComponent<Props, State> {

ValueContainer: {
style: () => ({
padding: ".5rem",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
paddingRight: ".5rem",
paddingLeft: ".5rem",
paddingBottom: ".5rem",
paddingTop: ".5rem",
}),
},

Expand Down
18 changes: 10 additions & 8 deletions frontend/src/components/widgets/DateInput/DateInput.tsx
Expand Up @@ -278,19 +278,21 @@ class DateInput extends React.PureComponent<Props, State> {
overrides: {
Root: {
style: {
borderWidth: "1px",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
borderLeftWidth: "1px",
borderRightWidth: "1px",
borderTopWidth: "1px",
borderBottomWidth: "1px",
},
},

InputContainer: {
style: {
borderWidth: "1px",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No border here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I removed that intentionally since it did not seem to actually do anything. Having borderWidth in Root is the only place that has an impact.

},
},
Input: {
style: {
padding: ".5rem",
borderWidth: "1px",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No border here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the other comment

// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
paddingRight: ".5rem",
paddingLeft: ".5rem",
paddingBottom: ".5rem",
paddingTop: ".5rem",
},
},
},
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/widgets/Multiselect/Multiselect.tsx
Expand Up @@ -230,7 +230,11 @@ class Multiselect extends React.PureComponent<Props, State> {

ControlContainer: {
style: () => ({
borderWidth: "1px",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
borderLeftWidth: "1px",
borderRightWidth: "1px",
borderTopWidth: "1px",
borderBottomWidth: "1px",
}),
},

Expand Down
12 changes: 10 additions & 2 deletions frontend/src/components/widgets/NumberInput/NumberInput.tsx
Expand Up @@ -341,8 +341,12 @@ class NumberInput extends React.PureComponent<Props, State> {
max: this.getMax(),
},
style: {
padding: ".5rem",
lineHeight: "1.5",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
paddingRight: ".5rem",
paddingLeft: ".5rem",
paddingBottom: ".5rem",
paddingTop: ".5rem",
},
},
InputContainer: {
Expand All @@ -355,7 +359,11 @@ class NumberInput extends React.PureComponent<Props, State> {
style: () => ({
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
borderWidth: 0,
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
borderLeftWidth: 0,
borderRightWidth: 0,
borderTopWidth: 0,
borderBottomWidth: 0,
}),
},
}}
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/widgets/TextArea/TextArea.tsx
Expand Up @@ -208,14 +208,18 @@ class TextArea extends React.PureComponent<Props, State> {
overrides={{
Input: {
style: {
padding: "1rem",
lineHeight: "1.4",
height: height ? `${height}px` : "",
minHeight: "95px",
resize: "vertical",
"::placeholder": {
opacity: "0.7",
},
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
paddingRight: "1rem",
paddingLeft: "1rem",
paddingBottom: "1rem",
paddingTop: "1rem",
},
},
}}
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/components/widgets/TextArea/styled-components.ts
@@ -1,7 +1,26 @@
/**
* @license
* Copyright 2018-2022 Streamlit Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import styled from "@emotion/styled"

export const StyledTextAreaContainer = styled.div({
div: {
// TODO: move this to the TextArea overwrites once Root is supported:
// https://github.com/uber/baseweb/issues/4264
borderWidth: "1px",
},
})
12 changes: 10 additions & 2 deletions frontend/src/components/widgets/TextInput/TextInput.tsx
Expand Up @@ -205,13 +205,21 @@ class TextInput extends React.PureComponent<Props, State> {
"::placeholder": {
opacity: "0.7",
},
padding: ".5rem",
lineHeight: "1.4",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
paddingRight: ".5rem",
paddingLeft: ".5rem",
paddingBottom: ".5rem",
paddingTop: ".5rem",
},
},
Root: {
style: {
borderWidth: "1px",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
borderLeftWidth: "1px",
borderRightWidth: "1px",
borderTopWidth: "1px",
borderBottomWidth: "1px",
},
},
}}
Expand Down
17 changes: 17 additions & 0 deletions frontend/src/components/widgets/TextInput/styled-components.ts
@@ -1,3 +1,20 @@
/**
* @license
* Copyright 2018-2022 Streamlit Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import styled from "@emotion/styled"

export interface StyledTextInputProps {
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/components/widgets/TimeInput/TimeInput.tsx
Expand Up @@ -146,7 +146,11 @@ class TimeInput extends PureComponent<Props, State> {
overrides: {
ControlContainer: {
style: {
borderWidth: "1px",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
borderLeftWidth: "1px",
borderRightWidth: "1px",
borderTopWidth: "1px",
borderBottomWidth: "1px",
},
},

Expand All @@ -158,7 +162,11 @@ class TimeInput extends PureComponent<Props, State> {

ValueContainer: {
style: () => ({
padding: ".5rem",
// Baseweb requires long-hand props, short-hand leads to weird bugs & warnings.
paddingRight: ".5rem",
paddingLeft: ".5rem",
paddingBottom: ".5rem",
paddingTop: ".5rem",
}),
},

Expand Down