Skip to content

Commit 4503ced

Browse files
Elena RashkovanLena Rashkovan
andauthored
fix: popover and listboxitem styling (#489)
* feat(popover): move even-width-with-trigger styling to popover * fix(list-box): fix styling when listbox item is a link * fix(icon-button): fix duplicate selector * fix(popover): fix syntax --------- Co-authored-by: Lena Rashkovan <[email protected]>
1 parent 4ccb47c commit 4503ced

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

src/components/experimental/ComboBox/ComboBox.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ const defaultAriaStrings = {
2727
};
2828

2929
const StyledPopover = styled(Popover)`
30-
box-sizing: border-box;
3130
overflow: auto;
32-
width: var(--trigger-width);
3331
`;
3432

3533
interface ComboBoxFieldProps extends Pick<FieldProps, 'label' | 'description' | 'errorMessage' | 'leadingIcon'> {

src/components/experimental/IconButton/IconButton.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const StandardIconContainer = styled(Button)<Omit<IconButtonProps, 'Icon'>>`
2525
&[data-disabled],
2626
&[data-pending] {
2727
cursor: not-allowed;
28+
opacity: 0.38;
2829
}
2930
3031
/* we create a before pseudo element to mess with the opacity (see the hovered state) */
@@ -50,11 +51,6 @@ const StandardIconContainer = styled(Button)<Omit<IconButtonProps, 'Icon'>>`
5051
&:not([data-disabled]) {
5152
color: ${props => (props.isActive ? getSemanticValue('interactive') : getSemanticValue('on-surface'))};
5253
}
53-
54-
&[data-disabled],
55-
&[data-pending] {
56-
opacity: 0.38;
57-
}
5854
`;
5955

6056
const TonalIconContainer = styled(Button)<Omit<IconButtonProps, 'Icon'>>`
@@ -69,6 +65,7 @@ const TonalIconContainer = styled(Button)<Omit<IconButtonProps, 'Icon'>>`
6965
&[data-disabled],
7066
&[data-pending] {
7167
cursor: not-allowed;
68+
opacity: 0.38;
7269
}
7370
7471
/* we create a before pseudo element to mess with the opacity (see the hovered state) */
@@ -104,11 +101,6 @@ const TonalIconContainer = styled(Button)<Omit<IconButtonProps, 'Icon'>>`
104101
color: ${props =>
105102
props.isActive ? getSemanticValue('on-interactive-container') : getSemanticValue('on-surface')};
106103
}
107-
108-
&[data-disabled],
109-
&[data-pending] {
110-
opacity: 0.38;
111-
}
112104
`;
113105

114106
export const IconButton = ({

src/components/experimental/ListBox/ListBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { getSemanticValue } from '../../../essentials/experimental';
77

88
const StyledListBoxItem = styled(BaseListBoxItem)`
99
position: relative;
10+
display: block;
1011
padding: ${get('space.3')} ${get('space.4')};
1112
border-radius: ${get('radii.4')};
1213
color: ${getSemanticValue('on-surface')};

src/components/experimental/Popover/Popover.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ const StyledPopover = styled(BasePopover)`
1414
box-shadow: 0 2px 4px -1px hsla(0, 0%, 0%, 0.2), 0 1px 10px 0 hsla(0, 0%, 0%, 0.12),
1515
0 4px 5px 0 hsla(0, 0%, 0%, 0.14);
1616
border-radius: ${get('radii.4')};
17+
18+
&[data-trigger='Select'],
19+
&[data-trigger='ComboBox'] {
20+
box-sizing: border-box;
21+
width: var(--trigger-width);
22+
}
1723
`;
1824

1925
const FocusTrap = styled(Dialog)`

src/components/experimental/Select/Select.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ import { VisuallyHidden } from '../../VisuallyHidden/VisuallyHidden';
2424
import { fieldStyles, fieldTextStyles } from '../Field/Field';
2525

2626
const StyledPopover = styled(Popover)`
27-
box-sizing: border-box;
2827
overflow: auto;
29-
width: var(--trigger-width);
3028
`;
3129

3230
const FakeButton = styled(FakeInput)`

0 commit comments

Comments
 (0)