viewkitjs 0.33.0 → 0.34.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 (107) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +1 -1
  3. package/views/dist/contract.d.ts +20 -10
  4. package/views/dist/contract.js +37 -3
  5. package/views/dist/controls/alert/alert.js +2 -1
  6. package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
  7. package/views/dist/controls/bulk-bar/bulk-bar.js +25 -22
  8. package/views/dist/controls/controls.d.ts +2 -0
  9. package/views/dist/controls/controls.js +2 -0
  10. package/views/dist/controls/customize/customize.js +8 -6
  11. package/views/dist/controls/customize/map-customize-body.d.ts +2 -2
  12. package/views/dist/controls/customize/map-customize-body.js +3 -2
  13. package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
  14. package/views/dist/controls/date-editor/date-editor.js +13 -7
  15. package/views/dist/controls/date-editor/map-calendar.js +2 -0
  16. package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
  17. package/views/dist/controls/date-editor/map-date-body.js +7 -3
  18. package/views/dist/controls/filter-editor/map-filter-body.d.ts +2 -0
  19. package/views/dist/controls/filter-editor/map-filter-body.js +7 -4
  20. package/views/dist/controls/filter-editor/parts.d.ts +3 -1
  21. package/views/dist/controls/filter-editor/parts.js +7 -6
  22. package/views/dist/controls/group-editor/group-editor.js +2 -1
  23. package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
  24. package/views/dist/controls/group-editor/map-group-body.js +5 -1
  25. package/views/dist/controls/input/input.js +2 -1
  26. package/views/dist/controls/internal/head-button.d.ts +9 -0
  27. package/views/dist/controls/internal/head-button.js +13 -0
  28. package/views/dist/controls/internal/panel-controls.d.ts +13 -5
  29. package/views/dist/controls/internal/panel-controls.js +53 -10
  30. package/views/dist/controls/menu/menu.d.ts +2 -1
  31. package/views/dist/controls/menu/menu.js +2 -2
  32. package/views/dist/controls/modal/modal.js +5 -3
  33. package/views/dist/controls/number-editor/map-number-body.js +5 -1
  34. package/views/dist/controls/number-editor/number-editor.js +6 -6
  35. package/views/dist/controls/pane/map-pane.d.ts +3 -0
  36. package/views/dist/controls/pane/map-pane.js +5 -0
  37. package/views/dist/controls/picker/map-fields-body.js +25 -1
  38. package/views/dist/controls/picker.css +10 -1
  39. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
  40. package/views/dist/controls/quick-filters/map-quick-filters-body.js +7 -3
  41. package/views/dist/controls/quick-filters/quick-filters.js +5 -3
  42. package/views/dist/controls/setting-row/looks.js +5 -5
  43. package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
  44. package/views/dist/controls/setting-row/setting-row.js +3 -1
  45. package/views/dist/controls/setting-row.css +3 -2
  46. package/views/dist/controls/sheet/bottom-sheet.d.ts +3 -1
  47. package/views/dist/controls/sheet/bottom-sheet.js +2 -2
  48. package/views/dist/controls/sort-editor/map-sort-body.js +4 -4
  49. package/views/dist/controls/text-editor/map-text-body.js +5 -1
  50. package/views/dist/controls/text-editor/text-editor.js +5 -4
  51. package/views/dist/controls/toolbar/toolbar.d.ts +4 -2
  52. package/views/dist/controls/toolbar/toolbar.js +2 -2
  53. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
  54. package/views/dist/controls/views-list/map-view-menu.js +6 -2
  55. package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
  56. package/views/dist/controls/views-list/map-views-list-body.js +6 -5
  57. package/views/dist/controls/views-list/view-menu.js +3 -4
  58. package/views/dist/controls/views-list/views-list.js +2 -2
  59. package/views/dist/editors/EditorPanel.js +3 -3
  60. package/views/dist/list/list.d.ts +6 -2
  61. package/views/dist/list/list.js +6 -2
  62. package/views/dist/list/parts.js +3 -2
  63. package/views/dist/list/toolbar.js +9 -3
  64. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -0
  65. package/views/dist/panels/react/toolbar/Toolbar.d.ts +4 -0
  66. package/views/dist/panels/react/toolbar/Toolbar.js +8 -3
  67. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +3 -2
  68. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +3 -2
  69. package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -2
  70. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -2
  71. package/views/dist/panels/react/toolbar/context.d.ts +21 -0
  72. package/views/dist/panels/react/toolbar/context.js +4 -0
  73. package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
  74. package/views/dist/panels/react/toolbar/pane-host.js +17 -0
  75. package/views/dist/panels/react/toolbar/panel-part.js +3 -2
  76. package/views/dist/panels/react.d.ts +1 -1
  77. package/views/dist/provider/ViewsProvider.d.ts +4 -3
  78. package/views/dist/provider/components.d.ts +34 -5
  79. package/views/dist/provider/components.js +1 -1
  80. package/views/dist/react.d.ts +1 -1
  81. package/views/dist/styles.css +97 -78
  82. package/views/dist/styles.unlayered.css +97 -78
  83. package/views/docs/contract.md +62 -6
  84. package/views/docs/controls/alert-dialog.md +4 -0
  85. package/views/docs/controls/alert.md +4 -0
  86. package/views/docs/controls/bulk-bar.md +4 -0
  87. package/views/docs/controls/customize.md +3 -1
  88. package/views/docs/controls/date-editor.md +2 -0
  89. package/views/docs/controls/filter-editor.md +1 -1
  90. package/views/docs/controls/group-editor.md +2 -0
  91. package/views/docs/controls/menu.md +3 -1
  92. package/views/docs/controls/modal.md +4 -0
  93. package/views/docs/controls/number-editor.md +2 -0
  94. package/views/docs/controls/quick-filters.md +3 -1
  95. package/views/docs/controls/sheet.md +1 -1
  96. package/views/docs/controls/text-editor.md +2 -0
  97. package/views/docs/controls/toolbar.md +4 -0
  98. package/views/docs/controls/views-list.md +2 -0
  99. package/views/docs/guides/the-provider.md +4 -4
  100. package/views/docs/reference/controls.md +5 -3
  101. package/views/docs/reference/list.md +5 -3
  102. package/views/docs/reference/looks.md +1 -1
  103. package/views/docs/reference/panels-react.md +6 -5
  104. package/views/docs/reference/react.md +7 -6
  105. package/views/docs/reference/views.md +4 -2
  106. package/views/docs/reshaping.md +16 -5
  107. package/views/skills/views/SKILL.md +1 -1
@@ -7,12 +7,12 @@ Import from `viewkitjs/views/react` in a client component: the door opens with t
7
7
  Guide: [the provider](../guides/the-provider.md).
8
8
 
9
9
  - `ViewsProvider` — the provider every view reads: mount it once at your app's client root, above every view: `<ViewsProvider components={CONTROLS}>` at the least, and whatever of its icons, ports and conventions your app draws its own. It lays your atoms over the defaults (handed `CONTROLS` as it stands, over `CONTROL_ATOMS`, which it carries), hands your `Menu` its items with every row under a disabled group already disabled, and fills in the browser's own confirm where your ports carry no `confirm`. It hands its views one context value per distinct set of inputs, so pass module-level objects: a new one on each render re-renders every view.
10
- - `ViewsProviderProps` — what the provider takes. Its optional `desktopQuery` is the media query that means a desktop, so an editor opens as a popover there and as a sheet elsewhere, the default controls take their phone form below it (`PhoneLine`), as do the toolbar's panels and the views picker outside a `Toolbar`, and the grid's own chrome takes its desktop form there (the grid's frame carries `data-desktop`); hand in the one your own shell switches on. Default `DEFAULT_DESKTOP_QUERY`. Its optional `sheetActions` (`ViewsSheetActionsPlace`, default `bar`) says where an editor's ✕ and ✓, and a toolbar panel's ✕, stand in that sheet. Its optional `escape` (`ViewsEscapeRules`) says what Escape does in an editor of each field type on a desktop, `"keep"` or `"cancel"`, a type left out cancelling. Its optional `selectionBar` (`ViewsSelectionBarSettings`) says where the selection bar sits. Its optional `oneValue` (`ViewsOneValueEditors`) says whether a single email or domain opens the text box in its cell (the default) or the value list holding one value, in the grid and a field row alike. Its optional `datePicks` (`ViewsDatePicks`) names the quick days the date editors offer, in order; absent, today, tomorrow and next Monday. Its optional `now` (a `Date`) is the moment every date counts from; absent, the provider reads the clock after mount, then once a minute and when the tab comes back into view, never while rendering, and a date that needs it draws its full form until the first read. Its optional `panelControls` (`true`, or the names among `Button`, `Select`, `Menu`, `Popover` and `Input`, `PanelControlName`) says which of your own controls ViewKit's sort and filter panels draw inside them (VK-1013), each handed the map's props and the part's `data-slot` and `data-key`; a control of `CONTROLS`' stays ViewKit's whatever it says, and without it the panels draw ViewKit's own, as before.
10
+ - `ViewsProviderProps` — what the provider takes. Its optional `desktopQuery` is the media query that means a desktop, so an editor opens as a popover there and as a sheet elsewhere, the default controls take their phone form below it (`PhoneLine`), as do the toolbar's panels and the views picker outside a `Toolbar`, and the grid's own chrome takes its desktop form there (the grid's frame carries `data-desktop`); hand in the one your own shell switches on. Default `DEFAULT_DESKTOP_QUERY`. Its optional `sheetActions` (`ViewsSheetActionsPlace`, default `bar`) says where an editor's ✕ and ✓, and a toolbar panel's ✕, stand in that sheet. Its optional `escape` (`ViewsEscapeRules`) says what Escape does in an editor of each field type on a desktop, `"keep"` or `"cancel"`, a type left out cancelling. Its optional `selectionBar` (`ViewsSelectionBarSettings`) says where the selection bar sits. Its optional `oneValue` (`ViewsOneValueEditors`) says whether a single email or domain opens the text box in its cell (the default) or the value list holding one value, in the grid and a field row alike. Its optional `datePicks` (`ViewsDatePicks`) names the quick days the date editors offer, in order; absent, today, tomorrow and next Monday. Its optional `now` (a `Date`) is the moment every date counts from; absent, the provider reads the clock after mount, then once a minute and when the tab comes back into view, never while rendering, and a date that needs it draws its full form until the first read. Its optional `panelControls` (`true`, or the names among `Button`, `Select`, `Menu`, `Popover`, `Input` and `Calendar`, `PanelControlName`) says which of your own controls ViewKit's sort and filter panels (VK-1013) and its text, number and date editors (VK-1021; `Calendar` is the date editor's month) draw inside them, each handed the map's props and the part's `data-slot` and `data-key`; a control of `CONTROLS`' stays ViewKit's whatever it says, and without it they draw ViewKit's own, as before.
11
11
  - `EditEscape` — `"cancel" | "keep"`: what Escape does in an edit session (`viewkitjs/views/editors/session` hands it on too).
12
12
  - `ViewsEscapeRules` — the provider's `escape`: an `EditEscape` per field type, and for `email`, `phone`, `url` and `domain` either one `EditEscape`, which covers both of their editors, or an `EditEscapeByEditor`.
13
13
  - `EditEscapeByEditor` — `{ box?: EditEscape; list?: EditEscape }`: what Escape does in an email, phone, link or domain field by the editor it opens, `box` its text box (a single value) and `list` the value list (several values, or a single one `oneValue` opens as a list of one). One left out throws the edit away.
14
14
  - `ViewsOneValueEditors` — `Partial<Record<"email" | "domain", "text" | "list">>`, the provider's `oneValue`.
15
- - `PANEL_CONTROL_NAMES` — `Button`, `Select`, `Menu`, `Popover` and `Input`: the controls the provider's `panelControls` can name.
15
+ - `PANEL_CONTROL_NAMES` — `Button`, `Select`, `Menu`, `Popover`, `Input` and `Calendar`: the controls the provider's `panelControls` can name.
16
16
  - `PanelControlName` — one member of `PANEL_CONTROL_NAMES`.
17
17
  - `flatSelectItems` — a Select's rows (`ViewsSelectItem[]`) with every `level` flattened, each row one level in standing in its parent's place, named by its path ("Company › Region"), its value as handed: for a `Select` of yours that draws no levels.
18
18
  - `DEFAULT_DESKTOP_QUERY` — `(min-width: 1024px)`: the width a desktop starts at when the provider is handed no `desktopQuery`, the default controls' phone line too (`PhoneLine`, in controls.md). Where the screen can't be asked (a server render, a browser with no `matchMedia`), it is a desktop.
@@ -28,7 +28,7 @@ Guide: [the provider](../guides/the-provider.md).
28
28
 
29
29
  The primitives your app hands in, modelled on Base UI's shapes: a controlled `open` with `onOpenChange(open, details)`, an `anchor` rather than a trigger child on the popover and the menu, and no `asChild`. An adapter on Base UI wraps its copies thinly; one on Radix absorbs the difference. The package ships none of them and depends on neither library. The [contract](../contract.md) says what each slot promises and how to write an adapter.
30
30
 
31
- - `ViewsComponents` — the map itself, one key per name of the contract's components: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody` (a whole body for a text typed as one string: the text editors open it; `CONTROLS.TextBody` is ViewKit's), `NumberBody` (a whole body for a number, money or a percent: the number editors open it, a duration excepted; `CONTROLS.NumberBody` is ViewKit's), `Picker` (a whole pick list: the select, several-values and relation editors open it; `CONTROLS.Picker` is ViewKit's), `LinksBody` (a whole links body: the set editor of a relation whose field declares `links` opens it, handed each link's roles, the lead and the field's roles; `CONTROLS.LinksBody` is ViewKit's), `DateBody` (a whole date body: the date editors open it; `CONTROLS.DateBody` is ViewKit's), `PartsBody` (a whole body for a name, a place or a range: the name, place and range editors open it; `CONTROLS.PartsBody` is ViewKit's), `ValuesBody` (a whole body for several emails, phones, links or domains: the value list editors open it; `CONTROLS.ValuesBody` is ViewKit's), and the toolbar panels' bodies: `SortBody` (the sort editor's whole body: the sort pill opens it on a computer and in the phone's Sheet; `CONTROLS.SortBody` is ViewKit's), `FilterBody` (the filter editor's whole body: an advanced filter's pill opens it on a computer and Filter in the phone's Sheet; `CONTROLS.FilterBody` is ViewKit's), `FilterPartBody` (a filter rule's way and value: a filter on the bar opens it; `CONTROLS.FilterPartBody` is ViewKit's), `FieldsBody` (the field list's whole body: every sort and filter field list opens it; `CONTROLS.FieldsBody` is ViewKit's), `QuickFiltersBody` (the quick filters' whole body: the quick filters' button opens it on a computer and in the phone's Sheet; `CONTROLS.QuickFiltersBody` is ViewKit's), `ViewsListBody` (the views list's whole body: the view picker's chip opens it on a computer and in the phone's Sheet; `CONTROLS.ViewsListBody` is ViewKit's) and `CustomizeBody` (Customize's whole body: Options and everything else that draws Customize open it on a computer and in the phone's Sheet; `CONTROLS.CustomizeBody` is ViewKit's). `AppIcon` is your own icon component, taking `name` and `className`, for the glyphs a host declares (a row's icon, a binding's icon); it draws on the first paint, because rows are measured as they mount, so map its names from a static record. `Markdown` is your markdown renderer, handed the stored text whole as `source`; the package parses no markdown itself. Eight keys are optional: `Input` (leave it out and the editors draw a plain `<input>`), `Command` (deprecated: the command list's parts, read by nothing), `Calendar` (the filter panel's month; reached without one, it throws an error naming it; `CONTROLS.Calendar` is ViewKit's), `RowsWait` (wraps a grid's rows; handed one, a grid that already shows rows keeps them, inert, as its children while new ones load, its column names and footer outside; left out, the grid draws Loading in place of its body), `GroupBody` (deprecated: read by nothing; a `CustomizeBody` holds its own group editor), `SearchField` (the toolbar's search box; handed one, the search opens it in place of its own field on a computer and on a phone), `PortsHost` (what draws the `toast` and `confirm` ports an app leaves out) and `SelectionBar` (the selection bar; handed one, ViewKit draws it in its own place).
31
+ - `ViewsComponents` — the map itself, one key per name of the contract's components: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody` (a whole body for a text typed as one string: the text editors open it; `CONTROLS.TextBody` is ViewKit's), `NumberBody` (a whole body for a number, money or a percent: the number editors open it, a duration excepted; `CONTROLS.NumberBody` is ViewKit's), `Picker` (a whole pick list: the select, several-values and relation editors open it; `CONTROLS.Picker` is ViewKit's), `LinksBody` (a whole links body: the set editor of a relation whose field declares `links` opens it, handed each link's roles, the lead and the field's roles; `CONTROLS.LinksBody` is ViewKit's), `DateBody` (a whole date body: the date editors open it; `CONTROLS.DateBody` is ViewKit's), `PartsBody` (a whole body for a name, a place or a range: the name, place and range editors open it; `CONTROLS.PartsBody` is ViewKit's), `ValuesBody` (a whole body for several emails, phones, links or domains: the value list editors open it; `CONTROLS.ValuesBody` is ViewKit's), and the toolbar panels' bodies: `SortBody` (the sort editor's whole body: the sort pill opens it on a computer and in the phone's Sheet; `CONTROLS.SortBody` is ViewKit's), `FilterBody` (the filter editor's whole body: an advanced filter's pill opens it on a computer and Filter in the phone's Sheet; `CONTROLS.FilterBody` is ViewKit's), `FilterPartBody` (a filter rule's way and value: a filter on the bar opens it; `CONTROLS.FilterPartBody` is ViewKit's), `FieldsBody` (the field list's whole body: every sort and filter field list opens it; `CONTROLS.FieldsBody` is ViewKit's), `QuickFiltersBody` (the quick filters' whole body: the quick filters' button opens it on a computer and in the phone's Sheet; `CONTROLS.QuickFiltersBody` is ViewKit's), `ViewsListBody` (the views list's whole body: the view picker's chip opens it on a computer and in the phone's Sheet; `CONTROLS.ViewsListBody` is ViewKit's) and `CustomizeBody` (Customize's whole body: Options and everything else that draws Customize open it on a computer and in the phone's Sheet; `CONTROLS.CustomizeBody` is ViewKit's). `AppIcon` is your own icon component, taking `name` and `className`, for the glyphs a host declares (a row's icon, a binding's icon); it draws on the first paint, because rows are measured as they mount, so map its names from a static record. `Markdown` is your markdown renderer, handed the stored text whole as `source`; the package parses no markdown itself. Eight keys are optional: `Input` (leave it out and the editors draw a plain `<input>`), `Command` (deprecated: the command list's parts, read by nothing), `Calendar` (the filter panel's month; reached without one, it throws an error naming it; `CONTROLS.Calendar` is ViewKit's), `RowsWait` (wraps a grid's rows; handed one, a grid that already shows rows keeps them, inert, as its children while new ones load, its column names and footer outside; left out, the grid draws Loading in place of its body), `GroupBody` (deprecated: read by nothing; a `CustomizeBody` holds its own group editor), `SearchField` (the toolbar's search box; handed one, the search opens it in place of its own field on a computer and on a phone), `PortsHost` (what draws the `toast` and `confirm` ports an app leaves out), `SelectionBar` (the selection bar; handed one, ViewKit draws it in its own place) and `Pane` (a toolbar panel at the right edge of the list's box: a toolbar with `customizeIn: "pane"` opens Customize in it on a computer; left out, the `Popover`; `CONTROLS.Pane` is ViewKit's).
32
32
  - `ViewsResolvedComponents` — the map as `useViews()` hands it on: yours, with `Input` always there, your own or the plain one, and `Calendar` always there, yours or a stand-in that throws an error naming the slot when it is reached.
33
33
  - `ViewsButtonProps` — a button: its `children`, `onClick`, `disabled`, a `variant` (`default`, `secondary`, `ghost`, `outline`, `destructive`; `secondary` only for the views picker's chip), a `size` (`default`, `sm`, `icon`), its `type`, a class, `aria-label` and `title`; and a `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open`, which the grid hands its own buttons: forward each to your element; and `aria-disabled`, which a field row's edit target is handed while its write is pending; and `aria-pressed`, `role`, `aria-selected`, `data-state` and `data-vs-row`, which the panels' own buttons are handed (the new-line mark, a view's row in the picker, the views row's chips and a view's ⋯, Export); and `data-key`, which one of a part that repeats, beside its `data-slot`, inside the sort and filter panels under `panelControls`. There a ViewKit part may hand it more props than these (a tooltip's handlers, a `data-*` the panel finds it by again): forward the rest to your element.
34
34
  - `ViewsPopoverProps` — a popover opened at an `anchor`, controlled by `open` and `onOpenChange`, placed by `side`, `align`, `sideOffset` and `alignOffset`; its `label`, where ViewKit names it (a panel's popover under `panelControls`), is its name to a screen reader, your popup's `aria-label`.
@@ -45,7 +45,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
45
45
  - `ViewsPickerProps` — a whole pick list your app draws, its search, rows, empty row and create row: its `label` (the field's name), `items`, `multiple`, `value` (one value or `null`; several, a list), `onValueChange` (the pick, `null` for the empty row, or the whole new list on every change; nothing is saved until the editor closes), `onDone` (a pick of one is made), `empty` (the empty row's words; absent, a value of one can't be emptied), `search` (its words before anything is typed), `onCreate` (handed what was typed, returns the value it makes, which you then pick or add), `typed` (what was typed on what opened it: on a computer, light its first match, so Enter picks it), `autoFocus`, `keyed` (opened by a key: on a computer, light the held row as it opens and let ↓ go on from it to the next), `fromHeld` (opened by a press, before a row is lit: ↓ and ↑ go on from the held row, to the next or the one before, nothing drawn lit until then), `form`, `computer` or `phone` (on a phone, draw no ✕, ✓ or Cancel of your own and hand every change as it is made), and for a relation `onSearch` (the editor filters or fetches: hand it every typed query and draw `items` as handed), `doing` (`searching` or `failed`; `searching` from the keystroke until the typed query answers, its `items` meanwhile the held records that match it alone), `onRetry`, `onMore`, `actions` (`ViewsPickerAction` rows after the rows) and `lead` (which held value leads, `onLead`, `label` and `makeLabel`); and, where your app adds options to a select's or multiselect's list, `onAdd` (draw an add row after the matches and call it with the typed text; handed instead of `onCreate`), `adding` (the text being added: draw its row as waiting, not pressable) and `addRefused` (your app's refusal, or the failure's words, to show where the add row was). A body that draws none of them offers no add. A status field's `steps`: its active steps by value, in order, so a held archived option is placed nowhere, as its cell places it.
46
46
  - `ViewsPickerItem` — one row of a picker body, as data: its `value` and `label`, a status `slot` (draw your status badge) or a category `color` (draw your option chip), an `icon` (your glyph's name, as `AppIcon` draws it), a quieter `line`, the `group` it stands under, `disabled`, and for a relation's record a `badge` (a word telling kinds apart), a `glyph` (the record's own, unsized), an `avatarUrl` and its `kind`.
47
47
  - `ViewsPickerAction` — a row of a picker body that does something rather than pick (create a record with what was typed): its `key`, `label`, an optional `icon`, and `onSelect`; picking it closes the editor, then runs it.
48
- - `ViewsCalendarProps` — a calendar over ISO days (`YYYY-MM-DD`): its `value` and `onChange`, `min` and `max`, a `month` (`YYYY-MM`) controlled with `onMonthChange`, a `captionLayout` of `label` or `dropdown`, the `startMonth` and `endMonth` its pickers offer, and `locale`, the conventions' locale, in which it draws its month and weekday names and starts its week (an adapter may keep its calendar's own). Your date library stays your own.
48
+ - `ViewsCalendarProps` — a calendar over ISO days (`YYYY-MM-DD`): its `value` and `onChange`, `min` and `max`, a `month` (`YYYY-MM`) controlled with `onMonthChange`, a `captionLayout` of `label` or `dropdown`, the `startMonth` and `endMonth` its pickers offer, and `locale`, the conventions' locale, in which it draws its month and weekday names and starts its week (an adapter may keep its calendar's own); and `data-slot`, its public name where ViewKit names it (`vk-calendar`, the date editor's month under `panelControls`), to draw on its root. Your date library stays your own.
49
49
  - `ViewsDateBodyProps` — a whole date body your app draws, its typed line, days, quick picks and time: its `label` (the field's name), `value` (on the conventions' calendar and clock, the zone the cell shows, and a date-only field's stored instant on the browser's calendar, as its cell shows it: a day `YYYY-MM-DD`, a day and time `YYYY-MM-DDTHH:MM`, or `null`), `onValueChange` (every change as it is made, a typed day once it reads as one, `null` for the empty pick; nothing is saved until the editor closes), `onDone` (the edit is finished: a pick that finishes it, as a day on a field with no time or the empty pick, or an Enter that keeps; after a plain Enter the editor closes as Enter, so a grid's next key lands the write first), `time`, `empty`, `picks` (`ViewsDatePick`s, in order: the provider's `datePicks`, then `none` where it may be emptied), `today` (`YYYY-MM-DD`, today in the conventions' zone), `typed` (what was typed on what opened it), `autoFocus` and `form` (`phone`: draw no ✕, ✓ or Cancel of your own, and hand every change as it is made). The editor around it keeps the draft, Tab, Escape, the save and the phone's ✕ and ✓.
50
50
  - `ViewsDatePick` — a quick pick a date body offers: `today`, `tomorrow`, `next-monday` (the Monday after today, a week on when today is one), `in-a-week` (today + 7 on the conventions' calendar) or `none`, which empties the field.
51
51
  - `ViewsDatePicks` — the provider's `datePicks`: the quick days the date editors offer, in order, any `ViewsDatePick` but `none`. The date editor hands exactly these to your `DateBody` and its own panel draws the same; absent, `today`, `tomorrow` and `next-monday`.
@@ -69,6 +69,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
69
69
  - `ViewsViewsListBodyProps` — the views list's whole body your app draws: `label`, `views` (each a `ViewsViewsListItem`), `value` (the view in use), `form`, `onViewChange` (a view picked; written when it is one of `views`; it closes nothing), `onCreate` and `createLabel` where the axis grows (what holds it closes first), `onReorder` and `canDrag` where the axis reorders (one whole block, shared or the reader's own, each once; any other order writes nothing), `onDone` (what holds it closes), on a phone where the sheet's head doesn't draw it `actions` (the ✕, and Back while the body stands on a step), on a computer `onHold` (while true, a press outside and Escape close nothing: the body asks outside the list), on a phone `onStepChange` (the body stands on a step of its own: the sheet shows its title and Back), and, where the axis hands them, `verbs` (a view's whole menu's data, `ViewsViewVerbs`).
70
70
  - `ViewsViewsListItem` — one view as the views list's body is handed it: `value`, `label`, `icon`, `count` (absent while counts are hidden), `private`, `menu` (the view's own verbs), and for a view's whole menu `layout`, `changed`, `favorite` and `readOnly` (nothing that changes it).
71
71
  - `ViewsViewMenuProps` — one view's whole menu your app may draw (`ViewMenu`, optional; `CONTROLS.ViewMenu` is ViewKit's own), opened on a computer by a views row's pill and a folded view's `⋮` where the axis hands `verbs`: `open`, `onOpenChange`, `anchor` and `align`, as `Menu` is; `view` (whose menu it is; left out, New view's Modal stands in place of a menu, as the row's + opens it, and `onOpenChange(false)` is told once it has closed), `views` (every view of the axis, each a `ViewsViewsListItem`), `value` (the view in use), `verbs`, `onDone` (what holds it closes) and `onHold` (while true, a press outside and Escape close nothing: the menu asks outside what holds it).
72
+ - `ViewsPaneProps` — what your map's `Pane` is handed (VK-1026; `CONTROLS.Pane` is ViewKit's own Pane): `open`, `onOpenChange` (it closes from inside: Escape, its ✕), `container` (the list's box it stands in: positioned, holding the grid, never scrolling itself; null until it is on the page, when it draws nothing), `opener` (the part's button, ⋯ while folded: give it the focus back as it closes from inside), `label` (its name to a screen reader) and `children` (the panel). A toolbar with `customizeIn: "pane"` opens Customize in it on a computer, in the box handed as `paneBox`.
72
73
  - `ViewsViewVerbs` — a view's verbs, handed on the axis where your app lets ViewKit draw a view's whole menu: `layouts`, `records` (the noun in the delete question's line), a board's `columns`, and `onChange`, which takes each `ViewsViewChange` and opens the right view itself (ViewKit moves none: `viewsAfter` does it); optionally `menu`, the view's menu as data, handed its default items and the view and returning the items drawn ([`/list`'s Menus as data](./list.md#menus-as-data)).
73
74
  - `ViewsViewChange` — a change a view's menu makes: rename, create (with its layout, name, a board's columns and the view it was made from), duplicate, delete, restore (Undo: the view, its place, whether it was open), save, reset, edit, link, favorite, private.
74
75
  - `ViewsViewLayout` — a layout a new view can take: `id`, `name`, `icon` (your `AppIcon`'s name), `line`, and `columns` where it asks which field makes its columns.
@@ -91,7 +92,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
91
92
  - `ViewsCollapseProps` — a box that opens and closes its `children` with `open`, over `durationMs`, with a class and a `clipClassName` on the box that crops the content.
92
93
  - `ViewsSheetProps` — a phone sheet, controlled by `open` and `onOpenChange`, with a `title`, a `label` (the title in words whenever the title is words: its accessible name, and the title of a head that takes only text), a `description`, a class, its `children`, and `snap` (`full`, `half`, `peek`, `auto`), a hint a sheet with no snap points ignores. With the provider's `sheetActions` at `head` it is handed `actions` to draw in its own head: the editor panel's ✕ and ✓ (and Back, on a body's step), a toolbar panel's ✕ alone, or the sort editor's ✕ (which takes its rules back) and ✓.
93
94
  - `ViewsSheetActions` — the editor panel's ✕ and ✓, handed to a sheet that draws them in its head: `close`, which throws the edit away as a swipe does, and `done`, which closes it as done, absent where the body saves on its pick. A toolbar panel's sheet is handed `close` alone, which closes it; the sort editor's is handed both, its `close` taking the rules back to what they were as the sheet opened and its `done` keeping them. While an editor's body stands on a step of its own it carries `back` too, to draw in `close`'s place: Back, returning the body to where it was; `close` stays handed, for a head that draws no Back.
94
- - `ViewsSheetAction` — one of them: its `label` (the accessible name) and `onPress`. The glyph is yours.
95
+ - `ViewsSheetAction` — one of them: its `label` (the accessible name) and `onPress`, and its `slot`, its public name on an editor panel's ✕, ✓ and Back (`vk-editor-close`, `vk-editor-save`, `vk-editor-back`), to draw on your button as its `data-slot`. The glyph is yours.
95
96
  - `ViewsBodyStep` — `{ title, onBack }`: a step of an editor body's own on a phone (a list of countries, a label's list), which a `TextBody`, `NumberBody`, `PartsBody`, `ValuesBody` or `LinksBody`, or the sort's `SortBody` (Add sort's fields, a rule's direction), hands the sheet through its `onStepChange`. The sheet's head shows `title` in place of the field's name, and Back and the sheet's Escape call `onBack`; the body hands `null` once it is back. A `GroupBody` hands its level the same way to ViewKit's Customize, on a computer and a phone: Customize's head shows its title and Back calls `onBack` (Escape there still closes the panel).
96
97
  - `ViewsSeveralValues` — `"first" | "fit"`, the provider's `severalValues`: how a cell of several values draws on one line. `fit` (the default) draws as many whole values as fit its width, then the count, following a column resize; `first` draws its first value and a count at any width, as on 0.5.0.
97
98
  - `ViewsSelectionBarSettings` — the provider's `selectionBar`: `phoneQuery` (the media query under which the bar is the phone's pill; without it, wherever `desktopQuery` does not match), and `desktop` and `phone`, each a `ViewsBarPlacement`.
@@ -99,7 +100,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
99
100
  - `ViewsSheetActionsPlace` — where the ✕ and ✓ stand on a phone, the provider's `sheetActions`: `bar` (the default, the panel's own bar, or a toolbar panel's own ✕, inside your sheet) or `head` (handed to your sheet as `actions`, and none drawn inside; a toolbar panel hands `close` alone, but the sort editor hands `close`, which takes its rules back, and `done`).
100
101
  - `ViewsInputProps` — a single-line text box: every prop of an `<input>`, `ref` included, which your element must receive, and `chrome`, `bare` (the default: a grid cell, a panel that frames the box) or `field` (your field's frame).
101
102
  - `ViewsSelectItem` — one row of a `Select`'s list: its `value`, `label`, an `icon`, a second `line`, the `group` it stands under, `disabled`, and `level`, the rows one level in under a row never picked itself (draw them in place, or flatten them with `flatSelectItems`).
102
- - `ViewsSelectProps` — the components map's `Select`, which ViewKit's sort and filter panels draw under `panelControls` for their boxes that pick: its `items`, its `value` (one, several with `multiple`, or none) and `onValueChange`, a `placeholder`, `disabled`, `open` and `onOpenChange` (on a phone a panel holds it shut and turns its sheet to a step of its own on `onOpenChange(true)`: honour both when handed), `search` (the words of the search ViewKit's own shows over a long list), `size` (`sm` or `default`), a class, `aria-label`, and the part's `data-slot` and `data-key`, to draw on the box a person presses. Forward any other prop to your box.
103
+ - `ViewsSelectProps` — the components map's `Select`, which ViewKit's panels draw under `panelControls` for their boxes that pick (the sort's and the filter's, and New view's columns): its `items`, its `value` (one, several with `multiple`, or none) and `onValueChange`, a `placeholder`, `disabled`, `open` and `onOpenChange` (on a phone a panel holds it shut and turns its sheet to a step of its own on `onOpenChange(true)`: honour both when handed), `search` (the words of the search ViewKit's own shows over a long list), `size` (`sm` or `default`), a class, `aria-label`, and the part's `data-slot` and `data-key`, to draw on the box a person presses. Forward any other prop to your box.
103
104
  - `ViewsAnchor` — where a floating part attaches: an element, a ref to one, a point `{ x, y }` (a context menu), or `null`.
104
105
  - `ViewsSide` — the side a floating part opens on: `top`, `right`, `bottom` or `left`.
105
106
  - `ViewsAlign` — how a floating part lines up along that side: `start`, `center` or `end`.
@@ -34,7 +34,7 @@ Guide: [the provider](../guides/the-provider.md).
34
34
  - `VK_CONTROL_PRIVATE_FAMILIES` — the prefixes of the controls' own machinery, set and read by a control alone (the smooth corner's, the pressing room's, and each control's own): not public, and your app neither sets nor reads them.
35
35
  - `COMPONENT_NAMES` — the primitives your app hands in through the provider: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody`, `NumberBody`, `Picker`, `LinksBody`, `DateBody`, `PartsBody`, `ValuesBody`, `SortBody`, `FilterBody`, `FilterPartBody`, `FieldsBody`, `QuickFiltersBody`, `ViewsListBody` and `CustomizeBody` ([the components map](../contract.md#the-components-map)).
36
36
  - `ComponentName` — one member of `COMPONENT_NAMES`.
37
- - `OPTIONAL_COMPONENT_NAMES` — the primitives your app may leave out: `Input` (a plain default), `Select` (drawn only inside the sort and filter panels, under the provider's `panelControls`), `Command` (deprecated: read by nothing), `Calendar` (reached without one, it throws an error naming it), `RowsWait` (without one, a grid waiting for new rows draws Loading in place of its body), `GroupBody` (deprecated: read by nothing), `SearchField` (without one, the toolbar's search draws its own field), `PortsHost` (without one, an app that hands no `confirm` gets the browser's and one that hands no `toast` sees nothing) `SelectionBar` (without one, a selection draws ViewKit's own bar) and `ViewMenu` (without one, a views row's pill opens its view's `menu` rows) ([the components map](../contract.md#the-components-map)).
37
+ - `OPTIONAL_COMPONENT_NAMES` — the primitives your app may leave out: `Input` (a plain default), `Select` (drawn only inside ViewKit's panels, under the provider's `panelControls`), `Command` (deprecated: read by nothing), `Calendar` (reached without one, it throws an error naming it), `RowsWait` (without one, a grid waiting for new rows draws Loading in place of its body), `GroupBody` (deprecated: read by nothing), `SearchField` (without one, the toolbar's search draws its own field), `PortsHost` (without one, an app that hands no `confirm` gets the browser's and one that hands no `toast` sees nothing) `SelectionBar` (without one, a selection draws ViewKit's own bar), `ViewMenu` (without one, a views row's pill opens its view's `menu` rows) and `Pane` (without one, a toolbar's `customizeIn: "pane"` opens Customize in the `Popover`) ([the components map](../contract.md#the-components-map)).
38
38
  - `OptionalComponentName` — one member of `OPTIONAL_COMPONENT_NAMES`.
39
39
  - `ATOM_NAMES` — the pieces the rendering is built from, and the pieces of your app's own it cannot draw itself (a command cell's verb menu, the row's right-click menu, where a relation goes, a wait, how a list asks for more), and the panels' rows. Each ships as a default, and your app swaps any of them through the provider's `atoms` ([the atoms](../contract.md#the-atoms)).
40
40
  - `AtomName` — one member of `ATOM_NAMES`.
@@ -47,8 +47,10 @@ Guide: [the provider](../guides/the-provider.md).
47
47
  - `EditorSlot` — one member of `EDITOR_SLOTS`.
48
48
  - `EDITOR_STATES` — the states the editor panel's popover carries: `vk-body`, the app's own body it holds (`picker`, `parts`, `values` or `links`).
49
49
  - `EditorState` — one member of `EDITOR_STATES`.
50
- - `SELECTION_SLOTS` — the `data-slot` values the selection bar marks its parts with, prefixed like the grid's (`vk-selection-bar`, `vk-selection-pill`, `vk-selection-chip`) ([slots](../contract.md#slots)).
50
+ - `SELECTION_SLOTS` — the `data-slot` values the selection bar marks its parts with, prefixed like the grid's (`vk-selection-bar`, `vk-selection-pill`, `vk-selection-chip`) ([slots](../contract.md#slots)), and the bulk bar's (`BULK_BAR_SLOTS`).
51
51
  - `SelectionSlot` — one member of `SELECTION_SLOTS`.
52
+ - `BULK_BAR_SLOTS` — the `data-slot` names of the bulk bar's parts (`CONTROLS.SelectionBar`) and of what it opens: its count, a verb (`data-key` its place), Delete, More, the pill's ✕ and Actions, More's menu and its rows, a group's menu, a field's popover and sheet … (VK-1023, [the bulk bar's parts](../contract.md#the-bulk-bars-parts-vk-1023)). Each is in `SELECTION_SLOTS` too.
53
+ - `BulkBarSlot` — one member of `BULK_BAR_SLOTS`.
52
54
  - `ATOM_STATES` — the default atoms' states: `chosen`, `disabled`, `muted`, `checked` and `open` are flags present when true, `status` carries the status slot's name and `platform` a link's platform key ([the atoms](../contract.md#the-atoms)).
53
55
  - `AtomState` — one member of `ATOM_STATES`.
54
56
  - `PORT_NAMES` — the runtime services your app hands in through the provider: `toast`, `haptics`, `clipboard`, `viewPrefs` and `confirm` ([Ports](../contract.md#ports)).
@@ -10,11 +10,22 @@ Cheapest change first. Each step reaches further and costs more to keep current.
10
10
  3. **Wrappers and slots.** Every part carries a `data-slot`; every state a `data-*`. A stylesheet or a
11
11
  wrapper styles `[data-slot="vk-grid-row"][data-selected]` without touching the package.
12
12
  4. **Your own primitives.** The components map is yours: the popover, the menu, the calendar inside
13
- the grid are your copies, so their look is already yours. Inside the sort and filter panels they are
14
- yours too where the provider's `panelControls` says so (VK-1013): your Button, Select, Menu, Popover and
15
- Input, each handed its part's name. The other panels follow (VK-1014), and the field editors (VK-991);
16
- the Tooltip, the Picker, ViewKit's menu rows, the sort's grip, the filter's number boxes and the filter
17
- bar's way-and-value box stay ViewKit's. The sort's direction box keeps, out of sight, ViewKit's two
13
+ the grid are your copies, so their look is already yours. Inside the panels (sort, filter, group, Customize, the views list and
14
+ view menu with the Modal and alert they open, the quick filters, the filter bar's popovers, and every head a
15
+ panel draws itself on a phone) they are yours too where the provider's `panelControls` says so (VK-1013,
16
+ VK-1014): your Button, Select, Menu, Popover and Input, each handed its part's name. So are the text, number
17
+ and date editors (VK-1021): your Button, Popover and one-line Input, and your Calendar as the date editor's
18
+ month where `panelControls` names `Calendar`. The rest of the field editors and the bulk bar follow (VK-1022,
19
+ VK-1023). In those three editors these stay ViewKit's: a box that grows over lines (the text
20
+ editor's box on a computer, text and long text on a phone), a box group's frame (your Input stands bare
21
+ inside it), the Number field, a search list's box, the date's segments, its parts' boxes, its quarter
22
+ list (`vk-date-quarter`), its months and years choices and its day buttons where no `Calendar` of yours
23
+ is named, its wheels, the phone's time row, the Picker a list opens, the ✕ and ✓ an editor standing on
24
+ its own draws in ViewKit's Sheet, and a duration's box (your map's `Input`, as before, opted in or not).
25
+ With your Calendar and a time, Enter on a day no longer keeps and closes the date editor on a computer:
26
+ your Calendar's day is a press. Across the panels, the Tooltip, the Picker, ViewKit's menu rows, Radio,
27
+ Toggle, the quick filters' values, the sort's grip and the filter's number boxes stay ViewKit's, and so
28
+ does the head ViewKit's own Sheet draws: hand your own `Sheet` to change it. The sort's direction box keeps, out of sight, ViewKit's two
18
29
  words drawn in its own classes, which size the box round your Select so the row never moves on a turn.
19
30
  5. **A copy of the rendering.** When the copy mode ships, a view's default rendering is a registry
20
31
  item you copy into your app and own from then on, updated by a three-way merge against the tag you
@@ -62,7 +62,7 @@ export function AppViews({ children }: { children: ReactNode }) {
62
62
 
63
63
  ## Write the adapter against the contract
64
64
 
65
- `views/docs/contract.md` lists the twenty-three required components (`TextBody`, `NumberBody`, `Picker`, `LinksBody`, `DateBody`, `PartsBody`, `ValuesBody`, `SortBody`, `FilterBody`, `FilterPartBody`, `FieldsBody`, `QuickFiltersBody`, `ViewsListBody` and `CustomizeBody` among them: spread `CONTROLS` for ViewKit's own) and the optional `Input`, `Command` (deprecated), `Calendar`, `RowsWait`, `GroupBody` (deprecated), `SearchField`, `PortsHost`, `SelectionBar` and `ViewMenu`, the five ports (each optional: a missing one is its default, and with `CONTROLS` spread a missing `toast` or `confirm` is ViewKit's Toast or alert dialog) and the icon names. Implement
65
+ `views/docs/contract.md` lists the twenty-three required components (`TextBody`, `NumberBody`, `Picker`, `LinksBody`, `DateBody`, `PartsBody`, `ValuesBody`, `SortBody`, `FilterBody`, `FilterPartBody`, `FieldsBody`, `QuickFiltersBody`, `ViewsListBody` and `CustomizeBody` among them: spread `CONTROLS` for ViewKit's own) and the optional `Input`, `Command` (deprecated), `Calendar`, `RowsWait`, `GroupBody` (deprecated), `SearchField`, `PortsHost`, `SelectionBar`, `ViewMenu` and `Pane`, the five ports (each optional: a missing one is its default, and with `CONTROLS` spread a missing `toast` or `confirm` is ViewKit's Toast or alert dialog) and the icon names. Implement
66
66
  `ViewsComponents` over your own shadcn copies: a controlled `open` with `onOpenChange(open, details)`,
67
67
  an `anchor` element or ref on the popover and the menu, and no `asChild`; `AppIcon` is your own
68
68
  icon component by your own names. The shapes are Base UI's; `views/docs/contract.md`'s "Writing an