magic-pill 9.0.0 → 9.1.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/CHANGELOG.md +44 -0
- package/README.md +259 -15
- package/dist/MagicPill/MagicPill.d.mts +7 -1
- package/dist/MagicPill/MagicPill.d.ts +7 -1
- package/dist/MagicPill/MagicPill.js +40 -17
- package/dist/MagicPill/MagicPill.mjs +42 -19
- package/dist/MagicPill/choreography.js +1 -1
- package/dist/MagicPill/choreography.mjs +1 -1
- package/dist/Pill/Pill.js +53 -17
- package/dist/Pill/Pill.mjs +54 -18
- package/dist/Pill/PillContext.js +3 -1
- package/dist/Pill/PillContext.mjs +3 -1
- package/dist/Pill/PillPanel.d.mts +5 -5
- package/dist/Pill/PillPanel.d.ts +5 -5
- package/dist/Pill/PillPanel.js +28 -20
- package/dist/Pill/PillPanel.mjs +28 -20
- package/dist/Pill/morph.js +25 -7
- package/dist/Pill/morph.mjs +22 -8
- package/dist/Pill/scene.js +90 -0
- package/dist/Pill/scene.mjs +89 -0
- package/dist/Pill/themed.js +36 -0
- package/dist/Pill/themed.mjs +34 -0
- package/dist/Pill/types.d.mts +50 -0
- package/dist/Pill/types.d.ts +50 -0
- package/dist/Pill/zone.js +160 -0
- package/dist/Pill/zone.mjs +159 -0
- package/dist/PillForm/Calendar.d.mts +15 -0
- package/dist/PillForm/Calendar.d.ts +16 -0
- package/dist/PillForm/Calendar.js +371 -0
- package/dist/PillForm/Calendar.mjs +370 -0
- package/dist/PillForm/FormContext.d.mts +2 -0
- package/dist/PillForm/FormContext.d.ts +2 -0
- package/dist/PillForm/FormContext.js +8 -0
- package/dist/PillForm/FormContext.mjs +8 -0
- package/dist/PillForm/PillCheckbox.d.mts +8 -0
- package/dist/PillForm/PillCheckbox.d.ts +8 -0
- package/dist/PillForm/PillCheckbox.js +45 -0
- package/dist/PillForm/PillCheckbox.mjs +45 -0
- package/dist/PillForm/PillChoices.d.mts +39 -0
- package/dist/PillForm/PillChoices.d.ts +39 -0
- package/dist/PillForm/PillChoices.js +103 -0
- package/dist/PillForm/PillChoices.mjs +103 -0
- package/dist/PillForm/PillCode.d.mts +12 -0
- package/dist/PillForm/PillCode.d.ts +12 -0
- package/dist/PillForm/PillCode.js +60 -0
- package/dist/PillForm/PillCode.mjs +60 -0
- package/dist/PillForm/PillColor.d.mts +10 -0
- package/dist/PillForm/PillColor.d.ts +10 -0
- package/dist/PillForm/PillColor.js +56 -0
- package/dist/PillForm/PillColor.mjs +56 -0
- package/dist/PillForm/PillDate.d.mts +44 -0
- package/dist/PillForm/PillDate.d.ts +44 -0
- package/dist/PillForm/PillDate.js +193 -0
- package/dist/PillForm/PillDate.mjs +193 -0
- package/dist/PillForm/PillField.d.mts +38 -0
- package/dist/PillForm/PillField.d.ts +38 -0
- package/dist/PillForm/PillField.js +81 -0
- package/dist/PillForm/PillField.mjs +80 -0
- package/dist/PillForm/PillFields.d.mts +11 -0
- package/dist/PillForm/PillFields.d.ts +11 -0
- package/dist/PillForm/PillFields.js +21 -0
- package/dist/PillForm/PillFields.mjs +21 -0
- package/dist/PillForm/PillFile.d.mts +8 -0
- package/dist/PillForm/PillFile.d.ts +8 -0
- package/dist/PillForm/PillFile.js +55 -0
- package/dist/PillForm/PillFile.mjs +55 -0
- package/dist/PillForm/PillForm.d.mts +29 -0
- package/dist/PillForm/PillForm.d.ts +29 -0
- package/dist/PillForm/PillForm.js +66 -0
- package/dist/PillForm/PillForm.mjs +65 -0
- package/dist/PillForm/PillFormPanel.d.mts +24 -0
- package/dist/PillForm/PillFormPanel.d.ts +24 -0
- package/dist/PillForm/PillFormPanel.js +53 -0
- package/dist/PillForm/PillFormPanel.mjs +53 -0
- package/dist/PillForm/PillInput.d.mts +20 -0
- package/dist/PillForm/PillInput.d.ts +20 -0
- package/dist/PillForm/PillInput.js +84 -0
- package/dist/PillForm/PillInput.mjs +84 -0
- package/dist/PillForm/PillSelect.d.mts +23 -0
- package/dist/PillForm/PillSelect.d.ts +23 -0
- package/dist/PillForm/PillSelect.js +87 -0
- package/dist/PillForm/PillSelect.mjs +87 -0
- package/dist/PillForm/PillSlider.d.mts +17 -0
- package/dist/PillForm/PillSlider.d.ts +17 -0
- package/dist/PillForm/PillSlider.js +61 -0
- package/dist/PillForm/PillSlider.mjs +61 -0
- package/dist/PillForm/PillStepper.d.mts +13 -0
- package/dist/PillForm/PillStepper.d.ts +13 -0
- package/dist/PillForm/PillStepper.js +84 -0
- package/dist/PillForm/PillStepper.mjs +84 -0
- package/dist/PillForm/PillSubmit.d.mts +14 -0
- package/dist/PillForm/PillSubmit.d.ts +14 -0
- package/dist/PillForm/PillSubmit.js +90 -0
- package/dist/PillForm/PillSubmit.mjs +89 -0
- package/dist/PillForm/PillSwitch.d.mts +5 -0
- package/dist/PillForm/PillSwitch.d.ts +5 -0
- package/dist/PillForm/PillSwitch.js +38 -0
- package/dist/PillForm/PillSwitch.mjs +38 -0
- package/dist/PillForm/PillTextarea.d.mts +5 -0
- package/dist/PillForm/PillTextarea.d.ts +5 -0
- package/dist/PillForm/PillTextarea.js +49 -0
- package/dist/PillForm/PillTextarea.mjs +49 -0
- package/dist/PillForm/dates.d.mts +1 -0
- package/dist/PillForm/dates.d.ts +1 -0
- package/dist/PillForm/dates.js +155 -0
- package/dist/PillForm/dates.mjs +139 -0
- package/dist/PillForm/glyphs.js +65 -0
- package/dist/PillForm/glyphs.mjs +56 -0
- package/dist/PillForm/keyboard.js +34 -0
- package/dist/PillForm/keyboard.mjs +34 -0
- package/dist/PillForm/popover.js +84 -0
- package/dist/PillForm/popover.mjs +83 -0
- package/dist/PillForm/send.d.mts +6 -0
- package/dist/PillForm/send.d.ts +6 -0
- package/dist/PillForm/send.js +44 -0
- package/dist/PillForm/send.mjs +44 -0
- package/dist/PillForm/validity.js +74 -0
- package/dist/PillForm/validity.mjs +72 -0
- package/dist/PillNavbar/PillNavbar.d.mts +29 -6
- package/dist/PillNavbar/PillNavbar.d.ts +29 -6
- package/dist/PillNavbar/PillNavbar.js +35 -11
- package/dist/PillNavbar/PillNavbar.mjs +36 -12
- package/dist/PillNavbar/room.js +84 -0
- package/dist/PillNavbar/room.mjs +83 -0
- package/dist/PillNotification/PillNotification.d.mts +6 -0
- package/dist/PillNotification/PillNotification.d.ts +6 -0
- package/dist/PillNotification/PillNotification.js +3 -0
- package/dist/PillNotification/PillNotification.mjs +3 -0
- package/dist/PillOptics/PillOptics.d.mts +8 -0
- package/dist/PillOptics/PillOptics.d.ts +8 -0
- package/dist/PillOptics/PillOptics.js +195 -0
- package/dist/PillOptics/PillOptics.mjs +195 -0
- package/dist/PillOptics/adaptive.js +212 -0
- package/dist/PillOptics/adaptive.mjs +208 -0
- package/dist/PillOptics/lens.js +77 -0
- package/dist/PillOptics/lens.mjs +73 -0
- package/dist/PillOptics/light.js +37 -0
- package/dist/PillOptics/light.mjs +36 -0
- package/dist/calendar.css +499 -0
- package/dist/forms.css +1452 -0
- package/dist/index.d.mts +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +36 -0
- package/dist/index.mjs +19 -1
- package/dist/styles.css +169 -19
- package/dist/themes.css +449 -0
- package/dist/utils/visuallyHidden.js +18 -0
- package/dist/utils/visuallyHidden.mjs +18 -0
- package/package.json +4 -1
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Magic Pill v9 calendar: the look of <PillDate>. Optional: import it next to
|
|
3
|
+
* styles.css and forms.css, in any order.
|
|
4
|
+
*
|
|
5
|
+
* Same rules as the others: everything is in the magic-pill layer (your
|
|
6
|
+
* unlayered CSS wins), public tokens (--mp-*) are only read, and nothing is
|
|
7
|
+
* loaded from the network.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@layer magic-pill.look, magic-pill.theme, magic-pill.forms, magic-pill.behaviour;
|
|
11
|
+
|
|
12
|
+
@layer magic-pill.forms {
|
|
13
|
+
[data-mp="pill"]:not([data-unstyled]) {
|
|
14
|
+
/* ─── The field ────────────────────────────────────────────────────────── */
|
|
15
|
+
|
|
16
|
+
/* Sent and checked, never seen: what the browser says about it points here */
|
|
17
|
+
& [data-mp="date-value"] {
|
|
18
|
+
position: absolute;
|
|
19
|
+
inset: 0;
|
|
20
|
+
inline-size: 100%;
|
|
21
|
+
block-size: 100%;
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
border: 0;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
& [data-mp="field-box"][data-type="pill-date"] {
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& [data-mp="field-trigger"] {
|
|
34
|
+
appearance: none;
|
|
35
|
+
position: static;
|
|
36
|
+
flex: 1 1 auto;
|
|
37
|
+
min-inline-size: 0;
|
|
38
|
+
min-block-size: var(--_mp-field-size);
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
border: 0;
|
|
42
|
+
outline: 0;
|
|
43
|
+
background: none;
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
color: inherit;
|
|
46
|
+
font: inherit;
|
|
47
|
+
font-size: max(1rem, 16px);
|
|
48
|
+
text-align: start;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
|
|
51
|
+
/* The whole field opens it */
|
|
52
|
+
&::after {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
& > span {
|
|
59
|
+
display: block;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
text-overflow: ellipsis;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&[data-empty] {
|
|
66
|
+
color: var(--_mp-placeholder);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:disabled {
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
& [data-mp="field-box"]:has(> [data-mp="field-trigger"]:focus-visible) {
|
|
75
|
+
outline: 2px solid var(--_mp-on-surface);
|
|
76
|
+
outline-offset: 2px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
& [data-mp="field"]:has(> [data-mp="field-box"] > [data-mp="field-trigger"]:disabled) {
|
|
80
|
+
opacity: 0.5;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* ─── The calendar ─────────────────────────────────────────────────────── */
|
|
84
|
+
|
|
85
|
+
& [data-mp="calendar"] {
|
|
86
|
+
--_mp-cell: var(--mp-calendar-cell, 2.25rem);
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
color: var(--_mp-ink);
|
|
89
|
+
font-family: var(--_mp-label-font);
|
|
90
|
+
font-size: 0.9375rem;
|
|
91
|
+
font-style: normal;
|
|
92
|
+
font-weight: 400;
|
|
93
|
+
line-height: 1.3;
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* In the form, in the pill's own colours, whatever its look */
|
|
98
|
+
& [data-mp="field"] > [data-mp="calendar"][data-inline][data-inline] {
|
|
99
|
+
--_mp-paper: transparent;
|
|
100
|
+
--_mp-ink: var(--_mp-on-surface);
|
|
101
|
+
--_mp-chosen: var(--_mp-on-fill);
|
|
102
|
+
--_mp-on-chosen: var(--_mp-mark-text);
|
|
103
|
+
--_mp-chosen-rim: var(--_mp-on-rim);
|
|
104
|
+
position: relative;
|
|
105
|
+
inline-size: fit-content;
|
|
106
|
+
max-inline-size: 100%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
& [data-mp="calendar"][popover] {
|
|
110
|
+
position: fixed;
|
|
111
|
+
inset: auto;
|
|
112
|
+
margin: 0;
|
|
113
|
+
padding: 0.6rem;
|
|
114
|
+
overflow: auto;
|
|
115
|
+
border: 0;
|
|
116
|
+
border-radius: var(--_mp-list-radius);
|
|
117
|
+
background: var(--_mp-sheet);
|
|
118
|
+
-webkit-backdrop-filter: var(--_mp-list-filter, none);
|
|
119
|
+
backdrop-filter: var(--_mp-list-filter, none) var(--_mp-list-lens,);
|
|
120
|
+
box-shadow:
|
|
121
|
+
0 0.5rem 1.5rem rgb(20 20 20 / 0.35),
|
|
122
|
+
inset 0 0 0 1px var(--_mp-paper-rim),
|
|
123
|
+
var(--_mp-list-rim, 0 0 transparent);
|
|
124
|
+
color: var(--_mp-ink);
|
|
125
|
+
opacity: 0;
|
|
126
|
+
scale: 0.96;
|
|
127
|
+
transform-origin: top;
|
|
128
|
+
transition:
|
|
129
|
+
opacity 150ms ease-out,
|
|
130
|
+
scale 150ms ease-out,
|
|
131
|
+
overlay 150ms allow-discrete,
|
|
132
|
+
display 150ms allow-discrete;
|
|
133
|
+
|
|
134
|
+
&[data-above] {
|
|
135
|
+
transform-origin: bottom;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&:popover-open {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
scale: 1;
|
|
141
|
+
|
|
142
|
+
@starting-style {
|
|
143
|
+
opacity: 0;
|
|
144
|
+
scale: 0.96;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Without popovers: in the page, under the field */
|
|
150
|
+
@supports not selector(:popover-open) {
|
|
151
|
+
& [data-mp="field-box"]:has(> [data-mp="calendar"][data-open]) {
|
|
152
|
+
flex-wrap: wrap;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
& [data-mp="calendar"][popover] {
|
|
156
|
+
display: none;
|
|
157
|
+
position: static;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
& [data-mp="calendar"][data-open] {
|
|
161
|
+
display: block;
|
|
162
|
+
opacity: 1;
|
|
163
|
+
scale: 1;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
& [data-mp="calendar-body"] {
|
|
168
|
+
display: grid;
|
|
169
|
+
gap: 0.4rem 0.75rem;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
|
|
172
|
+
&[data-type="datetime-local"] {
|
|
173
|
+
grid-template-columns: auto auto;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
& [data-mp="calendar-head"] {
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: space-between;
|
|
181
|
+
padding-block-end: 0.25rem;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* A button's look is on the button here: an app's resets only take its
|
|
185
|
+
background away, and it stays readable */
|
|
186
|
+
& :is([data-mp="calendar-button"], [data-mp="calendar-heading"], [data-mp="calendar-cell"]) {
|
|
187
|
+
appearance: none;
|
|
188
|
+
display: grid;
|
|
189
|
+
place-items: center;
|
|
190
|
+
margin: 0;
|
|
191
|
+
padding: 0;
|
|
192
|
+
border: 0;
|
|
193
|
+
outline-offset: -2px;
|
|
194
|
+
background: transparent;
|
|
195
|
+
color: inherit;
|
|
196
|
+
font: inherit;
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
transition:
|
|
199
|
+
background-color 150ms ease-out,
|
|
200
|
+
color 150ms ease-out;
|
|
201
|
+
|
|
202
|
+
&:focus-visible {
|
|
203
|
+
outline: 2px solid var(--_mp-ink);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&:disabled {
|
|
207
|
+
cursor: default;
|
|
208
|
+
opacity: 0.4;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
& [data-mp="calendar-button"] {
|
|
213
|
+
min-inline-size: var(--_mp-cell);
|
|
214
|
+
min-block-size: var(--_mp-cell);
|
|
215
|
+
border-radius: 99px;
|
|
216
|
+
|
|
217
|
+
& > svg {
|
|
218
|
+
inline-size: 1.15rem;
|
|
219
|
+
block-size: 1.15rem;
|
|
220
|
+
rotate: 90deg;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&[data-next] > svg {
|
|
224
|
+
rotate: -90deg;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&:dir(rtl) > svg {
|
|
228
|
+
rotate: -90deg;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&[data-next]:dir(rtl) > svg {
|
|
232
|
+
rotate: 90deg;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
& [data-mp="calendar-heading"] {
|
|
237
|
+
padding: 0.4rem 0.9rem;
|
|
238
|
+
border-radius: 99px;
|
|
239
|
+
font-weight: 700;
|
|
240
|
+
font-variant-numeric: tabular-nums;
|
|
241
|
+
|
|
242
|
+
&:disabled {
|
|
243
|
+
opacity: 1;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@media (hover: hover) {
|
|
248
|
+
& :is([data-mp="calendar-button"], [data-mp="calendar-heading"]):not(:disabled):hover,
|
|
249
|
+
& [data-mp="calendar-cell"]:not([aria-disabled="true"]):hover,
|
|
250
|
+
& [data-mp="calendar-option"]:not([aria-disabled="true"]):hover {
|
|
251
|
+
background: var(--_mp-hover);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
& [data-mp="calendar-grid"] {
|
|
256
|
+
inline-size: 100%;
|
|
257
|
+
margin: 0;
|
|
258
|
+
border-collapse: collapse;
|
|
259
|
+
border-spacing: 0;
|
|
260
|
+
font-variant-numeric: tabular-nums;
|
|
261
|
+
text-align: center;
|
|
262
|
+
animation: mp-page-in var(--_mp-change) ease-out;
|
|
263
|
+
|
|
264
|
+
&[data-direction="1"] {
|
|
265
|
+
--_mp-from: 1.25rem;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
&[data-direction="-1"] {
|
|
269
|
+
--_mp-from: -1.25rem;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&:dir(rtl)[data-direction="1"] {
|
|
273
|
+
--_mp-from: -1.25rem;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
&:dir(rtl)[data-direction="-1"] {
|
|
277
|
+
--_mp-from: 1.25rem;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
& :is(th, td) {
|
|
281
|
+
padding: 0;
|
|
282
|
+
border: 0;
|
|
283
|
+
background: none;
|
|
284
|
+
font-weight: 400;
|
|
285
|
+
text-align: center;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
& thead th {
|
|
289
|
+
block-size: 1.75rem;
|
|
290
|
+
font-size: 0.75rem;
|
|
291
|
+
opacity: var(--_mp-dim);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
& [data-mp="calendar-cell"] {
|
|
296
|
+
inline-size: var(--_mp-cell);
|
|
297
|
+
block-size: var(--_mp-cell);
|
|
298
|
+
margin-inline: auto;
|
|
299
|
+
border-radius: 99px;
|
|
300
|
+
|
|
301
|
+
&[data-other] {
|
|
302
|
+
opacity: var(--_mp-dim);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* Today, or this month */
|
|
306
|
+
&[aria-current="date"] {
|
|
307
|
+
box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 45%, transparent);
|
|
308
|
+
font-weight: 700;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
&[aria-disabled="true"] {
|
|
312
|
+
cursor: not-allowed;
|
|
313
|
+
opacity: 0.3;
|
|
314
|
+
text-decoration: line-through;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
&[data-chosen] {
|
|
318
|
+
background: var(--_mp-chosen);
|
|
319
|
+
box-shadow: inset 0 0 0 1.5px var(--_mp-chosen-rim);
|
|
320
|
+
color: var(--_mp-on-chosen);
|
|
321
|
+
font-weight: 700;
|
|
322
|
+
opacity: 1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/* Months and years: as wide as the days were, so nothing jumps */
|
|
327
|
+
& [data-mp="calendar-grid"]:not([data-view="days"]) {
|
|
328
|
+
block-size: calc(6 * var(--_mp-cell) + 1.75rem);
|
|
329
|
+
min-inline-size: calc(7 * var(--_mp-cell));
|
|
330
|
+
|
|
331
|
+
& [data-mp="calendar-cell"] {
|
|
332
|
+
inline-size: calc(100% - 0.4rem);
|
|
333
|
+
block-size: 2.75rem;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* A week is chosen whole */
|
|
338
|
+
& [data-mp="calendar-week"] {
|
|
339
|
+
inline-size: 1.75rem;
|
|
340
|
+
font-size: 0.75rem;
|
|
341
|
+
opacity: var(--_mp-dim);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
& [data-mp="calendar-body"][data-type="week"] {
|
|
345
|
+
& [data-mp="calendar-grid"] {
|
|
346
|
+
isolation: isolate;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
& td:nth-of-type(1) {
|
|
350
|
+
position: relative;
|
|
351
|
+
|
|
352
|
+
/* As wide as its seven days */
|
|
353
|
+
&::before {
|
|
354
|
+
content: "";
|
|
355
|
+
position: absolute;
|
|
356
|
+
z-index: -1;
|
|
357
|
+
inset-block: 0;
|
|
358
|
+
inset-inline-start: 0;
|
|
359
|
+
inline-size: 700%;
|
|
360
|
+
border-radius: 99px;
|
|
361
|
+
transition: background-color 150ms ease-out;
|
|
362
|
+
pointer-events: none;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
& tr[data-chosen] > td:nth-of-type(1)::before {
|
|
367
|
+
background: var(--_mp-chosen);
|
|
368
|
+
box-shadow: inset 0 0 0 1.5px var(--_mp-chosen-rim);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
& [data-mp="calendar-cell"][data-chosen] {
|
|
372
|
+
background: transparent;
|
|
373
|
+
box-shadow: none;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
@media (hover: hover) {
|
|
377
|
+
& tr:has([data-mp="calendar-cell"]:not([aria-disabled="true"]):hover) {
|
|
378
|
+
&:not([data-chosen]) > td:nth-of-type(1)::before {
|
|
379
|
+
background: var(--_mp-hover);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
& [data-mp="calendar-cell"] {
|
|
383
|
+
background: transparent;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/* ─── The time ─────────────────────────────────────────────────────────── */
|
|
390
|
+
|
|
391
|
+
& [data-mp="calendar-time"] {
|
|
392
|
+
display: flex;
|
|
393
|
+
gap: 0.25rem;
|
|
394
|
+
justify-content: center;
|
|
395
|
+
/* As high as the calendar next to it, whose rows don't change */
|
|
396
|
+
block-size: calc(6 * var(--_mp-cell) + 4rem);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
& [data-mp="calendar-column"] {
|
|
400
|
+
position: relative;
|
|
401
|
+
inline-size: 3.25rem;
|
|
402
|
+
overflow-y: auto;
|
|
403
|
+
overscroll-behavior: contain;
|
|
404
|
+
border-radius: 1rem;
|
|
405
|
+
outline-offset: -2px;
|
|
406
|
+
scrollbar-width: none;
|
|
407
|
+
|
|
408
|
+
&:focus-visible {
|
|
409
|
+
outline: 2px solid var(--_mp-ink);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
& [data-mp="calendar-option"] {
|
|
414
|
+
display: grid;
|
|
415
|
+
place-items: center;
|
|
416
|
+
block-size: var(--_mp-cell);
|
|
417
|
+
border-radius: 99px;
|
|
418
|
+
font-variant-numeric: tabular-nums;
|
|
419
|
+
cursor: pointer;
|
|
420
|
+
transition:
|
|
421
|
+
background-color 150ms ease-out,
|
|
422
|
+
color 150ms ease-out;
|
|
423
|
+
|
|
424
|
+
&[aria-selected="true"] {
|
|
425
|
+
background: var(--_mp-chosen);
|
|
426
|
+
box-shadow: inset 0 0 0 1.5px var(--_mp-chosen-rim);
|
|
427
|
+
color: var(--_mp-on-chosen);
|
|
428
|
+
font-weight: 700;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
&[aria-disabled="true"] {
|
|
432
|
+
cursor: not-allowed;
|
|
433
|
+
opacity: 0.3;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
& [data-mp="calendar-body"][data-type="time"] [data-mp="calendar-time"] {
|
|
438
|
+
block-size: calc(5 * var(--_mp-cell));
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
& [data-mp="calendar-foot"] {
|
|
442
|
+
grid-column: 1 / -1;
|
|
443
|
+
display: flex;
|
|
444
|
+
justify-content: center;
|
|
445
|
+
gap: 0.25rem;
|
|
446
|
+
|
|
447
|
+
& [data-mp="calendar-button"] {
|
|
448
|
+
padding-inline: 0.9rem;
|
|
449
|
+
font-size: 0.875rem;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
& [data-main] {
|
|
453
|
+
background: var(--_mp-chosen);
|
|
454
|
+
box-shadow: inset 0 0 0 1.5px var(--_mp-chosen-rim);
|
|
455
|
+
color: var(--_mp-on-chosen);
|
|
456
|
+
font-weight: 700;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
@media (max-width: 26rem) {
|
|
461
|
+
& [data-mp="calendar-body"][data-type="datetime-local"] {
|
|
462
|
+
grid-template-columns: auto;
|
|
463
|
+
|
|
464
|
+
& [data-mp="calendar-time"] {
|
|
465
|
+
block-size: calc(3 * var(--_mp-cell));
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/* ─── Preferences ──────────────────────────────────────────────────────── */
|
|
471
|
+
|
|
472
|
+
@media (prefers-reduced-motion: reduce) {
|
|
473
|
+
& [data-mp="calendar"][popover],
|
|
474
|
+
& [data-mp^="calendar-"] {
|
|
475
|
+
animation: none;
|
|
476
|
+
transition: none;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
@media (forced-colors: active) {
|
|
481
|
+
& [data-mp="calendar"][popover] {
|
|
482
|
+
border: 1px solid CanvasText;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
& :is([data-mp="calendar-cell"][data-chosen], [data-mp="calendar-option"][aria-selected="true"]) {
|
|
486
|
+
forced-color-adjust: none;
|
|
487
|
+
background: Highlight;
|
|
488
|
+
color: HighlightText;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
@keyframes mp-page-in {
|
|
494
|
+
from {
|
|
495
|
+
opacity: 0;
|
|
496
|
+
translate: var(--_mp-from, 0) 0;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|