Skip to content

Commit 85440fc

Browse files
committed
update grid areas and fix edgeToText
1 parent 0c3a3b4 commit 85440fc

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

packages/@react-spectrum/s2/src/ComboBox.tsx

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ export let listboxItem = style({
186186
gridColumnEnd: -1,
187187
display: 'grid',
188188
gridTemplateAreas: [
189-
'. checkmark icon label value keyboard descriptor .',
190-
'. . . description . . . .'
189+
'. checkmark icon label .',
190+
'. . . description .'
191191
],
192192
gridTemplateColumns: {
193193
size: {
194-
S: [edgeToText(24), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(24)],
195-
M: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(32)],
196-
L: [edgeToText(40), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(40)],
197-
XL: [edgeToText(48), 'auto', 'auto', 'minmax(0, 1fr)', 'auto', 'auto', 'auto', edgeToText(48)]
194+
S: [edgeToText(24), 'auto', 'auto', 'minmax(0, 1fr)', edgeToText(24)],
195+
M: [edgeToText(32), 'auto', 'auto', 'minmax(0, 1fr)', edgeToText(32)],
196+
L: [edgeToText(40), 'auto', 'auto', 'minmax(0, 1fr)', edgeToText(40)],
197+
XL: [edgeToText(48), 'auto', 'auto', 'minmax(0, 1fr)', edgeToText(48)]
198198
}
199199
},
200200
gridTemplateRows: {
@@ -223,10 +223,10 @@ export let listboxHeader = style<{size?: 'S' | 'M' | 'L' | 'XL'}>({
223223
paddingY: centerPadding(),
224224
marginX: {
225225
size: {
226-
S: '[calc(24 * 3 / 8)]',
227-
M: '[calc(32 * 3 / 8)]',
228-
L: '[calc(40 * 3 / 8)]',
229-
XL: '[calc(48 * 3 / 8)]'
226+
S: `[${edgeToText(24)}]`,
227+
M: `[${edgeToText(24)}]`,
228+
L: `[${edgeToText(24)}]`,
229+
XL: `[${edgeToText(24)}]`
230230
}
231231
}
232232
});
@@ -244,20 +244,13 @@ const separatorWrapper = style({
244244
':is(:last-child > &)': 'none',
245245
default: 'flex'
246246
},
247-
// marginX: {
248-
// size: {
249-
// S: edgeToText(24),
250-
// M: edgeToText(32),
251-
// L: edgeToText(40),
252-
// XL: edgeToText(48)
253-
// }
254-
// },
247+
// A workaround since edgeToText() returns undefined for some reason
255248
marginX: {
256249
size: {
257-
S: '[calc(24 * 3 / 8)]',
258-
M: '[calc(32 * 3 / 8)]',
259-
L: '[calc(40 * 3 / 8)]',
260-
XL: '[calc(48 * 3 / 8)]'
250+
S: `[${edgeToText(24)}]`,
251+
M: `[${edgeToText(24)}]`,
252+
L: `[${edgeToText(24)}]`,
253+
XL: `[${edgeToText(24)}]`
261254
}
262255
},
263256
height: 12

0 commit comments

Comments
 (0)