@slotted/styles 0.1.0-beta.2 → 0.1.0-beta.21
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 +1 -1
- package/src/accordion/accordion.css +10 -10
- package/src/action-bar/action-bar.css +45 -42
- package/src/action-bar/action-bar.tokens.json +1 -0
- package/src/action-sheet/action-sheet.css +36 -36
- package/src/alert/alert.css +68 -67
- package/src/alert/alert.tokens.json +5 -0
- package/src/app-shell/app-shell.css +452 -314
- package/src/app-shell/app-shell.tokens.json +5 -2
- package/src/aspect-ratio/aspect-ratio.css +9 -9
- package/src/attachment/attachment.css +91 -99
- package/src/avatar/avatar.css +71 -41
- package/src/avatar/avatar.tokens.json +7 -0
- package/src/avatar-group/avatar-group.css +21 -22
- package/src/badge/badge.css +45 -37
- package/src/badge/badge.tokens.json +5 -0
- package/src/breadcrumb/breadcrumb.css +37 -37
- package/src/button/button.css +149 -68
- package/src/button/button.tokens.json +10 -0
- package/src/button-group/button-group.css +79 -74
- package/src/button-group/button-group.tokens.json +2 -0
- package/src/calendar/calendar.css +133 -103
- package/src/calendar/calendar.tokens.json +5 -1
- package/src/card/card.css +54 -61
- package/src/carousel/carousel.css +150 -161
- package/src/cascader/cascader.css +154 -153
- package/src/cascader/cascader.tokens.json +1 -0
- package/src/chart/chart.css +258 -248
- package/src/chart/chart.tokens.json +1 -0
- package/src/checkbox/checkbox.css +119 -124
- package/src/checkbox-group/checkbox-group.css +7 -7
- package/src/code-block/code-block.css +81 -85
- package/src/collapsible/collapsible.css +72 -76
- package/src/color-picker/color-picker.css +83 -91
- package/src/column-manager/column-manager.css +106 -114
- package/src/combobox/combobox.css +157 -124
- package/src/combobox/combobox.tokens.json +2 -0
- package/src/command-palette/command-palette.css +103 -90
- package/src/command-palette/command-palette.tokens.json +1 -0
- package/src/container/container.css +24 -24
- package/src/context-menu/context-menu.css +8 -8
- package/src/currency-field/currency-field.css +212 -88
- package/src/currency-field/currency-field.tokens.json +13 -0
- package/src/dashboard-grid/dashboard-grid.css +184 -114
- package/src/data-grid/data-grid.css +535 -470
- package/src/data-grid/data-grid.tokens.json +4 -0
- package/src/data-list/data-list.css +81 -70
- package/src/data-list/data-list.tokens.json +2 -1
- package/src/date-field/date-field.css +57 -52
- package/src/date-field/date-field.tokens.json +1 -0
- package/src/date-picker/date-picker.css +75 -57
- package/src/date-picker/date-picker.tokens.json +1 -0
- package/src/date-range-picker/date-range-picker.css +116 -118
- package/src/datetime-field/datetime-field.css +80 -80
- package/src/datetime-field/datetime-field.tokens.json +1 -0
- package/src/datetime-picker/datetime-picker.css +63 -63
- package/src/datetime-range-picker/datetime-range-picker.css +151 -156
- package/src/description-list/description-list.css +80 -65
- package/src/detail-panel/detail-panel.css +86 -71
- package/src/detail-panel/detail-panel.tokens.json +2 -0
- package/src/dialog/dialog.css +376 -153
- package/src/dialog/dialog.tokens.json +6 -0
- package/src/divider/divider.css +18 -18
- package/src/drawer/drawer.css +513 -217
- package/src/drawer/drawer.tokens.json +6 -0
- package/src/entity-picker/entity-picker.css +273 -256
- package/src/entity-picker/entity-picker.tokens.json +2 -0
- package/src/event-calendar/event-calendar.css +343 -385
- package/src/field/field.css +74 -78
- package/src/field-group/field-group.css +22 -25
- package/src/filter-bar/filter-bar.css +193 -209
- package/src/form/form.css +34 -24
- package/src/form/form.tokens.json +1 -0
- package/src/fullscreen/fullscreen.css +24 -25
- package/src/grid/grid.css +28 -28
- package/src/highlight/highlight.css +6 -6
- package/src/hover-card/hover-card.css +6 -6
- package/src/icon/icon.css +62 -15
- package/src/icon/icon.tokens.json +1 -0
- package/src/image/image.css +39 -39
- package/src/import-export-center/import-export-center.css +135 -156
- package/src/inline/inline.css +27 -27
- package/src/inline-message/inline-message.css +153 -77
- package/src/inline-message/inline-message.tokens.json +4 -0
- package/src/kbd/kbd.css +48 -36
- package/src/kbd/kbd.tokens.json +3 -0
- package/src/link/link.css +36 -15
- package/src/link/link.tokens.json +4 -0
- package/src/list/list.css +44 -17
- package/src/list/list.tokens.json +4 -0
- package/src/list-item/list-item.css +80 -66
- package/src/list-item/list-item.tokens.json +7 -0
- package/src/listbox/listbox.css +56 -59
- package/src/loading-overlay/loading-overlay.css +75 -92
- package/src/markdown/markdown.css +17 -17
- package/src/menu/menu.css +117 -74
- package/src/menu/menu.tokens.json +1 -0
- package/src/menubar/menubar.css +13 -13
- package/src/message/message.css +192 -202
- package/src/message/message.tokens.json +5 -0
- package/src/message-scroller/message-scroller.css +41 -42
- package/src/multi-select/multi-select.css +177 -160
- package/src/multi-select/multi-select.tokens.json +1 -0
- package/src/navigation-menu/navigation-menu.css +167 -188
- package/src/notification-center/notification-center.css +140 -148
- package/src/notification-center/notification-center.tokens.json +3 -0
- package/src/number-field/number-field.css +83 -83
- package/src/number-field/number-field.tokens.json +1 -0
- package/src/otp-input/otp-input.css +67 -57
- package/src/otp-input/otp-input.tokens.json +1 -0
- package/src/page/page.css +39 -23
- package/src/page/page.tokens.json +1 -0
- package/src/page-header/page-header.css +339 -284
- package/src/page-header/page-header.tokens.json +5 -0
- package/src/pagination/pagination.css +68 -72
- package/src/popover/popover.css +73 -61
- package/src/popover/popover.tokens.json +1 -0
- package/src/progress-indicator/progress-indicator.css +169 -113
- package/src/progress-indicator/progress-indicator.tokens.json +1 -0
- package/src/prompt-composer/prompt-composer.css +251 -104
- package/src/prompt-composer/prompt-composer.tokens.json +15 -0
- package/src/prose/prose.css +71 -75
- package/src/radio-group/radio-group.css +98 -103
- package/src/rating/rating.css +136 -132
- package/src/rating/rating.tokens.json +1 -0
- package/src/result-state/result-state.css +74 -77
- package/src/runtime-properties.mjs +2 -0
- package/src/saved-views/saved-views.css +41 -47
- package/src/scroll-area/scroll-area.css +39 -32
- package/src/section/section.css +178 -43
- package/src/section/section.tokens.json +8 -2
- package/src/segmented-control/segmented-control.css +254 -97
- package/src/segmented-control/segmented-control.tokens.json +15 -11
- package/src/select/select.css +153 -132
- package/src/select/select.tokens.json +2 -0
- package/src/side-navigation/side-navigation.css +179 -182
- package/src/side-navigation/side-navigation.tokens.json +1 -0
- package/src/skeleton/skeleton.css +47 -48
- package/src/slider/slider.css +86 -88
- package/src/sparkline/sparkline.css +62 -40
- 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 +30 -31
- package/src/split-button/split-button.tokens.json +1 -0
- package/src/splitter/splitter.css +35 -35
- package/src/stack/stack.css +24 -24
- package/src/stat-card/stat-card.css +380 -241
- package/src/stat-card/stat-card.tokens.json +5 -0
- package/src/status-indicator/status-indicator.css +107 -82
- package/src/status-indicator/status-indicator.tokens.json +0 -3
- package/src/stepper/stepper.css +58 -62
- package/src/switch/switch.css +86 -92
- package/src/table/table.css +340 -175
- package/src/table/table.tokens.json +6 -0
- package/src/table-of-contents/table-of-contents.css +57 -56
- package/src/table-of-contents/table-of-contents.tokens.json +1 -0
- package/src/tabs/tabs.css +322 -289
- package/src/tabs/tabs.tokens.json +7 -1
- package/src/tag/tag.css +91 -71
- package/src/tag/tag.tokens.json +9 -0
- package/src/tags-input/tags-input.css +147 -82
- package/src/tags-input/tags-input.tokens.json +7 -1
- package/src/text-field/text-field.css +134 -136
- package/src/text-field/text-field.tokens.json +1 -0
- package/src/textarea/textarea.css +33 -28
- package/src/textarea/textarea.tokens.json +1 -0
- package/src/time-field/time-field.css +74 -69
- package/src/time-field/time-field.tokens.json +1 -0
- package/src/time-picker/time-picker.css +58 -58
- package/src/time-range-picker/time-range-picker.css +128 -133
- package/src/timeline/timeline.css +254 -266
- package/src/timeline/timeline.tokens.json +5 -0
- package/src/toast/toast.css +115 -98
- package/src/toast/toast.tokens.json +6 -0
- package/src/toggle/toggle.css +62 -25
- package/src/toggle/toggle.tokens.json +8 -0
- package/src/toggle-group/toggle-group.css +106 -60
- package/src/toggle-group/toggle-group.tokens.json +10 -0
- package/src/toolbar/toolbar.css +30 -35
- package/src/tooltip/tooltip.css +59 -38
- package/src/tooltip/tooltip.tokens.json +1 -0
- package/src/top-navigation/top-navigation.css +243 -259
- package/src/tour/tour.css +51 -60
- package/src/transfer/transfer.css +160 -164
- package/src/tree/tree.css +103 -111
- package/src/typography/typography.css +40 -36
- package/src/typography/typography.tokens.json +1 -0
- package/src/upload/upload.css +224 -224
- package/src/visually-hidden/visually-hidden.css +1 -1
- package/src/wizard/wizard.css +185 -197
package/src/menu/menu.css
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
* menu holds more commands and is the same component; only the surface's own
|
|
54
54
|
* inset and radius come off the space and radius scales, as `popover`'s do.
|
|
55
55
|
*/
|
|
56
|
-
[data-ui
|
|
56
|
+
[data-ui-menu] {
|
|
57
57
|
--_gap: var(--slotted-menu-gap, var(--slotted-space-2, 0.25rem));
|
|
58
58
|
|
|
59
59
|
--_surface: var(--slotted-menu-surface, var(--slotted-surface-raised, #ffffff));
|
|
@@ -162,7 +162,6 @@
|
|
|
162
162
|
pointer, and the frame must not swallow a press meant for the page. */
|
|
163
163
|
pointer-events: none;
|
|
164
164
|
|
|
165
|
-
opacity: 0;
|
|
166
165
|
/**
|
|
167
166
|
* R7: the layer arrives along the axis it opens on — from one space step
|
|
168
167
|
* above its place when it opens downward, from one step below when it
|
|
@@ -172,26 +171,24 @@
|
|
|
172
171
|
*/
|
|
173
172
|
--_enter-distance: var(--slotted-space-2, 0.25rem);
|
|
174
173
|
translate: 0 calc(-1 * var(--_enter-distance));
|
|
175
|
-
transition:
|
|
176
|
-
opacity var(--slotted-duration-short) var(--slotted-easing-exit),
|
|
177
|
-
translate var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
174
|
+
transition: translate var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
178
175
|
}
|
|
179
176
|
|
|
180
|
-
[data-ui
|
|
177
|
+
[data-ui-menu][data-side='top'] {
|
|
181
178
|
translate: 0 var(--_enter-distance);
|
|
182
179
|
}
|
|
183
180
|
|
|
184
181
|
/* A submenu, or a menu placed beside its anchor, arrives along the inline
|
|
185
182
|
axis it opens on: from one step inside the parent's edge (M1). */
|
|
186
|
-
[data-ui
|
|
183
|
+
[data-ui-menu][data-side='right'] {
|
|
187
184
|
translate: calc(-1 * var(--_enter-distance)) 0;
|
|
188
185
|
}
|
|
189
186
|
|
|
190
|
-
[data-ui
|
|
187
|
+
[data-ui-menu][data-side='left'] {
|
|
191
188
|
translate: var(--_enter-distance) 0;
|
|
192
189
|
}
|
|
193
190
|
|
|
194
|
-
[data-ui
|
|
191
|
+
[data-ui-menu]:is([data-side='left'], [data-side='right']) {
|
|
195
192
|
padding-block: 0;
|
|
196
193
|
padding-inline: var(--_gap);
|
|
197
194
|
}
|
|
@@ -205,8 +202,7 @@
|
|
|
205
202
|
* A keyframe states where it starts. The exit stays a transition: it
|
|
206
203
|
* leaves from wherever the layer is, on the closed rule's durations.
|
|
207
204
|
*/
|
|
208
|
-
[data-ui
|
|
209
|
-
opacity: 1;
|
|
205
|
+
[data-ui-menu][data-open] {
|
|
210
206
|
translate: 0 0;
|
|
211
207
|
transition: none;
|
|
212
208
|
}
|
|
@@ -216,46 +212,42 @@
|
|
|
216
212
|
* with the side, and a layer written open in static markup — the harness,
|
|
217
213
|
* a docs snippet — is simply there, and is photographed where it stands.
|
|
218
214
|
*/
|
|
219
|
-
[data-ui
|
|
215
|
+
[data-ui-menu][data-open][data-positioned] {
|
|
220
216
|
animation: slotted-menu-enter-down var(--slotted-duration-medium) var(--slotted-easing-enter);
|
|
221
217
|
}
|
|
222
218
|
|
|
223
|
-
[data-ui
|
|
219
|
+
[data-ui-menu][data-open][data-positioned][data-side='top'] {
|
|
224
220
|
animation-name: slotted-menu-enter-up;
|
|
225
221
|
}
|
|
226
222
|
|
|
227
|
-
[data-ui
|
|
223
|
+
[data-ui-menu][data-open][data-positioned][data-side='right'] {
|
|
228
224
|
animation-name: slotted-menu-enter-from-start;
|
|
229
225
|
}
|
|
230
226
|
|
|
231
|
-
[data-ui
|
|
227
|
+
[data-ui-menu][data-open][data-positioned][data-side='left'] {
|
|
232
228
|
animation-name: slotted-menu-enter-from-end;
|
|
233
229
|
}
|
|
234
230
|
|
|
235
231
|
@keyframes slotted-menu-enter-down {
|
|
236
232
|
from {
|
|
237
|
-
opacity: 0;
|
|
238
233
|
translate: 0 calc(-1 * var(--_enter-distance));
|
|
239
234
|
}
|
|
240
235
|
}
|
|
241
236
|
|
|
242
237
|
@keyframes slotted-menu-enter-up {
|
|
243
238
|
from {
|
|
244
|
-
opacity: 0;
|
|
245
239
|
translate: 0 var(--_enter-distance);
|
|
246
240
|
}
|
|
247
241
|
}
|
|
248
242
|
|
|
249
243
|
@keyframes slotted-menu-enter-from-start {
|
|
250
244
|
from {
|
|
251
|
-
opacity: 0;
|
|
252
245
|
translate: calc(-1 * var(--_enter-distance)) 0;
|
|
253
246
|
}
|
|
254
247
|
}
|
|
255
248
|
|
|
256
249
|
@keyframes slotted-menu-enter-from-end {
|
|
257
250
|
from {
|
|
258
|
-
opacity: 0;
|
|
259
251
|
translate: var(--_enter-distance) 0;
|
|
260
252
|
}
|
|
261
253
|
}
|
|
@@ -266,31 +258,74 @@
|
|
|
266
258
|
}
|
|
267
259
|
}
|
|
268
260
|
|
|
261
|
+
/**
|
|
262
|
+
* The fade belongs to the part that paints the surface, and the layer only
|
|
263
|
+
* moves. In Chromium an ancestor with `opacity` below one is the Backdrop Root
|
|
264
|
+
* of what it holds, so a `backdrop-filter` on the content blurs nothing until
|
|
265
|
+
* the layer is opaque and then appears at once. The content's own opacity
|
|
266
|
+
* leaves its own filter drawn on every frame of the motion.
|
|
267
|
+
*/
|
|
268
|
+
[data-ui-menu] > [data-part-content] {
|
|
269
|
+
opacity: 0;
|
|
270
|
+
transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
[data-ui-menu][data-open] > [data-part-content] {
|
|
274
|
+
opacity: 1;
|
|
275
|
+
transition: none;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
[data-ui-menu][data-open][data-positioned] > [data-part-content] {
|
|
279
|
+
animation: slotted-menu-fade var(--slotted-duration-medium) var(--slotted-easing-enter);
|
|
280
|
+
}
|
|
281
|
+
|
|
269
282
|
/* Stillness keeps the fade and drops the movement (R7). */
|
|
270
283
|
@media (prefers-reduced-motion: reduce) {
|
|
271
|
-
[data-ui
|
|
272
|
-
[data-ui
|
|
273
|
-
[data-ui
|
|
274
|
-
[data-ui
|
|
284
|
+
[data-ui-menu],
|
|
285
|
+
[data-ui-menu][data-side='top'],
|
|
286
|
+
[data-ui-menu][data-side='left'],
|
|
287
|
+
[data-ui-menu][data-side='right'] {
|
|
275
288
|
translate: 0 0;
|
|
276
|
-
transition:
|
|
289
|
+
transition: translate var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
277
290
|
}
|
|
278
291
|
|
|
279
|
-
[data-ui
|
|
280
|
-
[data-ui
|
|
281
|
-
[data-ui
|
|
282
|
-
[data-ui
|
|
283
|
-
animation-name:
|
|
292
|
+
[data-ui-menu][data-open][data-positioned],
|
|
293
|
+
[data-ui-menu][data-open][data-positioned][data-side='top'],
|
|
294
|
+
[data-ui-menu][data-open][data-positioned][data-side='left'],
|
|
295
|
+
[data-ui-menu][data-open][data-positioned][data-side='right'] {
|
|
296
|
+
animation-name: none;
|
|
284
297
|
}
|
|
285
298
|
}
|
|
286
299
|
|
|
287
300
|
/* The anchor scrolled out of its own clipper. The menu is still open and its
|
|
288
301
|
commands still belong to a control the reader can no longer see. */
|
|
289
|
-
[data-ui
|
|
302
|
+
[data-ui-menu][data-detached] {
|
|
290
303
|
visibility: hidden;
|
|
291
304
|
}
|
|
292
305
|
|
|
293
|
-
|
|
306
|
+
/**
|
|
307
|
+
* The surface as wide as its trigger: an account switcher at the foot of a
|
|
308
|
+
* sidebar, opened from a row the column's full width. The content takes the
|
|
309
|
+
* anchor's width as its size and its floor, as `popover`'s `width="anchor"`
|
|
310
|
+
* does, and the room the positioner reports caps both. The layer drops the
|
|
311
|
+
* family's floor and cap, which would hold it narrower or wider than the
|
|
312
|
+
* row. Opened above or below, the layer has no inline padding, so the
|
|
313
|
+
* content and the trigger share both edges.
|
|
314
|
+
*/
|
|
315
|
+
[data-ui-menu][data-width='anchor'] {
|
|
316
|
+
max-inline-size: var(--slotted-positioner-available-width, 100vw);
|
|
317
|
+
min-inline-size: 0;
|
|
318
|
+
}
|
|
319
|
+
[data-ui-menu][data-width='anchor'] > [data-part-content] {
|
|
320
|
+
inline-size: var(--slotted-positioner-anchor-width, auto);
|
|
321
|
+
max-inline-size: var(--slotted-positioner-available-width, 100vw);
|
|
322
|
+
min-inline-size: min(
|
|
323
|
+
var(--slotted-positioner-anchor-width, 0px),
|
|
324
|
+
var(--slotted-positioner-available-width, 100vw)
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
[data-ui-menu][data-size='sm'] {
|
|
294
329
|
--_item-padding: var(--slotted-control-padding-inline-sm, 0.625rem);
|
|
295
330
|
--_item-height: var(--slotted-control-height-sm, 30px);
|
|
296
331
|
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
@@ -300,7 +335,7 @@
|
|
|
300
335
|
--_measure: var(--slotted-menu-measure-sm, 14rem);
|
|
301
336
|
}
|
|
302
337
|
|
|
303
|
-
[data-ui
|
|
338
|
+
[data-ui-menu][data-size='lg'] {
|
|
304
339
|
--_item-padding: var(--slotted-control-padding-inline-lg, 1rem);
|
|
305
340
|
--_item-height: var(--slotted-control-height-lg, 38px);
|
|
306
341
|
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
@@ -319,7 +354,7 @@
|
|
|
319
354
|
* off the bottom of the screen. `overscroll-behavior` keeps the page still
|
|
320
355
|
* once the surface has scrolled to its end.
|
|
321
356
|
*/
|
|
322
|
-
[data-ui
|
|
357
|
+
[data-ui-menu] > [data-part-content] {
|
|
323
358
|
background: var(--_surface);
|
|
324
359
|
border: var(--_border-width) solid var(--_border-color);
|
|
325
360
|
border-radius: var(--_radius);
|
|
@@ -337,6 +372,16 @@
|
|
|
337
372
|
padding-block: var(--_inset-block);
|
|
338
373
|
padding-inline: var(--_inset-inline);
|
|
339
374
|
pointer-events: auto;
|
|
375
|
+
/* A theme that paints this surface as a translucent material blurs what moves behind it. */
|
|
376
|
+
-webkit-backdrop-filter: var(--slotted-menu-backdrop-filter, none);
|
|
377
|
+
backdrop-filter: var(--slotted-menu-backdrop-filter, none);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
|
|
381
|
+
[data-ui-menu] > [data-part-content] {
|
|
382
|
+
-webkit-backdrop-filter: none;
|
|
383
|
+
backdrop-filter: none;
|
|
384
|
+
}
|
|
340
385
|
}
|
|
341
386
|
|
|
342
387
|
/**
|
|
@@ -344,7 +389,7 @@
|
|
|
344
389
|
* the moment the menu opens, and a ring around the whole surface would say
|
|
345
390
|
* the surface is the thing being operated.
|
|
346
391
|
*/
|
|
347
|
-
[data-ui
|
|
392
|
+
[data-ui-menu] > [data-part-content]:focus-visible {
|
|
348
393
|
outline: none;
|
|
349
394
|
}
|
|
350
395
|
|
|
@@ -356,13 +401,13 @@
|
|
|
356
401
|
* second set. Without the subgrid a group would align its own labels and
|
|
357
402
|
* disagree with the items outside it.
|
|
358
403
|
*/
|
|
359
|
-
[data-ui
|
|
404
|
+
[data-ui-menu] [data-part-group] {
|
|
360
405
|
display: grid;
|
|
361
406
|
grid-column: 1 / -1;
|
|
362
407
|
grid-template-columns: subgrid;
|
|
363
408
|
}
|
|
364
409
|
|
|
365
|
-
[data-ui
|
|
410
|
+
[data-ui-menu] [data-part-group-label] {
|
|
366
411
|
color: var(--_muted);
|
|
367
412
|
font-size: var(--_secondary-font-size);
|
|
368
413
|
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
@@ -382,7 +427,7 @@
|
|
|
382
427
|
* lines; the name and its line reuse `label` and `description`. It starts
|
|
383
428
|
* at the item inset, so the avatar's edge is the icons' edge.
|
|
384
429
|
*/
|
|
385
|
-
[data-ui
|
|
430
|
+
[data-ui-menu] [data-part-header] {
|
|
386
431
|
align-items: center;
|
|
387
432
|
column-gap: var(--slotted-space-5, 0.75rem);
|
|
388
433
|
display: grid;
|
|
@@ -393,12 +438,12 @@
|
|
|
393
438
|
padding-inline: var(--_item-inset);
|
|
394
439
|
}
|
|
395
440
|
|
|
396
|
-
[data-ui
|
|
441
|
+
[data-ui-menu] [data-part-header] > :not([data-part-label], [data-part-description]) {
|
|
397
442
|
grid-column: 1;
|
|
398
443
|
grid-row: 1 / span 2;
|
|
399
444
|
}
|
|
400
445
|
|
|
401
|
-
[data-ui
|
|
446
|
+
[data-ui-menu] [data-part-header] > [data-part-label] {
|
|
402
447
|
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
403
448
|
}
|
|
404
449
|
|
|
@@ -420,7 +465,7 @@
|
|
|
420
465
|
* `select` used to take the hand for its options holds here unchanged. An
|
|
421
466
|
* unavailable item keeps the hand and refuses the press, as `button` does.
|
|
422
467
|
*/
|
|
423
|
-
[data-ui
|
|
468
|
+
[data-ui-menu] [data-part-item] {
|
|
424
469
|
appearance: none;
|
|
425
470
|
background: transparent;
|
|
426
471
|
border: 0;
|
|
@@ -466,7 +511,7 @@
|
|
|
466
511
|
* `data-highlighted` exists to prevent in Radix and Ark; here the platform
|
|
467
512
|
* prevents it, because there is only ever one focused element.
|
|
468
513
|
*/
|
|
469
|
-
[data-ui
|
|
514
|
+
[data-ui-menu] [data-part-item]:focus {
|
|
470
515
|
background-color: var(--_highlight);
|
|
471
516
|
color: var(--_accent);
|
|
472
517
|
}
|
|
@@ -477,13 +522,13 @@
|
|
|
477
522
|
* reader did not ask for. Inset, so it never overflows the surface's own
|
|
478
523
|
* rounded edge.
|
|
479
524
|
*/
|
|
480
|
-
[data-ui
|
|
525
|
+
[data-ui-menu] [data-part-item]:focus-visible {
|
|
481
526
|
outline: var(--slotted-focus-ring-width, 2px) solid
|
|
482
527
|
var(--slotted-focus-ring-color, currentColor);
|
|
483
528
|
outline-offset: calc(-1 * var(--slotted-focus-ring-width, 2px));
|
|
484
529
|
}
|
|
485
530
|
|
|
486
|
-
[data-ui
|
|
531
|
+
[data-ui-menu] [data-part-item]:not([data-disabled]):active {
|
|
487
532
|
background-color: var(--_highlight-active);
|
|
488
533
|
}
|
|
489
534
|
|
|
@@ -491,7 +536,7 @@
|
|
|
491
536
|
* A parent item stays highlighted while its submenu is open, so the path from
|
|
492
537
|
* the bar to the surface under the pointer reads as one line.
|
|
493
538
|
*/
|
|
494
|
-
[data-ui
|
|
539
|
+
[data-ui-menu] [data-part-item][data-open] {
|
|
495
540
|
background-color: var(--_highlight);
|
|
496
541
|
}
|
|
497
542
|
|
|
@@ -505,12 +550,12 @@
|
|
|
505
550
|
* against the dark surface and 0 against the high-contrast one: the pointer
|
|
506
551
|
* landed on an item and nothing answered.
|
|
507
552
|
*/
|
|
508
|
-
[data-ui
|
|
553
|
+
[data-ui-menu] [data-part-item][data-disabled] {
|
|
509
554
|
color: var(--slotted-disabled-foreground, #64748b);
|
|
510
555
|
cursor: not-allowed;
|
|
511
556
|
}
|
|
512
557
|
|
|
513
|
-
[data-ui
|
|
558
|
+
[data-ui-menu] [data-part-item][data-disabled]:focus {
|
|
514
559
|
background-color: var(--_highlight);
|
|
515
560
|
color: var(--slotted-disabled-foreground, #64748b);
|
|
516
561
|
}
|
|
@@ -522,8 +567,8 @@
|
|
|
522
567
|
* labels up: the mark's box exists whether or not the mark is drawn, so a
|
|
523
568
|
* menu of options does not shift by sixteen pixels as one is checked.
|
|
524
569
|
*/
|
|
525
|
-
[data-ui
|
|
526
|
-
[data-ui
|
|
570
|
+
[data-ui-menu] :is([data-part-indicator], [data-part-icon]),
|
|
571
|
+
[data-ui-menu] [data-part-item][aria-haspopup='menu'] > [data-ui-icon] {
|
|
527
572
|
/**
|
|
528
573
|
* One line box tall, so a mark beside a label that wrapped onto three
|
|
529
574
|
* lines sits on the first of them rather than in the middle of the item —
|
|
@@ -540,7 +585,7 @@
|
|
|
540
585
|
* a checkbox item, `dot` for a radio item — and it is shown while the item
|
|
541
586
|
* is checked.
|
|
542
587
|
*/
|
|
543
|
-
[data-ui
|
|
588
|
+
[data-ui-menu] [data-part-indicator] {
|
|
544
589
|
--slotted-icon-size: var(--_icon-size);
|
|
545
590
|
|
|
546
591
|
align-items: center;
|
|
@@ -564,7 +609,7 @@
|
|
|
564
609
|
scale var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
565
610
|
}
|
|
566
611
|
|
|
567
|
-
[data-ui
|
|
612
|
+
[data-ui-menu] [data-part-item][data-checked] > [data-part-indicator] {
|
|
568
613
|
opacity: 1;
|
|
569
614
|
scale: 1;
|
|
570
615
|
transition:
|
|
@@ -573,7 +618,7 @@
|
|
|
573
618
|
}
|
|
574
619
|
|
|
575
620
|
/* The dot is drawn smaller than the check, at seven tenths of the column's glyph. */
|
|
576
|
-
[data-ui
|
|
621
|
+
[data-ui-menu] [data-part-item][role='menuitemradio'] > [data-part-indicator] {
|
|
577
622
|
--slotted-icon-size: calc(var(--_icon-size) * 0.7);
|
|
578
623
|
}
|
|
579
624
|
|
|
@@ -600,7 +645,7 @@
|
|
|
600
645
|
* the child and not on the box, because the box's `1lh` reads the item's
|
|
601
646
|
* line box.
|
|
602
647
|
*/
|
|
603
|
-
[data-ui
|
|
648
|
+
[data-ui-menu] [data-part-icon] {
|
|
604
649
|
--slotted-icon-size: var(--_icon-size);
|
|
605
650
|
|
|
606
651
|
align-items: center;
|
|
@@ -613,19 +658,19 @@
|
|
|
613
658
|
margin-inline-end: var(--_column-gap);
|
|
614
659
|
}
|
|
615
660
|
|
|
616
|
-
[data-ui
|
|
661
|
+
[data-ui-menu] [data-part-icon] > * {
|
|
617
662
|
font-size: var(--_icon-size);
|
|
618
663
|
}
|
|
619
664
|
|
|
620
665
|
/* Column two, and the only column that gives way. */
|
|
621
|
-
[data-ui
|
|
666
|
+
[data-ui-menu] [data-part-label] {
|
|
622
667
|
grid-column: 2;
|
|
623
668
|
grid-row: 1;
|
|
624
669
|
min-inline-size: 0;
|
|
625
670
|
overflow-wrap: anywhere;
|
|
626
671
|
}
|
|
627
672
|
|
|
628
|
-
[data-ui
|
|
673
|
+
[data-ui-menu] [data-part-description] {
|
|
629
674
|
color: var(--_muted);
|
|
630
675
|
font-size: var(--_secondary-font-size);
|
|
631
676
|
grid-column: 2;
|
|
@@ -635,7 +680,7 @@
|
|
|
635
680
|
overflow-wrap: anywhere;
|
|
636
681
|
}
|
|
637
682
|
|
|
638
|
-
[data-ui
|
|
683
|
+
[data-ui-menu] [data-part-item][data-disabled] > [data-part-description] {
|
|
639
684
|
color: inherit;
|
|
640
685
|
}
|
|
641
686
|
|
|
@@ -647,7 +692,7 @@
|
|
|
647
692
|
* column, so counts stack on their last digit and a word ends where the
|
|
648
693
|
* numbers end; tabular figures, muted like the shortcut, never wrapped.
|
|
649
694
|
*/
|
|
650
|
-
[data-ui
|
|
695
|
+
[data-ui-menu] [data-part-meta] {
|
|
651
696
|
align-items: center;
|
|
652
697
|
color: var(--_muted);
|
|
653
698
|
column-gap: var(--slotted-space-2, 0.25rem);
|
|
@@ -667,7 +712,7 @@
|
|
|
667
712
|
* alone. Never narrower than its own content: a long label wraps in column
|
|
668
713
|
* two rather than pushing the binding off the surface.
|
|
669
714
|
*/
|
|
670
|
-
[data-ui
|
|
715
|
+
[data-ui-menu] [data-part-shortcut] {
|
|
671
716
|
color: var(--_muted);
|
|
672
717
|
grid-column: 4;
|
|
673
718
|
grid-row: 1;
|
|
@@ -676,10 +721,8 @@
|
|
|
676
721
|
white-space: nowrap;
|
|
677
722
|
}
|
|
678
723
|
|
|
679
|
-
[data-ui
|
|
680
|
-
|
|
681
|
-
> :is([data-part='shortcut'], [data-part='meta']),
|
|
682
|
-
[data-ui='menu'] [data-part='item'][data-disabled][aria-haspopup='menu'] > [data-ui='icon'] {
|
|
724
|
+
[data-ui-menu] [data-part-item][data-disabled] > :is([data-part-shortcut], [data-part-meta]),
|
|
725
|
+
[data-ui-menu] [data-part-item][data-disabled][aria-haspopup='menu'] > [data-ui-icon] {
|
|
683
726
|
color: inherit;
|
|
684
727
|
}
|
|
685
728
|
|
|
@@ -690,7 +733,7 @@
|
|
|
690
733
|
* takes the shortcut's column, because an item that opens a submenu runs no
|
|
691
734
|
* command and so carries no binding.
|
|
692
735
|
*/
|
|
693
|
-
[data-ui
|
|
736
|
+
[data-ui-menu] [data-part-item][aria-haspopup='menu'] > [data-ui-icon] {
|
|
694
737
|
--slotted-icon-size: var(--_icon-size);
|
|
695
738
|
|
|
696
739
|
grid-column: 4;
|
|
@@ -707,7 +750,7 @@
|
|
|
707
750
|
|
|
708
751
|
/* ── Separator, empty, loading ────────────────────────────────────────── */
|
|
709
752
|
|
|
710
|
-
[data-ui
|
|
753
|
+
[data-ui-menu] [data-part-separator] {
|
|
711
754
|
background-color: var(--slotted-menu-separator-color, var(--_border-color));
|
|
712
755
|
block-size: var(--_border-width);
|
|
713
756
|
border: 0;
|
|
@@ -726,7 +769,7 @@
|
|
|
726
769
|
* stated here: a row that was wider than the menu around it made the menu
|
|
727
770
|
* grow when its list emptied (M3).
|
|
728
771
|
*/
|
|
729
|
-
[data-ui
|
|
772
|
+
[data-ui-menu] [data-part-empty] {
|
|
730
773
|
color: var(--_muted);
|
|
731
774
|
grid-column: 1 / -1;
|
|
732
775
|
padding-block: var(--slotted-space-5, 0.75rem);
|
|
@@ -734,7 +777,7 @@
|
|
|
734
777
|
text-align: center;
|
|
735
778
|
}
|
|
736
779
|
|
|
737
|
-
[data-ui
|
|
780
|
+
[data-ui-menu] > [data-part-content][data-loading] {
|
|
738
781
|
cursor: progress;
|
|
739
782
|
}
|
|
740
783
|
|
|
@@ -746,7 +789,7 @@
|
|
|
746
789
|
* the theme already carries at the contrast every scheme needs; `danger` is
|
|
747
790
|
* the one a product reaches for, and the other four cost one line each.
|
|
748
791
|
*/
|
|
749
|
-
[data-ui
|
|
792
|
+
[data-ui-menu] [data-part-item][data-tone='accent'] {
|
|
750
793
|
--_accent: var(--slotted-tone-accent-text);
|
|
751
794
|
--_highlight: var(--slotted-tone-accent-surface);
|
|
752
795
|
--_highlight-active: var(--slotted-tone-accent-subtle-active);
|
|
@@ -754,7 +797,7 @@
|
|
|
754
797
|
color: var(--slotted-tone-accent-text);
|
|
755
798
|
}
|
|
756
799
|
|
|
757
|
-
[data-ui
|
|
800
|
+
[data-ui-menu] [data-part-item][data-tone='secondary'] {
|
|
758
801
|
--_accent: var(--slotted-tone-secondary-text);
|
|
759
802
|
--_highlight: var(--slotted-tone-secondary-surface);
|
|
760
803
|
--_highlight-active: var(--slotted-tone-secondary-subtle-active);
|
|
@@ -762,7 +805,7 @@
|
|
|
762
805
|
color: var(--slotted-tone-secondary-text);
|
|
763
806
|
}
|
|
764
807
|
|
|
765
|
-
[data-ui
|
|
808
|
+
[data-ui-menu] [data-part-item][data-tone='success'] {
|
|
766
809
|
--_accent: var(--slotted-tone-success-text);
|
|
767
810
|
--_highlight: var(--slotted-tone-success-surface);
|
|
768
811
|
--_highlight-active: var(--slotted-tone-success-subtle-active);
|
|
@@ -770,7 +813,7 @@
|
|
|
770
813
|
color: var(--slotted-tone-success-text);
|
|
771
814
|
}
|
|
772
815
|
|
|
773
|
-
[data-ui
|
|
816
|
+
[data-ui-menu] [data-part-item][data-tone='warning'] {
|
|
774
817
|
--_accent: var(--slotted-tone-warning-text);
|
|
775
818
|
--_highlight: var(--slotted-tone-warning-surface);
|
|
776
819
|
--_highlight-active: var(--slotted-tone-warning-subtle-active);
|
|
@@ -778,7 +821,7 @@
|
|
|
778
821
|
color: var(--slotted-tone-warning-text);
|
|
779
822
|
}
|
|
780
823
|
|
|
781
|
-
[data-ui
|
|
824
|
+
[data-ui-menu] [data-part-item][data-tone='danger'] {
|
|
782
825
|
--_accent: var(--slotted-tone-danger-text);
|
|
783
826
|
--_highlight: var(--slotted-tone-danger-surface);
|
|
784
827
|
--_highlight-active: var(--slotted-tone-danger-subtle-active);
|
|
@@ -787,7 +830,7 @@
|
|
|
787
830
|
}
|
|
788
831
|
|
|
789
832
|
/* An unavailable item keeps no tone: its highlight is the neutral one. */
|
|
790
|
-
[data-ui
|
|
833
|
+
[data-ui-menu] [data-part-item][data-tone][data-disabled] {
|
|
791
834
|
--_accent: var(--slotted-disabled-foreground, #64748b);
|
|
792
835
|
--_highlight: var(--slotted-menu-highlight, var(--slotted-tone-secondary-subtle-hover));
|
|
793
836
|
|
|
@@ -803,13 +846,13 @@
|
|
|
803
846
|
* to tell which command they are on.
|
|
804
847
|
*/
|
|
805
848
|
@media (forced-colors: active) {
|
|
806
|
-
[data-ui
|
|
849
|
+
[data-ui-menu] [data-part-item]:focus {
|
|
807
850
|
background-color: Highlight;
|
|
808
851
|
color: HighlightText;
|
|
809
852
|
forced-color-adjust: none;
|
|
810
853
|
}
|
|
811
854
|
|
|
812
|
-
[data-ui
|
|
855
|
+
[data-ui-menu] [data-part-item][data-disabled]:focus {
|
|
813
856
|
background-color: Highlight;
|
|
814
857
|
color: GrayText;
|
|
815
858
|
}
|
package/src/menubar/menubar.css
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* force the header to match it. The weight is carried by the triggers, which
|
|
20
20
|
* is where a reader's pointer goes.
|
|
21
21
|
*/
|
|
22
|
-
[data-ui
|
|
22
|
+
[data-ui-menubar] {
|
|
23
23
|
--_gap: var(--slotted-menubar-gap, var(--slotted-space-1, 0.125rem));
|
|
24
24
|
|
|
25
25
|
--_text: var(--slotted-menubar-text, var(--slotted-text, #0f172a));
|
|
@@ -58,18 +58,18 @@
|
|
|
58
58
|
* key swap for it. The triggers stretch rather than centring, because a
|
|
59
59
|
* column of labels reads from one edge.
|
|
60
60
|
*/
|
|
61
|
-
[data-ui
|
|
61
|
+
[data-ui-menubar][data-orientation='vertical'] {
|
|
62
62
|
align-items: stretch;
|
|
63
63
|
flex-direction: column;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
[data-ui
|
|
66
|
+
[data-ui-menubar][data-size='sm'] {
|
|
67
67
|
--_trigger-height: var(--slotted-control-height-sm, 30px);
|
|
68
68
|
--_trigger-inset: var(--slotted-control-padding-inline-sm, 0.625rem);
|
|
69
69
|
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
[data-ui
|
|
72
|
+
[data-ui-menubar][data-size='lg'] {
|
|
73
73
|
--_trigger-height: var(--slotted-control-height-lg, 38px);
|
|
74
74
|
--_trigger-inset: var(--slotted-control-padding-inline-lg, 1rem);
|
|
75
75
|
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
* The trigger holds the consumer's own text and nothing the family imposes —
|
|
86
86
|
* no icon slot, no chevron, no shortcut. A menubar trigger is a word.
|
|
87
87
|
*/
|
|
88
|
-
[data-ui
|
|
88
|
+
[data-ui-menubar] > [data-part-trigger] {
|
|
89
89
|
appearance: none;
|
|
90
90
|
background: transparent;
|
|
91
91
|
border: 0;
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
white-space: nowrap;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
[data-ui
|
|
114
|
+
[data-ui-menubar][data-orientation='vertical'] > [data-part-trigger] {
|
|
115
115
|
text-align: start;
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -122,19 +122,19 @@
|
|
|
122
122
|
* highlight follows the pointer; once a menu is open, entering another
|
|
123
123
|
* trigger opens it and focus moves, so hover and focus agree again.
|
|
124
124
|
*/
|
|
125
|
-
[data-ui
|
|
125
|
+
[data-ui-menubar] > [data-part-trigger]:not([data-disabled]):hover {
|
|
126
126
|
background-color: var(--_highlight);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
[data-ui
|
|
129
|
+
[data-ui-menubar] > [data-part-trigger]:not([data-disabled]):active {
|
|
130
130
|
background-color: var(--_highlight-active);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
[data-ui
|
|
133
|
+
[data-ui-menubar] > [data-part-trigger][data-open] {
|
|
134
134
|
background-color: var(--_highlight-active);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
[data-ui
|
|
137
|
+
[data-ui-menubar] > [data-part-trigger]:focus-visible {
|
|
138
138
|
outline: var(--slotted-focus-ring-width, 2px) solid
|
|
139
139
|
var(--slotted-focus-ring-color, currentColor);
|
|
140
140
|
outline-offset: calc(-1 * var(--slotted-focus-ring-width, 2px));
|
|
@@ -145,11 +145,11 @@
|
|
|
145
145
|
* pattern asks of every item in a menubar. It answers focus quietly, as a
|
|
146
146
|
* disabled menu item does.
|
|
147
147
|
*/
|
|
148
|
-
[data-ui
|
|
148
|
+
[data-ui-menubar] > [data-part-trigger][data-disabled] {
|
|
149
149
|
color: var(--slotted-disabled-foreground, #64748b);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
[data-ui
|
|
152
|
+
[data-ui-menubar] > [data-part-trigger][data-disabled]:focus {
|
|
153
153
|
background-color: var(--slotted-disabled-background, #e2e8f0);
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
* bar that has to stay distinguishable from the other three.
|
|
162
162
|
*/
|
|
163
163
|
@media (forced-colors: active) {
|
|
164
|
-
[data-ui
|
|
164
|
+
[data-ui-menubar] > [data-part-trigger][data-open] {
|
|
165
165
|
background-color: Highlight;
|
|
166
166
|
color: HighlightText;
|
|
167
167
|
forced-color-adjust: none;
|