@slotted/styles 0.0.0-stage → 0.1.0-beta.1
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/LICENSE +21 -0
- package/README.md +10 -2
- package/package.json +276 -3
- package/src/accordion/accordion.css +96 -0
- package/src/accordion/accordion.tokens.json +14 -0
- package/src/action-bar/action-bar.css +455 -0
- package/src/action-bar/action-bar.tokens.json +50 -0
- package/src/action-sheet/action-sheet.css +462 -0
- package/src/action-sheet/action-sheet.tokens.json +59 -0
- package/src/alert/alert.css +764 -0
- package/src/alert/alert.tokens.json +77 -0
- package/src/app-shell/app-shell.css +1899 -0
- package/src/app-shell/app-shell.tokens.json +88 -0
- package/src/aspect-ratio/aspect-ratio.css +131 -0
- package/src/aspect-ratio/aspect-ratio.tokens.json +1 -0
- package/src/attachment/attachment.css +906 -0
- package/src/attachment/attachment.tokens.json +85 -0
- package/src/avatar/avatar.css +598 -0
- package/src/avatar/avatar.tokens.json +64 -0
- package/src/avatar-group/avatar-group.css +268 -0
- package/src/avatar-group/avatar-group.tokens.json +16 -0
- package/src/badge/badge.css +462 -0
- package/src/badge/badge.tokens.json +58 -0
- package/src/breadcrumb/breadcrumb.css +441 -0
- package/src/breadcrumb/breadcrumb.tokens.json +50 -0
- package/src/button/button.css +754 -0
- package/src/button/button.tokens.json +72 -0
- package/src/button-group/button-group.css +455 -0
- package/src/button-group/button-group.tokens.json +11 -0
- package/src/calendar/calendar.css +846 -0
- package/src/calendar/calendar.tokens.json +67 -0
- package/src/card/card.css +602 -0
- package/src/card/card.tokens.json +68 -0
- package/src/carousel/carousel.css +860 -0
- package/src/carousel/carousel.tokens.json +62 -0
- package/src/cascader/cascader.css +1320 -0
- package/src/cascader/cascader.tokens.json +103 -0
- package/src/chart/chart.css +1473 -0
- package/src/chart/chart.tokens.json +107 -0
- package/src/checkbox/checkbox.css +1011 -0
- package/src/checkbox/checkbox.tokens.json +102 -0
- package/src/checkbox-group/checkbox-group.css +70 -0
- package/src/checkbox-group/checkbox-group.tokens.json +6 -0
- package/src/code-block/code-block.css +555 -0
- package/src/code-block/code-block.tokens.json +69 -0
- package/src/collapsible/collapsible.css +546 -0
- package/src/collapsible/collapsible.tokens.json +55 -0
- package/src/color-picker/color-picker.css +607 -0
- package/src/color-picker/color-picker.tokens.json +58 -0
- package/src/column-manager/column-manager.css +452 -0
- package/src/column-manager/column-manager.tokens.json +43 -0
- package/src/combobox/combobox.css +1048 -0
- package/src/combobox/combobox.tokens.json +112 -0
- package/src/command-palette/command-palette.css +1000 -0
- package/src/command-palette/command-palette.tokens.json +75 -0
- package/src/container/container.css +198 -0
- package/src/container/container.tokens.json +18 -0
- package/src/context-menu/context-menu.css +104 -0
- package/src/context-menu/context-menu.tokens.json +11 -0
- package/src/currency-field/currency-field.css +787 -0
- package/src/currency-field/currency-field.tokens.json +80 -0
- package/src/dashboard-grid/dashboard-grid.css +748 -0
- package/src/dashboard-grid/dashboard-grid.tokens.json +67 -0
- package/src/data-grid/data-grid.css +2484 -0
- package/src/data-grid/data-grid.tokens.json +100 -0
- package/src/data-list/data-list.css +455 -0
- package/src/data-list/data-list.tokens.json +35 -0
- package/src/date-field/date-field.css +560 -0
- package/src/date-field/date-field.tokens.json +80 -0
- package/src/date-picker/date-picker.css +420 -0
- package/src/date-picker/date-picker.tokens.json +49 -0
- package/src/date-range-picker/date-range-picker.css +983 -0
- package/src/date-range-picker/date-range-picker.tokens.json +109 -0
- package/src/datetime-field/datetime-field.css +850 -0
- package/src/datetime-field/datetime-field.tokens.json +91 -0
- package/src/datetime-picker/datetime-picker.css +843 -0
- package/src/datetime-picker/datetime-picker.tokens.json +78 -0
- package/src/datetime-range-picker/datetime-range-picker.css +1375 -0
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +135 -0
- package/src/description-list/description-list.css +675 -0
- package/src/description-list/description-list.tokens.json +66 -0
- package/src/detail-panel/detail-panel.css +329 -0
- package/src/detail-panel/detail-panel.tokens.json +33 -0
- package/src/dialog/dialog.css +968 -0
- package/src/dialog/dialog.tokens.json +66 -0
- package/src/divider/divider.css +131 -0
- package/src/divider/divider.tokens.json +18 -0
- package/src/drawer/drawer.css +1303 -0
- package/src/drawer/drawer.tokens.json +75 -0
- package/src/entity-picker/entity-picker.css +1367 -0
- package/src/entity-picker/entity-picker.tokens.json +118 -0
- package/src/event-calendar/event-calendar.css +2148 -0
- package/src/event-calendar/event-calendar.tokens.json +87 -0
- package/src/field/field.css +707 -0
- package/src/field/field.tokens.json +58 -0
- package/src/field-group/field-group.css +226 -0
- package/src/field-group/field-group.tokens.json +33 -0
- package/src/filter-bar/filter-bar.css +1306 -0
- package/src/filter-bar/filter-bar.tokens.json +78 -0
- package/src/form/form.css +218 -0
- package/src/form/form.tokens.json +32 -0
- package/src/fullscreen/fullscreen.css +376 -0
- package/src/fullscreen/fullscreen.tokens.json +50 -0
- package/src/grid/grid.css +173 -0
- package/src/grid/grid.tokens.json +20 -0
- package/src/highlight/highlight.css +135 -0
- package/src/highlight/highlight.tokens.json +16 -0
- package/src/hover-card/hover-card.css +93 -0
- package/src/hover-card/hover-card.tokens.json +17 -0
- package/src/icon/icon.css +136 -0
- package/src/icon/icon.tokens.json +14 -0
- package/src/image/image.css +449 -0
- package/src/image/image.tokens.json +27 -0
- package/src/import-export-center/import-export-center.css +1175 -0
- package/src/import-export-center/import-export-center.tokens.json +84 -0
- package/src/inline/inline.css +149 -0
- package/src/inline/inline.tokens.json +14 -0
- package/src/inline-message/inline-message.css +396 -0
- package/src/inline-message/inline-message.tokens.json +19 -0
- package/src/kbd/kbd.css +490 -0
- package/src/kbd/kbd.tokens.json +40 -0
- package/src/link/link.css +237 -0
- package/src/link/link.tokens.json +25 -0
- package/src/list/list.css +240 -0
- package/src/list/list.tokens.json +42 -0
- package/src/list-item/list-item.css +937 -0
- package/src/list-item/list-item.tokens.json +114 -0
- package/src/listbox/listbox.css +674 -0
- package/src/listbox/listbox.tokens.json +72 -0
- package/src/loading-overlay/loading-overlay.css +730 -0
- package/src/loading-overlay/loading-overlay.tokens.json +48 -0
- package/src/markdown/markdown.css +168 -0
- package/src/markdown/markdown.tokens.json +18 -0
- package/src/menu/menu.css +817 -0
- package/src/menu/menu.tokens.json +78 -0
- package/src/menubar/menubar.css +170 -0
- package/src/menubar/menubar.tokens.json +32 -0
- package/src/message/message.css +1453 -0
- package/src/message/message.tokens.json +85 -0
- package/src/message-scroller/message-scroller.css +371 -0
- package/src/message-scroller/message-scroller.tokens.json +47 -0
- package/src/multi-select/multi-select.css +1427 -0
- package/src/multi-select/multi-select.tokens.json +114 -0
- package/src/navigation-menu/navigation-menu.css +1029 -0
- package/src/navigation-menu/navigation-menu.tokens.json +70 -0
- package/src/notification-center/notification-center.css +856 -0
- package/src/notification-center/notification-center.tokens.json +84 -0
- package/src/number-field/number-field.css +794 -0
- package/src/number-field/number-field.tokens.json +80 -0
- package/src/otp-input/otp-input.css +525 -0
- package/src/otp-input/otp-input.tokens.json +69 -0
- package/src/page/page.css +179 -0
- package/src/page/page.tokens.json +20 -0
- package/src/page-header/page-header.css +1181 -0
- package/src/page-header/page-header.tokens.json +71 -0
- package/src/pagination/pagination.css +500 -0
- package/src/pagination/pagination.tokens.json +56 -0
- package/src/popover/popover.css +526 -0
- package/src/popover/popover.tokens.json +60 -0
- package/src/progress-indicator/progress-indicator.css +1584 -0
- package/src/progress-indicator/progress-indicator.tokens.json +50 -0
- package/src/prompt-composer/prompt-composer.css +680 -0
- package/src/prompt-composer/prompt-composer.tokens.json +99 -0
- package/src/prose/prose.css +733 -0
- package/src/prose/prose.tokens.json +79 -0
- package/src/radio-group/radio-group.css +778 -0
- package/src/radio-group/radio-group.tokens.json +103 -0
- package/src/rating/rating.css +1071 -0
- package/src/rating/rating.tokens.json +88 -0
- package/src/result-state/result-state.css +980 -0
- package/src/result-state/result-state.tokens.json +63 -0
- package/src/runtime-properties.mjs +321 -0
- package/src/saved-views/saved-views.css +394 -0
- package/src/saved-views/saved-views.tokens.json +41 -0
- package/src/scroll-area/scroll-area.css +481 -0
- package/src/scroll-area/scroll-area.tokens.json +15 -0
- package/src/section/section.css +177 -0
- package/src/section/section.tokens.json +39 -0
- package/src/segmented-control/segmented-control.css +564 -0
- package/src/segmented-control/segmented-control.tokens.json +67 -0
- package/src/select/select.css +1593 -0
- package/src/select/select.tokens.json +110 -0
- package/src/side-navigation/side-navigation.css +1096 -0
- package/src/side-navigation/side-navigation.tokens.json +87 -0
- package/src/skeleton/skeleton.css +431 -0
- package/src/skeleton/skeleton.tokens.json +29 -0
- package/src/slider/slider.css +792 -0
- package/src/slider/slider.tokens.json +75 -0
- package/src/sparkline/sparkline.css +282 -0
- package/src/sparkline/sparkline.tokens.json +45 -0
- package/src/spinner/spinner.css +224 -0
- package/src/spinner/spinner.tokens.json +8 -0
- package/src/split-button/split-button.css +253 -0
- package/src/split-button/split-button.tokens.json +12 -0
- package/src/splitter/splitter.css +336 -0
- package/src/splitter/splitter.tokens.json +24 -0
- package/src/stack/stack.css +128 -0
- package/src/stack/stack.tokens.json +14 -0
- package/src/stat-card/stat-card.css +641 -0
- package/src/stat-card/stat-card.tokens.json +95 -0
- package/src/status-indicator/status-indicator.css +481 -0
- package/src/status-indicator/status-indicator.tokens.json +38 -0
- package/src/stepper/stepper.css +629 -0
- package/src/stepper/stepper.tokens.json +72 -0
- package/src/switch/switch.css +703 -0
- package/src/switch/switch.tokens.json +75 -0
- package/src/table/table.css +1482 -0
- package/src/table/table.tokens.json +69 -0
- package/src/table-of-contents/table-of-contents.css +533 -0
- package/src/table-of-contents/table-of-contents.tokens.json +53 -0
- package/src/tabs/tabs.css +998 -0
- package/src/tabs/tabs.tokens.json +82 -0
- package/src/tag/tag.css +768 -0
- package/src/tag/tag.tokens.json +85 -0
- package/src/tags-input/tags-input.css +757 -0
- package/src/tags-input/tags-input.tokens.json +84 -0
- package/src/text-field/text-field.css +900 -0
- package/src/text-field/text-field.tokens.json +87 -0
- package/src/textarea/textarea.css +365 -0
- package/src/textarea/textarea.tokens.json +59 -0
- package/src/time-field/time-field.css +719 -0
- package/src/time-field/time-field.tokens.json +86 -0
- package/src/time-picker/time-picker.css +665 -0
- package/src/time-picker/time-picker.tokens.json +66 -0
- package/src/time-range-picker/time-range-picker.css +1287 -0
- package/src/time-range-picker/time-range-picker.tokens.json +134 -0
- package/src/timeline/timeline.css +1596 -0
- package/src/timeline/timeline.tokens.json +96 -0
- package/src/toast/toast.css +943 -0
- package/src/toast/toast.tokens.json +90 -0
- package/src/toggle/toggle.css +290 -0
- package/src/toggle/toggle.tokens.json +54 -0
- package/src/toggle-group/toggle-group.css +463 -0
- package/src/toggle-group/toggle-group.tokens.json +54 -0
- package/src/toolbar/toolbar.css +434 -0
- package/src/toolbar/toolbar.tokens.json +49 -0
- package/src/tooltip/tooltip.css +368 -0
- package/src/tooltip/tooltip.tokens.json +39 -0
- package/src/top-navigation/top-navigation.css +1287 -0
- package/src/top-navigation/top-navigation.tokens.json +91 -0
- package/src/tour/tour.css +680 -0
- package/src/tour/tour.tokens.json +67 -0
- package/src/transfer/transfer.css +571 -0
- package/src/transfer/transfer.tokens.json +49 -0
- package/src/tree/tree.css +1000 -0
- package/src/tree/tree.tokens.json +80 -0
- package/src/typography/typography.css +211 -0
- package/src/typography/typography.tokens.json +31 -0
- package/src/upload/upload.css +1706 -0
- package/src/upload/upload.tokens.json +123 -0
- package/src/visually-hidden/visually-hidden.css +52 -0
- package/src/visually-hidden/visually-hidden.tokens.json +1 -0
- package/src/wizard/wizard.css +740 -0
- package/src/wizard/wizard.tokens.json +63 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
@layer slotted.components {
|
|
2
|
+
/**
|
|
3
|
+
* A short list of actions that rises from the bottom edge, and the explicit
|
|
4
|
+
* way out beneath it.
|
|
5
|
+
*
|
|
6
|
+
* ┌─ drawer root ──────────────────────────────────────────┐
|
|
7
|
+
* │ ┌─ backdrop ─────────────────────────────────────────┐ │
|
|
8
|
+
* │ │ ┌─ drawer panel ─────────────────────┐ │ │
|
|
9
|
+
* │ │ │ ┌─ root ─────────────────────────┐ │ │ │
|
|
10
|
+
* │ │ │ │ header title · message │ │ │ │
|
|
11
|
+
* │ │ │ │ list item · item · item │ │ │ │
|
|
12
|
+
* │ │ │ │ footer cancel │ │ │ │
|
|
13
|
+
* └─┴────────┴─┴────────────────────────────────┴─┴──────┴─┘
|
|
14
|
+
*
|
|
15
|
+
* The layer, the scrim, the slide, the width and the drag are `drawer`'s: the
|
|
16
|
+
* family renders it with `side="bottom"` and `size="content"`, and its own
|
|
17
|
+
* root sits inside the panel. This stylesheet reaches only the root and its
|
|
18
|
+
* children, and `drawer`'s reaches only the panel and its own parts, so the
|
|
19
|
+
* two never style each other's boxes
|
|
20
|
+
* (`docs/history/designs/2026-09-25-action-sheet-on-drawer-design.md`).
|
|
21
|
+
*
|
|
22
|
+
* Every part is reached with a child combinator, except the rows of the
|
|
23
|
+
* list, which a group may hold one level down.
|
|
24
|
+
*/
|
|
25
|
+
[data-ui='action-sheet'] {
|
|
26
|
+
/** The row's inset, which the header, every item and the footer share. */
|
|
27
|
+
--_inset: var(--slotted-control-padding-inline-lg, 16px);
|
|
28
|
+
--_gap: var(--slotted-control-gap-lg, 8px);
|
|
29
|
+
/**
|
|
30
|
+
* The words of an action. The body step under a fine pointer, where the
|
|
31
|
+
* sheet sits beside `menu`'s 13-pixel items, and one step up under a coarse
|
|
32
|
+
* one, where a phone's own sheets set their actions at 16 to 20 points.
|
|
33
|
+
*/
|
|
34
|
+
--_label-size: var(--slotted-font-size-md, 0.875rem);
|
|
35
|
+
/**
|
|
36
|
+
* The mark follows the label, whose size does not move with density, and
|
|
37
|
+
* not the control glyph scale, which does: at dense a 14-pixel mark sat
|
|
38
|
+
* beside a 16-pixel word and read as a bullet.
|
|
39
|
+
*/
|
|
40
|
+
--_icon-size: calc(var(--_label-size) * 1.125);
|
|
41
|
+
/**
|
|
42
|
+
* A control's height, which the theme raises to the 44-pixel comfortable
|
|
43
|
+
* target under `pointer: coarse`, per density. Stating 44 pixels here at
|
|
44
|
+
* every density made the sheet a phone's sheet on a desktop too: rows of
|
|
45
|
+
* 44 pixels and words of 16 beside a menu of 34 and 13.
|
|
46
|
+
*/
|
|
47
|
+
--_item-height: var(--slotted-control-height-lg, 38px);
|
|
48
|
+
--_rule-size: var(--slotted-border-width-thin, 1px);
|
|
49
|
+
--_rule: var(--slotted-action-sheet-rule-color, var(--slotted-border-subtle, ButtonBorder));
|
|
50
|
+
--_muted: var(--slotted-text-muted, GrayText);
|
|
51
|
+
--_highlight: var(
|
|
52
|
+
--slotted-action-sheet-highlight,
|
|
53
|
+
var(--slotted-tone-secondary-subtle-hover, ButtonFace)
|
|
54
|
+
);
|
|
55
|
+
--_highlight-active: var(
|
|
56
|
+
--slotted-action-sheet-highlight-active,
|
|
57
|
+
var(--slotted-tone-secondary-subtle-active, ButtonFace)
|
|
58
|
+
);
|
|
59
|
+
--_accent: var(--slotted-text, CanvasText);
|
|
60
|
+
--_list-inset: var(--slotted-space-2, 0.25rem);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Every row of the panel's grid. The panel of a bottom sheet is four rows —
|
|
64
|
+
* resizer, header, body, footer — with the body the one flexible row. A box
|
|
65
|
+
* auto-placed in the first row alone sits in an `auto` track, which a capped
|
|
66
|
+
* panel does not shrink below its content; spanning all four puts the
|
|
67
|
+
* flexible row under the root, and the list is what scrolls.
|
|
68
|
+
*/
|
|
69
|
+
grid-row: 1 / -1;
|
|
70
|
+
/**
|
|
71
|
+
* The family's measure. The binding hands the same value to `drawer`'s
|
|
72
|
+
* panel as `--slotted-drawer-sheet-inline-size`, so the panel and the root
|
|
73
|
+
* are one width; the root is centred in the panel for the case where a
|
|
74
|
+
* theme gives the panel more.
|
|
75
|
+
*/
|
|
76
|
+
justify-self: center;
|
|
77
|
+
inline-size: min(100%, var(--slotted-action-sheet-inline-size, 32rem));
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-columns: minmax(0, 1fr);
|
|
81
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
82
|
+
min-block-size: 0;
|
|
83
|
+
/**
|
|
84
|
+
* A phone held sideways puts its notch on one inline edge. The inset is
|
|
85
|
+
* physical and the property is logical, so the larger of the two is taken
|
|
86
|
+
* on both sides: a few pixels on the edge without a notch, and nothing in
|
|
87
|
+
* any other posture.
|
|
88
|
+
*/
|
|
89
|
+
padding-inline: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
|
|
90
|
+
|
|
91
|
+
color: var(--slotted-text, CanvasText);
|
|
92
|
+
font-family: var(--slotted-control-font-family, var(--slotted-font-family-sans));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (pointer: coarse) {
|
|
96
|
+
[data-ui='action-sheet'] {
|
|
97
|
+
--_label-size: var(--slotted-font-size-lg, 1rem);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ── Header ───────────────────────────────────────────────────────────── */
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The title is the context and the actions are the content, so the title is
|
|
105
|
+
* set small and the actions large — the hierarchy UIKit and Ionic draw, and
|
|
106
|
+
* the reverse of `drawer`, whose title names a task the body carries out.
|
|
107
|
+
*/
|
|
108
|
+
[data-ui='action-sheet'] > [data-part='header'] {
|
|
109
|
+
border-block-end: var(--_rule-size) solid var(--_rule);
|
|
110
|
+
display: grid;
|
|
111
|
+
padding-block: var(--slotted-space-6, 1rem) var(--slotted-space-5, 0.75rem);
|
|
112
|
+
padding-inline: var(--_inset);
|
|
113
|
+
row-gap: var(--slotted-space-1, 0.125rem);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[data-ui='action-sheet'] [data-part='title'] {
|
|
117
|
+
color: var(--slotted-text, CanvasText);
|
|
118
|
+
font-family: var(
|
|
119
|
+
--slotted-font-family-heading,
|
|
120
|
+
var(--slotted-font-family-sans, ui-sans-serif, system-ui, sans-serif)
|
|
121
|
+
);
|
|
122
|
+
font-size: var(--slotted-font-size-md, 0.875rem);
|
|
123
|
+
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
124
|
+
line-height: var(--slotted-line-height-md, 1.5);
|
|
125
|
+
margin: 0;
|
|
126
|
+
overflow-wrap: anywhere;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
[data-ui='action-sheet'] [data-part='message'] {
|
|
130
|
+
color: var(--_muted);
|
|
131
|
+
font-size: var(--slotted-font-size-sm, 0.8125rem);
|
|
132
|
+
line-height: var(--slotted-line-height-sm, 1.45);
|
|
133
|
+
margin: 0;
|
|
134
|
+
overflow-wrap: anywhere;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ── The list ─────────────────────────────────────────────────────────── */
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* One column of rows. The list states the width of the mark column and every
|
|
141
|
+
* item reads it, so the labels of a sheet line up whether or not a given item
|
|
142
|
+
* draws a mark; the column and the gap after it are zero when none does.
|
|
143
|
+
*
|
|
144
|
+
* Rows are `max-content`. The list has a definite height once it scrolls,
|
|
145
|
+
* and with no free space an `auto` row stops at the item's minimum
|
|
146
|
+
* contribution, which is its `min-block-size`: measured at 240 pixels, every
|
|
147
|
+
* row was 44 pixels and a three-line label was painted over the two items
|
|
148
|
+
* below it.
|
|
149
|
+
*/
|
|
150
|
+
[data-ui='action-sheet'] > [data-part='list'] {
|
|
151
|
+
--_mark: 0px;
|
|
152
|
+
--_column-gap: 0px;
|
|
153
|
+
|
|
154
|
+
align-content: start;
|
|
155
|
+
display: grid;
|
|
156
|
+
grid-auto-rows: max-content;
|
|
157
|
+
grid-row: 2;
|
|
158
|
+
grid-template-columns: minmax(0, 1fr);
|
|
159
|
+
min-block-size: 0;
|
|
160
|
+
overflow-y: auto;
|
|
161
|
+
overscroll-behavior: contain;
|
|
162
|
+
/**
|
|
163
|
+
* `menu`'s geometry: the rows stand a step in from the sheet's edges, so a
|
|
164
|
+
* lit row is a rounded ground inside the sheet rather than a band across
|
|
165
|
+
* it, and its ring never meets the sheet's edge. The item gives the same
|
|
166
|
+
* step back in its own inset, so every label still starts on the title's
|
|
167
|
+
* line.
|
|
168
|
+
*/
|
|
169
|
+
padding-block: var(--slotted-space-2, 0.25rem);
|
|
170
|
+
padding-inline: var(--_list-inset);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-ui='action-sheet'] > [data-part='list']:has([data-part='icon']) {
|
|
174
|
+
--_mark: var(--_icon-size);
|
|
175
|
+
--_column-gap: var(--_gap);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The home indicator sits under the last row of a sheet with no footer, so
|
|
180
|
+
* that row carries the bottom inset instead.
|
|
181
|
+
*/
|
|
182
|
+
[data-ui='action-sheet']:not(:has(> [data-part='footer'])) > [data-part='list'] {
|
|
183
|
+
padding-block-end: calc(var(--slotted-space-2, 0.25rem) + env(safe-area-inset-bottom, 0px));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[data-ui='action-sheet'] [data-part='group'] {
|
|
187
|
+
display: grid;
|
|
188
|
+
grid-auto-rows: max-content;
|
|
189
|
+
grid-template-columns: minmax(0, 1fr);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[data-ui='action-sheet'] [data-part='group-label'] {
|
|
193
|
+
color: var(--_muted);
|
|
194
|
+
font-size: var(--slotted-font-size-sm, 0.8125rem);
|
|
195
|
+
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
196
|
+
line-height: var(--slotted-line-height-sm, 1.45);
|
|
197
|
+
padding-block: var(--slotted-space-4, 0.5rem) var(--slotted-space-2, 0.25rem);
|
|
198
|
+
padding-inline: calc(var(--_inset) - var(--_list-inset));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[data-ui='action-sheet'] [data-part='separator'] {
|
|
202
|
+
background-color: var(--_rule);
|
|
203
|
+
block-size: var(--_rule-size);
|
|
204
|
+
border: 0;
|
|
205
|
+
margin-block: var(--slotted-space-2, 0.25rem);
|
|
206
|
+
margin-inline: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* ── Items ────────────────────────────────────────────────────────────── */
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* A native `button` with `role="menuitem"`, as in `menu`: the platform gives
|
|
213
|
+
* the press, Enter and Space, and the role makes it an item of the list.
|
|
214
|
+
*
|
|
215
|
+
* `min-block-size` rather than a height, because an item with a description
|
|
216
|
+
* is two lines tall and still has to clear the target.
|
|
217
|
+
*/
|
|
218
|
+
[data-ui='action-sheet'] [data-part='item'] {
|
|
219
|
+
align-content: center;
|
|
220
|
+
appearance: none;
|
|
221
|
+
background: transparent;
|
|
222
|
+
border: 0;
|
|
223
|
+
box-sizing: border-box;
|
|
224
|
+
color: var(--_accent);
|
|
225
|
+
column-gap: var(--_column-gap);
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
display: grid;
|
|
228
|
+
font: inherit;
|
|
229
|
+
font-size: var(--_label-size);
|
|
230
|
+
grid-template-columns: var(--_mark) minmax(0, 1fr);
|
|
231
|
+
line-height: var(--slotted-line-height-md, 1.5);
|
|
232
|
+
margin: 0;
|
|
233
|
+
min-block-size: var(--_item-height);
|
|
234
|
+
padding-block: var(--slotted-space-4, 0.5rem);
|
|
235
|
+
padding-inline: calc(var(--_inset) - var(--_list-inset));
|
|
236
|
+
border-radius: var(--slotted-control-radius, 6px);
|
|
237
|
+
row-gap: var(--slotted-space-1, 0.125rem);
|
|
238
|
+
text-align: start;
|
|
239
|
+
text-decoration: none;
|
|
240
|
+
-webkit-tap-highlight-color: transparent;
|
|
241
|
+
transition:
|
|
242
|
+
background-color var(--slotted-control-transition-duration, var(--slotted-duration-short))
|
|
243
|
+
var(--slotted-control-transition-easing, var(--slotted-easing-standard)),
|
|
244
|
+
color var(--slotted-control-transition-duration, var(--slotted-duration-short))
|
|
245
|
+
var(--slotted-control-transition-easing, var(--slotted-easing-standard));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* The highlight follows focus, which a mouse moves as it crosses an item, so
|
|
250
|
+
* exactly one row is lit whichever device is driving — `menu`'s model. A
|
|
251
|
+
* pointer that has not moved focus yet, before the script has run, still
|
|
252
|
+
* gets the hover.
|
|
253
|
+
*/
|
|
254
|
+
[data-ui='action-sheet'] [data-part='item']:focus {
|
|
255
|
+
background-color: var(--_highlight);
|
|
256
|
+
outline: none;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@media (hover: hover) {
|
|
260
|
+
[data-ui='action-sheet'] [data-part='item']:hover:not([data-disabled]):not([data-loading]) {
|
|
261
|
+
background-color: var(--_highlight);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Inset, so the ring follows the row's own corner and never meets the
|
|
267
|
+
* neighbour's edge.
|
|
268
|
+
*/
|
|
269
|
+
[data-ui='action-sheet'] [data-part='item']:focus-visible {
|
|
270
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
271
|
+
outline-offset: calc(-1 * var(--slotted-focus-ring-width, 2px));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
[data-ui='action-sheet'] [data-part='item']:active:not([data-disabled]):not([data-loading]) {
|
|
275
|
+
background-color: var(--_highlight-active);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Focusable and inert, as the menu pattern requires, and legible rather than
|
|
280
|
+
* faded: the words keep the theme's disabled ink at its contrast.
|
|
281
|
+
*/
|
|
282
|
+
[data-ui='action-sheet'] [data-part='item'][data-disabled] {
|
|
283
|
+
color: var(--slotted-disabled-foreground, GrayText);
|
|
284
|
+
cursor: not-allowed;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
[data-ui='action-sheet'] [data-part='item'][data-disabled]:focus {
|
|
288
|
+
background-color: var(--slotted-disabled-background, ButtonFace);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
[data-ui='action-sheet'] [data-part='item'][data-loading] {
|
|
292
|
+
cursor: progress;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* ── The cells ────────────────────────────────────────────────────────── */
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The mark sits on the label's first line rather than on the middle of a
|
|
299
|
+
* two-line item: the line box is the item's, and the box is one line tall.
|
|
300
|
+
*/
|
|
301
|
+
[data-ui='action-sheet'] [data-part='icon'] {
|
|
302
|
+
--slotted-icon-size: var(--_icon-size);
|
|
303
|
+
--slotted-spinner-size: var(--_icon-size);
|
|
304
|
+
|
|
305
|
+
align-items: center;
|
|
306
|
+
block-size: 1lh;
|
|
307
|
+
display: flex;
|
|
308
|
+
grid-column: 1;
|
|
309
|
+
grid-row: 1;
|
|
310
|
+
inline-size: var(--_icon-size);
|
|
311
|
+
justify-content: center;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
[data-ui='action-sheet'] [data-part='icon'] > * {
|
|
315
|
+
flex: none;
|
|
316
|
+
font-size: var(--_icon-size);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
[data-ui='action-sheet'] [data-part='label'] {
|
|
320
|
+
grid-column: 2;
|
|
321
|
+
grid-row: 1;
|
|
322
|
+
min-inline-size: 0;
|
|
323
|
+
overflow-wrap: anywhere;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
[data-ui='action-sheet'] [data-part='description'] {
|
|
327
|
+
color: var(--_muted);
|
|
328
|
+
font-size: var(--slotted-font-size-sm, 0.8125rem);
|
|
329
|
+
grid-column: 2;
|
|
330
|
+
grid-row: 2;
|
|
331
|
+
line-height: var(--slotted-line-height-sm, 1.45);
|
|
332
|
+
min-inline-size: 0;
|
|
333
|
+
overflow-wrap: anywhere;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
[data-ui='action-sheet'] [data-part='item'][data-disabled] > [data-part='description'] {
|
|
337
|
+
color: inherit;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* ── Tones ────────────────────────────────────────────────────────────── */
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* `menu`'s five, so one list of actions renders the same in either family.
|
|
344
|
+
* The tone paints the words, the mark and the highlight together; `danger`
|
|
345
|
+
* is the destructive action.
|
|
346
|
+
*/
|
|
347
|
+
[data-ui='action-sheet'] [data-part='item'][data-tone='accent'] {
|
|
348
|
+
--_accent: var(--slotted-tone-accent-text);
|
|
349
|
+
--_highlight: var(--slotted-tone-accent-surface);
|
|
350
|
+
--_highlight-active: var(--slotted-tone-accent-subtle-active);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
[data-ui='action-sheet'] [data-part='item'][data-tone='secondary'] {
|
|
354
|
+
--_accent: var(--slotted-tone-secondary-text);
|
|
355
|
+
--_highlight: var(--slotted-tone-secondary-surface);
|
|
356
|
+
--_highlight-active: var(--slotted-tone-secondary-subtle-active);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
[data-ui='action-sheet'] [data-part='item'][data-tone='success'] {
|
|
360
|
+
--_accent: var(--slotted-tone-success-text);
|
|
361
|
+
--_highlight: var(--slotted-tone-success-surface);
|
|
362
|
+
--_highlight-active: var(--slotted-tone-success-subtle-active);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
[data-ui='action-sheet'] [data-part='item'][data-tone='warning'] {
|
|
366
|
+
--_accent: var(--slotted-tone-warning-text);
|
|
367
|
+
--_highlight: var(--slotted-tone-warning-surface);
|
|
368
|
+
--_highlight-active: var(--slotted-tone-warning-subtle-active);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
[data-ui='action-sheet'] [data-part='item'][data-tone='danger'] {
|
|
372
|
+
--_accent: var(--slotted-tone-danger-text);
|
|
373
|
+
--_highlight: var(--slotted-tone-danger-surface);
|
|
374
|
+
--_highlight-active: var(--slotted-tone-danger-subtle-active);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* ── The way out ──────────────────────────────────────────────────────── */
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* A band of its own, on the sunken ground, so the cancel is never read as one
|
|
381
|
+
* more action. It carries the bottom safe-area inset, which is where a
|
|
382
|
+
* phone's home indicator sits.
|
|
383
|
+
*/
|
|
384
|
+
[data-ui='action-sheet'] > [data-part='footer'] {
|
|
385
|
+
background: var(--slotted-action-sheet-footer-surface, var(--slotted-surface-sunken, Canvas));
|
|
386
|
+
border-block-start: var(--_rule-size) solid var(--_rule);
|
|
387
|
+
display: grid;
|
|
388
|
+
grid-row: 3;
|
|
389
|
+
padding-block: var(--slotted-space-4, 0.5rem)
|
|
390
|
+
calc(var(--slotted-space-4, 0.5rem) + env(safe-area-inset-bottom, 0px));
|
|
391
|
+
padding-inline: var(--_inset);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* A button with a face, on the band: the one control of the sheet that is
|
|
396
|
+
* not an item, and the one that always works — it is never disabled.
|
|
397
|
+
*/
|
|
398
|
+
[data-ui='action-sheet'] [data-part='cancel'] {
|
|
399
|
+
appearance: none;
|
|
400
|
+
background: var(--slotted-control-surface, ButtonFace);
|
|
401
|
+
border: var(--slotted-control-border-width, 1px) solid
|
|
402
|
+
var(--slotted-control-border-color, ButtonBorder);
|
|
403
|
+
border-radius: var(--slotted-control-radius, 6px);
|
|
404
|
+
box-shadow: var(--slotted-control-shadow);
|
|
405
|
+
box-sizing: border-box;
|
|
406
|
+
color: var(--slotted-text, CanvasText);
|
|
407
|
+
cursor: pointer;
|
|
408
|
+
font: inherit;
|
|
409
|
+
font-size: var(--_label-size);
|
|
410
|
+
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
411
|
+
inline-size: 100%;
|
|
412
|
+
line-height: var(--slotted-line-height-md, 1.5);
|
|
413
|
+
margin: 0;
|
|
414
|
+
min-block-size: var(--_item-height);
|
|
415
|
+
padding-block: var(--slotted-space-2, 0.25rem);
|
|
416
|
+
padding-inline: var(--_inset);
|
|
417
|
+
-webkit-tap-highlight-color: transparent;
|
|
418
|
+
transition: background-color
|
|
419
|
+
var(--slotted-control-transition-duration, var(--slotted-duration-short))
|
|
420
|
+
var(--slotted-control-transition-easing, var(--slotted-easing-standard));
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
@media (hover: hover) {
|
|
424
|
+
[data-ui='action-sheet'] [data-part='cancel']:hover:not(:disabled) {
|
|
425
|
+
background: var(--slotted-tone-secondary-subtle-hover, ButtonFace);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* `button`'s press: the face settles a hairline and gives up its lift. It is
|
|
431
|
+
* instant, as a press is, and the ground eases back on release.
|
|
432
|
+
*/
|
|
433
|
+
[data-ui='action-sheet'] [data-part='cancel']:active:not(:disabled) {
|
|
434
|
+
background: var(--slotted-tone-secondary-subtle-active, ButtonFace);
|
|
435
|
+
box-shadow: none;
|
|
436
|
+
translate: 0 var(--slotted-border-width-thin, 1px);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
[data-ui='action-sheet'] [data-part='cancel']:focus-visible {
|
|
440
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
441
|
+
outline-offset: var(--slotted-focus-ring-offset, 2px);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/* ── Forced colours ───────────────────────────────────────────────────── */
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* The one thing the theme cannot reach: every tone surface becomes `Canvas`,
|
|
448
|
+
* so the focused row would lose its highlight.
|
|
449
|
+
*/
|
|
450
|
+
@media (forced-colors: active) {
|
|
451
|
+
[data-ui='action-sheet'] [data-part='item']:focus {
|
|
452
|
+
background-color: Highlight;
|
|
453
|
+
color: HighlightText;
|
|
454
|
+
forced-color-adjust: none;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
[data-ui='action-sheet'] [data-part='item'][data-disabled]:focus {
|
|
458
|
+
background-color: Highlight;
|
|
459
|
+
color: GrayText;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-action-sheet-footer-surface",
|
|
3
|
+
"--slotted-action-sheet-highlight",
|
|
4
|
+
"--slotted-action-sheet-highlight-active",
|
|
5
|
+
"--slotted-action-sheet-inline-size",
|
|
6
|
+
"--slotted-action-sheet-rule-color",
|
|
7
|
+
"--slotted-border-subtle",
|
|
8
|
+
"--slotted-border-width-thin",
|
|
9
|
+
"--slotted-control-border-color",
|
|
10
|
+
"--slotted-control-border-width",
|
|
11
|
+
"--slotted-control-font-family",
|
|
12
|
+
"--slotted-control-gap-lg",
|
|
13
|
+
"--slotted-control-height-lg",
|
|
14
|
+
"--slotted-control-padding-inline-lg",
|
|
15
|
+
"--slotted-control-radius",
|
|
16
|
+
"--slotted-control-shadow",
|
|
17
|
+
"--slotted-control-surface",
|
|
18
|
+
"--slotted-control-transition-duration",
|
|
19
|
+
"--slotted-control-transition-easing",
|
|
20
|
+
"--slotted-disabled-background",
|
|
21
|
+
"--slotted-disabled-foreground",
|
|
22
|
+
"--slotted-duration-short",
|
|
23
|
+
"--slotted-easing-standard",
|
|
24
|
+
"--slotted-focus-ring-color",
|
|
25
|
+
"--slotted-focus-ring-offset",
|
|
26
|
+
"--slotted-focus-ring-width",
|
|
27
|
+
"--slotted-font-family-heading",
|
|
28
|
+
"--slotted-font-family-sans",
|
|
29
|
+
"--slotted-font-size-lg",
|
|
30
|
+
"--slotted-font-size-md",
|
|
31
|
+
"--slotted-font-size-sm",
|
|
32
|
+
"--slotted-font-weight-semibold",
|
|
33
|
+
"--slotted-line-height-md",
|
|
34
|
+
"--slotted-line-height-sm",
|
|
35
|
+
"--slotted-space-1",
|
|
36
|
+
"--slotted-space-2",
|
|
37
|
+
"--slotted-space-4",
|
|
38
|
+
"--slotted-space-5",
|
|
39
|
+
"--slotted-space-6",
|
|
40
|
+
"--slotted-surface-sunken",
|
|
41
|
+
"--slotted-text",
|
|
42
|
+
"--slotted-text-muted",
|
|
43
|
+
"--slotted-tone-accent-subtle-active",
|
|
44
|
+
"--slotted-tone-accent-surface",
|
|
45
|
+
"--slotted-tone-accent-text",
|
|
46
|
+
"--slotted-tone-danger-subtle-active",
|
|
47
|
+
"--slotted-tone-danger-surface",
|
|
48
|
+
"--slotted-tone-danger-text",
|
|
49
|
+
"--slotted-tone-secondary-subtle-active",
|
|
50
|
+
"--slotted-tone-secondary-subtle-hover",
|
|
51
|
+
"--slotted-tone-secondary-surface",
|
|
52
|
+
"--slotted-tone-secondary-text",
|
|
53
|
+
"--slotted-tone-success-subtle-active",
|
|
54
|
+
"--slotted-tone-success-surface",
|
|
55
|
+
"--slotted-tone-success-text",
|
|
56
|
+
"--slotted-tone-warning-subtle-active",
|
|
57
|
+
"--slotted-tone-warning-surface",
|
|
58
|
+
"--slotted-tone-warning-text"
|
|
59
|
+
]
|