@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,665 @@
|
|
|
1
|
+
@layer slotted.components {
|
|
2
|
+
/**
|
|
3
|
+
* ── A time field, a trigger, and a list of times behind them ───────────
|
|
4
|
+
*
|
|
5
|
+
* ┌─ root ──────────────────────────────────────────────────────────┐
|
|
6
|
+
* │ ┌─ control ─────────────────────────────────────────────────┐ │
|
|
7
|
+
* │ │ time-field ┌ trigger ┐ │ │
|
|
8
|
+
* │ └───────────────────────────────────────────────────────────┘ │
|
|
9
|
+
* └─────────────────────────────────────────────────────────────────┘
|
|
10
|
+
* ┌─ positioner ─ the layer ────────────────────────────────┐
|
|
11
|
+
* │ ┌─ content ─ the surface ──────────────────────────┐ │
|
|
12
|
+
* │ │ head: now │ presets │ │
|
|
13
|
+
* │ │ list ─ option · option · option │ │
|
|
14
|
+
* │ │ footer │ │
|
|
15
|
+
* │ └──────────────────────────────────────────────────┘ │
|
|
16
|
+
* └────────────────────────────────────────────────────────┘
|
|
17
|
+
*
|
|
18
|
+
* `time-field` inside keeps its own `data-ui`, so nothing here restyles a
|
|
19
|
+
* segment: this stylesheet owns the frame that holds the field, the trigger,
|
|
20
|
+
* and the layer the list stands on. A list of times at a step has one axis,
|
|
21
|
+
* which is why the surface is a listbox and not a grid — and why this family
|
|
22
|
+
* composes `select`'s machinery rather than `calendar`'s.
|
|
23
|
+
*
|
|
24
|
+
* One shape, at every step. A column per unit was drawn and withdrawn — the
|
|
25
|
+
* field already types every second — and so was an hour heading over the
|
|
26
|
+
* rows, which repeated the hour each row already carries. What is left is a
|
|
27
|
+
* list, and the length of it is answered by where the panel opens, by
|
|
28
|
+
* type-ahead, and by PageUp and PageDown.
|
|
29
|
+
*/
|
|
30
|
+
[data-ui='time-picker'][data-part='root'] {
|
|
31
|
+
display: block;
|
|
32
|
+
/* The anchor the positioner measures is the control, and a block root
|
|
33
|
+
lets the frame take the width the form gave it. */
|
|
34
|
+
inline-size: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The box the positioner measures, and nothing else.
|
|
39
|
+
*
|
|
40
|
+
* It draws no frame: the `time-field` inside it draws its own, and the
|
|
41
|
+
* trigger is handed to that field's `end` slot by the binding.
|
|
42
|
+
*/
|
|
43
|
+
[data-ui='time-picker'] [data-part='control'] {
|
|
44
|
+
--_icon-size: var(--slotted-control-icon-size-md, 16px);
|
|
45
|
+
--_height: var(--slotted-control-height-md, 34px);
|
|
46
|
+
|
|
47
|
+
align-items: center;
|
|
48
|
+
display: flex;
|
|
49
|
+
inline-size: 100%;
|
|
50
|
+
min-inline-size: 0;
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-ui='time-picker'][data-part='root'][data-size='sm'] [data-part='control'] {
|
|
55
|
+
--_icon-size: var(--slotted-control-icon-size-sm, 14px);
|
|
56
|
+
--_height: var(--slotted-control-height-sm, 30px);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-ui='time-picker'][data-part='root'][data-size='lg'] [data-part='control'] {
|
|
60
|
+
--_icon-size: var(--slotted-control-icon-size-lg, 18px);
|
|
61
|
+
--_height: var(--slotted-control-height-lg, 38px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The button that opens the list. It sits inside the field's frame, at the
|
|
66
|
+
* reading end, and takes the same inner-control box every other family puts
|
|
67
|
+
* inside a frame.
|
|
68
|
+
*
|
|
69
|
+
* It is always drawn. Angular Material records why: ChromeOS turns
|
|
70
|
+
* `Alt`+`ArrowDown` into `PageDown` before the browser sees it, so the chord
|
|
71
|
+
* cannot be the only way in.
|
|
72
|
+
*
|
|
73
|
+
* The mark is a clock and not a chevron, for the reason `date-picker`'s is a
|
|
74
|
+
* calendar: a chevron says "a list of choices opens here", and what opens
|
|
75
|
+
* here is a clock's worth of them. The glyph names the kind of value the
|
|
76
|
+
* control holds, which is the one thing about it that never changes — so it
|
|
77
|
+
* does not turn while the surface is open either. It is a `Glyph` the
|
|
78
|
+
* binding draws inside an `icon` box, at the field's icon step.
|
|
79
|
+
*/
|
|
80
|
+
[data-ui='time-picker'] [data-part='trigger'] {
|
|
81
|
+
--slotted-icon-size: var(--_icon-size);
|
|
82
|
+
|
|
83
|
+
align-items: center;
|
|
84
|
+
appearance: none;
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
block-size: var(
|
|
87
|
+
--slotted-time-picker-trigger-size,
|
|
88
|
+
min(
|
|
89
|
+
calc(var(--_icon-size) + 2 * var(--slotted-space-2, 0.25rem)),
|
|
90
|
+
calc(
|
|
91
|
+
var(--_height) - var(--slotted-control-border-width, 1px) * 2 -
|
|
92
|
+
var(--slotted-space-2, 0.25rem)
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
);
|
|
96
|
+
border: 0;
|
|
97
|
+
border-radius: var(--slotted-time-picker-radius, var(--slotted-control-radius, 4px));
|
|
98
|
+
color: var(--slotted-time-picker-trigger-color, var(--slotted-text-muted, GrayText));
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
flex: 0 0 auto;
|
|
102
|
+
inline-size: var(
|
|
103
|
+
--slotted-time-picker-trigger-size,
|
|
104
|
+
min(
|
|
105
|
+
calc(var(--_icon-size) + 2 * var(--slotted-space-2, 0.25rem)),
|
|
106
|
+
calc(
|
|
107
|
+
var(--_height) - var(--slotted-control-border-width, 1px) * 2 -
|
|
108
|
+
var(--slotted-space-2, 0.25rem)
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
);
|
|
112
|
+
justify-content: center;
|
|
113
|
+
padding: 0;
|
|
114
|
+
position: relative;
|
|
115
|
+
touch-action: manipulation;
|
|
116
|
+
transition:
|
|
117
|
+
background-color var(--slotted-control-transition-duration)
|
|
118
|
+
var(--slotted-control-transition-easing),
|
|
119
|
+
color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
|
|
120
|
+
-webkit-tap-highlight-color: transparent;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* The hit area, recovered outside the paint, exactly as every other inner
|
|
124
|
+
control in the library recovers it. */
|
|
125
|
+
[data-ui='time-picker'] [data-part='trigger']::after {
|
|
126
|
+
content: '';
|
|
127
|
+
inset: min(0px, calc((100% - var(--slotted-target-min, 24px)) / 2));
|
|
128
|
+
position: absolute;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* On a finger the target is the comfortable size in both axes and the box
|
|
132
|
+
is the one a mouse sees: the ground and the focus ring stay square, and
|
|
133
|
+
the hit area above grows to 44 pixels around them. Before the field's
|
|
134
|
+
clear it does not reach across it. */
|
|
135
|
+
@media (pointer: coarse) {
|
|
136
|
+
[data-ui='time-picker'] [data-part='trigger']::after {
|
|
137
|
+
inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-ui='time-picker']
|
|
141
|
+
[data-part='end']:has(+ [data-part='clear']:not([hidden]))
|
|
142
|
+
> [data-part='trigger']::after {
|
|
143
|
+
inset-inline-end: 0;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[data-ui='time-picker'] [data-part='trigger']:hover:not(:disabled):not([data-disabled]) {
|
|
148
|
+
background-color: var(
|
|
149
|
+
--slotted-time-picker-trigger-hover-background,
|
|
150
|
+
var(--slotted-tone-secondary-subtle-hover)
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
[data-ui='time-picker'] [data-part='trigger']:active:not(:disabled):not([data-disabled]) {
|
|
155
|
+
background-color: var(
|
|
156
|
+
--slotted-time-picker-trigger-active-background,
|
|
157
|
+
var(--slotted-tone-secondary-subtle-active)
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Its own ring: tabbing from the last segment to the trigger has to move
|
|
162
|
+
something visible, and the frame's ring would sit still. */
|
|
163
|
+
[data-ui='time-picker'] [data-part='trigger']:focus-visible {
|
|
164
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
165
|
+
outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
[data-ui='time-picker'][data-part='root'][data-invalid] {
|
|
169
|
+
--slotted-focus-ring-color: var(
|
|
170
|
+
--slotted-time-picker-invalid-focus-ring-color,
|
|
171
|
+
var(--slotted-focus-ring-color-invalid, Highlight)
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[data-ui='time-picker'] [data-part='trigger']:disabled {
|
|
176
|
+
color: var(--slotted-disabled-foreground);
|
|
177
|
+
cursor: not-allowed;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* ── The layer ────────────────────────────────────────────────────────
|
|
181
|
+
*
|
|
182
|
+
* What `packages/core/src/positioner` writes `position`, `left` and `top`
|
|
183
|
+
* onto. The painted surface is one element in, as every anchored family in
|
|
184
|
+
* the library is built.
|
|
185
|
+
*/
|
|
186
|
+
[data-ui='time-picker'][data-part='positioner'] {
|
|
187
|
+
/* Only the block inset: the positioner writes `left` and never `right`,
|
|
188
|
+
and `inset-inline-start` would resolve to `right` in a right-to-left
|
|
189
|
+
document and win over the measured value. */
|
|
190
|
+
position: absolute;
|
|
191
|
+
inset-block-start: 0;
|
|
192
|
+
|
|
193
|
+
box-sizing: border-box;
|
|
194
|
+
isolation: isolate;
|
|
195
|
+
/* The layer is only a frame around the surface; the surface takes the
|
|
196
|
+
pointer, and the frame must not swallow a press meant for the page. */
|
|
197
|
+
pointer-events: none;
|
|
198
|
+
z-index: calc(var(--slotted-z-index-popover, 1100) + var(--slotted-layer-depth, 0));
|
|
199
|
+
|
|
200
|
+
/* The layer arrives along the axis it opens on and never along the inline
|
|
201
|
+
one, which is the rule `select` records. */
|
|
202
|
+
--_enter-distance: var(--slotted-space-2, 0.25rem);
|
|
203
|
+
opacity: 0;
|
|
204
|
+
translate: 0 calc(-1 * var(--_enter-distance));
|
|
205
|
+
transition:
|
|
206
|
+
opacity var(--slotted-duration-short) var(--slotted-easing-exit),
|
|
207
|
+
translate var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
[data-ui='time-picker'][data-part='positioner'][data-side='top'] {
|
|
211
|
+
translate: 0 var(--_enter-distance);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* A lateral side has no block direction to arrive from, so it only fades. */
|
|
215
|
+
[data-ui='time-picker'][data-part='positioner']:is([data-side='left'], [data-side='right']) {
|
|
216
|
+
translate: 0 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
[data-ui='time-picker'][data-part='positioner'][data-open] {
|
|
220
|
+
opacity: 1;
|
|
221
|
+
translate: 0 0;
|
|
222
|
+
transition: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* The entrance is a keyframe animation and not a transition, for the reason
|
|
227
|
+
* `select` records: a transition starts from the style the browser computed
|
|
228
|
+
* last, and the positioner writes `data-side` in the same style update as
|
|
229
|
+
* the family opens the layer. A layer written open in static markup — the
|
|
230
|
+
* harness, a docs snippet — is simply there, and is photographed where it
|
|
231
|
+
* stands.
|
|
232
|
+
*/
|
|
233
|
+
[data-ui='time-picker'][data-part='positioner'][data-open][data-positioned] {
|
|
234
|
+
animation: slotted-time-picker-enter-down var(--slotted-duration-medium)
|
|
235
|
+
var(--slotted-easing-enter);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
[data-ui='time-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'] {
|
|
239
|
+
animation-name: slotted-time-picker-enter-up;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
[data-ui='time-picker'][data-part='positioner'][data-open][data-positioned]:is(
|
|
243
|
+
[data-side='left'],
|
|
244
|
+
[data-side='right']
|
|
245
|
+
) {
|
|
246
|
+
animation-name: slotted-time-picker-fade;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@keyframes slotted-time-picker-enter-down {
|
|
250
|
+
from {
|
|
251
|
+
opacity: 0;
|
|
252
|
+
translate: 0 calc(-1 * var(--_enter-distance));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@keyframes slotted-time-picker-enter-up {
|
|
257
|
+
from {
|
|
258
|
+
opacity: 0;
|
|
259
|
+
translate: 0 var(--_enter-distance);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@keyframes slotted-time-picker-fade {
|
|
264
|
+
from {
|
|
265
|
+
opacity: 0;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* Stillness keeps the fade and drops the movement. */
|
|
270
|
+
@media (prefers-reduced-motion: reduce) {
|
|
271
|
+
[data-ui='time-picker'][data-part='positioner'],
|
|
272
|
+
[data-ui='time-picker'][data-part='positioner'][data-side='top'],
|
|
273
|
+
[data-ui='time-picker'][data-part='positioner'][data-side='left'],
|
|
274
|
+
[data-ui='time-picker'][data-part='positioner'][data-side='right'] {
|
|
275
|
+
translate: 0 0;
|
|
276
|
+
transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
[data-ui='time-picker'][data-part='positioner'][data-open][data-positioned],
|
|
280
|
+
[data-ui='time-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'],
|
|
281
|
+
[data-ui='time-picker'][data-part='positioner'][data-open][data-positioned][data-side='left'],
|
|
282
|
+
[data-ui='time-picker'][data-part='positioner'][data-open][data-positioned][data-side='right'] {
|
|
283
|
+
animation-name: slotted-time-picker-fade;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* The anchor scrolled out of its own clipper. The list is still open and
|
|
288
|
+
still belongs to a control the reader can no longer see. */
|
|
289
|
+
[data-ui='time-picker'][data-part='positioner'][data-detached] {
|
|
290
|
+
visibility: hidden;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* The surface.
|
|
295
|
+
*
|
|
296
|
+
* A grid of `auto` tracks rather than a wrapping flex row, for the reason
|
|
297
|
+
* `date-picker` records: a footer running the whole width as a flex item
|
|
298
|
+
* needs `flex-basis: 100%`, which is a percentage against a container being
|
|
299
|
+
* shrink-wrapped from its contents, and the browser resolves the circle by
|
|
300
|
+
* making the surface wider than anything in it.
|
|
301
|
+
*
|
|
302
|
+
* Its inline size is the anchor's, floored so a narrow field does not
|
|
303
|
+
* produce a column too tight to read a time in, and capped so a wide form
|
|
304
|
+
* does not stretch one column of times across a page.
|
|
305
|
+
*/
|
|
306
|
+
[data-ui='time-picker'] [data-part='content'] {
|
|
307
|
+
background-color: var(--slotted-time-picker-surface, var(--slotted-surface-raised, Canvas));
|
|
308
|
+
border: var(--slotted-border-width-thin, 1px) solid
|
|
309
|
+
var(--slotted-time-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
310
|
+
border-radius: var(--slotted-time-picker-content-radius, var(--slotted-radius-lg, 8px));
|
|
311
|
+
box-shadow: var(--slotted-time-picker-content-shadow, var(--slotted-shadow-md));
|
|
312
|
+
box-sizing: border-box;
|
|
313
|
+
color: var(--slotted-time-picker-content-color, var(--slotted-text, CanvasText));
|
|
314
|
+
/**
|
|
315
|
+
* One row's height, stated once, because the panel's cap is counted in
|
|
316
|
+
* rows: eight and a half of them at every density. Read from the control
|
|
317
|
+
* scale rather than from the target floor alone, so a dense panel shrinks
|
|
318
|
+
* its rows and its cap together — the first dense capture shrank only the
|
|
319
|
+
* cap and showed six options where the comfortable one showed nine, which
|
|
320
|
+
* is density changing what a reader can see rather than how much room it
|
|
321
|
+
* takes.
|
|
322
|
+
*
|
|
323
|
+
* The pitch is the row plus the air under it, because that is what the cap
|
|
324
|
+
* has to count: eight row *heights* left the ninth row entirely outside
|
|
325
|
+
* the box, and the half-row that says the list scrolls was never drawn.
|
|
326
|
+
*/
|
|
327
|
+
--_row: max(var(--slotted-target-min, 24px), var(--slotted-control-height-sm, 30px));
|
|
328
|
+
--_row-pitch: calc(var(--_row) + var(--slotted-space-1, 0.125rem));
|
|
329
|
+
|
|
330
|
+
display: grid;
|
|
331
|
+
gap: var(--slotted-space-2, 0.25rem);
|
|
332
|
+
grid-template-areas: 'head' 'list' 'footer';
|
|
333
|
+
grid-template-columns: minmax(0, 1fr);
|
|
334
|
+
/**
|
|
335
|
+
* The anchor's width, floored so a narrow field does not produce a column
|
|
336
|
+
* too tight to read a time in, and capped so a wide form does not stretch
|
|
337
|
+
* one column of times across a page.
|
|
338
|
+
*
|
|
339
|
+
* The fallback is the floor rather than `auto` or `100%`: the property is
|
|
340
|
+
* written by the positioner and is absent wherever the surface is drawn
|
|
341
|
+
* without one — the harness, a docs snippet — and `min(auto, …)` is not a
|
|
342
|
+
* value, so the whole declaration would be dropped. `100%` is no answer
|
|
343
|
+
* either, and `table` paid for it in the same week: a percentage against a
|
|
344
|
+
* block being shrink-wrapped from its contents resolves to the contents.
|
|
345
|
+
*/
|
|
346
|
+
inline-size: max(
|
|
347
|
+
var(--slotted-time-picker-content-min-inline-size, 11rem),
|
|
348
|
+
min(var(--slotted-positioner-anchor-width, 11rem), 20rem)
|
|
349
|
+
);
|
|
350
|
+
padding: var(--slotted-time-picker-content-padding, var(--slotted-space-3, 0.375rem));
|
|
351
|
+
/* The layer above gave up the pointer; the surface takes it back. */
|
|
352
|
+
pointer-events: auto;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* The shortcuts take a column of their own only when there are any — and the
|
|
357
|
+
* surface stops being the anchor's width when they do. A second column
|
|
358
|
+
* inside a box sized to the field leaves the times about a hundred pixels
|
|
359
|
+
* wide, which is a column of numbers nobody chose that shape for; the
|
|
360
|
+
* surface shrink-wraps its two columns instead, capped by the room the
|
|
361
|
+
* positioner measured.
|
|
362
|
+
*/
|
|
363
|
+
[data-ui='time-picker'] [data-part='content']:has([data-part='presets']) {
|
|
364
|
+
grid-template-areas: 'presets head' 'presets list' 'footer footer';
|
|
365
|
+
grid-template-columns: auto minmax(9rem, 1fr);
|
|
366
|
+
inline-size: auto;
|
|
367
|
+
max-inline-size: min(28rem, var(--slotted-positioner-available-width, 28rem));
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* The head: one press for the current time, which is what a reader who never
|
|
372
|
+
* discovers that `+` opens an expression still has.
|
|
373
|
+
*/
|
|
374
|
+
[data-ui='time-picker'] [data-part='head'] {
|
|
375
|
+
align-items: center;
|
|
376
|
+
display: flex;
|
|
377
|
+
gap: var(--slotted-space-2, 0.25rem);
|
|
378
|
+
grid-area: head;
|
|
379
|
+
justify-content: flex-start;
|
|
380
|
+
padding-block-end: var(--slotted-space-2, 0.25rem);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
[data-ui='time-picker'] [data-part='now'] {
|
|
384
|
+
appearance: none;
|
|
385
|
+
background-color: transparent;
|
|
386
|
+
border: 0;
|
|
387
|
+
border-radius: var(--slotted-time-picker-option-radius, var(--slotted-radius-sm, 4px));
|
|
388
|
+
color: var(--slotted-time-picker-now-color, var(--slotted-tone-accent-text));
|
|
389
|
+
cursor: pointer;
|
|
390
|
+
font: inherit;
|
|
391
|
+
min-block-size: var(--slotted-target-min, 24px);
|
|
392
|
+
padding-block: var(--slotted-space-1, 0.125rem);
|
|
393
|
+
/* The option's own inset, so the control and the times it stands above run
|
|
394
|
+
down one left edge rather than two a few pixels apart. */
|
|
395
|
+
padding-inline: var(--slotted-space-3, 0.375rem);
|
|
396
|
+
touch-action: manipulation;
|
|
397
|
+
transition: background-color var(--slotted-control-transition-duration)
|
|
398
|
+
var(--slotted-control-transition-easing);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
[data-ui='time-picker'] [data-part='now']:hover:not(:disabled):not([data-disabled]) {
|
|
402
|
+
background-color: var(
|
|
403
|
+
--slotted-time-picker-option-hover-background,
|
|
404
|
+
var(--slotted-tone-secondary-subtle-hover)
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
[data-ui='time-picker'] [data-part='now']:focus-visible {
|
|
409
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
410
|
+
outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* The consumer's own shortcuts. This family ships no list of them: "start of
|
|
415
|
+
* the shift" is a business clock, and a library that guessed at one would be
|
|
416
|
+
* guessing at an industry. What it ships is the column they stand in.
|
|
417
|
+
*/
|
|
418
|
+
[data-ui='time-picker'] [data-part='presets'] {
|
|
419
|
+
align-items: flex-start;
|
|
420
|
+
border-inline-end: var(--slotted-border-width-thin, 1px) solid
|
|
421
|
+
var(--slotted-time-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
422
|
+
display: flex;
|
|
423
|
+
flex-direction: column;
|
|
424
|
+
gap: var(--slotted-space-2, 0.25rem);
|
|
425
|
+
grid-area: presets;
|
|
426
|
+
padding-inline-end: var(--slotted-space-3, 0.375rem);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* ── The list ─────────────────────────────────────────────────────────
|
|
430
|
+
*
|
|
431
|
+
* One column of times, capped in control heights so the cap holds at every
|
|
432
|
+
* density and every type step, and scrolled rather than truncated: a day of
|
|
433
|
+
* quarter-hours is ninety-six rows and every one of them is choosable.
|
|
434
|
+
*/
|
|
435
|
+
[data-ui='time-picker'] [data-part='list'] {
|
|
436
|
+
display: flex;
|
|
437
|
+
flex-direction: column;
|
|
438
|
+
/**
|
|
439
|
+
* One step of air between rows, so the chosen row's painted ground and the
|
|
440
|
+
* focused row's inset ring never share an edge. Touching, the two read as
|
|
441
|
+
* one band with a dark underline rather than as two states of two rows.
|
|
442
|
+
*/
|
|
443
|
+
gap: var(--slotted-space-1, 0.125rem);
|
|
444
|
+
grid-area: list;
|
|
445
|
+
/* Eight rows and half of the ninth. The half is the point: a list cut on a
|
|
446
|
+
row boundary looks like the whole list, and a reader who cannot see that
|
|
447
|
+
ninety-six times are available never scrolls for them. */
|
|
448
|
+
max-block-size: var(--slotted-time-picker-list-block-size, calc(var(--_row-pitch) * 8.5));
|
|
449
|
+
min-inline-size: 0;
|
|
450
|
+
overflow-y: auto;
|
|
451
|
+
/**
|
|
452
|
+
* No reserved gutter. The list's length is fixed for the life of the
|
|
453
|
+
* panel — the step, the bounds and the predicate are all settled before it
|
|
454
|
+
* opens — so there is no crossing of the scroll threshold to protect the
|
|
455
|
+
* rows from, and a gutter reserved on one side alone left every row ending
|
|
456
|
+
* twenty-one pixels short of the panel it sits in.
|
|
457
|
+
*/
|
|
458
|
+
/* A highlight moved by a key lands whole rather than half under the edge. */
|
|
459
|
+
scroll-padding-block: var(--slotted-space-2, 0.25rem);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* One time.
|
|
464
|
+
*
|
|
465
|
+
* The whole time on every row, which is what a reader choosing a slot wants
|
|
466
|
+
* to read: `09:15` says more at a glance than a `15` in a column of minutes,
|
|
467
|
+
* and the column shape exists for the steps where a flat list cannot.
|
|
468
|
+
*/
|
|
469
|
+
[data-ui='time-picker'] [data-part='option'] {
|
|
470
|
+
align-items: center;
|
|
471
|
+
background-color: transparent;
|
|
472
|
+
border-radius: var(--slotted-time-picker-option-radius, var(--slotted-radius-sm, 4px));
|
|
473
|
+
color: inherit;
|
|
474
|
+
cursor: pointer;
|
|
475
|
+
display: flex;
|
|
476
|
+
flex: 0 0 auto;
|
|
477
|
+
font-variant-numeric: tabular-nums;
|
|
478
|
+
gap: var(--slotted-space-2, 0.25rem);
|
|
479
|
+
/* The row *is* `--_row`: no block padding on top of it, so eight rows are
|
|
480
|
+
eight rows and the cap that counts them is arithmetic rather than an
|
|
481
|
+
estimate. A time never wraps, so there is nothing for the padding to
|
|
482
|
+
protect. */
|
|
483
|
+
min-block-size: var(--_row);
|
|
484
|
+
padding-inline: var(--slotted-space-3, 0.375rem);
|
|
485
|
+
transition:
|
|
486
|
+
background-color var(--slotted-control-transition-duration)
|
|
487
|
+
var(--slotted-control-transition-easing),
|
|
488
|
+
color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
|
|
489
|
+
user-select: none;
|
|
490
|
+
-webkit-tap-highlight-color: transparent;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/* ── Option states ────────────────────────────────────────────────────
|
|
494
|
+
*
|
|
495
|
+
* Written strongest last, and each weaker one guarded against every stronger
|
|
496
|
+
* one it can meet, which is the order `STATE_PRECEDENCE` sets: the chosen
|
|
497
|
+
* time outranks the highlight, and the highlight outranks the pointer.
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* The pointer is the weakest of the four, so it stands down for all three of
|
|
502
|
+
* the others — not only for `disabled`.
|
|
503
|
+
*
|
|
504
|
+
* Specificity is what makes this a rule rather than an ordering: a hover
|
|
505
|
+
* selector carrying `:hover` and one `:not()` outweighs a plain
|
|
506
|
+
* `[data-selected]`, so the chosen row turned grey under the pointer however
|
|
507
|
+
* far down the file its own rule was written. `states.test.mjs` guards the
|
|
508
|
+
* `disabled` half of `STATE_PRECEDENCE` and nothing else, which is why this
|
|
509
|
+
* one was found by a reader rather than by a test.
|
|
510
|
+
*/
|
|
511
|
+
[data-ui='time-picker']
|
|
512
|
+
[data-part='option']:hover:not([data-disabled]):not([data-selected]):not([data-current]) {
|
|
513
|
+
background-color: var(
|
|
514
|
+
--slotted-time-picker-option-hover-background,
|
|
515
|
+
var(--slotted-tone-secondary-subtle-hover)
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Where a key will act. Focus is real here — the reader is inside the list
|
|
521
|
+
* and a roving tabindex moves them — so the ring is the one every other
|
|
522
|
+
* focusable row in the library draws, inset so it is not clipped by the
|
|
523
|
+
* scroller's own edge. It stands down for the chosen row, which outranks it.
|
|
524
|
+
*/
|
|
525
|
+
[data-ui='time-picker'] [data-part='option'][data-current]:not([data-selected]) {
|
|
526
|
+
background-color: var(
|
|
527
|
+
--slotted-time-picker-option-current-background,
|
|
528
|
+
var(--slotted-tone-secondary-subtle-active)
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
[data-ui='time-picker'] [data-part='option']:focus-visible {
|
|
533
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
534
|
+
outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
[data-ui='time-picker'] [data-part='option'][data-selected] {
|
|
538
|
+
background-color: var(
|
|
539
|
+
--slotted-time-picker-option-selected-background,
|
|
540
|
+
var(--slotted-tone-accent-solid)
|
|
541
|
+
);
|
|
542
|
+
color: var(--slotted-time-picker-option-selected-color, var(--slotted-tone-accent-on-solid));
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* The chosen row still answers the pointer — one step along its own tone,
|
|
547
|
+
* rather than the grey every other row takes. Measured on the default theme:
|
|
548
|
+
* rgb(29 78 216) at rest and rgb(42 91 220) under the pointer, which is the
|
|
549
|
+
* same blue and a visible change. A row that swapped colour family under the
|
|
550
|
+
* pointer read as a different row, and that is the defect this pair replaces.
|
|
551
|
+
*/
|
|
552
|
+
[data-ui='time-picker'] [data-part='option'][data-selected]:hover:not([data-disabled]) {
|
|
553
|
+
background-color: var(
|
|
554
|
+
--slotted-time-picker-option-selected-hover-background,
|
|
555
|
+
var(--slotted-tone-accent-solid-hover)
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* A time a bound or the predicate refuses. It stays in the list by default,
|
|
561
|
+
* because a list that silently drops rows is a list whose step the reader
|
|
562
|
+
* cannot infer — and it is muted to the colour the theme measures rather
|
|
563
|
+
* than faded by opacity, so it stays readable.
|
|
564
|
+
*/
|
|
565
|
+
[data-ui='time-picker'] [data-part='option'][data-disabled] {
|
|
566
|
+
background-color: transparent;
|
|
567
|
+
color: var(--slotted-disabled-foreground);
|
|
568
|
+
cursor: not-allowed;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Nothing available at all — `min` above `max`, or a predicate that refuses
|
|
573
|
+
* every step. It is a sentence rather than an empty box: MUI draws nothing
|
|
574
|
+
* here and Ant draws an empty column, and both read as a broken component.
|
|
575
|
+
*/
|
|
576
|
+
[data-ui='time-picker'] [data-part='empty'] {
|
|
577
|
+
align-items: center;
|
|
578
|
+
color: var(--slotted-time-picker-label-color, var(--slotted-text-muted, GrayText));
|
|
579
|
+
display: flex;
|
|
580
|
+
grid-area: list;
|
|
581
|
+
justify-content: center;
|
|
582
|
+
min-block-size: calc(var(--_row) * 2);
|
|
583
|
+
padding: var(--slotted-space-4, 0.5rem);
|
|
584
|
+
text-align: center;
|
|
585
|
+
text-wrap: balance;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
[data-ui='time-picker'] [data-part='footer'] {
|
|
589
|
+
align-items: center;
|
|
590
|
+
border-block-start: var(--slotted-border-width-thin, 1px) solid
|
|
591
|
+
var(--slotted-time-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
592
|
+
display: flex;
|
|
593
|
+
gap: var(--slotted-space-2, 0.25rem);
|
|
594
|
+
grid-area: footer;
|
|
595
|
+
justify-content: flex-end;
|
|
596
|
+
padding-block-start: var(--slotted-space-3, 0.375rem);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/* ── Narrow, on a finger ──────────────────────────────────────────────
|
|
600
|
+
*
|
|
601
|
+
* §2.7 of `docs/component-features.md` asks for it by name: a popover on the
|
|
602
|
+
* desktop and a sheet in a narrow viewport. The DOM does not change, so the
|
|
603
|
+
* decision is testable without a device — and the query is on the viewport
|
|
604
|
+
* rather than on a container because a layer in a portal has no container to
|
|
605
|
+
* ask, and the question really is how much screen there is.
|
|
606
|
+
*/
|
|
607
|
+
@media (max-width: 480px) and (pointer: coarse) {
|
|
608
|
+
[data-ui='time-picker'][data-part='positioner'][data-presentation='sheet'] {
|
|
609
|
+
/* The positioner's own measurement is overridden here on purpose: a
|
|
610
|
+
sheet is not placed against an anchor, it is placed against the
|
|
611
|
+
screen. */
|
|
612
|
+
inset: auto 0 0;
|
|
613
|
+
position: fixed;
|
|
614
|
+
translate: 0 var(--slotted-space-9, 2rem);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
[data-ui='time-picker'][data-part='positioner'][data-presentation='sheet'][data-open] {
|
|
618
|
+
translate: 0 0;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
[data-ui='time-picker'][data-part='positioner'][data-presentation='sheet']
|
|
622
|
+
[data-part='content'] {
|
|
623
|
+
border-end-end-radius: 0;
|
|
624
|
+
border-end-start-radius: 0;
|
|
625
|
+
border-inline: 0;
|
|
626
|
+
border-block-end: 0;
|
|
627
|
+
inline-size: var(--slotted-time-picker-sheet-inline-size, 100%);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/* A sheet has the screen's height to spend, so the list takes more of it
|
|
631
|
+
rather than staying at the popover's eight rows and a half. */
|
|
632
|
+
[data-ui='time-picker'][data-part='positioner'][data-presentation='sheet'] [data-part='list'] {
|
|
633
|
+
max-block-size: 50vh;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
[data-ui='time-picker'][data-part='positioner'][data-presentation='sheet']
|
|
637
|
+
[data-part='presets'] {
|
|
638
|
+
/* Beside the list there is no room for a column of shortcuts, so they
|
|
639
|
+
become a row above it and keep their labels. */
|
|
640
|
+
border-inline-end: 0;
|
|
641
|
+
border-block-end: var(--slotted-border-width-thin, 1px) solid
|
|
642
|
+
var(--slotted-time-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
643
|
+
flex-direction: row;
|
|
644
|
+
flex-wrap: wrap;
|
|
645
|
+
padding-block-end: var(--slotted-space-3, 0.375rem);
|
|
646
|
+
padding-inline-end: 0;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
@media (forced-colors: active) {
|
|
651
|
+
/* The chosen row and the highlighted row both lose their painted grounds,
|
|
652
|
+
so each says what it is with a system pair the operating system
|
|
653
|
+
guarantees legible together. */
|
|
654
|
+
[data-ui='time-picker'] [data-part='option'][data-selected] {
|
|
655
|
+
background-color: Highlight;
|
|
656
|
+
color: HighlightText;
|
|
657
|
+
forced-color-adjust: none;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
[data-ui='time-picker'] [data-part='option'][data-current]:not([data-selected]) {
|
|
661
|
+
outline: var(--slotted-focus-ring-width, 2px) solid Highlight;
|
|
662
|
+
outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|