@mistriwork/ui 1.0.0-rc.57 → 1.0.0-rc.59

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.
Files changed (122) hide show
  1. package/README.md +46 -12
  2. package/dist/Avatar.js +3 -3
  3. package/dist/Button.d.ts +4 -14
  4. package/dist/Button.js +26 -13
  5. package/dist/Carousel.d.ts +6 -5
  6. package/dist/Carousel.js +58 -67
  7. package/dist/Choices.d.ts +2 -9
  8. package/dist/Choices.js +127 -64
  9. package/dist/DateField.d.ts +9 -4
  10. package/dist/DateField.js +102 -119
  11. package/dist/Drawer.d.ts +1 -19
  12. package/dist/Drawer.js +8 -9
  13. package/dist/DropMenu.d.ts +8 -21
  14. package/dist/DropMenu.js +84 -30
  15. package/dist/Dropdown.d.ts +9 -8
  16. package/dist/Dropdown.js +69 -65
  17. package/dist/Field.d.ts +2 -1
  18. package/dist/Field.js +12 -18
  19. package/dist/FileField.d.ts +3 -10
  20. package/dist/FileField.js +12 -9
  21. package/dist/FormParts.d.ts +17 -10
  22. package/dist/FormParts.js +26 -41
  23. package/dist/HeroBlocks.d.ts +7 -3
  24. package/dist/HeroBlocks.js +11 -6
  25. package/dist/Modal.d.ts +6 -17
  26. package/dist/Modal.js +90 -21
  27. package/dist/Pagination.d.ts +1 -12
  28. package/dist/Pagination.js +17 -3
  29. package/dist/Popover.d.ts +1 -15
  30. package/dist/Popover.js +10 -15
  31. package/dist/Resizable.d.ts +3 -21
  32. package/dist/Resizable.js +14 -91
  33. package/dist/ScrollArea.d.ts +4 -2
  34. package/dist/ScrollArea.js +11 -11
  35. package/dist/Select.d.ts +1 -6
  36. package/dist/Select.js +16 -7
  37. package/dist/SensitiveField.d.ts +1 -8
  38. package/dist/SensitiveField.js +6 -4
  39. package/dist/Slider.d.ts +1 -5
  40. package/dist/Slider.js +13 -5
  41. package/dist/Switch.d.ts +1 -11
  42. package/dist/Switch.js +10 -9
  43. package/dist/Tabs.d.ts +3 -3
  44. package/dist/Tabs.js +3 -3
  45. package/dist/TextArea.d.ts +4 -6
  46. package/dist/TextArea.js +14 -5
  47. package/dist/TextField.d.ts +5 -9
  48. package/dist/TextField.js +67 -9
  49. package/dist/Tooltip.d.ts +1 -21
  50. package/dist/Tooltip.js +13 -31
  51. package/dist/Typeahead.d.ts +15 -18
  52. package/dist/Typeahead.js +151 -86
  53. package/dist/UiKit.d.ts +63 -4
  54. package/dist/UiKit.js +46 -5
  55. package/dist/behaviors/DaysParts.js +28 -0
  56. package/dist/behaviors/EditableParts.js +21 -0
  57. package/dist/behaviors/PickParts.js +30 -0
  58. package/dist/behaviors/ScrubParts.js +21 -0
  59. package/dist/behaviors/SortableParts.js +32 -0
  60. package/dist/behaviors/SpansParts.js +12 -0
  61. package/dist/behaviors/TransferParts.js +37 -0
  62. package/dist/behaviors/TurnsParts.js +31 -0
  63. package/dist/behaviors/WidthsParts.js +27 -0
  64. package/dist/behaviors/days.js +216 -0
  65. package/dist/behaviors/dress.js +86 -0
  66. package/dist/behaviors/editable.js +104 -0
  67. package/dist/behaviors/heard.js +22 -0
  68. package/dist/behaviors/index.d.ts +310 -0
  69. package/dist/behaviors/index.js +44 -0
  70. package/dist/behaviors/pick.js +158 -0
  71. package/dist/behaviors/scrub.js +152 -0
  72. package/dist/behaviors/sortable.js +170 -0
  73. package/dist/behaviors/spans.js +240 -0
  74. package/dist/behaviors/testing.js +48 -0
  75. package/dist/behaviors/transfer.js +202 -0
  76. package/dist/behaviors/turns.js +106 -0
  77. package/dist/behaviors/widths.js +150 -0
  78. package/dist/behaviors.css +309 -0
  79. package/dist/changeDetails.d.ts +4 -8
  80. package/dist/changeDetails.js +0 -6
  81. package/dist/conformance.js +107 -1
  82. package/dist/controls.css +36 -0
  83. package/dist/fieldFrame.d.ts +2 -15
  84. package/dist/fieldFrame.js +1 -17
  85. package/dist/index.d.ts +6 -5
  86. package/dist/index.js +6 -5
  87. package/dist/internal/Frame.d.ts +6 -0
  88. package/dist/internal/Frame.js +25 -0
  89. package/dist/internal/HelpTip.d.ts +5 -0
  90. package/dist/internal/HelpTip.js +37 -0
  91. package/dist/internal/layers.d.ts +21 -0
  92. package/dist/internal/layers.js +66 -0
  93. package/dist/internal/popups.d.ts +12 -10
  94. package/dist/internal/popups.js +18 -14
  95. package/dist/internal/told.d.ts +14 -0
  96. package/dist/internal/told.js +20 -0
  97. package/dist/internal/uiKitContext.js +6 -4
  98. package/dist/preferences.css +2 -3
  99. package/dist/style.css +5 -16
  100. package/dist/styles/extras.css +461 -0
  101. package/dist/styles/forms.css +346 -0
  102. package/dist/styles/guard.css +114 -0
  103. package/dist/styles/kit-fields.css +181 -0
  104. package/dist/styles/kit-parts.css +130 -0
  105. package/dist/styles/kit.css +558 -0
  106. package/dist/styles/layers.css +4 -0
  107. package/dist/styles/looks.css +374 -0
  108. package/dist/styles/m-tokens.css +173 -0
  109. package/dist/styles/overlays.css +107 -0
  110. package/dist/styles/parts.css +456 -0
  111. package/dist/styles/screens.css +76 -0
  112. package/dist/styles/ui-sdk.css +1635 -0
  113. package/dist/tokens.css +15 -4
  114. package/dist/uiKitSlots.d.ts +1 -1
  115. package/dist/uiKitSlots.js +18 -2
  116. package/package.json +13 -11
  117. package/dist/forms.css +0 -225
  118. package/dist/hero.css +0 -23
  119. package/dist/internal/anchor.d.ts +0 -19
  120. package/dist/internal/anchor.js +0 -52
  121. package/dist/primitives.css +0 -200
  122. package/dist/standalone.css +0 -478
@@ -0,0 +1,456 @@
1
+ /* This theme's dress over UI SDK's stylesheet: what its tokens cannot say. Every rule keys on a part's
2
+ data-slot and its state attributes, never on a class or a generated id. */
3
+ @layer m-parts {
4
+ [data-slot='visually-hidden'],
5
+ [data-kind='visually-hidden'] {
6
+ position: absolute;
7
+ width: 1px;
8
+ height: 1px;
9
+ overflow: hidden;
10
+ clip-path: inset(50%);
11
+ white-space: nowrap;
12
+ }
13
+
14
+ /* Hover is 120ms of colour and nothing else (docs/design.md, Motion). */
15
+ :is(
16
+ [data-slot='button'],
17
+ [data-slot='toggle'],
18
+ [data-slot$='-trigger'],
19
+ [data-slot$='-close'],
20
+ [data-slot$='-item'],
21
+ [data-slot='pagination-link'],
22
+ [data-slot='tabs-tab'],
23
+ [data-slot='input'],
24
+ [data-slot='textarea']
25
+ ) {
26
+ transition:
27
+ background-color var(--m-fast),
28
+ border-color var(--m-fast),
29
+ color var(--m-fast);
30
+ }
31
+
32
+ /* A filled primary is the ink, not the accent: UI SDK fills `solid` with its primary, which here is the accent
33
+ that checked and selected states wear. */
34
+ /* A link dressed as a button is read as a button: no underline, in the button's own ink. */
35
+ a[data-slot='button'] {
36
+ text-decoration: none;
37
+ }
38
+
39
+ [data-slot][data-variant='solid'] {
40
+ border-color: var(--m-primary);
41
+ background: var(--m-primary);
42
+ color: var(--m-on-primary);
43
+
44
+ &:hover:not([data-disabled]) {
45
+ background: color-mix(in oklab, var(--m-primary) 86%, var(--m-surface));
46
+ }
47
+ }
48
+
49
+ /* A control at rest stands a hair off the surface, on a softer edge than a field's: a button is found by its
50
+ words and its fill, a field by its edge. A listbox's trigger holds a value, so it is a field and keeps the
51
+ field's edge (3:1 on its ground): on the softer one a pager's size was the one field of a list that did not
52
+ read as a field, in every look that had no rule of its own for it. */
53
+ :is([data-slot='button'], [data-slot$='-trigger']:not([data-slot='select-trigger']), [data-slot='toggle']):not([data-variant]) {
54
+ border-color: var(--m-line-strong);
55
+ box-shadow: var(--m-shadow-control);
56
+ }
57
+
58
+ /* A trigger says its popup is open, in the words a pressed control uses: the raised ground under a button, the
59
+ focus edge round a field. It holds until the popup closes, so the eye that left for the list finds its way back. */
60
+ :is([data-slot='button'], [data-slot$='-trigger']:not([data-slot='select-trigger']))[aria-expanded='true']:not(
61
+ [data-variant='solid'],
62
+ [data-variant='destructive'],
63
+ [data-kind]
64
+ ) {
65
+ background: var(--m-raised);
66
+ }
67
+
68
+ [data-slot='select-trigger'][aria-expanded='true'] {
69
+ border-color: var(--ui-ring-border);
70
+ }
71
+
72
+ /* The quiet intent: words until hovered, in the colour a link is, so they read as something to press and not as
73
+ a note beside the field. UI SDK draws `solid` and `destructive` itself. */
74
+ [data-slot][data-variant='quiet'] {
75
+ border-color: transparent;
76
+ background: transparent;
77
+ box-shadow: none;
78
+ color: var(--link, var(--m-accent-ink));
79
+
80
+ &:hover:not([data-disabled]) {
81
+ background: var(--m-raised);
82
+ }
83
+ }
84
+
85
+ /* A control's box is said once for every one of them (tokens.css): its height, the width of its edge and a
86
+ field's fill, which a theme moves to draw a taller, heavier or filled field. UI SDK sizes each control on its
87
+ spacing step, which no theme says, so the boxes read the three here. A size of its own (`data-size`, a chip, a
88
+ help mark) is said after this and stands over it; an input inside a box that is itself the field (a date's)
89
+ is undressed by that box's rule in the layer above. */
90
+ [data-slot='button']:not([data-variant='none']) {
91
+ height: auto;
92
+ min-height: var(--control-h);
93
+ border-width: var(--control-border-w);
94
+ }
95
+
96
+ :is([data-slot='input'], [data-slot='autocomplete-input'], [data-slot='select-trigger'], [data-slot='date-field']) {
97
+ height: var(--control-h);
98
+ border-width: var(--control-border-w);
99
+ background-color: var(--field-fill);
100
+ }
101
+
102
+ :is([data-slot='textarea'], [data-slot='check-cards-card'], [data-slot='file-field']) {
103
+ border-width: var(--control-border-w);
104
+ }
105
+
106
+ /* A listbox's button is as wide as what it says, and a field's frame makes it the field's width (./forms.css).
107
+ UI SDK gives it a floor of twelve rem, which made two filters side by side wider than a phone. */
108
+ [data-slot='select-trigger'] {
109
+ min-width: 0;
110
+ }
111
+
112
+ [data-slot='textarea'] {
113
+ background-color: var(--field-fill);
114
+ }
115
+
116
+ /* A least height, as the default size's is: a caller that sets a compact button in a line of text says
117
+ `min-height: 0` and has a word, where a fixed height made the line a control tall. */
118
+ [data-slot][data-size='sm']:is([data-slot='button'], [data-slot$='-trigger']) {
119
+ height: auto;
120
+ min-height: calc(var(--ui-spacing) * 6.5);
121
+ padding-inline: calc(var(--ui-spacing) * 2.25);
122
+ font-size: calc(var(--ui-font-size) - 0.0625rem);
123
+ }
124
+
125
+ [data-slot='button'][data-size='lg'] {
126
+ height: calc(var(--ui-spacing) * 10);
127
+ padding-inline: calc(var(--ui-spacing) * 4.5);
128
+ font-size: calc(var(--ui-font-size) + 0.0625rem);
129
+ }
130
+
131
+ /* The label keeps its width while the button waits, so nothing beside it moves. */
132
+ [data-slot='button'][data-pending] {
133
+ cursor: progress;
134
+ opacity: 0.72;
135
+ }
136
+
137
+ :is([data-slot='button'], [data-slot$='-trigger'], [data-slot$='-close'], [data-slot='toggle']) > svg {
138
+ flex: none;
139
+ width: 1.1em;
140
+ height: 1.1em;
141
+ }
142
+
143
+ /* A checkbox or a switch stands beside its label, not over it. */
144
+ [data-slot='field']:has(> :is([data-slot='checkbox'], [data-slot='switch'])) {
145
+ flex-direction: row;
146
+ align-items: flex-start;
147
+ gap: calc(var(--ui-spacing) * 2.5);
148
+ }
149
+
150
+ [data-slot='field-label'] {
151
+ font-weight: var(--m-weight-strong);
152
+ }
153
+
154
+ [data-slot='avatar'] {
155
+ border-radius: 999px;
156
+ background: color-mix(in oklab, var(--m-accent) 14%, var(--m-surface));
157
+ color: var(--m-accent-ink);
158
+ font-weight: var(--m-weight-bold);
159
+
160
+ &[data-size='sm'] {
161
+ width: 1.5rem;
162
+ height: 1.5rem;
163
+ font-size: var(--m-size-2xs);
164
+ }
165
+ }
166
+
167
+ /* Popups enter with ease-out and leave at once. */
168
+ @media (prefers-reduced-motion: no-preference) {
169
+ :is(
170
+ [data-slot='menu-content'],
171
+ [data-slot='select-content'],
172
+ [data-slot='combobox-content'],
173
+ [data-slot='popover-content'],
174
+ [data-slot='tooltip-content'],
175
+ [data-slot='date-picker-content'],
176
+ [data-slot='dialog-content'],
177
+ [data-slot='alert-dialog-content']
178
+ ) {
179
+ transform-origin: var(--transform-origin, center);
180
+ transition:
181
+ opacity var(--m-enter) var(--m-ease-out),
182
+ scale var(--m-enter) var(--m-ease-out);
183
+
184
+ &[data-starting-style] {
185
+ opacity: 0;
186
+ scale: 0.97;
187
+ }
188
+
189
+ &[data-ending-style] {
190
+ opacity: 0;
191
+ transition: none;
192
+ }
193
+ }
194
+ }
195
+
196
+ :is([data-slot='dialog-title'], [data-slot='alert-dialog-title'], [data-slot='drawer-title']) {
197
+ font-size: 1.0625rem;
198
+ font-weight: var(--m-weight-heavy);
199
+ letter-spacing: -0.012em;
200
+ }
201
+
202
+ [data-part='dialog-actions'] {
203
+ display: flex;
204
+ justify-content: flex-end;
205
+ gap: var(--m-space-3);
206
+ margin-block-start: var(--m-space-3);
207
+ }
208
+
209
+ [data-part='form'] {
210
+ display: flex;
211
+ flex-direction: column;
212
+ gap: var(--m-space-5);
213
+ }
214
+
215
+ [data-slot='drawer-content']:is([data-side='left'], [data-side='right']) {
216
+ width: min(24rem, 100vw);
217
+ }
218
+
219
+ /* A button that is one of a few ways to see the same thing says which is on by its ground, and by its state. */
220
+ [data-slot='button'][aria-pressed='true']:not([data-variant]) {
221
+ border-color: color-mix(in oklab, var(--m-accent) 45%, var(--m-surface));
222
+ background: var(--m-accent-soft);
223
+ color: var(--m-accent-ink);
224
+ }
225
+
226
+ /* A popover's title names a small surface, not a page: it is the size of a label. */
227
+ [data-slot='popover-title'] {
228
+ margin: 0;
229
+ font-size: var(--m-size-sm);
230
+ line-height: var(--m-lead-sm);
231
+ font-weight: var(--m-weight-bold);
232
+ letter-spacing: 0;
233
+ }
234
+
235
+ /* The command palette: a dialog that is nothing but its command. */
236
+ [data-slot='dialog-content'][data-part='palette'] {
237
+ inset-block: 18dvh auto;
238
+ width: min(36rem, calc(100% - 2rem));
239
+ padding: 0;
240
+ gap: 0;
241
+ overflow: hidden
242
+ }
243
+
244
+ [data-part='palette-search'] {
245
+ display: flex;
246
+ align-items: center;
247
+ padding-inline-start: calc(var(--ui-spacing) * 4);
248
+ border-block-end: 1px solid var(--m-line);
249
+ color: var(--m-ink-muted);
250
+
251
+ & svg {
252
+ flex: none;
253
+ width: 1rem;
254
+ height: 1rem;
255
+ }
256
+ }
257
+
258
+ /* A search box: the glass inside its start, the clear button inside its end. */
259
+ [data-kind='search'] {
260
+ position: relative;
261
+ display: flex;
262
+ align-items: center;
263
+
264
+ & > svg {
265
+ position: absolute;
266
+ inset-inline-start: 0.625rem;
267
+ width: 0.9375rem;
268
+ height: 0.9375rem;
269
+ color: var(--m-ink-muted);
270
+ pointer-events: none;
271
+ }
272
+
273
+ & [data-slot='input'] {
274
+ width: 100%;
275
+ padding-inline: var(--m-inset-icon);
276
+ }
277
+
278
+ & [data-slot='input']::-webkit-search-cancel-button {
279
+ display: none;
280
+ }
281
+
282
+ & [data-slot='input-clear'] {
283
+ position: absolute;
284
+ inset-inline-end: 0.25rem;
285
+ display: grid;
286
+ place-items: center;
287
+ width: 1.5rem;
288
+ height: 1.5rem;
289
+ padding: 0;
290
+ border: 0;
291
+ border-radius: calc(var(--m-radius) * 0.6);
292
+ background: transparent;
293
+ color: var(--m-ink-muted);
294
+ cursor: pointer;
295
+
296
+ &:hover {
297
+ background: var(--m-raised);
298
+ color: var(--m-ink);
299
+ }
300
+ }
301
+ }
302
+
303
+ /* Tabs are words on a rule; the marker under the current one slides to the next. */
304
+ [data-slot='tabs-list'] {
305
+ position: relative;
306
+ display: flex;
307
+ gap: calc(var(--m-unit) * 5);
308
+ padding: 0;
309
+ border: 0;
310
+ border-block-end: 1px solid var(--m-line);
311
+ border-radius: 0;
312
+ background: none;
313
+ /* More tabs than the width holds scroll in their own box, never the page. */
314
+ overflow-x: auto;
315
+ scrollbar-width: none;
316
+ }
317
+
318
+ [data-slot='tabs-tab'] {
319
+ flex: none;
320
+ white-space: nowrap;
321
+ display: inline-flex;
322
+ align-items: center;
323
+ gap: var(--m-space-2h);
324
+ height: calc(var(--m-unit) * 9.5);
325
+ padding: 0;
326
+ border: 0;
327
+ border-radius: 0;
328
+ background: none;
329
+ color: var(--m-ink-muted);
330
+ font: inherit;
331
+ font-size: var(--m-text);
332
+ font-weight: var(--m-weight-medium);
333
+ cursor: pointer;
334
+
335
+ &:hover {
336
+ color: var(--m-ink);
337
+ }
338
+
339
+ &[data-selected] {
340
+ background: none;
341
+ box-shadow: none;
342
+ color: var(--m-ink);
343
+ }
344
+ }
345
+
346
+ [data-slot='tabs-indicator'] {
347
+ position: absolute;
348
+ inset-block-end: -1px;
349
+ left: var(--active-tab-left);
350
+ width: var(--active-tab-width);
351
+ height: 2px;
352
+ background: var(--m-ink);
353
+ }
354
+
355
+ @media (prefers-reduced-motion: no-preference) {
356
+ [data-slot='tabs-indicator'] {
357
+ transition:
358
+ left var(--m-enter) var(--m-ease-out),
359
+ width var(--m-enter) var(--m-ease-out);
360
+ }
361
+ }
362
+
363
+ [data-slot='tabs-panel'] {
364
+ padding: 0;
365
+ }
366
+
367
+ [data-tone='warning']:not([data-slot]) {
368
+ color: var(--m-warning);
369
+ }
370
+
371
+ @keyframes m-wait {
372
+ from {
373
+ background-position: 120% 0;
374
+ }
375
+
376
+ to {
377
+ background-position: -80% 0;
378
+ }
379
+ }
380
+
381
+ /* A button whose press is still running keeps its width and says so with a turning ring in place of a dimming:
382
+ the reader pressed it, and it is working. */
383
+ [data-slot='button'][data-pending] {
384
+ position: relative;
385
+ filter: none;
386
+ color: transparent;
387
+
388
+ & > * {
389
+ visibility: hidden;
390
+ }
391
+
392
+ &::after {
393
+ position: absolute;
394
+ inset: 0;
395
+ width: 0.875rem;
396
+ height: 0.875rem;
397
+ margin: auto;
398
+ border: 2px solid var(--m-ink-subtle);
399
+ border-block-start-color: transparent;
400
+ border-radius: 50%;
401
+ content: '';
402
+ }
403
+
404
+ &:is([data-variant='solid'], [data-variant='destructive'])::after {
405
+ border-color: color-mix(in oklab, var(--m-surface) 80%, transparent);
406
+ border-block-start-color: transparent;
407
+ }
408
+ }
409
+
410
+ @media (prefers-reduced-motion: no-preference) {
411
+ [data-slot='button'][data-pending]::after {
412
+ animation: m-turn 0.7s linear infinite;
413
+ }
414
+ }
415
+
416
+ @keyframes m-turn {
417
+ to {
418
+ rotate: 1turn;
419
+ }
420
+ }
421
+
422
+ /* Something carried: the copy under the pointer lifts off the page and tilts, and squares up with an edge in the
423
+ accent over a place that would take it. It is drawn on the page's top layer, outside whatever it was lifted
424
+ from, so its look is said here with the parts and not with the board. */
425
+ [data-drag-preview] {
426
+ /* A copy of a list's item is outside its list, and would grow the marker its list had taken off. */
427
+ list-style: none;
428
+ box-shadow: var(--m-shadow-pop);
429
+ rotate: 1.5deg;
430
+ cursor: grabbing;
431
+ transition:
432
+ rotate var(--m-fast),
433
+ outline-color var(--m-fast);
434
+ outline: 2px solid transparent;
435
+
436
+ &[data-over] {
437
+ rotate: 0deg;
438
+ outline-color: var(--m-accent);
439
+ }
440
+ }
441
+
442
+ [data-slot='button'][data-block] {
443
+ display: flex;
444
+ width: 100%;
445
+ }
446
+
447
+ /* A word at a menu item's end: its shortcut, a count. */
448
+ [data-slot='menu-item-hint'] {
449
+ margin-inline-start: auto;
450
+ padding-inline-start: calc(var(--m-space-4) * 2);
451
+ color: var(--m-ink-subtle);
452
+ font-size: var(--m-size-xs);
453
+ line-height: var(--m-lead-xs);
454
+ font-variant-numeric: tabular-nums;
455
+ }
456
+ }
@@ -0,0 +1,76 @@
1
+ /* What a control owes the screen it stands on, whatever it looks like: an answer's width, a line's measure, a
2
+ finger's target and a phone's text size. These were promises of the stylesheet the controls wore before they were
3
+ drawn over UI SDK, and the screens were built on them; they are said here of the parts. */
4
+ @layer m-components {
5
+ /* A field is as wide as its answer (docs/design.md, Forms): a count, an amount, a day and a time are a few
6
+ characters long, and a box the width of the column for them says "write a paragraph". The cap is on the control,
7
+ not the field, so its label, hint and problem keep the column's measure. Set from the data kind the form already
8
+ knows (Field's `kind`, worn as `data-answer`), never measured, so no answer resizes its field. Consecutive short
9
+ fields share a row where the form lays its fields on a grid. */
10
+ [data-slot='field']:is([data-answer='number'], [data-answer='time']) {
11
+ --answer-max: 160px;
12
+ }
13
+ [data-slot='field'][data-answer='money'] {
14
+ --answer-max: 200px;
15
+ }
16
+ [data-slot='field'][data-answer='date'] {
17
+ --answer-max: 240px;
18
+ }
19
+ [data-slot='field'][data-answer='datetime'] {
20
+ --answer-max: 280px;
21
+ }
22
+ [data-slot='field'][data-answer] > :is(input, [data-slot='field-box'], [data-slot='field-with-action'], [data-slot='date-field'], [data-slot='dropdown']) {
23
+ max-inline-size: var(--answer-max);
24
+ }
25
+
26
+ /* A hint and a problem stand at a reading measure, not the width of a wide room (a field report: one line of 150
27
+ characters). */
28
+ :is([data-slot='field-description'], [data-slot='field-error']) {
29
+ max-width: 70ch;
30
+ }
31
+
32
+ /* A finger needs 44px (WCAG 2.5.5) whatever height a theme draws, through the density's zoom: under any coarse
33
+ pointer, and at a phone's width, where a narrow window on a desk is read as a phone is (grade measures the targets
34
+ at 390px with no touch). A small button stays small: it is the one a toolbar asks for. */
35
+ @media (pointer: coarse), (max-width: 40rem) {
36
+ :is(
37
+ [data-slot='input'],
38
+ [data-slot='textarea'],
39
+ [data-slot='select-trigger'],
40
+ [data-slot='autocomplete-input'],
41
+ [data-slot='choice'],
42
+ [data-slot='check-cards-card'],
43
+ [data-slot='button']:not([data-size='sm'])
44
+ ) {
45
+ min-height: calc(44px / var(--density-zoom, 1));
46
+ }
47
+ /* The calendar's button is the box's own height and wide enough to be hit. */
48
+ [data-slot='date-field'] > [data-slot='popover-trigger'] {
49
+ min-width: calc(44px / var(--density-zoom, 1));
50
+ min-height: calc(44px / var(--density-zoom, 1));
51
+ }
52
+ /* A page's number is a square, so it is given both ways; the steps are words and already wide enough. */
53
+ :is([data-slot='pagination-link'], [data-slot='pagination-previous'], [data-slot='pagination-next']) {
54
+ min-width: calc(44px / var(--density-zoom, 1));
55
+ min-height: calc(44px / var(--density-zoom, 1));
56
+ }
57
+ }
58
+
59
+ /* iOS Safari zooms the page when a field under 16px is focused, and does not zoom back. The density zoom only
60
+ enlarges (1, 1.12, 1.24), so a flat 16px is at least 16px drawn. Not verified on WebKit: it is not installed
61
+ where this was written, so a real iPhone is the test of this rule. */
62
+ @media (pointer: coarse) {
63
+ :is([data-slot='input'], [data-slot='textarea'], [data-slot='select-trigger'], [data-slot='autocomplete-input']) {
64
+ font-size: max(16px, var(--m-text));
65
+ }
66
+ }
67
+
68
+ /* A card with a mark at its end keeps room for its words at a phone's width: at the desk's 7rem floor three cards
69
+ stood across 354px and "Heating and cooling" was set one word to a line. Two across, or one where even that is
70
+ too narrow. A pick (a row, a pair) and a stack say their own columns. */
71
+ @media (max-width: 40rem) {
72
+ [data-slot='radio-group'][data-kind='cards']:not([data-fit='row'], [data-fit='pair'], [data-fit='stack'], [data-shape='pair']) {
73
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
74
+ }
75
+ }
76
+ }