viewkitjs 0.27.0 → 0.29.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 +178 -0
- package/MIGRATION.md +123 -5
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.d.ts +3 -1
- package/views/dist/cells/cell-format.js +3 -3
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/cells/use-cell-format.d.ts +8 -1
- package/views/dist/cells/use-cell-format.js +13 -2
- package/views/dist/contract.d.ts +218 -5
- package/views/dist/contract.js +233 -1
- package/views/dist/controls/alert/alert.d.ts +46 -0
- package/views/dist/controls/alert/alert.js +11 -0
- package/views/dist/controls/alert/looks.d.ts +4 -0
- package/views/dist/controls/alert/looks.js +19 -0
- package/views/dist/controls/alert/tokens.d.ts +92 -0
- package/views/dist/controls/alert/tokens.js +25 -0
- package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
- package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
- package/views/dist/controls/alert-dialog/confirm.js +11 -0
- package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
- package/views/dist/controls/alert-dialog/looks.js +17 -0
- package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
- package/views/dist/controls/alert-dialog/tokens.js +32 -0
- package/views/dist/controls/alert-dialog.css +95 -0
- package/views/dist/controls/alert.css +51 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
- package/views/dist/controls/collapsible/collapsible.js +18 -0
- package/views/dist/controls/collapsible/looks.d.ts +4 -0
- package/views/dist/controls/collapsible/looks.js +5 -0
- package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
- package/views/dist/controls/collapsible/map-collapse.js +6 -0
- package/views/dist/controls/collapsible/tokens.d.ts +68 -0
- package/views/dist/controls/collapsible/tokens.js +19 -0
- package/views/dist/controls/collapsible.css +83 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/compound-editor/place-parts.js +5 -1
- package/views/dist/controls/controls.d.ts +19 -0
- package/views/dist/controls/controls.js +17 -0
- package/views/dist/controls/customize/customize.d.ts +125 -0
- package/views/dist/controls/customize/customize.js +243 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
- package/views/dist/controls/customize/map-customize-body.js +160 -0
- package/views/dist/controls/customize/rules.d.ts +23 -0
- package/views/dist/controls/customize/rules.js +19 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +58 -0
- package/views/dist/controls/customize/words.js +37 -0
- package/views/dist/controls/customize.css +54 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/date-editor/map-calendar.js +3 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +58 -0
- package/views/dist/controls/filter-editor/filter-editor.js +250 -0
- package/views/dist/controls/filter-editor/how.d.ts +23 -0
- package/views/dist/controls/filter-editor/how.js +14 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +33 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +190 -0
- package/views/dist/controls/filter-editor/map-rules.d.ts +101 -0
- package/views/dist/controls/filter-editor/map-rules.js +304 -0
- package/views/dist/controls/filter-editor/parts.d.ts +46 -0
- package/views/dist/controls/filter-editor/parts.js +75 -0
- package/views/dist/controls/filter-editor/rules.d.ts +142 -0
- package/views/dist/controls/filter-editor/rules.js +201 -0
- package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
- package/views/dist/controls/filter-editor/tokens.js +23 -0
- package/views/dist/controls/filter-editor/words.d.ts +74 -0
- package/views/dist/controls/filter-editor/words.js +46 -0
- package/views/dist/controls/filter-editor.css +142 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
- package/views/dist/controls/group-editor/group-editor.js +126 -0
- package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
- package/views/dist/controls/group-editor/map-group-body.js +106 -0
- package/views/dist/controls/group-editor/rules.d.ts +48 -0
- package/views/dist/controls/group-editor/rules.js +41 -0
- package/views/dist/controls/group-editor/tokens.d.ts +15 -0
- package/views/dist/controls/group-editor/tokens.js +6 -0
- package/views/dist/controls/group-editor/words.d.ts +39 -0
- package/views/dist/controls/group-editor/words.js +21 -0
- package/views/dist/controls/group-editor.css +20 -0
- package/views/dist/controls/index.d.ts +45 -3
- package/views/dist/controls/index.js +44 -3
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/editor-parts.d.ts +8 -1
- package/views/dist/controls/internal/editor-parts.js +5 -0
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/step-return.d.ts +9 -0
- package/views/dist/controls/internal/step-return.js +27 -0
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +5 -3
- package/views/dist/controls/links-editor/links-editor.js +38 -17
- package/views/dist/controls/links-editor/map-links-body.js +4 -1
- package/views/dist/controls/links-editor.css +1 -1
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
- package/views/dist/controls/menu-list/menu-list.js +25 -16
- package/views/dist/controls/modal/looks.d.ts +4 -0
- package/views/dist/controls/modal/looks.js +25 -0
- package/views/dist/controls/modal/modal.d.ts +69 -0
- package/views/dist/controls/modal/modal.js +62 -0
- package/views/dist/controls/modal/tokens.d.ts +192 -0
- package/views/dist/controls/modal/tokens.js +50 -0
- package/views/dist/controls/modal.css +130 -0
- package/views/dist/controls/notice/notice.d.ts +49 -0
- package/views/dist/controls/notice/notice.js +35 -0
- package/views/dist/controls/notice/tokens.d.ts +99 -0
- package/views/dist/controls/notice/tokens.js +27 -0
- package/views/dist/controls/notice.css +100 -0
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/looks.d.ts +4 -0
- package/views/dist/controls/pane/looks.js +11 -0
- package/views/dist/controls/pane/pane.d.ts +67 -0
- package/views/dist/controls/pane/pane.js +99 -0
- package/views/dist/controls/pane/state.d.ts +14 -0
- package/views/dist/controls/pane/state.js +7 -0
- package/views/dist/controls/pane/tokens.d.ts +79 -0
- package/views/dist/controls/pane/tokens.js +22 -0
- package/views/dist/controls/pane.css +104 -0
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- package/views/dist/controls/picker/rows.d.ts +4 -2
- package/views/dist/controls/picker/rows.js +4 -3
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
- package/views/dist/controls/sort-editor/rules.d.ts +48 -0
- package/views/dist/controls/sort-editor/rules.js +24 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
- package/views/dist/controls/sort-editor/sort-editor.js +180 -0
- package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
- package/views/dist/controls/sort-editor/tokens.js +22 -0
- package/views/dist/controls/sort-editor/words.d.ts +48 -0
- package/views/dist/controls/sort-editor/words.js +25 -0
- package/views/dist/controls/sort-editor.css +96 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/text-editor.js +1 -5
- package/views/dist/controls/toast/toast.d.ts +79 -0
- package/views/dist/controls/toast/toast.js +101 -0
- package/views/dist/controls/toast/tokens.d.ts +100 -0
- package/views/dist/controls/toast/tokens.js +27 -0
- package/views/dist/controls/toast.css +93 -0
- package/views/dist/controls/tokens.js +38 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/values-editor/values-editor.js +7 -1
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +5 -5
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +13 -2
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/options.d.ts +3 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/display/use-display-options.d.ts +3 -0
- package/views/dist/display/use-display-options.js +10 -2
- package/views/dist/display/viewer.d.ts +1 -1
- package/views/dist/display/viewer.js +1 -1
- package/views/dist/editors/DateEditor.js +11 -9
- package/views/dist/editors/relation-panel.js +7 -1
- package/views/dist/editors/relation-picker.d.ts +2 -1
- package/views/dist/editors/relation-picker.js +4 -3
- package/views/dist/editors/relation-source.d.ts +4 -1
- package/views/dist/editors/relation-source.js +5 -2
- package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
- package/views/dist/fields/number-edit.d.ts +6 -0
- package/views/dist/fields/number-edit.js +8 -1
- package/views/dist/grid/chrome/GridCellEditors.js +2 -2
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
- package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
- package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
- package/views/dist/grid/chrome/GridFooter.js +2 -2
- package/views/dist/grid/chrome/GridHeader.js +2 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
- package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/core/commit-model.d.ts +7 -0
- package/views/dist/grid/core/commit-model.js +5 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/editing-model.js +3 -7
- package/views/dist/grid/core/undo-owner.d.ts +6 -0
- package/views/dist/grid/core/undo-owner.js +13 -0
- package/views/dist/grid/core/useGridEditing.d.ts +2 -0
- package/views/dist/grid/core/useGridEditing.js +4 -0
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +10 -0
- package/views/dist/looks/index.js +10 -0
- package/views/dist/looks/pieces.js +20 -0
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +14 -1
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +12 -5
- package/views/dist/panels/react/customize-body.js +41 -13
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +11 -6
- package/views/dist/panels/react/filter/FilterEditor.js +6 -6
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +12 -9
- package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
- package/views/dist/panels/react/filter/filter-body.js +21 -7
- package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
- package/views/dist/panels/react/filter/filter-part-body.js +3 -1
- package/views/dist/panels/react/panel-sheet.d.ts +5 -1
- package/views/dist/panels/react/panel-sheet.js +6 -2
- package/views/dist/panels/react/panel-step.d.ts +15 -0
- package/views/dist/panels/react/panel-step.js +27 -0
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
- package/views/dist/panels/react/sort/SortEditor.js +5 -2
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +18 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +93 -4
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +15 -5
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +50 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +38 -23
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
- package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
- package/views/dist/panels/react/toolbar/panel-part.js +2 -2
- package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
- package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
- package/views/dist/panels/react/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/react.d.ts +1 -0
- package/views/dist/panels/react.js +1 -0
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +72 -7
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/settings/group-buckets.js +1 -0
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.d.ts +7 -1
- package/views/dist/provider/ViewsProvider.js +50 -6
- package/views/dist/provider/components.d.ts +178 -11
- package/views/dist/provider/context.d.ts +6 -0
- package/views/dist/provider/moment.d.ts +6 -0
- package/views/dist/provider/moment.js +10 -0
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +4 -1
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +1499 -73
- package/views/dist/styles.unlayered.css +1497 -70
- package/views/docs/contract.md +56 -23
- package/views/docs/controls/alert-dialog.md +37 -0
- package/views/docs/controls/alert.md +30 -0
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/collapsible.md +22 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/filter-editor.md +28 -0
- package/views/docs/controls/group-editor.md +11 -0
- package/views/docs/controls/modal.md +55 -0
- package/views/docs/controls/notice.md +32 -0
- package/views/docs/controls/pane.md +25 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/sort-editor.md +27 -0
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toast.md +32 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +3 -3
- package/views/docs/guides/display.md +3 -3
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +6 -6
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +2 -2
- package/views/docs/guides/the-provider.md +21 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +3 -3
- package/views/docs/reference/controls.md +403 -16
- package/views/docs/reference/display.md +3 -2
- package/views/docs/reference/editors-relation.md +1 -1
- package/views/docs/reference/looks.md +35 -11
- package/views/docs/reference/panels-react.md +11 -10
- package/views/docs/reference/panels.md +9 -7
- package/views/docs/reference/react.md +20 -13
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +8 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { resolveViewsMessage } from "../../contract.js";
|
|
4
4
|
import { ViewsContext } from "../../provider/context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { menuWordsOf } from "../picker/map-picker.js";
|
|
6
6
|
import { Menu } from "./menu.js";
|
|
7
7
|
const NO_REASON = "Not now";
|
|
8
8
|
const closingTick = (item) => item.checked !== undefined && !item.keepOpen && !item.children && !item.href && !item.disabled;
|
|
@@ -48,6 +48,6 @@ export function menuEntries(items, notNow = NO_REASON) {
|
|
|
48
48
|
}
|
|
49
49
|
export function MapMenu({ open, onOpenChange, anchor, items, side, align, label }) {
|
|
50
50
|
const say = React.useContext(ViewsContext)?.messages ?? resolveViewsMessage;
|
|
51
|
-
const words = React.useMemo(() => (
|
|
51
|
+
const words = React.useMemo(() => menuWordsOf(say), [say]);
|
|
52
52
|
return _jsx(Menu, { words: words, entries: menuEntries(items, say({ key: "views.menus.not-now" })), label: label ?? "", open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align === "center" || align === undefined ? "start" : align });
|
|
53
53
|
}
|
|
@@ -100,6 +100,17 @@ export declare const menuListCloseOf: (el: Element | null) => boolean;
|
|
|
100
100
|
export declare function useMenuListOption(frame: HTMLElement | null, id: MenuListLookOptionId): string;
|
|
101
101
|
/** What its rows stand on, as worn around `frame`, kept up to date as an app changes it. */
|
|
102
102
|
export declare const useMenuListRows: (frame: HTMLElement | null) => string;
|
|
103
|
+
/** The words its rows with a grip and its Switches say: a grip's name, how the rows move on a computer and on a phone, each move as
|
|
104
|
+
* it is said, and the Switch's two words. English unless handed (the group editor hands the app's, VK-839). */
|
|
105
|
+
export interface MenuListWords {
|
|
106
|
+
move: (label: string) => string;
|
|
107
|
+
howKeys: string;
|
|
108
|
+
howHold: string;
|
|
109
|
+
movedTo: (label: string, at: number, of: number) => string;
|
|
110
|
+
on: string;
|
|
111
|
+
off: string;
|
|
112
|
+
}
|
|
113
|
+
export declare const MENU_LIST_WORDS: MenuListWords;
|
|
103
114
|
/** What scrolls in a menu's panel: its rows, alone, when the panel is taller than the room on screen, the Scrollbar over
|
|
104
115
|
* them: the menu's panel and each level in. Not the menu list's rows in a panel that is no menu (`.o-menu-rows`). */
|
|
105
116
|
export declare const MenuScroll: ({ children }: {
|
|
@@ -133,6 +144,8 @@ export interface MenuListPanelRowsProps {
|
|
|
133
144
|
ticks?: "box" | "switch" | "eye";
|
|
134
145
|
/** A row with a grip moved, handed on as it is made: its place and the place it moved to, counted among the rows with a grip. */
|
|
135
146
|
onMove?: (from: number, to: number) => void;
|
|
147
|
+
/** Its grips' and Switches' words; English unless handed. */
|
|
148
|
+
words?: Partial<MenuListWords>;
|
|
136
149
|
className?: string;
|
|
137
150
|
}
|
|
138
151
|
/** A menu's rows on a computer standing in a panel that is no menu (the Pane, a Popover): the same rows, pressed and keyed by
|
|
@@ -140,7 +153,7 @@ export interface MenuListPanelRowsProps {
|
|
|
140
153
|
* a row one level in handed to its holder, which shows what it opens in place. It draws no panel: its holder's is round it.
|
|
141
154
|
* Its rows are one tab stop, as a menu's are; the pointer lights the row under it, and moves the focus there only while the
|
|
142
155
|
* focus is already in it, so it never takes the focus from its holder's other controls. */
|
|
143
|
-
export declare function MenuListPanelRows({ label, entries, onOpen, ticks, onMove, className }: MenuListPanelRowsProps): import("react/jsx-runtime").JSX.Element;
|
|
156
|
+
export declare function MenuListPanelRows({ label, entries, onOpen, ticks, onMove, className, words: given }: MenuListPanelRowsProps): import("react/jsx-runtime").JSX.Element;
|
|
144
157
|
export declare function tilesOf(entries: MenuEntry[], allRows?: boolean): {
|
|
145
158
|
tiles?: MenuListTile[];
|
|
146
159
|
entries: MenuEntry[];
|
|
@@ -190,9 +203,11 @@ export interface MenuListProps {
|
|
|
190
203
|
onMove?: (from: number, to: number) => void;
|
|
191
204
|
/** How a tick is drawn: the Switch (the default), or an eye at its end, crossed while it is off. */
|
|
192
205
|
ticks?: "switch" | "eye";
|
|
206
|
+
/** Its grips' and Switches' words; English unless handed. */
|
|
207
|
+
words?: Partial<MenuListWords>;
|
|
193
208
|
className?: string;
|
|
194
209
|
}
|
|
195
210
|
/** What you can do with something, as rows you press: tiles if it has them, then its rows in sections. Pour it into a Sheet; it owns
|
|
196
211
|
* no way of opening or closing. No search: a menu long enough to need one is a wrong menu. */
|
|
197
|
-
export declare function MenuList({ label, entries, tiles, onOpen, onClose, closeWord, onMove, ticks, className }: MenuListProps): import("react/jsx-runtime").JSX.Element;
|
|
212
|
+
export declare function MenuList({ label, entries, tiles, onOpen, onClose, closeWord, onMove, ticks, className, words: given }: MenuListProps): import("react/jsx-runtime").JSX.Element;
|
|
198
213
|
export {};
|
|
@@ -49,10 +49,17 @@ const linkBody = (e, id) => _jsxs(_Fragment, { children: [e.icon, _jsx("span", {
|
|
|
49
49
|
const checkBody = (e, id) => _jsxs(_Fragment, { children: [_jsx(CheckboxMark, {}), _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label })] });
|
|
50
50
|
const actionsBody = (e, id) => _jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.detail != null && _jsx("span", { className: "o-menu-value", id: part(id, "v"), "data-on": e.inForce ? "" : undefined, children: e.detail }), strokeGlyph(MORE, "o-menu-more")] });
|
|
51
51
|
const choicesBody = (e, id) => (_jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), _jsx("span", { className: "o-menu-value", id: part(id, "v"), children: e.detail ?? e.choices.find((c) => c.value === e.value)?.label }), strokeGlyph(MORE, "o-menu-more")] }));
|
|
52
|
-
const
|
|
53
|
-
|
|
52
|
+
export const MENU_LIST_WORDS = {
|
|
53
|
+
move: (label) => `Move ${label}`,
|
|
54
|
+
howKeys: "Left arrow for its grip, then up or down arrow to move it",
|
|
55
|
+
howHold: "Hold, then drag to move it",
|
|
56
|
+
movedTo: (label, at, of) => `${label}, ${at} of ${of}`,
|
|
57
|
+
on: "On",
|
|
58
|
+
off: "Off",
|
|
59
|
+
};
|
|
60
|
+
const listWords = (given) => (given ? { ...MENU_LIST_WORDS, ...given } : MENU_LIST_WORDS);
|
|
54
61
|
const HOLD = { delay: (row) => msOf(row, "--menu-list-hold"), swipe: (row) => spacingPx(2, row) };
|
|
55
|
-
const movedTo = (list, from, to) =>
|
|
62
|
+
const movedTo = (list, from, to, w = MENU_LIST_WORDS) => w.movedTo("label" in list[from] ? list[from].label : "", to + 1, list.length);
|
|
56
63
|
function Says({ id, how, said }) {
|
|
57
64
|
return _jsxs(_Fragment, { children: [_jsx("span", { id: id, hidden: true, children: how }), _jsx("span", { role: "status", className: "o-menu-said", children: said })] });
|
|
58
65
|
}
|
|
@@ -116,16 +123,17 @@ export function MenuListShown({ entries, label, open, on = [], className }) {
|
|
|
116
123
|
}
|
|
117
124
|
const grippedOf = (list) => list.flatMap((e) => (e.kind === "group" ? grippedOf(e.entries) : e.kind !== "separator" && e.kind !== "pick" && e.grip && !("disabled" in e && e.disabled) ? [e] : []));
|
|
118
125
|
const disabledProps = (why) => (why ? { "aria-disabled": true, "data-disabled": "", title: why } : {});
|
|
119
|
-
function PanelCheck({ e, item, ticks, grip, id }) {
|
|
126
|
+
function PanelCheck({ e, item, ticks, grip, id, words = MENU_LIST_WORDS }) {
|
|
120
127
|
const [own, setOwn] = React.useState(!!e.defaultChecked), on = e.checked ?? own;
|
|
121
128
|
const press = () => { if (e.disabled)
|
|
122
129
|
return; const next = !on; if (e.checked === undefined)
|
|
123
130
|
setOwn(next); e.onCheckedChange?.(next); };
|
|
124
131
|
if (ticks === "eye")
|
|
125
132
|
return (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-eyed", children: [grip, e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), eyeOf(on, "o-menu-eye")] }));
|
|
126
|
-
return ticks === "switch" ? (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-switch", children: [grip, e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), _jsx(Switch, { size: "sm", checked: on, onCheckedChange: () => { }, disabled: !!e.disabled, tabIndex: -1, "aria-hidden": true, onMouseDown: (ev) => { ev.preventDefault(); ev.currentTarget.closest("[data-item]")?.focus({ preventScroll: true }); } })] })) : (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", children: [grip, checkBody(e, id)] }));
|
|
133
|
+
return ticks === "switch" ? (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-switch", children: [grip, e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), _jsx(Switch, { size: "sm", checked: on, onCheckedChange: () => { }, disabled: !!e.disabled, tabIndex: -1, "aria-hidden": true, words: [words.on, words.off], onMouseDown: (ev) => { ev.preventDefault(); ev.currentTarget.closest("[data-item]")?.focus({ preventScroll: true }); } })] })) : (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...disabledProps(e.disabled), ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", children: [grip, checkBody(e, id)] }));
|
|
127
134
|
}
|
|
128
|
-
export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMove, className }) {
|
|
135
|
+
export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMove, className, words: given }) {
|
|
136
|
+
const w = listWords(given);
|
|
129
137
|
const root = React.useRef(null), mark = phoneMark(usePhoneForm());
|
|
130
138
|
const [lit, setLit] = React.useState(null), [stop, setStop] = React.useState(0);
|
|
131
139
|
const typed = React.useRef({ text: "", at: 0 });
|
|
@@ -143,7 +151,7 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
|
|
|
143
151
|
};
|
|
144
152
|
setLit((l) => (l == null ? l : at(l)));
|
|
145
153
|
setStop(at);
|
|
146
|
-
setSaid(movedTo(gripped, from, to));
|
|
154
|
+
setSaid(movedTo(gripped, from, to, w));
|
|
147
155
|
onMove?.(from, to);
|
|
148
156
|
} });
|
|
149
157
|
const rowsNow = () => [...(root.current?.querySelectorAll("[data-item]") ?? [])];
|
|
@@ -229,7 +237,7 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
|
|
|
229
237
|
if (g < 0 || !("label" in e))
|
|
230
238
|
return null;
|
|
231
239
|
const own = gripProps(g);
|
|
232
|
-
return (_jsx(Grip, { label:
|
|
240
|
+
return (_jsx(Grip, { label: w.move(e.label), className: "o-menu-grip", tabIndex: -1, ...own, onClick: (ev) => ev.stopPropagation(), onKeyDown: (ev) => {
|
|
233
241
|
if (ev.key === "ArrowRight" || ev.key === "Escape") {
|
|
234
242
|
ev.preventDefault();
|
|
235
243
|
ev.stopPropagation();
|
|
@@ -252,7 +260,7 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
|
|
|
252
260
|
if (e.kind === "pick")
|
|
253
261
|
return (_jsxs("div", { role: "group", "aria-label": e.heading, children: [e.heading && _jsx("p", { className: "o-list-heading", children: e.heading }), e.choices.map((c) => _jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, ...item(), onClick: () => e.onChoose?.(c.value), className: ROW, children: choiceBody(c) }, c.value))] }, k));
|
|
254
262
|
if (e.kind === "check")
|
|
255
|
-
return _jsx(PanelCheck, { e: e, item: item(e), ticks: ticks, grip: gripFor(e), id: idOf(e) }, k);
|
|
263
|
+
return _jsx(PanelCheck, { e: e, item: item(e), ticks: ticks, grip: gripFor(e), id: idOf(e), words: w }, k);
|
|
256
264
|
if (e.kind === "link") {
|
|
257
265
|
const attrs = { role: "menuitem", ...item(e), className: ROW, onClick: e.onSelect, ...(e.external ? { target: "_blank", rel: "noreferrer" } : {}) };
|
|
258
266
|
return e.render ? React.cloneElement(e.render, { key: k, ...attrs }, gripFor(e), linkBody(e, idOf(e))) : _jsxs("a", { href: e.href, ...attrs, children: [gripFor(e), linkBody(e, idOf(e))] }, k);
|
|
@@ -262,7 +270,7 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
|
|
|
262
270
|
return _jsxs("div", { role: "menuitem", ...disabledProps(e.disabled), ...item(e), onClick: () => { if (!e.disabled)
|
|
263
271
|
e.onSelect?.(); }, className: rowClass(e), children: [gripFor(e), actionBody(e, idOf(e))] }, k);
|
|
264
272
|
});
|
|
265
|
-
return (_jsxs("div", { ref: root, role: "menu", "aria-label": label, className: cx("o-menu-rows", className), "data-kit": "menu-list", ...mark, onKeyDown: onKeyDown, onPointerLeave: onPointerLeave, onBlur: onBlur, children: [rows(entries), gripped.length > 0 && _jsx(Says, { id: `${ids}how`, how:
|
|
273
|
+
return (_jsxs("div", { ref: root, role: "menu", "aria-label": label, className: cx("o-menu-rows", className), "data-kit": "menu-list", ...mark, onKeyDown: onKeyDown, onPointerLeave: onPointerLeave, onBlur: onBlur, children: [rows(entries), gripped.length > 0 && _jsx(Says, { id: `${ids}how`, how: w.howKeys, said: said })] }));
|
|
266
274
|
}
|
|
267
275
|
export function tilesOf(entries, allRows) {
|
|
268
276
|
if (allRows)
|
|
@@ -302,14 +310,14 @@ const endOf = (r) => {
|
|
|
302
310
|
const end = r.end ?? (r.kind === "actions" ? r.detail : r.kind === undefined || r.kind === "action" ? r.count : undefined);
|
|
303
311
|
return end != null ? _jsx("span", { className: "o-menu-list-end", "data-on": r.kind === "actions" && r.inForce ? "" : undefined, children: end }) : null;
|
|
304
312
|
};
|
|
305
|
-
function PhoneRow({ row, onOpen, move, room, ticks = "switch" }) {
|
|
313
|
+
function PhoneRow({ row, onOpen, move, room, ticks = "switch", words = MENU_LIST_WORDS }) {
|
|
306
314
|
const mv = move ? { "data-row": move.at, ...(move.lifted ? { "data-lifted": "" } : {}), style: move.style, ...move.drag } : {};
|
|
307
315
|
const how = move ? { "aria-describedby": move.how } : {};
|
|
308
316
|
const lead = move ? glyph(GRIP, "o-menu-list-grip") : room ? React.cloneElement(glyph(GRIP, "o-menu-list-grip"), { "data-room": "" }) : null;
|
|
309
317
|
if (row.kind === "check" && ticks === "eye")
|
|
310
318
|
return _jsx(PhoneEye, { row: row, lead: lead, mv: mv, how: how });
|
|
311
319
|
if (row.kind === "check")
|
|
312
|
-
return (_jsxs("label", { className: "o-menu-list-row", ...mv, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), _jsx(Switch, { size: "lg", checked: row.checked, defaultChecked: row.defaultChecked, onCheckedChange: (c) => row.onCheckedChange?.(c), disabled: !!row.disabled, ...how })] }));
|
|
320
|
+
return (_jsxs("label", { className: "o-menu-list-row", ...mv, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), _jsx(Switch, { size: "lg", checked: row.checked, defaultChecked: row.defaultChecked, onCheckedChange: (c) => row.onCheckedChange?.(c), disabled: !!row.disabled, words: [words.on, words.off], ...how })] }));
|
|
313
321
|
if (row.kind === "link") {
|
|
314
322
|
const attrs = { className: "o-menu-list-row", ...mv, ...how, ...(row.external ? { target: "_blank", rel: "noreferrer" } : {}) };
|
|
315
323
|
const inside = _jsxs(_Fragment, { children: [lead, body(row), endOf(row), row.external ? glyph(AWAY, "o-menu-list-more") : glyph(MORE, "o-menu-list-more")] });
|
|
@@ -332,18 +340,19 @@ function PhoneEye({ row, lead, mv, how }) {
|
|
|
332
340
|
setOwn(next); row.onCheckedChange?.(next); };
|
|
333
341
|
return (_jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, role: "switch", "aria-checked": on, disabled: !!row.disabled, focusableWhenDisabled: true, onClick: press, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), eyeOf(on, "o-menu-list-eye")] }));
|
|
334
342
|
}
|
|
335
|
-
export function MenuList({ label, entries, tiles, onOpen, onClose, closeWord = "Close", onMove, ticks, className }) {
|
|
343
|
+
export function MenuList({ label, entries, tiles, onOpen, onClose, closeWord = "Close", onMove, ticks, className, words: given }) {
|
|
344
|
+
const w = listWords(given);
|
|
336
345
|
const sections = React.useMemo(() => sectionsOf(entries).filter((s) => s.rows.length), [entries]);
|
|
337
346
|
const root = React.useRef(null), gripped = grippedOf(entries);
|
|
338
347
|
const ids = React.useId(), [said, setSaid] = React.useState("");
|
|
339
|
-
const { gripProps, lift, dragging } = useReorder({ count: gripped.length, grip: "[data-drag-start]", onMove: (from, to) => { setSaid(movedTo(gripped, from, to)); onMove?.(from, to); } });
|
|
348
|
+
const { gripProps, lift, dragging } = useReorder({ count: gripped.length, grip: "[data-drag-start]", onMove: (from, to) => { setSaid(movedTo(gripped, from, to, w)); onMove?.(from, to); } });
|
|
340
349
|
const phoneDrag = useHoldDrag(root, gripProps, HOLD, gripped.length > 0);
|
|
341
350
|
const moveOf = (r) => {
|
|
342
351
|
const at = gripped.indexOf(r);
|
|
343
352
|
return at < 0 ? undefined : { at, lifted: dragging === at, style: lift(at), drag: phoneDrag(at), how: `${ids}how` };
|
|
344
353
|
};
|
|
345
354
|
return (_jsxs("div", { ref: root, role: "group", "aria-label": label, className: cx("o-menu-list", className), "data-kit": "menu-list", children: [onClose && _jsx("div", { className: "o-menu-list-section", children: _jsx(PhoneRow, { row: { icon: _jsx(Icon, { name: "x", size: 22 }), label: closeWord, onSelect: onClose } }) }), tiles && (_jsx("div", { className: "o-menu-list-tiles", children: tiles.map((t) => _jsxs(BaseButton, { className: "o-menu-list-tile", disabled: t.disabled, onClick: t.onSelect, children: [_jsx("span", { className: "o-menu-list-mark", children: t.icon }), _jsx("span", { className: "o-menu-list-tile-name", children: t.label })] }, t.label)) })), sections.map((s, i) => {
|
|
346
|
-
const card = (_jsx("div", { role: s.name ? "group" : undefined, "aria-labelledby": s.name ? `${ids}h${i}` : undefined, className: "o-menu-list-section", children: s.rows.map((r) => _jsx(PhoneRow, { row: r, onOpen: onOpen, move: moveOf(r), room: gripped.length > 0, ticks: ticks }, r.label)) }, s.name ?? i));
|
|
355
|
+
const card = (_jsx("div", { role: s.name ? "group" : undefined, "aria-labelledby": s.name ? `${ids}h${i}` : undefined, className: "o-menu-list-section", children: s.rows.map((r) => _jsx(PhoneRow, { row: r, onOpen: onOpen, move: moveOf(r), room: gripped.length > 0, ticks: ticks, words: w }, r.label)) }, s.name ?? i));
|
|
347
356
|
return s.name ? _jsxs("div", { className: "o-menu-list-group", children: [_jsx("p", { id: `${ids}h${i}`, className: "o-list-heading", children: s.name }), card] }, `${i}${s.name}`) : card;
|
|
348
|
-
}), gripped.length > 0 && _jsx(Says, { id: `${ids}how`, how:
|
|
357
|
+
}), gripped.length > 0 && _jsx(Says, { id: `${ids}how`, how: w.howHold, said: said })] }));
|
|
349
358
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PieceLooks } from "../../looks/looks.js";
|
|
2
|
+
export type ModalOptionId = "edge" | "lines" | "buttons" | "head" | "size" | "corners" | "smoothing" | "padding" | "behind" | "strength" | "blur" | "shadow";
|
|
3
|
+
/** The Modal's options and its looks: Framed is Attio's, Outlined Linear's. */
|
|
4
|
+
export declare const MODAL_LOOKS: PieceLooks<ModalOptionId>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const steps = (ids) => ids.map((id) => ({ id, name: id }));
|
|
2
|
+
const options = [
|
|
3
|
+
{ id: "edge", name: "Edge", device: "desktop", def: "ring", values: [{ id: "ring", name: "Ring" }, { id: "outline", name: "Outline" }] },
|
|
4
|
+
{ id: "lines", name: "Lines", device: "desktop", def: "shown", values: [{ id: "shown", name: "Head and foot" }, { id: "none", name: "None" }] },
|
|
5
|
+
{ id: "buttons", name: "Buttons", device: "desktop", def: "own", values: [{ id: "own", name: "The Button's" }, { id: "pill", name: "Pill" }] },
|
|
6
|
+
{ id: "head", name: "Head and foot", device: "desktop", def: "bar", values: [{ id: "bar", name: "Bar" }, { id: "margin", name: "Margin" }] },
|
|
7
|
+
{ id: "size", name: "Button size", device: "desktop", def: "28", kind: "steps", values: steps(["28", "32", "36"]) },
|
|
8
|
+
{ id: "corners", name: "Corners", device: "desktop", def: "xl", kind: "steps", values: steps(["lg", "xl", "2xl"]) },
|
|
9
|
+
{ id: "smoothing", name: "Corner smoothing", device: "desktop", def: "smooth", values: [{ id: "round", name: "Round" }, { id: "smooth", name: "Smooth" }] },
|
|
10
|
+
{ id: "padding", name: "Padding", device: "desktop", def: "20", kind: "steps", values: steps(["16", "20", "24"]) },
|
|
11
|
+
{ id: "behind", name: "What's behind", device: "desktop", def: "dim", values: [{ id: "dim", name: "Dim" }, { id: "veil", name: "Veil" }] },
|
|
12
|
+
{ id: "strength", name: "Strength", device: "desktop", def: "light", kind: "steps", values: [{ id: "light", name: "Light" }, { id: "medium", name: "Medium" }, { id: "deep", name: "Deep" }] },
|
|
13
|
+
{ id: "blur", name: "Blur", device: "desktop", def: "0", kind: "steps", values: [{ id: "0", name: "None" }, ...steps(["4", "8", "12", "24"])] },
|
|
14
|
+
{ id: "shadow", name: "Shadow", device: "desktop", def: "2xl", kind: "steps", values: [{ id: "none", name: "None" }, { id: "lg", name: "Large" }, { id: "xl", name: "Extra large" }, { id: "2xl", name: "Largest" }] },
|
|
15
|
+
];
|
|
16
|
+
const shared = { size: "28", corners: "xl", smoothing: "smooth", padding: "20", behind: "dim", strength: "light", blur: "0", shadow: "2xl" };
|
|
17
|
+
export const MODAL_LOOKS = {
|
|
18
|
+
id: "modal",
|
|
19
|
+
name: "Modal",
|
|
20
|
+
options,
|
|
21
|
+
looks: [
|
|
22
|
+
{ id: "framed", name: "Framed", device: "desktop", picks: { ...shared, edge: "ring", lines: "shown", buttons: "own", head: "bar" } },
|
|
23
|
+
{ id: "outlined", name: "Outlined", device: "desktop", picks: { ...shared, edge: "outline", lines: "none", buttons: "pill", head: "margin" } },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** How wide it stands: 512, 672, 896 or 1024, from the kit's containers. */
|
|
3
|
+
export type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
4
|
+
/** What its foot holds: Cancel and the action, the action alone, or nothing, for a long read. */
|
|
5
|
+
export type ModalFoot = "both" | "action" | "none";
|
|
6
|
+
/** At rest; saving, when nothing closes it; or not saved, when it stays open and says why. */
|
|
7
|
+
export type ModalState = "rest" | "saving" | "failed";
|
|
8
|
+
/** What its foot confirms. */
|
|
9
|
+
export interface ModalAction {
|
|
10
|
+
/** The verb that happens: "Save changes", "Create deal". */
|
|
11
|
+
label: string;
|
|
12
|
+
/** Primary unless it takes something away. */
|
|
13
|
+
kind?: "primary" | "danger";
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** The work it starts. It shows it's saving until this is done, then closes; if it throws, it stays open with what went wrong. */
|
|
16
|
+
run?: () => void | Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/** The words a Modal draws of its own: its head's buttons, what a failure says when its work threw no words, and the question
|
|
19
|
+
* every way out asks while something typed is unsaved. Its way out's word is its `cancel`. */
|
|
20
|
+
export type ModalWords = {
|
|
21
|
+
close: string;
|
|
22
|
+
openAsPage: string;
|
|
23
|
+
failed: string;
|
|
24
|
+
discardTitle: string;
|
|
25
|
+
discardLine: string;
|
|
26
|
+
discard: string;
|
|
27
|
+
keepEditing: string;
|
|
28
|
+
};
|
|
29
|
+
/** Its words in English. */
|
|
30
|
+
export declare const MODAL_WORDS: ModalWords;
|
|
31
|
+
export interface ModalProps {
|
|
32
|
+
open: boolean;
|
|
33
|
+
/** Told when it closes: by any way out, once unsaved changes are let go, or by its action once its work is done. */
|
|
34
|
+
onOpenChange: (open: boolean) => void;
|
|
35
|
+
/** What it is: "Edit company", "New deal". */
|
|
36
|
+
title: string;
|
|
37
|
+
/** Its head's mark: an icon, in a tile on a bar, quieter in the margin. */
|
|
38
|
+
mark?: React.ReactNode;
|
|
39
|
+
/** Where it was opened: a chip before its title. */
|
|
40
|
+
path?: {
|
|
41
|
+
label: string;
|
|
42
|
+
icon?: React.ReactNode;
|
|
43
|
+
};
|
|
44
|
+
/** Open as a page, beside the X. */
|
|
45
|
+
onOpenAsPage?: () => void;
|
|
46
|
+
size?: ModalSize;
|
|
47
|
+
foot?: ModalFoot;
|
|
48
|
+
action?: ModalAction;
|
|
49
|
+
/** The way out's word: "Cancel" unless said. */
|
|
50
|
+
cancel?: string;
|
|
51
|
+
/** What stands at its foot's start: an attach, a Create more. */
|
|
52
|
+
footStart?: React.ReactNode;
|
|
53
|
+
/** Something typed is unsaved: every way out asks "Discard your changes?" first. */
|
|
54
|
+
dirty?: boolean;
|
|
55
|
+
/** Shown as it stands, on a page that shows one. Left out, its own. */
|
|
56
|
+
state?: ModalState;
|
|
57
|
+
/** What went wrong, on a page that shows one. Left out, what its action threw. */
|
|
58
|
+
failed?: React.ReactNode;
|
|
59
|
+
/** Where it is drawn: over the whole page, or inside an element that holds it as a window holds a page. */
|
|
60
|
+
container?: HTMLElement | null;
|
|
61
|
+
/** It stands in `container`, a screen on a page that shows it: what's round that screen stays live. */
|
|
62
|
+
standing?: boolean;
|
|
63
|
+
/** Its body. */
|
|
64
|
+
children: React.ReactNode;
|
|
65
|
+
/** Its own words, over the English. */
|
|
66
|
+
words?: Partial<ModalWords>;
|
|
67
|
+
}
|
|
68
|
+
/** Holds a form, a quick create or a long read over the page: its own shell on a computer, the Sheet on the phone. */
|
|
69
|
+
export declare function Modal({ open, onOpenChange, title, mark, path, onOpenAsPage, size, foot, action, cancel, footStart, dirty, state, failed, container, standing, children, words }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Dialog as BaseDialog } from "@base-ui/react/dialog";
|
|
4
|
+
import { AlertDialog } from "../alert-dialog/alert-dialog.js";
|
|
5
|
+
import { Button } from "../button/button.js";
|
|
6
|
+
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
7
|
+
import { usePopupHost } from "../internal/popup-host.js";
|
|
8
|
+
import { Notice } from "../notice/notice.js";
|
|
9
|
+
import { Scrollbar } from "../scrollbar/scrollbar.js";
|
|
10
|
+
import { Sheet, SheetBody, SheetButton, SheetHead } from "../sheet/bottom-sheet.js";
|
|
11
|
+
const glyph = (paths) => _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) });
|
|
12
|
+
const X = ["M18 6l-12 12", "M6 6l12 12"], CHECK = ["M5 12l5 5l10 -10"], NEXT = ["M9 6l6 6l-6 6"];
|
|
13
|
+
const EXPAND = ["M16 4l4 0l0 4", "M14 10l6 -6", "M8 20l-4 0l0 -4", "M4 20l6 -6"];
|
|
14
|
+
export const MODAL_WORDS = {
|
|
15
|
+
close: "Close",
|
|
16
|
+
openAsPage: "Open as a page",
|
|
17
|
+
failed: "That didn't save: the server didn't answer. Your changes are still here.",
|
|
18
|
+
discardTitle: "Discard your changes?",
|
|
19
|
+
discardLine: "What you typed isn't saved yet.",
|
|
20
|
+
discard: "Discard",
|
|
21
|
+
keepEditing: "Keep editing",
|
|
22
|
+
};
|
|
23
|
+
export function Modal({ open, onOpenChange, title, mark, path, onOpenAsPage, size = "md", foot = "both", action, cancel = "Cancel", footStart, dirty, state, failed, container, standing, children, words }) {
|
|
24
|
+
const said = { ...MODAL_WORDS, ...words };
|
|
25
|
+
const ref = React.useRef(null), host = usePopupHost(ref), body = React.useRef(null);
|
|
26
|
+
const small = usePhone(), screen = React.useContext(PhoneHost), phone = small || !!screen;
|
|
27
|
+
const [own, setOwn] = React.useState("rest"), [why, setWhy] = React.useState(null), [asking, setAsking] = React.useState(false);
|
|
28
|
+
const [wasOpen, setWasOpen] = React.useState(open);
|
|
29
|
+
if (open !== wasOpen) {
|
|
30
|
+
setWasOpen(open);
|
|
31
|
+
if (open) {
|
|
32
|
+
setOwn("rest");
|
|
33
|
+
setWhy(null);
|
|
34
|
+
setAsking(false);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const now = state ?? own, saving = now === "saving", wrong = now === "failed", where = container ?? screen ?? host;
|
|
38
|
+
const [overPopup, setOverPopup] = React.useState(false);
|
|
39
|
+
React.useLayoutEffect(() => { setOverPopup(!!ref.current?.closest('[data-kit="popover"]')); }, []);
|
|
40
|
+
const over = overPopup ? "" : undefined;
|
|
41
|
+
const leave = () => { if (saving)
|
|
42
|
+
return; if (dirty)
|
|
43
|
+
setAsking(true);
|
|
44
|
+
else
|
|
45
|
+
onOpenChange(false); };
|
|
46
|
+
const act = () => {
|
|
47
|
+
if (saving || action?.disabled)
|
|
48
|
+
return;
|
|
49
|
+
if (!action?.run)
|
|
50
|
+
return onOpenChange(false);
|
|
51
|
+
setOwn("saving");
|
|
52
|
+
Promise.resolve().then(action.run).then(() => { setOwn("rest"); onOpenChange(false); }, (e) => { setWhy(e instanceof Error && e.message ? e.message : said.failed); setOwn("failed"); });
|
|
53
|
+
};
|
|
54
|
+
const notice = wrong ? _jsx(Notice, { meaning: "danger", urgent: true, className: "o-modal-failed", children: failed ?? why }) : null;
|
|
55
|
+
const guard = (_jsx(AlertDialog, { open: asking, onAnswer: (yes) => { setAsking(false); if (yes)
|
|
56
|
+
onOpenChange(false); }, title: said.discardTitle, line: said.discardLine, action: said.discard, kind: "danger", cancel: said.keepEditing, container: where, standing: standing }));
|
|
57
|
+
if (phone)
|
|
58
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: ref, hidden: true }), _jsxs(Sheet, { open: open, onOpenChange: (o) => { if (!o)
|
|
59
|
+
leave(); }, label: title, form: "full", container: where, standing: standing, children: [_jsx(SheetHead, { title: title, left: _jsx(SheetButton, { "aria-label": cancel, icon: glyph(X), onClick: leave, disabled: saving }), right: foot !== "none" && action ? _jsx(SheetButton, { kind: "primary", "aria-label": action.label, icon: glyph(CHECK), onClick: act, disabled: saving || action.disabled }) : _jsx("span", {}) }), _jsxs(SheetBody, { children: [notice, children] }), guard] })] }));
|
|
60
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: ref, hidden: true }), _jsx(BaseDialog.Root, { open: open, onOpenChange: (o) => { if (!o)
|
|
61
|
+
leave(); }, ...(standing ? { modal: false, disablePointerDismissal: true } : {}), children: _jsxs(BaseDialog.Portal, { container: where, children: [_jsx(BaseDialog.Backdrop, { className: "o-modal-backdrop", "data-over-popup": over }), _jsx(BaseDialog.Viewport, { className: "o-modal-viewport", "data-over-popup": over, children: _jsxs(BaseDialog.Popup, { className: "o-modal", "data-kit": "modal", "data-width": size, "aria-busy": saving || undefined, initialFocus: standing ? false : () => body.current?.querySelector("input:not([type=hidden]), textarea, [role='combobox'], .o-select-field") ?? true, children: [_jsxs("div", { className: "o-modal-cut o-smooth", children: [_jsxs("header", { className: "o-modal-head", children: [mark != null && _jsx("span", { className: "o-modal-mark", "aria-hidden": "true", children: mark }), path && _jsxs("span", { className: "o-modal-path", children: [_jsxs("span", { className: "o-modal-chip", children: [path.icon, _jsx("span", { className: "o-modal-chip-word", children: path.label })] }), glyph(NEXT)] }), _jsx(BaseDialog.Title, { className: "o-modal-title", children: title }), _jsxs("span", { className: "o-modal-tools", children: [onOpenAsPage && _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", "aria-label": said.openAsPage, icon: glyph(EXPAND), onClick: onOpenAsPage }), _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", "aria-label": said.close, icon: glyph(X), disabled: saving, onClick: leave })] })] }), _jsxs("div", { ref: body, className: "o-modal-body", children: [notice, children] }), _jsx(Scrollbar, { drawn: true }), foot !== "none" && (_jsxs("footer", { className: "o-modal-foot", children: [footStart != null && _jsx("span", { className: "o-modal-start", children: footStart }), _jsxs("span", { className: "o-modal-end", children: [foot === "both" && _jsx(Button, { className: "o-modal-cancel", disabled: saving, onClick: leave, children: cancel }), action && _jsx(Button, { kind: action.kind ?? "primary", loading: saving, disabled: action.disabled, onClick: act, children: action.label })] })] }))] }), guard] }) })] }) })] }));
|
|
62
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
export declare const MODAL_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-layer-drawer";
|
|
3
|
+
readonly kind: "size";
|
|
4
|
+
readonly outright: "--layer-drawer";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-layer-popup";
|
|
7
|
+
readonly kind: "size";
|
|
8
|
+
readonly outright: "--layer-popup";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-backdrop-modal-light";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--backdrop-modal-light";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-duration-base";
|
|
15
|
+
readonly kind: "motion";
|
|
16
|
+
readonly outright: "--duration-base";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-ease-out";
|
|
19
|
+
readonly kind: "motion";
|
|
20
|
+
readonly outright: "--ease-out";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-backdrop-modal-medium";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--backdrop-modal-medium";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-backdrop-modal-deep";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--backdrop-modal-deep";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-backdrop-modal-veil-light";
|
|
31
|
+
readonly kind: "colour";
|
|
32
|
+
readonly outright: "--backdrop-modal-veil-light";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-backdrop-modal-veil-medium";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--backdrop-modal-veil-medium";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-backdrop-modal-veil-deep";
|
|
39
|
+
readonly kind: "colour";
|
|
40
|
+
readonly outright: "--backdrop-modal-veil-deep";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-blur-xs";
|
|
43
|
+
readonly kind: "size";
|
|
44
|
+
readonly outright: "--blur-xs";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-blur-sm";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--blur-sm";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-blur-md";
|
|
51
|
+
readonly kind: "size";
|
|
52
|
+
readonly outright: "--blur-md";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-blur-lg";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--blur-lg";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-spacing";
|
|
59
|
+
readonly kind: "size";
|
|
60
|
+
readonly outright: "--spacing";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-radius-xl";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--radius-xl";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-container-2xl";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--container-2xl";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-overlay";
|
|
71
|
+
readonly kind: "colour";
|
|
72
|
+
readonly outright: "--surface-overlay";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-shadow-2xl";
|
|
75
|
+
readonly kind: "shadow";
|
|
76
|
+
readonly outright: "--shadow-2xl";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-fg";
|
|
79
|
+
readonly kind: "colour";
|
|
80
|
+
readonly outright: "--text";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-container-lg";
|
|
83
|
+
readonly kind: "size";
|
|
84
|
+
readonly outright: "--container-lg";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-container-4xl";
|
|
87
|
+
readonly kind: "size";
|
|
88
|
+
readonly outright: "--container-4xl";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-container-5xl";
|
|
91
|
+
readonly kind: "size";
|
|
92
|
+
readonly outright: "--container-5xl";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "--vk-push-scale";
|
|
95
|
+
readonly kind: "motion";
|
|
96
|
+
readonly outright: "--push-scale";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-duration-fast";
|
|
99
|
+
readonly kind: "motion";
|
|
100
|
+
readonly outright: "--duration-fast";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "--vk-ease-in";
|
|
103
|
+
readonly kind: "motion";
|
|
104
|
+
readonly outright: "--ease-in";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "--vk-press-scale";
|
|
107
|
+
readonly kind: "motion";
|
|
108
|
+
readonly outright: "--press-scale";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "--vk-radius-lg";
|
|
111
|
+
readonly kind: "size";
|
|
112
|
+
readonly outright: "--radius-lg";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "--vk-radius-2xl";
|
|
115
|
+
readonly kind: "size";
|
|
116
|
+
readonly outright: "--radius-2xl";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "--vk-shadow-lg";
|
|
119
|
+
readonly kind: "shadow";
|
|
120
|
+
readonly outright: "--shadow-lg";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "--vk-shadow-xl";
|
|
123
|
+
readonly kind: "shadow";
|
|
124
|
+
readonly outright: "--shadow-xl";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "--vk-border-modal-ring";
|
|
127
|
+
readonly kind: "colour";
|
|
128
|
+
readonly outright: "--border-modal-ring";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "--vk-border-width";
|
|
131
|
+
readonly kind: "size";
|
|
132
|
+
readonly outright: "--border-width";
|
|
133
|
+
}, {
|
|
134
|
+
readonly name: "--vk-border-modal-edge";
|
|
135
|
+
readonly kind: "colour";
|
|
136
|
+
readonly outright: "--border-modal-edge";
|
|
137
|
+
}, {
|
|
138
|
+
readonly name: "--vk-border";
|
|
139
|
+
readonly kind: "colour";
|
|
140
|
+
readonly outright: "--border";
|
|
141
|
+
}, {
|
|
142
|
+
readonly name: "--vk-font-size-base";
|
|
143
|
+
readonly kind: "size";
|
|
144
|
+
readonly outright: "--text-base";
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "--vk-line-height-base";
|
|
147
|
+
readonly kind: "size";
|
|
148
|
+
readonly outright: "--text-base--line-height";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "--vk-font-weight-medium";
|
|
151
|
+
readonly kind: "size";
|
|
152
|
+
readonly outright: "--font-weight-medium";
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "--vk-font-size-sm";
|
|
155
|
+
readonly kind: "size";
|
|
156
|
+
readonly outright: "--text-sm";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "--vk-line-height-sm";
|
|
159
|
+
readonly kind: "size";
|
|
160
|
+
readonly outright: "--text-sm--line-height";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "--vk-radius-sm";
|
|
163
|
+
readonly kind: "size";
|
|
164
|
+
readonly outright: "--radius-sm";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "--vk-brand";
|
|
167
|
+
readonly kind: "colour";
|
|
168
|
+
readonly outright: "--background-brand-bold";
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "--vk-fg-on-brand";
|
|
171
|
+
readonly kind: "colour";
|
|
172
|
+
readonly outright: "--text-brand-inverse";
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "--vk-fg-subtle";
|
|
175
|
+
readonly kind: "colour";
|
|
176
|
+
readonly outright: "--text-subtle";
|
|
177
|
+
}, {
|
|
178
|
+
readonly name: "--vk-fg-subtlest";
|
|
179
|
+
readonly kind: "colour";
|
|
180
|
+
readonly outright: "--text-subtlest";
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "--vk-radius-full";
|
|
183
|
+
readonly kind: "size";
|
|
184
|
+
readonly outright: "--radius-full";
|
|
185
|
+
}, {
|
|
186
|
+
readonly name: "--vk-overlay-card";
|
|
187
|
+
readonly kind: "colour";
|
|
188
|
+
readonly outright: "--surface-overlay-card";
|
|
189
|
+
}];
|
|
190
|
+
/** The Modal's own machinery: its corners, padding and width as its options and its size set them, the edge's corner, and how
|
|
191
|
+
* far it keeps from the screen's edges (`--modal-room`, which a page that draws a screen sets). */
|
|
192
|
+
export declare const MODAL_PRIVATE: readonly ["--modal-"];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const MODAL_TOKENS = [
|
|
2
|
+
{ name: "--vk-layer-drawer", kind: "size", outright: "--layer-drawer" },
|
|
3
|
+
{ name: "--vk-layer-popup", kind: "size", outright: "--layer-popup" },
|
|
4
|
+
{ name: "--vk-backdrop-modal-light", kind: "colour", outright: "--backdrop-modal-light" },
|
|
5
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
6
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
7
|
+
{ name: "--vk-backdrop-modal-medium", kind: "colour", outright: "--backdrop-modal-medium" },
|
|
8
|
+
{ name: "--vk-backdrop-modal-deep", kind: "colour", outright: "--backdrop-modal-deep" },
|
|
9
|
+
{ name: "--vk-backdrop-modal-veil-light", kind: "colour", outright: "--backdrop-modal-veil-light" },
|
|
10
|
+
{ name: "--vk-backdrop-modal-veil-medium", kind: "colour", outright: "--backdrop-modal-veil-medium" },
|
|
11
|
+
{ name: "--vk-backdrop-modal-veil-deep", kind: "colour", outright: "--backdrop-modal-veil-deep" },
|
|
12
|
+
{ name: "--vk-blur-xs", kind: "size", outright: "--blur-xs" },
|
|
13
|
+
{ name: "--vk-blur-sm", kind: "size", outright: "--blur-sm" },
|
|
14
|
+
{ name: "--vk-blur-md", kind: "size", outright: "--blur-md" },
|
|
15
|
+
{ name: "--vk-blur-lg", kind: "size", outright: "--blur-lg" },
|
|
16
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
17
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
18
|
+
{ name: "--vk-container-2xl", kind: "size", outright: "--container-2xl" },
|
|
19
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
20
|
+
{ name: "--vk-shadow-2xl", kind: "shadow", outright: "--shadow-2xl" },
|
|
21
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
22
|
+
{ name: "--vk-container-lg", kind: "size", outright: "--container-lg" },
|
|
23
|
+
{ name: "--vk-container-4xl", kind: "size", outright: "--container-4xl" },
|
|
24
|
+
{ name: "--vk-container-5xl", kind: "size", outright: "--container-5xl" },
|
|
25
|
+
{ name: "--vk-push-scale", kind: "motion", outright: "--push-scale" },
|
|
26
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
27
|
+
{ name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
|
|
28
|
+
{ name: "--vk-press-scale", kind: "motion", outright: "--press-scale" },
|
|
29
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
30
|
+
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
31
|
+
{ name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
|
|
32
|
+
{ name: "--vk-shadow-xl", kind: "shadow", outright: "--shadow-xl" },
|
|
33
|
+
{ name: "--vk-border-modal-ring", kind: "colour", outright: "--border-modal-ring" },
|
|
34
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
35
|
+
{ name: "--vk-border-modal-edge", kind: "colour", outright: "--border-modal-edge" },
|
|
36
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
37
|
+
{ name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
|
|
38
|
+
{ name: "--vk-line-height-base", kind: "size", outright: "--text-base--line-height" },
|
|
39
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
40
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
41
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
42
|
+
{ name: "--vk-radius-sm", kind: "size", outright: "--radius-sm" },
|
|
43
|
+
{ name: "--vk-brand", kind: "colour", outright: "--background-brand-bold" },
|
|
44
|
+
{ name: "--vk-fg-on-brand", kind: "colour", outright: "--text-brand-inverse" },
|
|
45
|
+
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
46
|
+
{ name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
|
|
47
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
48
|
+
{ name: "--vk-overlay-card", kind: "colour", outright: "--surface-overlay-card" },
|
|
49
|
+
];
|
|
50
|
+
export const MODAL_PRIVATE = ["--modal-"];
|