viewkitjs 0.26.0 → 0.27.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.
- package/CHANGELOG.md +24 -0
- package/MIGRATION.md +84 -6
- package/package.json +1 -1
- package/views/dist/contract.d.ts +171 -1
- package/views/dist/contract.js +162 -0
- package/views/dist/controls/compound-editor/map-parts-body.js +2 -1
- package/views/dist/controls/compound-editor/name-parts.js +10 -2
- package/views/dist/controls/compound-editor/place.d.ts +2 -1
- package/views/dist/controls/compound-editor/place.js +2 -0
- package/views/dist/controls/controls.d.ts +8 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/index.d.ts +16 -0
- package/views/dist/controls/index.js +16 -0
- package/views/dist/controls/internal/editor-parts.d.ts +40 -0
- package/views/dist/controls/internal/editor-parts.js +43 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +78 -0
- package/views/dist/controls/links-editor/links-editor.js +308 -0
- package/views/dist/controls/links-editor/links.d.ts +62 -0
- package/views/dist/controls/links-editor/links.js +50 -0
- package/views/dist/controls/links-editor/map-links-body.d.ts +10 -0
- package/views/dist/controls/links-editor/map-links-body.js +71 -0
- package/views/dist/controls/links-editor/tokens.d.ts +71 -0
- package/views/dist/controls/links-editor/tokens.js +20 -0
- package/views/dist/controls/links-editor/words.d.ts +56 -0
- package/views/dist/controls/links-editor/words.js +33 -0
- package/views/dist/controls/links-editor.css +132 -0
- package/views/dist/controls/number-editor/format.d.ts +31 -0
- package/views/dist/controls/number-editor/format.js +79 -0
- package/views/dist/controls/number-editor/looks.d.ts +14 -0
- package/views/dist/controls/number-editor/looks.js +17 -0
- package/views/dist/controls/number-editor/map-number-body.d.ts +16 -0
- package/views/dist/controls/number-editor/map-number-body.js +57 -0
- package/views/dist/controls/number-editor/number-editor.d.ts +72 -0
- package/views/dist/controls/number-editor/number-editor.js +202 -0
- package/views/dist/controls/number-editor/tokens.d.ts +28 -0
- package/views/dist/controls/number-editor/tokens.js +9 -0
- package/views/dist/controls/number-editor/words.d.ts +23 -0
- package/views/dist/controls/number-editor/words.js +13 -0
- package/views/dist/controls/number-editor.css +37 -0
- package/views/dist/controls/number-field/number-field.js +57 -5
- package/views/dist/controls/radio/radio.d.ts +33 -0
- package/views/dist/controls/radio/radio.js +19 -0
- package/views/dist/controls/radio/tokens.d.ts +127 -0
- package/views/dist/controls/radio/tokens.js +34 -0
- package/views/dist/controls/radio.css +104 -0
- package/views/dist/controls/text-editor/phone-number.d.ts +4 -0
- package/views/dist/controls/text-editor/phone-number.js +20 -0
- package/views/dist/controls/text-editor/text-editor.js +2 -19
- package/views/dist/controls/tokens.js +10 -0
- package/views/dist/controls/values-editor/looks.d.ts +16 -0
- package/views/dist/controls/values-editor/looks.js +19 -0
- package/views/dist/controls/values-editor/map-values-body.d.ts +12 -0
- package/views/dist/controls/values-editor/map-values-body.js +71 -0
- package/views/dist/controls/values-editor/tokens.d.ts +132 -0
- package/views/dist/controls/values-editor/tokens.js +35 -0
- package/views/dist/controls/values-editor/values-editor.d.ts +62 -0
- package/views/dist/controls/values-editor/values-editor.js +435 -0
- package/views/dist/controls/values-editor/values.d.ts +71 -0
- package/views/dist/controls/values-editor/values.js +59 -0
- package/views/dist/controls/values-editor/words.d.ts +50 -0
- package/views/dist/controls/values-editor/words.js +29 -0
- package/views/dist/controls/values-editor.css +207 -0
- package/views/dist/controls/views-list/looks.d.ts +13 -0
- package/views/dist/controls/views-list/looks.js +12 -0
- package/views/dist/controls/views-list/map-views-list-body.d.ts +19 -0
- package/views/dist/controls/views-list/map-views-list-body.js +65 -0
- package/views/dist/controls/views-list/rules.d.ts +72 -0
- package/views/dist/controls/views-list/rules.js +4 -0
- package/views/dist/controls/views-list/tokens.d.ts +11 -0
- package/views/dist/controls/views-list/tokens.js +5 -0
- package/views/dist/controls/views-list/views-list.d.ts +44 -0
- package/views/dist/controls/views-list/views-list.js +57 -0
- package/views/dist/controls/views-list/words.d.ts +22 -0
- package/views/dist/controls/views-list/words.js +3 -0
- package/views/dist/controls/views-list.css +8 -0
- package/views/dist/editors/NumberEditor.js +3 -1
- package/views/dist/grid/chrome/GridCellEditors.js +1 -1
- package/views/dist/grid/chrome/GridDateEditor.d.ts +3 -1
- package/views/dist/grid/chrome/GridDateEditor.js +2 -1
- package/views/dist/looks/index.d.ts +3 -0
- package/views/dist/looks/index.js +3 -0
- package/views/dist/looks/pieces.js +6 -0
- package/views/dist/provider/components.d.ts +4 -0
- package/views/dist/styles.css +432 -2
- package/views/dist/styles.unlayered.css +432 -2
- package/views/docs/contract.md +10 -8
- package/views/docs/controls/links-editor.md +25 -0
- package/views/docs/controls/number-editor.md +12 -0
- package/views/docs/controls/radio.md +39 -0
- package/views/docs/controls/values-editor.md +40 -0
- package/views/docs/controls/views-list.md +8 -0
- package/views/docs/reference/controls.md +117 -5
- package/views/docs/reference/looks.md +9 -2
- package/views/docs/reference/react.md +2 -2
package/views/docs/contract.md
CHANGED
|
@@ -419,7 +419,7 @@ grid's editors and menus use, each in Base UI's shape, and an adapter on Radix a
|
|
|
419
419
|
both fill every one.
|
|
420
420
|
|
|
421
421
|
**Defaults for an app that hands none:** `CONTROLS`, from `viewkitjs/views/controls`, holds ViewKit's default controls,
|
|
422
|
-
the Outright kit's, on Base UI: its controls (the Button, the Popover, the Sheet, the Input, the Checkbox, the Tooltip, the Menu), the Text editor as its `TextBody`, the Picker as its `Picker` and `FieldsBody`, the Date editor as its `DateBody`, the Date editor's days as its `Calendar`
|
|
422
|
+
the Outright kit's, on Base UI: its controls (the Button, the Popover, the Sheet, the Input, the Checkbox, the Tooltip, the Menu), the Text editor as its `TextBody`, the Picker as its `Picker` and `FieldsBody`, the Date editor as its `DateBody`, the Date editor's days as its `Calendar`, the Compound editor as its `PartsBody`, the Number editor as its `NumberBody`, the Values editor as its `ValuesBody`, the Links editor as its `LinksBody` and the views list as its `ViewsListBody`. An app spreads it first and its own after
|
|
423
423
|
(`components={{ ...CONTROLS, ...own }}`), so whatever it hands wins. That door alone needs `@base-ui/react`, an optional
|
|
424
424
|
peer; the provider and every other door import neither library, so an app that hands every control never installs it.
|
|
425
425
|
|
|
@@ -435,7 +435,7 @@ peer; the provider and every other door import neither library, so an app that h
|
|
|
435
435
|
|
|
436
436
|
`Picker`, optional: a whole pick list your app draws, `ViewsPickerProps`. Handed one, the select, several-values, place and relation editors open it, handed their rows as `ViewsPickerItem` data (a value, its words, a status slot or a colour, a glyph, a line, a group), what is held, the empty row's words, the search's words, create (`onCreate`, handed what was typed, returning the value it makes), and where your app adds options from a cell, the add (`onAdd`, handed what was typed, with `adding` while your app answers and `addRefused` for its refusal, and no `onCreate`), and `form`. The body hands back `onValueChange` (the pick, or the whole new list) and `onDone` (a pick of one is made). The editor keeps the draft, what each close means, Tab, Escape, the save and, on a phone, the panel's ✕ and ✓: at `form: "phone"` your body draws none of its own and hands every change as it is made. Tab is taken before your body hears it. Left out, these editors draw from `Command`; `CONTROLS.Picker` is ViewKit's own, the Picker. A status field's editor hands its active steps by value (`steps`): a row on a step between that isn't one (an archived option held) is placed nowhere, as a cell places it. A relation's list is filtered (a static source, by label) or fetched (a remote one, a page at a time) by the editor, never by your body: it hands every typed query to `onSearch` and draws `items` as handed, with `doing` (`searching` or `failed`), `onRetry` and `onMore` for a remote one. A relation's rows may carry a `badge` (a word telling kinds apart), a `glyph` (the record's own, unsized), an `avatarUrl` and the record's `kind`; its create rows come as `actions` (`ViewsPickerAction`), after the rows, and picking one closes the editor before it runs; a set whose field leads hands `lead` (which value leads, `onLead`, and its words). Held records come first while nothing is typed, and by the same search once something is. Its popover takes ViewKit's width and padding unless the provider's `bodyFrame` is `popover`, when it stands at your `Popover`'s own width, marked `data-vk-body="picker"`.
|
|
437
437
|
|
|
438
|
-
`LinksBody`, optional: a whole links body your app draws, `ViewsLinksBodyProps`, for a relation holding several records whose field declares `links` (each link may carry roles, and one may lead). Handed one, the set editor opens it in the grid and in a field row, in a popover on a computer and the sheet on a phone, in place of your `Picker` or ViewKit's own list; a relation with no `links` still opens those. It hands the field's name (`label`), the records as `ViewsPickerItem` data (`items`: the linked ones first, in the links' order, then the ones to add, filtered or fetched by the editor as for `Picker`, with `search`, `onSearch`, `doing`, `onRetry`, `onMore` and the create rows as `actions`), the links (`links`: `ViewsLink`s, `{ value, roles }`, in the order they stand), the field's roles in its order (`roles`: `ViewsLinkRole`s, `{ value, label, archived? }`; an archived one is handed so a link holding it shows its words and can let it go, and you offer it on that link alone), where the field leads `lead` (which value leads, `onLead`, and its words: making another lead never moves a line), what was typed on what opened it (`typed`), `autoFocus` and `form`, and in the phone's sheet `onStepChange`. The body hands back `onLinksChange` (the whole list, every change as it is made: a record linked, last and holding no role, or unlinked, a link's roles set) and `onDone` (it closes and saves the set). The editor drops from what comes back a value it never handed, a repeated link, a role the field doesn't declare, an archived role on a link that didn't hold it as the editor opened, and a role repeated; `onLead` with a value no link holds changes nothing. Unlinking the lead passes it to the first link left. The set saves with the lead first and, on each link, its roles in the key it was stored with: a link stored with `role` keeps `role` (its first role, or null), one stored with `roles` keeps `roles`, one stored with `role` alone gains `roles` beside it once it holds two or more, and a new link writes `roles` alone; a link whose roles didn't change is written as it was stored. Escape and Tab from inside your body's element are taken before your body hears them (Escape throws the set away; Tab walks your controls and closes from either end, which saves); a key in a popup your body draws outside its element, or in a level you mark `EDITOR_INNER_ESCAPE` inside it, is your body's. Its popover takes ViewKit's width and padding unless the provider's `bodyFrame` is `popover`, when it stands at your `Popover`'s own width, marked `data-vk-body="links"`.
|
|
438
|
+
`LinksBody`, optional: a whole links body your app draws, `ViewsLinksBodyProps`, for a relation holding several records whose field declares `links` (each link may carry roles, and one may lead). Handed one, the set editor opens it in the grid and in a field row, in a popover on a computer and the sheet on a phone, in place of your `Picker` or ViewKit's own list; a relation with no `links` still opens those. It hands the field's name (`label`), the records as `ViewsPickerItem` data (`items`: the linked ones first, in the links' order, then the ones to add, filtered or fetched by the editor as for `Picker`, with `search`, `onSearch`, `doing`, `onRetry`, `onMore` and the create rows as `actions`), the links (`links`: `ViewsLink`s, `{ value, roles }`, in the order they stand), the field's roles in its order (`roles`: `ViewsLinkRole`s, `{ value, label, archived? }`; an archived one is handed so a link holding it shows its words and can let it go, and you offer it on that link alone), where the field leads `lead` (which value leads, `onLead`, and its words: making another lead never moves a line), what was typed on what opened it (`typed`), `autoFocus` and `form`, and in the phone's sheet `onStepChange`. The body hands back `onLinksChange` (the whole list, every change as it is made: a record linked, last and holding no role, or unlinked, a link's roles set) and `onDone` (it closes and saves the set). The editor drops from what comes back a value it never handed, a repeated link, a role the field doesn't declare, an archived role on a link that didn't hold it as the editor opened, and a role repeated; `onLead` with a value no link holds changes nothing. Unlinking the lead passes it to the first link left. The set saves with the lead first and, on each link, its roles in the key it was stored with: a link stored with `role` keeps `role` (its first role, or null), one stored with `roles` keeps `roles`, one stored with `role` alone gains `roles` beside it once it holds two or more, and a new link writes `roles` alone; a link whose roles didn't change is written as it was stored. Escape and Tab from inside your body's element are taken before your body hears them (Escape throws the set away; Tab walks your controls and closes from either end, which saves); a key in a popup your body draws outside its element, or in a level you mark `EDITOR_INNER_ESCAPE` inside it, is your body's. Its popover takes ViewKit's width and padding unless the provider's `bodyFrame` is `popover`, when it stands at your `Popover`'s own width, marked `data-vk-body="links"`. `CONTROLS.LinksBody` is ViewKit's own, the Links editor: the search on top, the linked records as rows under the field's name, Roles and Lead (a link's roles ticked in the Picker under its button, the lead a radio, ✕ to unlink), the records to add under Add; on a phone a card per link, its roles on top. It hands every query back (`onSearch`), draws the records as handed, and draws `doing`, `onMore` and the create rows.
|
|
439
439
|
|
|
440
440
|
`Calendar`, optional: a calendar over ISO days, `ViewsCalendarProps`, which the date editor draws its month through, with its own typed line, quick days and time around it, and the default `RangeCalendar` atom draws the filter panel's month through (the date filter, its date ranges and its custom time scope). Reached without one, it throws an error naming it. Handed `DateBody`, the date editor never reaches it; the filter panel still does, unless the app hands its own `RangeCalendar` atom. `CONTROLS.Calendar` is ViewKit's own: a month of the Date editor's days, one day a press, so an app that spreads `CONTROLS` needs no `Calendar` of its own.
|
|
441
441
|
|
|
@@ -443,10 +443,10 @@ peer; the provider and every other door import neither library, so an app that h
|
|
|
443
443
|
|
|
444
444
|
`PartsBody`, optional: a whole body for a field made of parts your app draws, `ViewsPartsBodyProps`, by `kind`: `name`, `place` or `range`; `CONTROLS.PartsBody` is ViewKit's own, the Compound editor. Handed one, the name, place and range editors open it in the grid and in a field row, in a popover under the value (or over the cell at `gridBodyPlace` `over`, in the grid) on a computer and the sheet on a phone, handed the field's name, the draft as its parts, whether it may be emptied, what was typed on what opened it (already the first part's value where it reads as one), `autoFocus` and `form`. A name is handed `{ given, family, full }`, `full` as the editor's rule shows it: hand it back as handed unless the person typed one, and the editor keeps the full name following the parts until a name of its own is typed; a full name handed back as the parts joined follows them again. A place is handed its parts (`ViewsPlaceParts`), the boxes the field takes (`parts`, `ViewsPlacePart`s), those boxes in the country's own order (`rows`), each box's words for that country (`words`), the boxes it asks for (`required`), every country by name where the field takes the country (`countries`), the country's regions once loaded (`regions`), and `opens: "countries"` where the field takes a country and the place has none as the editor opens (read once, it stays as handed); the next render hands a new country's rows, words and regions. Its `regionCode` is the editor's, read from the region: a region named in the list (by its code, its name, its Latin name or its label, in any case) takes that region's label and code, any other has none, and a new country clears both. A range is handed its ends, the `decimals` the editor rounds to as it closes, its `unit` and its `bands`, which your body draws as picks. The body hands back `onValueChange` (the whole value, every change as it is made) and `onDone` (with no argument it closes as Enter does; `onDone("pick")` closes as a pick, a band picked). The editor keeps the draft, Escape's keep or throw-away by field type, the write check and the save and, on a phone, the panel's ✕ and ✓: at `form: "phone"` your body draws none of its own. Escape and Tab from inside your body's element are taken before your body hears them (Tab walks your controls and closes from either end); a key that starts in a popup your body draws outside its element (a list in a portal) is left to your body, and that popup carries `EDITOR_INNER_ESCAPE` on its root (from `viewkitjs/views/editors/panel`), so a popover that hears Escape on the document first leaves it to your popup. A level you draw inside your element (a list in your boxes' place) may carry `EDITOR_INNER_ESCAPE` too: its Escape is your body's, and the editor stays open. Call `preventDefault()` on that Escape as you close your level, so nothing around the editor takes it too (a list's Escape that clears its selection). Enter is your body's. In the phone's sheet your body is handed `onStepChange`: hand it a step of your own (`ViewsBodyStep`, its `title` and `onBack`) while you stand on one, and `null` once you are back (*The sheet's head*). Its popover takes ViewKit's width and padding unless the provider's `bodyFrame` is `popover`, when it stands at your `Popover`'s own width, marked `data-vk-body="parts"`.
|
|
445
445
|
|
|
446
|
-
`ValuesBody`, optional: a whole body for a field holding several emails, phones, links or domains, which your app draws, `ViewsValuesBodyProps
|
|
446
|
+
`ValuesBody`, optional: a whole body for a field holding several emails, phones, links or domains, which your app draws, `ViewsValuesBodyProps`; `CONTROLS.ValuesBody` is ViewKit's own, the Values editor. Handed one, the value list editor opens it in the grid and in a field row, in a popover under the values (or over the cell at `gridBodyPlace` `over`, in the grid) on a computer and the sheet on a phone, handed the field's name (`label`), its type (`kind`: `email`, `phone`, `url` or `domain`), the draft as lines (`ViewsValueLine`: `{ value, label?, main }`, the main one first; `[]` when there are none, so your body draws its own line for adding one), whether a value carries a label (`labels`; false, draw none and none is saved), `holds` (`one` where the field holds one value: one line, no label, no main mark, no line to add another while it holds one), a phone's country (`region`, where a number typed without its code is read), whether it may be emptied, what was typed on what opened it (already the one line's value), `autoFocus` and `form`, and `check`, the field's own reading of a value: its reason in your app's words, or null when it reads, for your body to say as a value is added or changed. The body hands back `onValueChange` (the whole list, every change as it is made) and `onDone` (it closes as Enter does: the grid moves one row down). A line handed back as it was drawn keeps what is stored, so a phone or a link is not rewritten by opening the editor. The editor keeps the draft, Escape's keep or throw-away by field type, the write check and the save and, on a phone, the panel's ✕ and ✓: at `form: "phone"` your body draws none of its own. Escape and Tab from inside your body's element are taken before your body hears them (Tab walks your controls and closes from either end); a key that starts in a popup your body draws outside its element (a label list in a portal) is left to your body, and that popup carries `EDITOR_INNER_ESCAPE` on its root. A level you draw inside your element (a list in your rows' place) may carry `EDITOR_INNER_ESCAPE` too: its Escape is your body's, and the editor stays open. Call `preventDefault()` on that Escape as you close your level, so nothing around the editor takes it too (a list's Escape that clears its selection). Enter is your body's. In the phone's sheet your body is handed `onStepChange`: hand it a step of your own (`ViewsBodyStep`, its `title` and `onBack`) while you stand on one, and `null` once you are back (*The sheet's head*). Three things differ from the editor's own rows: a list the write check refuses is said once, under your body in the panel, rather than under each row; where Escape keeps, an Escape over a refused list shows the reason and a second Escape throws the edit away, where the editor's own rows hold Escape until every row reads; and focus leaving your body other than by Tab doesn't close the editor (a press outside does). Its popover takes ViewKit's width and padding unless the provider's `bodyFrame` is `popover`, when it stands at your `Popover`'s own width, marked `data-vk-body="values"`.
|
|
447
447
|
|
|
448
448
|
`TextBody`, optional: a whole body for a field typed as one string (a line of text, an email, a phone, a link, a domain, long text or rich text), which your app draws, `ViewsTextBodyProps`; `CONTROLS.TextBody` is ViewKit's own, the Text editor. Handed one, the grid's and a field row's text editors open it: in a grid cell on a computer, every text the person may write, long text and a line the cell cut off included (lifted over the rows below and the frozen columns as ViewKit's own grown editor is; a body growing past the scroll box at the last row is your body's to handle: open upward, or scroll inside), in the sheet on a phone, and in place in a field row at every width. A text opened only to be read keeps the editor's own panel. It is handed the field's name (`label`), its text type (`kind`: `text`, `url`, `domain`, `email`, `phone` or `rich_text`), whether it is a paragraph (`paragraph`: long text and rich text), the draft (`value`, a string), a phone's country (`region`, where a number typed without its code is read; the phone opens written out), what was typed on what opened it (`typed`, already the draft), `autoFocus`, `form` (`phone` in the sheet, `computer` anywhere in place), and `check`, the host's own reading of a value: its reason in your app's words, or null when it reads, for your body to say as it is typed. The body hands back `onValueChange` (the whole text, every change as it is made) and `onDone` (it closes as Enter does: the grid moves one row down). The editor keeps the draft, Escape's keep or throw-away by field type, Tab, the close's tidy (a line's line breaks become a space; a phone handed back that reads as the stored number writes nothing), the write check and the save, and it draws the reason a value is refused (under the cell, in the sheet, under a field row's box): draw none of your own at the close. Escape, Tab and ⌘ or Ctrl Enter from inside your body's element are taken before your body hears them (Tab walks your controls and closes from either end; ⌘ or Ctrl Enter closes as Enter; in place, a Tab between your controls moves the focus but your own key handlers don't hear it). Enter and Shift Enter are your body's and do what the editor's own do: on a line they call `onDone()`, in a paragraph they make a new line; a step of your own that lists choices (a phone's countries) may take Enter for its pick. A key that starts in a popup your body draws outside its element (a country list in a portal) is left to your body; that popup carries `EDITOR_INNER_ESCAPE` on its root, takes the focus while it is open, and hands it back to your body when it closes. A level you draw inside your element (a list in your box's place) may carry `EDITOR_INNER_ESCAPE` too: its Escape is your body's, and the editor stays open. Call `preventDefault()` on that Escape as you close your level, so nothing around the editor takes it too (a list's Escape that clears its selection). In place, the focus leaving your body for anywhere else closes the editor as a press outside does; a press on your body's own surface doesn't. At `form: "phone"` your body draws no ✕, ✓ or Cancel of its own: the sheet holds them. In the phone's sheet your body is handed `onStepChange`: hand it a step of your own (`ViewsBodyStep`, its `title` and `onBack`, as for a phone's countries) while you stand on one, and `null` once you are back (*The sheet's head*).
|
|
449
|
-
`NumberBody`, optional: a whole body for a number, money or a percent, which your app draws, `ViewsNumberBodyProps`. Handed one, the grid's and a field row's number editors open it: in the grid cell on a computer (lifted over the rows below and the frozen columns as ViewKit's own grown editor is; a body growing past the scroll box at the last row is your body's to handle), in the sheet on a phone, and in place in a field row at every width. A number formatted as a duration keeps the editor's own box. It is handed the field's name (`label`), its kind (`kind`: `number`, `money` or `percent`; a percent is stored 0 to 100, the value is the percent), the draft (`value`: a number, `null` when empty, `NaN` when what is in the box reads as no number), its unit (`unit`: money's currency code or a number's unit) and the units it may be put in (`units`; absent, the unit is shown with nothing to press), the digits the field keeps (`decimals`), its limits (`min`, `max`; a percent 0 and 100 unless the field widens them), how your people write a number (`locale`, and `decimal`, the separator where your app states one), whether it may be emptied (`empty`), where the figure stands (`align`: `end` in the grid, `start` in a field row), what was typed on what opened it (`typed`; `value` is its reading, or `NaN`), `autoFocus`, `form` (`phone` in the sheet, `computer` anywhere in place), and `check`, the host's own reading of a value and its unit, asked with the value rounded to `decimals`: its reason in your app's words, or null. The body hands back `onValueChange` (a number, never text: `null` when its box is emptied, `NaN` for text that reads as no number, and the unit when it is one of `units`; every change as it is made) and `onDone` (it closes as Enter does: the grid moves one row down). Read what is typed in your box with `locale` and `decimal`; the editor rounds to `decimals`, so hand what was typed. The editor keeps the draft, the rounding, Escape's keep or throw-away by field type, Tab, the close (`NaN` writes nothing; empty clears only where it may be emptied; a value that rounds to the stored one writes nothing), the write check and the save, and it draws the reason a value is refused: draw none of your own at the close. A unit handed back that isn't one of `units` is ignored. Escape, Tab and ⌘ or Ctrl Enter from inside your body's element are taken before your body hears them (Tab walks your controls and closes from either end; ⌘ or Ctrl Enter closes as Enter). Enter, Shift Enter and Alt Enter are your body's and call `onDone()`, as the editor's own box closes on Enter with any modifier; your own unit list may take Enter for its pick. A key that starts in a popup your body draws outside its element (a unit list in a portal) is left to your body; that popup carries `EDITOR_INNER_ESCAPE` on its root, takes the focus while it is open, and hands it back to your body when it closes. A level you draw inside your element may carry `EDITOR_INNER_ESCAPE` too: its Escape is your body's, and the editor stays open. Call `preventDefault()` on that Escape as you close your level, so nothing around the editor takes it too (a list's Escape that clears its selection). In place, the focus leaving your body for anywhere else closes the editor as a press outside does; a press on your body's own surface doesn't. At `form: "phone"` your body draws no ✕, ✓ or Cancel of its own: the sheet holds them.
|
|
449
|
+
`NumberBody`, optional: a whole body for a number, money or a percent, which your app draws, `ViewsNumberBodyProps`. Handed one, the grid's and a field row's number editors open it: in the grid cell on a computer (lifted over the rows below and the frozen columns as ViewKit's own grown editor is; a body growing past the scroll box at the last row is your body's to handle), in the sheet on a phone, and in place in a field row at every width. A number formatted as a duration keeps the editor's own box. It is handed the field's name (`label`), its kind (`kind`: `number`, `money` or `percent`; a percent is stored 0 to 100, the value is the percent), the draft (`value`: a number, `null` when empty, `NaN` when what is in the box reads as no number), its unit (`unit`: money's currency code or a number's unit) and the units it may be put in (`units`; absent, the unit is shown with nothing to press), the digits the field keeps (`decimals`), its limits (`min`, `max`; a percent 0 and 100 unless the field widens them), how your people write a number (`locale`, and `decimal`, the separator where your app states one), whether it may be emptied (`empty`), where the figure stands (`align`: `end` in the grid, `start` in a field row), what was typed on what opened it (`typed`; `value` is its reading, or `NaN`), `autoFocus`, `form` (`phone` in the sheet, `computer` anywhere in place), and `check`, the host's own reading of a value and its unit, asked with the value rounded to `decimals`: its reason in your app's words, or null. The body hands back `onValueChange` (a number, never text: `null` when its box is emptied, `NaN` for text that reads as no number, and the unit when it is one of `units`; every change as it is made) and `onDone` (it closes as Enter does: the grid moves one row down). Read what is typed in your box with `locale` and `decimal`; the editor rounds to `decimals`, so hand what was typed. The editor keeps the draft, the rounding, Escape's keep or throw-away by field type, Tab, the close (`NaN` writes nothing; empty clears only where it may be emptied; a value that rounds to the stored one writes nothing), the write check and the save, and it draws the reason a value is refused: draw none of your own at the close. A unit handed back that isn't one of `units` is ignored. Escape, Tab and ⌘ or Ctrl Enter from inside your body's element are taken before your body hears them (Tab walks your controls and closes from either end; ⌘ or Ctrl Enter closes as Enter). Enter, Shift Enter and Alt Enter are your body's and call `onDone()`, as the editor's own box closes on Enter with any modifier; your own unit list may take Enter for its pick. A key that starts in a popup your body draws outside its element (a unit list in a portal) is left to your body; that popup carries `EDITOR_INNER_ESCAPE` on its root, takes the focus while it is open, and hands it back to your body when it closes. A level you draw inside your element may carry `EDITOR_INNER_ESCAPE` too: its Escape is your body's, and the editor stays open. Call `preventDefault()` on that Escape as you close your level, so nothing around the editor takes it too (a list's Escape that clears its selection). In place, the focus leaving your body for anywhere else closes the editor as a press outside does; a press on your body's own surface doesn't. At `form: "phone"` your body draws no ✕, ✓ or Cancel of its own: the sheet holds them. In the phone's sheet your body is handed `onStepChange`: hand it a step of your own (`ViewsBodyStep`, its `title` and `onBack`, as for money's currencies) while you stand on one, and `null` once you are back (*The sheet's head*).
|
|
450
450
|
|
|
451
451
|
`SortBody`, optional: the sort editor's whole body, which your app draws, `ViewsSortBodyProps`. Handed one, the sort pill opens it in place of ViewKit's own sort editor: in its popover on a computer (or your `host`, where the toolbar is handed one) and in the Sheet on a phone, and so does anything else that opens `SortEditor` or `useSortEditor`'s body. It is handed the sort's name (`label`), the fields the list sorts by (`options`, each its sort key, its words and the direction a new rule takes, and, marked as the grid's header marks its column, its field's `type`, the `part` it sorts by and the header's `glyph`, drawn with your icons; the three absent for an option your app built with no column behind it), the rules in order, the first sorting first (`rules`, each a sort key and `asc` or `desc`), the sorts set aside after them (`setAside`, each holding one of the places until it is put back or deleted; `[]` when there are none), how many rules at most (`max`, a set-aside sort holding one of the places), `form`, and `addSort`, true on a computer where what holds it has no + of its own (the dashed Sort, while only set-aside sorts stand, and a pill handed `addAfter={false}`), so Add sort stands at your body's foot; a phone's body always has one. The body hands back `onRulesChange` (the whole rules in order and, when handed, the set-aside sorts kept, any left out deleted, absent keeping every one; every change as it is made: a move, a direction, a removal, an added rule, a set-aside sort put back or deleted) and `onDone` (the job is done and what holds it closes). On a phone where the sheet's head doesn't draw them (the provider's `sheetActions` at `bar`), it is handed `actions`, the ✕ (`close`, which takes the rules and the set-aside sorts back to what they were as the sheet opened) and ✓ (`done`, which keeps them) for its own head; on a computer, and under `head`, where the sheet holds them, it is handed none. ViewKit keeps the rest: it checks each list against the rules (each rule one of `options`, each field sorted once, each set-aside sort one the list holds, `max` at most, a set-aside sort counted) and writes nothing when one breaks them; it keeps the latest rules between renders, so two changes before the next render both land; on a computer it closes the popover when the last rule goes with no set-aside sort left; and it keeps what ✕ takes back to. The + after the pill, the empty Sort and Sort on the row's right open your `FieldsBody` where you hand one, else ViewKit's own list of fields. A body that ignores `setAside` shows an empty panel at the dashed Sort, where only set-aside sorts stand.
|
|
452
452
|
|
|
@@ -458,7 +458,7 @@ peer; the provider and every other door import neither library, so an app that h
|
|
|
458
458
|
|
|
459
459
|
`SearchField`, optional: the toolbar's search box, which your app draws, `ViewsSearchFieldProps`. Handed one, the search opens it wherever it opens its own field, in place of its frame's glass, field and ✕, on a computer and on a phone: from its button on the row and beside the phone's views, and filling its line in the narrow panel and on a phone with no views. It is handed the value, `onChange` (every keystroke), the placeholder, its name (`label`), `searching` and its words (`searchingLabel`), the clear (`onClear`, its name in `clearLabel`, and `closes`: opened from its button, your clear stands while it is open, empty or not, and closes it; filling its line, show it only while it holds a value), `form` (`computer` or `phone`) and `fill`. ViewKit keeps its button while shut, whether it is open, the caret on a press (in the first `input` inside your box), Escape and a blur with nothing typed, caught on its frame around your box: an Escape your box keeps for itself, `preventDefault` it, and a button of your own inside the box `preventDefault`s its `mousedown`, as ViewKit's ✕ does, so the box keeps its focus (a browser that doesn't focus a button on a click gives the blur no target). Fill the frame's width; on a phone, a text of 16px keeps iOS from zooming the page.
|
|
460
460
|
|
|
461
|
-
`ViewsListBody`, optional: the views list's whole body, which your app draws, `ViewsViewsListBodyProps`. Handed one, the view picker's chip opens it in place of ViewKit's own list of views: in its popover on a computer and in the Sheet on a phone. The row's pills and its "+N" list stay ViewKit's. It is handed the list's name (`label`), the axis's views in its order (`views`, each its `value`, its words, its `icon`, its `count` (absent while the list's counts are hidden), `private` for one of the reader's own, and `menu`, the view's own verbs as your app gave them), the view in use (`value`), `form`, and, where the axis has them, `onCreate` with its word (`createLabel`; what holds the list closes first, then the axis's own create runs) and `onReorder` with `canDrag`. The body hands back `onViewChange` (a view picked; it closes nothing, so call `onDone` after it, as ViewKit's own list closes on a pick), `onReorder` (one whole block, the shared views or the reader's own, in its new order, each once) and `onDone` (what holds it closes). On a phone where the sheet's head doesn't draw it (the provider's `sheetActions` at `bar`), it is handed `actions`, the ✕ alone (`close`, which closes the list); on a computer, and under `head`, it is handed none. ViewKit checks each value before it is written: a pick that isn't one of `views`, and an order that isn't one whole block, write nothing. What creating, reordering and a view's verbs mean stays your app's, as the axis says.
|
|
461
|
+
`ViewsListBody`, optional: the views list's whole body, which your app draws, `ViewsViewsListBodyProps`. Handed one, the view picker's chip opens it in place of ViewKit's own list of views: in its popover on a computer and in the Sheet on a phone. The row's pills and its "+N" list stay ViewKit's. It is handed the list's name (`label`), the axis's views in its order (`views`, each its `value`, its words, its `icon`, its `count` (absent while the list's counts are hidden), `private` for one of the reader's own, and `menu`, the view's own verbs as your app gave them), the view in use (`value`), `form`, and, where the axis has them, `onCreate` with its word (`createLabel`; what holds the list closes first, then the axis's own create runs) and `onReorder` with `canDrag`. The body hands back `onViewChange` (a view picked; it closes nothing, so call `onDone` after it, as ViewKit's own list closes on a pick), `onReorder` (one whole block, the shared views or the reader's own, in its new order, each once) and `onDone` (what holds it closes). On a phone where the sheet's head doesn't draw it (the provider's `sheetActions` at `bar`), it is handed `actions`, the ✕ alone (`close`, which closes the list); on a computer, and under `head`, it is handed none. ViewKit checks each value before it is written: a pick that isn't one of `views`, and an order that isn't one whole block, write nothing. What creating, reordering and a view's verbs mean stays your app's, as the axis says. `CONTROLS.ViewsListBody` is ViewKit's own, the views list: a search over the views (at the Sheet's foot on a phone), each with its glyph, its count and its ⋮ where you hand it a menu, Shared and the reader's own under their headings with a lock on each of the reader's own, a view moved by a drag or ⌥↑ ⌥↓ within its block (never one `canDrag` refuses, nor a view dropped past one), ↓ and ↑ going on from the view in use, and New view where the axis grows. It draws no ✕ of its own: the Sheet's head draws it, and `actions` goes unread.
|
|
462
462
|
|
|
463
463
|
`GroupBody`, optional: the group editor's whole body, which your app draws, `ViewsGroupBodyProps`. Handed one, Customize's Group opens it in place of ViewKit's own group pages (Group by, its order, its date step, the groups): on a computer and in the phone's Sheet. It is for an app that keeps ViewKit's Customize: an app that hands its own `CustomizeBody` holds its group editor inside it, handed the same props. It is handed the group's name (`label`), the fields the list can be grouped by (`dimensions`, each its `value`, its words, its `orderOptions` with the direction each opens in, its `defaultOrder`, and a date's `granularities` with its `defaultGranularity`), the group as one value (`group`, a `ViewsGroupValue`: the dimension grouped by or `none`, the active dimension's `order` (`mode` and `dir`), its date step (`granularity`), `hideEmpty` while grouped where the list offers it, and `groups` while grouped where the list hands them, in the order the list shows them, each its `key`, its words, `empty` and `hidden`; no group carries a count), `manualOrder` (your own order, `manual`, may be picked) and `form`. The body hands back `onGroupChange` (the whole group, every change as it is made) and `onDone` (inside Customize, back to its list). ViewKit makes one write for each change, in this order: a new Group by, order or date step is written alone, the rest of the value (about the old field's groups) set aside; else Hide empty groups; else the groups: the same groups in a new order (your own order), one group shown or hidden, every group hidden, or every group shown. A new Group by keeps the order and step handed with it only where the new field offers them, else takes the field's own. A value that changes two of those at once, names a field the list doesn't offer, names an order or step the field grouped by doesn't offer, or adds or loses a group writes nothing. Inside Customize, whose own head holds the ✕, it is handed no `actions`.
|
|
464
464
|
|
|
@@ -535,7 +535,7 @@ keeps the rules as they are, and `actions.close` takes them back to what they we
|
|
|
535
535
|
your sheet's own (a swipe, the dim, Escape) keeps them, as ✓ does. Draw both, or the one button left throws a
|
|
536
536
|
person's changes away.
|
|
537
537
|
|
|
538
|
-
**A body's step.** While an editor's body stands on a step of its own (a `TextBody`, `PartsBody`, `ValuesBody` or `LinksBody` hands
|
|
538
|
+
**A body's step.** While an editor's body stands on a step of its own (a `TextBody`, `NumberBody`, `PartsBody`, `ValuesBody` or `LinksBody` hands
|
|
539
539
|
one through `onStepChange`), the editor's sheet is handed the step's title as `title` and `label`, in place of the
|
|
540
540
|
field's name, and, under `head`, `actions.back` too: draw Back in `actions.close`'s place, on the left, with your own back
|
|
541
541
|
arrow, and keep ✓. The panel's own bar does the same under `bar`. Back and an Escape your sheet reports as `escape-key`
|
|
@@ -802,7 +802,7 @@ message, read from the conventions the provider carries. The package's are a clo
|
|
|
802
802
|
`views.editors.*`, `views.menus.*`, `views.display.*`, `views.selection.*`, `views.panels.*` and `views.field-row.*`: `views.editors.tag-remove` (`{ label }`),
|
|
803
803
|
`views.editors.marker-resolve`, `views.editors.marker-no-reason`, `views.editors.range-low` and
|
|
804
804
|
`views.editors.range-high` (a range editor's two boxes, "From" and "To"), and `views.editors.name-given`,
|
|
805
|
-
`views.editors.name-family` and `views.editors.name-full` (a name editor's three boxes: "First name", "Last name" and "Full name"; the first two the default controls' Compound editor's words too); the Compound editor's own (`CONTROLS.PartsBody`): `views.editors.name-shown-as` ("Shown as", the full name's box), `views.editors.name-follows` and `views.editors.name-own` (under the full name, while it follows the parts and once it is its own), `views.editors.name-own-mark` ("Its own"), `views.editors.place-no-country` ("No country", its list's empty row), `views.editors.place-no-region` (`{ region }`, "No {region}"), `views.editors.place-search-for-region` (`{ region }`, "Search for a {region}"), `views.editors.place-pick` ("Select…", an empty country or region box), in the country-first look `views.editors.place-find-country` ("Find a country"), `views.editors.place-find-region` (`{ region }`, "Find a {region}"), `views.editors.place-choose-country` ("Choose a country") and `views.editors.place-choose-region` (`{ region }`, "Choose a {region}"), and the boxes' words while no country is held: `views.editors.place-street` ("Street address"), and in the country-first look `views.editors.place-street-number` ("Street and number", "Street" on a phone: `views.editors.place-street-short`), `views.editors.place-line2-plain` ("Line 2") and `views.editors.place-postcode` ("Postcode"), beside `views.editors.place-city-city`, `views.editors.place-postal-postal`, `views.editors.place-region-state` and `views.editors.place-region`; and its number boxes' `views.editors.number-increase` ("Increase"), `views.editors.number-decrease` ("Decrease") and `views.editors.number-field` ("Number field", what a screen reader calls one); `views.editors.values-add` ("Add"), `views.editors.values-label` ("Label"), `views.editors.values-main` ("Main", the main value's mark), `views.editors.values-make-main` (`{ value }`, "Make {value} the main one") and `views.editors.values-remove` (`{ value }`, "Remove {value}") (a value list editor's rows); `views.editors.discard` ("Discard", the editor sheet's ✕), `views.editors.save` ("Save", its ✓) and `views.editors.back` ("Back", in ✕'s place while a body stands on a step of its own); `views.editors.open-email`, `views.editors.open-phone` and `views.editors.open-link` (`{ value }`, "Email {value}", "Call {value}", "Open {value}", the open action beside a stored value in a phone's sheet); `views.editors.add-option` (`{ value }`, "Add “{value}”", the row that asks the app to add a typed word as an option), `views.editors.adding-option` (`{ value }`, "Adding “{value}”…", that row while the app answers), `views.editors.add-failed` (`{ value }`, "Couldn't add “{value}”", an add that failed with no words of its own) and `views.editors.add-not-listed` (`{ value }`, "Added “{value}”, but the list hasn't shown it yet", an added option the field's options still don't carry after five seconds); the place editor's: `views.editors.place-country` ("Country"), `views.editors.place-country-search` ("Search for a country"), `views.editors.place-change-country` ("Change country"), `views.editors.place-region-search` ("Search"), `views.editors.place-line1` ("Address line 1"), `views.editors.place-line2` ("Address line 2"), `views.editors.place-required` (`{ label }`, "{label} *", a part its country asks for), the region's words `views.editors.place-region-area`, `views.editors.place-region-county`, `views.editors.place-region-department`, `views.editors.place-region-district`, `views.editors.place-region-do-si`, `views.editors.place-region-emirate`, `views.editors.place-region-island`, `views.editors.place-region-oblast`, `views.editors.place-region-parish`, `views.editors.place-region-prefecture`, `views.editors.place-region-province` and `views.editors.place-region-state`, the city's `views.editors.place-city-city`, `views.editors.place-city-district`, `views.editors.place-city-post-town` and `views.editors.place-city-suburb`, and the postal code's `views.editors.place-postal-eircode`, `views.editors.place-postal-pin`, `views.editors.place-postal-postal` and `views.editors.place-postal-zip` (each its word in English: "County", "Do/Si", "Post town", "PIN code", "ZIP code"); `placeWordKey(kind, word)` gives the key for a word `placeFormat` names; `views.editors.place-region` ("Region") beside the place editor's `views.editors.place-country`,
|
|
805
|
+
`views.editors.name-family` and `views.editors.name-full` (a name editor's three boxes: "First name", "Last name" and "Full name"; the first two the default controls' Compound editor's words too); the Compound editor's own (`CONTROLS.PartsBody`): `views.editors.name-shown-as` ("Shown as", the full name's box), `views.editors.name-follows` and `views.editors.name-own` (under the full name, while it follows the parts and once it is its own), `views.editors.name-own-mark` ("Its own"), `views.editors.place-no-country` ("No country", its list's empty row), `views.editors.place-no-region` (`{ region }`, "No {region}"), `views.editors.place-search-for-region` (`{ region }`, "Search for a {region}"), `views.editors.place-pick` ("Select…", an empty country or region box), in the country-first look `views.editors.place-find-country` ("Find a country"), `views.editors.place-find-region` (`{ region }`, "Find a {region}"), `views.editors.place-choose-country` ("Choose a country") and `views.editors.place-choose-region` (`{ region }`, "Choose a {region}"), and the boxes' words while no country is held: `views.editors.place-street` ("Street address"), and in the country-first look `views.editors.place-street-number` ("Street and number", "Street" on a phone: `views.editors.place-street-short`), `views.editors.place-line2-plain` ("Line 2") and `views.editors.place-postcode` ("Postcode"), beside `views.editors.place-city-city`, `views.editors.place-postal-postal`, `views.editors.place-region-state` and `views.editors.place-region`; and its number boxes' `views.editors.number-increase` ("Increase"), `views.editors.number-decrease` ("Decrease") and `views.editors.number-field` ("Number field", what a screen reader calls one); the Number editor's own (`CONTROLS.NumberBody`): `views.editors.number-unit` ("Unit", a number's units' list, as `views.menus.currency` names money's), `views.editors.number-find-currency` ("Find a currency") and `views.editors.number-search-currency` ("Search for a currency", on a phone), `views.editors.number-find-unit` ("Find a unit") and `views.editors.number-search-unit` ("Search for a unit"), and `views.editors.number-unit-named` (`{ unit, name }`, "{unit}: {name}", the code button's name, "Currency: Euro"); `views.editors.values-add` ("Add"), `views.editors.values-label` ("Label"), `views.editors.values-main` ("Main", the main value's mark), `views.editors.values-make-main` (`{ value }`, "Make {value} the main one") and `views.editors.values-remove` (`{ value }`, "Remove {value}") (a value list editor's rows); the Values editor's own (`CONTROLS.ValuesBody`): `views.editors.values-line-email` ("Add email…"), `views.editors.values-line-link` ("Add link…"), `views.editors.values-line-domain` ("Add domain…"), `views.editors.values-card-line-email` ("Add email", on a phone's card), `views.editors.values-card-line-link` ("Add link"), `views.editors.values-card-line-domain` ("Add domain"), `views.editors.values-add-email` ("Add an email"), `views.editors.values-add-phone` ("Add a phone"), `views.editors.values-add-link` ("Add a link"), `views.editors.values-add-domain` ("Add a domain"), `views.editors.values-nth-email` (`{ n }`, "email {n}"), `views.editors.values-nth-phone` (`{ n }`, "phone {n}"), `views.editors.values-nth-link` (`{ n }`, "link {n}"), `views.editors.values-nth-domain` (`{ n }`, "domain {n}"), `views.editors.values-change` (`{ value }`, "Change {value}"), `views.editors.values-copy` (`{ value }`, "Copy {value}"), `views.editors.values-move` (`{ value }`, "Move {value}"), `views.editors.values-label-is` (`{ label }`, "Label: {label}"), `views.editors.values-no-label` ("none"), `views.editors.values-label-search` ("Search or type a label"), `views.editors.values-label-find` ("Find or type a label"), `views.editors.values-country-code` ("Country code"), `views.editors.values-country-is` (`{ country }`, "Country: {country}"), `views.editors.values-country-code-is` (`{ country }`, "Country code: {country}"), `views.editors.values-back-to` (`{ label }`, "Back to {label}"), `views.editors.values-label-work` ("Work"), `views.editors.values-label-personal` ("Personal"), `views.editors.values-label-mobile` ("Mobile"), `views.editors.values-label-other` ("Other"); `views.editors.discard` ("Discard", the editor sheet's ✕), `views.editors.save` ("Save", its ✓) and `views.editors.back` ("Back", in ✕'s place while a body stands on a step of its own); `views.editors.open-email`, `views.editors.open-phone` and `views.editors.open-link` (`{ value }`, "Email {value}", "Call {value}", "Open {value}", the open action beside a stored value in a phone's sheet); `views.editors.add-option` (`{ value }`, "Add “{value}”", the row that asks the app to add a typed word as an option), `views.editors.adding-option` (`{ value }`, "Adding “{value}”…", that row while the app answers), `views.editors.add-failed` (`{ value }`, "Couldn't add “{value}”", an add that failed with no words of its own) and `views.editors.add-not-listed` (`{ value }`, "Added “{value}”, but the list hasn't shown it yet", an added option the field's options still don't carry after five seconds); the place editor's: `views.editors.place-country` ("Country"), `views.editors.place-country-search` ("Search for a country"), `views.editors.place-change-country` ("Change country"), `views.editors.place-region-search` ("Search"), `views.editors.place-line1` ("Address line 1"), `views.editors.place-line2` ("Address line 2"), `views.editors.place-required` (`{ label }`, "{label} *", a part its country asks for), the region's words `views.editors.place-region-area`, `views.editors.place-region-county`, `views.editors.place-region-department`, `views.editors.place-region-district`, `views.editors.place-region-do-si`, `views.editors.place-region-emirate`, `views.editors.place-region-island`, `views.editors.place-region-oblast`, `views.editors.place-region-parish`, `views.editors.place-region-prefecture`, `views.editors.place-region-province` and `views.editors.place-region-state`, the city's `views.editors.place-city-city`, `views.editors.place-city-district`, `views.editors.place-city-post-town` and `views.editors.place-city-suburb`, and the postal code's `views.editors.place-postal-eircode`, `views.editors.place-postal-pin`, `views.editors.place-postal-postal` and `views.editors.place-postal-zip` (each its word in English: "County", "Do/Si", "Post town", "PIN code", "ZIP code"); `placeWordKey(kind, word)` gives the key for a word `placeFormat` names; `views.editors.place-region` ("Region") beside the place editor's `views.editors.place-country`,
|
|
806
806
|
`views.editors.place-city-city` and `views.editors.place-postal-postal`, a place's parts in a panel;
|
|
807
807
|
`views.menus.part-row` (`{ field, part }`, one part's row in a panel: "Location · Country");
|
|
808
808
|
the grid's column menu: `views.menus.sort-asc` ("Sort ascending"), `views.menus.sort-desc`, `views.menus.sort-clear`
|
|
@@ -899,12 +899,14 @@ sort), `views.panels.group-none` ("None") and
|
|
|
899
899
|
Wrap"), `views.panels.toggle-reset-hint` ("Back to your default") and `views.panels.search-clear` ("Clear"). The
|
|
900
900
|
panels' label functions take the resolver last; each defaults to `resolveViewsMessage`.
|
|
901
901
|
The Picker's own words, which `CONTROLS.Picker` and `CONTROLS.FieldsBody` hand it from these keys as its `words`: `views.picker.searching` ("Searching…"), `views.picker.failed` ("Couldn't search."), `views.picker.failed-line` ("Check the connection and try again."), `views.picker.retry` ("Try again"), `views.picker.none-typed` (`{ typed }`, "Nothing matches “Zed”."), `views.picker.nothing-matches` ("Nothing matches."), `views.picker.create` (`{ typed }`, "Create “Zed”"), `views.picker.create-button` ("Create"), `views.picker.loading-more` ("Loading more…"), `views.picker.chosen` (`{ count }`, "2 chosen"), `views.picker.clear-all` ("Clear all"), `views.picker.selected` ("Selected"), `views.picker.selected-count` (`{ count }`, "Selected · 2"), `views.picker.selected-fixed` ("Selected · can't be empty"), `views.picker.cancel` ("Cancel"), `views.picker.save` ("Save"), `views.picker.type-to-search` ("Type to look one up."), `views.picker.actions` ("Actions"), `views.picker.back` (`{ label }`, "Back to Company"), `views.picker.row-actions` (`{ label }`, "Actions for Company"), `views.picker.you` ("you").
|
|
902
|
+
|
|
903
|
+
The Links editor's own words, which `CONTROLS.LinksBody` hands it from these keys (with the Picker's where the words are the same: `views.picker.nothing-matches`, `none-typed`, `row-actions`, `back`, `save`, `searching`, `failed`, `retry` and `loading-more`, `views.panels.close`, and the slot's `lead.makeLabel` for a link's Make lead): `views.editors.links-search` ("Search…"), `views.editors.links-roles` ("Roles"), `views.editors.links-add` ("Add"), `views.editors.links-add-to` (`{ label }`, "Add to Companies"), `views.editors.links-link` (`{ label }`, "Link Acme"), `views.editors.links-unlink` ("Unlink"), `views.editors.links-unlink-record` (`{ label }`, "Unlink Acme"), `views.editors.links-is-lead` (`{ label, lead }`, "Acme is the lead"), `views.editors.links-edit` (`{ label }`, "Edit the link to Acme"), `views.editors.links-menu` (`{ label }`, "the link to Acme", a link's ⋯ menu on a phone), `views.editors.links-field-at` (`{ field, label }`, "Roles at Acme"), `views.editors.links-search-roles` ("Search roles…"), `views.editors.links-none` ("None"), `views.editors.links-no-details` ("No details"), `views.editors.links-yes` ("Yes"), `views.editors.links-no` ("No"), `views.editors.links-all-linked` ("Everything is linked."), `views.editors.links-done` ("Done").
|
|
902
904
|
The views row's words: `views.panels.view-private` ("Only you", a private view's lock),
|
|
903
905
|
`views.panels.view-reorder` (`{ label }`, "Reorder Board", a pill's grip), `views.panels.view-count`
|
|
904
906
|
(`{ label, count }`, "Board · 12"), `views.panels.views-more` (`{ count }`, "3 more views", the "+N" chip),
|
|
905
907
|
`views.panels.views-more-list` ("More views", its list), `views.panels.view-change` ("Change view", the
|
|
906
908
|
picker's chip), `views.panels.view-fallback` ("View", the chip with no active view),
|
|
907
|
-
`views.panels.views-search` ("Search views…"), `views.panels.views-list` ("Views", the picker's list),
|
|
909
|
+
`views.panels.views-search` ("Search views…"), `views.panels.views-find` ("Find a view", the views list's search on a phone, `CONTROLS.ViewsListBody`), `views.panels.views-list` ("Views", the picker's list),
|
|
908
910
|
`views.panels.views-shared` ("Shared") and `views.panels.views-personal` ("Personal"), its two headings,
|
|
909
911
|
`views.panels.views-none` ("No view matches."), `views.panels.view-create` ("New view", the +),
|
|
910
912
|
`views.panels.view-create-row` (`{ label }`, "New view…", the picker's last row) and
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# The Links editor's tokens
|
|
2
|
+
|
|
3
|
+
Every name `links-editor.css` reads, each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
|
+
|
|
5
|
+
Its own machinery (`--links-room`, `--links-under`, the room a phone's full Sheet gives it) is set and read by it alone.
|
|
6
|
+
|
|
7
|
+
| name | kind | the Outright token | default |
|
|
8
|
+
| ---- | ---- | ------------------ | ------- |
|
|
9
|
+
| `--vk-danger` | colour | `text-danger` | `hsl(0 81% 58%)` |
|
|
10
|
+
| `--vk-duration-fast` | motion | `duration-fast` | `150ms` |
|
|
11
|
+
| `--vk-ease-out` | motion | `ease-out` | `cubic-bezier(0, 0, 0.2, 1)` |
|
|
12
|
+
| `--vk-fg` | colour | `text` | `hsl(210 6% 7%)` · dark `hsl(210 8% 95%)` |
|
|
13
|
+
| `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
|
|
14
|
+
| `--vk-fg-subtlest` | colour | `text-subtlest` | `hsl(210 1% 53.5%)` · dark `hsl(210 3% 53%)` |
|
|
15
|
+
| `--vk-font-size-base` | size | `text-base` | `16px` |
|
|
16
|
+
| `--vk-font-size-sm` | size | `text-sm` | `14px` |
|
|
17
|
+
| `--vk-font-size-xs` | size | `text-xs` | `12px` |
|
|
18
|
+
| `--vk-font-weight-medium` | size | `font-weight-medium` | `500` |
|
|
19
|
+
| `--vk-font-weight-normal` | size | `font-weight-normal` | `400` |
|
|
20
|
+
| `--vk-layer-popup` | size | `layer-popup` | `50` |
|
|
21
|
+
| `--vk-line-height-base` | size | `text-base--line-height` | `1.5` |
|
|
22
|
+
| `--vk-line-height-sm` | size | `text-sm--line-height` | `1.4286` |
|
|
23
|
+
| `--vk-line-height-xs` | size | `text-xs--line-height` | `1.3333` |
|
|
24
|
+
| `--vk-overlay` | colour | `surface-overlay` | `hsl(0 0% 100%)` · dark `hsl(226 10% 10%)` |
|
|
25
|
+
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# The Number editor's tokens
|
|
2
|
+
|
|
3
|
+
Every name `number-editor.css` reads (beside the stylesheets of the controls it draws with: the number field's `number-field.css`, the Input's `input.css`, the inline input's `inline-input.css`, the Button's `button.css`, the Popover's `popover.css`, the Picker's `picker.css` for money's currencies and a number's units, and the Sheet's `sheet.css` for a phone's ✕ and ✓), each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
|
+
|
|
5
|
+
| name | kind | the Outright token | default |
|
|
6
|
+
| ---- | ---- | ------------------ | ------- |
|
|
7
|
+
| `--vk-border-width` | size | `border-width` | `1px` |
|
|
8
|
+
| `--vk-fg` | colour | `text` | `hsl(210 6% 7%)` · dark `hsl(210 8% 95%)` |
|
|
9
|
+
| `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
|
|
10
|
+
| `--vk-font-size-base` | size | `text-base` | `16px` |
|
|
11
|
+
| `--vk-font-size-sm` | size | `text-sm` | `14px` |
|
|
12
|
+
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# The Radio's tokens
|
|
2
|
+
|
|
3
|
+
Every name `radio.css` reads, each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
|
+
|
|
5
|
+
The words beside a choice, and a card's edge and ground (`o-choice-*`), are the app's own choice styles, as the Checkbox's are.
|
|
6
|
+
|
|
7
|
+
| name | kind | the Outright token | default |
|
|
8
|
+
| ---- | ---- | ------------------ | ------- |
|
|
9
|
+
| `--vk-border-brand` | colour | `border-focused` | `hsl(219 90% 65.5%)` · dark `hsl(219 66% 47%)` |
|
|
10
|
+
| `--vk-border-danger` | colour | `border-danger` | `hsl(3 87% 68%)` · dark `hsl(1 55% 46.5%)` |
|
|
11
|
+
| `--vk-border-input` | colour | `border-input` | `hsl(220 3% 86%)` · dark `hsl(220 4% 22%)` |
|
|
12
|
+
| `--vk-border-input-hovered` | colour | `border-input-hovered` | `hsl(210 1% 82%)` · dark `hsl(210 2% 26.5%)` |
|
|
13
|
+
| `--vk-border-selected` | colour | `border-selected` | `hsl(219 90% 65.5%)` · dark `hsl(219 66% 47%)` |
|
|
14
|
+
| `--vk-border-subtle` | colour | `border-subtle` | `hsl(0 0% 94%)` · dark `hsl(225 7% 11%)` |
|
|
15
|
+
| `--vk-border-width` | size | `border-width` | `1px` |
|
|
16
|
+
| `--vk-brand` | colour | `background-brand-bold` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
|
|
17
|
+
| `--vk-brand-hovered` | colour | `background-brand-bold-hovered` | `hsl(219 70% 46.5%)` · dark `hsl(219 95% 64%)` |
|
|
18
|
+
| `--vk-danger-bold` | colour | `background-danger-bold` | `hsl(0 81% 58%)` |
|
|
19
|
+
| `--vk-danger-bold-hovered` | colour | `background-danger-bold-hovered` | `hsl(0 59% 49%)` · dark `hsl(3 90% 66.5%)` |
|
|
20
|
+
| `--vk-duration-base` | motion | `duration-base` | `200ms` |
|
|
21
|
+
| `--vk-duration-fast` | motion | `duration-fast` | `150ms` |
|
|
22
|
+
| `--vk-ease-out` | motion | `ease-out` | `cubic-bezier(0, 0, 0.2, 1)` |
|
|
23
|
+
| `--vk-fg-accent` | colour | `text-brand` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
|
|
24
|
+
| `--vk-fg-disabled` | colour | `text-disabled` | `hsl(210 1% 72%)` · dark `hsl(210 1% 37%)` |
|
|
25
|
+
| `--vk-fg-inverse` | colour | `text-inverse` | `hsl(0 0% 100%)` · dark `hsl(210 8% 95%)` |
|
|
26
|
+
| `--vk-fg-on-brand` | colour | `text-brand-inverse` | `hsl(0 0% 100%)` · dark `hsl(210 8% 5%)` |
|
|
27
|
+
| `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
|
|
28
|
+
| `--vk-focus-offset` | size | `focus-offset` | `2px` |
|
|
29
|
+
| `--vk-focus-width` | size | `focus-width` | `2px` |
|
|
30
|
+
| `--vk-font-weight-normal` | size | `font-weight-normal` | `400` |
|
|
31
|
+
| `--vk-ground` | colour | `surface` | `hsl(0 0% 100%)` · dark `hsl(210 6% 7%)` |
|
|
32
|
+
| `--vk-hovered` | colour | `surface-hovered` | `hsl(0 0% 96.5%)` · dark `hsl(210 4% 9.5%)` |
|
|
33
|
+
| `--vk-input` | colour | `background-input` | `hsl(0 0% 100% / 0)` |
|
|
34
|
+
| `--vk-neutral` | colour | `background-neutral` | `hsl(0 0% 94%)` · dark `hsl(225 7% 11%)` |
|
|
35
|
+
| `--vk-overlay-card` | colour | `surface-overlay-card` | `hsl(0 0% 94%)` · dark `hsl(225 7% 15%)` |
|
|
36
|
+
| `--vk-radius-full` | size | `radius-full` | `9999px` |
|
|
37
|
+
| `--vk-radius-lg` | size | `radius-lg` | `10px` |
|
|
38
|
+
| `--vk-radius-xl` | size | `radius-xl` | `15px` |
|
|
39
|
+
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# The Values editor's tokens
|
|
2
|
+
|
|
3
|
+
Every name `values-editor.css` reads (beside the stylesheets of the controls it draws its values with: the Button's `button.css`, the Input's `input.css`, the Inline input's `inline-input.css`, the Field's `field.css` for a phone's card, the Popover's `popover.css` and the Picker's `picker.css` for a label's or a country's list, the list's `list.css`, the popup line's `popup-line.css`, the Sheet's `sheet.css` for a phone's ✕ and ✓, and the Flag's `flag.css`), each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
|
+
|
|
5
|
+
It also reads the Popover's corners (`--popover-corners`), the popup line's reach (`--popup-line-reach`) and a list's dividers (`--divider-colour`, `--divider-reach`, `--dividers-words`, `--dividers-rows`), those controls' own families, and sets its line's inset, `--values-line-in`, its own: none is public, and none is for an app to set.
|
|
6
|
+
|
|
7
|
+
| name | kind | the Outright token | default |
|
|
8
|
+
| ---- | ---- | ------------------ | ------- |
|
|
9
|
+
| `--vk-border` | colour | `border` | `hsl(220 7% 90%)` · dark `hsl(225 7% 15%)` |
|
|
10
|
+
| `--vk-border-brand` | colour | `border-focused` | `hsl(219 90% 65.5%)` · dark `hsl(219 66% 47%)` |
|
|
11
|
+
| `--vk-border-danger` | colour | `border-danger` | `hsl(3 87% 68%)` · dark `hsl(1 55% 46.5%)` |
|
|
12
|
+
| `--vk-border-overlay-card` | colour | `border-overlay-card` | `hsl(220 3% 86%)` · dark `hsl(220 4% 22%)` |
|
|
13
|
+
| `--vk-border-subtle` | colour | `border-subtle` | `hsl(0 0% 94%)` · dark `hsl(225 7% 11%)` |
|
|
14
|
+
| `--vk-border-width` | size | `border-width` | `1px` |
|
|
15
|
+
| `--vk-brand-subtler` | colour | `background-brand-subtler` | `hsl(218 100% 94%)` · dark `hsl(218 32% 14.5%)` |
|
|
16
|
+
| `--vk-danger` | colour | `text-danger` | `hsl(0 81% 58%)` |
|
|
17
|
+
| `--vk-fg` | colour | `text` | `hsl(210 6% 7%)` · dark `hsl(210 8% 95%)` |
|
|
18
|
+
| `--vk-fg-brand` | colour | `link` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
|
|
19
|
+
| `--vk-fg-inverse` | colour | `text-inverse` | `hsl(0 0% 100%)` · dark `hsl(210 8% 95%)` |
|
|
20
|
+
| `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
|
|
21
|
+
| `--vk-fg-subtlest` | colour | `text-subtlest` | `hsl(210 1% 53.5%)` · dark `hsl(210 3% 53%)` |
|
|
22
|
+
| `--vk-focus-width` | size | `focus-width` | `2px` |
|
|
23
|
+
| `--vk-font-size-base` | size | `text-base` | `16px` |
|
|
24
|
+
| `--vk-font-size-sm` | size | `text-sm` | `14px` |
|
|
25
|
+
| `--vk-font-size-xs` | size | `text-xs` | `12px` |
|
|
26
|
+
| `--vk-font-weight-medium` | size | `font-weight-medium` | `500` |
|
|
27
|
+
| `--vk-layer-popup` | size | `layer-popup` | `50` |
|
|
28
|
+
| `--vk-line-height-base` | size | `text-base--line-height` | `1.5` |
|
|
29
|
+
| `--vk-line-height-sm` | size | `text-sm--line-height` | `1.4286` |
|
|
30
|
+
| `--vk-line-height-xs` | size | `text-xs--line-height` | `1.3333` |
|
|
31
|
+
| `--vk-neutral` | colour | `background-neutral` | `hsl(0 0% 94%)` · dark `hsl(225 7% 11%)` |
|
|
32
|
+
| `--vk-overlay` | colour | `surface-overlay` | `hsl(0 0% 100%)` · dark `hsl(226 10% 10%)` |
|
|
33
|
+
| `--vk-overlay-hovered` | colour | `surface-overlay-hovered` | `hsl(220 3% 97%)` · dark `hsl(225 7% 15%)` |
|
|
34
|
+
| `--vk-radius-full` | size | `radius-full` | `9999px` |
|
|
35
|
+
| `--vk-radius-lg` | size | `radius-lg` | `10px` |
|
|
36
|
+
| `--vk-radius-md` | size | `radius-md` | `7.5px` |
|
|
37
|
+
| `--vk-radius-sm` | size | `radius-sm` | `5px` |
|
|
38
|
+
| `--vk-radius-xl` | size | `radius-xl` | `15px` |
|
|
39
|
+
| `--vk-shadow-lg` | shadow | `shadow-lg` | `0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)` |
|
|
40
|
+
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# The views list's tokens
|
|
2
|
+
|
|
3
|
+
Every name `views-list.css` reads (beside the stylesheets of the controls it draws with: the Picker's `picker.css`, the list's `list.css`, the popup line's `popup-line.css`, the Menu's and the menu list's for a view's menu, and the Sheet's `sheet.css` on a phone), each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
|
+
|
|
5
|
+
| name | kind | the Outright token | default |
|
|
6
|
+
| ---- | ---- | ------------------ | ------- |
|
|
7
|
+
| `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
|
|
8
|
+
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
@@ -124,7 +124,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
124
124
|
- `InlineInputProps` — its props.
|
|
125
125
|
- `InlineInputGroup` — an inline input with something beside the value in one row; its button is `xs`.
|
|
126
126
|
- `InlineInputGroupProps` — its props.
|
|
127
|
-
- `NumberField` — a number typed in, stepped or bounded, on Base UI's number field: the Input's own field with its steppers (or `steppers="arrows"`), `before` and `after` it, `align`, `scrub`; `chrome` `field`, `soft`, `inline` or `bare`.
|
|
127
|
+
- `NumberField` — a number typed in, stepped or bounded, on Base UI's number field: the Input's own field with its steppers (or `steppers="arrows"`), `before` and `after` it, `align`, `scrub`; `chrome` `field`, `soft`, `inline` or `bare`. One ⌘Z takes back a typed run: while a value is typed, Base UI's hidden form input keeps what it held until the box is left, Enter is pressed or a change that isn't typing arrives; a named field's is written as it comes.
|
|
128
128
|
- `NumberFieldProps` — its props.
|
|
129
129
|
- `Field` — a field: its `label`, its control, and under it its `note` or its `error` (several shown each once), `orientation`, `quietLabel` and its `form`, the computer's unless said: its place says the phone's where it draws a phone's form.
|
|
130
130
|
- `FieldProps` — its props.
|
|
@@ -331,9 +331,42 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
331
331
|
- `chipsThatFit` — how many chips stand on its one line.
|
|
332
332
|
- `filledMatch` — the choice a browser's fill names.
|
|
333
333
|
|
|
334
|
-
<!-- The panels': the Pane, the toolbar button, the Radio, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
334
|
+
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
## The Radio
|
|
337
|
+
|
|
338
|
+
One of a few choices, all of them in sight, on Base UI's radio group: the arrow keys move the choice, a hidden input carries it in a form, and the label round a ring presses it. Its stylesheet is `viewkitjs/views/controls/radio.css`; the words beside a choice and a card's edge and ground (`o-choice-*`) are the app's own choice styles, as the Checkbox's are. Its group marks a phone from the device (`data-vk-phone`), where marked cards stand one under another and tiles on one card. The Links editor draws a link's lead with it.
|
|
339
|
+
|
|
340
|
+
- `RadioGroup` — its choices, one under another: its `label` (the group a FieldSet, its name the legend; without one, give it an `aria-label`), `row` for two to four side by side, `tiles` for marked cards three across, and Base UI's group props (`value`, `defaultValue`, `onValueChange`, `disabled`).
|
|
341
|
+
- `RadioGroupProps` — its props.
|
|
342
|
+
- `Radio` — one choice: its `value`, its `label` and `note` beside it, `card` drawn as a card, `mark` a mark in place of the ring on a marked card.
|
|
343
|
+
- `RadioProps` — its props.
|
|
344
|
+
|
|
345
|
+
## The views list
|
|
346
|
+
|
|
347
|
+
What the view switcher opens: the Picker over a list's views, each its layout's mark, its name and its count where handed, the open one held (in its place on a phone too), ↓ and ↑ going on from it. A press opens a view and closes the list; a press and drag (on a phone after a hold) or ⌥↑ ⌥↓ moves one among the views under its heading. Its holder hands each view's menu and New view. Where private views are on, Shared and Just me head the views and a private view wears a lock. Its stylesheet is `viewkitjs/views/controls/views-list.css`; its root marks a phone from the device (`data-vk-phone`). Its options are on `viewkitjs/views/looks` (`VIEWS_LIST_LOOKS`). Its props, `ViewsListProps`, stay inside the controls part until VK-727: `viewkitjs/views/react` already exports an atom by that name.
|
|
348
|
+
|
|
349
|
+
- `useViewsList` — its state and the parts a shell pours in: `views`, `open`, `layouts` (each view's mark by its layout), `onChange` (it hands on `open` and `order`), `onDone`, `form`, `entries` (a view's menu, by its id), `onNew` (New view), `privateViews` (left out, the Private views option worn round it), `reorder` (`false`: no row moves), `label` and `words`.
|
|
350
|
+
- `ViewsListParts` — its `body`, and on a phone its Sheet head's buttons (`head`).
|
|
351
|
+
- `ViewsList` — the body alone, for a shell that holds only a body.
|
|
352
|
+
- `LOCK` — a private view's lock, as the list draws it after its name.
|
|
353
|
+
- `useViewsListWorn` — the views list's options worn round an element, read again as they change.
|
|
354
|
+
- `listed` — the views as the list shows them: as they are, or with private views on, the shared ones, then the reader's own.
|
|
355
|
+
- `SHARED` — the shared views' heading's English ("Shared").
|
|
356
|
+
- `JUST_ME` — the reader's own views' heading's English ("Just me").
|
|
357
|
+
- `ListView` — a view as an app hands it: its `id`, `name`, `layout`, and `private`, `favorite`, `changed` and `count` where it has them.
|
|
358
|
+
- `ViewsListLayout` — a layout a view takes: its `id`, `name`, `mark`, its one `line`, and `columns` where it asks which field makes its columns.
|
|
359
|
+
- `ViewsListChange` — what happened, handed on as it happens.
|
|
360
|
+
- `viewsListWornOf` — the options worn round an element, `{ privateViews, favorites }`.
|
|
361
|
+
- `ViewsListWorn` — those two.
|
|
362
|
+
- `VIEWS_LIST_ATTRS` — the attributes it reads them from.
|
|
363
|
+
- `ViewsListWords` — its words: `label`, `search` (a computer's), `find` (a phone's), `newView`, `shared`, `justMe`, `none`, and `picker` (the list's own).
|
|
364
|
+
- `VIEWS_LIST_WORDS` — their English.
|
|
365
|
+
- `viewsListWords` — the words handed over the English.
|
|
366
|
+
|
|
367
|
+
`CONTROLS.ViewsListBody` draws it where the view switcher opens: the axis's views, each its glyph by your `AppIcon`, its count and its menu rows as the Menu's (a row with no reason it can't be used says your `views.menus.not-now`), New view from `onCreate` in the axis's word, an order handed to `onReorder` as one whole block and never one that moves a view `canDrag` refuses, Shared and the reader's own wherever a view is private, and every word your messages'. It is internal: `CONTROLS` is the way in.
|
|
368
|
+
|
|
369
|
+
<!-- The editors' block: the Text editor, the Picker, the Date editor, the Compound editor, the Number editor, the Values editor, the Links editor -->
|
|
337
370
|
|
|
338
371
|
## The Text editor
|
|
339
372
|
|
|
@@ -434,7 +467,7 @@ Its stylesheet is `viewkitjs/views/controls/date-editor.css`, beside the Button'
|
|
|
434
467
|
|
|
435
468
|
## The Compound editor
|
|
436
469
|
|
|
437
|
-
`CONTROLS` fills its `PartsBody` with the Compound editor: ViewKit's name, place and range bodies, held as a shell that keeps the draft. A name types into First name and Last name, labelled boxes side by side; a place into its street, one box of several lines (line 1, and the rest line 2) under
|
|
470
|
+
`CONTROLS` fills its `PartsBody` with the Compound editor: ViewKit's name, place and range bodies, held as a shell that keeps the draft. A name types into First name and Last name, labelled boxes side by side; a place into its street, one box of several lines (line 1, and the rest line 2) under one word for both, `Street address` (`views.editors.place-street`) whatever the country, City, State beside Postal code, then its Country with its flag, the country's and the region's lists the Select's own under their boxes (on a phone a step of the Sheet); a range into From and To, its unit under them and its bands listed under those. ViewKit's name, place and range editors keep the draft, the full name's rule, a place's region code, Escape, Tab, the check and the save; a refusal is the host's to show. With its full name hidden (Shown as: Hidden, the default) the body hands a name of its own back as its parts joined once one changes, so the full name follows them, from the start when a letter typed on the cell opened it; untouched, it stays the name's own.
|
|
438
471
|
|
|
439
472
|
- `useCompoundEditor` — the Compound editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's buttons (`head`) and a list's step `title`. Standing alone (`draft: "own"`, the default) it keeps on Enter, Escape or a press elsewhere, says why it keeps the value it had, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change, the whole value each time, and keeps nothing. One kind per mount.
|
|
440
473
|
- `CompoundEditor` — the body alone, for a shell that holds only a body.
|
|
@@ -457,7 +490,7 @@ Its stylesheet is `viewkitjs/views/controls/date-editor.css`, beside the Button'
|
|
|
457
490
|
- `Country` — a country: its code and name, and its rows, words and regions where a field hands them.
|
|
458
491
|
- `Region` — a region a country names: its code and its name.
|
|
459
492
|
- `rowsOf` — a country's rows for the parts a field keeps, in its own order or Attio's.
|
|
460
|
-
- `wordOf` — a part's words for a country; where no country names them, the app's from `words` when it hands them.
|
|
493
|
+
- `wordOf` — a part's words for a country; where no country names them, the app's from `words` when it hands them. In Attio's look the street takes Attio's word whatever the country.
|
|
461
494
|
- `PlaceWords` — a place's boxes' words where no country names them: Attio's look's, the country-first look's, and the short ones a phone's row takes.
|
|
462
495
|
- `streetOf` — the street as its one box holds it: line 1, and line 2 on the next line.
|
|
463
496
|
- `streetParts` — the street box's text back as line 1 and line 2.
|
|
@@ -477,6 +510,85 @@ Its stylesheet is `viewkitjs/views/controls/date-editor.css`, beside the Button'
|
|
|
477
510
|
|
|
478
511
|
A name's `NameValue` and `sameName`, and a range's `rangeText`, stay inside the editor: `viewkitjs/fields` names each already, with another meaning. Its stylesheets are `viewkitjs/views/controls/compound-editor.css` and `flag.css`, beside those of the controls it draws its parts with; their names are on [its page](../controls/compound-editor.md) and [the Flag's](../controls/flag.md). The flags are about 560 KB of SVG, loaded with the controls part.
|
|
479
512
|
|
|
513
|
+
## The Number editor
|
|
514
|
+
|
|
515
|
+
`CONTROLS` fills its `NumberBody` with the Number editor: ViewKit's number, money and percent bodies, held as a shell that keeps the draft. A number types into the number field inline, over its cell, its up and down arrows at its end while it is edited; money's code stands before the amount, a press away from a searchable list of each currency's sign and name in the conventions' language, ↓ there going on from the currency held; a number's unit the same; a percent shows its %. Home and End move the cursor. On a phone the Sheet holds the number field with the number pad, the currencies a step of the Sheet (`onStepChange`). ViewKit's number editor keeps the draft, the rounding to the field's decimals, Escape, Tab, the check, the empty rule and the save; a refusal is the host's to show. A duration keeps ViewKit's own box.
|
|
516
|
+
|
|
517
|
+
- `useNumberEditor` — the Number editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's buttons (`head`) and the currencies' step `title`. Standing alone (`draft: "own"`, the default) it keeps on Enter or a press elsewhere and leaves on Escape, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change as it is read and keeps nothing.
|
|
518
|
+
- `useNumberEditorWorn` — the options worn round the body, read again as they change: a ref for its root, and what it wears.
|
|
519
|
+
- `NumberEditorProps` — its props: a `number`, `money` or `percent`, its value, its currency or unit and those on offer, its limits, decimals and reading, and its change.
|
|
520
|
+
- `NumberEditorParts` — what `useNumberEditor` hands back: its `body`, its phone `head` and a step's `title`.
|
|
521
|
+
- `numberText` — what a cell shows of a number once kept: its thousands back, money's code (or sign) before it, a percent's %.
|
|
522
|
+
- `readTyped` — what is typed, read as ViewKit's own box reads it: either separator unless one is stated; null for nothing, `NaN` for text that reads as no number.
|
|
523
|
+
- `boxLocale` — the locale the box reads with: the one handed, or one that writes the decimal separator handed.
|
|
524
|
+
- `NumberKind` — `number`, `money` or `percent`.
|
|
525
|
+
- `Currency` — a currency: its code, sign and name.
|
|
526
|
+
- `Unit` — a unit or a currency: its code, name, and the sign that stands for it where it has one.
|
|
527
|
+
- `Units` — how money's currency and a percent's % stand in what a cell shows: `code` or `sign`.
|
|
528
|
+
- `NUMBER_EDITOR_ATTRS` — the frame's attributes the body watches.
|
|
529
|
+
- `numberEditorWornOf` — the options worn round an element, each from the nearest frame; outside any frame, Attio's.
|
|
530
|
+
- `NumberEditorWorn` — its options as worn.
|
|
531
|
+
- `NUMBER_EDITOR_WORDS` — its words, in English: its lists' names and searches, the code button's name and the number field's steps. `CONTROLS.NumberBody` hands the app's (`views.menus.currency`, `views.editors.number-*`, listed in the contract).
|
|
532
|
+
- `numberWords` — the words handed over the English.
|
|
533
|
+
- `NumberEditorWords` — those words, and its lists' own (`picker`).
|
|
534
|
+
|
|
535
|
+
The body alone, as `NumberEditor`, stays inside the editor until the editors' older `NumberEditor` (`viewkitjs/views/editors/number`) leaves: one package holds no two public names alike. Its stylesheet is `viewkitjs/views/controls/number-editor.css`, beside those of the controls it draws with; its names are on [its page](../controls/number-editor.md).
|
|
536
|
+
## The Values editor
|
|
537
|
+
|
|
538
|
+
`CONTROLS` fills its `ValuesBody` with the Values editor: ViewKit's bodies for several emails, phones, links or domains (and for one email or domain an app opens as a list of one, `oneValue`), held as a shell that keeps the draft. Each value is a pill with copy and trash, pressed to edit it in place, its label quiet after it; a grip moves it, by the pointer or by ↑ and ↓, and the first is the main one. A line at the foot adds one: a plus and its kind's words, or a phone's country (ViewKit's region for the record, else the last one kept, else the browser's region), its dial code and its pattern. Enter there adds the value and stays open; Enter on the empty line saves, as Enter on a value being edited first finishes it. A new value takes Work, Mobile or Other (a domain none), and a label is picked from Work, Personal, Mobile and Other in the app's words, or typed. ViewKit's value list editor keeps the draft, which value is kept as stored, Escape, Tab, the check and the save; a value that doesn't read, left in the line or in a value being edited, is handed as typed, so the host refuses it, says why and stays open. Escape in a label's or a country's list closes the list alone.
|
|
539
|
+
|
|
540
|
+
- `useValuesEditor` — the Values editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's buttons (`head`) and a list's step `title`. Standing alone (`draft: "own"`, the default) it keeps the list with what the line reads on Enter on the empty line, Escape or a press elsewhere, says why a value is refused under it, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change, the whole list each time, and keeps nothing.
|
|
541
|
+
- `ValuesEditor` — the body alone, for a shell that holds only a body.
|
|
542
|
+
- `useValuesEditorWorn` — the options worn round the body, read again as they change.
|
|
543
|
+
- `ValuesEditorProps` — its props: what it holds several of, the list, its change, and its labels, country codes, words and language.
|
|
544
|
+
- `ValuesEditorParts` — what `useValuesEditor` hands back: its `body`, its phone `head` and a step's `title`.
|
|
545
|
+
- `ValuesKind` — what a field holds several of: `email`, `phone`, `link` or `domain`.
|
|
546
|
+
- `ListedValue` — one value of the list: what it is, its label, and whether it is the main one.
|
|
547
|
+
- `DialCode` — a phone's country code as a field hands it: the country, its code and how a number is written there.
|
|
548
|
+
- `LABELS` — the labels a value is picked from, in English.
|
|
549
|
+
- `labelFor` — a new value's label, in the words handed: Work for an email, Mobile for a phone, Other for a link; a domain none.
|
|
550
|
+
- `listOf` — the list with its main one first and marked main alone.
|
|
551
|
+
- `added` — what the line adds: the value as kept, a phone's country code before it; or why it is refused.
|
|
552
|
+
- `valuesText` — what a cell shows: the main one, and how many more.
|
|
553
|
+
- `openOf` — a value's open action: a call, an email written, the page.
|
|
554
|
+
- `splitEmail` — an email as its name and its domain, split at its last @.
|
|
555
|
+
- `charsThatFit` — how many of a name's characters stand before its ellipsis.
|
|
556
|
+
- `VALUES_EDITOR_WORDS` — its words, in English: the line's, each value's buttons, its labels, a phone's country and its list, a list's step and Back. `CONTROLS.ValuesBody` hands the app's (`views.editors.values-*`, the open actions' and the place editor's country words, listed in the contract) and names a phone's countries in the conventions' `language`.
|
|
557
|
+
- `ValuesEditorWords` — those words, and its lists' own (`picker`).
|
|
558
|
+
- `valuesWords` — the words handed, over the English.
|
|
559
|
+
- `valuesEditorWornOf` — its options as worn round an element.
|
|
560
|
+
- `VALUES_EDITOR_ATTRS` — the attributes it watches, so a look changed while it is open reaches it.
|
|
561
|
+
- `ValuesEditorWorn` — its options as worn.
|
|
562
|
+
|
|
563
|
+
The grip's `moved` and `dragAt`, the list a shell is handed (`handedList`) and the shapes of the label words and the line's read stay inside it. Its stylesheet is `viewkitjs/views/controls/values-editor.css`, beside those of the controls it draws with; its names are on [its page](../controls/values-editor.md).
|
|
564
|
+
## The Links editor
|
|
565
|
+
|
|
566
|
+
`CONTROLS` fills its `LinksBody` with the Links editor: ViewKit's links body, for a relation holding several records whose field declares `links`. On a computer the search stands on top, the linked records under the field's name, Roles and Lead (a link's roles in a short button opening the Picker to tick them, the lead a radio, ✕ to unlink), then a line and the records to add under Add, ↑ ↓ lighting one and Enter linking it last; on a phone a card per link (its roles a row opening them on top, its ⋯ making it the lead or unlinking it), the records to add in a card under it and the search at the Sheet's foot. ViewKit keeps the set, the lead first on save, Escape, Tab, the save on close and the phone's ✕ and ✓; the editor hands every change as it is made, every query back to ViewKit (which filters or fetches), and draws its searching and failed lines, more records as the list's end comes into sight, and the create rows. A field that declares no roles has no Roles column. Its stylesheet is `viewkitjs/views/controls/links-editor.css`; its words are the app's, from its messages. With several fields on a link (an app's own use of the body), each column reads as words and a link's fields open as a step on a computer, and in the Sheet on a phone.
|
|
567
|
+
|
|
568
|
+
- `LinksEditor` — the body alone, for a shell that holds only a body.
|
|
569
|
+
- `useLinksEditor` — its state and the parts a shell pours in: the body, and on a phone the Sheet head's ✕ and ✓.
|
|
570
|
+
- `LinksEditorProps` — its props (a link's own type, `Link`, stays inside the editor, named `LinksEditorProps["links"][number]`): the field's name (`label`), its records' kind (`kind`, the first column's name), the records (`records`, Picker rows), the fields a link holds (`fields`), the links (`links`), each change (`onLinksChange`), the lead (`lead`), the search's words (`search`), `form`, `onDone`, `autoFocus`, a page's state (`typed`, `opens`), its `words`, and a list its editor finds (`onSearch`, `doing`, `onRetry`, `onMore`, `actions`).
|
|
571
|
+
- `LinksEditorParts` — what it hands a shell.
|
|
572
|
+
- `LinksEditorLead` — which link leads, a way to set it, and its column's name.
|
|
573
|
+
- `LinksEditorOpens` — what a page shows standing open: a field's list on a link, or a link's fields.
|
|
574
|
+
- `LinksEditorAction` — a row that does something rather than link: its key, its words, a mark, and what it does.
|
|
575
|
+
- `LinkField` — a field a link holds: its id, its name, its kind (`LinkFieldKind`: several, one, or yes or no) and, for a list, its choices (`LinkChoice`, an archived one offered only where held).
|
|
576
|
+
- `LinkFieldKind` — a field's kind: several of a list, one of a list, or yes or no.
|
|
577
|
+
- `LinkChoice` — a choice of a field's list: its value, its words, and whether it is archived.
|
|
578
|
+
- `LinkValue` — what a field holds on a link: several choices, one, yes or no, or nothing.
|
|
579
|
+
- `found` — what the search finds: the linked records first, then the rest; handed, as the editor found them.
|
|
580
|
+
- `removed` — the links with a record unlinked. Its `added` (a record linked last) stays inside the editor: the Values editor's `added` holds that name on this door.
|
|
581
|
+
- `leadAfter` — which link leads after a change: never none while a link is left.
|
|
582
|
+
- `setValue` — the links with one field of one link changed.
|
|
583
|
+
- `ticked` — the choices held after one is pressed: a new one last, a held one out.
|
|
584
|
+
- `heldOf` — the choices a link holds on a field, in the order held.
|
|
585
|
+
- `offered` — what a field's list offers on a link: its choices, an archived one only where held, then each held value it no longer offers.
|
|
586
|
+
- `said` — a link's value in words, as its column reads it.
|
|
587
|
+
- `saidShort` — a link's value as a short button says it: two whole, more as the first and a count.
|
|
588
|
+
- `LINKS_EDITOR_WORDS` — its words, in English.
|
|
589
|
+
- `LinksEditorWords` — those words, and its roles list's own (`picker`).
|
|
590
|
+
- `linksWords` — the words handed, over the English.
|
|
591
|
+
|
|
480
592
|
## The stylesheets
|
|
481
593
|
|
|
482
594
|
The ready stylesheet (`viewkitjs/views/styles.css`) carries the controls, every token they read declared at the Outright look's value ([the controls' tokens](../contract.md#the-controls-tokens)). An app on the Outright tokens imports them one by one instead, and declares each token as its own: `viewkitjs/views/controls/smooth.css` first (the smooth corner every control's outline stands on), then each control's own, `viewkitjs/views/controls/<piece>.css` (the Button's `button.css`, the Spinner's `spinner.css`); each control's names are on its page under `docs/controls/`. Their options and looks are on [`viewkitjs/views/looks`](looks.md).
|
|
@@ -102,9 +102,12 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
102
102
|
- `AvatarLookOptionId` — the Avatar's option ids.
|
|
103
103
|
- `MENU_LIST_CARD_FRAME` — the menu list's options as a frame's data attributes, the Stack look's (Card rows, inset lines, 52, xl): a piece whose menu lists are no menu's own sheet (a panel's settings, a list of people) puts it round them, and keeps them whatever the app picks, since with nothing picked a menu's own sheet draws My preset's Words and the nearest frame wins.
|
|
104
104
|
|
|
105
|
-
<!-- The panels': the Pane, the toolbar button, the Radio, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
105
|
+
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
- `VIEWS_LIST_LOOKS` — the views list's: 2 options (`private`, Private views: Shared and Just me, a private view's lock, and a view's menu's Private view; `favorites`, a view's menu's Favorite), each `off` (the default, My preset's) or `on`, and no looks.
|
|
108
|
+
- `ViewsListOptionId` — its option ids.
|
|
109
|
+
|
|
110
|
+
<!-- The editors' block: the Text editor, the Picker, the Date editor, the Compound editor, the Number editor, the Values editor, the Links editor -->
|
|
108
111
|
|
|
109
112
|
- `TEXT_EDITOR_LOOKS` — the Text editor's: 3 options (`box`, `over` or `cell`, a computer's; `long`, `enter` or `mod`, a computer's; `phone`, `country` or `line`) and two looks, `attio` (every option's default) and `mihais`.
|
|
110
113
|
- `TextEditorLookOptionId` — its option ids.
|
|
@@ -112,6 +115,10 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
112
115
|
- `DateEditorLookOptionId` — its option ids.
|
|
113
116
|
- `COMPOUND_EDITOR_LOOKS` — the Compound editor's: 4 options (`boxes`, `boxes` or `fields`; `shown`, `hidden` or `shown`; `country`, `last` or `first`; `arrows`, `editing` or `none`, a computer's) and two looks, `attio` (every option's default) and `mihai`.
|
|
114
117
|
- `CompoundEditorOptionId` — its option ids.
|
|
118
|
+
- `NUMBER_EDITOR_LOOKS` — the Number editor's: 3 options (`arrows`, `editing` or `none`, a computer's; `units`, `code` or `sign`; `sheet`, `line` or `field`, a phone's) and two looks, `attio` (every option's default) and `mihai`.
|
|
119
|
+
- `NumberEditorOptionId` — its option ids.
|
|
120
|
+
- `VALUES_EDITOR_LOOKS` — the Values editor's: 5 options (`rows`, `copy` or `fill`, a computer's; `main`, `none` or `pill`, a computer's; `line`, `plus` or `icon`; `lists`, `under` or `inplace`, a computer's; `phone`, `rows` or `cards`, a phone's) and two looks, `attio` (every option's default) and `mihai`.
|
|
121
|
+
- `ValuesEditorOptionId` — its option ids.
|
|
115
122
|
|
|
116
123
|
## The grid's
|
|
117
124
|
|
|
@@ -52,7 +52,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
52
52
|
- `ViewsLink` — `{ value, roles }`: one link as a links body draws it, its record's value and the roles it holds, in order.
|
|
53
53
|
- `ViewsLinkRole` — `{ value, label, archived? }`: a role a link may hold, as a links body offers it.
|
|
54
54
|
- `ViewsTextBodyProps` — a whole body for a field typed as one string your app draws: `label`, `kind` (`text`, `url`, `domain`, `email`, `phone` or `rich_text`), `paragraph`, `value` and `onValueChange` (the whole text, every change as it is made), `onDone` (closes as Enter does), `check` (a value's reason, or null), `region` (a phone's country), `typed`, `autoFocus` and `form` (`phone`: draw no ✕, ✓ or Cancel of your own), and, in the phone's sheet, `onStepChange` (a `ViewsBodyStep` while it stands on a step of its own, `null` once back). The editor keeps the draft, Tab, Escape, ⌘ or Ctrl Enter, the close's tidy, the write check, the save and the phone's ✕ and ✓.
|
|
55
|
-
- `ViewsNumberBodyProps` — a whole body for a number, money or a percent your app draws: `label`, `kind` (`number`, `money` or `percent`), `value` (a number, `null` empty, `NaN` unreadable) and `onValueChange` (the number and, when it is one of `units`, the unit; every change as it is made), `unit` and `units`, `onDone` (closes as Enter does), `check` (a value's reason, or null), `decimals`, `min`, `max`, `locale`, `decimal`, `empty`, `align`, `typed`, `autoFocus
|
|
55
|
+
- `ViewsNumberBodyProps` — a whole body for a number, money or a percent your app draws: `label`, `kind` (`number`, `money` or `percent`), `value` (a number, `null` empty, `NaN` unreadable) and `onValueChange` (the number and, when it is one of `units`, the unit; every change as it is made), `unit` and `units`, `onDone` (closes as Enter does), `check` (a value's reason, or null), `decimals`, `min`, `max`, `locale`, `decimal`, `empty`, `align`, `typed`, `autoFocus`, `form` (`phone`: draw no ✕, ✓ or Cancel of your own) and, in the phone's sheet, `onStepChange` (a step of its own, money's currencies). The editor keeps the draft, the rounding, Tab, Escape, ⌘ or Ctrl Enter, the write check, the save and the phone's ✕ and ✓.
|
|
56
56
|
- `ViewsSortBodyProps` — the sort editor's whole body your app draws: `label`, `options` (the fields it sorts by, each its `value`, `label` and `defaultDir`, and, as the grid's header marks its column, its field's `type`, its `part` and the header's `glyph`), `rules` (in order, the first sorting first), `setAside` (the set-aside sorts, `[]` when none), `max`, `form`, `addSort` (on a computer, Add sort at its foot), `onRulesChange` (the whole rules and, when handed, the set-aside sorts kept; every change as it is made; a list that breaks the rules writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the rules back to what they were as it opened, and ✓). ViewKit keeps the check, the latest rules between renders, the close on the last rule and what ✕ takes back to.
|
|
57
57
|
- `ViewsQuickFiltersBodyProps` — the quick filters' whole body your app draws: `label`, `fields` (each its `key`, `label`, `searchPlaceholder` and `values` in the order to show them, each value its key, its words, its `count` where counts show and whether it is `held`; a held value no count lists is among them, drawn from the hold and worded by the config's `heldLabels` else its key; after the fields offered, each other field holding a value, its held values alone), `hold` (each held field once, its values), `several`, `showCounts`, `form`, `onHoldChange` (the whole hold, every change as it is made; one that holds a field twice, more than one value where `several` is false, or a value added on a field the strip doesn't offer writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw it, `actions` (the ✕, closing it).
|
|
58
58
|
- `ViewsFilterBodyProps` — the filter editor's whole body your app draws: `label`, `fields` (the fields a rule may name, `ViewsFilterBodyField`s), `filter` (the level it is open on, a `FilterGroup`: an advanced filter's group on a computer, the whole filter on a phone), `levels` (how deep its rules may stand, its own the first), `excludable` (whether it may be `not`), `relation` (where the level is a relation's where edited in place: its field key, words and quantifier, and `gone`, why in words, where the list no longer lists the relation: there a level that adds or changes a rule writes nothing), `form`, `onFilterChange` (the whole level and, at a relation, its quantifier; every change as it is made; a level that breaks the rules writes nothing; an empty one on a computer takes its advanced filter away), `ruleValue` (a rule's value in ViewKit's own body for its type, each change handed back as the rule), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the filter back to what it was as it opened, and ✓). ViewKit keeps the check, the Or top's wrap, the pills' keys and what ✕ takes back to.
|
|
@@ -80,7 +80,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
80
80
|
- `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 ✓.
|
|
81
81
|
- `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.
|
|
82
82
|
- `ViewsSheetAction` — one of them: its `label` (the accessible name) and `onPress`. The glyph is yours.
|
|
83
|
-
- `ViewsBodyStep` — `{ title, onBack }`: a step of an editor body's own on a phone (a list of countries, a label's list), which a `TextBody`, `PartsBody`, `ValuesBody` or `LinksBody` hands the sheet through its `onStepChange`. The sheet's head shows `title` in place of the field's name, and Back and the sheet's Escape call `onBack`; the body hands `null` once it is back.
|
|
83
|
+
- `ViewsBodyStep` — `{ title, onBack }`: a step of an editor body's own on a phone (a list of countries, a label's list), which a `TextBody`, `NumberBody`, `PartsBody`, `ValuesBody` or `LinksBody` hands the sheet through its `onStepChange`. The sheet's head shows `title` in place of the field's name, and Back and the sheet's Escape call `onBack`; the body hands `null` once it is back.
|
|
84
84
|
- `ViewsMenuRoute` — `"popover" | "menu"`, the provider's `menus`: how the grid opens its own menus (a column's, a footer's figure picker, a group's ⋯, Add column). `popover` (the default) draws ViewKit's rows in your `Popover`; `menu` hands your `Menu` its rows as data. The row menu and a command cell's menu always go through your `Menu`.
|
|
85
85
|
- `ViewsSeveralValues` — `"first" | "fit"`, the provider's `severalValues`: how a cell of several values draws on one line. `fit` (the default) draws as many whole values as fit its width, then the count, following a column resize; `first` draws its first value and a count at any width, as on 0.5.0.
|
|
86
86
|
- `ViewsGridButtons` — `"own" | "button"`, the provider's `gridButtons`: who draws the buttons the grid draws itself (a group's fold and ⋯, "+ Add column", a row's ⋯, the name's actions, an action column's buttons, a pick-list cell's ▾, a command cell's ▾ and trigger). `own` (the default) draws ViewKit's own, as on 0.5.0; `button` draws your `Button`, handed the grid's box in `className`.
|