@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,90 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-border-subtle",
|
|
3
|
+
"--slotted-border-width-thin",
|
|
4
|
+
"--slotted-control-font-family",
|
|
5
|
+
"--slotted-control-font-size-md",
|
|
6
|
+
"--slotted-control-icon-size-md",
|
|
7
|
+
"--slotted-control-inner-size-md",
|
|
8
|
+
"--slotted-control-radius",
|
|
9
|
+
"--slotted-control-transition-duration",
|
|
10
|
+
"--slotted-control-transition-easing",
|
|
11
|
+
"--slotted-duration-long",
|
|
12
|
+
"--slotted-duration-medium",
|
|
13
|
+
"--slotted-duration-short",
|
|
14
|
+
"--slotted-easing-enter",
|
|
15
|
+
"--slotted-easing-exit",
|
|
16
|
+
"--slotted-easing-standard",
|
|
17
|
+
"--slotted-focus-ring-color",
|
|
18
|
+
"--slotted-focus-ring-offset",
|
|
19
|
+
"--slotted-focus-ring-width",
|
|
20
|
+
"--slotted-font-family-heading",
|
|
21
|
+
"--slotted-font-family-sans",
|
|
22
|
+
"--slotted-font-weight-semibold",
|
|
23
|
+
"--slotted-line-height-md",
|
|
24
|
+
"--slotted-radius-lg",
|
|
25
|
+
"--slotted-shadow-md",
|
|
26
|
+
"--slotted-space-1",
|
|
27
|
+
"--slotted-space-2",
|
|
28
|
+
"--slotted-space-3",
|
|
29
|
+
"--slotted-space-4",
|
|
30
|
+
"--slotted-space-5",
|
|
31
|
+
"--slotted-space-6",
|
|
32
|
+
"--slotted-space-7",
|
|
33
|
+
"--slotted-surface-raised",
|
|
34
|
+
"--slotted-target-comfortable",
|
|
35
|
+
"--slotted-target-min",
|
|
36
|
+
"--slotted-text",
|
|
37
|
+
"--slotted-text-muted",
|
|
38
|
+
"--slotted-toast-actions-gap",
|
|
39
|
+
"--slotted-toast-border-color",
|
|
40
|
+
"--slotted-toast-border-width",
|
|
41
|
+
"--slotted-toast-close-radius",
|
|
42
|
+
"--slotted-toast-close-size",
|
|
43
|
+
"--slotted-toast-column-gap",
|
|
44
|
+
"--slotted-toast-font-family",
|
|
45
|
+
"--slotted-toast-gap",
|
|
46
|
+
"--slotted-toast-measure",
|
|
47
|
+
"--slotted-toast-offset",
|
|
48
|
+
"--slotted-toast-padding-block",
|
|
49
|
+
"--slotted-toast-padding-inline",
|
|
50
|
+
"--slotted-toast-progress-size",
|
|
51
|
+
"--slotted-toast-radius",
|
|
52
|
+
"--slotted-toast-row-gap",
|
|
53
|
+
"--slotted-toast-shadow",
|
|
54
|
+
"--slotted-toast-stack-fade",
|
|
55
|
+
"--slotted-toast-stack-step",
|
|
56
|
+
"--slotted-toast-state-layer-active",
|
|
57
|
+
"--slotted-toast-state-layer-hover",
|
|
58
|
+
"--slotted-toast-surface",
|
|
59
|
+
"--slotted-toast-text",
|
|
60
|
+
"--slotted-toast-text-gap",
|
|
61
|
+
"--slotted-toast-text-muted",
|
|
62
|
+
"--slotted-toast-title-font-family",
|
|
63
|
+
"--slotted-toast-title-font-weight",
|
|
64
|
+
"--slotted-tone-accent-border",
|
|
65
|
+
"--slotted-tone-accent-on-solid",
|
|
66
|
+
"--slotted-tone-accent-solid",
|
|
67
|
+
"--slotted-tone-accent-surface",
|
|
68
|
+
"--slotted-tone-accent-text",
|
|
69
|
+
"--slotted-tone-danger-border",
|
|
70
|
+
"--slotted-tone-danger-on-solid",
|
|
71
|
+
"--slotted-tone-danger-solid",
|
|
72
|
+
"--slotted-tone-danger-surface",
|
|
73
|
+
"--slotted-tone-danger-text",
|
|
74
|
+
"--slotted-tone-secondary-border",
|
|
75
|
+
"--slotted-tone-secondary-on-solid",
|
|
76
|
+
"--slotted-tone-secondary-solid",
|
|
77
|
+
"--slotted-tone-secondary-surface",
|
|
78
|
+
"--slotted-tone-secondary-text",
|
|
79
|
+
"--slotted-tone-success-border",
|
|
80
|
+
"--slotted-tone-success-on-solid",
|
|
81
|
+
"--slotted-tone-success-solid",
|
|
82
|
+
"--slotted-tone-success-surface",
|
|
83
|
+
"--slotted-tone-success-text",
|
|
84
|
+
"--slotted-tone-warning-border",
|
|
85
|
+
"--slotted-tone-warning-on-solid",
|
|
86
|
+
"--slotted-tone-warning-solid",
|
|
87
|
+
"--slotted-tone-warning-surface",
|
|
88
|
+
"--slotted-tone-warning-text",
|
|
89
|
+
"--slotted-z-index-toast"
|
|
90
|
+
]
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
@layer slotted.components {
|
|
2
|
+
/**
|
|
3
|
+
* ── A two-state button standing on its own ─────────────────────────────
|
|
4
|
+
*
|
|
5
|
+
* A `button` carrying `aria-pressed` in both states: the Button pattern's
|
|
6
|
+
* toggle button, whose label does not change when its state does. It is a
|
|
7
|
+
* mode — Bold, Wrap, Pin — and a mode is neutral until it is on and one
|
|
8
|
+
* colour when it is: the accent ground inside the accent edge, which is the
|
|
9
|
+
* pair `docs/token-foundation.md` names for the chosen row, card, option
|
|
10
|
+
* and toggle. `button`'s ToggleButton is the other member, an action that
|
|
11
|
+
* persists — Follow, Subscribe — which reaches a server, waits, and stands
|
|
12
|
+
* in one of five tones beside the other actions of a page.
|
|
13
|
+
*
|
|
14
|
+
* ── The picture is `toggle-group`'s item ──────────────────────────────
|
|
15
|
+
*
|
|
16
|
+
* The same geometry, the same two variants, the same "on", the same hover,
|
|
17
|
+
* the same press timing, the same disabled-and-on reading and the same
|
|
18
|
+
* icon alignment, under this family's own prefix. The group keeps its item
|
|
19
|
+
* so the value has one owner; the reopen recorded in `docs/process/build-order.md`
|
|
20
|
+
* makes that item this family and the duplicated rules leave. A rule
|
|
21
|
+
* changed in one sheet is changed in the other until then.
|
|
22
|
+
*
|
|
23
|
+
* What differs is the room around the control: a standalone toggle has
|
|
24
|
+
* some, so the ring is held off the edge at the foundation's offset, where
|
|
25
|
+
* the joined bar draws it inward.
|
|
26
|
+
*/
|
|
27
|
+
[data-ui='toggle'][data-part='root'] {
|
|
28
|
+
--_height: var(--slotted-control-height-md, 34px);
|
|
29
|
+
--_padding-inline: var(--slotted-control-padding-inline-md, 13px);
|
|
30
|
+
--_font-size: var(--slotted-control-font-size-md, 13px);
|
|
31
|
+
--_icon-size: var(--slotted-control-icon-size-md, 16px);
|
|
32
|
+
--_gap: var(--slotted-control-gap-md, 8px);
|
|
33
|
+
--_radius: var(--slotted-toggle-radius, var(--slotted-control-radius, 4px));
|
|
34
|
+
--_border-width: var(--slotted-control-border-width, 1px);
|
|
35
|
+
--_border-color: var(
|
|
36
|
+
--slotted-toggle-border-color,
|
|
37
|
+
var(--slotted-control-border-color, ButtonBorder)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
align-items: center;
|
|
41
|
+
appearance: none;
|
|
42
|
+
background: transparent;
|
|
43
|
+
block-size: var(--_height);
|
|
44
|
+
/**
|
|
45
|
+
* Always a border, and always the same width. A state changes its colour
|
|
46
|
+
* and never its presence: a border that appears when the control is on
|
|
47
|
+
* moves its label by a pixel.
|
|
48
|
+
*/
|
|
49
|
+
border: var(--_border-width) solid transparent;
|
|
50
|
+
border-radius: var(--_radius);
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
color: var(--slotted-toggle-color, var(--slotted-text, ButtonText));
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
font-family: var(--slotted-control-font-family, ui-sans-serif, system-ui, sans-serif);
|
|
56
|
+
font-size: var(--_font-size);
|
|
57
|
+
font-weight: var(--slotted-control-font-weight, 600);
|
|
58
|
+
gap: var(--_gap);
|
|
59
|
+
justify-content: center;
|
|
60
|
+
letter-spacing: var(--slotted-control-letter-spacing, 0);
|
|
61
|
+
line-height: var(--slotted-control-line-height, 1);
|
|
62
|
+
margin: 0;
|
|
63
|
+
/**
|
|
64
|
+
* A control never pushes past the container it was placed in: the label
|
|
65
|
+
* clamps rather than the page scrolling. `min-inline-size` is the floor,
|
|
66
|
+
* so the control is never narrower than it is tall and the WCAG target
|
|
67
|
+
* holds.
|
|
68
|
+
*/
|
|
69
|
+
max-inline-size: 100%;
|
|
70
|
+
min-inline-size: var(--_height);
|
|
71
|
+
padding-block: 0;
|
|
72
|
+
padding-inline: var(--_padding-inline);
|
|
73
|
+
position: relative;
|
|
74
|
+
/* No tap delay waiting for a second tap the control cannot use. */
|
|
75
|
+
touch-action: manipulation;
|
|
76
|
+
/**
|
|
77
|
+
* Nothing here moves: a toggle changes colour, and colour is what the eye
|
|
78
|
+
* has to follow. The duration is the control step, so a theme retunes
|
|
79
|
+
* every control's interaction feedback once and reduced motion collapses
|
|
80
|
+
* it to a frame.
|
|
81
|
+
*/
|
|
82
|
+
transition:
|
|
83
|
+
background-color var(--slotted-control-transition-duration)
|
|
84
|
+
var(--slotted-control-transition-easing),
|
|
85
|
+
border-color var(--slotted-control-transition-duration)
|
|
86
|
+
var(--slotted-control-transition-easing),
|
|
87
|
+
color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
|
|
88
|
+
user-select: none;
|
|
89
|
+
/* A control written inside a sentence sits on the text's centre. */
|
|
90
|
+
vertical-align: middle;
|
|
91
|
+
-webkit-tap-highlight-color: transparent;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* ── Size ─────────────────────────────────────────────────────────────── */
|
|
95
|
+
|
|
96
|
+
[data-ui='toggle'][data-part='root'][data-size='sm'] {
|
|
97
|
+
--_height: var(--slotted-control-height-sm, 30px);
|
|
98
|
+
--_padding-inline: var(--slotted-control-padding-inline-sm, 10px);
|
|
99
|
+
--_font-size: var(--slotted-control-font-size-sm, 12px);
|
|
100
|
+
--_icon-size: var(--slotted-control-icon-size-sm, 14px);
|
|
101
|
+
--_gap: var(--slotted-control-gap-sm, 6px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-ui='toggle'][data-part='root'][data-size='lg'] {
|
|
105
|
+
--_height: var(--slotted-control-height-lg, 38px);
|
|
106
|
+
--_padding-inline: var(--slotted-control-padding-inline-lg, 16px);
|
|
107
|
+
--_font-size: var(--slotted-control-font-size-lg, 14px);
|
|
108
|
+
--_icon-size: var(--slotted-control-icon-size-lg, 18px);
|
|
109
|
+
--_gap: var(--slotted-control-gap-lg, 8px);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ── Content ──────────────────────────────────────────────────────────── */
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* A control with no words is a square holding one mark, so its inline
|
|
116
|
+
* padding is whatever centres that mark rather than the padding a label
|
|
117
|
+
* needs, and its width is its height. An empty label box counts as no
|
|
118
|
+
* words: the Angular binding projects the words into a box it always
|
|
119
|
+
* renders, and a box with nothing in it must not hold the gap open either.
|
|
120
|
+
*/
|
|
121
|
+
[data-ui='toggle'][data-part='root']:not(:has([data-part='label']:not(:empty))) {
|
|
122
|
+
inline-size: var(--_height);
|
|
123
|
+
padding-inline: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-ui='toggle'] [data-part='label']:empty {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The slot sizes what it holds: an icon box reads `--slotted-icon-size`
|
|
132
|
+
* from its container, and a bare glyph host such as `ng-icon` reads the
|
|
133
|
+
* slot's font-size, so both are the glyph scale.
|
|
134
|
+
*/
|
|
135
|
+
[data-ui='toggle'] [data-part='icon'] {
|
|
136
|
+
--slotted-icon-size: var(--_icon-size);
|
|
137
|
+
|
|
138
|
+
block-size: var(--_icon-size);
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
flex: none;
|
|
141
|
+
font-size: var(--_icon-size);
|
|
142
|
+
inline-size: var(--_icon-size);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[data-ui='toggle'] [data-part='icon'] > * {
|
|
146
|
+
block-size: 100%;
|
|
147
|
+
display: block;
|
|
148
|
+
inline-size: 100%;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The words get a box of their own, as they do in `tabs` and `tag`: it is
|
|
153
|
+
* what `text-overflow` needs to clip a label a narrow container made too
|
|
154
|
+
* long, and what an icon beside it is aligned against. The string stays
|
|
155
|
+
* whole in the DOM — the library's rule is that truncation never removes
|
|
156
|
+
* content.
|
|
157
|
+
*/
|
|
158
|
+
[data-ui='toggle'] [data-part='label'] {
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
text-overflow: ellipsis;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* ── The edge ─────────────────────────────────────────────────────────── */
|
|
165
|
+
|
|
166
|
+
[data-ui='toggle'][data-part='root'][data-variant='outline'] {
|
|
167
|
+
border-color: var(--_border-color);
|
|
168
|
+
/* A framed control lifts off its ground at rest, as button's outline does. */
|
|
169
|
+
box-shadow: var(--slotted-toggle-shadow, var(--slotted-control-shadow, none));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* ── On ───────────────────────────────────────────────────────────────
|
|
174
|
+
*
|
|
175
|
+
* The accent ground inside the accent edge, and the accent text on it. It
|
|
176
|
+
* sits above hover and below disabled, which is the order
|
|
177
|
+
* `STATE_PRECEDENCE` sets. Both variants take the edge: a ghost toggle that
|
|
178
|
+
* is on has become a framed thing, and the edge is half of what says so.
|
|
179
|
+
*/
|
|
180
|
+
[data-ui='toggle'][data-part='root'][data-pressed]:not(:disabled):not([data-disabled]) {
|
|
181
|
+
background: var(
|
|
182
|
+
--slotted-toggle-pressed-background,
|
|
183
|
+
var(--slotted-tone-accent-subtle-active, Highlight)
|
|
184
|
+
);
|
|
185
|
+
border-color: var(
|
|
186
|
+
--slotted-toggle-pressed-border-color,
|
|
187
|
+
var(--slotted-tone-accent-border, Highlight)
|
|
188
|
+
);
|
|
189
|
+
color: var(--slotted-toggle-pressed-color, var(--slotted-tone-accent-text, HighlightText));
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* ── Hover and press, each held back for every stronger state ──────────
|
|
194
|
+
*
|
|
195
|
+
* A control that is off takes the neutral ground, whatever it is for: a
|
|
196
|
+
* tinted hover on a row of toggles read as status chips before it read as
|
|
197
|
+
* hovered controls, which is the reading `button` records. A control that
|
|
198
|
+
* is on answers the pointer on the accent ground's own steps, so the two
|
|
199
|
+
* states share no surface in any of theirs.
|
|
200
|
+
*/
|
|
201
|
+
[data-ui='toggle'][data-part='root']:hover:not(:disabled):not([data-disabled]):not(
|
|
202
|
+
[data-pressed]
|
|
203
|
+
) {
|
|
204
|
+
background: var(
|
|
205
|
+
--slotted-toggle-hover-background,
|
|
206
|
+
var(--slotted-tone-secondary-subtle-hover, ButtonFace)
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-ui='toggle'][data-part='root']:active:not(:disabled):not([data-disabled]):not(
|
|
211
|
+
[data-pressed]
|
|
212
|
+
) {
|
|
213
|
+
background: var(
|
|
214
|
+
--slotted-toggle-active-background,
|
|
215
|
+
var(--slotted-tone-secondary-subtle-active, ButtonFace)
|
|
216
|
+
);
|
|
217
|
+
/* The press lands on the frame it went down on and eases out at the
|
|
218
|
+
control's own pace, which is `button`'s rule for the same gesture: a
|
|
219
|
+
transition's timing is read from the state being entered. */
|
|
220
|
+
transition-duration: var(--slotted-duration-instant);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
[data-ui='toggle'][data-part='root'][data-pressed]:hover:not(:disabled):not([data-disabled]) {
|
|
224
|
+
background: var(
|
|
225
|
+
--slotted-toggle-pressed-hover-background,
|
|
226
|
+
var(--slotted-tone-accent-subtle-hover, Highlight)
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
[data-ui='toggle'][data-part='root'][data-pressed]:active:not(:disabled):not([data-disabled]) {
|
|
231
|
+
background: var(
|
|
232
|
+
--slotted-toggle-pressed-background,
|
|
233
|
+
var(--slotted-tone-accent-subtle-active, Highlight)
|
|
234
|
+
);
|
|
235
|
+
transition-duration: var(--slotted-duration-instant);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* ── Focus ────────────────────────────────────────────────────────────── */
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* A standalone control has room around it, so the ring is held off the
|
|
242
|
+
* edge the way every other control in the library holds it.
|
|
243
|
+
*/
|
|
244
|
+
[data-ui='toggle'][data-part='root']:focus-visible {
|
|
245
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
246
|
+
outline-offset: var(--slotted-focus-ring-offset, 2px);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* ── Disabled ─────────────────────────────────────────────────────────── */
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* `[data-disabled]` as well as `:disabled`, because a control taken out of
|
|
253
|
+
* action with a `fieldset` carries no attribute of its own.
|
|
254
|
+
*/
|
|
255
|
+
[data-ui='toggle'][data-part='root']:disabled,
|
|
256
|
+
[data-ui='toggle'][data-part='root'][data-disabled] {
|
|
257
|
+
background: transparent;
|
|
258
|
+
color: var(--slotted-toggle-disabled-color, var(--slotted-disabled-foreground, GrayText));
|
|
259
|
+
cursor: not-allowed;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
[data-ui='toggle'][data-part='root'][data-variant='outline']:disabled,
|
|
263
|
+
[data-ui='toggle'][data-part='root'][data-variant='outline'][data-disabled] {
|
|
264
|
+
border-color: var(
|
|
265
|
+
--slotted-toggle-disabled-border-color,
|
|
266
|
+
var(--slotted-disabled-border, GrayText)
|
|
267
|
+
);
|
|
268
|
+
/* Nothing a person cannot reach is lifted off the page. */
|
|
269
|
+
box-shadow: none;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* A control that is on and unavailable keeps both facts. The ground says
|
|
274
|
+
* unavailable and the edge says on, in the same two places the live state
|
|
275
|
+
* uses them — so the reader still learns the mode from a control they
|
|
276
|
+
* cannot change. In `high-contrast` the ground is the page's own white, and
|
|
277
|
+
* the edge is then the only thing carrying it.
|
|
278
|
+
*/
|
|
279
|
+
[data-ui='toggle'][data-part='root'][data-pressed]:disabled,
|
|
280
|
+
[data-ui='toggle'][data-part='root'][data-pressed][data-disabled] {
|
|
281
|
+
background: var(
|
|
282
|
+
--slotted-toggle-disabled-pressed-background,
|
|
283
|
+
var(--slotted-disabled-background, ButtonFace)
|
|
284
|
+
);
|
|
285
|
+
border-color: var(
|
|
286
|
+
--slotted-toggle-pressed-border-color,
|
|
287
|
+
var(--slotted-tone-accent-border, Highlight)
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-control-border-color",
|
|
3
|
+
"--slotted-control-border-width",
|
|
4
|
+
"--slotted-control-font-family",
|
|
5
|
+
"--slotted-control-font-size-lg",
|
|
6
|
+
"--slotted-control-font-size-md",
|
|
7
|
+
"--slotted-control-font-size-sm",
|
|
8
|
+
"--slotted-control-font-weight",
|
|
9
|
+
"--slotted-control-gap-lg",
|
|
10
|
+
"--slotted-control-gap-md",
|
|
11
|
+
"--slotted-control-gap-sm",
|
|
12
|
+
"--slotted-control-height-lg",
|
|
13
|
+
"--slotted-control-height-md",
|
|
14
|
+
"--slotted-control-height-sm",
|
|
15
|
+
"--slotted-control-icon-size-lg",
|
|
16
|
+
"--slotted-control-icon-size-md",
|
|
17
|
+
"--slotted-control-icon-size-sm",
|
|
18
|
+
"--slotted-control-letter-spacing",
|
|
19
|
+
"--slotted-control-line-height",
|
|
20
|
+
"--slotted-control-padding-inline-lg",
|
|
21
|
+
"--slotted-control-padding-inline-md",
|
|
22
|
+
"--slotted-control-padding-inline-sm",
|
|
23
|
+
"--slotted-control-radius",
|
|
24
|
+
"--slotted-control-shadow",
|
|
25
|
+
"--slotted-control-transition-duration",
|
|
26
|
+
"--slotted-control-transition-easing",
|
|
27
|
+
"--slotted-disabled-background",
|
|
28
|
+
"--slotted-disabled-border",
|
|
29
|
+
"--slotted-disabled-foreground",
|
|
30
|
+
"--slotted-duration-instant",
|
|
31
|
+
"--slotted-focus-ring-color",
|
|
32
|
+
"--slotted-focus-ring-offset",
|
|
33
|
+
"--slotted-focus-ring-width",
|
|
34
|
+
"--slotted-text",
|
|
35
|
+
"--slotted-toggle-active-background",
|
|
36
|
+
"--slotted-toggle-border-color",
|
|
37
|
+
"--slotted-toggle-color",
|
|
38
|
+
"--slotted-toggle-disabled-border-color",
|
|
39
|
+
"--slotted-toggle-disabled-color",
|
|
40
|
+
"--slotted-toggle-disabled-pressed-background",
|
|
41
|
+
"--slotted-toggle-hover-background",
|
|
42
|
+
"--slotted-toggle-pressed-background",
|
|
43
|
+
"--slotted-toggle-pressed-border-color",
|
|
44
|
+
"--slotted-toggle-pressed-color",
|
|
45
|
+
"--slotted-toggle-pressed-hover-background",
|
|
46
|
+
"--slotted-toggle-radius",
|
|
47
|
+
"--slotted-toggle-shadow",
|
|
48
|
+
"--slotted-tone-accent-border",
|
|
49
|
+
"--slotted-tone-accent-subtle-active",
|
|
50
|
+
"--slotted-tone-accent-subtle-hover",
|
|
51
|
+
"--slotted-tone-accent-text",
|
|
52
|
+
"--slotted-tone-secondary-subtle-active",
|
|
53
|
+
"--slotted-tone-secondary-subtle-hover"
|
|
54
|
+
]
|