@slotted/styles 0.1.0-beta.39 → 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 +5 -1
- package/src/aspect-ratio/aspect-ratio.css +15 -14
- package/src/badge/badge.css +3 -0
- package/src/calendar/calendar.css +210 -171
- package/src/calendar/calendar.tokens.json +17 -2
- package/src/clock/clock.css +246 -0
- package/src/clock/clock.tokens.json +44 -0
- package/src/date-picker/date-picker.css +5 -302
- package/src/date-picker/date-picker.tokens.json +1 -26
- package/src/date-range-picker/date-range-picker.css +4 -490
- package/src/date-range-picker/date-range-picker.tokens.json +1 -41
- package/src/datetime-picker/datetime-picker.css +23 -738
- package/src/datetime-picker/datetime-picker.tokens.json +1 -53
- package/src/datetime-range-picker/datetime-range-picker.css +6 -959
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +1 -71
- package/src/grid/grid.css +3 -2
- package/src/inline/inline.css +1 -1
- package/src/picker-panel/picker-panel.css +1074 -0
- package/src/picker-panel/picker-panel.tokens.json +77 -0
- package/src/progress-indicator/progress-indicator.css +3 -2
- package/src/skeleton/skeleton.css +19 -0
- package/src/stack/stack.css +1 -1
- package/src/time-picker/time-picker.css +4 -545
- package/src/time-picker/time-picker.tokens.json +1 -41
- package/src/time-range-picker/time-range-picker.css +5 -875
- package/src/time-range-picker/time-range-picker.tokens.json +1 -70
- package/src/tree/tree.css +5 -1
|
@@ -3,18 +3,27 @@
|
|
|
3
3
|
"--slotted-border-width-thin",
|
|
4
4
|
"--slotted-calendar-active-background",
|
|
5
5
|
"--slotted-calendar-background",
|
|
6
|
+
"--slotted-calendar-cell-block-size",
|
|
6
7
|
"--slotted-calendar-cell-size",
|
|
7
8
|
"--slotted-calendar-color",
|
|
8
9
|
"--slotted-calendar-day-height",
|
|
9
10
|
"--slotted-calendar-day-mark-size",
|
|
10
11
|
"--slotted-calendar-day-radius",
|
|
11
12
|
"--slotted-calendar-disabled-color",
|
|
13
|
+
"--slotted-calendar-heading-rest-color",
|
|
12
14
|
"--slotted-calendar-hover-background",
|
|
13
15
|
"--slotted-calendar-in-range-color",
|
|
14
16
|
"--slotted-calendar-invalid-edge-width",
|
|
15
17
|
"--slotted-calendar-invalid-focus-ring-color",
|
|
16
18
|
"--slotted-calendar-line-color",
|
|
19
|
+
"--slotted-calendar-month-gap",
|
|
17
20
|
"--slotted-calendar-outside-color",
|
|
21
|
+
"--slotted-calendar-over-background",
|
|
22
|
+
"--slotted-calendar-over-color",
|
|
23
|
+
"--slotted-calendar-over-selected-background",
|
|
24
|
+
"--slotted-calendar-over-selected-color",
|
|
25
|
+
"--slotted-calendar-period-background",
|
|
26
|
+
"--slotted-calendar-period-block-size",
|
|
18
27
|
"--slotted-calendar-preview-background",
|
|
19
28
|
"--slotted-calendar-preview-border-color",
|
|
20
29
|
"--slotted-calendar-radius",
|
|
@@ -25,12 +34,13 @@
|
|
|
25
34
|
"--slotted-calendar-selected-background",
|
|
26
35
|
"--slotted-calendar-selected-color",
|
|
27
36
|
"--slotted-calendar-today-background",
|
|
37
|
+
"--slotted-calendar-today-border-color",
|
|
28
38
|
"--slotted-calendar-today-color",
|
|
29
39
|
"--slotted-calendar-trigger-color",
|
|
30
40
|
"--slotted-calendar-unavailable-color",
|
|
31
|
-
"--slotted-calendar-week-number-border-color",
|
|
32
41
|
"--slotted-calendar-week-number-color",
|
|
33
42
|
"--slotted-calendar-weekday-color",
|
|
43
|
+
"--slotted-calendar-weekend-color",
|
|
34
44
|
"--slotted-control-font-family",
|
|
35
45
|
"--slotted-control-font-size-md",
|
|
36
46
|
"--slotted-control-gap-md",
|
|
@@ -54,18 +64,21 @@
|
|
|
54
64
|
"--slotted-focus-ring-color-invalid",
|
|
55
65
|
"--slotted-focus-ring-offset",
|
|
56
66
|
"--slotted-focus-ring-width",
|
|
67
|
+
"--slotted-font-size-md",
|
|
57
68
|
"--slotted-font-size-xs",
|
|
58
69
|
"--slotted-font-weight-medium",
|
|
59
70
|
"--slotted-font-weight-regular",
|
|
60
71
|
"--slotted-font-weight-semibold",
|
|
61
72
|
"--slotted-highlight-tint-opacity",
|
|
62
73
|
"--slotted-radius-full",
|
|
63
|
-
"--slotted-radius-
|
|
74
|
+
"--slotted-radius-md",
|
|
64
75
|
"--slotted-space-1",
|
|
65
76
|
"--slotted-space-2",
|
|
66
77
|
"--slotted-space-3",
|
|
67
78
|
"--slotted-space-4",
|
|
68
79
|
"--slotted-space-6",
|
|
80
|
+
"--slotted-surface-sunken",
|
|
81
|
+
"--slotted-target-comfortable",
|
|
69
82
|
"--slotted-target-min",
|
|
70
83
|
"--slotted-text",
|
|
71
84
|
"--slotted-text-muted",
|
|
@@ -75,7 +88,9 @@
|
|
|
75
88
|
"--slotted-tone-accent-subtle-active",
|
|
76
89
|
"--slotted-tone-accent-subtle-hover",
|
|
77
90
|
"--slotted-tone-accent-text",
|
|
91
|
+
"--slotted-tone-danger-on-solid",
|
|
78
92
|
"--slotted-tone-danger-solid",
|
|
93
|
+
"--slotted-tone-danger-text",
|
|
79
94
|
"--slotted-tone-info-solid",
|
|
80
95
|
"--slotted-tone-secondary-subtle-active",
|
|
81
96
|
"--slotted-tone-secondary-subtle-hover",
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
@layer slotted.components {
|
|
2
|
+
/**
|
|
3
|
+
* ── Every hour of the day, and the minutes of the step ─────────────────
|
|
4
|
+
*
|
|
5
|
+
* ┌─ root ─ role="group" ───────────────────────────────┐
|
|
6
|
+
* │ hours ─ listbox │
|
|
7
|
+
* │ period hour hour hour hour hour hour │
|
|
8
|
+
* │ period hour hour hour hour hour hour │
|
|
9
|
+
* │ ───────────────────────────────────────────────── │
|
|
10
|
+
* │ minutes: period │ cells ─ minute minute minute … │
|
|
11
|
+
* │ seconds: period │ cells ─ second second second … │
|
|
12
|
+
* └─────────────────────────────────────────────────────┘
|
|
13
|
+
*
|
|
14
|
+
* A stated list of times takes the place of the three: `slots`, whole times
|
|
15
|
+
* under the part of the day each one is in, on the same label column.
|
|
16
|
+
*
|
|
17
|
+
* Nothing scrolls. The hours are six to a row so a part of the day is a row,
|
|
18
|
+
* and the minutes answer the step with four, six or ten across.
|
|
19
|
+
*/
|
|
20
|
+
[data-ui-clock][data-part-root] {
|
|
21
|
+
/* The label column of the hours, the minutes and the slots, so the three
|
|
22
|
+
read as one table. The longest name of a part of the day stands on it. */
|
|
23
|
+
--_label: var(--slotted-clock-label-inline-size, 62px);
|
|
24
|
+
/* A row stands one step under the control, which is what lets four of them
|
|
25
|
+
and the minutes stand beside a month. */
|
|
26
|
+
--_row: var(
|
|
27
|
+
--slotted-clock-row-block-size,
|
|
28
|
+
max(var(--slotted-target-min, 24px), calc(var(--slotted-control-height-md, 34px) - 6px))
|
|
29
|
+
);
|
|
30
|
+
--_tight-row: var(--slotted-target-min, 24px);
|
|
31
|
+
--_gap: var(--slotted-space-1, 0.125rem);
|
|
32
|
+
--_edge: var(--slotted-border-width-thin, 1px) solid
|
|
33
|
+
var(--slotted-clock-separator-color, var(--slotted-border-subtle, ButtonBorder));
|
|
34
|
+
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
color: var(--slotted-clock-color, var(--slotted-text, CanvasText));
|
|
37
|
+
display: grid;
|
|
38
|
+
font-family: var(--slotted-font-family-sans, sans-serif);
|
|
39
|
+
font-size: var(--slotted-control-font-size-md, 13px);
|
|
40
|
+
font-variant-numeric: tabular-nums;
|
|
41
|
+
gap: var(--slotted-space-4, 0.5rem);
|
|
42
|
+
/* The hours share the height the surface around them leaves; the units
|
|
43
|
+
under them are the height they are. */
|
|
44
|
+
grid-auto-rows: auto;
|
|
45
|
+
grid-template-rows: 1fr;
|
|
46
|
+
line-height: 1.3;
|
|
47
|
+
min-inline-size: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-ui-clock][data-part-root][data-slots] {
|
|
51
|
+
grid-template-rows: auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-ui-clock] :is([data-part-hours], [data-part-minutes], [data-part-seconds]) {
|
|
55
|
+
display: grid;
|
|
56
|
+
gap: var(--_gap);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-ui-clock] [data-part-hours] {
|
|
60
|
+
grid-auto-rows: minmax(var(--_row), 1fr);
|
|
61
|
+
grid-template-columns: var(--_label) repeat(6, minmax(0, 1fr));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* A part of the day is a group to assistive technology and a row of the grid
|
|
65
|
+
to the eye: the box between the two draws nothing. */
|
|
66
|
+
[data-ui-clock] :is([data-part-hours], [data-part-slots]) > [role='group'] {
|
|
67
|
+
display: contents;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[data-ui-clock] :is([data-part-minutes], [data-part-seconds]) {
|
|
71
|
+
border-block-start: var(--_edge);
|
|
72
|
+
grid-template-columns: var(--_label) minmax(0, 1fr);
|
|
73
|
+
padding-block-start: var(--slotted-space-4, 0.5rem);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[data-ui-clock] [data-part-cells] {
|
|
77
|
+
display: grid;
|
|
78
|
+
gap: var(--_gap);
|
|
79
|
+
grid-auto-rows: var(--_row);
|
|
80
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
[data-ui-clock] [data-columns='6'] > [data-part-cells] {
|
|
84
|
+
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Sixty units stand on the whole width, their name over them: beside a label
|
|
88
|
+
column the tenth of what is left is under the smallest target. */
|
|
89
|
+
[data-ui-clock] [data-columns='10'] {
|
|
90
|
+
grid-template-columns: minmax(0, 1fr);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-ui-clock] [data-columns='10'] > [data-part-cells] {
|
|
94
|
+
gap: var(--slotted-border-width-thin, 1px);
|
|
95
|
+
grid-auto-rows: var(--_tight-row);
|
|
96
|
+
grid-template-columns: repeat(10, minmax(0, 1fr));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-ui-clock] [data-columns='10'] > [data-part-cells] > * {
|
|
100
|
+
font-size: var(--slotted-font-size-sm, 0.8125rem);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-ui-clock] [data-part-slots] {
|
|
104
|
+
align-content: start;
|
|
105
|
+
display: grid;
|
|
106
|
+
gap: var(--slotted-space-5, 0.75rem) var(--_gap);
|
|
107
|
+
grid-template-columns: var(--_label) minmax(0, 1fr);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-ui-clock] [data-part-slots] [data-part-cells] {
|
|
111
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* ── The name of a row ── */
|
|
115
|
+
[data-ui-clock] [data-part-period] {
|
|
116
|
+
align-self: center;
|
|
117
|
+
color: var(--slotted-clock-label-color, var(--slotted-text-muted, GrayText));
|
|
118
|
+
font-size: var(--slotted-font-size-xs, 0.75rem);
|
|
119
|
+
white-space: nowrap;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-ui-clock] [data-part-slots] [data-part-period] {
|
|
123
|
+
align-self: start;
|
|
124
|
+
line-height: var(--_row);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-ui-clock] [data-part-empty] {
|
|
128
|
+
color: var(--slotted-clock-label-color, var(--slotted-text-muted, GrayText));
|
|
129
|
+
padding: var(--slotted-space-4, 0.5rem);
|
|
130
|
+
text-align: center;
|
|
131
|
+
text-wrap: balance;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* ── One time, or one unit of it ── */
|
|
135
|
+
[data-ui-clock] :is([data-part-hour], [data-part-minute], [data-part-second], [data-part-slot]) {
|
|
136
|
+
appearance: none;
|
|
137
|
+
background-color: var(
|
|
138
|
+
--slotted-clock-cell-background,
|
|
139
|
+
var(--slotted-surface-sunken, ButtonFace)
|
|
140
|
+
);
|
|
141
|
+
border: 0;
|
|
142
|
+
border-radius: var(--slotted-clock-cell-radius, var(--slotted-radius-sm, 4px));
|
|
143
|
+
box-sizing: border-box;
|
|
144
|
+
color: inherit;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
font: inherit;
|
|
147
|
+
font-variant-numeric: inherit;
|
|
148
|
+
margin: 0;
|
|
149
|
+
min-inline-size: 0;
|
|
150
|
+
padding: 0;
|
|
151
|
+
touch-action: manipulation;
|
|
152
|
+
transition:
|
|
153
|
+
background-color var(--slotted-control-transition-duration)
|
|
154
|
+
var(--slotted-control-transition-easing),
|
|
155
|
+
color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
|
|
156
|
+
user-select: none;
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
-webkit-tap-highlight-color: transparent;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* The hour it is, as an outline: told apart from the chosen one without color. */
|
|
162
|
+
[data-ui-clock] [data-part-hour][data-now]:not([data-selected]) {
|
|
163
|
+
box-shadow: inset 0 0 0 var(--slotted-border-width-thin, 1px)
|
|
164
|
+
var(--slotted-clock-now-border-color, var(--slotted-tone-accent-border, Highlight));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-ui-clock]:not([data-disabled], [data-readonly])
|
|
168
|
+
[role='option']:hover:not([data-disabled], [data-unavailable], [data-selected]) {
|
|
169
|
+
background-color: var(
|
|
170
|
+
--slotted-clock-cell-hover-background,
|
|
171
|
+
var(--slotted-tone-accent-subtle-hover)
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[data-ui-clock]:not([data-disabled], [data-readonly])
|
|
176
|
+
[role='option']:active:not([data-disabled], [data-unavailable], [data-selected]) {
|
|
177
|
+
background-color: var(
|
|
178
|
+
--slotted-clock-cell-active-background,
|
|
179
|
+
var(--slotted-tone-accent-subtle-active)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[data-ui-clock] [role='option'][data-unavailable] {
|
|
184
|
+
color: var(--slotted-disabled-foreground, GrayText);
|
|
185
|
+
cursor: not-allowed;
|
|
186
|
+
text-decoration: line-through;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
[data-ui-clock] :is([data-part-hour], [data-part-slot])[data-unavailable]:not([data-selected]) {
|
|
190
|
+
background-color: transparent;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
[data-ui-clock] [role='option'][data-selected] {
|
|
194
|
+
background-color: var(--slotted-clock-selected-background, var(--slotted-tone-accent-solid));
|
|
195
|
+
color: var(--slotted-clock-selected-color, var(--slotted-tone-accent-on-solid));
|
|
196
|
+
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
[data-ui-clock]:not([data-disabled], [data-readonly])
|
|
200
|
+
[role='option'][data-selected]:hover:not([data-disabled], [data-unavailable]) {
|
|
201
|
+
background-color: var(
|
|
202
|
+
--slotted-clock-selected-hover-background,
|
|
203
|
+
var(--slotted-tone-accent-solid-hover)
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
[data-ui-clock] [role='option']:focus-visible {
|
|
208
|
+
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
209
|
+
outline-offset: var(--slotted-border-width-thin, 1px);
|
|
210
|
+
position: relative;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[data-ui-clock][data-readonly] [role='option'] {
|
|
214
|
+
cursor: default;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
[data-ui-clock][data-disabled] [role='option'] {
|
|
218
|
+
color: var(--slotted-disabled-foreground, GrayText);
|
|
219
|
+
cursor: not-allowed;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
[data-ui-clock][data-disabled] [role='option'][data-selected] {
|
|
223
|
+
background-color: var(--slotted-disabled-background, ButtonFace);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* ── A finger, and the one column of a narrow screen ──
|
|
227
|
+
The target is the comfortable one, and sixty minutes keep one screen. */
|
|
228
|
+
@media (max-width: 760px), (pointer: coarse) {
|
|
229
|
+
[data-ui-clock][data-part-root] {
|
|
230
|
+
--_row: var(--slotted-clock-row-block-size, var(--slotted-target-comfortable, 44px));
|
|
231
|
+
--_tight-row: calc(var(--slotted-target-comfortable, 44px) - var(--slotted-space-4, 0.5rem));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@media (forced-colors: active) {
|
|
236
|
+
[data-ui-clock] [role='option'][data-selected] {
|
|
237
|
+
background-color: Highlight;
|
|
238
|
+
color: HighlightText;
|
|
239
|
+
forced-color-adjust: none;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
[data-ui-clock] [data-part-hour][data-now]:not([data-selected]) {
|
|
243
|
+
outline: var(--slotted-border-width-thin, 1px) solid Highlight;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[
|
|
2
|
+
"--slotted-border-subtle",
|
|
3
|
+
"--slotted-border-width-thin",
|
|
4
|
+
"--slotted-clock-cell-active-background",
|
|
5
|
+
"--slotted-clock-cell-background",
|
|
6
|
+
"--slotted-clock-cell-hover-background",
|
|
7
|
+
"--slotted-clock-cell-radius",
|
|
8
|
+
"--slotted-clock-color",
|
|
9
|
+
"--slotted-clock-label-color",
|
|
10
|
+
"--slotted-clock-label-inline-size",
|
|
11
|
+
"--slotted-clock-now-border-color",
|
|
12
|
+
"--slotted-clock-row-block-size",
|
|
13
|
+
"--slotted-clock-selected-background",
|
|
14
|
+
"--slotted-clock-selected-color",
|
|
15
|
+
"--slotted-clock-selected-hover-background",
|
|
16
|
+
"--slotted-clock-separator-color",
|
|
17
|
+
"--slotted-control-font-size-md",
|
|
18
|
+
"--slotted-control-height-md",
|
|
19
|
+
"--slotted-control-transition-duration",
|
|
20
|
+
"--slotted-control-transition-easing",
|
|
21
|
+
"--slotted-disabled-background",
|
|
22
|
+
"--slotted-disabled-foreground",
|
|
23
|
+
"--slotted-focus-ring-color",
|
|
24
|
+
"--slotted-focus-ring-width",
|
|
25
|
+
"--slotted-font-family-sans",
|
|
26
|
+
"--slotted-font-size-sm",
|
|
27
|
+
"--slotted-font-size-xs",
|
|
28
|
+
"--slotted-font-weight-semibold",
|
|
29
|
+
"--slotted-radius-sm",
|
|
30
|
+
"--slotted-space-1",
|
|
31
|
+
"--slotted-space-4",
|
|
32
|
+
"--slotted-space-5",
|
|
33
|
+
"--slotted-surface-sunken",
|
|
34
|
+
"--slotted-target-comfortable",
|
|
35
|
+
"--slotted-target-min",
|
|
36
|
+
"--slotted-text",
|
|
37
|
+
"--slotted-text-muted",
|
|
38
|
+
"--slotted-tone-accent-border",
|
|
39
|
+
"--slotted-tone-accent-on-solid",
|
|
40
|
+
"--slotted-tone-accent-solid",
|
|
41
|
+
"--slotted-tone-accent-solid-hover",
|
|
42
|
+
"--slotted-tone-accent-subtle-active",
|
|
43
|
+
"--slotted-tone-accent-subtle-hover"
|
|
44
|
+
]
|
|
@@ -1,23 +1,17 @@
|
|
|
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
16
|
[data-ui-date-picker][data-part-root] {
|
|
23
17
|
display: block;
|
|
@@ -185,295 +179,4 @@
|
|
|
185
179
|
color: var(--slotted-disabled-foreground);
|
|
186
180
|
cursor: not-allowed;
|
|
187
181
|
}
|
|
188
|
-
|
|
189
|
-
/* ── The layer ────────────────────────────────────────────────────────
|
|
190
|
-
*
|
|
191
|
-
* What `packages/core/src/positioner` writes `position`, `left` and `top`
|
|
192
|
-
* onto. The painted surface is one element in, as `tooltip`, `popover`,
|
|
193
|
-
* `menu` and `select` are all built.
|
|
194
|
-
*/
|
|
195
|
-
[data-ui-date-picker][data-part-positioner] {
|
|
196
|
-
/* Only the block inset: the positioner writes `left` and never `right`,
|
|
197
|
-
and `inset-inline-start` would resolve to `right` in a right-to-left
|
|
198
|
-
document and win over the measured value. */
|
|
199
|
-
position: absolute;
|
|
200
|
-
inset-block-start: 0;
|
|
201
|
-
|
|
202
|
-
box-sizing: border-box;
|
|
203
|
-
isolation: isolate;
|
|
204
|
-
/* The layer is only a frame around the surface; the surface takes the
|
|
205
|
-
pointer, and the frame must not swallow a press meant for the page. */
|
|
206
|
-
pointer-events: none;
|
|
207
|
-
z-index: calc(var(--slotted-z-index-popover, 1100) + var(--slotted-layer-depth, 0));
|
|
208
|
-
|
|
209
|
-
/* The layer arrives along the axis it opens on and never along the inline
|
|
210
|
-
one, which is the rule `select` records: a scale from the corner the
|
|
211
|
-
positioner named as origin moved the far edge and read as an entrance
|
|
212
|
-
from the side. */
|
|
213
|
-
--_enter-distance: var(--slotted-space-2, 0.25rem);
|
|
214
|
-
translate: 0 calc(-1 * var(--_enter-distance));
|
|
215
|
-
transition: translate var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
[data-ui-date-picker][data-part-positioner][data-side='top'] {
|
|
219
|
-
translate: 0 var(--_enter-distance);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/* A lateral side has no block direction to arrive from, so it only fades. */
|
|
223
|
-
[data-ui-date-picker][data-part-positioner]:is([data-side='left'], [data-side='right']) {
|
|
224
|
-
translate: 0 0;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
[data-ui-date-picker][data-part-positioner][data-open] {
|
|
228
|
-
translate: 0 0;
|
|
229
|
-
transition: none;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* The entrance is a keyframe animation and not a transition, for the reason
|
|
234
|
-
* `select` records: a transition starts from the style the browser computed
|
|
235
|
-
* last, and the positioner writes `data-side` in the same style update as
|
|
236
|
-
* the family opens the layer.
|
|
237
|
-
*
|
|
238
|
-
* Only a layer the positioner placed arrives. A layer written open in static
|
|
239
|
-
* markup — the harness, a docs snippet — is simply there, and is
|
|
240
|
-
* photographed where it stands.
|
|
241
|
-
*/
|
|
242
|
-
[data-ui-date-picker][data-part-positioner][data-open][data-positioned] {
|
|
243
|
-
animation: slotted-date-picker-enter-down var(--slotted-duration-medium)
|
|
244
|
-
var(--slotted-easing-enter);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
[data-ui-date-picker][data-part-positioner][data-open][data-positioned][data-side='top'] {
|
|
248
|
-
animation-name: slotted-date-picker-enter-up;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
@keyframes slotted-date-picker-enter-down {
|
|
252
|
-
from {
|
|
253
|
-
translate: 0 calc(-1 * var(--_enter-distance));
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
@keyframes slotted-date-picker-enter-up {
|
|
258
|
-
from {
|
|
259
|
-
translate: 0 var(--_enter-distance);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
@keyframes slotted-date-picker-fade {
|
|
264
|
-
from {
|
|
265
|
-
opacity: 0;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* The fade belongs to the part that paints the surface, and the layer only
|
|
271
|
-
* moves. In Chromium an ancestor with `opacity` below one is the Backdrop Root
|
|
272
|
-
* of what it holds, so a `backdrop-filter` on the content blurs nothing until
|
|
273
|
-
* the layer is opaque and then appears at once. The content's own opacity
|
|
274
|
-
* leaves its own filter drawn on every frame of the motion.
|
|
275
|
-
*/
|
|
276
|
-
[data-ui-date-picker][data-part-positioner] > [data-part-content] {
|
|
277
|
-
opacity: 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-part-content] {
|
|
282
|
-
opacity: 1;
|
|
283
|
-
transition: none;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
[data-ui-date-picker][data-part-positioner][data-open][data-positioned] > [data-part-content] {
|
|
287
|
-
animation: slotted-date-picker-fade var(--slotted-duration-medium) var(--slotted-easing-enter);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/* Stillness keeps the fade and drops the movement. */
|
|
291
|
-
@media (prefers-reduced-motion: reduce) {
|
|
292
|
-
[data-ui-date-picker][data-part-positioner],
|
|
293
|
-
[data-ui-date-picker][data-part-positioner][data-side='top'],
|
|
294
|
-
[data-ui-date-picker][data-part-positioner][data-side='left'],
|
|
295
|
-
[data-ui-date-picker][data-part-positioner][data-side='right'] {
|
|
296
|
-
translate: 0 0;
|
|
297
|
-
transition: translate var(--slotted-duration-short) var(--slotted-easing-exit);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
[data-ui-date-picker][data-part-positioner][data-open][data-positioned],
|
|
301
|
-
[data-ui-date-picker][data-part-positioner][data-open][data-positioned][data-side='top'],
|
|
302
|
-
[data-ui-date-picker][data-part-positioner][data-open][data-positioned][data-side='left'],
|
|
303
|
-
[data-ui-date-picker][data-part-positioner][data-open][data-positioned][data-side='right'] {
|
|
304
|
-
animation-name: none;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/* The anchor scrolled out of its own clipper. The calendar is still open and
|
|
309
|
-
still belongs to a control the reader can no longer see. */
|
|
310
|
-
[data-ui-date-picker][data-part-positioner][data-detached] {
|
|
311
|
-
visibility: hidden;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* The surface. It is sized by the calendar inside it rather than by the
|
|
316
|
-
* control it hangs from: a month is seven columns wide and a field is as
|
|
317
|
-
* wide as the form, and forcing one to the other would either crush the grid
|
|
318
|
-
* or stretch it.
|
|
319
|
-
*/
|
|
320
|
-
[data-ui-date-picker] [data-part-content] {
|
|
321
|
-
background-color: var(--slotted-date-picker-surface, var(--slotted-surface-raised, Canvas));
|
|
322
|
-
border: var(--slotted-border-width-thin, 1px) solid
|
|
323
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
324
|
-
border-radius: var(--slotted-date-picker-content-radius, var(--slotted-radius-lg, 8px));
|
|
325
|
-
box-shadow: var(--slotted-date-picker-content-shadow, var(--slotted-shadow-md));
|
|
326
|
-
box-sizing: border-box;
|
|
327
|
-
color: var(--slotted-date-picker-content-color, var(--slotted-text, CanvasText));
|
|
328
|
-
/**
|
|
329
|
-
* A grid of `auto` tracks rather than a wrapping flex row.
|
|
330
|
-
*
|
|
331
|
-
* The footer has to run the whole width, and as a flex item that means
|
|
332
|
-
* `flex-basis: 100%` — a percentage against a container whose own width is
|
|
333
|
-
* being shrink-wrapped from its contents. The browser resolves the circle
|
|
334
|
-
* by making the surface wider than anything in it: the first capture of
|
|
335
|
-
* this family showed 195 pixels of empty ground to the right of the grid.
|
|
336
|
-
* `auto` tracks have no such circle, and `grid-area` says which cell each
|
|
337
|
-
* part is in without a second element to carry the row.
|
|
338
|
-
*/
|
|
339
|
-
display: grid;
|
|
340
|
-
gap: var(--slotted-space-5, 0.75rem);
|
|
341
|
-
grid-template-areas: 'calendar' 'footer';
|
|
342
|
-
grid-template-columns: auto;
|
|
343
|
-
padding: var(--slotted-date-picker-content-padding, var(--slotted-space-5, 0.75rem));
|
|
344
|
-
/* The layer above gave up the pointer; the surface takes it back. */
|
|
345
|
-
pointer-events: auto;
|
|
346
|
-
/* A theme that paints this surface as a translucent material blurs what moves behind it. */
|
|
347
|
-
-webkit-backdrop-filter: var(--slotted-date-picker-content-backdrop-filter, none);
|
|
348
|
-
backdrop-filter: var(--slotted-date-picker-content-backdrop-filter, none);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
|
|
352
|
-
[data-ui-date-picker] [data-part-content] {
|
|
353
|
-
-webkit-backdrop-filter: none;
|
|
354
|
-
backdrop-filter: none;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/* The shortcuts take a column of their own only when there are any. */
|
|
359
|
-
[data-ui-date-picker] [data-part-content]:has([data-part-presets]) {
|
|
360
|
-
grid-template-areas: 'presets calendar' 'footer footer';
|
|
361
|
-
grid-template-columns: auto auto;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
[data-ui-date-picker] [data-part-content] > [data-ui-calendar] {
|
|
365
|
-
grid-area: calendar;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* The consumer's own shortcuts. This family ships no list of them: "last 7
|
|
370
|
-
* days" is a business calendar and a library that guessed at one would be
|
|
371
|
-
* guessing at a fiscal year. What it ships is the column they stand in.
|
|
372
|
-
*/
|
|
373
|
-
[data-ui-date-picker] [data-part-presets] {
|
|
374
|
-
/* A list of shortcuts reads from the start edge. Stretched, each button
|
|
375
|
-
centerd its own label and the four labels formed a ragged column with
|
|
376
|
-
no left edge to run down. */
|
|
377
|
-
align-items: flex-start;
|
|
378
|
-
border-inline-end: var(--slotted-border-width-thin, 1px) solid
|
|
379
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
380
|
-
display: flex;
|
|
381
|
-
flex-direction: column;
|
|
382
|
-
gap: var(--slotted-space-2, 0.25rem);
|
|
383
|
-
grid-area: presets;
|
|
384
|
-
padding-inline-end: var(--slotted-space-5, 0.75rem);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
[data-ui-date-picker] [data-part-footer] {
|
|
388
|
-
align-items: center;
|
|
389
|
-
border-block-start: var(--slotted-border-width-thin, 1px) solid
|
|
390
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
391
|
-
display: flex;
|
|
392
|
-
gap: var(--slotted-space-2, 0.25rem);
|
|
393
|
-
/* The whole width under whatever the surface is holding, so the actions
|
|
394
|
-
sit under the calendar rather than beside it. */
|
|
395
|
-
grid-area: footer;
|
|
396
|
-
justify-content: flex-end;
|
|
397
|
-
padding-block-start: var(--slotted-space-4, 0.5rem);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/* ── Narrow, on a finger ──────────────────────────────────────────────
|
|
401
|
-
*
|
|
402
|
-
* §2.7 of `docs/component-features.md` asks for it by name: a popover on the
|
|
403
|
-
* desktop and a sheet in a narrow viewport. The DOM does not change, so the
|
|
404
|
-
* decision is testable without a device — and the query is on the viewport
|
|
405
|
-
* rather than on a container because a layer in a portal has no container to
|
|
406
|
-
* ask, and the question really is how much screen there is.
|
|
407
|
-
*/
|
|
408
|
-
@media (max-width: 480px) and (pointer: coarse) {
|
|
409
|
-
[data-ui-date-picker][data-part-positioner][data-presentation='sheet'] {
|
|
410
|
-
/* The positioner's own measurement is overridden here on purpose: a
|
|
411
|
-
sheet is not placed against an anchor, it is placed against the
|
|
412
|
-
screen. */
|
|
413
|
-
inset: auto 0 0;
|
|
414
|
-
position: fixed;
|
|
415
|
-
/* Nothing arrives sideways, and the sheet rises from the edge it is
|
|
416
|
-
attached to. */
|
|
417
|
-
translate: 0 var(--slotted-space-9, 2rem);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
[data-ui-date-picker][data-part-positioner][data-presentation='sheet'][data-open] {
|
|
421
|
-
translate: 0 0;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
[data-ui-date-picker][data-part-positioner][data-presentation='sheet'] [data-part-content] {
|
|
425
|
-
border-end-end-radius: 0;
|
|
426
|
-
border-end-start-radius: 0;
|
|
427
|
-
border-inline: 0;
|
|
428
|
-
border-block-end: 0;
|
|
429
|
-
inline-size: 100%;
|
|
430
|
-
/* A calendar wider than the screen would scroll sideways; the grid
|
|
431
|
-
inside answers its own width and drops to one month instead. */
|
|
432
|
-
justify-content: center;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
[data-ui-date-picker][data-part-positioner][data-presentation='sheet'] [data-part-presets] {
|
|
436
|
-
/* Beside the grid there is no room for a column of shortcuts, so they
|
|
437
|
-
become a row above it and keep their labels. */
|
|
438
|
-
border-inline-end: 0;
|
|
439
|
-
border-block-end: var(--slotted-border-width-thin, 1px) solid
|
|
440
|
-
var(--slotted-date-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
|
|
441
|
-
flex-direction: row;
|
|
442
|
-
flex-wrap: wrap;
|
|
443
|
-
padding-block-end: var(--slotted-space-4, 0.5rem);
|
|
444
|
-
padding-inline-end: 0;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* The grip every bottom sheet carries, in the drawer's geometry and line
|
|
449
|
-
* color: a pill three rem by a quarter, centerd in a row one target tall
|
|
450
|
-
* that the content keeps clear at its top. A pull down on it dismisses the
|
|
451
|
-
* sheet; Escape and the press outside stay the accessible ways out.
|
|
452
|
-
*/
|
|
453
|
-
[data-ui-date-picker][data-part-positioner][data-presentation='sheet'] > [data-part-content] {
|
|
454
|
-
padding-block-start: var(--slotted-target-min, 24px);
|
|
455
|
-
position: relative;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
[data-ui-date-picker][data-part-positioner][data-presentation='sheet']
|
|
459
|
-
> [data-part-content]
|
|
460
|
-
> [data-part-grip] {
|
|
461
|
-
background-clip: content-box;
|
|
462
|
-
background-color: var(
|
|
463
|
-
--slotted-drawer-resizer-line-color,
|
|
464
|
-
var(--slotted-border-strong, ButtonBorder)
|
|
465
|
-
);
|
|
466
|
-
block-size: var(--slotted-space-2, 0.25rem);
|
|
467
|
-
border-radius: var(--slotted-radius-full, 9999px);
|
|
468
|
-
box-sizing: content-box;
|
|
469
|
-
cursor: grab;
|
|
470
|
-
inline-size: var(--slotted-space-11, 3rem);
|
|
471
|
-
inset-block-start: 0;
|
|
472
|
-
inset-inline: 0;
|
|
473
|
-
margin-inline: auto;
|
|
474
|
-
padding-block: calc((var(--slotted-target-min, 24px) - var(--slotted-space-2, 0.25rem)) / 2);
|
|
475
|
-
position: absolute;
|
|
476
|
-
touch-action: none;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
182
|
}
|