viewkitjs 0.33.0 → 0.35.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 (257) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/package.json +1 -1
  3. package/views/README.md +1 -1
  4. package/views/dist/atoms/Avatar.js +2 -1
  5. package/views/dist/atoms/RelationChip.d.ts +2 -0
  6. package/views/dist/atoms/RelationChip.js +5 -0
  7. package/views/dist/atoms/RowMenu.d.ts +1 -1
  8. package/views/dist/atoms/RowMenu.js +15 -3
  9. package/views/dist/atoms/defaults.js +2 -0
  10. package/views/dist/atoms/types.d.ts +40 -4
  11. package/views/dist/cells/relation-wrap.js +9 -2
  12. package/views/dist/contract.d.ts +27 -14
  13. package/views/dist/contract.js +40 -4
  14. package/views/dist/controls/alert/alert.js +2 -1
  15. package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
  16. package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
  17. package/views/dist/controls/avatar/avatar-mark.js +5 -0
  18. package/views/dist/controls/avatar/avatar.d.ts +7 -4
  19. package/views/dist/controls/avatar/avatar.js +10 -4
  20. package/views/dist/controls/avatar/looks.d.ts +1 -1
  21. package/views/dist/controls/avatar/looks.js +3 -0
  22. package/views/dist/controls/avatar/record-mark.d.ts +16 -0
  23. package/views/dist/controls/avatar/record-mark.js +13 -0
  24. package/views/dist/controls/avatar/tokens.d.ts +12 -0
  25. package/views/dist/controls/avatar/tokens.js +3 -0
  26. package/views/dist/controls/avatar.css +54 -17
  27. package/views/dist/controls/bulk-bar/bulk-bar.js +29 -27
  28. package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
  29. package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
  30. package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
  31. package/views/dist/controls/compound-editor/map-parts-body.js +6 -1
  32. package/views/dist/controls/compound-editor/name-parts.js +2 -1
  33. package/views/dist/controls/compound-editor/place-parts.js +2 -2
  34. package/views/dist/controls/compound-editor/range-parts.js +10 -9
  35. package/views/dist/controls/controls.d.ts +2 -0
  36. package/views/dist/controls/controls.js +2 -0
  37. package/views/dist/controls/customize/customize.d.ts +14 -5
  38. package/views/dist/controls/customize/customize.js +19 -20
  39. package/views/dist/controls/customize/map-customize-body.d.ts +2 -2
  40. package/views/dist/controls/customize/map-customize-body.js +15 -13
  41. package/views/dist/controls/customize/words.d.ts +3 -3
  42. package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
  43. package/views/dist/controls/date-editor/date-editor.js +13 -7
  44. package/views/dist/controls/date-editor/map-calendar.js +2 -0
  45. package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
  46. package/views/dist/controls/date-editor/map-date-body.js +7 -3
  47. package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
  48. package/views/dist/controls/filter-editor/filter-editor.js +4 -6
  49. package/views/dist/controls/filter-editor/map-filter-body.d.ts +2 -0
  50. package/views/dist/controls/filter-editor/map-filter-body.js +7 -4
  51. package/views/dist/controls/filter-editor/parts.d.ts +4 -2
  52. package/views/dist/controls/filter-editor/parts.js +8 -7
  53. package/views/dist/controls/group-editor/group-editor.js +2 -1
  54. package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
  55. package/views/dist/controls/group-editor/map-group-body.js +5 -1
  56. package/views/dist/controls/index.d.ts +1 -1
  57. package/views/dist/controls/input/input.js +2 -1
  58. package/views/dist/controls/internal/head-button.d.ts +9 -0
  59. package/views/dist/controls/internal/head-button.js +13 -0
  60. package/views/dist/controls/internal/map-panel-controls.js +9 -5
  61. package/views/dist/controls/internal/panel-controls.d.ts +38 -6
  62. package/views/dist/controls/internal/panel-controls.js +191 -19
  63. package/views/dist/controls/links-editor/links-editor.js +5 -7
  64. package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
  65. package/views/dist/controls/links-editor/map-links-body.js +5 -1
  66. package/views/dist/controls/menu/menu.d.ts +5 -1
  67. package/views/dist/controls/menu/menu.js +4 -3
  68. package/views/dist/controls/modal/modal.js +5 -3
  69. package/views/dist/controls/number-editor/map-number-body.js +5 -1
  70. package/views/dist/controls/number-editor/number-editor.js +6 -6
  71. package/views/dist/controls/pane/map-pane.d.ts +3 -0
  72. package/views/dist/controls/pane/map-pane.js +5 -0
  73. package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
  74. package/views/dist/controls/picker/map-fields-body.js +30 -2
  75. package/views/dist/controls/picker/map-picker.d.ts +8 -3
  76. package/views/dist/controls/picker/map-picker.js +14 -3
  77. package/views/dist/controls/picker/picker.js +11 -8
  78. package/views/dist/controls/picker/rows.d.ts +7 -2
  79. package/views/dist/controls/picker.css +10 -1
  80. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
  81. package/views/dist/controls/quick-filters/map-quick-filters-body.js +9 -4
  82. package/views/dist/controls/quick-filters/quick-filters.js +8 -6
  83. package/views/dist/controls/quick-filters/reminder.js +2 -2
  84. package/views/dist/controls/quick-filters/rules.d.ts +4 -1
  85. package/views/dist/controls/quick-filters/words.d.ts +2 -0
  86. package/views/dist/controls/quick-filters/words.js +1 -0
  87. package/views/dist/controls/select/select.d.ts +3 -0
  88. package/views/dist/controls/select/select.js +9 -3
  89. package/views/dist/controls/setting-row/looks.js +5 -5
  90. package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
  91. package/views/dist/controls/setting-row/setting-row.js +3 -1
  92. package/views/dist/controls/setting-row.css +3 -2
  93. package/views/dist/controls/sheet/bottom-sheet.d.ts +3 -1
  94. package/views/dist/controls/sheet/bottom-sheet.js +2 -2
  95. package/views/dist/controls/sort-editor/map-sort-body.js +4 -4
  96. package/views/dist/controls/sort-editor/sort-editor.d.ts +2 -0
  97. package/views/dist/controls/sort-editor/sort-editor.js +4 -5
  98. package/views/dist/controls/text-editor/map-text-body.js +5 -1
  99. package/views/dist/controls/text-editor/text-editor.js +5 -4
  100. package/views/dist/controls/toolbar/toolbar.d.ts +29 -14
  101. package/views/dist/controls/toolbar/toolbar.js +17 -22
  102. package/views/dist/controls/toolbar.css +0 -5
  103. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  104. package/views/dist/controls/tooltip/map-tooltip.js +4 -2
  105. package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
  106. package/views/dist/controls/values-editor/map-values-body.js +5 -1
  107. package/views/dist/controls/values-editor/values-editor.js +8 -7
  108. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
  109. package/views/dist/controls/views-list/map-view-menu.js +6 -2
  110. package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
  111. package/views/dist/controls/views-list/map-views-list-body.js +6 -5
  112. package/views/dist/controls/views-list/view-menu.js +3 -4
  113. package/views/dist/controls/views-list/views-list.js +2 -2
  114. package/views/dist/display/option-badges.d.ts +16 -0
  115. package/views/dist/display/option-badges.js +11 -0
  116. package/views/dist/display/relation-link.d.ts +12 -0
  117. package/views/dist/display/relation-link.js +17 -0
  118. package/views/dist/display/relation.d.ts +1 -1
  119. package/views/dist/display/relation.js +10 -3
  120. package/views/dist/display/select.js +1 -8
  121. package/views/dist/editors/EditorPanel.js +4 -4
  122. package/views/dist/editors/RangeEditor.d.ts +3 -0
  123. package/views/dist/editors/RangeEditor.js +2 -2
  124. package/views/dist/editors/SelectEditor.d.ts +2 -2
  125. package/views/dist/editors/SelectEditor.js +1 -1
  126. package/views/dist/editors/TextEditor.js +4 -2
  127. package/views/dist/editors/ValueListEditor.js +2 -1
  128. package/views/dist/field-row/FieldRow.js +32 -5
  129. package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
  130. package/views/dist/grid/chrome/GridAddColumn.js +9 -6
  131. package/views/dist/grid/chrome/GridCellEditors.js +1 -1
  132. package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
  133. package/views/dist/grid/chrome/GridCellOutline.js +16 -6
  134. package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
  135. package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
  136. package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
  137. package/views/dist/grid/chrome/GridFooter.js +4 -4
  138. package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
  139. package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
  140. package/views/dist/grid/chrome/GridHeader.js +1 -2
  141. package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
  142. package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
  143. package/views/dist/grid/chrome/GridRow.js +5 -3
  144. package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
  145. package/views/dist/grid/chrome/GridRowActions.js +2 -2
  146. package/views/dist/grid/chrome/GridRowCells.js +3 -2
  147. package/views/dist/grid/chrome/GridStructure.js +1 -1
  148. package/views/dist/grid/chrome/GridTable.js +32 -20
  149. package/views/dist/grid/chrome/checks.d.ts +1 -1
  150. package/views/dist/grid/chrome/checks.js +4 -1
  151. package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
  152. package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
  153. package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
  154. package/views/dist/grid/chrome/grid-hover.js +14 -4
  155. package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
  156. package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
  157. package/views/dist/grid/chrome/grid-table-props.d.ts +10 -2
  158. package/views/dist/grid/grid.css +6 -0
  159. package/views/dist/grid/looks.d.ts +3 -1
  160. package/views/dist/grid/looks.js +10 -4
  161. package/views/dist/list/layer.d.ts +8 -0
  162. package/views/dist/list/layer.js +7 -0
  163. package/views/dist/list/list.d.ts +6 -2
  164. package/views/dist/list/list.js +6 -2
  165. package/views/dist/list/parts.js +3 -2
  166. package/views/dist/list/store.d.ts +1 -1
  167. package/views/dist/list/toolbar.js +51 -20
  168. package/views/dist/list/views.js +1 -0
  169. package/views/dist/panels/availability.d.ts +5 -0
  170. package/views/dist/panels/availability.js +4 -5
  171. package/views/dist/panels/customize-body.d.ts +4 -0
  172. package/views/dist/panels/customize-body.js +13 -11
  173. package/views/dist/panels/model.d.ts +9 -4
  174. package/views/dist/panels/react/customize-body.js +5 -2
  175. package/views/dist/panels/react/customize.d.ts +5 -0
  176. package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
  177. package/views/dist/panels/react/filter/FilterEditor.js +7 -0
  178. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
  179. package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
  180. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +17 -1
  181. package/views/dist/panels/react/toolbar/Toolbar.d.ts +15 -1
  182. package/views/dist/panels/react/toolbar/Toolbar.js +24 -9
  183. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +3 -2
  184. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
  185. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +14 -6
  186. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
  187. package/views/dist/panels/react/toolbar/ToolbarFilters.js +21 -10
  188. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +6 -1
  189. package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
  190. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  191. package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
  192. package/views/dist/panels/react/toolbar/ToolbarSave.js +5 -4
  193. package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
  194. package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
  195. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
  196. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +7 -6
  197. package/views/dist/panels/react/toolbar/context.d.ts +21 -0
  198. package/views/dist/panels/react/toolbar/context.js +4 -0
  199. package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
  200. package/views/dist/panels/react/toolbar/pane-host.js +17 -0
  201. package/views/dist/panels/react/toolbar/panel-part.js +3 -2
  202. package/views/dist/panels/react/views-row/ViewPicker.js +13 -5
  203. package/views/dist/panels/react.d.ts +2 -2
  204. package/views/dist/panels/settings/layout.js +6 -38
  205. package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
  206. package/views/dist/panels/toolbar/page-resets.js +62 -0
  207. package/views/dist/panels/toolbar/same-item.d.ts +7 -0
  208. package/views/dist/panels/toolbar/same-item.js +9 -0
  209. package/views/dist/panels/view-state.d.ts +4 -0
  210. package/views/dist/provider/ViewsProvider.d.ts +9 -3
  211. package/views/dist/provider/ViewsProvider.js +13 -2
  212. package/views/dist/provider/components.d.ts +59 -8
  213. package/views/dist/provider/components.js +1 -1
  214. package/views/dist/react.d.ts +2 -2
  215. package/views/dist/styles.css +194 -100
  216. package/views/dist/styles.unlayered.css +194 -100
  217. package/views/docs/contract.md +96 -27
  218. package/views/docs/controls/alert-dialog.md +4 -0
  219. package/views/docs/controls/alert.md +4 -0
  220. package/views/docs/controls/avatar.md +3 -0
  221. package/views/docs/controls/bulk-bar.md +7 -1
  222. package/views/docs/controls/compound-editor.md +2 -0
  223. package/views/docs/controls/customize.md +3 -1
  224. package/views/docs/controls/date-editor.md +2 -0
  225. package/views/docs/controls/filter-editor.md +1 -1
  226. package/views/docs/controls/group-editor.md +2 -0
  227. package/views/docs/controls/links-editor.md +2 -0
  228. package/views/docs/controls/menu.md +3 -1
  229. package/views/docs/controls/modal.md +4 -0
  230. package/views/docs/controls/number-editor.md +2 -0
  231. package/views/docs/controls/pane.md +1 -1
  232. package/views/docs/controls/picker.md +2 -0
  233. package/views/docs/controls/quick-filters.md +4 -2
  234. package/views/docs/controls/sheet.md +1 -1
  235. package/views/docs/controls/text-editor.md +3 -1
  236. package/views/docs/controls/toolbar.md +4 -0
  237. package/views/docs/controls/values-editor.md +2 -0
  238. package/views/docs/controls/views-list.md +2 -0
  239. package/views/docs/guides/atoms.md +54 -3
  240. package/views/docs/guides/display.md +1 -1
  241. package/views/docs/guides/looks.md +1 -1
  242. package/views/docs/guides/the-grid.md +4 -2
  243. package/views/docs/guides/the-provider.md +4 -4
  244. package/views/docs/index.md +2 -2
  245. package/views/docs/install.md +198 -104
  246. package/views/docs/reference/controls.md +21 -17
  247. package/views/docs/reference/editors-range.md +1 -1
  248. package/views/docs/reference/field-row.md +1 -1
  249. package/views/docs/reference/grid.md +2 -1
  250. package/views/docs/reference/list.md +7 -5
  251. package/views/docs/reference/looks.md +6 -6
  252. package/views/docs/reference/panels-react.md +17 -15
  253. package/views/docs/reference/panels.md +4 -4
  254. package/views/docs/reference/react.md +15 -12
  255. package/views/docs/reference/views.md +6 -4
  256. package/views/docs/reshaping.md +32 -5
  257. package/views/skills/views/SKILL.md +3 -3
@@ -1,106 +1,200 @@
1
1
  # Install
2
2
 
3
- 1. **Pin it**: one package holds views and fields.
4
-
5
- ```sh
6
- pnpm add viewkitjs zod
7
- ```
8
-
9
- `react` and `react-dom` 19 are optional peers of the package, which the views part needs and a React app already has. `@dnd-kit/core`, `@dnd-kit/sortable` and
10
- `@dnd-kit/utilities` are optional peers for the panels' parts that drag (the views row's pills, the sort's rules, the
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
- 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.
15
-
16
- 2. **Import the stylesheet.** One line gives the rendering its whole look, with no Tailwind needed:
17
-
18
- ```css
19
- @import "viewkitjs/views/styles.css";
20
- ```
21
-
22
- It goes anywhere among your imports. Its rules sit in `components › viewkit`, a layer inside
23
- `components`, and the file opens by declaring Tailwind's order (`theme, base, components, utilities`), so
24
- your own components rules and your utilities win over ViewKit's whatever the order you import things in.
25
- Its defaults are the Outright look (the look Outright's own apps wear), light, and dark under `.dark` or
26
- `[data-theme="dark"]`. The reset it carries (Tailwind's preflight) touches only ViewKit's elements and what
27
- your components draw inside them, and sits in `base › viewkit`, under your own base styles: a rule of yours
28
- in `base` (shadcn's border colour) still wins there.
29
-
30
- An app whose reset or styles sit in no layer (Tailwind 3, or a plain CSS reset, whose unlayered preflight
31
- beats any layer) imports `viewkitjs/views/styles.unlayered.css` instead: ViewKit's classes outside any
32
- layer, its reset and defaults still in `base › viewkit` and `components › viewkit`, and Tailwind's
33
- fallbacks for browsers without `@property` in a `properties` layer. It declares no layer order, so it is
34
- for an app with no layers of its own: a Tailwind 4 app takes `styles.css`.
35
-
36
- Until each piece moves to CSS of its own, the stylesheet carries ViewKit's classes under Tailwind's names (`h-8`, `rounded-md`). Where your own Tailwind writes a class of the same name, your rule wins on ViewKit's element too: a stock Tailwind app that uses `rounded-md` itself draws ViewKit's corners at 6px, not the Outright look's 7.5px. The pieces move to their own `vk-*` classes one by one, and the overlap goes with them.
37
-
38
- **Or let your Tailwind compile it.** An app on Tailwind 4 can still draw ViewKit on its own scale: leave
39
- the import out and add one line to the stylesheet that imports Tailwind instead:
40
-
41
- ```css
42
- @source "../../node_modules/viewkitjs/views";
43
- ```
44
-
45
- (Adjust the relative path to where your stylesheet sits.) A missing line shows unstyled values and editors.
46
- This way the rendering needs no base reset (Tailwind's preflight or any other): every button, input,
47
- textarea and link it draws itself resets itself, at zero specificity, so it looks the same with or without
48
- one, and your own classes and base styles elsewhere are untouched. The grid's look (its header's words, its
49
- frames, its pinned edge, its names and phones: the grid's options, `docs/guides/looks.md`) is plain CSS of its
50
- own this way: import it after your Tailwind, `@import "viewkitjs/views/grid.css";`, and declare the grid's look
51
- tokens (`VK_GRID_TOKENS`) with the colours below.
52
-
53
- 3. **Make the colours yours (optional).** The rendering paints through its own names. The stylesheet
54
- already declares every one with the Outright look's value, light, and dark under `.dark` or `[data-theme="dark"]`;
55
- declare them yourself to wear your own theme. A declaration in no layer, or in any layer above
56
- `components`, wins over the stylesheet's. With `@source` instead of the stylesheet, nothing declares
57
- them for you, and this block is required. On stock shadcn tokens:
58
-
59
- ```css
60
- :root {
61
- --vk-fg: var(--foreground);
62
- --vk-fg-subtle: var(--muted-foreground);
63
- --vk-fg-subtlest: var(--muted-foreground);
64
- --vk-fg-brand: var(--primary);
65
- --vk-fg-selected: var(--primary);
66
- --vk-fg-on-brand: var(--primary-foreground);
67
- --vk-ground: var(--background);
68
- --vk-overlay: var(--popover);
69
- --vk-hovered: var(--accent);
70
- --vk-pressed: var(--accent);
71
- --vk-neutral: var(--muted);
72
- --vk-neutral-hovered: var(--accent);
73
- --vk-brand: var(--primary);
74
- --vk-brand-subtlest: color-mix(in oklab, var(--primary) 12%, var(--background));
75
- --vk-danger: var(--destructive);
76
- --vk-danger-subtlest: color-mix(in oklab, var(--destructive) 12%, var(--background));
77
- --vk-border: var(--border);
78
- --vk-border-subtle: var(--border);
79
- --vk-border-bold: var(--ring);
80
- --vk-border-brand: var(--primary);
81
- }
82
- ```
83
-
84
- `.dark` needs nothing more: each line reads your own token, which your dark theme already sets.
85
- If your grounds each tune their hover, declare `--vk-hovered` and `--vk-pressed` beside each
86
- ground's own. The status and category hues (`--vk-success`, `--vk-label-blue`, …) are optional, and so
87
- are the status washes, the words on a filled status and each hue's soft fill and pill rungs
88
- (`--vk-success-subtlest`, `--vk-fg-inverse`, `--vk-label-blue-soft`, `--vk-label-blue-strong`, …; the list
89
- is in `docs/contract.md`, Tokens).
90
-
91
- If your pages pad their content at the sides, tell the grid how far, so its rows line up with the
92
- rest of the page: declare `--vk-gutter` beside the colours, onto your own padding. Without it the
93
- grid sits flush with its container.
94
-
95
- 4. **Mount the provider once**, above every view, with your primitives, your ports, your icons and
96
- your field conventions; your own atoms, wording and number formats are optional.
97
- [The provider guide](guides/the-provider.md) shows it, with your messages through a translator
98
- scoped to the `views` namespace and `presentation` for your own number and date formats.
99
-
100
- 5. **Write the adapter.** The [contract](contract.md) names the eleven components and what each must
101
- accept, and the optional `Input`; `ViewsComponents`, from `viewkitjs/views/react`, is the type. An app on Base UI wraps its
102
- shadcn copies thinly; an app on Radix maps `anchor` to its anchor with a virtual ref and
103
- `onOpenChange` to its own. [The provider guide](guides/the-provider.md) walks through both, and
104
- the contract's "Writing an adapter" says what to do where a copy stops short.
105
-
106
- From here, [getting started](getting-started.md) puts a grid on screen.
3
+ A whole list (its toolbar, grid, saved views, edits and undo, on a computer and a phone) is the six steps below, and
4
+ nothing else. ViewKit's own test app runs exactly this at `/proof`: 115 lines in seven files (`test-app/app/proof/` and
5
+ its root layout, in the repository), which CI holds under 150 and installs into a fresh app from the packed package.
6
+
7
+ ## 1. Pin it
8
+
9
+ ```sh
10
+ pnpm add viewkitjs zod @base-ui/react @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities
11
+ ```
12
+
13
+ One package holds the fields, the views and the server's part; `react` and `react-dom` 19 are peers your app has.
14
+ `@base-ui/react` (1.6 or later) is what `CONTROLS`, ViewKit's default controls, stand on. The dnd-kit packages draw
15
+ what drags; `viewkitjs/views/list` loads them with `import()`, so your bundler may want them even for `fetchSource`
16
+ alone. ESM only, Node 20 or later. The server's part reads Postgres through your own client (`pg` in the proof).
17
+
18
+ ## 2. Import the stylesheet
19
+
20
+ ```css
21
+ @import "viewkitjs/views/styles.css";
22
+ ```
23
+
24
+ In your root layout: the whole look, with no Tailwind. [Your theme](#your-theme) makes the colours yours.
25
+
26
+ ## 3. Mount the provider
27
+
28
+ ```tsx
29
+ "use client";
30
+ import type { ReactNode } from "react";
31
+ import { CONTROLS } from "viewkitjs/views/controls";
32
+ import { ViewsProvider } from "viewkitjs/views/react";
33
+
34
+ export function Views({ children }: { children: ReactNode }) {
35
+ return <ViewsProvider components={CONTROLS}>{children}</ViewsProvider>;
36
+ }
37
+ ```
38
+
39
+ Once, above every list. `CONTROLS` fills every control and carries its atoms (`CONTROL_ATOMS`); the icons, the ports
40
+ and the conventions (`en-US`, `UTC`) have defaults.
41
+
42
+ ## 4. Define the fields
43
+
44
+ ```tsx
45
+ import { defineFields, defineIndex } from "viewkitjs/fields";
46
+
47
+ export const DEAL_FIELDS = defineFields({
48
+ entity: "deal",
49
+ identity: "name",
50
+ fields: {
51
+ name: { type: "text", label: "Name", required: true },
52
+ stage: { type: "status", label: "Stage", options: [{ value: "new", label: "New", slot: "pending" }, { value: "won", label: "Won", slot: "success" }] },
53
+ seats: { type: "number", label: "Seats", validation: { integer: true } },
54
+ },
55
+ });
56
+
57
+ export type Deal = { id: string; name: string; stage: string; seats: number };
58
+ ```
59
+
60
+ The browser and the server read the same fields. Every field is a column, in this order, bound by its key.
61
+
62
+ ## 5. Draw the list
63
+
64
+ ```tsx
65
+ import { List, fetchSource, type ListChange } from "viewkitjs/views/list";
66
+
67
+ const deals = fetchSource<Deal>("/api/deals/list");
68
+
69
+ async function save({ id, values }: ListChange<Deal>) {
70
+ const answer = await fetch(`/api/deals/${id}`, { method: "PATCH", body: JSON.stringify(values) });
71
+ if (!answer.ok) throw new Error("The deal wasn't saved.");
72
+ }
73
+
74
+ export function Deals() {
75
+ return <List id="deals" fields={DEAL_FIELDS} source={deals} save={save} />;
76
+ }
77
+ ```
78
+
79
+ `source` asks your server a page at a time; `rows` takes rows you already hold. `save`, your own route, is one call per
80
+ record: a throw takes the edit back. Without it the list is read-only.
81
+
82
+ ## 6. Answer it on the server
83
+
84
+ ```tsx
85
+ import { EVERY_FIELD, listHandler, sql, type Run } from "viewkitjs/postgres";
86
+ import { buildFieldMap, type AppStorage } from "viewkitjs/postgres/definitions";
87
+
88
+ // Your connection (`pg`'s Pool) and your session, where the proof reads a cookie.
89
+ declare const pool: { query(text: string, values: unknown[]): Promise<{ rows: Record<string, unknown>[] }> };
90
+ declare function workspaceOf(): Promise<string | null>;
91
+
92
+ const storage: AppStorage = { defaults: { keyStored: "text" }, kinds: { deal: { table: "deals", key: "id", softDelete: null } } };
93
+ const run: Run = async (query) => (await pool.query(query.text, [...query.values])).rows;
94
+
95
+ // app/api/deals/list/route.ts
96
+ export const POST = listHandler({
97
+ map: buildFieldMap({ index: defineIndex([{ entity: "deal", identity: "name", fields: DEAL_FIELDS }]), storage, kind: "deal" }).map,
98
+ run,
99
+ access: async () => {
100
+ const workspace = await workspaceOf();
101
+ if (!workspace) return null; // 401
102
+ return { access: { deal: (row) => sql`${row.column("workspace")} = ${workspace}` }, readable: EVERY_FIELD };
103
+ },
104
+ });
105
+ ```
106
+
107
+ One route answers every request the list makes. `access` is read per request from your own session: which rows of each
108
+ table, and which fields, the reader may read ([Answering a list's requests](../../postgres/docs/guides/list-handler.md)).
109
+
110
+ ## What an app writes
111
+
112
+ | What | Required | The rest, each optional |
113
+ |---|---|---|
114
+ | `<ViewsProvider>` | `components`, `children` | [The provider](guides/the-provider.md) |
115
+ | `<List>` | `id`, `fields`, `rows` or `source` | [The ready List](reference/list.md#the-ready-list) |
116
+ | `listHandler` | `map`, `run`, `access` | [Answering a list's requests](../../postgres/docs/guides/list-handler.md) |
117
+
118
+ ## The four things an app shapes
119
+
120
+ **Every size and colour.** Each is a `--vk-*` token with a default: the colours below, and each control's sizes, radii,
121
+ gaps, shadows and timings on its own page ([the controls' tokens](contract.md#the-controls-tokens)). The toolbar's line
122
+ reads `--vk-toolbar-line-py`, `--vk-toolbar-line-gap` and `--vk-toolbar-line-w`, and a phone list's foot
123
+ `--vk-toolbar-foot`. Each piece's options and looks are on [Looks](guides/looks.md). Every part ViewKit draws has a
124
+ public name, its `data-slot` (and a part's `data-key`), and every state a data attribute ([Slots](contract.md#slots),
125
+ [States](contract.md#states)): your stylesheet dresses any of them alone.
126
+
127
+ **Its own controls.** Hand your own over ViewKit's, keeping its atoms:
128
+ `components={{ ...CONTROLS, Button: YourButton }} atoms={CONTROL_ATOMS}`. A map spread from `CONTROLS` carries none
129
+ of its atoms (your own `atoms` lie over `CONTROL_ATOMS`), and in development the provider says so once. `panelControls`
130
+ names which of `Button`, `Select`, `Menu`, `Popover`, `Input` and `Calendar` the panels and the field editors draw with
131
+ yours ([your own controls inside the panels](guides/the-provider.md#your-own-controls-inside-the-panels)). A toolbar
132
+ part takes its own `button` or `className` through `toolbarParts`, and ⋯ its own through `overflow`
133
+ ([Parts as data](reference/list.md#parts-as-data)).
134
+
135
+ **Each menu's and panel's content and order.** Every menu is data: `menus={{ column: (items, ctx) => items }}`, with
136
+ `menu.drop`, `menu.rename`, `menu.add` and `menu.move` over its items' public keys; the proof reshapes the column menu
137
+ that way ([Menus as data](reference/list.md#menus-as-data)). Each panel's body is a control of the map (`CustomizeBody`,
138
+ `SortBody`, `FilterBody`, …), yours to replace ([The components map](contract.md#the-components-map)).
139
+
140
+ **The layout.** `toolbarParts` places each toolbar part on its line and side, with its words, and its panel where you
141
+ want it. `customizeIn: "pane"` opens Customize in a pane at the list's right edge. For another arrangement, `ListRoot`
142
+ holds the list's state and ViewKit's parts (`ListToolbar`, `ListGrid`, `ListBulkBar`) stand where you put them;
143
+ `ListSlot` and `ListFill` draw one outside the list's tree, in your page's header ([A list's root](reference/list.md#a-lists-root)).
144
+
145
+ ## Your theme
146
+
147
+ The stylesheet's rules sit in `components › viewkit`, a layer inside `components`, and the file declares Tailwind's
148
+ order (`theme, base, components, utilities`), so your components rules and utilities win over ViewKit's whatever the
149
+ order you import in. Its reset touches only ViewKit's elements and what your components draw inside them, in
150
+ `base › viewkit`, under your own base styles. The defaults are the Outright look, light, and dark under `.dark` or
151
+ `[data-theme="dark"]`. ViewKit's classes still carry Tailwind's names (`h-8`, `rounded-md`): where your own Tailwind
152
+ writes one, yours wins on ViewKit's element too, until each piece moves to its own `vk-*` classes.
153
+
154
+ An app whose reset or styles sit in no layer (Tailwind 3, a plain CSS reset) imports
155
+ `viewkitjs/views/styles.unlayered.css` instead: only ViewKit's classes sit outside any layer; its reset stays in
156
+ `base › viewkit`, its `--vk-*` defaults in `components › viewkit`, and Tailwind's fallbacks for browsers without
157
+ `@property` in `properties`, so your own reset and colours still win. It declares no layer order: a Tailwind 4 app takes
158
+ `styles.css`.
159
+
160
+ **Make the colours yours (optional).** Declare the colours in no layer, or in a layer above `components`. On stock shadcn
161
+ tokens:
162
+
163
+ ```css
164
+ :root {
165
+ --vk-fg: var(--foreground);
166
+ --vk-fg-subtle: var(--muted-foreground);
167
+ --vk-fg-subtlest: var(--muted-foreground);
168
+ --vk-fg-brand: var(--primary);
169
+ --vk-fg-selected: var(--primary);
170
+ --vk-fg-on-brand: var(--primary-foreground);
171
+ --vk-ground: var(--background);
172
+ --vk-overlay: var(--popover);
173
+ --vk-hovered: var(--accent);
174
+ --vk-pressed: var(--accent);
175
+ --vk-neutral: var(--muted);
176
+ --vk-neutral-hovered: var(--accent);
177
+ --vk-brand: var(--primary);
178
+ --vk-brand-subtlest: color-mix(in oklab, var(--primary) 12%, var(--background));
179
+ --vk-danger: var(--destructive);
180
+ --vk-danger-subtlest: color-mix(in oklab, var(--destructive) 12%, var(--background));
181
+ --vk-border: var(--border);
182
+ --vk-border-subtle: var(--border);
183
+ --vk-border-bold: var(--ring);
184
+ --vk-border-brand: var(--primary);
185
+ }
186
+ ```
187
+
188
+ `.dark` needs nothing more. The status and category hues (`--vk-success`, `--vk-label-blue`, …) are optional
189
+ ([Tokens](contract.md#tokens)); `--vk-gutter`, onto your pages' side padding, lines the grid's rows up with them.
190
+
191
+ **Or let your Tailwind compile it.** A Tailwind 4 app can draw ViewKit on its own scale: leave the import out and add,
192
+ to the stylesheet that imports Tailwind, `@source "../../node_modules/viewkitjs/views";` (the path from where it sits),
193
+ then `@import "viewkitjs/views/grid.css";` after Tailwind for the grid's look. Every button, input and link ViewKit
194
+ draws resets itself, so no base reset is needed. Nothing then declares ViewKit's tokens for you: the colour block above
195
+ is required, the grid's look tokens (`VK_GRID_TOKENS`) and, with `CONTROLS`, every one of the controls' tokens
196
+ (`VK_CONTROL_TOKENS`: spacing, type, radii, motion, shadows, the status tints), which the controls read with no
197
+ fallback. Their defaults are the `:where(:root)` blocks of `viewkitjs/views/styles.css`: copy them, or the controls
198
+ draw unstyled.
199
+
200
+ From here, [getting started](getting-started.md) builds a grid by hand, from the provider up.
@@ -4,7 +4,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
4
4
 
5
5
  ## The defaults
6
6
 
7
- - `CONTROLS` — the components map's defaults, for each control an app leaves out: each control below that fills a slot of the map. An app spreads it first and its own controls after, `components={{ ...CONTROLS, ...own }}`. Handed as it stands, `components={CONTROLS}`, it brings `CONTROL_ATOMS` too, under the provider's `atoms`; a map spread from it brings none. Its `Button` draws ViewKit's buttons (`variant`, `size`) as the kit's Button's kinds and sizes, stands a glyph handed before the words as the Button's icon, and one handed after them as its end icon. Its `AppIcon` draws ViewKit's own glyph of each name (`CONTROL_ICONS`), and nothing for a name it doesn't draw; a provider handed no `icons` draws every meaning through it. Its `Markdown` draws the stored text as it stands, its line breaks kept, with no renderer. Its `Button`, `Select`, `Menu`, `Popover` and `Input` are ViewKit's own: named in the provider's `panelControls`, they still draw the panels exactly as without it.
7
+ - `CONTROLS` — the components map's defaults, for each control an app leaves out: each control below that fills a slot of the map. Handed as it stands, `components={CONTROLS}`, it brings `CONTROL_ATOMS` too, under the provider's `atoms`. An app spreads it first and its own controls after, and hands the atoms beside it, which a spread doesn't carry: `components={{ ...CONTROLS, ...own }} atoms={CONTROL_ATOMS}` (or `{{ ...CONTROL_ATOMS, ...yours }}`). Without them the toolbar draws ViewKit's plain button and the Toolbar's look options stop applying; in development the provider says so once, where a map spread from `CONTROLS` comes with no atoms of the kit's and no `ToolbarButton` of yours. Its `Button` draws ViewKit's buttons (`variant`, `size`) as the kit's Button's kinds and sizes, stands a glyph handed before the words as the Button's icon, and one handed after them as its end icon. Its `AppIcon` draws ViewKit's own glyph of each name (`CONTROL_ICONS`), and nothing for a name it doesn't draw; a provider handed no `icons` draws every meaning through it. Its `Markdown` draws the stored text as it stands, its line breaks kept, with no renderer. Its `Button`, `Select`, `Menu`, `Popover`, `Input` and `Calendar` are ViewKit's own: named in the provider's `panelControls`, they still draw the panels and the field editors exactly as without it.
8
8
  - `CONTROL_ICONS` — ViewKit's default glyphs by meaning, a `ViewsIcons` over every `ICON_NAMES` meaning, each a Tabler icon as the Outright kit draws it (a line of 2 in the colour of its words; the carets filled; `loading` the Spinner): what `CONTROLS.AppIcon` draws, for an app with an `AppIcon` of its own that keeps ViewKit's glyphs, `icons={CONTROL_ICONS}`.
9
9
  - `leadingGlyph` — `leadingGlyph(children, glyphs)`: a glyph before a button's words (an svg, or one of the app's icons or its `AppIcon` in `glyphs`) as `icon`, one after them as `iconEnd`, and the words as `label`; a glyph alone, or another component, stays `{ label }`.
10
10
 
@@ -83,7 +83,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
83
83
 
84
84
  ## The bottom Sheet
85
85
 
86
- - `Sheet` — what rises from the bottom of the phone, in a `form` (`full`, `floating`, `blend`, `edge`) and at `stops`, on Base UI's drawer: the drag, focus, Escape and the dim, and a settle on a spring that starts from the finger's speed. What it holds is poured in. `standing` keeps it in its `container`, a screen on a page. It says why it closed. `CONTROLS.Sheet` draws ViewKit's sheets with it, the editor's ✕ (or Back) and ✓ in its head; its height is the `snap` asked (`auto` the `edge` form, as tall as its content; `half` the `blend` form, opening at half; `peek` opening at the small stop; `full`, and none, to the top), a title that isn't words is drawn as handed (its name to screen readers still the label), `description` under the title and `className` on the sheet itself, a prop of the Sheet too.
86
+ - `Sheet` — what rises from the bottom of the phone, in a `form` (`full`, `floating`, `blend`, `edge`) and at `stops`, on Base UI's drawer: the drag, focus, Escape and the dim, and a settle on a spring that starts from the finger's speed. What it holds is poured in. `standing` keeps it in its `container`, a screen on a page. It says why it closed. `CONTROLS.Sheet` draws ViewKit's sheets with it, the editor's ✕ (or Back) and ✓ in its head; its height is the `snap` asked (`auto` the `edge` form, as tall as its content; `half` the `blend` form, opening at half; `peek` opening at the small stop; `full`, and none, to the top), a title that isn't words is drawn as handed (its name to screen readers still the label), `description` under the title and `className` on the sheet itself, a prop of the Sheet too; its own `data-slot` is drawn on its popup (a phone menu's sheet carries its menu's name).
87
87
  - `SheetProps` — its props.
88
88
  - `SheetChangeDetails` — why it opened or closed.
89
89
  - `SheetForm` — `full`, `floating`, `blend` or `edge`.
@@ -116,7 +116,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
116
116
  - `InputGroupButton` — a quiet Button inside the field, an icon-only square when it has no words.
117
117
  - `InputGroupSegment` — a segment of a value typed in parts (a day, a month), a spinbutton; `on` draws it on the brand's tint.
118
118
  - `InputGroupContext` — the group an Input stands in, for a box that frames its Input as the InputGroup does.
119
- - `pressGroup` — `pressGroup(event)`: a press on a box holding an Input taken as the InputGroup takes it.
119
+ - `pressGroup` — `pressGroup(event)`: a press on a box holding an Input taken as the InputGroup takes it; where the box holds no Input of ViewKit's (an app's own, bare inside it under `panelControls`), the cursor goes into its typed input.
120
120
  - `useAutofill` — a hook: `fill(false)` spreads what turns the browser's and the password managers' filling off on a box; `fill()` adds nothing.
121
121
  - `offWord` — `offWord(navigator)`: the word that turns autofill off in a browser, `language` in Chromium and Firefox, `off` in WebKit.
122
122
  - `autofillOff` — `autofillOff(word)`: what a box carries with its autofill off.
@@ -281,7 +281,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
281
281
 
282
282
  ## The Avatar
283
283
 
284
- - `Avatar` — who or what a row is about: a person a circle on their tone, a thing, the workspace or an agent a square, which a `colour` stands on one of the label hues (on a phone an agent's bold, the hue under a white letter, as an app's tile); `size` 16 to 64, a photo or logo by `src`, its kind's `icon`, `presence` or a `badge` on its corner.
284
+ - `Avatar` — who or what a row is about: a person a circle on their tone, a thing, the workspace or an agent a square, which a `colour` stands on one of the label hues (on a phone an agent's bold, the hue under a white letter, as an app's tile); `size` 16 to 64, a photo or logo by `src`, which always wins, its object's `icon` (on a person or a thing drawn by the frame's `mark`, `ground` and `icon-colour`, `AVATAR_LOOKS`; the workspace's and an agent's own mark), `presence` or a `badge` on its corner.
285
285
  - `AvatarProps` — its props.
286
286
  - `AvatarSize` — its sizes, 16, 20, 24, 32, 40, 56 and 64; a stack takes neither 16 nor 56.
287
287
  - `AvatarColour` — a square's own colour: blue, green, amber, red, purple, pink, teal or grey, the Option's list; the square on the hue's fill, what it holds in its strong ink, with no edge.
@@ -307,7 +307,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
307
307
  - `PickerLead` — the row that leads, where its field leads several.
308
308
  - `PickerBoxSearch` — what a box that is its search is handed: its keys and what it holds.
309
309
  - `PickerItem` — a row handed to it: its value, words, second line, group, level, menu, count, the words its search also finds (`also`), and its public name (`slot`, a `PartSlot`, VK-988).
310
- - `PickerAs` — what a row is drawn as: an Option, a Status, an Avatar, a sign or a mark.
310
+ - `PickerAs` — what a row is drawn as: an Option, a Status, an Avatar (its `kind` the record's kind as the app names it, handed to the app's Avatar atom, VK-1044), a sign, a mark, or a chip drawn in place of its words (`{ chip }`: a field's option as its cell draws it).
311
311
  - `PickerRow` — a row its list shows.
312
312
  - `RowsInput` — what its rows are worked out from.
313
313
  - `pickerRows` — what its list shows: the empty row, the headings, the matches, Create, loading more.
@@ -328,7 +328,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
328
328
  - `SelectProps` — its props.
329
329
  - `SelectListProps` — its props with a list of its own.
330
330
  - `SelectAloneProps` — its props alone, owning no list.
331
- - `SelectItem` — a choice.
331
+ - `SelectItem` — a choice; `avatar` says its mark is the app's own Avatar atom, which a typed field's chip draws again at `chip` (ViewKit's own Avatar is drawn again at 16 with no flag, VK-1044).
332
332
  - `SelectShown` — the Select standing open in a page, its list under it.
333
333
  - `SelectShownProps` — its props.
334
334
  - `toPickerItems` — a Select's choices as the Picker's rows.
@@ -357,6 +357,8 @@ A list's panel at its right edge, on a computer, on Base UI's dialog, not modal:
357
357
  - `PaneState` — what stands in it, by its key, and what opened it last.
358
358
  - `PanePress` — a press on an opener, or a close from inside.
359
359
 
360
+ `CONTROLS.Pane` is the components map's `Pane` (`ViewsPaneProps`, VK-1026): this shell, where a toolbar with `customizeIn: "pane"` opens Customize on a computer, in the list's box it is handed (as tall as that box: give the list a height of its own, as a flex column, or it is as tall as every row), the focus going back to the part's button as it closes from inside. It is internal: `CONTROLS` is the way in.
361
+
360
362
  ## The toolbar button
361
363
 
362
364
  What stands in a toolbar: the view switcher, View settings, the sort, each filter on the filter bar, a phone's round buttons. It is the Button, on Base UI's Toolbar button inside a toolbar: its ground picks the Button's kind (ghost the quiet, bordered the outline, filled the soft), its size the Button's height, its words whether it is icon-only, so every Button option an app sets reaches it. Its own options are read off the frame around it (`data-toolbar-button-<option>`), a computer's or a phone's, and change as the frame's attributes change; what it holds can say otherwise for itself. Nothing set, it is bordered, 32, its icon and word on a computer, and filled, 36, round, its icon alone on a phone. Its stylesheet is `viewkitjs/views/controls/toolbar-button.css`, after the Button's; its options and looks are `TOOLBAR_BUTTON_LOOKS`. ViewKit's own toolbar draws its `ToolbarButton` atom, which `CONTROL_ATOMS.ToolbarButton` draws with this control, under `components={CONTROLS}` or `atoms={CONTROL_ATOMS}`; an app with neither keeps ViewKit's own button.
@@ -388,7 +390,7 @@ What a list's sort opens, Attio's: the view's rules in order, the first sorting
388
390
  - `SortEditor` — the body alone, for a shell that holds only a body (the Popover, Customize's Sort): its props are `SortEditorProps`.
389
391
  - `useSortEditor` — the editor's state and its parts (`SortEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`SortEditorProps`): `label`, the `fields` (Picker rows, each with its mark; one leading one level in holds its own), the `rules`, `onRulesChange` (the whole rules, and the set-aside sorts left when one of them is written), `max`, `form` (`computer`, `phone`, or `narrow`: the phone's structure at a computer's sizes, for a narrow place), `onDone`, the fields' `search` words, `aside` (the sorts set aside, `SortAside`s), `fieldOf` (the field a sort key sorts, so a place sorts once by one of its parts), `addSort` (Add sort at a computer's foot, true unless said), `words`, and for a page standing still `lifted`, `opens` (`SortEditorOpens`) and `level`. On a computer each rule is its grip, its field's and its direction's Select, and ×, with Add sort and Clear all sorts at the foot; the set-aside sorts follow, each its field's box dashed in the warning colour with why, its direction greyed, ⋯ holding why, Put back and Delete. On a phone each rule is a card row, its direction under its name; a press turns the body to its direction, Add sort to the fields, a set-aside sort's row to the fields to point it at one: steps of the same sheet, never a sheet on top. The body answers no Escape: its holder's sheet does. Its hook joins this door as `useSortEditor`, and the body alone as `SortEditor`, once VK-727 retires the panels' older sort editor of those names.
390
392
  - `useSortEditorParts` — `useSortEditor`, under its name before the body took the plain one; kept.
391
- - `SortEditorProps` — its props.
393
+ - `SortEditorProps` — its props; `clearAll` (default on) draws Clear all at its foot, off inside Customize.
392
394
  - `SortEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
393
395
  - `SortEditorOpens` — what a page shows standing open: a rule's field or direction, by its place.
394
396
  - `sortableFields` — the fields as the list's Sort offers them to add a rule: those another rule sorts greyed with "Sorted", one level in too.
@@ -463,13 +465,13 @@ What an advanced filter opens on a computer and Filter on a phone, Attio's: the
463
465
  - `FilterEditor` — the body alone, for a shell that holds only a body (the Popover): its props are `FilterEditorProps`.
464
466
  - `useFilterEditor` — the editor's state and its parts (`FilterEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`FilterEditorProps`): `label`, the `fields` (each typed, a choice's values with it; one leading one level in holds its own), the `filter`, `onFilterChange`, `at`, `ids`, `levels`, `form` (`computer`, `phone`, or `narrow`), `onDone`, `standing`, `own` (ViewKit's own words and value body for a rule the kit has no box for), `excludable` (whether the filter itself may exclude its matches: an advanced filter's own group, its foot then holding a group's ⋮ too) and `words`. On a phone each box's list, a date, a value ViewKit draws, Add filter, a block's quantifier and a rule's or a group's ⋯ turn the body to a step of the same sheet, never a sheet on top; the body answers no Escape: its holder's sheet does. Its hook joins this door as `useFilterEditor`, and the body alone as `FilterEditor`, once VK-727 retires the panels' older filter editor of that name.
465
467
  - `useFilterEditorParts` — deprecated: `useFilterEditor`, under its name before the body took the plain one.
466
- - `FilterEditorProps` — its props.
468
+ - `FilterEditorProps` — its props; `clearAll` (default on) draws Clear all at its foot, off inside Customize.
467
469
  - `FilterEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
468
470
  - `FilterOwn` — ViewKit's own words and value body for a rule: its field's words, its way's word, its value's words, its value body.
469
471
  - `FilterPartBody` — what a part of a filter on the bar opens: the fields, its type's ways, or its value in its type's own.
470
472
  - `FilterPartProps` — its props: `part`, `rule`, `label`, `fields`, `filter`, `onFilterChange`, `onDone`, `own`, `form` and `words`.
471
473
  - `FilterPart` — which part was pressed: `field`, `how` or `value`.
472
- - `PairValue` — a range's From and To: two Number fields, an en dash between.
474
+ - `PairValue` — a range's From and To: two number boxes (the Number field, or the app's Input under `panelControls`), an en dash between.
473
475
  - `valuePlaceholder` — what a filter's value says while it has none, by its field's type.
474
476
  - `FILTER_SEARCH` — the fields' search, in English.
475
477
  - `HOW` — each type's ways, in the order they are offered, the first a new rule's.
@@ -546,10 +548,10 @@ What Customize's Group opens: the list's group as the Menu list's rows. Group by
546
548
 
547
549
  ## Customize
548
550
 
549
- What View settings opens: the view's sections as the Menu list's rows, Layout, Columns, then each of Filter, Sort and Group it is handed, each saying where it stands and opening its screen in place, then its toggles (Show counts among them). Layout is the layout cards and the layout's own settings: its pick-one settings (a density, a board's field) each opening its choices in place, its toggles under their sections with a toggle's way back, and For you with its own. Columns is a search, the shown columns, each its grip, its mark, its name and its Switch, dragged into place, the first one locked, the hidden ones under Hidden, Hide all, Reset columns and Show all at the headings. A column with settings of its own or the app's rows for its field carries a › after its Switch, opening its level in Columns' place: Shown, its pick-one settings each opening in place, its toggles under their sections, then the app's rows; on a card layout each field carries its new-line Toggle, refused with its reason on the card's first field and a hidden one; and the app's rows under Columns' rows (Add field) stand at its foot. A list's per-field filters stand as rows after Columns and its time range and date ranges after Group, each saying what it holds and opening its screen (choices to pick one of, choices to check, or a body of its own with its level), or, folded, all behind one Filter row. Its head is the view's name renamed in place, or a title, as its options say; its footer, Copy link and Export CSV, each where handed; Reset and Save over it once something changed, with the shared view's stale note. A body: on a computer the Pane holds it where an app hands a Pane, and elsewhere (the toolbar's popover) it draws the same head, body and foot in a frame of its own; on a phone it hands the Sheet its head and foot, each section's step under that one head. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/customize.css`; its options are `CUSTOMIZE_LOOKS`; its root marks a phone from the device (`data-vk-phone`).
551
+ What View settings opens: the view's sections as the Menu list's rows, Layout, Columns, then each of Filter, Sort and Group it is handed, each saying where it stands and opening its screen in place, then its toggles (Show counts among them). Layout is the layout cards (none on a phone offered one layout) and the layout's own settings: its pick-one settings (a density, a board's field) each opening its choices in place, and its toggles under their sections, with nothing after them. A section that differs from the view as saved shows its value in the brand (`differs`, and the sections' own `inForce`), a section at rest in the normal colour. Each section's screen (Layout, Columns, Filter, Sort, Group) carries its own Reset while it is handed one (`resets`), in the first page's Reset's word and look and place, never on a level the screen opened in place; inside Customize the sort's and the filter's own Clear all give way to it. Columns is a search, the shown columns, each its grip, its mark, its name and its Switch, dragged into place, the first one locked, the hidden ones under Hidden, Hide all and Show all at the headings. A column with settings of its own or the app's rows for its field carries a › after its Switch, opening its level in Columns' place: Shown, its pick-one settings each opening in place, its toggles under their sections, then the app's rows; on a card layout each field carries its new-line Toggle, refused with its reason on the card's first field and a hidden one; and the app's rows under Columns' rows (Add field) stand at its foot. A list's per-field filters stand as rows after Columns and its time range and date ranges after Group, each saying what it holds and opening its screen (choices to pick one of, choices to check, or a body of its own with its level), or, folded, all behind one Filter row. Its head is the view's name renamed in place, or a title, as its options say; its footer, Copy link and Export CSV, each where handed; Reset and Save over it once something changed, with the shared view's stale note. A body: on a computer the Pane holds it where an app hands a Pane, and elsewhere (the toolbar's popover) it draws the same head, body and foot in a frame of its own; on a phone it hands the Sheet its head and foot, each section's step under that one head. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/customize.css`; its options are `CUSTOMIZE_LOOKS`; its root marks a phone from the device (`data-vk-phone`).
550
552
 
551
553
  - `Customize` — the body alone, for a shell that holds only a body: its props are `CustomizeProps`.
552
- - `useCustomize` — its state and its parts (`CustomizeParts`): the `body`, the `level` it stands on (a layout's choice, a column's settings, a section's level) or `null`, and on a phone the Sheet's `title`, `head` (Back and ✕) and `foot`. Its props (`CustomizeProps`): the `view`, `onViewChange` (the whole view, each change as it is made), the `layouts`, the `filter`, `sort` and `group` sections, `changed` with `onReset` and `onSave`, `pending`, `stale`, `exportCount` with `onCopyLink` and `onExport`, `toggles`, `layoutSettings`, `columnsReset`, `onLineChange` (a card's field starting a new line, turned on or off), `columnsFoot` (the app's rows under Columns' rows), `fields` and `foldFields` (a list's per-field filters, its time range and date ranges, `CustomizeField`), `onClose` (outside a Pane, the title head's ✕), `onScreenChange`, `words`, `form`, and for a page standing still `screen`. The body alone, `Customize`, joins this door with VK-727, beside the other panels' bodies.
554
+ - `useCustomize` — its state and its parts (`CustomizeParts`): the `body`, the `level` it stands on (a layout's choice, a column's settings, a section's level) or `null`, and on a phone the Sheet's `title`, `head` (Back and ✕) and `foot`. Its props (`CustomizeProps`): the `view`, `onViewChange` (the whole view, each change as it is made), the `layouts`, the `filter`, `sort` and `group` sections, `changed` with `onReset` and `onSave`, `pending`, `stale`, `exportCount` with `onCopyLink` and `onExport`, `toggles`, `layoutSettings`, `resets` (each section's own Reset), `differs` (a section that differs from the view as saved, its value in the brand: Layout and Columns marked only where handed, VK-1048), `columnsReset` (deprecated: read as `resets.columns`), `onLineChange` (a card's field starting a new line, turned on or off), `columnsFoot` (the app's rows under Columns' rows), `fields` and `foldFields` (a list's per-field filters, its time range and date ranges, `CustomizeField`), `onClose` (outside a Pane, the title head's ✕), `onScreenChange`, `words`, `form`, and for a page standing still `screen`. The body alone, `Customize`, joins this door with VK-727, beside the other panels' bodies.
553
555
  - `useCustomizeWorn` — its options as the frame round it wears them, kept up to date as they change.
554
556
  - `layoutMark` — a layout's mark by its id: table, board, list, calendar, timeline.
555
557
  - `CustomizeProps` — its props.
@@ -674,7 +676,7 @@ What the quick filters' button opens, the Outright kit's (after Linear's): a str
674
676
  - `QuickFiltersProps` — its props.
675
677
  - `QuickField` — a field it offers: its id, its name in the strip, its values, what its search says.
676
678
  - `QuickValue` — a value: its key, its words, its mark, its count.
677
- - `QuickMark` — a value's mark: a status's place (a step between at its quarters), or a person's or a company's face.
679
+ - `QuickMark` — a value's mark: a status's place (a step between at its quarters), or a person's or a company's face, its `src` and `kind` handed only to the app's Avatar atom (VK-1044).
678
680
  - `QuickHolds` — what is held: each field's held values by its id.
679
681
  - `QuickHolding` — one at a time in all, or several.
680
682
  - `QuickPress` — a press: the field and the value held or let go.
@@ -687,7 +689,7 @@ What the quick filters' button opens, the Outright kit's (after Linear's): a str
687
689
  - `QUICK_FILTERS_ATTRS` — the attribute it watches, so an option changed while it is open reaches it.
688
690
  - `QUICK_FILTERS_WORDS` — its English words.
689
691
  - `quickFiltersWords` — the words handed, each left out the English.
690
- - `QuickFiltersWords` — its words: the strip's name, a field's search, Clear filter, and what a search that finds nothing says.
692
+ - `QuickFiltersWords` — its words: the strip's name, a field's search, Clear filter, what a search that finds nothing says (`none`), and what a field with nothing to pick says (`nothing`).
691
693
 
692
694
  ### The reminder
693
695
 
@@ -701,12 +703,14 @@ On a phone, a pill at the list's foot naming what quick filters hold while they
701
703
 
702
704
  ## The Toolbar
703
705
 
704
- The Outright kit's Toolbar, on Base UI's toolbar: the row and, under it, the filter bar, a step smaller; on a phone one line. Tab reaches the whole of it once, the arrows run through its lines and loop, Home and End reach its ends; in a text box the arrows move the caret and step out at its ends. Handed a list's places (`views`, `settings`, `search`, `add`, `sort`, `filter`, `filters`, `quick`, `save`), it stands each where its options pick (`TOOLBAR_LOOKS`, worn as `data-toolbar-*` on the frame round it): View settings beside the views or on the row's right, the sort and Filter on the bar or on the row's right, the filter bar always or once something is added (`added`), lines across or none, Clear and Save on the bar or in View settings, New in its form, the quick filters' button or none; on a phone the sort, Filter, the quick filters' icon and View settings beside the views or on the right, the search a button or its own line. A place may be a function of where it stands (`ToolbarAt`: `row`, `right`, `bar`, `phone`). Handed no places, it is its `children` (the row) and `bar` (the filter bar), as any row of controls. What doesn't fit gives way, each line on its own, from its end: words to icons, then the view tabs into "+N", the filters into "+N filters", then the rest into ⋯, a Menu; a line holds while a Menu holding what folded stands open, or while its holder says `holds`. What never folds: a toolbar button marked `stays`, and the Button (New). Handed `fill`, the row's worded buttons grow to share it, the square ones keeping their width, and as it narrows the first worded button with an icon keeps its words while the others give theirs up and fold, giving way itself last; the filter bar draws as without. Handed `more`, ⋯ stands at the row's end holding those entries, what folds joining them in the row's order (an empty list: ⋯ there once something folds). Each line's height is its toolbar buttons' (the toolbar button's Size, a phone's its own), given to the Buttons, the Toggle group and the text box in it. Every word it says of its own is handed (`words`). Its stylesheet is `viewkitjs/views/controls/toolbar.css` ([its tokens](../controls/toolbar.md)).
706
+ The Outright kit's Toolbar, on Base UI's toolbar: the row and, under it, the filter bar, a step smaller; on a phone one line. Tab reaches the whole of it once, the arrows run through its lines and loop, Home and End reach its ends; in a text box the arrows move the caret and step out at its ends. Handed a list's places (`views`, `settings`, `search`, `add`, `sort`, `filter`, `filters`, `quick`, `save`), it stands each where its options pick (`TOOLBAR_LOOKS`, worn as `data-toolbar-*` on the frame round it): View settings beside the views or on the row's right, the sort and Filter on the bar or on the row's right, the filter bar always or once something is added (`added`), lines across or none, Clear and Save on the bar or in View settings, New in its form, the quick filters' button or none; on a phone the sort, Filter, the quick filters' icon and View settings beside the views or on the right, the search a button or its own line. A place may be a function of where it stands (`ToolbarAt`: `row`, `right`, `bar`, `phone`). Handed no places, it is its `children` (the row) and `bar` (the filter bar), as any row of controls. What doesn't fit gives way, each line on its own, from its end: words to icons, then the view tabs into "+N", the filters into "+N filters", then the rest into ⋯, a Menu; a line holds while a Menu holding what folded stands open, or while its holder says `holds`. What never folds: a toolbar button marked `stays`, and the Button (New). ⋯ is yours where you hand it (`overflow`): your glyph, your class, or your whole button, handed the props the Toolbar's own would get; so are "+N" (`moreViews`) and "+N filters" (`moreFilters`): your class, or your whole button. It is the bar above a list and nothing else: a row of a page's actions (a record's) is your own, on your Button. Each line's height is its toolbar buttons' (the toolbar button's Size, a phone's its own), given to the Buttons, the Toggle group and the text box in it. Every word it says of its own is handed (`words`). Its stylesheet is `viewkitjs/views/controls/toolbar.css` ([its tokens](../controls/toolbar.md)).
705
707
 
706
708
  Its frame and its separator are `ToolbarControl` and `ToolbarSeparatorControl`: `viewkitjs/views/panels/react` already names the ready toolbar's frame `Toolbar` and its separator `ToolbarSeparator`, and one package holds no two public names alike. The ready toolbar keeps its own frame.
707
709
 
708
- - `ToolbarControl` — the Toolbar. Its props, `ToolbarProps`: `label` (its name to a screen reader), `children` and `bar`, the places above, `added`, `picks` (its options over the frame's), `barLabel`, `size` and `barSize` (`28`, `32` or `36`), `spacing` (in spacing steps), `fold` (default on), `holds`, `fill` (the row's worded buttons share it), `more` (Menu entries ⋯ always holds at the row's end), `form` (`computer` or `phone`; by default a phone's in a phone's window or a `PhoneHost`), `onMoreViews` and `moreViewsOpen` (where its holder opens what "+N" opens), `words`, `className`, `style`, and Base UI's toolbar's own. Its width is its holder's to give: sized from what it holds in a pill (the bulk bar, the quick filters' reminder), so a holder that draws it as a list's toolbar gives it its width (a flex item with `min-width: 0`), or its row never runs out of room to fold.
710
+ - `ToolbarControl` — the Toolbar. Its props, `ToolbarProps`: `label` (its name to a screen reader), `children` and `bar`, the places above, `added`, `picks` (its options over the frame's), `barLabel`, `size` and `barSize` (`28`, `32` or `36`), `spacing` (in spacing steps), `fold` (default on), `holds`, `overflow` (`ToolbarOverflowControl`: ⋯ as you draw it), `moreViews` and `moreFilters` (`ToolbarMoreControl`: "+N" and "+N filters" as you draw them), `form` (`computer` or `phone`; by default a phone's in a phone's window or a `PhoneHost`), `onMoreViews` and `moreViewsOpen` (where its holder opens what "+N" opens), `words`, `className`, `style`, and Base UI's toolbar's own. Its width is its holder's to give: sized from what it holds in a pill (the bulk bar, the quick filters' reminder), so a holder that draws it as a list's toolbar gives it its width (a flex item with `min-width: 0`), or its row never runs out of room to fold.
709
711
  - `ToolbarProps` — its props.
712
+ - `ToolbarOverflowControl` — ⋯ as you draw it: `icon` (your glyph over ViewKit's dots), `className` (put on it) and `button` (your button, drawn in its place and handed the very props the Toolbar button would get, `ref` and what its Menu sets to open from it included: spread them on yours). Absent, ViewKit's own ⋯.
713
+ - `ToolbarMoreControl` — "+N" or "+N filters" as you draw it: `className` (put on it) and `button` (your button, drawn in its place and handed the very props the Toolbar button would get, `ref`, its words and what its Menu, or `onMoreViews`, sets to open from it included: spread them on yours). Absent, ViewKit's own.
710
714
  - `ToolbarPlace` — a place: what it draws, or a function of where it stands.
711
715
  - `ToolbarAt` — where a place stands: `row`, `right`, `bar` or `phone`.
712
716
  - `ToolbarSeparatorControl` — a line between what belongs together and what doesn't.
@@ -715,7 +719,7 @@ Its frame and its separator are `ToolbarControl` and `ToolbarSeparatorControl`:
715
719
  - `ToolbarInputProps` — its props: the Input's, `icon`, and `words`: `"both"` shows "Search" beside the shut search's icon as the buttons on the right show their words (the Toolbar's "Buttons on the right"; on a phone its icon alone); absent or `"icon"`, its icon alone, as Mihai's look stands it.
716
720
  - `ToolbarFolds` — filters or view tabs a holder draws itself, standing in a line: the line folds them one at a time among its own (`kind`, `filters` or `tabs`; `count`) and hands `children` how many are folded.
717
721
  - `ToolbarFoldsProps` — its props.
718
- - `toolbarSteps` — the steps a line takes as it narrows, in order (`fill` as its second argument), for a holder's test.
722
+ - `toolbarSteps` — the steps a line takes as it narrows, in order, for a holder's test.
719
723
  - `useToolbarWorn` — its options as worn round an element, kept up to date as they change.
720
724
  - `toolbarWornOf` — its options as the frame round an element wears them, each its default where nothing sets it.
721
725
  - `TOOLBAR_ATTRS` — the attributes it watches.
@@ -785,7 +789,7 @@ Its stylesheet is `viewkitjs/views/controls/text-editor.css`, beside the inline
785
789
 
786
790
  `CONTROLS` fills its `Picker` with the Picker: ViewKit's select, status, several-values, relation and set editors open it, handed their rows as data, the panel round it keeping the draft and, on a phone, its ✕ and ✓, so the Picker is told the shell keeps them and hands every change. Its words are ViewKit's `views.picker.*` messages, so an app's own words reach it. A status field's steps come as `steps`: an archived option held stands outside them, as its cell draws it. It fills its `FieldsBody` with the Picker too: the sort's and the filter's field lists, each field its column's glyph, one that can't be picked greyed with why, a relation under Related records with its far fields one level in. The Picker's stylesheet, `viewkitjs/views/controls/picker.css`, stands on the Avatar's, the Button's, the Checkbox's, the Glass button's, the Input's, the Kbd's, the Menu's, the Option's, the Spinner's, the Status's, the Sheet's, the scrollbar's, the list's and the popup line's.
787
791
 
788
- - `pickerItemsOf` — ViewKit's rows (`ViewsPickerItem`) as the Picker's: an avatar, the record's glyph, a status at its place (its quarters among `steps` when handed), an option, or the app's icon (handed `AppIcon`). For an app's own list in the Picker; the editors' own `pickerItemOf` is another, internal one.
792
+ - `pickerItemsOf` — ViewKit's rows (`ViewsPickerItem`) as the Picker's: an avatar, the record's glyph, a status at its place (its quarters among `steps` when handed), an option, or the app's icon (handed `AppIcon`). Handed `cells: true`, as `CONTROLS.Picker` hands it, a status and an option are drawn as their cells draw them: your `StatusBadge` and `Tag` atoms, in the option's colour (a chip row, `as: { chip }`). For an app's own list in the Picker; the editors' own `pickerItemOf` is another, internal one.
789
793
 
790
794
  ## The Date editor
791
795
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  Import from `viewkitjs/views/editors/range` in a client component: the door opens with the client directive. It holds the editor of a `range` field, which opens your app's `PartsBody` as `kind: "range"` (`CONTROLS.PartsBody` is ViewKit's own, the Compound editor): two ends, low and high. An empty end is an open end. It owns the draft and what a close means; the body draws; its host owns the popover (the grid's and the field row's open it under the value), the write, and keeping the pair in its own columns. It commits a `RangeValue` of `viewkitjs/fields`, `{ low, high }`, each a number or null. Guide: [editors](../guides/editors.md).
4
4
 
5
- - `RangeEditor` — the range panel; its ref is a `RangeEditorHandle`. It takes `initial` (the stored range, or null) and `onRequestClose`, and optionally `seed` (the character that opened the editor, replacing the low end), `decimals` (default 0), `allowEmpty`, `suffix` (a unit drawn after the high end, such as `%` or a currency code), `conventions` (how a typed seed is read; default: the provider's), `bands` (the field's `presets`) and `label` (the field's name, for your `PartsBody`; default the two ends' words). It hands the body the two ends, `decimals`, the `suffix` as `unit`, and the `bands` for the body to draw as picks (a band picked closes as `pick`, so it is read and judged as typed ends are). It keeps the draft, rounds the ends to `decimals` as it closes, and draws no refusal of its own: your panel draws it. Escape, Tab and the close are the body's frame's: Escape is taken before the body hears it, and Tab walks the body and closes from either end.
5
+ - `RangeEditor` — the range panel; its ref is a `RangeEditorHandle`. It takes `initial` (the stored range, or null) and `onRequestClose`, and optionally `seed` (the character that opened the editor, replacing the low end), `decimals` (default 0), `allowEmpty`, `suffix` (a unit drawn after the high end, such as `%` or a currency code), `conventions` (how a typed seed is read; default: the provider's), `bands` (the field's `presets`), `label` (the field's name, for your `PartsBody`; default the two ends' words) and `min` and `max` (the field's limits, `numberBounds(field)`, which the grid's and a field row's range editors hand, VK-904). It hands the body the two ends, `decimals`, the `suffix` as `unit`, the `bands` for the body to draw as picks, and `min` and `max` where handed (a band picked closes as `pick`, so it is read and judged as typed ends are). It keeps the draft, rounds the ends to `decimals` as it closes, and draws no refusal of its own: your panel draws it. Escape, Tab and the close are the body's frame's: Escape is taken before the body hears it, and Tab walks the body and closes from either end.
6
6
  - `RangeEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. Escape cancels, and so does a seed that is not a number, left as typed. Both ends unchanged as the body showed them is a `noop`, so a stored 2.555 that opened as 2.56 writes nothing. Two empty ends cancel, or commit with `allowEmpty`. A low end above the high end commits as handed, for the host's acceptance to refuse in its own words.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Import from `viewkitjs/views/field-row` in a client component, under your `ViewsProvider`: the door opens with the client directive. It holds a record's field row: one field drawn as its label, its value and, on a click, its type's editor in place, and the write path that admits each edit at once, queues one record's writes, settles each on the save's receipt and rolls a failure back. The row knows no entity, only a binding, a value and a commit, so your app builds its record's panel (its sections, its related records) around the rows. It draws with your provider's `Popover`, `Sheet`, `Collapse`, `AppIcon`, icons, `CommandMenu` atom and toast port. The shapes its writes go through (the write target, the receipt, the admission, a value's note, the reconciliation error) are the root door's, described under [A write's target](views.md#a-writes-target), and this door re-exports them. Guide: [editors](../guides/editors.md).
4
4
 
5
- - `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Outside a Field rows card (below), below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money) in its own box on every width; a name and a range open your `PartsBody` anchored under the value, as a place does; and a single email or domain opens the value list holding one value, anchored, where the provider's `oneValue` says `list` for its type. Escape throws the edit away, unless the provider's `escape` keeps the field's type, on a desktop, where it keeps what was typed and a refusal stays open until a second Escape throws the edit away; a sheet's swipe or ✕ changes nothing. On a desktop the date editor opens with the keyboard in your `DateBody`, as a place's or a long select's does; and with an editor open in its popover, an Escape heard from the page itself or from an element holding the row closes that editor and goes no further, so a drawer around the row hears only the next one. On a desktop, a select gives your Picker the keys however it opened, by Enter, Space or a pointer: the focus in its search, the arrows going on from the value it holds, and Enter picking the one lit (opened by a key, an Enter at once changes nothing). As the editor takes the place of the row's button, the row holds the focus the button held until the editor takes it, so the focus never falls to the page: a dialog around the row that takes such a focus back to itself (Base UI's) leaves a text's or a number's editor open. On a desktop, an editor closed by Tab, Shift-Tab, Escape, Enter or a pick puts the focus back on the row's own button, once its exit has played out and a write still saving has saved, so the next Tab moves on from that row; a press or a focus outside an editor's panel since the close lets that go, so a row opened meanwhile keeps its editor, and an outside press leaves the focus where it put it. A relation saves what its row stores (an id, a ref with the picked record's kind, or a set of records with its lead); a date field has no time and offers No date where it may be empty; several values read a phone typed without its code in the binding's `region`. A value of several parts inside a writable row draws its count as plain text: the row's press opens the editor, which lists them all. A single email, phone, link or domain in a writable row reads as plain text too, with an open action beside the row's button (a mail, a call, the site), and a writable rich text lies over its button, so its links and "Show more" keep their own press while a press on its text edits. A money figure its host reads in another currency than the record's own (it hands the converted figure as `value` and that currency as `opts.currency`) is marked ≈ with the currency it came from, and its editor names it under the record's own amount. A boolean commits from its own control, a `command` field opens its verbs, and a read-only row draws a lock with its reason. A refused commit keeps the editor open with the reason under it, a saved value shows at once and stays until the receipt settles it, and a failed save rolls back with a retry. A text, an email, a phone, a link, a domain, long or rich text edits in place in the row; handed the components map's `TextBody`, the row opens it there, at every width, with the field's own check and the record's country. A number, money or a percent edits in place too; handed `NumberBody`, the row opens it there, at every width, with the field's own check and its limits (a duration keeps the editor's own box).
5
+ - `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Outside a Field rows card (below), below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money) in its own box on every width; a name and a range open your `PartsBody` anchored under the value, as a place does; and a single email or domain opens the value list holding one value, anchored, where the provider's `oneValue` says `list` for its type. Escape throws the edit away, unless the provider's `escape` keeps the field's type, on a desktop, where it keeps what was typed and a refusal stays open until a second Escape throws the edit away; a sheet's swipe or ✕ changes nothing. On a desktop the date editor opens with the keyboard in your `DateBody`, as a place's or a long select's does; and with an editor open in its popover, an Escape heard from the page itself or from an element holding the row closes that editor and goes no further, so a drawer around the row hears only the next one. On a desktop, a select gives your Picker the keys however it opened, by Enter, Space or a pointer: the focus in its search, the arrows going on from the value it holds, and Enter picking the one lit (opened by a key, an Enter at once changes nothing). As the editor takes the place of the row's button, the row holds the focus the button held until the editor takes it, so the focus never falls to the page: a dialog around the row that takes such a focus back to itself (Base UI's) leaves a text's or a number's editor open. On a desktop, an editor closed by Tab, Shift-Tab, Escape, Enter or a pick puts the focus back on the row's own button, once its exit has played out and a write still saving has saved, so the next Tab moves on from that row; a press or a focus outside an editor's panel since the close lets that go, so a row opened meanwhile keeps its editor, and an outside press leaves the focus where it put it. A Tab pressed while that exit plays (a Tab at once after a pick by the keys) is the person going on: it is taken from the row's button once the button is back, so the focus lands on the next control after the row (Shift-Tab, the one before), as a later Tab does. A relation saves what its row stores (an id, a ref with the picked record's kind, or a set of records with its lead); a date field has no time and offers No date where it may be empty; several values read a phone typed without its code in the binding's `region`. A value of several parts inside a writable row draws its count as plain text: the row's press opens the editor, which lists them all. A single email, phone, link or domain in a writable row reads as plain text too, with an open action beside the row's button (a mail, a call, the site), and a writable rich text lies over its button, so its links and "Show more" keep their own press while a press on its text edits. A money figure its host reads in another currency than the record's own (it hands the converted figure as `value` and that currency as `opts.currency`) is marked ≈ with the currency it came from, and its editor names it under the record's own amount. A boolean commits from its own control, a `command` field opens its verbs, and a read-only row draws a lock with its reason. A refused commit keeps the editor open with the reason under it, a saved value shows at once and stays until the receipt settles it, and a failed save rolls back with a retry. A text, an email, a phone, a link, a domain, long or rich text edits in place in the row; handed the components map's `TextBody`, the row opens it there, at every width, with the field's own check and the record's country. A number, money or a percent edits in place too; handed `NumberBody`, the row opens it there, at every width, with the field's own check and its limits (a duration keeps the editor's own box).
6
6
  - `FieldRowProps` — the row's props: `binding`, `row`, `value` (the display value), `editValue` (the stored value the editor opens on), `writable`, `ready` (false refuses gestures while the record loads), `unread` (the value isn't read yet, drawn blank), `refusal` (why it's read-only here), `onCommit` (admits or refuses a draft, then settles; an editor still open when the page or the row goes is asked as for a press outside, so it can be called inside `pagehide`), `opts` (display options), `menu` (a `command` field's verbs), `meta` (a few words in the value's line), `note` (a sentence under the value, with an optional quote a tap opens) and `kindIcon` (your icon name for a record kind, the glyph a relation's candidates wear; unanswered, they wear the type's glyph).
7
7
  - `RowEditor` — the editor a row mounts for its field's type, picked from `ROW_HOSTS`.
8
8
  - `ROW_HOSTS` — the host each field type mounts in a row, or `null` for a type the row never opens (a boolean, a derived or system field).
@@ -10,8 +10,9 @@ The spreadsheet. The door carries no client directive; every rendering file behi
10
10
  - Row actions and menus: `rowMenu` (a row's items, on right-click and in its ⋯ tail; the same builder a list takes), `contextMenu` (a right-click menu that differs from it), `rowActions` (buttons in the title cell's action lane, before the grid's own Edit), `onRowDelete` and `deleteLabel` (a delete row in the row's menu), `menus` (`GridMenus`: each of the grid's menus as data, reshaped by your function; `menus.row` is asked as a row's menu opens and may answer a promise, the menu waiting on one greyed row until it does, and holds Open page and Delete as `row-open` and `row-delete`, so a row's Delete is offered per row; the ready `<List>` (VK-742) hands the same `menus.row` through), `commands` (the verbs a `command` column's cell opens, by field key; without it a command column is a read-only badge) and `selection` (the list's selection; its optional `renderBar` draws the bar it opens, `SelectionBar` with your verbs, and without one the rows still tick and no bar is drawn).
11
11
  - Sort, group and figures: `sort` (`GridSortState`), `sortMark` (a sorted column's header wears `icons.sortAsc` or `icons.sortDesc` after its name; off by default, `aria-sort` saying it either way), `groupBy` (`GridGroupByState`: handed, a column's menu offers Group by and Ungroup, saved view or not), `sortOptions` (the group band menu's sort, as `GridGroupSortOption`s), `groupMenu` (the parts a group band's ⋯ holds, as `GridGroupMenuPart`s: `"select"` (Select all in group, on a grid with a `selection`), `"sort"`, `"figures"`, `"hide"`), `groupSummary` and `onGroupSummaryChange` (which figures ride beside a group's name), `groupFigures` (`GridGroupFigure`s), `countNoun` (`GroupCountNoun`), `aggregates`, `onAggregateChange` and `renderAggregate` (the footer's figure per column), `viewBacked` (a saved view: Sort on every bound column, and figures only for field-backed columns; it doesn't decide Group by) and `defaultCurrency` (the reader's currency, which a money column read as it was entered totals in).
12
12
  - Format overrides and their handlers, every map keyed by field key: `optionColors`, `dateStyles`, `durationStyles`, `numberFormats` (decimals null is the field's own), `showTimeOverrides` and `percentDisplays`, each with its `on…Change` handler taking the field key first, and `formatsWritable` (false hides the stored format knobs from the column menu; default true).
13
- - Columns and preferences: `columnState` and `onColumnStateChange` (order, widths, and which columns show), `renderAddColumn` (your own add-column cell at the header's end, or in the title column's header under `addColumnAt`; without it, or answering `undefined`, `false` or `""`, the grid's own lists the hidden columns; answering `null`, none is drawn and no room is kept for it), `addColumnOnPhone` ("+ Add column" on a phone too, its list in your `Menu`; off by default), `addColumnAt` (`"title"` stands "+ Add column" as a lone + at the right edge of the title column's header, in reach while the columns scroll, and the tail keeps no room for it; `"end"`, the default, the header row's last cell; with no title column shown it stands at the end), `phonePicking` (a phone picks rows by a long press, the boxes inside the name column before the picture, and always shown on a grouped grid, its titles row's box in the name column's head; needs `selection`; off by default), `parts` (a column per part of a name, a place or a range, offered under its field in "+ Add column"; off by default), `columnMenuItems` (your rows in a column's menu, as data, above Hide: the old route, which adds rows only; `menus.column` reshapes the whole menu), and the per-user toggles `freezeIdentity` (the identity columns, everything through the title, pinned at the left edge; on by default, on the bare prop, in `LIST_VIEW_PREF_DEFAULTS` (`gridFreezeIdentity`), in a view's look and in the grid's look alike; hand `false`, or start your prefs with `gridFreezeIdentity: false`, to open it unpinned), `alwaysCheckboxes`, `verticalBorders` and `scale`; and `headerVerticalBorders` (the header's columns ruled as the rows' are under `verticalBorders`, the last bare; off by default); and `fillWidth` (the columns share the grid's whole width, each in proportion to its own width and never below it, a column the person resized or one with a `grid.maxWidth` keeping its width; a table wider than the grid scrolls sideways as without it; off by default).
13
+ - Columns and preferences: `columnState` and `onColumnStateChange` (order, widths, and which columns show), `renderAddColumn` (your own add-column cell at the header's end, or in the title column's header under `addColumnAt`; without it, or answering `undefined`, `false` or `""`, the grid's own lists the hidden columns; answering `null`, none is drawn and no room is kept for it), `addColumnOnPhone` ("+ Add column" on a phone too, its list in your `Menu`; off by default), `addColumnAt` (`"title"` stands "+ Add column" as a lone + at the right edge of the title column's header, in reach while the columns scroll, and the tail keeps no room for it; `"end"`, the default, the header row's last cell; with no title column shown it stands at the end), `phonePicking` (a phone picks rows by a long press, the boxes inside the name column before the picture, and always shown on a grouped grid, its titles row's box in the name column's head; needs `selection`; off by default), `parts` (a column per part of a name, a place or a range, offered under its field in "+ Add column"; off by default), `columnMenuItems` (your rows in a column's menu, as data, above Hide: the old route, which adds rows only; `menus.column` reshapes the whole menu), and the per-user toggles `freezeIdentity` (the identity columns, everything through the title, pinned at the left edge; on by default, on the bare prop, in `LIST_VIEW_PREF_DEFAULTS` (`gridFreezeIdentity`), in a view's look and in the grid's look alike; hand `false`, or start your prefs with `gridFreezeIdentity: false`, to open it unpinned), `alwaysCheckboxes`, `verticalBorders` (the lines between the columns, the last column's closing the table, in the rows and the footer, which then also draws a line under itself, pinned or not) and `scale`; and `headerVerticalBorders` (the header's columns ruled as the rows' are under `verticalBorders`, the last column's included; off by default); and `fillWidth` (the columns share the grid's whole width, each in proportion to its own width and never below it, a column the person resized or one with a `grid.maxWidth` keeping its width; a table wider than the grid scrolls sideways as without it; off by default).
14
14
  - Writes: `onCellCommit` (`GridCellCommitFn`) and `onCellsCommit` (`GridCellsCommitFn`).
15
+ - `rowHighlight`: which row the grid tints. `"hover"`, the default, the row under the pointer, as always; `"active"`, the active row alone, `data-active`: the row a person last pressed, anywhere on it, or the picked cell's row, so the keyboard moves it too, kept through a press outside the grid and Escape until another is pressed or picked; no row tints under the pointer then, nor a `hoveredRow`, while the hover's box, ⋯ and the name's actions still show.
15
16
  - States held from outside, each off when left out, as a page that shows the grid's states side by side needs them: `hoveredRow` (a row, by its id, drawn as under the pointer: its tint, its rail's box, its ⋯ and the name's actions, and `data-hovered`, while a real pointer still hovers any row beside it; drawn, as a hover is, only on a screen whose pointer hovers) and `onHoveredRowChange` (the row a person's pointer moves onto, or null off it); `cellPick` (a `GridCellPick` drawn as picked, placed each time its value changes without taking the page's focus; while it is given, null included, a press outside the grid lets go of nothing, and a person's click, drag, keys and Escape move it as always) and `onCellPickChange` (each change a person makes, or null); `openColumnMenu` (the column, by its id, whose menu stands open on the first row of column names, its header cell `data-open`; while it is given, null included, the menus open and close only as it says) and `onOpenColumnMenuChange` (the column a person's press opens, or null when a press, a row of the menu or a press outside closes it, for you to answer).
16
17
  - List config: `listConfig` (the settings layer every user of the list inherits, which may only take away from what the columns declare: the table read-only, per-column locks; a constraint on the screen, while your API guards its own writes). The grid only reads it: a surface of your own changes it.
17
18
  - Per row: `rowWritable` (`(row) => boolean`, whether a row's cells write, for a reader who may edit some records and not others; a row it answers false for opens no editor, takes no typing, paste, fill, clear, cut or bulk-bar write, says "Cell is read-only" (`views.grid.cell-read-only`) when a person tries, and marks its cells `aria-readonly`; it only takes away from what the columns and `listConfig` allow; absent, every row writes as its columns say; called while the grid renders, so keep it pure and cheap; a constraint on the screen, while your API guards its own writes).