@slotted/styles 0.0.0-stage → 0.1.0-beta.0
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,75 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-border-subtle",
|
|
3
|
+
"--slotted-border-width-thin",
|
|
4
|
+
"--slotted-command-palette-active",
|
|
5
|
+
"--slotted-command-palette-border-color",
|
|
6
|
+
"--slotted-command-palette-footer-surface",
|
|
7
|
+
"--slotted-command-palette-highlight",
|
|
8
|
+
"--slotted-command-palette-highlight-ring",
|
|
9
|
+
"--slotted-command-palette-hover",
|
|
10
|
+
"--slotted-command-palette-item-radius",
|
|
11
|
+
"--slotted-command-palette-list-max-block-size",
|
|
12
|
+
"--slotted-command-palette-list-padding",
|
|
13
|
+
"--slotted-command-palette-measure",
|
|
14
|
+
"--slotted-command-palette-page-surface",
|
|
15
|
+
"--slotted-command-palette-placeholder-fade",
|
|
16
|
+
"--slotted-command-palette-radius",
|
|
17
|
+
"--slotted-command-palette-separator-color",
|
|
18
|
+
"--slotted-command-palette-shadow",
|
|
19
|
+
"--slotted-command-palette-surface",
|
|
20
|
+
"--slotted-command-palette-text",
|
|
21
|
+
"--slotted-command-palette-text-muted",
|
|
22
|
+
"--slotted-control-font-size-lg",
|
|
23
|
+
"--slotted-control-font-size-md",
|
|
24
|
+
"--slotted-control-font-size-sm",
|
|
25
|
+
"--slotted-control-gap-lg",
|
|
26
|
+
"--slotted-control-gap-md",
|
|
27
|
+
"--slotted-control-gap-sm",
|
|
28
|
+
"--slotted-control-height-lg",
|
|
29
|
+
"--slotted-control-height-md",
|
|
30
|
+
"--slotted-control-height-sm",
|
|
31
|
+
"--slotted-control-icon-size-lg",
|
|
32
|
+
"--slotted-control-icon-size-md",
|
|
33
|
+
"--slotted-control-icon-size-sm",
|
|
34
|
+
"--slotted-control-inner-size-lg",
|
|
35
|
+
"--slotted-control-inner-size-md",
|
|
36
|
+
"--slotted-control-inner-size-sm",
|
|
37
|
+
"--slotted-control-padding-inline-lg",
|
|
38
|
+
"--slotted-control-padding-inline-md",
|
|
39
|
+
"--slotted-control-padding-inline-sm",
|
|
40
|
+
"--slotted-control-radius",
|
|
41
|
+
"--slotted-control-transition-duration",
|
|
42
|
+
"--slotted-control-transition-easing",
|
|
43
|
+
"--slotted-disabled-foreground",
|
|
44
|
+
"--slotted-duration-short",
|
|
45
|
+
"--slotted-easing-standard",
|
|
46
|
+
"--slotted-focus-ring-color",
|
|
47
|
+
"--slotted-focus-ring-width",
|
|
48
|
+
"--slotted-font-family-sans",
|
|
49
|
+
"--slotted-font-size-lg",
|
|
50
|
+
"--slotted-font-size-xs",
|
|
51
|
+
"--slotted-font-weight-medium",
|
|
52
|
+
"--slotted-font-weight-semibold",
|
|
53
|
+
"--slotted-line-height-md",
|
|
54
|
+
"--slotted-line-height-sm",
|
|
55
|
+
"--slotted-line-height-xs",
|
|
56
|
+
"--slotted-radius-lg",
|
|
57
|
+
"--slotted-radius-sm",
|
|
58
|
+
"--slotted-shadow-lg",
|
|
59
|
+
"--slotted-space-2",
|
|
60
|
+
"--slotted-space-3",
|
|
61
|
+
"--slotted-space-4",
|
|
62
|
+
"--slotted-space-6",
|
|
63
|
+
"--slotted-space-8",
|
|
64
|
+
"--slotted-surface-raised",
|
|
65
|
+
"--slotted-surface-sunken",
|
|
66
|
+
"--slotted-target-comfortable",
|
|
67
|
+
"--slotted-target-min",
|
|
68
|
+
"--slotted-text",
|
|
69
|
+
"--slotted-text-muted",
|
|
70
|
+
"--slotted-tone-accent-border",
|
|
71
|
+
"--slotted-tone-accent-surface",
|
|
72
|
+
"--slotted-tone-accent-text",
|
|
73
|
+
"--slotted-tone-secondary-subtle-active",
|
|
74
|
+
"--slotted-tone-secondary-subtle-hover"
|
|
75
|
+
]
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
@layer slotted.components {
|
|
2
|
+
/**
|
|
3
|
+
* Container bounds the inline size of a region, insets it from the edge of
|
|
4
|
+
* the space it was given, and places it inside that space. It paints
|
|
5
|
+
* nothing: a layout that carried a colour would be a surface, and a surface
|
|
6
|
+
* is another family's decision.
|
|
7
|
+
*
|
|
8
|
+
* The root lays three tracks — a start gutter, the bounded column, an end
|
|
9
|
+
* gutter — rather than setting a maximum on the box itself. The reason is
|
|
10
|
+
* the breakout: a child that has to reach both edges needs a track to span,
|
|
11
|
+
* and a box bounded by its own maximum has nothing to offer it. Inset for
|
|
12
|
+
* the same reason is a floor on the two gutters and never a pad on the box,
|
|
13
|
+
* because a pad would inset the breakout too.
|
|
14
|
+
*
|
|
15
|
+
* Every value travels through a private property so the three axes can be
|
|
16
|
+
* read against each other in one declaration instead of restating the
|
|
17
|
+
* template four times.
|
|
18
|
+
*/
|
|
19
|
+
[data-ui='container'] {
|
|
20
|
+
--_max: var(--slotted-container-content, 56rem);
|
|
21
|
+
--_inset: var(--slotted-space-6, 1rem);
|
|
22
|
+
--_start-track: 1fr;
|
|
23
|
+
--_end-track: 1fr;
|
|
24
|
+
|
|
25
|
+
display: grid;
|
|
26
|
+
/**
|
|
27
|
+
* The column takes the smaller of its maximum and what is left after both
|
|
28
|
+
* gutters, so it collapses continuously as the container narrows. There is
|
|
29
|
+
* no breakpoint to be unstable around, and nothing to reflow.
|
|
30
|
+
*/
|
|
31
|
+
grid-template-columns:
|
|
32
|
+
[full-start] minmax(var(--_inset), var(--_start-track))
|
|
33
|
+
[content-start] min(100% - 2 * var(--_inset), var(--_max))
|
|
34
|
+
[content-end] minmax(var(--_inset), var(--_end-track))
|
|
35
|
+
[full-end];
|
|
36
|
+
/**
|
|
37
|
+
* The maximum belongs to the column, so the box itself takes everything it
|
|
38
|
+
* is offered. Without this a container placed in a flex row would size to
|
|
39
|
+
* its content and bound nothing.
|
|
40
|
+
*/
|
|
41
|
+
inline-size: 100%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A grid item is at least as wide as its content unless it is told
|
|
46
|
+
* otherwise, so a single unbroken token — a URL, an identifier — would widen
|
|
47
|
+
* the track past its maximum and scroll the page sideways, which is the
|
|
48
|
+
* failure WCAG SC 1.4.10 names. The column holds; what to do with the
|
|
49
|
+
* overflow is the child's decision.
|
|
50
|
+
*/
|
|
51
|
+
[data-ui='container'] > * {
|
|
52
|
+
grid-column: content;
|
|
53
|
+
min-inline-size: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A child that leaves the bound behind and reaches both edges of the
|
|
58
|
+
* container: a table, a banner, a strip of media inside a page of prose.
|
|
59
|
+
* It answers the container rather than the viewport, so it is still correct
|
|
60
|
+
* nested, inside a scroll region, and in a container that does not fill the
|
|
61
|
+
* page — none of which the `50% - 50vw` recipe survives. Bounded content
|
|
62
|
+
* returns inside it by nesting another container.
|
|
63
|
+
*/
|
|
64
|
+
[data-ui='container'] > [data-part='breakout'] {
|
|
65
|
+
grid-column: full;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The steps are named for what they bound. `sm`/`md`/`lg` is this library's
|
|
70
|
+
* word for control geometry, and a container's maximum is not that: it is
|
|
71
|
+
* chosen by what is inside it, and a letter hides the choice.
|
|
72
|
+
*
|
|
73
|
+
* `measure` is stated in characters because that is the unit a measure has.
|
|
74
|
+
* A maximum stated in pixels gets *longer* in characters when the reader
|
|
75
|
+
* enlarges the text, which is the opposite of what the bound is for; `ch`
|
|
76
|
+
* follows the inherited type and the reader's zoom. WCAG SC 1.4.8 caps a
|
|
77
|
+
* line at eighty characters, and `ch` is the advance of "0" — wider than the
|
|
78
|
+
* average glyph in a proportional face — so sixty-five of them land under
|
|
79
|
+
* that ceiling rather than over it.
|
|
80
|
+
*
|
|
81
|
+
* The two page steps state a literal because the foundation has no scale of
|
|
82
|
+
* widths: space stops at 4rem and is about separation, not extent. Three
|
|
83
|
+
* values read by one family is not a scale, so they stay family tokens.
|
|
84
|
+
*/
|
|
85
|
+
[data-ui='container'][data-size='measure'] {
|
|
86
|
+
--_max: var(--slotted-container-measure, 65ch);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-ui='container'][data-size='content'] {
|
|
90
|
+
--_max: var(--slotted-container-content, 56rem);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-ui='container'][data-size='wide'] {
|
|
94
|
+
--_max: var(--slotted-container-wide, 80rem);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* `full` is what the frame gives, up to a ceiling, and `bleed` is the
|
|
99
|
+
* absence of a ceiling. The names are that way round because the value
|
|
100
|
+
* written without thinking has to be the safe one: `full` is what a person
|
|
101
|
+
* types to mean "use the screen", and an application that typed it on every
|
|
102
|
+
* route was unreadable on an ultra-wide display — a line of text three
|
|
103
|
+
* thousand pixels long, a form whose label and field were a screen apart.
|
|
104
|
+
* 120rem is a 1920-pixel display, where `full` and `bleed` are the same
|
|
105
|
+
* picture; past it the content stops and centres.
|
|
106
|
+
*
|
|
107
|
+
* `bleed` keeps the old behaviour and has to be asked for by name: a data
|
|
108
|
+
* grid, a board, a canvas — content that is worth every pixel it is given,
|
|
109
|
+
* and reads better at three thousand pixels than at nineteen hundred.
|
|
110
|
+
* Neither removes the container: the gutters stay in both.
|
|
111
|
+
*/
|
|
112
|
+
[data-ui='container'][data-size='full'] {
|
|
113
|
+
--_max: var(--slotted-container-full, 120rem);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[data-ui='container'][data-size='bleed'] {
|
|
117
|
+
--_max: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The inset is a step of the space scale the layout families take their gap
|
|
122
|
+
* from, so a page gutter and a stack gap are retuned by one theme decision.
|
|
123
|
+
* It does not answer density: how tightly controls are packed is not a
|
|
124
|
+
* composition decision, and a page frame that moved every time a table got
|
|
125
|
+
* denser would be the page reflowing for no reason.
|
|
126
|
+
*/
|
|
127
|
+
[data-ui='container'][data-inset='0'] {
|
|
128
|
+
--_inset: 0px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-ui='container'][data-inset='1'] {
|
|
132
|
+
--_inset: var(--slotted-space-1, 0.125rem);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
[data-ui='container'][data-inset='2'] {
|
|
136
|
+
--_inset: var(--slotted-space-2, 0.25rem);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
[data-ui='container'][data-inset='3'] {
|
|
140
|
+
--_inset: var(--slotted-space-3, 0.375rem);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
[data-ui='container'][data-inset='4'] {
|
|
144
|
+
--_inset: var(--slotted-space-4, 0.5rem);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[data-ui='container'][data-inset='5'] {
|
|
148
|
+
--_inset: var(--slotted-space-5, 0.75rem);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-ui='container'][data-inset='6'] {
|
|
152
|
+
--_inset: var(--slotted-space-6, 1rem);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
[data-ui='container'][data-inset='7'] {
|
|
156
|
+
--_inset: var(--slotted-space-7, 1.25rem);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-ui='container'][data-inset='8'] {
|
|
160
|
+
--_inset: var(--slotted-space-8, 1.5rem);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-ui='container'][data-inset='9'] {
|
|
164
|
+
--_inset: var(--slotted-space-9, 2rem);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-ui='container'][data-inset='10'] {
|
|
168
|
+
--_inset: var(--slotted-space-10, 2.5rem);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
[data-ui='container'][data-inset='11'] {
|
|
172
|
+
--_inset: var(--slotted-space-11, 3rem);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[data-ui='container'][data-inset='12'] {
|
|
176
|
+
--_inset: var(--slotted-space-12, 4rem);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Where the column sits when there is spare space. It is expressed as the
|
|
181
|
+
* growth limit of a gutter: `1fr` takes a share of what is free, and the
|
|
182
|
+
* inset itself pins a gutter to its floor. Track order follows the writing
|
|
183
|
+
* direction, so a right-to-left document is the same component mirrored
|
|
184
|
+
* rather than a second stylesheet.
|
|
185
|
+
*/
|
|
186
|
+
[data-ui='container'][data-align='center'] {
|
|
187
|
+
--_start-track: 1fr;
|
|
188
|
+
--_end-track: 1fr;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-ui='container'][data-align='start'] {
|
|
192
|
+
--_start-track: var(--_inset);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
[data-ui='container'][data-align='end'] {
|
|
196
|
+
--_end-track: var(--_inset);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-container-content",
|
|
3
|
+
"--slotted-container-full",
|
|
4
|
+
"--slotted-container-measure",
|
|
5
|
+
"--slotted-container-wide",
|
|
6
|
+
"--slotted-space-1",
|
|
7
|
+
"--slotted-space-10",
|
|
8
|
+
"--slotted-space-11",
|
|
9
|
+
"--slotted-space-12",
|
|
10
|
+
"--slotted-space-2",
|
|
11
|
+
"--slotted-space-3",
|
|
12
|
+
"--slotted-space-4",
|
|
13
|
+
"--slotted-space-5",
|
|
14
|
+
"--slotted-space-6",
|
|
15
|
+
"--slotted-space-7",
|
|
16
|
+
"--slotted-space-8",
|
|
17
|
+
"--slotted-space-9"
|
|
18
|
+
]
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
@layer slotted.components {
|
|
2
|
+
/**
|
|
3
|
+
* The target of a context menu: the region the reader presses with the
|
|
4
|
+
* secondary button, holds on a touch screen, or opens with `Shift+F10`.
|
|
5
|
+
*
|
|
6
|
+
* ┌─ root ─ the target ─ data-open ─ data-pressed ──────────────┐
|
|
7
|
+
* │ the consumer's content: a row, a card, a canvas │
|
|
8
|
+
* └──────────────────────────────────────────────────────────────┘
|
|
9
|
+
* ┌─ [data-ui='menu'] ─ unchanged ─┐ ← anchored to the point
|
|
10
|
+
*
|
|
11
|
+
* The family owns this one part and no surface: the menu that opens is
|
|
12
|
+
* `menu`, imported as it is, the way `menubar` holds it. Radix's context menu
|
|
13
|
+
* re-exports sixteen parts its dropdown already has, and two copies of one
|
|
14
|
+
* machine drift.
|
|
15
|
+
*
|
|
16
|
+
* ── Why the target paints nothing at rest ────────────────────────────
|
|
17
|
+
*
|
|
18
|
+
* Its content is the consumer's. A wash on hover would claim a row that
|
|
19
|
+
* `table` already paints; a ground would fight the card it wraps. What the
|
|
20
|
+
* stylesheet owns is the three moments the family adds to the region: the
|
|
21
|
+
* long press, the open menu, and the browser's own menu taking over.
|
|
22
|
+
*/
|
|
23
|
+
[data-ui='context-menu'] {
|
|
24
|
+
/* The mark Finder and Explorer leave on the row whose menu is showing:
|
|
25
|
+
one line, inward, in the colour that separates two surfaces. A consumer
|
|
26
|
+
whose target already shows its selection sets the width to `0`. */
|
|
27
|
+
--_mark-width: var(--slotted-context-menu-mark-width, var(--slotted-border-width-thin, 1px));
|
|
28
|
+
--_mark-color: var(--slotted-context-menu-mark-color, var(--slotted-border-strong, CanvasText));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* On a coarse pointer a long press on a link or an image inside the target
|
|
33
|
+
* raises the platform's own callout — the sheet iOS draws with "Open" and
|
|
34
|
+
* "Copy" — over the family's menu. It is turned off for the whole target
|
|
35
|
+
* rather than only during the press, because the callout is decided by the
|
|
36
|
+
* platform at `touchstart`, before any state the family writes could apply.
|
|
37
|
+
*/
|
|
38
|
+
@media (pointer: coarse) {
|
|
39
|
+
[data-ui='context-menu'] {
|
|
40
|
+
-webkit-touch-callout: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* While a long press is running the press must not become a text selection,
|
|
46
|
+
* which is what a held finger otherwise starts at the same moment. Only
|
|
47
|
+
* then: a target that is text stays selectable at rest, and a mouse never
|
|
48
|
+
* sets the state at all.
|
|
49
|
+
*/
|
|
50
|
+
[data-ui='context-menu'][data-pressed] {
|
|
51
|
+
-webkit-user-select: none;
|
|
52
|
+
user-select: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The open mark is a pseudo-element laid over the whole target rather than a
|
|
57
|
+
* shadow on the target's own box: the region's content — a card with a
|
|
58
|
+
* ground of its own, a row's cells — paints over the target's background,
|
|
59
|
+
* and an inset shadow drawn there showed only at the corners the content's
|
|
60
|
+
* radius left uncovered. Laid on top, the mark takes no room, follows the
|
|
61
|
+
* target's own corner through `border-radius: inherit`, and lets every press
|
|
62
|
+
* through. It is not an outline, because an outline in this library is the
|
|
63
|
+
* focus ring and nothing else (`focus-ring.test.mjs`).
|
|
64
|
+
*
|
|
65
|
+
* The target is positioned so the overlay has a box to fill. It is
|
|
66
|
+
* positioned at rest rather than only while open, so nothing inside the
|
|
67
|
+
* region moves at the moment the menu appears.
|
|
68
|
+
*/
|
|
69
|
+
[data-ui='context-menu'] {
|
|
70
|
+
position: relative;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-ui='context-menu']::after {
|
|
74
|
+
border-radius: inherit;
|
|
75
|
+
box-shadow: inset 0 0 0 var(--_mark-width) transparent;
|
|
76
|
+
content: '';
|
|
77
|
+
inset: 0;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
position: absolute;
|
|
80
|
+
transition: box-shadow var(--slotted-duration-short) var(--slotted-easing-standard);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[data-ui='context-menu'][data-open]::after {
|
|
84
|
+
box-shadow: inset 0 0 0 var(--_mark-width) var(--_mark-color);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A target the consumer made focusable — a row with roving focus, a tile with
|
|
89
|
+
* `tabindex` — takes the foundation ring, so `Shift+F10` is pressed on a
|
|
90
|
+
* region the reader can see they are on. The open mark is gone by the time
|
|
91
|
+
* focus returns, so the two are never drawn together.
|
|
92
|
+
*/
|
|
93
|
+
[data-ui='context-menu']:focus-visible {
|
|
94
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
95
|
+
outline-offset: var(--slotted-focus-ring-offset, 2px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* `disabled` means the browser's own menu is the one that opens, and the
|
|
100
|
+
* family writes nothing: a region that looks disabled while its content
|
|
101
|
+
* still works would say the wrong thing. The state is in the DOM for a
|
|
102
|
+
* consumer who wants to say it.
|
|
103
|
+
*/
|
|
104
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-border-strong",
|
|
3
|
+
"--slotted-border-width-thin",
|
|
4
|
+
"--slotted-context-menu-mark-color",
|
|
5
|
+
"--slotted-context-menu-mark-width",
|
|
6
|
+
"--slotted-duration-short",
|
|
7
|
+
"--slotted-easing-standard",
|
|
8
|
+
"--slotted-focus-ring-color",
|
|
9
|
+
"--slotted-focus-ring-offset",
|
|
10
|
+
"--slotted-focus-ring-width"
|
|
11
|
+
]
|