viewkitjs 0.20.0 → 0.22.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/MIGRATION.md +2 -1
  3. package/README.md +1 -1
  4. package/fields/dist/conventions.d.ts +15 -3
  5. package/fields/dist/conventions.js +25 -0
  6. package/fields/dist/design/category-colors.d.ts +12 -5
  7. package/fields/dist/design/category-colors.js +7 -7
  8. package/fields/dist/query/buckets.js +42 -35
  9. package/fields/dist/query/date.js +2 -13
  10. package/fields/docs/guides/conventions.md +1 -1
  11. package/fields/docs/guides/options.md +2 -1
  12. package/fields/docs/reference/design-category-colors.md +2 -2
  13. package/fields/docs/reference/design-status-slots.md +1 -1
  14. package/fields/docs/reference/fields.md +1 -1
  15. package/package.json +19 -1
  16. package/views/README.md +2 -1
  17. package/views/dist/atoms/StatusBadge.js +1 -1
  18. package/views/dist/atoms/tones.js +7 -7
  19. package/views/dist/atoms/types.d.ts +3 -2
  20. package/views/dist/contract.d.ts +295 -2
  21. package/views/dist/contract.js +129 -0
  22. package/views/dist/controls/button/button.d.ts +40 -0
  23. package/views/dist/controls/button/button.js +40 -0
  24. package/views/dist/controls/button/looks.d.ts +4 -0
  25. package/views/dist/controls/button/looks.js +20 -0
  26. package/views/dist/controls/button/map-button.d.ts +11 -0
  27. package/views/dist/controls/button/map-button.js +20 -0
  28. package/views/dist/controls/button/own-look.d.ts +59 -0
  29. package/views/dist/controls/button/own-look.js +33 -0
  30. package/views/dist/controls/button.css +530 -0
  31. package/views/dist/controls/controls.d.ts +5 -0
  32. package/views/dist/controls/controls.js +2 -0
  33. package/views/dist/controls/index.d.ts +11 -0
  34. package/views/dist/controls/index.js +6 -0
  35. package/views/dist/controls/smooth.css +101 -0
  36. package/views/dist/controls/spinner/looks.d.ts +4 -0
  37. package/views/dist/controls/spinner/looks.js +32 -0
  38. package/views/dist/controls/spinner/spinner.d.ts +23 -0
  39. package/views/dist/controls/spinner/spinner.js +16 -0
  40. package/views/dist/controls/spinner.css +147 -0
  41. package/views/dist/display/date.js +15 -2
  42. package/views/dist/display/fit-values.d.ts +3 -2
  43. package/views/dist/display/link.d.ts +1 -1
  44. package/views/dist/display/location.js +2 -1
  45. package/views/dist/display/multi-value.js +1 -1
  46. package/views/dist/display/name.js +3 -1
  47. package/views/dist/display/select.js +1 -1
  48. package/views/dist/display/value-list.d.ts +1 -1
  49. package/views/dist/grid/chrome/GridStructure.js +2 -1
  50. package/views/dist/grid/looks.d.ts +45 -0
  51. package/views/dist/grid/looks.js +74 -0
  52. package/views/dist/looks/index.d.ts +9 -0
  53. package/views/dist/looks/index.js +5 -0
  54. package/views/dist/looks/looks.d.ts +47 -0
  55. package/views/dist/looks/looks.js +25 -0
  56. package/views/dist/looks/pieces.d.ts +3 -0
  57. package/views/dist/looks/pieces.js +4 -0
  58. package/views/dist/panels/react/views-row/FoldingViewRow.js +8 -8
  59. package/views/dist/provider/ViewsProvider.d.ts +3 -3
  60. package/views/dist/provider/ViewsProvider.js +1 -1
  61. package/views/dist/provider/context.d.ts +1 -1
  62. package/views/dist/styles.css +1000 -119
  63. package/views/dist/styles.unlayered.css +1017 -119
  64. package/views/docs/contract.md +172 -7
  65. package/views/docs/guides/display.md +11 -7
  66. package/views/docs/guides/looks.md +29 -0
  67. package/views/docs/guides/the-provider.md +2 -2
  68. package/views/docs/index.md +3 -0
  69. package/views/docs/install.md +7 -5
  70. package/views/docs/reference/controls.md +36 -0
  71. package/views/docs/reference/display.md +2 -2
  72. package/views/docs/reference/looks.md +41 -0
  73. package/views/docs/reference/react.md +2 -2
  74. package/views/docs/reference/views.md +5 -2
  75. package/views/skills/views/SKILL.md +2 -2
@@ -66,7 +66,7 @@ use; the prefix keeps that selector from reaching an element of the app's own.
66
66
  | `data-slot="vk-grid-group-header"` | a group's name and figures |
67
67
  | `data-slot="vk-grid-group-count"` | a group's count, in its head |
68
68
  | `data-slot="vk-grid-group-figure"` | one of a group's figures, in its head |
69
- | `data-slot="vk-grid-group-dot"` | the · before a group's count or figure |
69
+ | `data-slot="vk-grid-group-dot"` | the · before a group's figure |
70
70
  | `data-slot="vk-grid-footer"` | the footer row |
71
71
  | `data-slot="vk-grid-footer-cell"` | one column's figure |
72
72
  | `data-slot="vk-grid-figure-label"` | a footer figure's kind ("Sum"), drawn before its value; none on a figure the app draws |
@@ -97,8 +97,8 @@ colours the name at rest also writes its own `:hover` rule, or the name keeps th
97
97
  Only the grid's titles carry the part; a title drawn on another surface names none.
98
98
 
99
99
  Each of a group head's three parts carries `data-part="<part>"`, an identifier like `data-group-key="<key>"` rather than a state: the summary part it shows or stands before (`count`,
100
- `total`, `total:<columnId>`), so an app hides one dot by it: a count in a chip with no dot is
101
- `[data-slot="vk-grid-group-dot"][data-part="count"] { display: none; }` and a rule on `vk-grid-group-count`.
100
+ `total`, `total:<columnId>`), so an app hides one dot by it. The count is a chip ViewKit draws itself, at the
101
+ row's text size, with no dot before it; each figure follows its dot.
102
102
 
103
103
  Board's slots (`vk-board`, `vk-board-lane`, `vk-board-lane-header`, `vk-board-card`,
104
104
  `vk-board-add-card`) join this table when the board arrives.
@@ -250,7 +250,27 @@ declares both wherever a ground declares its own, so a part takes the states of
250
250
  The default atoms and the display also read `--vk-success`, `--vk-warning`, `--vk-info`,
251
251
  `--vk-label-blue`, `--vk-label-green`, `--vk-label-amber`, `--vk-label-red`, `--vk-label-purple`,
252
252
  `--vk-label-pink` and `--vk-label-teal` when the app declares them, each with a built-in fallback. The
253
- selection bar reads `--vk-float-shadow`, a whole `box-shadow` value for what floats over a list, with a
253
+ default Tag draws each hue as a pill, as does fields' chip map (`CATEGORY_COLOR_CLASSES`), and the stylesheet draws fields' soft fills and the words on a filled
254
+ status, through the optional colours below (`<hue>` is each of the seven: blue, green, amber, red, purple,
255
+ pink, teal). Each is optional: the stylesheet declares the Outright look's, and with `@source` the pill's
256
+ rungs fall back to the hue itself, so an app that declares only `--vk-label-<hue>` keeps its hue, and
257
+ fields' names draw on the app's own theme.
258
+
259
+ | optional colour | what it paints |
260
+ | -------------------------- | ------------------------------------------------------------------------------ |
261
+ | `--vk-success-subtlest` | a success wash: a status's soft fill (`bg-success-soft`) |
262
+ | `--vk-warning-subtlest` | a warning wash (`bg-warning-soft`) |
263
+ | `--vk-info-subtlest` | an information wash (`bg-info-soft`) |
264
+ | `--vk-fg-inverse` | words on a filled success, information or error |
265
+ | `--vk-fg-warning-inverse` | words on a filled warning |
266
+ | `--vk-label-<hue>-soft` | the hue's pale ground, for a class of the app's own (`bg-label-<hue>-soft`) |
267
+ | `--vk-label-<hue>-fill` | the pill's fill; undeclared, the hue 15% into `--vk-ground` |
268
+ | `--vk-label-<hue>-edge` | the pill's edge, drawn inside; undeclared, the hue 40% into `--vk-ground` |
269
+ | `--vk-label-<hue>-strong` | the pill's words; undeclared, the hue 60% into `--vk-fg` |
270
+
271
+ By name: `--vk-label-blue-soft`, `--vk-label-green-soft`, `--vk-label-amber-soft`, `--vk-label-red-soft`, `--vk-label-purple-soft`, `--vk-label-pink-soft`, `--vk-label-teal-soft`; `--vk-label-blue-fill`, `--vk-label-green-fill`, `--vk-label-amber-fill`, `--vk-label-red-fill`, `--vk-label-purple-fill`, `--vk-label-pink-fill`, `--vk-label-teal-fill`; `--vk-label-blue-edge`, `--vk-label-green-edge`, `--vk-label-amber-edge`, `--vk-label-red-edge`, `--vk-label-purple-edge`, `--vk-label-pink-edge`, `--vk-label-teal-edge`; `--vk-label-blue-strong`, `--vk-label-green-strong`, `--vk-label-amber-strong`, `--vk-label-red-strong`, `--vk-label-purple-strong`, `--vk-label-pink-strong`, `--vk-label-teal-strong`.
272
+
273
+ The selection bar reads `--vk-float-shadow`, a whole `box-shadow` value for what floats over a list, with a
254
274
  built-in fallback. The grid's chrome (its header and footer cells, a group's name and its own buttons) draws keyboard focus as
255
275
  `--vk-focus-ring`, a whole `box-shadow` value;
256
276
  undeclared, `inset 0 0 0 2px var(--vk-brand)`. The views row (`/panels/react`) reads `--vk-selected`, the ground's selected state (the
@@ -340,9 +360,142 @@ reads, and through which `GridTable`'s `fillWidth` has the columns share the gri
340
360
  while rows are selected), and
341
361
  while the lab's lock is on `--vk-hold-x` and `--vk-sx` (the offsets that hold the frozen columns, the rail, a group's name and the empty message at the left while the table is scrolled
342
362
  sideways) for itself. The stylesheet declares `--vk-t-<name>`, its own theme values that differ in the
343
- dark (a shadow) and the kit colours no `--vk-*` name stands for. They carry the prefix because they share the global namespace;
363
+ dark (a shadow). They carry the prefix because they share the global namespace;
344
364
  an app neither sets nor reads them, and they may change in any release.
345
365
 
366
+ ### The controls' tokens
367
+
368
+ ViewKit's default controls (`viewkitjs/views/controls`) read only these names, each optional: the ready stylesheet
369
+ declares every one at My preset's value, and an app declares one to change it. Each stands for one Outright token, which an
370
+ app on the Outright tokens declares it as. Sixteen are the contract's colours already. **How a new one is named**, so every
371
+ control that moves names the same way:
372
+
373
+ 1. A token already public keeps its name.
374
+ 2. A colour joins its family (`fg-`, the grounds, the fills, `border-`) in the family's words.
375
+ 3. A scale's name starts with the scale, a role's ends with it: `--vk-radius-md`, `--vk-shadow-key`, `--vk-font-size-sm`,
376
+ against `--vk-outline-radius`, `--vk-frozen-shadow-width`.
377
+ 4. Anything else is the prefix and the Outright token's own name.
378
+ 5. A scale step never falls back to a role's single name: each duration step is declared, and the grid's one `--vk-duration`
379
+ stays the grid's.
380
+ 6. No name repeats one the contract already gives a geometry, a layout or the grid's own machinery.
381
+
382
+ `--vk-fg-accent` is the brand's colour on words that aren't links; `--vk-fg-brand` stays the link's. The controls' own
383
+ machinery (the variables named for the button, the smooth corner, the spinner, the loading bar and the pressing room) is
384
+ private, set and read by a control alone.
385
+
386
+ | name | kind | the Outright token | default |
387
+ | ---- | ---- | ------------------ | ------- |
388
+ | `--vk-brand` | colour | `background-brand-bold` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
389
+ | `--vk-neutral` | colour | `background-neutral` | `hsl(0 0% 94%)` · dark `hsl(225 7% 11%)` |
390
+ | `--vk-neutral-hovered` | colour | `background-neutral-hovered` | `hsl(220 7% 90%)` · dark `hsl(225 7% 15%)` |
391
+ | `--vk-border` | colour | `border` | `hsl(220 7% 90%)` · dark `hsl(225 7% 15%)` |
392
+ | `--vk-border-bold` | colour | `border-bold` | `hsl(210 1% 82%)` · dark `hsl(210 2% 26.5%)` |
393
+ | `--vk-border-brand` | colour | `border-focused` | `hsl(219 90% 65.5%)` · dark `hsl(219 66% 47%)` |
394
+ | `--vk-border-subtle` | colour | `border-subtle` | `hsl(0 0% 94%)` · dark `hsl(225 7% 11%)` |
395
+ | `--vk-fg-brand` | colour | `link` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
396
+ | `--vk-ground` | colour | `surface` | `hsl(0 0% 100%)` · dark `hsl(210 6% 7%)` |
397
+ | `--vk-hovered` | colour | `surface-hovered` | `hsl(0 0% 96.5%)` · dark `hsl(210 4% 9.5%)` |
398
+ | `--vk-pressed` | colour | `surface-pressed` | `hsl(0 0% 94.5%)` · dark `hsl(225 7% 11%)` |
399
+ | `--vk-fg` | colour | `text` | `hsl(210 6% 7%)` · dark `hsl(210 8% 95%)` |
400
+ | `--vk-fg-on-brand` | colour | `text-brand-inverse` | `hsl(0 0% 100%)` · dark `hsl(210 8% 5%)` |
401
+ | `--vk-fg-inverse` | colour | `text-inverse` | `hsl(0 0% 100%)` · dark `hsl(210 8% 95%)` |
402
+ | `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
403
+ | `--vk-fg-subtlest` | colour | `text-subtlest` | `hsl(210 1% 53.5%)` · dark `hsl(210 3% 53%)` |
404
+ | `--vk-brand-hovered` | colour | `background-brand-bold-hovered` | `hsl(219 70% 46.5%)` · dark `hsl(219 95% 64%)` |
405
+ | `--vk-brand-pressed` | colour | `background-brand-bold-pressed` | `hsl(219 70% 38%)` · dark `hsl(219 100% 72.5%)` |
406
+ | `--vk-brand-subtler` | colour | `background-brand-subtler` | `hsl(218 100% 94%)` · dark `hsl(218 32% 14.5%)` |
407
+ | `--vk-brand-subtler-hovered` | colour | `background-brand-subtler-hovered` | `hsl(218 100% 89%)` · dark `hsl(219 46% 21%)` |
408
+ | `--vk-brand-subtler-pressed` | colour | `background-brand-subtler-pressed` | `hsl(218 97% 82%)` · dark `hsl(219 55% 29%)` |
409
+ | `--vk-danger-bold` | colour | `background-danger-bold` | `hsl(0 81% 58%)` |
410
+ | `--vk-danger-bold-hovered` | colour | `background-danger-bold-hovered` | `hsl(0 59% 49%)` · dark `hsl(3 90% 66.5%)` |
411
+ | `--vk-danger-bold-pressed` | colour | `background-danger-bold-pressed` | `hsl(0 59% 39%)` · dark `hsl(4 100% 75%)` |
412
+ | `--vk-info-bold` | colour | `background-information-bold` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
413
+ | `--vk-info-bold-hovered` | colour | `background-information-bold-hovered` | `hsl(219 70% 46.5%)` · dark `hsl(219 95% 64%)` |
414
+ | `--vk-info-bold-pressed` | colour | `background-information-bold-pressed` | `hsl(219 70% 38%)` · dark `hsl(219 100% 72.5%)` |
415
+ | `--vk-success-bold` | colour | `background-success-bold` | `hsl(158 98% 26%)` · dark `hsl(158 98% 34%)` |
416
+ | `--vk-success-bold-hovered` | colour | `background-success-bold-hovered` | `hsl(157 88% 24%)` · dark `hsl(150 45% 51.5%)` |
417
+ | `--vk-success-bold-pressed` | colour | `background-success-bold-pressed` | `hsl(156 87% 21%)` · dark `hsl(148 46% 62.5%)` |
418
+ | `--vk-warning-bold` | colour | `background-warning-bold` | `hsl(25 92% 41%)` |
419
+ | `--vk-warning-bold-hovered` | colour | `background-warning-bold-hovered` | `hsl(24 86% 35.5%)` · dark `hsl(21 66% 55%)` |
420
+ | `--vk-warning-bold-pressed` | colour | `background-warning-bold-pressed` | `hsl(23 85% 29%)` · dark `hsl(20 73% 65.5%)` |
421
+ | `--vk-brighten` | colour | `background-brighten` | `hsl(0 0% 100% / 0.09)` · dark `hsl(210 8% 95% / 0.09)` |
422
+ | `--vk-darken` | colour | `background-darken` | `hsl(214 30% 10% / 0.1)` · dark `hsl(0 0% 0% / 0.15)` |
423
+ | `--vk-border-input` | colour | `border-input` | `hsl(220 3% 86%)` · dark `hsl(220 4% 22%)` |
424
+ | `--vk-border-input-hovered` | colour | `border-input-hovered` | `hsl(210 1% 82%)` · dark `hsl(210 2% 26.5%)` |
425
+ | `--vk-raised` | colour | `surface-raised` | `hsl(0 0% 100%)` · dark `hsl(226 10% 10%)` |
426
+ | `--vk-raised-hovered` | colour | `surface-raised-hovered` | `hsl(220 3% 97%)` · dark `hsl(225 7% 15%)` |
427
+ | `--vk-overlay-hovered` | colour | `surface-overlay-hovered` | `hsl(220 3% 97%)` · dark `hsl(225 7% 15%)` |
428
+ | `--vk-overlay-pressed` | colour | `surface-overlay-pressed` | `hsl(0 0% 94%)` · dark `hsl(225 7% 15%)` |
429
+ | `--vk-overlay-card-pressed` | colour | `surface-overlay-card-pressed` | `hsl(220 7% 90%)` · dark `hsl(220 4% 22%)` |
430
+ | `--vk-fg-disabled` | colour | `text-disabled` | `hsl(210 1% 72%)` · dark `hsl(210 1% 37%)` |
431
+ | `--vk-fg-accent` | colour | `text-brand` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
432
+ | `--vk-border-width` | size | `border-width` | `1px` |
433
+ | `--vk-corner-smoothing` | size | `corner-smoothing` | `0.7` |
434
+ | `--vk-dot-size` | size | `dot-size` | `6px` |
435
+ | `--vk-duration-instant` | motion | `duration-instant` | `60ms` |
436
+ | `--vk-duration-fast` | motion | `duration-fast` | `150ms` |
437
+ | `--vk-duration-base` | motion | `duration-base` | `200ms` |
438
+ | `--vk-duration-slow` | motion | `duration-slow` | `300ms` |
439
+ | `--vk-ease-out` | motion | `ease-out` | `cubic-bezier(0, 0, 0.2, 1)` |
440
+ | `--vk-ease-in-out` | motion | `ease-in-out` | `cubic-bezier(0.4, 0, 0.2, 1)` |
441
+ | `--vk-ease-spring` | motion | `ease-spring` | `cubic-bezier(0.34, 1.56, 0.64, 1)` |
442
+ | `--vk-focus-width` | size | `focus-width` | `2px` |
443
+ | `--vk-focus-offset` | size | `focus-offset` | `2px` |
444
+ | `--vk-font-weight-medium` | size | `font-weight-medium` | `500` |
445
+ | `--vk-font-weight-semibold` | size | `font-weight-semibold` | `600` |
446
+ | `--vk-hover-lift` | motion | `hover-lift` | `1px` |
447
+ | `--vk-loading-dim` | motion | `loading-dim` | `0.55` |
448
+ | `--vk-press-scale` | motion | `press-scale` | `0.98` |
449
+ | `--vk-press-squash` | motion | `press-squash` | `1.025 0.92` |
450
+ | `--vk-press-travel` | motion | `press-travel` | `1px` |
451
+ | `--vk-press-travel-lg` | motion | `press-travel-lg` | `2px` |
452
+ | `--vk-progress-slide` | motion | `progress-slide` | `1400ms` |
453
+ | `--vk-radius-xs` | size | `radius-xs` | `2.5px` |
454
+ | `--vk-radius-sm` | size | `radius-sm` | `5px` |
455
+ | `--vk-radius-md` | size | `radius-md` | `7.5px` |
456
+ | `--vk-radius-lg` | size | `radius-lg` | `10px` |
457
+ | `--vk-radius-xl` | size | `radius-xl` | `15px` |
458
+ | `--vk-radius-2xl` | size | `radius-2xl` | `20px` |
459
+ | `--vk-radius-full` | size | `radius-full` | `9999px` |
460
+ | `--vk-shadow-key` | shadow | `shadow-key` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.24), inset 0 -1px 0 0 hsl(214 30% 10% / 0.18), 0 1px 0 0 hsl(214 30% 10% / 0.32), 0 1px 2px 0 hsl(214 30% 10% / 0.12)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.24), inset 0 -1px 0 0 hsl(0 0% 0% / 0.27), 0 1px 0 0 hsl(0 0% 0% / 0.5), 0 1px 2px 0 hsl(0 0% 0% / 0.18)` |
461
+ | `--vk-shadow-key-pressed` | shadow | `shadow-key-pressed` | `inset 0 1px 1.5px 0 hsl(214 30% 10% / 0.12)` · dark `inset 0 1px 1.5px 0 hsl(0 0% 0% / 0.18)` |
462
+ | `--vk-shadow-key-pressed-bold` | shadow | `shadow-key-pressed-bold` | `inset 0 1px 1.5px 0 hsl(214 30% 10% / 0.28)` · dark `inset 0 1px 1.5px 0 hsl(0 0% 0% / 0.42)` |
463
+ | `--vk-shadow-key-shallow` | shadow | `shadow-key-shallow` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.24), inset 0 -1px 0 0 hsl(214 30% 10% / 0.064)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.24), inset 0 -1px 0 0 hsl(0 0% 0% / 0.096)` |
464
+ | `--vk-shadow-key-soft` | shadow | `shadow-key-soft` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.3), inset 0 -1px 0 0 hsl(214 30% 10% / 0.088)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.3), inset 0 -1px 0 0 hsl(0 0% 0% / 0.132)` |
465
+ | `--vk-shadow-key-subtle` | shadow | `shadow-key-subtle` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.07), 0 1px 0 0 hsl(214 30% 10% / 0.088), 0 1px 2px 0 hsl(214 30% 10% / 0.04)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.07), 0 1px 0 0 hsl(0 0% 0% / 0.132), 0 1px 2px 0 hsl(0 0% 0% / 0.06)` |
466
+ | `--vk-shadow-key-subtle-raised` | shadow | `shadow-key-subtle-raised` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.07), 0 1px 0 0 hsl(214 30% 10% / 0.128), 0 1px 2px 0 hsl(214 30% 10% / 0.04)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.07), 0 1px 0 0 hsl(0 0% 0% / 0.192), 0 1px 2px 0 hsl(0 0% 0% / 0.06)` |
467
+ | `--vk-shadow-lift` | shadow | `shadow-lift` | `0 1px 2px 0 hsl(214 30% 10% / 0.104), 0 2px 6px -1px hsl(214 30% 10% / 0.064)` · dark `0 1px 2px 0 hsl(0 0% 0% / 0.156), 0 2px 6px -1px hsl(0 0% 0% / 0.096)` |
468
+ | `--vk-shadow-lift-raised` | shadow | `shadow-lift-raised` | `0 2px 4px -1px hsl(214 30% 10% / 0.104), 0 9px 20px -6px hsl(214 30% 10% / 0.136), 0 6px 18px -6px hsl(0 0% 100% / 0.1)` · dark `0 2px 4px -1px hsl(0 0% 0% / 0.156), 0 9px 20px -6px hsl(0 0% 0% / 0.204), 0 6px 18px -6px hsl(210 8% 95% / 0.1)` |
469
+ | `--vk-shadow-rim` | shadow | `shadow-rim` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.07)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.07)` |
470
+ | `--vk-shadow-rim-bold` | shadow | `shadow-rim-bold` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.22)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.22)` |
471
+ | `--vk-shadow-rim-bold-raised` | shadow | `shadow-rim-bold-raised` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.3)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.3)` |
472
+ | `--vk-shadow-rim-raised` | shadow | `shadow-rim-raised` | `inset 0 1px 0 0 hsl(0 0% 100% / 0.14)` · dark `inset 0 1px 0 0 hsl(210 8% 95% / 0.14)` |
473
+ | `--vk-spacing` | size | `spacing` | `4px` |
474
+ | `--vk-spinner-breath` | motion | `spinner-breath` | `1400ms` |
475
+ | `--vk-spinner-turn` | motion | `spinner-turn` | `2000ms` |
476
+ | `--vk-spinner-turn-reduced` | motion | `spinner-turn-reduced` | `3000ms` |
477
+ | `--vk-font-size-xs` | size | `text-xs` | `12px` |
478
+ | `--vk-font-size-sm` | size | `text-sm` | `14px` |
479
+ | `--vk-font-size-base` | size | `text-base` | `16px` |
480
+ | `--vk-font-size-lg` | size | `text-lg` | `18px` |
481
+
482
+ ## Looks
483
+
484
+ A piece's looks are declared beside the piece and listed in `LOOKS` (`viewkitjs/views/looks`). An option is a closed set
485
+ of values with a default; a look is a named set of picks, one value for every option. Nothing picked wears each option's
486
+ default, My preset's pick, which no look need match whole. An app
487
+ wears a set of picks as data attributes on a frame round the piece, `data-<piece>-<option>="<value>"` (`lookAttrs`), which
488
+ the piece's look stylesheet reads, and the piece's code reads the same picks back (`lookWorn`, `lookWornOf`); a pick its
489
+ option doesn't have wears the default. **Public:** a piece's id, its options' ids, their values' ids and its looks' ids,
490
+ renamed only with a codemod, since apps save picks by them. Not public: the words (`name`), which a later version may
491
+ reword. Only options live in the shape: what a piece takes from an app's own design beyond its options stays outside it.
492
+
493
+ The Button (`BUTTON_LOOKS`: seven options, four looks) and the Spinner (`SPINNER_LOOKS`: six options, thirteen looks) declare
494
+ theirs beside them in the controls part; their look stylesheets are the controls' own. The grid (`GRID_LOOKS`): 25 options and two looks, `attio` and `portal`. Fourteen of its
495
+ options are read by the grid's code (`GRID_LOOK_READ`): eleven become the props it is handed (`gridLookProps`), and three
496
+ the app wires itself, `more` (pages under `GridTable`'s `pages`), `figures` (the footer's words, through the provider's
497
+ messages) and `wait` (`RowsWait` in the components map). The other eleven are its look stylesheet's, which ships later.
498
+
346
499
  ## The components map
347
500
 
348
501
  The primitives an app hands in through `ViewsProvider`, typed in `src/provider/components.ts`.
@@ -357,6 +510,11 @@ on a focus that bubbles up from within, and where yours checks `:focus-visible`,
357
510
  grid's editors and menus use, each in Base UI's shape, and an adapter on Radix and one on Base UI
358
511
  both fill every one.
359
512
 
513
+ **Defaults for an app that hands none:** `CONTROLS`, from `viewkitjs/views/controls`, holds ViewKit's default controls,
514
+ the Outright kit's, on Base UI: today the `Button`. An app spreads it first and its own after
515
+ (`components={{ ...CONTROLS, ...own }}`), so whatever it hands wins. That door alone needs `@base-ui/react`, an optional
516
+ peer; the provider and every other door import neither library, so an app that hands every control never installs it.
517
+
360
518
  `Button` · `Popover` · `Tooltip` · `Checkbox` · `Menu` · `Collapse` · `Sheet` · `AppIcon` · `Markdown`
361
519
 
362
520
  `Button`: `ViewsButtonProps`, its children, `onClick`, `disabled`, `variant`, `size`, `type`, a class, `aria-label` and `title`, and, for the grid's own buttons when the provider's `gridButtons` is `button`, a `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open`, each forwarded to your element. A command cell's ▾ and trigger, under `gridButtons` too, and the selection chip, when the provider's `selectionBar`'s `chip` is `button`, are handed only the props named first, the chip also `data-slot`. A field row's own buttons, when the provider's `fieldRowButtons` is `button`, are handed `type`, `variant`, `size`, `className`, `aria-label`, `disabled` and `onClick` (the ▾ and the verb trigger no `onClick`: the menu opens on them), Show more also `data-slot`, and the edit target also a ref and `aria-disabled` while its write is pending, each forwarded to your element. The panels' own buttons, when the provider's `panelButtons` is `button`, are handed `type`, `variant` (`ghost`, `outline` or `secondary`), `size`, `className` and their children, each with what it needs of `onClick`, `disabled`, `aria-label`, `title`, a ref, `aria-haspopup`, `aria-expanded`, `aria-pressed`, `role`, `aria-selected`, `aria-disabled` and `aria-describedby` (a button that can't be used, described by why), `data-slot`, `data-state="open"` or `data-state="closed"` and `data-vs-row="true"`, each forwarded to your element.
@@ -941,7 +1099,7 @@ A field whose changes are transitions with rules of their own (a lost deal needs
941
1099
 
942
1100
  ## The doors
943
1101
 
944
- Twenty-three doors in this version, and nothing else is importable but `./package.json`; the panels' two (`/panels` and `/panels/react`) are described last. What each holds is summarised here; each door's reference page names every export, one line each, starting at [`reference/views.md`](reference/views.md).
1102
+ Twenty-four doors in this version, and nothing else is importable but `./package.json`; the panels' two (`/panels` and `/panels/react`) are described last. What each holds is summarised here; each door's reference page names every export, one line each, starting at [`reference/views.md`](reference/views.md).
945
1103
 
946
1104
  `viewkitjs/views`, no React at runtime, holds two things. The rendering contract, every name listed:
947
1105
  the constants `VK_PREFIX`, `GRID_SLOTS`, `GRID_STATES`, `VK_TOKENS`, `VK_COLOURS`,
@@ -1014,7 +1172,7 @@ And `selectionBar`'s `chip` (`ViewsSelectionChip`, default `own`): who draws the
1014
1172
  on the desktop. `own` draws ViewKit's own, as on 0.5.0; `button` draws your `Button`, `variant` `outline`, `size` `sm`,
1015
1173
  its box in `className`, `data-slot="vk-selection-chip"`, `aria-label`, and `disabled` while a batch runs, inside the
1016
1174
  same `Tooltip`.
1017
- And an optional `severalValues` (`ViewsSeveralValues`, from `./react`, default `first`): how a cell of several values
1175
+ And an optional `severalValues` (`ViewsSeveralValues`, from `./react`, default `fit`): how a cell of several values
1018
1176
  draws on one line, wherever it draws (a grid cell, a board or calendar card, a field row that doesn't wrap). `first`
1019
1177
  draws its first value and a count at any width, as on 0.5.0. `fit` draws as many whole values as fit its width, then
1020
1178
  the count, and follows a column resize; the first shows cut when even it doesn't fit, and a wrapped row shows three
@@ -1129,6 +1287,13 @@ host's binding shares with the grid: `GridCommitContext` and `GridCommitOutcome`
1129
1287
  CSV export reuses), and `GRID_TITLE_LINK_CLASS`. The house menu rows, the group collapse and the type
1130
1288
  icons are the app's; the selection bar is `SelectionBar`, on the selection door, drawn with the app's verbs.
1131
1289
 
1290
+ `viewkitjs/views/looks`, no React at runtime: a piece's options and looks (see Looks above). The shape,
1291
+ `PieceLooks` with its `LookOption`s, `LookValue`s and `Look`s, `LookPicks` and `LookDevice`; its helpers, `lookAttrs` (the
1292
+ frame's `data-<piece>-<option>` attributes for a set of picks), `lookPicks` (a look's picks by its id), `lookWorn` and
1293
+ `lookWornOf` (the picks read back, from picks or from the closest frame); `LOOKS`, every piece that declares looks; and the
1294
+ grid's, `GRID_LOOKS` with `GridLookOptionId`, `GRID_LOOK_READ`, `GridLookWorn`, `gridLookWorn`, `gridLookWornOf`, and
1295
+ `gridLookProps` with `GridLookProps` (the `GridTable` props a look sets).
1296
+
1132
1297
  `viewkitjs/views/panels`, no client
1133
1298
  directive on the door, the one hook behind it (`useFilterOpened`) carrying
1134
1299
  its own: what a list's panels read and say. The settings they edit (`SortConfig`, `GroupConfig`, `ToggleConfig`,
@@ -30,10 +30,7 @@ assert.equal(renderFieldValue(DEAL_FIELDS.tags, []), null);
30
30
  // An unset boolean still draws: its empty box is the control.
31
31
  assert.notEqual(renderFieldValue(DEAL_FIELDS.archived, null), null);
32
32
 
33
- // A name reads as written: the full name, else the given and family names.
34
- assert.equal(renderFieldValue(DEAL_FIELDS.contact, { full: null, given: "Ada", family: "Lovelace" }), "Ada Lovelace");
35
- // An empty name draws the words you hand it, or nothing.
36
- assert.equal(renderFieldValue(DEAL_FIELDS.contact, null, { nameFallback: "ada@example.com" }), "ada@example.com");
33
+ // An empty name draws nothing, unless you hand it words to draw (below).
37
34
  assert.equal(renderFieldValue(DEAL_FIELDS.contact, { full: null, given: null, family: null }), null);
38
35
  ```
39
36
 
@@ -49,6 +46,13 @@ assert.ok(titleHtml.includes('title="Acme renewal"')); // a clipped value keeps
49
46
  const websiteHtml = renderToStaticMarkup(<>{renderFieldValue(DEAL_FIELDS.website, "https://acme.example")}</>);
50
47
  assert.ok(websiteHtml.includes('href="https://acme.example"'));
51
48
  assert.ok(websiteHtml.includes(">acme.example</a>"));
49
+
50
+ // A name reads as written: the full name, else the given and family names, in a box that ends in "…" when it
51
+ // doesn't fit. An empty name draws the words you hand it.
52
+ const nameHtml = renderToStaticMarkup(<>{renderFieldValue(DEAL_FIELDS.contact, { full: null, given: "Ada", family: "Lovelace" })}</>);
53
+ assert.ok(nameHtml.includes(">Ada Lovelace</span>"));
54
+ const fallbackHtml = renderToStaticMarkup(<>{renderFieldValue(DEAL_FIELDS.contact, null, { nameFallback: "ada@example.com" })}</>);
55
+ assert.ok(fallbackHtml.includes(">ada@example.com</span>"));
52
56
  ```
53
57
 
54
58
  ## One renderer per storage type
@@ -73,7 +77,7 @@ assert.equal(DISPLAY_CORES.date, DISPLAY_CORES.datetime);
73
77
  - **boolean**: four looks, the field's `format.style`. `checkbox` (the default) draws the `TickBox` atom, and `icon` your `booleanIcon(on)`; either becomes a real switch only when you hand `onToggle`, and is a plain glyph otherwise. `text` draws the option's label for the value, or the package's words. `marker` draws only when true, as the `StatusMarker` atom with your `marker` words, `markerReason` and `onResolve`.
74
78
  - **select**, **status** and **multiselect**: a select is a category and draws the `Tag` atom in its colour (a reader's `optionColors` first, then the option's declared colour, then one derived from the value). A status is a state and draws the `StatusBadge` atom in its option's slot. A multiselect draws a tag per value, through the several-values layout. A value no option names draws as the raw value, muted, with a hover saying it is not an option, unless you hand a `labelFallback`; an open (`custom-values`) vocabulary's values are their own labels. An option's `icon` is drawn through your `AppIcon`.
75
79
  - **relation** and **user**: a chip, the record's avatar when it has one, else your `entityIcon(kind)`, else the relation glyph, then its label, then, on a `many` relation that declares `links`, the link's roles, drawn by the `RelationRoles` atom ([atoms](atoms.md)). Where it goes is yours (`relationWrap`); without one the chip is inert. Several draw through the several-values layout, the lead link first. A user is drawn as a relation to a member, so the two never differ.
76
- - **url**, **domain**, **email** and **phone**: a url is a link with its scheme off the label, its platform's mark before it (the [`PlatformMark` atom](atoms.md)); a value that is no safe web address draws as text. A domain links to its site and reads no platform from it. An email is a `mailto:` link to the address alone: text stored after it (`?cc=…`, a second address) is never part of the link, and a value that holds no address draws as text. A phone is written in its international form, as its country writes it for a viewer in that country (the conventions' `region`) and internationally for anyone else, its extension after it, and dialled through a `tel:` link; a phone stored as typed draws as its text and is marked `data-as-typed`, still a link to its digits, and as text alone when it holds no digit to dial. Every phone's value is the part `data-slot="vk-phone"`, its link or its text. Several values of one of these draw as the main one and a count.
80
+ - **url**, **domain**, **email** and **phone**: a url is a link with its scheme off the label, its platform's mark before it (the [`PlatformMark` atom](atoms.md)); a value that is no safe web address draws as text. A domain links to its site and reads no platform from it. An email is a `mailto:` link to the address alone: text stored after it (`?cc=…`, a second address) is never part of the link, and a value that holds no address draws as text. A phone is written in its international form, as its country writes it for a viewer in that country (the conventions' `region`) and internationally for anyone else, its extension after it, and dialled through a `tel:` link; a phone stored as typed draws as its text and is marked `data-as-typed`, still a link to its digits, and as text alone when it holds no digit to dial. Every phone's value is the part `data-slot="vk-phone"`, its link or its text. Several values of one of these draw the main one first, as many as fit, then a count.
77
81
  - **location**: in a cell, its city and its country; with `wrap: "full"`, the whole place. The country is named in the viewer's language.
78
82
  - **name**: the full name as written, else the given and family names, else `nameFallback`, else nothing.
79
83
  - **actor**: a chip like a relation's that opens nothing, since an actor records who did something rather than pointing at a record: a member's avatar when your value carries an `avatarUrl` beside it, and your glyph for an automation, an API key or the system.
@@ -81,8 +85,8 @@ assert.equal(DISPLAY_CORES.date, DISPLAY_CORES.datetime);
81
85
  - **range**: its two ends as text ("11–50", "10,001+", "up to 50"), then its unit (`%`, its currency code or its suffix) and its period ("/mo").
82
86
  - **lookup** and **formula**: as the field their result is. A **rollup** grouped by an option draws a segmented bar beside its headline, and one grouped by time a sparkline, the current bucket faded.
83
87
 
84
- A value that holds several, of any of these types, uses `MultiValueCell`: one value, or three when wrapped, then a `+N` count that opens all of them in a list. It is exported for your own cells; [the display reference](../reference/display.md) has its props.
85
- With the provider's `severalValues: "fit"`, a value on one line shows as many whole values as fit its width, then the count ([the provider](the-provider.md)). The count is the `CellMore` atom ([atoms](atoms.md)).
88
+ A value that holds several, of any of these types, uses `MultiValueCell`: as many as fit on one line, or three when wrapped, then a `+N` count that opens all of them in a list. It is exported for your own cells; [the display reference](../reference/display.md) has its props.
89
+ With the provider's `severalValues: "first"`, a value on one line shows its first value and the count at any width instead ([the provider](the-provider.md)). The count is the `CellMore` atom ([atoms](atoms.md)).
86
90
 
87
91
  ## What the field can't know
88
92
 
@@ -0,0 +1,29 @@
1
+ # Looks
2
+
3
+ A piece's look is what an app sets once for every copy of the piece it draws: the grid's column lines, its density, how a grouped grid draws its titles. ViewKit declares each piece's options and looks beside the piece, in `viewkitjs/views/looks`, and an app picks one by its name, or picks option by option, and saves the picks it made. Reference: [`viewkitjs/views/looks`](../reference/looks.md).
4
+
5
+ ## Options and looks
6
+
7
+ An option is a closed set of values with a default: the grid's `columns` is `all`, `none` or `pinned`. A look is a named set of picks, one value for every option: the grid's `attio` look, its first, is every option's default; its `portal` look is ViewKit's own grid as the portal draws it. The ids are public and stay as they are, since an app saves picks by them; the words beside them (`name`) may change.
8
+
9
+ ## Picking the grid's look
10
+
11
+ The picks go on the element round the grid as data attributes, which the grid's look stylesheet reads, and the options the grid's code reads go to `GridTable` as props:
12
+
13
+ ```ts
14
+ import { GRID_LOOKS, gridLookProps, gridLookWorn, lookAttrs, lookPicks } from "viewkitjs/views/looks";
15
+
16
+ // The portal's look, with the columns sharing the grid's whole width.
17
+ const picks = { ...lookPicks(GRID_LOOKS, "portal"), width: "fill" };
18
+ const frame = lookAttrs(GRID_LOOKS, picks); // spread on the element round the grid
19
+ const props = gridLookProps(gridLookWorn(picks), false); // spread on GridTable, false on a computer
20
+ console.log(frame["data-grid-columns"], props.verticalBorders, props.fillWidth); // all true true
21
+ ```
22
+
23
+ A pick its option doesn't have (one saved by an older version, say) wears the option's default, so saved picks never break a grid. Where the picks live on the page rather than in your state, `gridLookWornOf(element)` reads them back from the closest frame.
24
+
25
+ Fourteen of the grid's options are read by its code. Eleven become its props through `gridLookProps`; three you wire yourself, as the Showcase does: `more` (`"pages"`: hand `GridTable` its `pages`), `figures` (`"value"`: the footer's figure words through your provider's messages) and `wait` (`"kept"`: hand the components map a `RowsWait`). The other eleven (the header's words, the rows' lines, the pinned edge, picked rows and cells, the cells' frames, names and phones) are its look stylesheet's alone, and draw nothing until that stylesheet ships.
26
+
27
+ ## A piece of your own
28
+
29
+ A piece that comes into ViewKit declares its options and looks in its own folder, in the same shape (`PieceLooks`), and adds itself to `LOOKS`. Only options live in the shape: what a piece takes from an app's own design beyond its options (its own colours, its own sizes) stays outside it.
@@ -26,7 +26,7 @@ Every view reads what it takes from its app, other than its own props, from one
26
26
 
27
27
  `gridButtons` says who draws the buttons the grid draws itself: a group's fold and ⋯, "+ Add column", a row's ⋯, the name's actions (the pencil and your `rowActions`), an action column's buttons, a pick-list cell's ▾, and a command cell's ▾ and its trigger. `own`, the default, draws ViewKit's own, as on 0.5.0. `button` draws your `Button`, so they take your pointer, hover, press and focus ring: the grid hands its box (size, place, the reveal on hover) in `className`, `variant` `ghost` or `outline`, `size` `icon` or `sm`. Before you set it, make your `Button` forward `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open` to its element and let the `className` it is handed win over its own size: a `Button` that drops the ref leaves the ⋯'s and "+ Add column"'s menus with nothing to anchor on, and one that drops `tabIndex` makes every grid button a Tab stop. The example adapters on this page forward none of them; they suit the default.
28
28
 
29
- `severalValues` says how a cell of several values (a multiselect's options, several emails or records, a lookup's names) draws on one line. `first`, the default, draws its first value and a "+N" count at any width, as on 0.5.0. `fit` draws as many whole values as fit the cell's width, then the count, and follows a column resize; when even the first doesn't fit whole, it shows cut. A wrapped row shows three either way. Each cell measures its values once when it mounts or they change, and a resize is arithmetic over what it kept, so fitting costs no row a redraw.
29
+ `severalValues` says how a cell of several values (a multiselect's options, several emails or records, a lookup's names) draws on one line. `fit`, the default, draws as many whole values as fit the cell's width, then the count, and follows a column resize; when even the first doesn't fit whole, it shows cut. `first` draws its first value and a "+N" count at any width, as on 0.5.0. A wrapped row shows three either way. Each cell measures its values once when it mounts or they change, and a resize is arithmetic over what it kept, so fitting costs no row a redraw.
30
30
 
31
31
  `gridCheckboxes` says who draws a yes/no cell's box in the grid. `own`, the default, draws ViewKit's tick box in its own switch button, as on 0.5.0. `checkbox` draws your `Checkbox`, the box your rail draws, so a row's two boxes are one: it is handed `checked`, the column's name, `tabIndex` -1 and `onCheckedChange`, and a press writes the value once. A cell the grid can't write is handed `readOnly` and a press that writes nothing. Before you set it, make your `Checkbox` forward `readOnly`: one that drops it shows a read-only cell that looks pressable and does nothing when pressed.
32
32
 
@@ -87,7 +87,7 @@ The shapes are Base UI's, and the types promise three things:
87
87
  - **An `anchor`, not a trigger child.** The popover and the menu open at an element, a ref to one, or a point (a right-click). Nothing is wrapped.
88
88
  - **No `asChild`.** The tooltip is the one slot that wraps, and it takes the element it wraps as `children`.
89
89
 
90
- So an app on Base UI wraps its own copies thinly, and an app on Radix maps the difference in its adapter. The package ships none of these primitives and depends on neither library.
90
+ So an app on Base UI wraps its own copies thinly, and an app on Radix maps the difference in its adapter. The package's own defaults are `CONTROLS`, from `viewkitjs/views/controls`, on Base UI, an optional peer: spread it first and your own controls after. Every other door depends on neither library.
91
91
 
92
92
  ### An adapter over Radix
93
93
 
@@ -28,6 +28,7 @@ Drawing and editing values:
28
28
  The grid:
29
29
 
30
30
  - [The grid](guides/the-grid.md): grouping, sorting, writes, preferences, figures and the editing rules
31
+ - [Looks](guides/looks.md): a piece's options and looks, and picking the grid's by name
31
32
 
32
33
  Reference material:
33
34
 
@@ -50,5 +51,7 @@ One page per door. Each lists every name the door exports.
50
51
  - [`viewkitjs/views/cells`](reference/cells.md): a column's typed cell
51
52
  - [`viewkitjs/views/selection`](reference/selection.md): a list's selection
52
53
  - [`viewkitjs/views/grid`](reference/grid.md): the grid, its props and the helpers a host shares with it
54
+ - [`viewkitjs/views/looks`](reference/looks.md): a piece's options and looks, and the helpers that wear one ([guide](guides/looks.md))
55
+ - [`viewkitjs/views/controls`](reference/controls.md): ViewKit's default controls on Base UI, the Button and the Spinner, and `CONTROLS` for the components map
53
56
  - [`viewkitjs/views/panels`](reference/panels.md): what a list's panels read and say, built from its settings, and the toolbar's arrangement, with no React
54
57
  - [`viewkitjs/views/panels/react`](reference/panels-react.md): the panels as they draw, the toolbar's frame, its parts and the ready toolbar
@@ -10,6 +10,8 @@
10
10
  `@dnd-kit/utilities` are optional peers for the panels' parts that drag (the views row's pills, the sort's rules, the
11
11
  Columns list, the group order), which the door loads with `import()` as it loads: install them if your app renders one. The drawn
12
12
  panels' door (`viewkitjs/views/panels/react`) itself loads without them. ESM only, Node 20 or later.
13
+ `@base-ui/react` (1.6 or later) is an optional peer too: install it only to take ViewKit's default controls
14
+ (`CONTROLS`, from `viewkitjs/views/controls`) for the ones your components map leaves out.
13
15
 
14
16
  2. **Import the stylesheet.** One line gives the rendering its whole look, with no Tailwind needed:
15
17
 
@@ -49,10 +51,7 @@
49
51
  already declares every one with the Outright look's value, light, and dark under `.dark` or `[data-theme="dark"]`;
50
52
  declare them yourself to wear your own theme. A declaration in no layer, or in any layer above
51
53
  `components`, wins over the stylesheet's. With `@source` instead of the stylesheet, nothing declares
52
- them for you, and this block is required. Under the stylesheet, three fills keep the Outright look for
53
- now, with no name of their own yet: a status's soft fill (success, warning, information), the text on a
54
- filled status, and a category chip's fill (the chip's text follows `--vk-label-<hue>`). On stock shadcn
55
- tokens:
54
+ them for you, and this block is required. On stock shadcn tokens:
56
55
 
57
56
  ```css
58
57
  :root {
@@ -81,7 +80,10 @@
81
80
 
82
81
  `.dark` needs nothing more: each line reads your own token, which your dark theme already sets.
83
82
  If your grounds each tune their hover, declare `--vk-hovered` and `--vk-pressed` beside each
84
- ground's own. The status and category hues (`--vk-success`, `--vk-label-blue`, …) are optional.
83
+ ground's own. The status and category hues (`--vk-success`, `--vk-label-blue`, …) are optional, and so
84
+ are the status washes, the words on a filled status and each hue's soft fill and pill rungs
85
+ (`--vk-success-subtlest`, `--vk-fg-inverse`, `--vk-label-blue-soft`, `--vk-label-blue-strong`, …; the list
86
+ is in `docs/contract.md`, Tokens).
85
87
 
86
88
  If your pages pad their content at the sides, tell the grid how far, so its rows line up with the
87
89
  rest of the page: declare `--vk-gutter` beside the colours, onto your own padding. Without it the
@@ -0,0 +1,36 @@
1
+ # `viewkitjs/views/controls`
2
+
3
+ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the Outright kit's Button and Spinner, on Base UI. It is the one door that needs `@base-ui/react`, an optional peer (`^1.6.0`): an app that hands every control in its components map never imports it and never installs Base UI. Guide: [the components map](../contract.md#the-components-map).
4
+
5
+ ## The defaults
6
+
7
+ - `CONTROLS` — the components map's defaults, for each control an app leaves out: today `Button`. An app spreads it first and its own controls after, `components={{ ...CONTROLS, ...own }}`. Its `Button` draws ViewKit's buttons (`variant`, `size`) as the kit's Button's kinds and sizes, and stands a glyph handed before the words as the Button's icon.
8
+ - `leadingGlyph` — `leadingGlyph(children, glyphs)`: a glyph before a button's words (an svg, or one of the app's icons in `glyphs`) as `{ icon, label }`; a glyph alone, or another component, stays `{ label }`.
9
+
10
+ ## The Button
11
+
12
+ - `Button` — what a person presses to make something happen, on Base UI's button: `kind`, `size`, `shape`, `loading` (a spinner over the label, which keeps its width; a press does nothing), `icon` and `iconEnd`, and `look`, its own look. Drawn as a link (`render={<a href=… />}`, `nativeButton={false}`) it stays a link. An icon-only one needs an `aria-label`.
13
+ - `ButtonProps` — its props: Base UI's button's, with those above.
14
+ - `ButtonKind` — `primary`, `outline` (the default), `soft`, `quiet`, `danger`, `information`, `success`, `warning`, `link`, `text`.
15
+ - `ButtonSize` — `2xs`, `xs`, `sm`, `md` (the default), `lg`, `44`, and the measured sizes `20`, `22`, `26`, `20x24`, `32x44`, `40x44`, `line`.
16
+ - `ButtonShape` — `default`, `icon` (square), `round`.
17
+ - `buttonClass` — `buttonClass(kind?, size?, shape?)`: its class names, for an element drawn as a Button.
18
+ - `ButtonGroup` — Buttons joined in a row or a column, the corners between them square and the edges shared.
19
+ - `ButtonGroupText` — words inside a group: a unit, a count.
20
+ - `ButtonGroupSeparator` — a line between two Buttons of a group that have no edge of their own.
21
+ - `ButtonOwnLook` — a Button's own look, set on one Button: its radius, words, colour, icons, room, hover, open and pressed states and the rest, each an attribute on the Button beside `data-button-own`. It may change before 1.0.
22
+ - `buttonOwnOptions` — each own option, the attribute it sets and its values.
23
+ - `buttonOwnAttrs` — `buttonOwnAttrs(look)`: the attributes of an own look.
24
+
25
+ ## The Spinner
26
+
27
+ - `Spinner` — something on its way, in the colour of the words beside it, at `size` px, said to screen readers by `label` (empty when what it stands in for says it). Every kind is in its drawing; the frame's `data-spinner-*` picks one.
28
+ - `SpinnerProps` — its props.
29
+ - `LoadingBar` — a thin bar along the top of what is loading again, which stays where it is, dimmed and out of reach, until it is in.
30
+ - `LoadingBarProps` — its props.
31
+
32
+ ## The stylesheets
33
+
34
+ The ready stylesheet (`viewkitjs/views/styles.css`) carries the controls, every token they read declared at the Outright look's value ([the controls' tokens](../contract.md#the-controls-tokens)). An app on the Outright tokens imports them one by one instead, in this order, and declares each token as its own: `viewkitjs/views/controls/smooth.css` (the smooth corner every control's outline stands on), `viewkitjs/views/controls/button.css`, `viewkitjs/views/controls/spinner.css`. Their options and looks are on [`viewkitjs/views/looks`](looks.md).
35
+
36
+ The class names (`o-button`, `o-spinner` and the rest) and the selectors other pieces use to style a Button they hold stay as the Outright kit named them until those pieces move into ViewKit; they are not public.
@@ -17,8 +17,8 @@ Guide: [display](../guides/display.md).
17
17
  - A relation's: `entityIcon` (your glyph for an entity kind) and `relationWrap` (where a chip goes; absent, the chip is inert).
18
18
  - The host's slot: `slotOwnsClick`, set by a host whose own element is the button, such as a calendar card. Every core then draws bare content: an overflow count as plain text, a boolean with no toggle. `hostOwnsPlainClick`, set by a host whose plain click on a value is its own, such as the grid: an email, phone, url or domain stays a link, marked `data-cell-link`, not draggable, and lets its click through for the host to decide.
19
19
  - `RelationWrap` — the type of `relationWrap`: `(relation, chip) => ReactNode`. The core draws the chip (its picture or glyph, through your `Avatar` atom, and its label); your function wraps it in your own link or button, since where a record opens is your app's.
20
- - `MultiValueCell` — the layout for a value that holds several: several emails, phones, links or domains, a multiselect, the far side of a relation. It takes `items` (one drawn node per value), and optionally `details` (a word beside each value in the list, never in the cell), `wrap`, `title` (the native hover text) and `slotOwnsClick`. It shows one value, or three when wrapped, then a `+N` count that opens every value in a read-only list in the components map's `Popover`, drawn with the `List` and `Row` atoms. With `slotOwnsClick` the count is plain text and nothing opens. No items draws nothing.
21
- With the provider's `severalValues: "fit"`, on one line it shows as many whole values as fit its width instead (at most 20 are measured), then the count, following its width; the first shows cut when even it doesn't fit. The count is drawn by the `CellMore` atom inside `data-slot="vk-cell-more"`, with `data-open` while the list is open.
20
+ - `MultiValueCell` — the layout for a value that holds several: several emails, phones, links or domains, a multiselect, the far side of a relation. It takes `items` (one drawn node per value), and optionally `details` (a word beside each value in the list, never in the cell), `wrap`, `title` (the native hover text) and `slotOwnsClick`. On one line it shows as many whole values as fit its width (at most 20 are measured), or three when wrapped, then a `+N` count that opens every value in a read-only list in the components map's `Popover`, drawn with the `List` and `Row` atoms. With `slotOwnsClick` the count is plain text and nothing opens. No items draws nothing.
21
+ It follows its width, and the first shows cut when even it doesn't fit. With the provider's `severalValues: "first"`, on one line it shows its first value and the count instead, at any width. The count is drawn by the `CellMore` atom inside `data-slot="vk-cell-more"`, with `data-open` while the list is open.
22
22
  - `ConvertedFigure` — a money figure shown in another currency than its record's own, marked: ≈ before its `children`, and a title naming the currency it came `from` ("Converted from USD", the `views.display.converted-from` message). `renderTypedCellValue` draws it around a converted cell, and a field row around a figure its host reads in another currency; an app draws it on a surface of its own.
23
23
  - `ConversionLine` — the line under a money editor opened from a converted figure: the marked `figure`, then "as shown" (`views.display.as-shown`), so the record's own amount being edited and the figure the person clicked read as one value. An optional `className` spaces it.
24
24
 
@@ -0,0 +1,41 @@
1
+ # `viewkitjs/views/looks`
2
+
3
+ Import from `viewkitjs/views/looks` to pick a piece's look by name: each piece's options and looks, declared beside the piece, and the helpers that wear a set of picks on a frame and read it back. No React at runtime, so a server or a script reads it too. A piece's id, its options' ids, their values' ids and its looks' ids are public ([the contract](../contract.md#looks)); the words are not. Guide: [looks](../guides/looks.md).
4
+
5
+ ## The shape
6
+
7
+ - `PieceLooks` — a piece's options and looks: `id` (the piece's, the middle of its attributes' names), `name`, `options` (`LookOption`s, in the order a picker shows them) and `looks` (`Look`s). Nothing picked wears each option's `def`, My preset's pick, which no look need match whole.
8
+ - `LookOption` — one option: `id`, `name`, `def` (the value worn when nothing is picked, or when the pick is a value it doesn't have), `values` (`LookValue`s), and optionally `device` (a `LookDevice`), `kind` (`"steps"` for an ordered scale, `"list"` for a long list), `unless` (an option and a value, or several, under which this one means nothing) and `demo: false` (it changes nothing a whole list draws, so a list-wide picker may leave it out).
9
+ - `LookValue` — one value an option can hold: `id` and `name`.
10
+ - `Look` — a named set of picks: `id`, `name`, `picks` (one value for every option) and optionally `device`.
11
+ - `LookPicks` — some options' picks, by option id; what an app saves.
12
+ - `LookDevice` — `"phone"` or `"desktop"`: the device an option or a look is for, when it is for one.
13
+
14
+ ## Wearing a look
15
+
16
+ - `lookAttrs` — `lookAttrs(piece, picks?)`: the `data-<piece>-<option>` attribute for every option, the pick where the option has it and the default otherwise, to spread on the element round the piece.
17
+ - `lookPicks` — `lookPicks(piece, id)`: a look's picks by its id, or `undefined` for an id the piece has no look by.
18
+ - `lookWorn` — `lookWorn(piece, picks, ids)`: the named options' values from a set of picks, each its default when missing or unknown.
19
+ - `lookWornOf` — `lookWornOf(piece, element, ids)`: the same, read from the closest frame round `element` carrying each option's attribute; with `null`, or outside any frame, the defaults.
20
+ - `LOOKS` — every piece that declares looks, in a list, each found by its `id`: the grid, the Button and the Spinner.
21
+
22
+ ## The controls'
23
+
24
+ The default controls' options and looks (the controls themselves: [`viewkitjs/views/controls`](controls.md)), each worn
25
+ on a frame round the controls as `data-button-*` and `data-spinner-*`, which the controls' stylesheets read.
26
+
27
+ - `BUTTON_LOOKS` — the Button's: 7 options (`radius`, a scale from `xs` to `full`; `smoothing`; `depth`; `hover`; `press`; `soft`; `weight`) and four looks, `classic` (every option's default), `keycap`, `pill` and `soft-lift`.
28
+ - `ButtonLookOptionId` — the Button's option ids.
29
+ - `SPINNER_LOOKS` — the Spinner's: 6 options (`kind`, `breath`, `line`, `track`, `bars`, `loading`, the four in the middle meaning nothing under some kinds) and thirteen looks, from `arc` to `pulse`.
30
+ - `SpinnerLookOptionId` — the Spinner's option ids.
31
+
32
+ ## The grid's
33
+
34
+ - `GRID_LOOKS` — the grid's options and looks: 25 options (`header`, `lines`, `columns`, `density`, `phone`, `name`, `edge`, `boxes`, `icon`, `picked`, `cell`, `corners`, `hover`, `frame`, `groups`, `names`, `phones`, `typed`, `figures`, `width`, `more`, `wait`, `foot`, `add`, `picking`) and two looks, `attio` (every option's default) and `portal` (ViewKit's own grid, as the portal draws it).
35
+ - `GridLookOptionId` — the grid's option ids.
36
+ - `GridLookWorn` — what the grid's code reads of its options: `columns`, `density`, `phone`, `name`, `boxes`, `icon`, `groups`, `figures`, `width`, `more`, `wait`, `foot`, `add` and `picking`. The others are its look stylesheet's alone, which ships later.
37
+ - `GRID_LOOK_READ` — those fourteen option ids, in that order. Eleven reach `GridTable` through `gridLookProps`; `more`, `figures` and `wait` the app wires itself (the [guide](../guides/looks.md)).
38
+ - `gridLookWorn` — `gridLookWorn(picks?)`: a `GridLookWorn` from a set of picks.
39
+ - `gridLookWornOf` — `gridLookWornOf(element)`: a `GridLookWorn` read from the frame round `element`.
40
+ - `gridLookProps` — `gridLookProps(worn, phone)`: the `GridTable` props a look sets, on a phone or a computer, as a `GridLookProps`.
41
+ - `GridLookProps` — `verticalBorders`, `headerVerticalBorders`, `scale` (the density's, times 1.25 on a phone under `phone: "attio"`), `freezeIdentity`, `alwaysCheckboxes`, `showRowIcon`, `oneHeader`, `groupMenu`, `fillWidth`, and the phone's three, `pinFooter`, `addColumnAt` and `phonePicking`, which on a computer are always ViewKit's own.
@@ -82,7 +82,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
82
82
  - `ViewsSheetAction` — one of them: its `label` (the accessible name) and `onPress`. The glyph is yours.
83
83
  - `ViewsBodyStep` — `{ title, onBack }`: a step of an editor body's own on a phone (a list of countries, a label's list), which a `TextBody`, `PartsBody`, `ValuesBody` or `LinksBody` hands the sheet through its `onStepChange`. The sheet's head shows `title` in place of the field's name, and Back and the sheet's Escape call `onBack`; the body hands `null` once it is back.
84
84
  - `ViewsMenuRoute` — `"popover" | "menu"`, the provider's `menus`: how the grid opens its own menus (a column's, a footer's figure picker, a group's ⋯, Add column). `popover` (the default) draws ViewKit's rows in your `Popover`; `menu` hands your `Menu` its rows as data. The row menu and a command cell's menu always go through your `Menu`.
85
- - `ViewsSeveralValues` — `"first" | "fit"`, the provider's `severalValues`: how a cell of several values draws on one line. `first` (the default) draws its first value and a count at any width, as on 0.5.0; `fit` draws as many whole values as fit its width, then the count, following a column resize.
85
+ - `ViewsSeveralValues` — `"first" | "fit"`, the provider's `severalValues`: how a cell of several values draws on one line. `fit` (the default) draws as many whole values as fit its width, then the count, following a column resize; `first` draws its first value and a count at any width, as on 0.5.0.
86
86
  - `ViewsGridButtons` — `"own" | "button"`, the provider's `gridButtons`: who draws the buttons the grid draws itself (a group's fold and ⋯, "+ Add column", a row's ⋯, the name's actions, an action column's buttons, a pick-list cell's ▾, a command cell's ▾ and trigger). `own` (the default) draws ViewKit's own, as on 0.5.0; `button` draws your `Button`, handed the grid's box in `className`.
87
87
  - `ViewsGridCheckboxes` — `"own" | "checkbox"`, the provider's `gridCheckboxes`: who draws a yes/no cell's box in the grid (the checkbox style). `own` (the default) draws ViewKit's tick box in its own switch button, as on 0.5.0; `checkbox` draws your `Checkbox`, handed `checked`, the column's name, `tabIndex` -1 and `onCheckedChange`, or `readOnly` where the grid can't write.
88
88
  - `ViewsFieldRowButtons` — `"own" | "button"`, the provider's `fieldRowButtons`: who draws a field row's own buttons (its edit target, the verb trigger around a value, the lane's ▾, rich text's Show more). `own` (the default) draws ViewKit's, as on 0.5.0; `button` draws your `Button`.
@@ -146,7 +146,7 @@ The pieces the rendering is built from, and your app's own pieces it cannot draw
146
146
  - `ViewsRowProps` — a whole row: everything `ViewsRowContentProps` takes, as a button, or with `interactive` false a static line. It adds `onClick`, `onMouseDown` (for a row inside an editor that keeps its input focused), `disabled`, `title`, a `role` with `aria-selected`, and `opens` and `open` for a row that opens a flyout beside its menu.
147
147
  - `ViewsTickBoxProps` — a paint-only tick box: `checked` and a class. The control around it is the caller's.
148
148
  - `ViewsAvatarProps` — a person's or a record's picture, drawn in a user's, a relation's and an actor's chip (`size: "chip"`) and before the name when the list's `rowIcon` hands the row's `avatar` (`size: "glyph"`, sized by `--vk-glyph`): `label` (whose picture it is, for initials), `avatarUrl` (the picture, when there is one), `kind` (the record's kind as your app names it: a relation's `entity`, `user` for a member, an actor's type) and `fallback` (the glyph the chip or the name draws without a picture). The default draws the picture while it loads and the fallback otherwise; yours may hand back the fallback for a kind it doesn't dress. It only paints: what wraps the chip owns the click.
149
- - `ViewsStatusBadgeProps` — a pill coloured by a status slot of `viewkitjs/fields`: its `slot` and `label`, a `leading` mark that replaces the slot's own, a `title`, a `size` (`compact`, 11px, the default, as a status value is drawn in a cell; or `regular`) and a class. It is handed `place` wherever a field's option is drawn (a cell, the select editor, the selection bar): where the status stands among the field's steps.
149
+ - `ViewsStatusBadgeProps` — a pill coloured by a status slot of `viewkitjs/fields`: its `slot` and `label`, a `leading` mark that replaces the slot's own, a `title`, a `size` (`compact`, 11px, the default; `regular`; or `row`, the text size of the row it sits in, which a cell's status value hands) and a class. It is handed `place` wherever a field's option is drawn (a cell, the select editor, the selection bar): where the status stands among the field's steps.
150
150
  - `ViewsStatusPlace` — a status's `place`: `options`, the field's active options in their order (the same array for every cell of a field), and `index`, this one's place in them. A stray or archived value, and a badge that is no option, are handed none.
151
151
  - `ViewsStatusOption` — one of those options as a badge is handed it: `value`, `label` and its `slot`.
152
152
  - `ViewsStatusMarkerProps` — an attention badge that opens its reason in a popover: its `label`, its `title` (the panel's heading and the marker's accessible name), a `slot` (`warning` by default), the `reason`, the `emptyReason` shown when there is none (the package's wording by default), and `onResolve` with its `resolveLabel`; without `onResolve` the marker is read-only.
@@ -17,7 +17,7 @@ Guide: [the provider](../guides/the-provider.md).
17
17
  - `VkToken` — one member of `VK_TOKENS`.
18
18
  - `VK_COLOURS` — the colours the rendering paints, each a CSS variable your app declares (`--vk-fg`, `--vk-ground`, `--vk-brand`, `--vk-border` and the rest). The package sets none of them and names no variable of your own; you map each onto your tokens once ([Tokens](../contract.md#tokens)).
19
19
  - `VkColour` — one member of `VK_COLOURS`.
20
- - `VK_OPTIONAL_COLOURS` — the status hues (`--vk-success`, `--vk-warning`, `--vk-info`) and the category hues (`--vk-label-blue` to `--vk-label-teal`) the default atoms and the display read when your app declares them, each with a built-in fallback, beside the shadows, the selected ground and the cell outlines' colours listed under [Tokens](../contract.md#tokens).
20
+ - `VK_OPTIONAL_COLOURS` — the status hues (`--vk-success`, `--vk-warning`, `--vk-info`) and the category hues (`--vk-label-blue` to `--vk-label-teal`) the default atoms and the display read when your app declares them, each with a built-in fallback; the status washes (`--vk-success-subtlest`, `--vk-warning-subtlest`, `--vk-info-subtlest`), the words on a filled status (`--vk-fg-inverse`, `--vk-fg-warning-inverse`), and each hue's soft fill and the default Tag's pill rungs (`--vk-label-blue-soft`, `--vk-label-blue-fill`, `--vk-label-blue-edge`, `--vk-label-blue-strong` and the same for each hue); beside the shadows, the selected ground and the cell outlines' colours listed under [Tokens](../contract.md#tokens).
21
21
  - `VkOptionalColour` — one member of `VK_OPTIONAL_COLOURS`.
22
22
  - `VK_OPTIONAL_LAYOUT` — the layout your app may declare, each read with a fallback: `--vk-gutter` (`0px`), the side padding your page gives its content, which the grid's rows line their content up with; `--vk-scroll-inset-bottom` (`0px`), how much of the grid's foot your app covers with something it floats there (a phone's bottom bar), so the grid's scroll area runs underneath it and its last row scrolls clear of it; and `--vk-panel-padding` (`0.375rem`), the inset a panel's list keeps from the panel's edge; and the rail, outline, gap, type, line and timing variables listed under [Tokens](../contract.md#tokens).
23
23
  - `VkOptionalLayout` — one member of `VK_OPTIONAL_LAYOUT`.
@@ -26,6 +26,9 @@ Guide: [the provider](../guides/the-provider.md).
26
26
  - `VK_INTERNAL_FAMILIES` — the grid's internal variable families, a prefix with one variable per key after it: `--vk-col-w-<id>`, one column's resolved width, set on the grid's root for every visible column. Not public, like `VK_INTERNAL`.
27
27
  - `VK_INTERNAL_MARKS` — the display's own marks, set and read by ViewKit alone: `vk-fit` on a cell fitting its values and `vk-fit-value` on each value's box, which its measure reads. Not public, like `VK_INTERNAL`: your app neither sets, reads nor styles them, and they may change in any release.
28
28
  - `VkInternalMark` — one member of `VK_INTERNAL_MARKS`.
29
+ - `VK_CONTROL_TOKENS` — every name ViewKit's default controls (`viewkitjs/views/controls`) read, each with its `kind` (`colour`, `shadow`, `size` or `motion`): all optional, the ready stylesheet declaring each at the Outright look's value, and each standing for the Outright token [the controls' tokens](../contract.md#the-controls-tokens) names.
30
+ - `VkControlToken` — one name of `VK_CONTROL_TOKENS`.
31
+ - `VK_CONTROL_PRIVATE_FAMILIES` — the prefixes of the controls' own machinery, set and read by a control alone: not public, and your app neither sets nor reads them.
29
32
  - `COMPONENT_NAMES` — the primitives your app hands in through the provider: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon` and `Markdown` ([the components map](../contract.md#the-components-map)).
30
33
  - `ComponentName` — one member of `COMPONENT_NAMES`.
31
34
  - `OPTIONAL_COMPONENT_NAMES` — the primitives your app may leave out: `Input` (a plain default), `Command` (reached without one, it throws an error naming it), `Picker` (without one, the lists draw from `Command`), `LinksBody` (without one, the set editor of a relation whose field declares `links` opens `Picker`, else its own list), `Calendar` (reached without one, it throws an error naming it), `DateBody` (without one, the date editor draws its own around `Calendar`), `PartsBody` (without one, the name, place and range editors draw their own boxes), `ValuesBody` (without one, the value list editor draws its own rows), `TextBody` (without one, the text editors draw their own box) and `NumberBody` (without one, the number editors draw their own box), `SortBody` (without one, the sort pill opens ViewKit's own sort editor), `FilterBody` (without one, an advanced filter's pill and the phone's Filter open ViewKit's own filter editor), `FieldsBody` (without one, ViewKit's own sort and filter field lists), `FilterPartBody` (without one, a filter rule's way and value open ViewKit's ways menu and value body), `RowsWait` (without one, a grid waiting for new rows draws Loading in place of its body), `QuickFiltersBody` (without one, the quick filters' button opens ViewKit's own quick-filters panel), `ViewsListBody` (without one, the view picker opens ViewKit's own list of views), `GroupBody` (without one, Customize's Group opens ViewKit's own group pages), `CustomizeBody` (without one, Options opens ViewKit's own Customize) and `SearchField` (without one, the toolbar's search draws its own field) ([the components map](../contract.md#the-components-map)).
@@ -430,7 +433,7 @@ Each rule is data, an operator and its values, so the same rule is judged in mem
430
433
  - `dateFilterDates` — how many days a date operator takes: none, one or two.
431
434
  - `dateFilterOperatorLabel` — a date operator's name in the host's words.
432
435
  - `isDateRuleActive` — says whether a date rule filters: a relative rule needs its direction and unit, the others their days.
433
- - `dateRuleLabel` — a date rule's summary, its days written in the host's locale, or the word for any.
436
+ - `dateRuleLabel` — a date rule's summary, its days written in the host's locale with their month's word in its `language`, or the word for any.
434
437
  - `matchesDateRule` — judges a value against a date rule by its calendar day in the host's time zone; a relative rule is resolved against the current moment each time, so it moves with the clock.
435
438
  - `resolveRelativeWindow` — the inclusive window of days a relative rule means today: this is the calendar period holding today, with weeks running Monday to Sunday; past and next run back or forward one unit from today.
436
439
  - `valueDayKey` — the calendar day a stored date or instant means, in the host's time zone; a bare day is already a day and is never read as a UTC instant. Null for an empty or unreadable value.
@@ -5,11 +5,11 @@ description: Mount and adapt viewkitjs/views — the provider, the components ma
5
5
 
6
6
  # ViewKit views
7
7
 
8
- Use the package through its twenty-three declared doors only, never a deep path: `viewkitjs/views` (the
8
+ Use the package through its twenty-four declared doors only, never a deep path: `viewkitjs/views` (the
9
9
  contract and the model), `viewkitjs/views/react` (the provider, the atoms, the adapter's types),
10
10
  `/display`, `/editors`, `/editors/select`, `/editors/text`, `/editors/relation`, `/editors/number`, `/editors/range`,
11
11
  `/editors/name`, `/editors/location`, `/editors/value-list`, `/editors/date`, `/editors/chips`,
12
- `/editors/session`, `/editors/panel`, `/editors/open-values`, `/field-row`, `/cells`, `/selection`, `/grid`,
12
+ `/editors/session`, `/editors/panel`, `/editors/open-values`, `/field-row`, `/cells`, `/selection`, `/grid`, `/looks`,
13
13
  `/panels` (what a list's panels read and say, no React) and `/panels/react` (the panels and the toolbar as they draw). The package's docs
14
14
  start at `views/docs/index.md`: `views/docs/getting-started.md` goes from install to a grid on screen, a guide per
15
15
  concept sits in `views/docs/guides/`, and `views/docs/reference/` names every export of each door.