Skip to content

Commit 4d4feae

Browse files
TkDodoandrewshie-sentry
authored andcommitted
fix(ui): chonk styling for compactSelect (#88093)
1 parent 3870f46 commit 4d4feae

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

static/app/components/core/compactSelect/control.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ export function Control({
561561
onFocus={onSearchFocus}
562562
onBlur={onSearchBlur}
563563
onChange={e => updateSearch(e.target.value)}
564-
size={searchInputSizeMapping[size]}
564+
size="xs"
565565
{...searchKeyboardProps}
566566
/>
567567
)}
@@ -655,12 +655,6 @@ const ClearButton = styled(Button)`
655655
margin: -${space(0.25)} -${space(0.5)};
656656
`;
657657

658-
const searchInputSizeMapping: Record<FormSize, FormSize> = {
659-
md: 'sm',
660-
sm: 'xs',
661-
xs: 'xs',
662-
};
663-
664658
const SearchInput = styled(Input)`
665659
appearance: none;
666660
width: calc(100% - ${space(0.5)} * 2);

static/app/components/core/compactSelect/gridList/option.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Fragment, useMemo, useRef, useState} from 'react';
2+
import styled from '@emotion/styled';
23
import type {AriaGridListItemOptions} from '@react-aria/gridlist';
34
import {useGridListItem, useGridListSelectionCheckbox} from '@react-aria/gridlist';
45
import {useFocusWithin, useHover} from '@react-aria/interactions';
@@ -7,8 +8,9 @@ import type {ListState} from '@react-stately/list';
78
import type {Node} from '@react-types/shared';
89

910
import {Checkbox} from 'sentry/components/core/checkbox';
10-
import {MenuListItem} from 'sentry/components/core/menuListItem';
11+
import {InnerWrap, MenuListItem} from 'sentry/components/core/menuListItem';
1112
import {IconCheckmark} from 'sentry/icons';
13+
import {space} from 'sentry/styles/space';
1214
import type {FormSize} from 'sentry/utils/theme';
1315

1416
import {CheckWrap} from '../styles';
@@ -111,7 +113,7 @@ export function GridListOption({node, listState, size}: GridListOptionProps) {
111113
}, [multiple, isSelected, isDisabled, size, leadingItems, hideCheck]);
112114

113115
return (
114-
<MenuListItem
116+
<StyledMenuListItem
115117
{...rowPropsMemo}
116118
ref={ref}
117119
size={size}
@@ -132,3 +134,9 @@ export function GridListOption({node, listState, size}: GridListOptionProps) {
132134
/>
133135
);
134136
}
137+
138+
const StyledMenuListItem = styled(MenuListItem)`
139+
> ${InnerWrap} {
140+
padding-left: ${space(1)};
141+
}
142+
`;

static/app/components/core/compactSelect/listBox/option.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import {Fragment, useMemo, useRef} from 'react';
2+
import styled from '@emotion/styled';
23
import type {AriaOptionProps} from '@react-aria/listbox';
34
import {useOption} from '@react-aria/listbox';
45
import type {ListState} from '@react-stately/list';
56
import type {Node} from '@react-types/shared';
67

78
import {Checkbox} from 'sentry/components/core/checkbox';
8-
import {MenuListItem} from 'sentry/components/core/menuListItem';
9+
import {InnerWrap, MenuListItem} from 'sentry/components/core/menuListItem';
910
import {IconCheckmark} from 'sentry/icons';
11+
import {space} from 'sentry/styles/space';
1012
import type {FormSize} from 'sentry/utils/theme';
1113

1214
import {CheckWrap} from '../styles';
@@ -90,7 +92,7 @@ export function ListBoxOption({
9092
}, [multiple, isSelected, isDisabled, size, leadingItems, hideCheck]);
9193

9294
return (
93-
<MenuListItem
95+
<StyledMenuListItem
9496
{...optionPropsMemo}
9597
ref={ref}
9698
size={size}
@@ -111,3 +113,9 @@ export function ListBoxOption({
111113
/>
112114
);
113115
}
116+
117+
const StyledMenuListItem = styled(MenuListItem)`
118+
> ${InnerWrap} {
119+
padding-left: ${space(1)};
120+
}
121+
`;

0 commit comments

Comments
 (0)