@slotted/styles 0.1.0-beta.4 → 0.1.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -1
- package/src/accordion/accordion.css +31 -13
- package/src/accordion/accordion.tokens.json +2 -0
- package/src/action-bar/action-bar.css +47 -44
- package/src/action-bar/action-bar.tokens.json +1 -0
- package/src/action-sheet/action-sheet.css +39 -39
- package/src/alert/alert.css +97 -97
- package/src/alert/alert.tokens.json +6 -1
- package/src/app-shell/app-shell.css +472 -342
- package/src/app-shell/app-shell.tokens.json +6 -3
- package/src/aspect-ratio/aspect-ratio.css +24 -23
- package/src/attachment/attachment.css +118 -114
- package/src/avatar/avatar.css +97 -67
- package/src/avatar/avatar.tokens.json +8 -0
- package/src/avatar-group/avatar-group.css +22 -23
- package/src/badge/badge.css +58 -47
- package/src/badge/badge.tokens.json +6 -0
- package/src/breadcrumb/breadcrumb.css +52 -52
- package/src/button/button.css +408 -93
- package/src/button/button.tokens.json +13 -0
- package/src/button-group/button-group.css +80 -79
- package/src/button-group/button-group.tokens.json +1 -0
- package/src/calendar/calendar.css +594 -267
- package/src/calendar/calendar.tokens.json +35 -3
- package/src/card/card.css +133 -70
- package/src/card/card.tokens.json +1 -0
- package/src/carousel/carousel.css +158 -169
- package/src/cascader/cascader.css +174 -159
- package/src/cascader/cascader.tokens.json +2 -0
- package/src/chart/chart.css +300 -271
- package/src/chart/chart.tokens.json +5 -0
- package/src/checkbox/checkbox.css +190 -148
- package/src/checkbox/checkbox.tokens.json +4 -0
- package/src/checkbox-group/checkbox-group.css +7 -7
- package/src/clock/clock.css +246 -0
- package/src/clock/clock.tokens.json +44 -0
- package/src/code-block/code-block.css +85 -89
- package/src/collapsible/collapsible.css +273 -85
- package/src/collapsible/collapsible.tokens.json +6 -0
- package/src/color-picker/color-picker.css +106 -114
- package/src/column-manager/column-manager.css +111 -119
- package/src/combobox/combobox.css +219 -132
- package/src/combobox/combobox.tokens.json +4 -0
- package/src/command-palette/command-palette.css +214 -102
- package/src/command-palette/command-palette.tokens.json +4 -0
- package/src/container/container.css +27 -27
- package/src/context-menu/context-menu.css +9 -9
- package/src/currency-field/currency-field.css +119 -119
- package/src/currency-field/currency-field.tokens.json +1 -0
- package/src/dashboard-grid/dashboard-grid.css +231 -115
- package/src/dashboard-grid/dashboard-grid.tokens.json +3 -1
- package/src/data-grid/data-grid.css +637 -496
- package/src/data-grid/data-grid.tokens.json +5 -1
- package/src/data-list/data-list.css +93 -76
- package/src/data-list/data-list.tokens.json +2 -1
- package/src/date-field/date-field.css +62 -57
- package/src/date-field/date-field.tokens.json +1 -0
- package/src/date-picker/date-picker.css +31 -269
- package/src/date-picker/date-picker.tokens.json +1 -21
- package/src/date-range-picker/date-range-picker.css +72 -528
- package/src/date-range-picker/date-range-picker.tokens.json +1 -37
- package/src/datetime-field/datetime-field.css +90 -90
- package/src/datetime-field/datetime-field.tokens.json +1 -0
- package/src/datetime-picker/datetime-picker.css +49 -711
- package/src/datetime-picker/datetime-picker.tokens.json +1 -50
- package/src/datetime-range-picker/datetime-range-picker.css +60 -985
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +1 -67
- package/src/description-list/description-list.css +120 -76
- package/src/description-list/description-list.tokens.json +1 -0
- package/src/detail-panel/detail-panel.css +86 -71
- package/src/detail-panel/detail-panel.tokens.json +2 -0
- package/src/dialog/dialog.css +462 -199
- package/src/dialog/dialog.tokens.json +10 -0
- package/src/divider/divider.css +20 -20
- package/src/drawer/drawer.css +736 -237
- package/src/drawer/drawer.tokens.json +15 -0
- package/src/entity-picker/entity-picker.css +402 -272
- package/src/entity-picker/entity-picker.tokens.json +6 -0
- package/src/event-calendar/event-calendar.css +357 -399
- package/src/field/field.css +106 -93
- package/src/field/field.tokens.json +2 -0
- package/src/field-group/field-group.css +58 -38
- package/src/field-group/field-group.tokens.json +3 -0
- package/src/filter-bar/filter-bar.css +224 -216
- package/src/floating-panel/floating-panel.css +147 -0
- package/src/floating-panel/floating-panel.tokens.json +32 -0
- package/src/form/form.css +103 -26
- package/src/form/form.tokens.json +6 -1
- package/src/fullscreen/fullscreen.css +26 -27
- package/src/grid/grid.css +32 -31
- package/src/highlight/highlight.css +11 -11
- package/src/hover-card/hover-card.css +9 -9
- package/src/icon/icon.css +67 -20
- package/src/icon/icon.tokens.json +1 -0
- package/src/image/image.css +42 -42
- package/src/import-export-center/import-export-center.css +147 -168
- package/src/import-export-center/import-export-center.tokens.json +1 -0
- package/src/inline/inline.css +29 -29
- package/src/inline-message/inline-message.css +162 -86
- package/src/inline-message/inline-message.tokens.json +5 -0
- package/src/kbd/kbd.css +63 -51
- package/src/kbd/kbd.tokens.json +4 -0
- package/src/link/link.css +54 -33
- package/src/link/link.tokens.json +4 -0
- package/src/list/list.css +55 -24
- package/src/list/list.tokens.json +2 -0
- package/src/list-item/list-item.css +195 -80
- package/src/list-item/list-item.tokens.json +10 -0
- package/src/listbox/listbox.css +121 -72
- package/src/listbox/listbox.tokens.json +6 -1
- package/src/loading-overlay/loading-overlay.css +86 -103
- package/src/markdown/markdown.css +20 -20
- package/src/media-viewer/media-viewer.css +790 -0
- package/src/media-viewer/media-viewer.tokens.json +53 -0
- package/src/menu/menu.css +166 -83
- package/src/menu/menu.tokens.json +3 -1
- package/src/menubar/menubar.css +16 -16
- package/src/message/message.css +1296 -1243
- package/src/message/message.tokens.json +14 -0
- package/src/message-scroller/message-scroller.css +323 -320
- package/src/meter/meter.css +136 -0
- package/src/meter/meter.tokens.json +23 -0
- package/src/multi-select/multi-select.css +246 -174
- package/src/multi-select/multi-select.tokens.json +3 -0
- package/src/navigation-menu/navigation-menu.css +170 -191
- package/src/navigation-menu/navigation-menu.tokens.json +1 -0
- package/src/notification-center/notification-center.css +155 -163
- package/src/notification-center/notification-center.tokens.json +4 -0
- package/src/number-field/number-field.css +93 -93
- package/src/number-field/number-field.tokens.json +1 -0
- package/src/otp-input/otp-input.css +74 -64
- package/src/otp-input/otp-input.tokens.json +1 -0
- package/src/page/page.css +109 -31
- package/src/page/page.tokens.json +8 -0
- package/src/page-header/page-header.css +342 -287
- package/src/page-header/page-header.tokens.json +6 -1
- package/src/pagination/pagination.css +75 -79
- package/src/picker-panel/picker-panel.css +1074 -0
- package/src/picker-panel/picker-panel.tokens.json +77 -0
- package/src/popover/popover.css +85 -65
- package/src/popover/popover.tokens.json +2 -0
- package/src/progress-indicator/progress-indicator.css +194 -137
- package/src/progress-indicator/progress-indicator.tokens.json +1 -0
- package/src/prompt-composer/prompt-composer.css +274 -116
- package/src/prompt-composer/prompt-composer.tokens.json +15 -0
- package/src/prose/prose.css +77 -82
- package/src/radio-group/radio-group.css +107 -112
- package/src/rating/rating.css +147 -143
- package/src/rating/rating.tokens.json +2 -0
- package/src/result-state/result-state.css +95 -102
- package/src/result-state/result-state.tokens.json +1 -0
- package/src/runtime-properties.mjs +44 -6
- package/src/saved-views/saved-views.css +43 -49
- package/src/scroll-area/scroll-area.css +50 -37
- package/src/section/section.css +311 -46
- package/src/section/section.tokens.json +13 -1
- package/src/segmented-control/segmented-control.css +221 -133
- package/src/segmented-control/segmented-control.tokens.json +7 -11
- package/src/select/select.css +226 -149
- package/src/select/select.tokens.json +4 -0
- package/src/side-navigation/side-navigation.css +204 -201
- package/src/side-navigation/side-navigation.tokens.json +2 -0
- package/src/skeleton/skeleton.css +76 -58
- package/src/slider/slider.css +108 -104
- package/src/slider/slider.tokens.json +1 -0
- package/src/sparkline/sparkline.css +75 -53
- package/src/sparkline/sparkline.tokens.json +2 -0
- package/src/spinner/spinner.css +83 -180
- package/src/spinner/spinner.tokens.json +0 -1
- package/src/split-button/split-button.css +34 -35
- package/src/split-button/split-button.tokens.json +1 -0
- package/src/splitter/splitter.css +47 -48
- package/src/stack/stack.css +26 -26
- package/src/stat-card/stat-card.css +420 -245
- package/src/stat-card/stat-card.tokens.json +8 -0
- package/src/status-indicator/status-indicator.css +126 -101
- package/src/status-indicator/status-indicator.tokens.json +0 -3
- package/src/stepper/stepper.css +78 -82
- package/src/switch/switch.css +143 -125
- package/src/switch/switch.tokens.json +4 -0
- package/src/table/table.css +653 -222
- package/src/table/table.tokens.json +10 -0
- package/src/table-of-contents/table-of-contents.css +60 -59
- package/src/table-of-contents/table-of-contents.tokens.json +1 -0
- package/src/tabs/tabs.css +327 -294
- package/src/tabs/tabs.tokens.json +7 -1
- package/src/tag/tag.css +113 -89
- package/src/tag/tag.tokens.json +11 -0
- package/src/tags-input/tags-input.css +152 -87
- package/src/tags-input/tags-input.tokens.json +7 -1
- package/src/text-field/text-field.css +146 -148
- package/src/text-field/text-field.tokens.json +1 -0
- package/src/textarea/textarea.css +38 -33
- package/src/textarea/textarea.tokens.json +1 -0
- package/src/time-field/time-field.css +82 -77
- package/src/time-field/time-field.tokens.json +1 -0
- package/src/time-picker/time-picker.css +30 -519
- package/src/time-picker/time-picker.tokens.json +1 -38
- package/src/time-range-picker/time-range-picker.css +53 -895
- package/src/time-range-picker/time-range-picker.tokens.json +1 -66
- package/src/timeline/timeline.css +280 -292
- package/src/timeline/timeline.tokens.json +5 -0
- package/src/toast/toast.css +139 -122
- package/src/toast/toast.tokens.json +7 -0
- package/src/toggle/toggle.css +34 -38
- package/src/toggle-group/toggle-group.css +73 -77
- package/src/toolbar/toolbar.css +49 -40
- package/src/toolbar/toolbar.tokens.json +2 -1
- package/src/tooltip/tooltip.css +95 -39
- package/src/tooltip/tooltip.tokens.json +1 -0
- package/src/top-navigation/top-navigation.css +253 -269
- package/src/top-navigation/top-navigation.tokens.json +1 -0
- package/src/tour/tour.css +68 -74
- package/src/tour/tour.tokens.json +1 -0
- package/src/transfer/transfer.css +164 -168
- package/src/tree/tree.css +118 -122
- package/src/typography/typography.css +67 -38
- package/src/typography/typography.tokens.json +2 -0
- package/src/upload/upload.css +256 -257
- package/src/visually-hidden/visually-hidden.css +1 -1
- package/src/wizard/wizard.css +187 -199
|
@@ -30,12 +30,14 @@
|
|
|
30
30
|
"--slotted-font-weight-regular",
|
|
31
31
|
"--slotted-line-height-md",
|
|
32
32
|
"--slotted-line-height-sm",
|
|
33
|
+
"--slotted-list-fill-inset",
|
|
33
34
|
"--slotted-list-item-background",
|
|
34
35
|
"--slotted-list-item-background-active",
|
|
35
36
|
"--slotted-list-item-background-current",
|
|
36
37
|
"--slotted-list-item-background-hover",
|
|
37
38
|
"--slotted-list-item-background-selected",
|
|
38
39
|
"--slotted-list-item-body-gap",
|
|
40
|
+
"--slotted-list-item-body-min-inline-size",
|
|
39
41
|
"--slotted-list-item-border-color",
|
|
40
42
|
"--slotted-list-item-border-width",
|
|
41
43
|
"--slotted-list-item-color",
|
|
@@ -73,6 +75,7 @@
|
|
|
73
75
|
"--slotted-selection-size-sm",
|
|
74
76
|
"--slotted-space-1",
|
|
75
77
|
"--slotted-space-2",
|
|
78
|
+
"--slotted-space-3",
|
|
76
79
|
"--slotted-surface-raised",
|
|
77
80
|
"--slotted-surface-sunken",
|
|
78
81
|
"--slotted-text",
|
|
@@ -91,6 +94,13 @@
|
|
|
91
94
|
"--slotted-tone-danger-subtle-hover",
|
|
92
95
|
"--slotted-tone-danger-surface",
|
|
93
96
|
"--slotted-tone-danger-text",
|
|
97
|
+
"--slotted-tone-info-border",
|
|
98
|
+
"--slotted-tone-info-solid-active",
|
|
99
|
+
"--slotted-tone-info-solid-hover",
|
|
100
|
+
"--slotted-tone-info-subtle-active",
|
|
101
|
+
"--slotted-tone-info-subtle-hover",
|
|
102
|
+
"--slotted-tone-info-surface",
|
|
103
|
+
"--slotted-tone-info-text",
|
|
94
104
|
"--slotted-tone-secondary-border",
|
|
95
105
|
"--slotted-tone-secondary-solid-active",
|
|
96
106
|
"--slotted-tone-secondary-solid-hover",
|
package/src/listbox/listbox.css
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* component; only the surface's own inset, radius and shadow come off the
|
|
47
47
|
* space, radius and shadow scales.
|
|
48
48
|
*/
|
|
49
|
-
[data-ui
|
|
49
|
+
[data-ui-listbox] {
|
|
50
50
|
--_surface: var(--slotted-listbox-surface, var(--slotted-surface, #ffffff));
|
|
51
51
|
--_text: var(--slotted-listbox-text, var(--slotted-text, #0f172a));
|
|
52
52
|
--_muted: var(--slotted-listbox-text-muted, var(--slotted-text-muted, #5b6b7f));
|
|
@@ -78,7 +78,11 @@
|
|
|
78
78
|
--_inset-inline: var(--slotted-listbox-padding-inline, var(--slotted-space-2, 0.25rem));
|
|
79
79
|
--_option-inset: var(--slotted-control-padding-inline-md, 0.8125rem);
|
|
80
80
|
--_option-height: var(--slotted-control-height-md, 34px);
|
|
81
|
-
|
|
81
|
+
/* Concentric with the panel: its radius less the inset, floored at 0. */
|
|
82
|
+
--_option-radius: var(
|
|
83
|
+
--slotted-listbox-option-radius,
|
|
84
|
+
max(0px, calc(var(--_radius) - var(--_inset-inline)))
|
|
85
|
+
);
|
|
82
86
|
--_font-size: var(--slotted-control-font-size-md, 13px);
|
|
83
87
|
--_secondary-font-size: var(--slotted-control-font-size-sm, 12px);
|
|
84
88
|
--_icon-size: var(--slotted-control-icon-size-md, 16px);
|
|
@@ -126,7 +130,7 @@
|
|
|
126
130
|
scroll-behavior: auto;
|
|
127
131
|
}
|
|
128
132
|
|
|
129
|
-
[data-ui
|
|
133
|
+
[data-ui-listbox][data-size='sm'] {
|
|
130
134
|
--_option-inset: var(--slotted-control-padding-inline-sm, 0.625rem);
|
|
131
135
|
--_option-height: var(--slotted-control-height-sm, 30px);
|
|
132
136
|
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
@@ -135,7 +139,7 @@
|
|
|
135
139
|
--_column-gap: var(--slotted-control-gap-sm, 0.375rem);
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
[data-ui
|
|
142
|
+
[data-ui-listbox][data-size='lg'] {
|
|
139
143
|
--_option-inset: var(--slotted-control-padding-inline-lg, 1rem);
|
|
140
144
|
--_option-height: var(--slotted-control-height-lg, 38px);
|
|
141
145
|
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
@@ -149,18 +153,18 @@
|
|
|
149
153
|
/**
|
|
150
154
|
* `framed` is the standalone control: a box with an edge, which is what
|
|
151
155
|
* `<select multiple>` looks like and what a listbox presented on its own has
|
|
152
|
-
* to look like to be
|
|
156
|
+
* to look like to be recognized as a control at all. `plain` is what `select`
|
|
153
157
|
* and `combobox` render inside their own layer, where the layer already has
|
|
154
158
|
* the edge and a second one would draw a box inside a box.
|
|
155
159
|
*/
|
|
156
|
-
[data-ui
|
|
160
|
+
[data-ui-listbox][data-variant='framed'] {
|
|
157
161
|
background: var(--_surface);
|
|
158
162
|
border: var(--_border-width) solid var(--_border-color);
|
|
159
163
|
border-radius: var(--_radius);
|
|
160
164
|
box-shadow: var(--_shadow);
|
|
161
165
|
}
|
|
162
166
|
|
|
163
|
-
[data-ui
|
|
167
|
+
[data-ui-listbox][data-variant='plain'] {
|
|
164
168
|
background: transparent;
|
|
165
169
|
border: 0;
|
|
166
170
|
}
|
|
@@ -171,30 +175,30 @@
|
|
|
171
175
|
* the option, and a second ring around the whole listbox would say the
|
|
172
176
|
* listbox is the thing being operated.
|
|
173
177
|
*/
|
|
174
|
-
[data-ui
|
|
178
|
+
[data-ui-listbox][data-focus-mode='activedescendant']:focus-visible {
|
|
175
179
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, #2563eb);
|
|
176
180
|
outline-offset: var(--slotted-focus-ring-offset, 2px);
|
|
177
181
|
}
|
|
178
182
|
|
|
179
|
-
[data-ui
|
|
183
|
+
[data-ui-listbox][data-focus-mode='roving']:focus {
|
|
180
184
|
outline: none;
|
|
181
185
|
}
|
|
182
186
|
|
|
183
|
-
[data-ui
|
|
187
|
+
[data-ui-listbox][data-invalid] {
|
|
184
188
|
--_border-color: var(--slotted-tone-danger-border);
|
|
185
189
|
--slotted-focus-ring-color: var(--slotted-focus-ring-color-invalid);
|
|
186
190
|
}
|
|
187
191
|
|
|
188
|
-
/* Width as well as
|
|
192
|
+
/* Width as well as color (WCAG 1.4.1): in `high-contrast` the danger border
|
|
189
193
|
is the resting edge's black. An edge inside the border, so nothing moves,
|
|
190
194
|
in place of the resting lift — the one `text-field` draws. Disabled keeps
|
|
191
|
-
its own edge, as it keeps its own border
|
|
192
|
-
[data-ui
|
|
195
|
+
its own edge, as it keeps its own border color. */
|
|
196
|
+
[data-ui-listbox][data-invalid]:not([data-disabled]) {
|
|
193
197
|
--_invalid-edge-width: var(--slotted-control-invalid-edge-width, 1px);
|
|
194
198
|
--_shadow: inset 0 0 0 var(--_invalid-edge-width) var(--slotted-tone-danger-border);
|
|
195
199
|
}
|
|
196
200
|
|
|
197
|
-
[data-ui
|
|
201
|
+
[data-ui-listbox][data-disabled] {
|
|
198
202
|
--_surface: var(--slotted-disabled-background, #e2e8f0);
|
|
199
203
|
--_text: var(--slotted-disabled-foreground, #64748b);
|
|
200
204
|
--_border-color: var(--slotted-disabled-border, #cbd5e1);
|
|
@@ -202,7 +206,7 @@
|
|
|
202
206
|
cursor: not-allowed;
|
|
203
207
|
}
|
|
204
208
|
|
|
205
|
-
[data-ui
|
|
209
|
+
[data-ui-listbox][data-loading] {
|
|
206
210
|
cursor: progress;
|
|
207
211
|
}
|
|
208
212
|
|
|
@@ -215,18 +219,18 @@
|
|
|
215
219
|
* a layout read during a key press; here the number is stated, the arrows
|
|
216
220
|
* step by it, and the picture and the keyboard cannot disagree.
|
|
217
221
|
*/
|
|
218
|
-
[data-ui
|
|
222
|
+
[data-ui-listbox][data-layout='grid'] {
|
|
219
223
|
column-gap: var(--_column-gap);
|
|
220
224
|
grid-template-columns: repeat(var(--_columns), minmax(0, 1fr));
|
|
221
225
|
max-block-size: none;
|
|
222
226
|
}
|
|
223
227
|
|
|
224
|
-
[data-ui
|
|
228
|
+
[data-ui-listbox][data-layout='grid'] [data-part-option] {
|
|
225
229
|
grid-column: auto;
|
|
226
230
|
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
[data-ui
|
|
233
|
+
[data-ui-listbox][data-layout='grid'] :is([data-part-group], [data-part-canvas]) {
|
|
230
234
|
grid-template-columns: repeat(var(--_columns), minmax(0, 1fr));
|
|
231
235
|
}
|
|
232
236
|
|
|
@@ -235,7 +239,7 @@
|
|
|
235
239
|
* is one row tall — and the scroll turns with it, so `dir="rtl"` reverses the
|
|
236
240
|
* whole thing without a rule of its own.
|
|
237
241
|
*/
|
|
238
|
-
[data-ui
|
|
242
|
+
[data-ui-listbox][data-orientation='horizontal'] {
|
|
239
243
|
display: flex;
|
|
240
244
|
flex-direction: row;
|
|
241
245
|
max-block-size: none;
|
|
@@ -243,7 +247,7 @@
|
|
|
243
247
|
overflow-y: hidden;
|
|
244
248
|
}
|
|
245
249
|
|
|
246
|
-
[data-ui
|
|
250
|
+
[data-ui-listbox][data-orientation='horizontal'] [data-part-option] {
|
|
247
251
|
flex: 0 0 auto;
|
|
248
252
|
grid-template-columns: auto auto auto;
|
|
249
253
|
}
|
|
@@ -262,7 +266,7 @@
|
|
|
262
266
|
* generic element between a `listbox` and its `option`s is an owned element
|
|
263
267
|
* with no permitted role, and the role is what makes it transparent.
|
|
264
268
|
*/
|
|
265
|
-
[data-ui
|
|
269
|
+
[data-ui-listbox] > [data-part-canvas] {
|
|
266
270
|
/**
|
|
267
271
|
* `align-content: start` and `grid-auto-rows: min-content` together, and
|
|
268
272
|
* neither is optional: a grid with a definite block size and automatic rows
|
|
@@ -291,7 +295,7 @@
|
|
|
291
295
|
* because the reader scrolled it out and moving it back would take the
|
|
292
296
|
* scrollbar away from them.
|
|
293
297
|
*/
|
|
294
|
-
[data-ui
|
|
298
|
+
[data-ui-listbox] [data-part-option][data-pinned] {
|
|
295
299
|
/* Out of flow, so out of the subgrid: it states the three columns itself.
|
|
296
300
|
They are the option's own rather than the listbox's, which is the price
|
|
297
301
|
of rendering a row the window does not reach. */
|
|
@@ -302,13 +306,13 @@
|
|
|
302
306
|
|
|
303
307
|
/* ── Groups ───────────────────────────────────────────────────────────── */
|
|
304
308
|
|
|
305
|
-
[data-ui
|
|
309
|
+
[data-ui-listbox] [data-part-group] {
|
|
306
310
|
display: grid;
|
|
307
311
|
grid-column: 1 / -1;
|
|
308
312
|
grid-template-columns: subgrid;
|
|
309
313
|
}
|
|
310
314
|
|
|
311
|
-
[data-ui
|
|
315
|
+
[data-ui-listbox] [data-part-group-label] {
|
|
312
316
|
color: var(--_muted);
|
|
313
317
|
font-size: var(--_secondary-font-size);
|
|
314
318
|
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
@@ -323,7 +327,7 @@
|
|
|
323
327
|
* element: ARIA 1.2 lets a `listbox` own `option` and `group` and nothing
|
|
324
328
|
* else, so an `hr` inside one is an owned element with no permitted role.
|
|
325
329
|
*/
|
|
326
|
-
[data-ui
|
|
330
|
+
[data-ui-listbox] [data-part-group] + [data-part-group] {
|
|
327
331
|
border-block-start: var(--_border-width) solid
|
|
328
332
|
var(--slotted-listbox-group-border-color, var(--slotted-border-subtle, #e2e8f0));
|
|
329
333
|
margin-block-start: var(--slotted-space-2, 0.25rem);
|
|
@@ -332,9 +336,13 @@
|
|
|
332
336
|
|
|
333
337
|
/* ── Options ──────────────────────────────────────────────────────────── */
|
|
334
338
|
|
|
335
|
-
[data-ui
|
|
339
|
+
[data-ui-listbox] [data-part-option] {
|
|
336
340
|
align-content: center;
|
|
337
341
|
background: transparent;
|
|
342
|
+
/* No edge by default. A list whose options are cards gives them one, and
|
|
343
|
+
the chosen option changes its colour with the selection's own token. */
|
|
344
|
+
border: var(--slotted-listbox-option-border-width, 0) solid
|
|
345
|
+
var(--slotted-listbox-option-border-color, transparent);
|
|
338
346
|
border-radius: var(--_option-radius);
|
|
339
347
|
box-sizing: border-box;
|
|
340
348
|
color: inherit;
|
|
@@ -350,8 +358,8 @@
|
|
|
350
358
|
*/
|
|
351
359
|
line-height: var(--slotted-line-height-md, 1.5);
|
|
352
360
|
min-block-size: var(--_option-height);
|
|
353
|
-
padding-block: var(--slotted-space-2, 0.25rem);
|
|
354
|
-
padding-inline: var(--_option-inset);
|
|
361
|
+
padding-block: var(--slotted-listbox-option-padding-block, var(--slotted-space-2, 0.25rem));
|
|
362
|
+
padding-inline: var(--slotted-listbox-option-padding-inline, var(--_option-inset));
|
|
355
363
|
position: relative;
|
|
356
364
|
/* The one gap inside an option, between a label and the line under it. */
|
|
357
365
|
row-gap: var(--slotted-space-1, 0.125rem);
|
|
@@ -363,17 +371,57 @@
|
|
|
363
371
|
var(--slotted-control-transition-easing, var(--slotted-easing-standard));
|
|
364
372
|
}
|
|
365
373
|
|
|
374
|
+
/* Options touch by default; a list of separate cards sets the distance. */
|
|
375
|
+
[data-ui-listbox] [data-part-option] + [data-part-option] {
|
|
376
|
+
margin-block-start: var(--slotted-listbox-option-gap, 0);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/* Along a row the distance is inline, and in a grid it is the tracks' gap,
|
|
380
|
+
so options of one row stay on one line. */
|
|
381
|
+
[data-ui-listbox][data-orientation='horizontal'] [data-part-option] + [data-part-option] {
|
|
382
|
+
margin-block-start: 0;
|
|
383
|
+
margin-inline-start: var(--slotted-listbox-option-gap, 0);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
[data-ui-listbox][data-layout='grid'] [data-part-option] + [data-part-option] {
|
|
387
|
+
margin-block-start: 0;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
[data-ui-listbox][data-layout='grid'],
|
|
391
|
+
[data-ui-listbox][data-layout='grid'] :is([data-part-group], [data-part-canvas]) {
|
|
392
|
+
row-gap: var(--slotted-listbox-option-gap, 0);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* A group with a column count of its own lays its options out in it,
|
|
397
|
+
* whatever the listbox's count is, so one listbox holds a column of rows
|
|
398
|
+
* beside a grid of cards and keeps one tab stop and one set of arrows.
|
|
399
|
+
*/
|
|
400
|
+
[data-ui-listbox] [data-part-group][data-columns] {
|
|
401
|
+
--_columns: var(--slotted-listbox-columns, 1);
|
|
402
|
+
|
|
403
|
+
column-gap: var(--_column-gap);
|
|
404
|
+
grid-template-columns: repeat(var(--_columns), minmax(0, 1fr));
|
|
405
|
+
row-gap: var(--slotted-listbox-option-gap, 0);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
[data-ui-listbox] [data-part-group][data-columns] > [data-part-option] {
|
|
409
|
+
grid-column: auto;
|
|
410
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
411
|
+
margin-block-start: 0;
|
|
412
|
+
}
|
|
413
|
+
|
|
366
414
|
/**
|
|
367
415
|
* Hover is a pointer's own feedback and nothing more. Unlike `menu`, it does
|
|
368
416
|
* not move the active option: a listbox holds a selection as well as a
|
|
369
417
|
* highlight, and a hover that moved the highlight would fight the arrow keys
|
|
370
418
|
* a reader is holding down.
|
|
371
419
|
*/
|
|
372
|
-
[data-ui
|
|
420
|
+
[data-ui-listbox]:not([data-disabled]) [data-part-option]:not([data-disabled]):hover {
|
|
373
421
|
background-color: var(--_highlight);
|
|
374
422
|
}
|
|
375
423
|
|
|
376
|
-
[data-ui
|
|
424
|
+
[data-ui-listbox]:not([data-disabled]) [data-part-option]:not([data-disabled]):active {
|
|
377
425
|
background-color: var(--_highlight-active);
|
|
378
426
|
}
|
|
379
427
|
|
|
@@ -387,8 +435,8 @@
|
|
|
387
435
|
* legitimately be elsewhere — a `combobox` keeps it in its own text field and
|
|
388
436
|
* this ground is then the only thing that says which option is live.
|
|
389
437
|
*/
|
|
390
|
-
[data-ui
|
|
391
|
-
[data-ui
|
|
438
|
+
[data-ui-listbox][data-focus-mode='roving']:focus-within [data-part-option][data-current],
|
|
439
|
+
[data-ui-listbox][data-focus-mode='activedescendant'] [data-part-option][data-current] {
|
|
392
440
|
background-color: var(--_highlight);
|
|
393
441
|
}
|
|
394
442
|
|
|
@@ -402,15 +450,15 @@
|
|
|
402
450
|
*
|
|
403
451
|
* An inset `outline` rather than a `::after` border: an outline follows the
|
|
404
452
|
* option's own radius without a second radius to keep in step, and forced
|
|
405
|
-
*
|
|
453
|
+
* colors replace its paint on their own, where a pseudo-element's border
|
|
406
454
|
* would be decoration the theme cannot reach.
|
|
407
455
|
*/
|
|
408
|
-
[data-ui
|
|
456
|
+
[data-ui-listbox]:focus-within [data-part-option][data-current] {
|
|
409
457
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, #2563eb);
|
|
410
458
|
outline-offset: calc(-1 * var(--slotted-focus-ring-width, 2px));
|
|
411
459
|
}
|
|
412
460
|
|
|
413
|
-
[data-ui
|
|
461
|
+
[data-ui-listbox] [data-part-option]:focus {
|
|
414
462
|
outline: none;
|
|
415
463
|
}
|
|
416
464
|
|
|
@@ -418,14 +466,18 @@
|
|
|
418
466
|
* What the reader chose. The ground says it at a glance, the ink says it
|
|
419
467
|
* again, and the mark says it where neither can: in the `high-contrast`
|
|
420
468
|
* scheme the accent surface *is* the plain surface, and every tone surface
|
|
421
|
-
* becomes `Canvas` under forced
|
|
469
|
+
* becomes `Canvas` under forced colors, so a selection painted with a fill
|
|
422
470
|
* alone disappears in the mode that needs it most — the same failure WCAG
|
|
423
|
-
* 2.2 SC 1.4.1 describes for
|
|
471
|
+
* 2.2 SC 1.4.1 describes for color on its own. A bar on the start edge said
|
|
424
472
|
* it once; a rail for state is out of the system (R1), and the `indicator`
|
|
425
473
|
* below is the mark that carries it instead.
|
|
426
474
|
*/
|
|
427
|
-
[data-ui
|
|
475
|
+
[data-ui-listbox] [data-part-option][data-selected] {
|
|
428
476
|
background-color: var(--_selected-surface);
|
|
477
|
+
border-color: var(
|
|
478
|
+
--slotted-listbox-selected-border-color,
|
|
479
|
+
var(--slotted-listbox-option-border-color, transparent)
|
|
480
|
+
);
|
|
429
481
|
color: var(--_selected-text);
|
|
430
482
|
}
|
|
431
483
|
|
|
@@ -438,24 +490,23 @@
|
|
|
438
490
|
* selection begins and ends. `select` and `combobox` draw the same ground
|
|
439
491
|
* and answer the same way; `selection-block.test.mjs` holds the three to it.
|
|
440
492
|
*/
|
|
441
|
-
[data-ui
|
|
493
|
+
[data-ui-listbox] [data-part-option][data-selected] + [data-part-option][data-selected] {
|
|
442
494
|
border-start-end-radius: 0;
|
|
443
495
|
border-start-start-radius: 0;
|
|
444
496
|
}
|
|
445
497
|
|
|
446
|
-
[data-ui
|
|
447
|
-
[data-part='option'][data-selected]:has(+ [data-part='option'][data-selected]) {
|
|
498
|
+
[data-ui-listbox] [data-part-option][data-selected]:has(+ [data-part-option][data-selected]) {
|
|
448
499
|
border-end-end-radius: 0;
|
|
449
500
|
border-end-start-radius: 0;
|
|
450
501
|
}
|
|
451
502
|
|
|
452
|
-
[data-ui
|
|
453
|
-
[data-part
|
|
503
|
+
[data-ui-listbox]:not([data-disabled])
|
|
504
|
+
[data-part-option][data-selected]:not([data-disabled]):hover {
|
|
454
505
|
background-color: var(--slotted-tone-accent-subtle-hover);
|
|
455
506
|
}
|
|
456
507
|
|
|
457
|
-
[data-ui
|
|
458
|
-
[data-part
|
|
508
|
+
[data-ui-listbox]:not([data-disabled])
|
|
509
|
+
[data-part-option][data-selected]:not([data-disabled]):active {
|
|
459
510
|
background-color: var(--slotted-tone-accent-subtle-active);
|
|
460
511
|
}
|
|
461
512
|
|
|
@@ -465,7 +516,7 @@
|
|
|
465
516
|
* control cannot do. It therefore has to answer the highlight with something,
|
|
466
517
|
* and answer it more quietly than an option that would do anything.
|
|
467
518
|
*/
|
|
468
|
-
[data-ui
|
|
519
|
+
[data-ui-listbox] [data-part-option][data-disabled] {
|
|
469
520
|
color: var(--slotted-disabled-foreground, #64748b);
|
|
470
521
|
cursor: not-allowed;
|
|
471
522
|
}
|
|
@@ -475,12 +526,12 @@
|
|
|
475
526
|
* The mark stays drawn — the reader still needs to know which option was
|
|
476
527
|
* chosen — and the ground stops claiming the option is theirs to change.
|
|
477
528
|
*/
|
|
478
|
-
[data-ui
|
|
529
|
+
[data-ui-listbox] [data-part-option][data-disabled]:is([data-selected], [data-current]) {
|
|
479
530
|
background-color: var(--slotted-disabled-background, #e2e8f0);
|
|
480
531
|
color: var(--slotted-disabled-foreground, #64748b);
|
|
481
532
|
}
|
|
482
533
|
|
|
483
|
-
[data-ui
|
|
534
|
+
[data-ui-listbox][data-readonly] [data-part-option] {
|
|
484
535
|
cursor: default;
|
|
485
536
|
}
|
|
486
537
|
|
|
@@ -491,7 +542,7 @@
|
|
|
491
542
|
* labels up: the mark's box exists whether or not the mark is drawn, so a
|
|
492
543
|
* list of options does not shift by sixteen pixels as one is chosen.
|
|
493
544
|
*/
|
|
494
|
-
[data-ui
|
|
545
|
+
[data-ui-listbox] :is([data-part-indicator], [data-part-icon]) {
|
|
495
546
|
/* One line box tall, so a mark beside a label that wrapped onto three lines
|
|
496
547
|
sits on the first of them rather than in the middle of the option. */
|
|
497
548
|
block-size: 1lh;
|
|
@@ -507,7 +558,7 @@
|
|
|
507
558
|
* an `icon` box, sized here to the column so the mark and a consumer's icon
|
|
508
559
|
* in the same column are one size.
|
|
509
560
|
*/
|
|
510
|
-
[data-ui
|
|
561
|
+
[data-ui-listbox] [data-part-indicator] {
|
|
511
562
|
--slotted-icon-size: var(--_icon-size);
|
|
512
563
|
|
|
513
564
|
align-items: center;
|
|
@@ -517,16 +568,16 @@
|
|
|
517
568
|
transition: opacity var(--slotted-duration-short) var(--slotted-easing-standard);
|
|
518
569
|
}
|
|
519
570
|
|
|
520
|
-
[data-ui
|
|
571
|
+
[data-ui-listbox] [data-part-option][data-selected] > [data-part-indicator] {
|
|
521
572
|
opacity: 1;
|
|
522
573
|
}
|
|
523
574
|
|
|
524
575
|
/**
|
|
525
576
|
* The option's own artwork, in the mark column. The box holds content and
|
|
526
577
|
* paints none: a `Glyph` in an `Icon` box, or an element of the consumer's
|
|
527
|
-
* own,
|
|
578
|
+
* own, centerd and sized from the column, as the tick is.
|
|
528
579
|
*/
|
|
529
|
-
[data-ui
|
|
580
|
+
[data-ui-listbox] [data-part-icon] {
|
|
530
581
|
--slotted-icon-size: var(--_icon-size);
|
|
531
582
|
|
|
532
583
|
align-items: center;
|
|
@@ -535,14 +586,14 @@
|
|
|
535
586
|
}
|
|
536
587
|
|
|
537
588
|
/* Column two, and the only column that gives way. */
|
|
538
|
-
[data-ui
|
|
589
|
+
[data-ui-listbox] [data-part-label] {
|
|
539
590
|
grid-column: 2;
|
|
540
591
|
grid-row: 1;
|
|
541
592
|
min-inline-size: 0;
|
|
542
593
|
overflow-wrap: anywhere;
|
|
543
594
|
}
|
|
544
595
|
|
|
545
|
-
[data-ui
|
|
596
|
+
[data-ui-listbox] [data-part-description] {
|
|
546
597
|
color: var(--_muted);
|
|
547
598
|
font-size: var(--_secondary-font-size);
|
|
548
599
|
grid-column: 2;
|
|
@@ -552,9 +603,9 @@
|
|
|
552
603
|
overflow-wrap: anywhere;
|
|
553
604
|
}
|
|
554
605
|
|
|
555
|
-
[data-ui
|
|
556
|
-
[data-part
|
|
557
|
-
> [data-part
|
|
606
|
+
[data-ui-listbox]
|
|
607
|
+
[data-part-option]:is([data-disabled], [data-selected])
|
|
608
|
+
> [data-part-description] {
|
|
558
609
|
color: inherit;
|
|
559
610
|
}
|
|
560
611
|
|
|
@@ -565,7 +616,7 @@
|
|
|
565
616
|
* library. Never narrower than its own content, so a long label wraps in
|
|
566
617
|
* column two rather than pushing the value off the surface.
|
|
567
618
|
*/
|
|
568
|
-
[data-ui
|
|
619
|
+
[data-ui-listbox] [data-part-meta] {
|
|
569
620
|
color: var(--_muted);
|
|
570
621
|
font-variant-numeric: tabular-nums;
|
|
571
622
|
grid-column: 3;
|
|
@@ -575,9 +626,7 @@
|
|
|
575
626
|
white-space: nowrap;
|
|
576
627
|
}
|
|
577
628
|
|
|
578
|
-
[data-ui
|
|
579
|
-
[data-part='option']:is([data-disabled], [data-selected])
|
|
580
|
-
> [data-part='meta'] {
|
|
629
|
+
[data-ui-listbox] [data-part-option]:is([data-disabled], [data-selected]) > [data-part-meta] {
|
|
581
630
|
color: inherit;
|
|
582
631
|
}
|
|
583
632
|
|
|
@@ -589,7 +638,7 @@
|
|
|
589
638
|
* all. The message lives inside the listbox: outside it the reader hears
|
|
590
639
|
* "listbox, 0 items" and then nothing.
|
|
591
640
|
*/
|
|
592
|
-
[data-ui
|
|
641
|
+
[data-ui-listbox] :is([data-part-empty], [data-part-loader]) {
|
|
593
642
|
align-content: center;
|
|
594
643
|
color: var(--_muted);
|
|
595
644
|
display: grid;
|
|
@@ -605,7 +654,7 @@
|
|
|
605
654
|
* role — a listbox owns nothing else — so it carries the same geometry and
|
|
606
655
|
* says what it is with a pulse rather than with a second element.
|
|
607
656
|
*/
|
|
608
|
-
[data-ui
|
|
657
|
+
[data-ui-listbox] [data-part-loader] {
|
|
609
658
|
animation: slotted-listbox-loader var(--slotted-duration-loop) ease-in-out infinite;
|
|
610
659
|
}
|
|
611
660
|
|
|
@@ -626,44 +675,44 @@
|
|
|
626
675
|
* the rest of the motion scale.
|
|
627
676
|
*/
|
|
628
677
|
@media (prefers-reduced-motion: reduce) {
|
|
629
|
-
[data-ui
|
|
678
|
+
[data-ui-listbox] [data-part-loader] {
|
|
630
679
|
animation: none;
|
|
631
680
|
opacity: 0.7;
|
|
632
681
|
}
|
|
633
682
|
}
|
|
634
683
|
|
|
635
|
-
/* ── Forced
|
|
684
|
+
/* ── Forced colors ───────────────────────────────────────────────────── */
|
|
636
685
|
|
|
637
686
|
/**
|
|
638
687
|
* The two things the theme cannot reach. Every tone surface becomes `Canvas`
|
|
639
|
-
* under forced
|
|
688
|
+
* under forced colors, so both the selection and the highlight — which are
|
|
640
689
|
* this family's whole state vocabulary, not decoration — would disappear and
|
|
641
690
|
* leave a reader unable to tell what they have chosen from what they are on.
|
|
642
691
|
*/
|
|
643
692
|
@media (forced-colors: active) {
|
|
644
|
-
[data-ui
|
|
693
|
+
[data-ui-listbox] [data-part-option][data-selected] {
|
|
645
694
|
background-color: Highlight;
|
|
646
695
|
color: HighlightText;
|
|
647
696
|
forced-color-adjust: none;
|
|
648
697
|
}
|
|
649
698
|
|
|
650
|
-
[data-ui
|
|
699
|
+
[data-ui-listbox] [data-part-option][data-disabled] {
|
|
651
700
|
color: GrayText;
|
|
652
701
|
}
|
|
653
702
|
}
|
|
654
703
|
|
|
655
704
|
/*
|
|
656
|
-
* Forced
|
|
705
|
+
* Forced colors remove every box shadow, and the edge with them. The width
|
|
657
706
|
* comes back as an outline inside the border, and where focus draws the ring
|
|
658
707
|
* on the same box an invalid ring is double, which a valid one is not.
|
|
659
708
|
*/
|
|
660
709
|
@media (forced-colors: active) {
|
|
661
|
-
[data-ui
|
|
710
|
+
[data-ui-listbox][data-variant='framed'][data-invalid]:not([data-disabled]) {
|
|
662
711
|
outline: var(--_invalid-edge-width) solid CanvasText;
|
|
663
712
|
outline-offset: calc(-1 * (var(--_border-width) + var(--_invalid-edge-width)));
|
|
664
713
|
}
|
|
665
714
|
|
|
666
|
-
[data-ui
|
|
715
|
+
[data-ui-listbox][data-variant='framed'][data-invalid]:not(
|
|
667
716
|
[data-disabled]
|
|
668
717
|
)[data-focus-mode='activedescendant']:focus-visible {
|
|
669
718
|
outline: calc(var(--slotted-focus-ring-width, 2px) + var(--_invalid-edge-width)) double
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"--slotted-control-padding-inline-lg",
|
|
19
19
|
"--slotted-control-padding-inline-md",
|
|
20
20
|
"--slotted-control-padding-inline-sm",
|
|
21
|
-
"--slotted-control-radius",
|
|
22
21
|
"--slotted-control-shadow",
|
|
23
22
|
"--slotted-control-transition-duration",
|
|
24
23
|
"--slotted-control-transition-easing",
|
|
@@ -43,11 +42,17 @@
|
|
|
43
42
|
"--slotted-listbox-highlight",
|
|
44
43
|
"--slotted-listbox-highlight-active",
|
|
45
44
|
"--slotted-listbox-measure",
|
|
45
|
+
"--slotted-listbox-option-border-color",
|
|
46
|
+
"--slotted-listbox-option-border-width",
|
|
47
|
+
"--slotted-listbox-option-gap",
|
|
48
|
+
"--slotted-listbox-option-padding-block",
|
|
49
|
+
"--slotted-listbox-option-padding-inline",
|
|
46
50
|
"--slotted-listbox-option-radius",
|
|
47
51
|
"--slotted-listbox-padding-block",
|
|
48
52
|
"--slotted-listbox-padding-inline",
|
|
49
53
|
"--slotted-listbox-radius",
|
|
50
54
|
"--slotted-listbox-rows",
|
|
55
|
+
"--slotted-listbox-selected-border-color",
|
|
51
56
|
"--slotted-listbox-selected-surface",
|
|
52
57
|
"--slotted-listbox-selected-text",
|
|
53
58
|
"--slotted-listbox-shadow",
|