@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,461 @@
1
+ /* The rest of the furniture: badges and marks, a form's progress, the landing blocks, and what holds other things
2
+ (slides, panes, a scrolling region). */
3
+ @layer m-components {
4
+ [data-slot='badge'] {
5
+ display: inline-flex;
6
+ align-items: center;
7
+ gap: var(--m-space-2);
8
+ height: 1.375rem;
9
+ padding-inline: var(--m-space-3);
10
+ border-radius: var(--m-radius-pill, 999px);
11
+ background: var(--m-raised);
12
+ color: var(--m-ink-muted);
13
+ font-size: var(--m-size-xs);
14
+ line-height: var(--m-lead-xs);
15
+ font-weight: var(--m-weight-strong);
16
+ white-space: nowrap;
17
+
18
+ & svg {
19
+ width: 0.75rem;
20
+ height: 0.75rem;
21
+ }
22
+
23
+ &[data-tone='good'] {
24
+ background: color-mix(in oklab, var(--m-good) 12%, var(--m-surface));
25
+ color: color-mix(in oklab, var(--m-good) 82%, var(--m-ink));
26
+ }
27
+
28
+ &[data-tone='warning'] {
29
+ background: color-mix(in oklab, var(--m-warning) 12%, var(--m-surface));
30
+ color: color-mix(in oklab, var(--m-warning) 82%, var(--m-ink));
31
+ }
32
+
33
+ &[data-tone='critical'] {
34
+ background: color-mix(in oklab, var(--m-critical) 12%, var(--m-surface));
35
+ color: color-mix(in oklab, var(--m-critical) 82%, var(--m-ink));
36
+ }
37
+
38
+ &[data-tone='info'] {
39
+ background: var(--m-accent-soft);
40
+ color: var(--m-accent-ink);
41
+ }
42
+ }
43
+
44
+ @keyframes m-arrive {
45
+ from {
46
+ opacity: 0;
47
+ scale: 0.6;
48
+ }
49
+ }
50
+
51
+ /* More about a field: a small question mark that opens a few words. */
52
+ [data-slot='popover-trigger'][data-kind='help-tip'] {
53
+ display: inline-grid;
54
+ place-items: center;
55
+ width: 1.125rem;
56
+ height: 1.125rem;
57
+ min-width: 0;
58
+ padding: 0;
59
+ border: 0;
60
+ border-radius: 999px;
61
+ background: var(--m-raised);
62
+ box-shadow: none;
63
+ color: var(--m-ink-muted);
64
+ vertical-align: middle;
65
+
66
+ & svg {
67
+ width: 0.6875rem;
68
+ height: 0.6875rem;
69
+ }
70
+
71
+ &:hover,
72
+ &[data-open] {
73
+ background: var(--m-accent-soft);
74
+ color: var(--m-accent-ink);
75
+ }
76
+ }
77
+
78
+ [data-slot='popover-content'][data-kind='help-tip'] {
79
+ max-width: 18rem;
80
+ padding: var(--m-space-3h) var(--m-space-4);
81
+ color: var(--m-ink-muted);
82
+ line-height: var(--m-leading);
83
+ }
84
+
85
+ /* One step of a longer form: where the reader is, drawn as a thin bar that fills, over the step's name. */
86
+ [data-slot='step-header'] {
87
+ display: flex;
88
+ flex-direction: column;
89
+ gap: var(--m-space-2h);
90
+
91
+ & :is(h1, h2, h3) {
92
+ margin: var(--m-space-2) 0 0;
93
+ font-size: var(--m-size-3xl);
94
+ line-height: var(--m-lead-3xl);
95
+ font-weight: var(--m-weight-bold);
96
+ letter-spacing: var(--m-track-title);
97
+ }
98
+ }
99
+
100
+ [data-slot='step-lead'] {
101
+ margin: 0;
102
+ color: var(--m-ink-muted);
103
+ line-height: var(--m-leading);
104
+ }
105
+
106
+ [data-slot='columns'] {
107
+ display: grid;
108
+ /* As wide as what it stands in, or a row of them would shrink to one column's width inside a flex box. */
109
+ width: 100%;
110
+ /* As many across as fit at a width a short answer can be typed in; a caller narrows or widens that with
111
+ `--min`. Each starts at the row's top, so a hint or a problem under one moves nothing beside it. */
112
+ grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 9rem), 100%), 1fr));
113
+ align-items: start;
114
+ gap: var(--m-space-5);
115
+ }
116
+
117
+ /* What was said, before it is sent: a ruled list, the way back at each row's end. */
118
+ [data-slot='review-list'] {
119
+ display: flex;
120
+ flex-direction: column;
121
+ margin: 0;
122
+ border: 1px solid var(--m-line);
123
+ border-radius: var(--m-radius-panel, calc(var(--m-radius) + 2px));
124
+
125
+ & > div {
126
+ display: grid;
127
+ grid-template-columns: minmax(5rem, 0.6fr) minmax(0, 1fr) 3.75rem;
128
+ gap: var(--m-space-2) var(--m-space-5);
129
+ align-items: baseline;
130
+ padding: var(--m-space-3h) var(--m-space-4h);
131
+ }
132
+
133
+ & > div + div {
134
+ border-block-start: 1px solid var(--m-line);
135
+ }
136
+
137
+ & dt {
138
+ color: var(--m-ink-muted);
139
+ }
140
+
141
+ & dd {
142
+ grid-column: 2;
143
+ margin: 0;
144
+ }
145
+ }
146
+
147
+ @media (max-width: 30rem) {
148
+ [data-slot='review-list'] > div {
149
+ grid-template-columns: minmax(0, 1fr) 3.75rem;
150
+
151
+ & dt {
152
+ grid-column: 1 / -1;
153
+ }
154
+
155
+ & dd {
156
+ grid-column: 1;
157
+ }
158
+ }
159
+ }
160
+
161
+ [data-slot='icon-rows'] {
162
+ display: flex;
163
+ flex-direction: column;
164
+ gap: var(--m-space-5);
165
+ margin: 0;
166
+ padding: 0;
167
+ list-style: none;
168
+
169
+ & li {
170
+ display: flex;
171
+ gap: var(--m-space-4);
172
+ }
173
+
174
+ & strong {
175
+ font-weight: var(--m-weight-strong);
176
+ }
177
+
178
+ & p {
179
+ margin: var(--m-space-1) 0 0;
180
+ color: var(--m-ink-muted);
181
+ line-height: var(--m-leading);
182
+ }
183
+ }
184
+
185
+ [data-slot='icon-rows-icon'] {
186
+ display: grid;
187
+ flex: none;
188
+ place-items: center;
189
+ width: 2rem;
190
+ height: 2rem;
191
+ border-radius: var(--m-radius);
192
+ background: var(--m-accent-soft);
193
+ color: var(--m-accent-ink);
194
+
195
+ & svg {
196
+ width: 1rem;
197
+ height: 1rem;
198
+ }
199
+ }
200
+
201
+ /* Pictures as tiles: the first leads at twice the height, the rest fill the column beside it. */
202
+ [data-slot='photo-tiles'] {
203
+ display: grid;
204
+ grid-template-columns: 1.4fr 1fr;
205
+ grid-auto-rows: minmax(0, 1fr);
206
+ gap: var(--m-space-3);
207
+ /* A box of its own shape, so nothing under it moves as the pictures arrive. */
208
+ aspect-ratio: 4 / 3;
209
+
210
+ & figure {
211
+ position: relative;
212
+ min-height: 0;
213
+ margin: 0;
214
+ overflow: hidden;
215
+ border-radius: var(--m-radius-panel, calc(var(--m-radius) + 2px));
216
+ background: var(--m-raised);
217
+ }
218
+
219
+ & figure:first-child {
220
+ grid-row: 1 / -1;
221
+ }
222
+
223
+ &[data-count='1'] {
224
+ grid-template-columns: 1fr;
225
+ }
226
+
227
+ &[data-count='3'] figure:first-child,
228
+ &[data-count='4'] figure:first-child {
229
+ grid-row: span 2;
230
+ }
231
+
232
+ &[data-count='4'] figure:last-child {
233
+ grid-column: 1 / -1;
234
+ }
235
+
236
+ /* Out of the flow: a picture fills its tile and never sizes it, or a tall one would stretch its row and the
237
+ mosaic with it. */
238
+ & img {
239
+ position: absolute;
240
+ inset: 0;
241
+ display: block;
242
+ width: 100%;
243
+ height: 100%;
244
+ object-fit: cover;
245
+ }
246
+ }
247
+
248
+ /* Slides: the arrows stand outside the viewport, and the dots under it say which slide and take a press. */
249
+ [data-slot='carousel'] {
250
+ display: flex;
251
+ flex-direction: column;
252
+ gap: var(--m-space-3h);
253
+ }
254
+
255
+ [data-slot='carousel-stage'] {
256
+ display: grid;
257
+ grid-template-columns: auto minmax(0, 1fr) auto;
258
+ align-items: center;
259
+ gap: var(--m-space-2h);
260
+ }
261
+
262
+ [data-slot='carousel-viewport'] {
263
+ border-radius: var(--m-radius-panel, calc(var(--m-radius) + 2px));
264
+ }
265
+
266
+ :is([data-slot='carousel-previous'], [data-slot='carousel-next']) {
267
+ width: calc(var(--ui-spacing) * 8);
268
+ padding: 0;
269
+ border-radius: 999px;
270
+ }
271
+
272
+ [data-slot='carousel-indicator-group'] {
273
+ display: flex;
274
+ justify-content: center;
275
+ gap: var(--m-space-2h);
276
+ }
277
+
278
+ [data-slot='carousel-indicator'] {
279
+ width: 0.4375rem;
280
+ height: 0.4375rem;
281
+ min-width: 0;
282
+ padding: 0;
283
+ border: 0;
284
+ border-radius: 999px;
285
+ background: var(--m-line-strong);
286
+ cursor: pointer;
287
+ transition:
288
+ width var(--m-fast),
289
+ background-color var(--m-fast);
290
+
291
+ &[data-selected] {
292
+ width: 1.25rem;
293
+ background: var(--m-ink);
294
+ }
295
+ }
296
+
297
+ @media (max-width: 30rem) {
298
+ [data-slot='carousel-stage'] {
299
+ grid-template-columns: minmax(0, 1fr);
300
+ }
301
+
302
+ :is([data-slot='carousel-previous'], [data-slot='carousel-next']) {
303
+ display: none;
304
+ }
305
+ }
306
+
307
+ /* Panes and the bar between them: a hairline that thickens into the accent under the pointer and the keyboard,
308
+ with a hit area wider than it looks. */
309
+ [data-slot='resizable'] {
310
+ display: flex;
311
+ min-height: 0;
312
+ border: 1px solid var(--m-line);
313
+ border-radius: var(--m-radius-panel, calc(var(--m-radius) + 2px));
314
+ overflow: hidden;
315
+
316
+ &[data-orientation='vertical'] {
317
+ flex-direction: column;
318
+ }
319
+ }
320
+
321
+ [data-slot='resizable-panel'] {
322
+ min-width: 0;
323
+ min-height: 0;
324
+ overflow: auto;
325
+ /* What is in a pane says its own padding: a list runs edge to edge, a note does not. */
326
+ padding: 0;
327
+ }
328
+
329
+ /* A region that scrolls inside a pane is the pane's, not a box in a box. */
330
+ [data-slot='resizable-panel'] > [data-slot='scroll-area'] {
331
+ border: 0;
332
+ border-radius: 0;
333
+ }
334
+
335
+ [data-slot='resizable-handle'] {
336
+ position: relative;
337
+ flex: none;
338
+ background: var(--m-line);
339
+ transition: background-color var(--m-fast);
340
+
341
+ [data-orientation='horizontal'] > & {
342
+ width: 1px;
343
+ cursor: col-resize;
344
+ }
345
+
346
+ [data-orientation='vertical'] > & {
347
+ height: 1px;
348
+ cursor: row-resize;
349
+ }
350
+
351
+ &::after {
352
+ position: absolute;
353
+ inset: -0.25rem;
354
+ content: '';
355
+ }
356
+
357
+ &:is([data-hovering], [data-dragging], :focus-visible) {
358
+ background: var(--m-accent);
359
+ box-shadow: 0 0 0 1px var(--m-accent);
360
+ outline: 0;
361
+ }
362
+ }
363
+
364
+ [data-slot='scroll-area'] {
365
+ position: relative;
366
+ display: flex;
367
+ overflow: hidden;
368
+ border: 1px solid var(--m-line);
369
+ border-radius: var(--m-radius-panel, calc(var(--m-radius) + 2px));
370
+ }
371
+
372
+ [data-slot='scroll-area-viewport'] {
373
+ flex: 1;
374
+ max-height: inherit;
375
+
376
+ &:focus-visible {
377
+ outline: 2px solid var(--ui-ring);
378
+ outline-offset: -2px;
379
+ }
380
+ }
381
+
382
+ /* Two answers, side by side and as wide as each other. */
383
+ [data-slot='radio-group'][data-kind='cards'][data-shape='pair'] {
384
+ grid-template-columns: repeat(2, minmax(0, 8rem));
385
+
386
+ & [data-slot='choice'] {
387
+ align-items: center;
388
+ padding-block: var(--m-space-3);
389
+ font-weight: var(--m-weight-strong);
390
+ }
391
+ }
392
+
393
+ /* Several of a few: cards that fill when ticked, the tick at the card's corner. */
394
+ [data-slot='check-cards'] {
395
+ display: grid;
396
+ /* As many across as fit at a width a card's words can be read at, unless the caller counts them. */
397
+ grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
398
+ gap: var(--m-space-3);
399
+
400
+ & [data-slot='choice'] {
401
+ display: grid;
402
+ grid-template-columns: auto minmax(0, 1fr);
403
+ gap: var(--m-space-1) var(--m-space-3h);
404
+ align-items: start;
405
+ padding: var(--m-space-3) var(--m-space-4);
406
+ border: 1px solid var(--m-line-control);
407
+ border-radius: var(--m-radius);
408
+ background: var(--m-surface);
409
+ cursor: pointer;
410
+ transition:
411
+ background-color var(--m-fast),
412
+ border-color var(--m-fast),
413
+ opacity var(--m-fast);
414
+
415
+ &:hover {
416
+ background: var(--m-raised);
417
+ }
418
+
419
+ &:has([data-slot='checkbox'][data-checked]) {
420
+ border-color: var(--m-accent);
421
+ background: var(--m-accent-soft);
422
+ box-shadow: inset 0 0 0 1px var(--m-accent);
423
+ }
424
+
425
+ &[data-off] {
426
+ opacity: 0.5;
427
+ cursor: not-allowed;
428
+ }
429
+ }
430
+
431
+ & [data-slot='checkbox'] {
432
+ grid-row: span 2;
433
+ margin-block-start: var(--m-space-1);
434
+ }
435
+
436
+ & [data-slot='choice-hint'] {
437
+ grid-column: 2;
438
+ color: var(--m-ink-muted);
439
+ font-size: var(--m-size-sm);
440
+ line-height: var(--m-lead-sm);
441
+ }
442
+ }
443
+
444
+ [data-slot='field-count'] {
445
+ color: var(--m-ink-subtle);
446
+ font-variant-numeric: tabular-nums;
447
+ }
448
+
449
+ @media (max-width: 30rem) {
450
+ /* Named twice, to stand over the rule that fits the cards to the room (kit-fields.css), which comes later. */
451
+ [data-slot='check-cards'][data-slot] {
452
+ grid-template-columns: minmax(0, 1fr);
453
+ }
454
+ }
455
+
456
+ /* An agreement's words run to a sentence or three: they wrap beside the tick, in the body's own weight. */
457
+ [data-slot='field'][data-kind='check'][data-shape='consent'] [data-slot='field-label'] {
458
+ font-weight: var(--m-weight-regular);
459
+ line-height: var(--m-leading);
460
+ }
461
+ }