@slotted/styles 0.1.0-beta.4 → 0.1.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -1
- package/src/accordion/accordion.css +31 -13
- package/src/accordion/accordion.tokens.json +2 -0
- package/src/action-bar/action-bar.css +47 -44
- package/src/action-bar/action-bar.tokens.json +1 -0
- package/src/action-sheet/action-sheet.css +39 -39
- package/src/alert/alert.css +97 -97
- package/src/alert/alert.tokens.json +6 -1
- package/src/app-shell/app-shell.css +472 -342
- package/src/app-shell/app-shell.tokens.json +6 -3
- package/src/aspect-ratio/aspect-ratio.css +24 -23
- package/src/attachment/attachment.css +118 -114
- package/src/avatar/avatar.css +97 -67
- package/src/avatar/avatar.tokens.json +8 -0
- package/src/avatar-group/avatar-group.css +22 -23
- package/src/badge/badge.css +58 -47
- package/src/badge/badge.tokens.json +6 -0
- package/src/breadcrumb/breadcrumb.css +52 -52
- package/src/button/button.css +408 -93
- package/src/button/button.tokens.json +13 -0
- package/src/button-group/button-group.css +80 -79
- package/src/button-group/button-group.tokens.json +1 -0
- package/src/calendar/calendar.css +594 -267
- package/src/calendar/calendar.tokens.json +35 -3
- package/src/card/card.css +133 -70
- package/src/card/card.tokens.json +1 -0
- package/src/carousel/carousel.css +158 -169
- package/src/cascader/cascader.css +174 -159
- package/src/cascader/cascader.tokens.json +2 -0
- package/src/chart/chart.css +300 -271
- package/src/chart/chart.tokens.json +5 -0
- package/src/checkbox/checkbox.css +190 -148
- package/src/checkbox/checkbox.tokens.json +4 -0
- package/src/checkbox-group/checkbox-group.css +7 -7
- package/src/clock/clock.css +246 -0
- package/src/clock/clock.tokens.json +44 -0
- package/src/code-block/code-block.css +85 -89
- package/src/collapsible/collapsible.css +273 -85
- package/src/collapsible/collapsible.tokens.json +6 -0
- package/src/color-picker/color-picker.css +106 -114
- package/src/column-manager/column-manager.css +111 -119
- package/src/combobox/combobox.css +219 -132
- package/src/combobox/combobox.tokens.json +4 -0
- package/src/command-palette/command-palette.css +214 -102
- package/src/command-palette/command-palette.tokens.json +4 -0
- package/src/container/container.css +27 -27
- package/src/context-menu/context-menu.css +9 -9
- package/src/currency-field/currency-field.css +119 -119
- package/src/currency-field/currency-field.tokens.json +1 -0
- package/src/dashboard-grid/dashboard-grid.css +231 -115
- package/src/dashboard-grid/dashboard-grid.tokens.json +3 -1
- package/src/data-grid/data-grid.css +637 -496
- package/src/data-grid/data-grid.tokens.json +5 -1
- package/src/data-list/data-list.css +93 -76
- package/src/data-list/data-list.tokens.json +2 -1
- package/src/date-field/date-field.css +62 -57
- package/src/date-field/date-field.tokens.json +1 -0
- package/src/date-picker/date-picker.css +31 -269
- package/src/date-picker/date-picker.tokens.json +1 -21
- package/src/date-range-picker/date-range-picker.css +72 -528
- package/src/date-range-picker/date-range-picker.tokens.json +1 -37
- package/src/datetime-field/datetime-field.css +90 -90
- package/src/datetime-field/datetime-field.tokens.json +1 -0
- package/src/datetime-picker/datetime-picker.css +49 -711
- package/src/datetime-picker/datetime-picker.tokens.json +1 -50
- package/src/datetime-range-picker/datetime-range-picker.css +60 -985
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +1 -67
- package/src/description-list/description-list.css +120 -76
- package/src/description-list/description-list.tokens.json +1 -0
- package/src/detail-panel/detail-panel.css +86 -71
- package/src/detail-panel/detail-panel.tokens.json +2 -0
- package/src/dialog/dialog.css +462 -199
- package/src/dialog/dialog.tokens.json +10 -0
- package/src/divider/divider.css +20 -20
- package/src/drawer/drawer.css +736 -237
- package/src/drawer/drawer.tokens.json +15 -0
- package/src/entity-picker/entity-picker.css +402 -272
- package/src/entity-picker/entity-picker.tokens.json +6 -0
- package/src/event-calendar/event-calendar.css +357 -399
- package/src/field/field.css +106 -93
- package/src/field/field.tokens.json +2 -0
- package/src/field-group/field-group.css +58 -38
- package/src/field-group/field-group.tokens.json +3 -0
- package/src/filter-bar/filter-bar.css +224 -216
- package/src/floating-panel/floating-panel.css +147 -0
- package/src/floating-panel/floating-panel.tokens.json +32 -0
- package/src/form/form.css +103 -26
- package/src/form/form.tokens.json +6 -1
- package/src/fullscreen/fullscreen.css +26 -27
- package/src/grid/grid.css +32 -31
- package/src/highlight/highlight.css +11 -11
- package/src/hover-card/hover-card.css +9 -9
- package/src/icon/icon.css +67 -20
- package/src/icon/icon.tokens.json +1 -0
- package/src/image/image.css +42 -42
- package/src/import-export-center/import-export-center.css +147 -168
- package/src/import-export-center/import-export-center.tokens.json +1 -0
- package/src/inline/inline.css +29 -29
- package/src/inline-message/inline-message.css +162 -86
- package/src/inline-message/inline-message.tokens.json +5 -0
- package/src/kbd/kbd.css +63 -51
- package/src/kbd/kbd.tokens.json +4 -0
- package/src/link/link.css +54 -33
- package/src/link/link.tokens.json +4 -0
- package/src/list/list.css +55 -24
- package/src/list/list.tokens.json +2 -0
- package/src/list-item/list-item.css +195 -80
- package/src/list-item/list-item.tokens.json +10 -0
- package/src/listbox/listbox.css +121 -72
- package/src/listbox/listbox.tokens.json +6 -1
- package/src/loading-overlay/loading-overlay.css +86 -103
- package/src/markdown/markdown.css +20 -20
- package/src/media-viewer/media-viewer.css +790 -0
- package/src/media-viewer/media-viewer.tokens.json +53 -0
- package/src/menu/menu.css +166 -83
- package/src/menu/menu.tokens.json +3 -1
- package/src/menubar/menubar.css +16 -16
- package/src/message/message.css +1296 -1243
- package/src/message/message.tokens.json +14 -0
- package/src/message-scroller/message-scroller.css +323 -320
- package/src/meter/meter.css +136 -0
- package/src/meter/meter.tokens.json +23 -0
- package/src/multi-select/multi-select.css +246 -174
- package/src/multi-select/multi-select.tokens.json +3 -0
- package/src/navigation-menu/navigation-menu.css +170 -191
- package/src/navigation-menu/navigation-menu.tokens.json +1 -0
- package/src/notification-center/notification-center.css +155 -163
- package/src/notification-center/notification-center.tokens.json +4 -0
- package/src/number-field/number-field.css +93 -93
- package/src/number-field/number-field.tokens.json +1 -0
- package/src/otp-input/otp-input.css +74 -64
- package/src/otp-input/otp-input.tokens.json +1 -0
- package/src/page/page.css +109 -31
- package/src/page/page.tokens.json +8 -0
- package/src/page-header/page-header.css +342 -287
- package/src/page-header/page-header.tokens.json +6 -1
- package/src/pagination/pagination.css +75 -79
- package/src/picker-panel/picker-panel.css +1074 -0
- package/src/picker-panel/picker-panel.tokens.json +77 -0
- package/src/popover/popover.css +85 -65
- package/src/popover/popover.tokens.json +2 -0
- package/src/progress-indicator/progress-indicator.css +194 -137
- package/src/progress-indicator/progress-indicator.tokens.json +1 -0
- package/src/prompt-composer/prompt-composer.css +274 -116
- package/src/prompt-composer/prompt-composer.tokens.json +15 -0
- package/src/prose/prose.css +77 -82
- package/src/radio-group/radio-group.css +107 -112
- package/src/rating/rating.css +147 -143
- package/src/rating/rating.tokens.json +2 -0
- package/src/result-state/result-state.css +95 -102
- package/src/result-state/result-state.tokens.json +1 -0
- package/src/runtime-properties.mjs +44 -6
- package/src/saved-views/saved-views.css +43 -49
- package/src/scroll-area/scroll-area.css +50 -37
- package/src/section/section.css +311 -46
- package/src/section/section.tokens.json +13 -1
- package/src/segmented-control/segmented-control.css +221 -133
- package/src/segmented-control/segmented-control.tokens.json +7 -11
- package/src/select/select.css +226 -149
- package/src/select/select.tokens.json +4 -0
- package/src/side-navigation/side-navigation.css +204 -201
- package/src/side-navigation/side-navigation.tokens.json +2 -0
- package/src/skeleton/skeleton.css +76 -58
- package/src/slider/slider.css +108 -104
- package/src/slider/slider.tokens.json +1 -0
- package/src/sparkline/sparkline.css +75 -53
- package/src/sparkline/sparkline.tokens.json +2 -0
- package/src/spinner/spinner.css +83 -180
- package/src/spinner/spinner.tokens.json +0 -1
- package/src/split-button/split-button.css +34 -35
- package/src/split-button/split-button.tokens.json +1 -0
- package/src/splitter/splitter.css +47 -48
- package/src/stack/stack.css +26 -26
- package/src/stat-card/stat-card.css +420 -245
- package/src/stat-card/stat-card.tokens.json +8 -0
- package/src/status-indicator/status-indicator.css +126 -101
- package/src/status-indicator/status-indicator.tokens.json +0 -3
- package/src/stepper/stepper.css +78 -82
- package/src/switch/switch.css +143 -125
- package/src/switch/switch.tokens.json +4 -0
- package/src/table/table.css +653 -222
- package/src/table/table.tokens.json +10 -0
- package/src/table-of-contents/table-of-contents.css +60 -59
- package/src/table-of-contents/table-of-contents.tokens.json +1 -0
- package/src/tabs/tabs.css +327 -294
- package/src/tabs/tabs.tokens.json +7 -1
- package/src/tag/tag.css +113 -89
- package/src/tag/tag.tokens.json +11 -0
- package/src/tags-input/tags-input.css +152 -87
- package/src/tags-input/tags-input.tokens.json +7 -1
- package/src/text-field/text-field.css +146 -148
- package/src/text-field/text-field.tokens.json +1 -0
- package/src/textarea/textarea.css +38 -33
- package/src/textarea/textarea.tokens.json +1 -0
- package/src/time-field/time-field.css +82 -77
- package/src/time-field/time-field.tokens.json +1 -0
- package/src/time-picker/time-picker.css +30 -519
- package/src/time-picker/time-picker.tokens.json +1 -38
- package/src/time-range-picker/time-range-picker.css +53 -895
- package/src/time-range-picker/time-range-picker.tokens.json +1 -66
- package/src/timeline/timeline.css +280 -292
- package/src/timeline/timeline.tokens.json +5 -0
- package/src/toast/toast.css +139 -122
- package/src/toast/toast.tokens.json +7 -0
- package/src/toggle/toggle.css +34 -38
- package/src/toggle-group/toggle-group.css +73 -77
- package/src/toolbar/toolbar.css +49 -40
- package/src/toolbar/toolbar.tokens.json +2 -1
- package/src/tooltip/tooltip.css +95 -39
- package/src/tooltip/tooltip.tokens.json +1 -0
- package/src/top-navigation/top-navigation.css +253 -269
- package/src/top-navigation/top-navigation.tokens.json +1 -0
- package/src/tour/tour.css +68 -74
- package/src/tour/tour.tokens.json +1 -0
- package/src/transfer/transfer.css +164 -168
- package/src/tree/tree.css +118 -122
- package/src/typography/typography.css +67 -38
- package/src/typography/typography.tokens.json +2 -0
- package/src/upload/upload.css +256 -257
- package/src/visually-hidden/visually-hidden.css +1 -1
- package/src/wizard/wizard.css +187 -199
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
@layer slotted.components {
|
|
2
2
|
/**
|
|
3
|
-
* ── A date field, a trigger, and a
|
|
3
|
+
* ── A date field, a trigger, and a month behind them ───────────────────
|
|
4
4
|
*
|
|
5
5
|
* ┌─ root ──────────────────────────────────────────────────────────┐
|
|
6
6
|
* │ ┌─ control ─────────────────────────────────────────────────┐ │
|
|
7
7
|
* │ │ date-field ┌ trigger ┐ │ │
|
|
8
8
|
* │ └───────────────────────────────────────────────────────────┘ │
|
|
9
9
|
* └─────────────────────────────────────────────────────────────────┘
|
|
10
|
-
*
|
|
11
|
-
* │ ┌─ content ─ the surface ──────────────────────────┐ │
|
|
12
|
-
* │ │ presets │ calendar │ │
|
|
13
|
-
* │ │ footer │ │
|
|
14
|
-
* │ └──────────────────────────────────────────────────┘ │
|
|
15
|
-
* └────────────────────────────────────────────────────────┘
|
|
10
|
+
* the panel is `picker-panel`'s, and the month in it `calendar`'s
|
|
16
11
|
*
|
|
17
|
-
* The
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* another family's parts would be a second place to fix one defect.
|
|
12
|
+
* The families inside keep their own `data-ui`, so nothing here restyles a
|
|
13
|
+
* segment or a day: this stylesheet owns the frame that holds the field, and
|
|
14
|
+
* the trigger.
|
|
21
15
|
*/
|
|
22
|
-
[data-ui
|
|
16
|
+
[data-ui-date-picker][data-part-root] {
|
|
23
17
|
display: block;
|
|
18
|
+
/* In a flex row the item's basis is its content, not the whole row. */
|
|
19
|
+
flex-basis: content;
|
|
24
20
|
/* The anchor the positioner measures is the control, and a block root
|
|
25
21
|
lets the frame take the width the form gave it. */
|
|
26
22
|
inline-size: 100%;
|
|
@@ -35,7 +31,7 @@
|
|
|
35
31
|
* would then have to reach into another family's parts to suppress the first
|
|
36
32
|
* — which is the rule the whole family is built to keep.
|
|
37
33
|
*/
|
|
38
|
-
[data-ui
|
|
34
|
+
[data-ui-date-picker] [data-part-control] {
|
|
39
35
|
--_icon-size: var(--slotted-control-icon-size-md, 16px);
|
|
40
36
|
--_height: var(--slotted-control-height-md, 34px);
|
|
41
37
|
|
|
@@ -46,12 +42,21 @@
|
|
|
46
42
|
position: relative;
|
|
47
43
|
}
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The `date-field` is the control's flex item, and its own basis is its
|
|
47
|
+
* content. It grows to the control, so the frame takes the width the field
|
|
48
|
+
* gave the root: the whole field at `full`, the step at `short` and `medium`.
|
|
49
|
+
*/
|
|
50
|
+
[data-ui-date-picker] [data-part-control] > [data-ui-date-field] {
|
|
51
|
+
flex: 1 1 auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-ui-date-picker][data-part-root][data-size='sm'] [data-part-control] {
|
|
50
55
|
--_icon-size: var(--slotted-control-icon-size-sm, 14px);
|
|
51
56
|
--_height: var(--slotted-control-height-sm, 30px);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
[data-ui
|
|
59
|
+
[data-ui-date-picker][data-part-root][data-size='lg'] [data-part-control] {
|
|
55
60
|
--_icon-size: var(--slotted-control-icon-size-lg, 18px);
|
|
56
61
|
--_height: var(--slotted-control-height-lg, 38px);
|
|
57
62
|
}
|
|
@@ -65,7 +70,7 @@
|
|
|
65
70
|
* `Alt`+`ArrowDown` into `PageDown` before the browser sees it, so the chord
|
|
66
71
|
* cannot be the only way in.
|
|
67
72
|
*/
|
|
68
|
-
[data-ui
|
|
73
|
+
[data-ui-date-picker] [data-part-trigger] {
|
|
69
74
|
--slotted-icon-size: var(--_icon-size);
|
|
70
75
|
|
|
71
76
|
align-items: center;
|
|
@@ -110,7 +115,7 @@
|
|
|
110
115
|
|
|
111
116
|
/* The hit area, recovered outside the paint, exactly as every other inner
|
|
112
117
|
control in the library recovers it. */
|
|
113
|
-
[data-ui
|
|
118
|
+
[data-ui-date-picker] [data-part-trigger]::after {
|
|
114
119
|
content: '';
|
|
115
120
|
inset: min(0px, calc((100% - var(--slotted-target-min, 24px)) / 2));
|
|
116
121
|
position: absolute;
|
|
@@ -121,13 +126,13 @@
|
|
|
121
126
|
the hit area above grows to 44 pixels around them. Before the field's
|
|
122
127
|
clear it does not reach across it. */
|
|
123
128
|
@media (pointer: coarse) {
|
|
124
|
-
[data-ui
|
|
129
|
+
[data-ui-date-picker] [data-part-trigger]::after {
|
|
125
130
|
inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
|
|
126
131
|
}
|
|
127
132
|
|
|
128
|
-
[data-ui
|
|
129
|
-
[data-part
|
|
130
|
-
> [data-part
|
|
133
|
+
[data-ui-date-picker]
|
|
134
|
+
[data-part-end]:has(+ [data-part-clear]:not([hidden]))
|
|
135
|
+
> [data-part-trigger]::after {
|
|
131
136
|
inset-inline-end: 0;
|
|
132
137
|
}
|
|
133
138
|
}
|
|
@@ -142,14 +147,14 @@
|
|
|
142
147
|
* that never changes.
|
|
143
148
|
*/
|
|
144
149
|
|
|
145
|
-
[data-ui
|
|
150
|
+
[data-ui-date-picker] [data-part-trigger]:hover:not(:disabled):not([data-disabled]) {
|
|
146
151
|
background-color: var(
|
|
147
152
|
--slotted-date-picker-trigger-hover-background,
|
|
148
153
|
var(--slotted-tone-secondary-subtle-hover)
|
|
149
154
|
);
|
|
150
155
|
}
|
|
151
156
|
|
|
152
|
-
[data-ui
|
|
157
|
+
[data-ui-date-picker] [data-part-trigger]:active:not(:disabled):not([data-disabled]) {
|
|
153
158
|
background-color: var(
|
|
154
159
|
--slotted-date-picker-trigger-active-background,
|
|
155
160
|
var(--slotted-tone-secondary-subtle-active)
|
|
@@ -158,263 +163,20 @@
|
|
|
158
163
|
|
|
159
164
|
/* Its own ring: tabbing from the last segment to the trigger has to move
|
|
160
165
|
something visible, and the frame's ring would sit still. */
|
|
161
|
-
[data-ui
|
|
166
|
+
[data-ui-date-picker] [data-part-trigger]:focus-visible {
|
|
162
167
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
163
168
|
outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
|
|
164
169
|
}
|
|
165
170
|
|
|
166
|
-
[data-ui
|
|
171
|
+
[data-ui-date-picker][data-part-root][data-invalid] {
|
|
167
172
|
--slotted-focus-ring-color: var(
|
|
168
173
|
--slotted-date-picker-invalid-focus-ring-color,
|
|
169
174
|
var(--slotted-focus-ring-color-invalid, Highlight)
|
|
170
175
|
);
|
|
171
176
|
}
|
|
172
177
|
|
|
173
|
-
[data-ui
|
|
178
|
+
[data-ui-date-picker] [data-part-trigger]:disabled {
|
|
174
179
|
color: var(--slotted-disabled-foreground);
|
|
175
180
|
cursor: not-allowed;
|
|
176
181
|
}
|
|
177
|
-
|
|
178
|
-
/* ── The layer ────────────────────────────────────────────────────────
|
|
179
|
-
*
|
|
180
|
-
* What `packages/core/src/positioner` writes `position`, `left` and `top`
|
|
181
|
-
* onto. The painted surface is one element in, as `tooltip`, `popover`,
|
|
182
|
-
* `menu` and `select` are all built.
|
|
183
|
-
*/
|
|
184
|
-
[data-ui='date-picker'][data-part='positioner'] {
|
|
185
|
-
/* Only the block inset: the positioner writes `left` and never `right`,
|
|
186
|
-
and `inset-inline-start` would resolve to `right` in a right-to-left
|
|
187
|
-
document and win over the measured value. */
|
|
188
|
-
position: absolute;
|
|
189
|
-
inset-block-start: 0;
|
|
190
|
-
|
|
191
|
-
box-sizing: border-box;
|
|
192
|
-
isolation: isolate;
|
|
193
|
-
/* The layer is only a frame around the surface; the surface takes the
|
|
194
|
-
pointer, and the frame must not swallow a press meant for the page. */
|
|
195
|
-
pointer-events: none;
|
|
196
|
-
z-index: calc(var(--slotted-z-index-popover, 1100) + var(--slotted-layer-depth, 0));
|
|
197
|
-
|
|
198
|
-
/* The layer arrives along the axis it opens on and never along the inline
|
|
199
|
-
one, which is the rule `select` records: a scale from the corner the
|
|
200
|
-
positioner named as origin moved the far edge and read as an entrance
|
|
201
|
-
from the side. */
|
|
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='date-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='date-picker'][data-part='positioner']:is([data-side='left'], [data-side='right']) {
|
|
216
|
-
translate: 0 0;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
[data-ui='date-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.
|
|
230
|
-
*
|
|
231
|
-
* Only a layer the positioner placed arrives. A layer written open in static
|
|
232
|
-
* markup — the harness, a docs snippet — is simply there, and is
|
|
233
|
-
* photographed where it stands.
|
|
234
|
-
*/
|
|
235
|
-
[data-ui='date-picker'][data-part='positioner'][data-open][data-positioned] {
|
|
236
|
-
animation: slotted-date-picker-enter-down var(--slotted-duration-medium)
|
|
237
|
-
var(--slotted-easing-enter);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
[data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'] {
|
|
241
|
-
animation-name: slotted-date-picker-enter-up;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
[data-ui='date-picker'][data-part='positioner'][data-open][data-positioned]:is(
|
|
245
|
-
[data-side='left'],
|
|
246
|
-
[data-side='right']
|
|
247
|
-
) {
|
|
248
|
-
animation-name: slotted-date-picker-fade;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
@keyframes slotted-date-picker-enter-down {
|
|
252
|
-
from {
|
|
253
|
-
opacity: 0;
|
|
254
|
-
translate: 0 calc(-1 * var(--_enter-distance));
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
@keyframes slotted-date-picker-enter-up {
|
|
259
|
-
from {
|
|
260
|
-
opacity: 0;
|
|
261
|
-
translate: 0 var(--_enter-distance);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
@keyframes slotted-date-picker-fade {
|
|
266
|
-
from {
|
|
267
|
-
opacity: 0;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/* Stillness keeps the fade and drops the movement. */
|
|
272
|
-
@media (prefers-reduced-motion: reduce) {
|
|
273
|
-
[data-ui='date-picker'][data-part='positioner'],
|
|
274
|
-
[data-ui='date-picker'][data-part='positioner'][data-side='top'],
|
|
275
|
-
[data-ui='date-picker'][data-part='positioner'][data-side='left'],
|
|
276
|
-
[data-ui='date-picker'][data-part='positioner'][data-side='right'] {
|
|
277
|
-
translate: 0 0;
|
|
278
|
-
transition: opacity var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
[data-ui='date-picker'][data-part='positioner'][data-open][data-positioned],
|
|
282
|
-
[data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='top'],
|
|
283
|
-
[data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='left'],
|
|
284
|
-
[data-ui='date-picker'][data-part='positioner'][data-open][data-positioned][data-side='right'] {
|
|
285
|
-
animation-name: slotted-date-picker-fade;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/* The anchor scrolled out of its own clipper. The calendar is still open and
|
|
290
|
-
still belongs to a control the reader can no longer see. */
|
|
291
|
-
[data-ui='date-picker'][data-part='positioner'][data-detached] {
|
|
292
|
-
visibility: hidden;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* The surface. It is sized by the calendar inside it rather than by the
|
|
297
|
-
* control it hangs from: a month is seven columns wide and a field is as
|
|
298
|
-
* wide as the form, and forcing one to the other would either crush the grid
|
|
299
|
-
* or stretch it.
|
|
300
|
-
*/
|
|
301
|
-
[data-ui='date-picker'] [data-part='content'] {
|
|
302
|
-
background-color: var(--slotted-date-picker-surface, var(--slotted-surface-raised, Canvas));
|
|
303
|
-
border: var(--slotted-border-width-thin, 1px) solid
|
|
304
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
305
|
-
border-radius: var(--slotted-date-picker-content-radius, var(--slotted-radius-lg, 8px));
|
|
306
|
-
box-shadow: var(--slotted-date-picker-content-shadow, var(--slotted-shadow-md));
|
|
307
|
-
box-sizing: border-box;
|
|
308
|
-
color: var(--slotted-date-picker-content-color, var(--slotted-text, CanvasText));
|
|
309
|
-
/**
|
|
310
|
-
* A grid of `auto` tracks rather than a wrapping flex row.
|
|
311
|
-
*
|
|
312
|
-
* The footer has to run the whole width, and as a flex item that means
|
|
313
|
-
* `flex-basis: 100%` — a percentage against a container whose own width is
|
|
314
|
-
* being shrink-wrapped from its contents. The browser resolves the circle
|
|
315
|
-
* by making the surface wider than anything in it: the first capture of
|
|
316
|
-
* this family showed 195 pixels of empty ground to the right of the grid.
|
|
317
|
-
* `auto` tracks have no such circle, and `grid-area` says which cell each
|
|
318
|
-
* part is in without a second element to carry the row.
|
|
319
|
-
*/
|
|
320
|
-
display: grid;
|
|
321
|
-
gap: var(--slotted-space-5, 0.75rem);
|
|
322
|
-
grid-template-areas: 'calendar' 'footer';
|
|
323
|
-
grid-template-columns: auto;
|
|
324
|
-
padding: var(--slotted-date-picker-content-padding, var(--slotted-space-5, 0.75rem));
|
|
325
|
-
/* The layer above gave up the pointer; the surface takes it back. */
|
|
326
|
-
pointer-events: auto;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/* The shortcuts take a column of their own only when there are any. */
|
|
330
|
-
[data-ui='date-picker'] [data-part='content']:has([data-part='presets']) {
|
|
331
|
-
grid-template-areas: 'presets calendar' 'footer footer';
|
|
332
|
-
grid-template-columns: auto auto;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
[data-ui='date-picker'] [data-part='content'] > [data-ui='calendar'] {
|
|
336
|
-
grid-area: calendar;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* The consumer's own shortcuts. This family ships no list of them: "last 7
|
|
341
|
-
* days" is a business calendar and a library that guessed at one would be
|
|
342
|
-
* guessing at a fiscal year. What it ships is the column they stand in.
|
|
343
|
-
*/
|
|
344
|
-
[data-ui='date-picker'] [data-part='presets'] {
|
|
345
|
-
/* A list of shortcuts reads from the start edge. Stretched, each button
|
|
346
|
-
centred its own label and the four labels formed a ragged column with
|
|
347
|
-
no left edge to run down. */
|
|
348
|
-
align-items: flex-start;
|
|
349
|
-
border-inline-end: var(--slotted-border-width-thin, 1px) solid
|
|
350
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
351
|
-
display: flex;
|
|
352
|
-
flex-direction: column;
|
|
353
|
-
gap: var(--slotted-space-2, 0.25rem);
|
|
354
|
-
grid-area: presets;
|
|
355
|
-
padding-inline-end: var(--slotted-space-5, 0.75rem);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
[data-ui='date-picker'] [data-part='footer'] {
|
|
359
|
-
align-items: center;
|
|
360
|
-
border-block-start: var(--slotted-border-width-thin, 1px) solid
|
|
361
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
362
|
-
display: flex;
|
|
363
|
-
gap: var(--slotted-space-2, 0.25rem);
|
|
364
|
-
/* The whole width under whatever the surface is holding, so the actions
|
|
365
|
-
sit under the calendar rather than beside it. */
|
|
366
|
-
grid-area: footer;
|
|
367
|
-
justify-content: flex-end;
|
|
368
|
-
padding-block-start: var(--slotted-space-4, 0.5rem);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/* ── Narrow, on a finger ──────────────────────────────────────────────
|
|
372
|
-
*
|
|
373
|
-
* §2.7 of `docs/component-features.md` asks for it by name: a popover on the
|
|
374
|
-
* desktop and a sheet in a narrow viewport. The DOM does not change, so the
|
|
375
|
-
* decision is testable without a device — and the query is on the viewport
|
|
376
|
-
* rather than on a container because a layer in a portal has no container to
|
|
377
|
-
* ask, and the question really is how much screen there is.
|
|
378
|
-
*/
|
|
379
|
-
@media (max-width: 480px) and (pointer: coarse) {
|
|
380
|
-
[data-ui='date-picker'][data-part='positioner'][data-presentation='sheet'] {
|
|
381
|
-
/* The positioner's own measurement is overridden here on purpose: a
|
|
382
|
-
sheet is not placed against an anchor, it is placed against the
|
|
383
|
-
screen. */
|
|
384
|
-
inset: auto 0 0;
|
|
385
|
-
position: fixed;
|
|
386
|
-
/* Nothing arrives sideways, and the sheet rises from the edge it is
|
|
387
|
-
attached to. */
|
|
388
|
-
translate: 0 var(--slotted-space-9, 2rem);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
[data-ui='date-picker'][data-part='positioner'][data-presentation='sheet'][data-open] {
|
|
392
|
-
translate: 0 0;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
[data-ui='date-picker'][data-part='positioner'][data-presentation='sheet']
|
|
396
|
-
[data-part='content'] {
|
|
397
|
-
border-end-end-radius: 0;
|
|
398
|
-
border-end-start-radius: 0;
|
|
399
|
-
border-inline: 0;
|
|
400
|
-
border-block-end: 0;
|
|
401
|
-
inline-size: 100%;
|
|
402
|
-
/* A calendar wider than the screen would scroll sideways; the grid
|
|
403
|
-
inside answers its own width and drops to one month instead. */
|
|
404
|
-
justify-content: center;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
[data-ui='date-picker'][data-part='positioner'][data-presentation='sheet']
|
|
408
|
-
[data-part='presets'] {
|
|
409
|
-
/* Beside the grid there is no room for a column of shortcuts, so they
|
|
410
|
-
become a row above it and keep their labels. */
|
|
411
|
-
border-inline-end: 0;
|
|
412
|
-
border-block-end: var(--slotted-border-width-thin, 1px) solid
|
|
413
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
414
|
-
flex-direction: row;
|
|
415
|
-
flex-wrap: wrap;
|
|
416
|
-
padding-block-end: var(--slotted-space-4, 0.5rem);
|
|
417
|
-
padding-inline-end: 0;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
182
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
[
|
|
2
|
-
"--slotted-border-subtle",
|
|
3
|
-
"--slotted-border-width-thin",
|
|
4
2
|
"--slotted-control-border-width",
|
|
5
3
|
"--slotted-control-height-lg",
|
|
6
4
|
"--slotted-control-height-md",
|
|
@@ -11,39 +9,21 @@
|
|
|
11
9
|
"--slotted-control-radius",
|
|
12
10
|
"--slotted-control-transition-duration",
|
|
13
11
|
"--slotted-control-transition-easing",
|
|
14
|
-
"--slotted-date-picker-content-border-color",
|
|
15
|
-
"--slotted-date-picker-content-color",
|
|
16
|
-
"--slotted-date-picker-content-padding",
|
|
17
|
-
"--slotted-date-picker-content-radius",
|
|
18
|
-
"--slotted-date-picker-content-shadow",
|
|
19
12
|
"--slotted-date-picker-invalid-focus-ring-color",
|
|
20
13
|
"--slotted-date-picker-radius",
|
|
21
|
-
"--slotted-date-picker-surface",
|
|
22
14
|
"--slotted-date-picker-trigger-active-background",
|
|
23
15
|
"--slotted-date-picker-trigger-color",
|
|
24
16
|
"--slotted-date-picker-trigger-hover-background",
|
|
25
17
|
"--slotted-date-picker-trigger-size",
|
|
26
18
|
"--slotted-disabled-foreground",
|
|
27
|
-
"--slotted-duration-medium",
|
|
28
|
-
"--slotted-duration-short",
|
|
29
|
-
"--slotted-easing-enter",
|
|
30
|
-
"--slotted-easing-exit",
|
|
31
19
|
"--slotted-focus-ring-color",
|
|
32
20
|
"--slotted-focus-ring-color-invalid",
|
|
33
21
|
"--slotted-focus-ring-offset",
|
|
34
22
|
"--slotted-focus-ring-width",
|
|
35
|
-
"--slotted-radius-lg",
|
|
36
|
-
"--slotted-shadow-md",
|
|
37
23
|
"--slotted-space-2",
|
|
38
|
-
"--slotted-space-4",
|
|
39
|
-
"--slotted-space-5",
|
|
40
|
-
"--slotted-space-9",
|
|
41
|
-
"--slotted-surface-raised",
|
|
42
24
|
"--slotted-target-comfortable",
|
|
43
25
|
"--slotted-target-min",
|
|
44
|
-
"--slotted-text",
|
|
45
26
|
"--slotted-text-muted",
|
|
46
27
|
"--slotted-tone-secondary-subtle-active",
|
|
47
|
-
"--slotted-tone-secondary-subtle-hover"
|
|
48
|
-
"--slotted-z-index-popover"
|
|
28
|
+
"--slotted-tone-secondary-subtle-hover"
|
|
49
29
|
]
|