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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { AlertDialog as BaseAlert } from "@base-ui/react/alert-dialog";
|
|
4
|
+
import { Dialog as BaseDialog } from "@base-ui/react/dialog";
|
|
5
|
+
import { Alert, ALERT_WORDS } from "../alert/alert.js";
|
|
6
|
+
import { Button } from "../button/button.js";
|
|
7
|
+
import { GlassButton } from "../glass-button/glass-button.js";
|
|
8
|
+
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
9
|
+
import { usePopupHost } from "../internal/popup-host.js";
|
|
10
|
+
import { Sheet, SheetBody } from "../sheet/bottom-sheet.js";
|
|
11
|
+
import { answered, asked, subscribe } from "./confirm.js";
|
|
12
|
+
export { confirm } from "./confirm.js";
|
|
13
|
+
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)) });
|
|
14
|
+
const X = ["M18 6l-12 12", "M6 6l12 12"];
|
|
15
|
+
function Held({ phone, shell, disabled, onClose, close, children }) {
|
|
16
|
+
return (_jsxs("div", { className: "o-alert-held", "data-screen": phone ? "phone" : "computer", "data-shell": shell, "data-kit": "alert-dialog", children: [children, phone && (_jsxs("span", { className: "o-alert-x", children: [_jsx(GlassButton, { "aria-label": close, className: "o-alert-x-glass", icon: glyph(X), disabled: disabled, onClick: onClose }), _jsx(Button, { kind: "quiet", shape: "icon", size: "sm", "aria-label": close, className: "o-alert-x-plain", icon: glyph(X), disabled: disabled, onClick: onClose })] }))] }));
|
|
17
|
+
}
|
|
18
|
+
const shellOf = (el) => (el?.closest("[data-alert-phone]")?.dataset.alertPhone === "sheet" ? "sheet" : "panel");
|
|
19
|
+
function useShell(frame) {
|
|
20
|
+
const [shell, setShell] = React.useState("panel");
|
|
21
|
+
React.useLayoutEffect(() => {
|
|
22
|
+
if (!frame)
|
|
23
|
+
return;
|
|
24
|
+
const read = () => setShell(shellOf(frame));
|
|
25
|
+
read();
|
|
26
|
+
const watch = new MutationObserver(read);
|
|
27
|
+
watch.observe(document.documentElement, { attributes: true, subtree: true, attributeFilter: ["data-alert-phone"] });
|
|
28
|
+
return () => watch.disconnect();
|
|
29
|
+
}, [frame]);
|
|
30
|
+
return shell;
|
|
31
|
+
}
|
|
32
|
+
export const ALERT_DIALOG_WORDS = { close: "Close", failed: "That didn't go through. Nothing changed.", ...ALERT_WORDS };
|
|
33
|
+
export function AlertDialogPanel({ open, onClose, phone, busy, container, standing, initialFocus, close = ALERT_DIALOG_WORDS.close, children }) {
|
|
34
|
+
const Root = (standing ? BaseDialog.Root : BaseAlert.Root);
|
|
35
|
+
return (_jsx(Root, { open: open, onOpenChange: (o) => { if (!o)
|
|
36
|
+
onClose(); }, ...(standing ? { modal: false, disablePointerDismissal: true } : {}), children: _jsxs(BaseAlert.Portal, { container: container, children: [_jsx(BaseAlert.Backdrop, { className: "o-alert-backdrop", "data-screen": phone ? "phone" : "computer" }), _jsx(BaseAlert.Viewport, { className: "o-alert-viewport", children: _jsx(BaseAlert.Popup, { initialFocus: standing ? false : initialFocus, className: "o-alert-dialog", "data-screen": phone ? "phone" : "computer", children: _jsx("div", { className: "o-alert-cut o-smooth", children: _jsx(Held, { phone: phone, shell: "panel", disabled: busy, onClose: onClose, close: close, children: children }) }) }) })] }) }));
|
|
37
|
+
}
|
|
38
|
+
export function AlertDialog({ open, onAnswer, state, failed, container, standing, run, words, ...ask }) {
|
|
39
|
+
const said = { ...ALERT_DIALOG_WORDS, ...words };
|
|
40
|
+
const ref = React.useRef(null), host = usePopupHost(ref), cancelRef = React.useRef(null);
|
|
41
|
+
const small = usePhone(), screen = React.useContext(PhoneHost), phone = small || !!screen;
|
|
42
|
+
const shell = useShell(screen ?? host ?? null), inSheet = phone && shell === "sheet";
|
|
43
|
+
const [own, setOwn] = React.useState("rest"), [why, setWhy] = React.useState(null), now = state ?? own;
|
|
44
|
+
const [wasOpen, setWasOpen] = React.useState(open);
|
|
45
|
+
if (open !== wasOpen) {
|
|
46
|
+
setWasOpen(open);
|
|
47
|
+
if (open) {
|
|
48
|
+
setOwn("rest");
|
|
49
|
+
setWhy(null);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const answer = (yes) => {
|
|
53
|
+
if (now === "working")
|
|
54
|
+
return;
|
|
55
|
+
if (!yes || !run)
|
|
56
|
+
return onAnswer(yes);
|
|
57
|
+
setOwn("working");
|
|
58
|
+
Promise.resolve().then(run).then(() => { setOwn("rest"); onAnswer(true); }, (e) => { setWhy(e instanceof Error && e.message ? e.message : said.failed); setOwn("failed"); });
|
|
59
|
+
};
|
|
60
|
+
const body = { ...ask, onAnswer: answer, state: now, failed: failed ?? why, phone, words: { tryAgain: said.tryAgain } }, working = now === "working";
|
|
61
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: ref, hidden: true }), inSheet ? (_jsx(Sheet, { open: open, onOpenChange: (o) => { if (!o)
|
|
62
|
+
answer(false); }, label: ask.title, form: "floating", container: container ?? screen ?? host, standing: standing, children: _jsx(SheetBody, { children: _jsx(Held, { phone: true, shell: "sheet", disabled: working, onClose: () => answer(false), close: said.close, children: _jsx(Alert, { ...body, shell: "sheet" }) }) }) })) : (_jsx(AlertDialogPanel, { open: open, onClose: () => answer(false), phone: phone, busy: working, container: container ?? screen ?? host, standing: standing, initialFocus: cancelRef, close: said.close, children: _jsx(Alert, { ...body, cancelRef: cancelRef, Title: BaseAlert.Title, Line: BaseAlert.Description }) }))] }));
|
|
63
|
+
}
|
|
64
|
+
export function AlertDialogHost({ container, words }) {
|
|
65
|
+
const { open, ask } = React.useSyncExternalStore(subscribe, asked, asked);
|
|
66
|
+
return ask ? _jsx(AlertDialog, { ...ask, open: open, onAnswer: answered, container: container, words: words }) : null;
|
|
67
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AlertAsk } from "../alert/alert.js";
|
|
2
|
+
/** What stands asked: open or closing, and its question. */
|
|
3
|
+
export type Asking = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
ask: AlertAsk | null;
|
|
6
|
+
};
|
|
7
|
+
/** Asks from anywhere, through the one AlertDialogHost: true for its action, false for every way out. */
|
|
8
|
+
export declare function confirm(ask: AlertAsk): Promise<boolean>;
|
|
9
|
+
/** Its answer, from the host: the asker hears it, and the question closes. */
|
|
10
|
+
export declare const answered: (yes: boolean) => void;
|
|
11
|
+
/** For the host's useSyncExternalStore. */
|
|
12
|
+
export declare const subscribe: (l: () => void) => () => void;
|
|
13
|
+
export declare const asked: () => Asking;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
let asking = { open: false, ask: null }, settle = null;
|
|
2
|
+
const listeners = new Set();
|
|
3
|
+
const tell = (next) => { asking = next; listeners.forEach((l) => l()); };
|
|
4
|
+
export function confirm(ask) {
|
|
5
|
+
const replaced = settle;
|
|
6
|
+
settle = null;
|
|
7
|
+
return new Promise((resolve) => { settle = resolve; tell({ open: true, ask }); replaced?.(false); });
|
|
8
|
+
}
|
|
9
|
+
export const answered = (yes) => { const done = settle; settle = null; tell({ open: false, ask: asking.ask }); done?.(yes); };
|
|
10
|
+
export const subscribe = (l) => { listeners.add(l); return () => { listeners.delete(l); }; };
|
|
11
|
+
export const asked = () => asking;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PieceLooks } from "../../looks/looks.js";
|
|
2
|
+
export type AlertDialogOptionId = "close" | "padding" | "behind" | "strength" | "blur" | "blurphone" | "shadow" | "shadowphone" | "margin" | "corners" | "smoothing";
|
|
3
|
+
/** The alert dialog's options. */
|
|
4
|
+
export declare const ALERT_DIALOG_LOOKS: PieceLooks<AlertDialogOptionId>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const steps = (ids) => ids.map((id) => ({ id, name: id }));
|
|
2
|
+
const BLURS = [{ id: "0", name: "None" }, ...steps(["4", "8", "12", "24"])];
|
|
3
|
+
const SHADOWS = [{ id: "none", name: "None" }, { id: "lg", name: "Large" }, { id: "xl", name: "Extra large" }, { id: "2xl", name: "Largest" }];
|
|
4
|
+
const options = [
|
|
5
|
+
{ id: "close", name: "The X", device: "phone", def: "hidden", values: [{ id: "hidden", name: "Hidden" }, { id: "shown", name: "Shown" }] },
|
|
6
|
+
{ id: "padding", name: "Padding", def: "24", kind: "steps", values: steps(["16", "20", "24", "28"]) },
|
|
7
|
+
{ id: "behind", name: "What's behind", def: "dim", values: [{ id: "dim", name: "Dim" }, { id: "veil", name: "Veil" }] },
|
|
8
|
+
{ id: "strength", name: "Strength", def: "medium", kind: "steps", values: [{ id: "light", name: "Light" }, { id: "medium", name: "Medium" }, { id: "deep", name: "Deep" }] },
|
|
9
|
+
{ id: "blur", name: "Blur", device: "desktop", def: "0", kind: "steps", values: BLURS },
|
|
10
|
+
{ id: "blurphone", name: "Blur", device: "phone", def: "0", kind: "steps", values: BLURS },
|
|
11
|
+
{ id: "shadow", name: "Shadow", device: "desktop", def: "2xl", kind: "steps", values: SHADOWS },
|
|
12
|
+
{ id: "shadowphone", name: "Shadow", device: "phone", def: "xl", kind: "steps", values: SHADOWS },
|
|
13
|
+
{ id: "margin", name: "Margins", device: "phone", def: "16", kind: "steps", values: steps(["8", "12", "16", "24", "32"]) },
|
|
14
|
+
{ id: "corners", name: "Corners", def: "2xl", kind: "steps", values: steps(["lg", "xl", "2xl", "3xl"]) },
|
|
15
|
+
{ id: "smoothing", name: "Corner smoothing", def: "smooth", values: [{ id: "round", name: "Round" }, { id: "smooth", name: "Smooth" }] },
|
|
16
|
+
];
|
|
17
|
+
export const ALERT_DIALOG_LOOKS = { id: "alert-dialog", name: "Alert Dialog", options, looks: [] };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export declare const ALERT_DIALOG_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-layer-popup";
|
|
3
|
+
readonly kind: "size";
|
|
4
|
+
readonly outright: "--layer-popup";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-backdrop-alert-medium";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--backdrop-alert-medium";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-duration-base";
|
|
11
|
+
readonly kind: "motion";
|
|
12
|
+
readonly outright: "--duration-base";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-ease-out";
|
|
15
|
+
readonly kind: "motion";
|
|
16
|
+
readonly outright: "--ease-out";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-backdrop-alert-light";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--backdrop-alert-light";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-backdrop-alert-deep";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--backdrop-alert-deep";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-backdrop-veil-medium";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--backdrop-veil-medium";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-backdrop-veil-light";
|
|
31
|
+
readonly kind: "colour";
|
|
32
|
+
readonly outright: "--backdrop-veil-light";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-backdrop-veil";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--backdrop-veil";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-blur-xs";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--blur-xs";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-blur-sm";
|
|
43
|
+
readonly kind: "size";
|
|
44
|
+
readonly outright: "--blur-sm";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-blur-md";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--blur-md";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-blur-lg";
|
|
51
|
+
readonly kind: "size";
|
|
52
|
+
readonly outright: "--blur-lg";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-spacing";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--spacing";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-radius-2xl";
|
|
59
|
+
readonly kind: "size";
|
|
60
|
+
readonly outright: "--radius-2xl";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-container-sm";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--container-sm";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-border-width";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--border-width";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-border-subtle";
|
|
71
|
+
readonly kind: "colour";
|
|
72
|
+
readonly outright: "--border-subtle";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-overlay";
|
|
75
|
+
readonly kind: "colour";
|
|
76
|
+
readonly outright: "--surface-overlay";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-shadow-2xl";
|
|
79
|
+
readonly kind: "shadow";
|
|
80
|
+
readonly outright: "--shadow-2xl";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-fg";
|
|
83
|
+
readonly kind: "colour";
|
|
84
|
+
readonly outright: "--text";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-shadow-lg";
|
|
87
|
+
readonly kind: "shadow";
|
|
88
|
+
readonly outright: "--shadow-lg";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-shadow-xl";
|
|
91
|
+
readonly kind: "shadow";
|
|
92
|
+
readonly outright: "--shadow-xl";
|
|
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-radius-lg";
|
|
107
|
+
readonly kind: "size";
|
|
108
|
+
readonly outright: "--radius-lg";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "--vk-radius-xl";
|
|
111
|
+
readonly kind: "size";
|
|
112
|
+
readonly outright: "--radius-xl";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "--vk-radius-3xl";
|
|
115
|
+
readonly kind: "size";
|
|
116
|
+
readonly outright: "--radius-3xl";
|
|
117
|
+
}];
|
|
118
|
+
/** Its own machinery is the Alert's family (`--alert-`): its panel's corners, padding and margins, and the edge's corner. */
|
|
119
|
+
export declare const ALERT_DIALOG_PRIVATE: readonly [];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const ALERT_DIALOG_TOKENS = [
|
|
2
|
+
{ name: "--vk-layer-popup", kind: "size", outright: "--layer-popup" },
|
|
3
|
+
{ name: "--vk-backdrop-alert-medium", kind: "colour", outright: "--backdrop-alert-medium" },
|
|
4
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
5
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
6
|
+
{ name: "--vk-backdrop-alert-light", kind: "colour", outright: "--backdrop-alert-light" },
|
|
7
|
+
{ name: "--vk-backdrop-alert-deep", kind: "colour", outright: "--backdrop-alert-deep" },
|
|
8
|
+
{ name: "--vk-backdrop-veil-medium", kind: "colour", outright: "--backdrop-veil-medium" },
|
|
9
|
+
{ name: "--vk-backdrop-veil-light", kind: "colour", outright: "--backdrop-veil-light" },
|
|
10
|
+
{ name: "--vk-backdrop-veil", kind: "colour", outright: "--backdrop-veil" },
|
|
11
|
+
{ name: "--vk-blur-xs", kind: "size", outright: "--blur-xs" },
|
|
12
|
+
{ name: "--vk-blur-sm", kind: "size", outright: "--blur-sm" },
|
|
13
|
+
{ name: "--vk-blur-md", kind: "size", outright: "--blur-md" },
|
|
14
|
+
{ name: "--vk-blur-lg", kind: "size", outright: "--blur-lg" },
|
|
15
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
16
|
+
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
17
|
+
{ name: "--vk-container-sm", kind: "size", outright: "--container-sm" },
|
|
18
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
19
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
20
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
21
|
+
{ name: "--vk-shadow-2xl", kind: "shadow", outright: "--shadow-2xl" },
|
|
22
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
23
|
+
{ name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
|
|
24
|
+
{ name: "--vk-shadow-xl", kind: "shadow", outright: "--shadow-xl" },
|
|
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-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
29
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
30
|
+
{ name: "--vk-radius-3xl", kind: "size", outright: "--radius-3xl" },
|
|
31
|
+
];
|
|
32
|
+
export const ALERT_DIALOG_PRIVATE = [];
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* The alert dialog: the panel an Alert stands in, over the page. Every value it draws with is a public name
|
|
2
|
+
(controls/alert-dialog/tokens.ts); this file only says which name each part takes. Its options (looks.ts) are data attributes on
|
|
3
|
+
the frame around it, and each one only chooses other names:
|
|
4
|
+
|
|
5
|
+
data-alert-dialog-close hidden · shown the X in its corner, on the phone
|
|
6
|
+
data-alert-dialog-padding 16 · 20 · 24 · 28 how far the Alert's words stand from its panel's edge
|
|
7
|
+
data-alert-dialog-behind dim · veil what stands over the page behind it: dark or light
|
|
8
|
+
data-alert-dialog-strength light · medium · deep how strong that is
|
|
9
|
+
data-alert-dialog-blur 0 · 4 · 8 · 12 · 24 how far the page blurs under it, on a computer
|
|
10
|
+
data-alert-dialog-blurphone 0 · 4 · 8 · 12 · 24 and on the phone
|
|
11
|
+
data-alert-dialog-shadow none · lg · xl · 2xl its panel's shadow on a computer
|
|
12
|
+
data-alert-dialog-shadowphone none · lg · xl · 2xl and on the phone
|
|
13
|
+
data-alert-dialog-margin 8 · 12 · 16 · 24 · 32 how far its panel stands from the phone's edges
|
|
14
|
+
data-alert-dialog-corners lg · xl · 2xl · 3xl which radius its panel takes
|
|
15
|
+
data-alert-dialog-smoothing round · smooth how its panel's corners bend
|
|
16
|
+
|
|
17
|
+
What it stands in on the phone, its panel or a Sheet, is the Alert's Opens as (data-alert-phone), which alert-dialog.tsx reads.
|
|
18
|
+
data-screen on its panel and on .o-alert-held, which holds the Alert and the X, says where it stands, phone or computer.
|
|
19
|
+
|
|
20
|
+
The rules sit in the components layer, so a utility class still wins. */
|
|
21
|
+
@layer components {
|
|
22
|
+
|
|
23
|
+
/* ── What's behind it, and where it stands: in the middle of the screen, over everything ─────────────────────────────────────────── */
|
|
24
|
+
.o-alert-backdrop, .o-alert-viewport { position: fixed; inset: 0; z-index: var(--vk-layer-popup); }
|
|
25
|
+
.o-alert-backdrop { background-color: var(--vk-backdrop-alert-medium); transition: opacity var(--vk-duration-base) var(--vk-ease-out); }
|
|
26
|
+
.o-alert-backdrop:is([data-starting-style], [data-ending-style]) { opacity: 0; }
|
|
27
|
+
[data-alert-dialog-strength="light"] .o-alert-backdrop { background-color: var(--vk-backdrop-alert-light); }
|
|
28
|
+
[data-alert-dialog-strength="deep"] .o-alert-backdrop { background-color: var(--vk-backdrop-alert-deep); }
|
|
29
|
+
[data-alert-dialog-behind="veil"] .o-alert-backdrop { background-color: var(--vk-backdrop-veil-medium); }
|
|
30
|
+
[data-alert-dialog-behind="veil"][data-alert-dialog-strength="light"] .o-alert-backdrop { background-color: var(--vk-backdrop-veil-light); }
|
|
31
|
+
[data-alert-dialog-behind="veil"][data-alert-dialog-strength="deep"] .o-alert-backdrop { background-color: var(--vk-backdrop-veil); }
|
|
32
|
+
/* How far the page blurs under it, each screen's own. No blur at all at none, since blur(0) still builds a backdrop root. */
|
|
33
|
+
[data-alert-dialog-blur="4"] .o-alert-backdrop[data-screen="computer"], [data-alert-dialog-blurphone="4"] .o-alert-backdrop[data-screen="phone"] { -webkit-backdrop-filter: blur(var(--vk-blur-xs)); backdrop-filter: blur(var(--vk-blur-xs)); }
|
|
34
|
+
[data-alert-dialog-blur="8"] .o-alert-backdrop[data-screen="computer"], [data-alert-dialog-blurphone="8"] .o-alert-backdrop[data-screen="phone"] { -webkit-backdrop-filter: blur(var(--vk-blur-sm)); backdrop-filter: blur(var(--vk-blur-sm)); }
|
|
35
|
+
[data-alert-dialog-blur="12"] .o-alert-backdrop[data-screen="computer"], [data-alert-dialog-blurphone="12"] .o-alert-backdrop[data-screen="phone"] { -webkit-backdrop-filter: blur(var(--vk-blur-md)); backdrop-filter: blur(var(--vk-blur-md)); }
|
|
36
|
+
[data-alert-dialog-blur="24"] .o-alert-backdrop[data-screen="computer"], [data-alert-dialog-blurphone="24"] .o-alert-backdrop[data-screen="phone"] { -webkit-backdrop-filter: blur(var(--vk-blur-lg)); backdrop-filter: blur(var(--vk-blur-lg)); }
|
|
37
|
+
.o-alert-viewport { --alert-margin: calc(var(--vk-spacing) * 4); box-sizing: border-box; display: grid; place-items: center; padding: var(--alert-margin); overflow-y: auto; outline: none; }
|
|
38
|
+
[data-alert-dialog-margin="8"] .o-alert-viewport { --alert-margin: calc(var(--vk-spacing) * 2); }
|
|
39
|
+
[data-alert-dialog-margin="12"] .o-alert-viewport { --alert-margin: calc(var(--vk-spacing) * 3); }
|
|
40
|
+
[data-alert-dialog-margin="24"] .o-alert-viewport { --alert-margin: calc(var(--vk-spacing) * 6); }
|
|
41
|
+
[data-alert-dialog-margin="32"] .o-alert-viewport { --alert-margin: calc(var(--vk-spacing) * 8); }
|
|
42
|
+
|
|
43
|
+
/* ── Its panel: on the overlay's ground, one width on a computer, the phone's width less its margins ─────────────────────────────── */
|
|
44
|
+
.o-alert-dialog {
|
|
45
|
+
--alert-corners: var(--vk-radius-2xl); --alert-padding: calc(var(--vk-spacing) * 6);
|
|
46
|
+
box-sizing: border-box; width: 100%; max-width: var(--vk-container-sm); min-width: 0; border: var(--vk-border-width) solid var(--vk-border-subtle); border-radius: var(--alert-corners);
|
|
47
|
+
background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-2xl); color: var(--vk-fg); outline: none;
|
|
48
|
+
transition: opacity var(--vk-duration-base) var(--vk-ease-out), scale var(--vk-duration-base) var(--vk-ease-out);
|
|
49
|
+
}
|
|
50
|
+
.o-alert-dialog[data-screen="phone"] { max-width: none; }
|
|
51
|
+
/* Its shadow, each screen's own. */
|
|
52
|
+
[data-alert-dialog-shadow="none"] .o-alert-dialog[data-screen="computer"], [data-alert-dialog-shadowphone="none"] .o-alert-dialog[data-screen="phone"] { box-shadow: none; }
|
|
53
|
+
[data-alert-dialog-shadow="lg"] .o-alert-dialog[data-screen="computer"], [data-alert-dialog-shadowphone="lg"] .o-alert-dialog[data-screen="phone"] { box-shadow: var(--vk-shadow-lg); }
|
|
54
|
+
[data-alert-dialog-shadow="xl"] .o-alert-dialog[data-screen="computer"], [data-alert-dialog-shadowphone="xl"] .o-alert-dialog[data-screen="phone"] { box-shadow: var(--vk-shadow-xl); }
|
|
55
|
+
.o-alert-dialog:is([data-starting-style], [data-ending-style]) { opacity: 0; scale: var(--vk-push-scale); }
|
|
56
|
+
.o-alert-dialog[data-ending-style] { transition-duration: var(--vk-duration-fast); transition-timing-function: var(--vk-ease-in); }
|
|
57
|
+
[data-alert-dialog-corners="lg"] .o-alert-dialog { --alert-corners: var(--vk-radius-lg); }
|
|
58
|
+
[data-alert-dialog-corners="xl"] .o-alert-dialog { --alert-corners: var(--vk-radius-xl); }
|
|
59
|
+
[data-alert-dialog-corners="3xl"] .o-alert-dialog { --alert-corners: var(--vk-radius-3xl); }
|
|
60
|
+
.o-alert-cut { border-radius: inherit; background-color: inherit; }
|
|
61
|
+
|
|
62
|
+
/* ── How far the Alert's words stand from its panel's edge, which the Alert reads (alert.css) ─────────────────────────────────────── */
|
|
63
|
+
[data-alert-dialog-padding="16"] .o-alert-dialog { --alert-padding: calc(var(--vk-spacing) * 4); }
|
|
64
|
+
[data-alert-dialog-padding="20"] .o-alert-dialog { --alert-padding: calc(var(--vk-spacing) * 5); }
|
|
65
|
+
[data-alert-dialog-padding="28"] .o-alert-dialog { --alert-padding: calc(var(--vk-spacing) * 7); }
|
|
66
|
+
|
|
67
|
+
/* ── The X, in its corner, on the phone only, beside the Alert in its panel or its Sheet: Glass when the phone header is Glass, or a
|
|
68
|
+
quiet Button ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
69
|
+
.o-alert-held { position: relative; min-width: 0; }
|
|
70
|
+
.o-alert-x { display: none; }
|
|
71
|
+
[data-alert-dialog-close="shown"] .o-alert-x { position: absolute; top: calc(var(--vk-spacing) * 3); right: calc(var(--vk-spacing) * 3); display: grid; }
|
|
72
|
+
[data-alert-dialog-close="shown"] .o-alert-held[data-shell="sheet"] .o-alert-x { top: 0; right: 0; }
|
|
73
|
+
[data-alert-dialog-close="shown"] .o-alert-held[data-screen="phone"] .o-alert-title { padding-right: calc(var(--vk-spacing) * 11); }
|
|
74
|
+
.o-alert-x .o-alert-x-glass { display: none; }
|
|
75
|
+
/* Glass unless the phone's surface is Flat, as ViewKit's phone header and Sheet are where nothing is picked. */
|
|
76
|
+
.o-alert-held[data-screen="phone"]:not([data-phone-header-surface="flat"] *) .o-alert-x .o-alert-x-glass { display: grid; }
|
|
77
|
+
.o-alert-held[data-screen="phone"]:not([data-phone-header-surface="flat"] *) .o-alert-x .o-alert-x-plain { display: none; }
|
|
78
|
+
|
|
79
|
+
/* ── Its corners smooth, the default (what nothing set draws), unless a frame picks Round: the smooth outline (smooth.css), Apple's curve as measured, so every browser that knows shape() shows it; one that doesn't
|
|
80
|
+
keeps the corners above. The panel keeps its shadow, which a cut would take with it, so .o-alert-cut inside it is cut instead ───── */
|
|
81
|
+
@supports (clip-path: shape(from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close)) {
|
|
82
|
+
.o-alert-dialog:not([data-alert-dialog-smoothing="round"] *) { border-color: transparent; background-color: transparent; background-clip: padding-box; }
|
|
83
|
+
.o-alert-cut:not([data-alert-dialog-smoothing="round"] *) {
|
|
84
|
+
--alert-c: var(--alert-corners);
|
|
85
|
+
background-color: var(--vk-overlay);
|
|
86
|
+
--smooth-t: var(--alert-c); clip-path: shape(var(--smooth-outline));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Less motion: a fade, no scale. */
|
|
91
|
+
@media (prefers-reduced-motion: reduce) {
|
|
92
|
+
.o-alert-dialog { transition: opacity var(--vk-duration-base) var(--vk-ease-out); }
|
|
93
|
+
.o-alert-dialog:is([data-starting-style], [data-ending-style]) { scale: 1; }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* The Alert. Every value it draws with is a public name (controls/alert/tokens.ts); this file only says which name each part takes. Its options
|
|
2
|
+
(looks.ts) are data attributes on the frame around it, and each one only chooses other names:
|
|
3
|
+
|
|
4
|
+
data-alert-buttons end · full its buttons on a computer: at the end, or filling its foot
|
|
5
|
+
data-alert-pair side · stacked its buttons on the phone, which always fill its foot
|
|
6
|
+
data-alert-mark none · shown a round mark over its words, which centres them
|
|
7
|
+
data-alert-size 32 · 36 · 44 its buttons' height on a computer
|
|
8
|
+
data-alert-phone panel · sheet what it stands in on the phone, which the Alert Dialog reads
|
|
9
|
+
|
|
10
|
+
data-screen on it says where it stands, phone or computer, and data-shell what it stands in, the Alert Dialog's panel or a sheet.
|
|
11
|
+
How far its words stand from the panel's edge is the panel's (--alert-padding, alert-dialog.css), 24 where nothing sets it.
|
|
12
|
+
|
|
13
|
+
The rules sit in the components layer, so a utility class still wins. */
|
|
14
|
+
@layer components {
|
|
15
|
+
|
|
16
|
+
/* ── What it says ────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
17
|
+
.o-alert-body { position: relative; display: grid; min-width: 0; color: var(--vk-fg); }
|
|
18
|
+
.o-alert-body[data-shell="panel"] { padding: var(--alert-padding, calc(var(--vk-spacing) * 6)); }
|
|
19
|
+
.o-alert-body[data-shell="sheet"] { padding: calc(var(--vk-spacing) * 2); }
|
|
20
|
+
.o-alert-title { margin: 0; font-size: var(--vk-font-size-lg); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); font-weight: var(--vk-font-weight-semibold); text-wrap: balance; overflow-wrap: anywhere; }
|
|
21
|
+
.o-alert-line { margin: calc(var(--vk-spacing) * 1) 0 0; font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg-subtle); text-wrap: pretty; }
|
|
22
|
+
.o-alert-line.o-alert-wrong { color: var(--vk-danger); }
|
|
23
|
+
.o-alert-body[data-screen="phone"] .o-alert-line { font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); }
|
|
24
|
+
|
|
25
|
+
/* ── Its buttons: at the end on a computer unless they fill its foot, as they always do on the phone. A foot that fills stands 12 from a
|
|
26
|
+
panel's edge, so a 24 corner and a 12 button nest, and the way out stands on the overlay's card ────────────────────────────────── */
|
|
27
|
+
.o-alert-foot { display: flex; justify-content: flex-end; gap: calc(var(--vk-spacing) * 2); margin-top: calc(var(--vk-spacing) * 5); }
|
|
28
|
+
:is([data-alert-buttons="full"] .o-alert-body, .o-alert-body[data-screen="phone"]) .o-alert-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
29
|
+
:is([data-alert-buttons="full"] .o-alert-body, .o-alert-body[data-screen="phone"]) .o-alert-foot > .o-button { width: 100%; padding-inline: 0; }
|
|
30
|
+
:is([data-alert-buttons="full"] .o-alert-body, .o-alert-body[data-screen="phone"])[data-shell="panel"] { padding-bottom: calc(var(--vk-spacing) * 3); }
|
|
31
|
+
:is([data-alert-buttons="full"] .o-alert-body, .o-alert-body[data-screen="phone"])[data-shell="panel"] .o-alert-foot { margin-inline: calc(var(--vk-spacing) * 3 - var(--alert-padding, calc(var(--vk-spacing) * 6))); }
|
|
32
|
+
:is([data-alert-buttons="full"] .o-alert-body, .o-alert-body[data-screen="phone"]) .o-alert-cancel:not(:disabled) { border-color: transparent; background-color: var(--vk-overlay-card); }
|
|
33
|
+
/* A hover only on a screen with a pointer (iOS keeps :hover on what was last tapped); a press and the forced state stay out. */
|
|
34
|
+
:is([data-alert-buttons="full"] .o-alert-body, .o-alert-body[data-screen="phone"]) .o-alert-cancel:active:not(:disabled) { border-color: transparent; background-color: var(--vk-overlay-card-pressed); }
|
|
35
|
+
@media (hover: hover) { :is([data-alert-buttons="full"] .o-alert-body, .o-alert-body[data-screen="phone"]) .o-alert-cancel:hover:not(:disabled) { border-color: transparent; background-color: var(--vk-overlay-card-pressed); } }
|
|
36
|
+
[data-alert-size="32"] .o-alert-body[data-screen="computer"] .o-alert-foot > .o-button { height: calc(var(--vk-spacing) * 8); --button-side: calc(var(--vk-spacing) * 8); padding-inline: calc(var(--vk-spacing) * 3); }
|
|
37
|
+
[data-alert-size="44"] .o-alert-body[data-screen="computer"] .o-alert-foot > .o-button { height: calc(var(--vk-spacing) * 11); --button-side: calc(var(--vk-spacing) * 11); padding-inline: calc(var(--vk-spacing) * 5); font-size: var(--vk-font-size-base); }
|
|
38
|
+
[data-alert-pair="stacked"] .o-alert-body[data-screen="phone"] .o-alert-foot { grid-template-columns: minmax(0, 1fr); }
|
|
39
|
+
[data-alert-pair="stacked"] .o-alert-body[data-screen="phone"] .o-alert-foot > .o-alert-cancel { order: 1; }
|
|
40
|
+
|
|
41
|
+
/* ── Its mark: round, in its action's colour, its words centred under it ─────────────────────────────────────────────────────────── */
|
|
42
|
+
.o-alert-mark { display: none; }
|
|
43
|
+
[data-alert-mark="shown"] .o-alert-mark { display: grid; place-items: center; justify-self: center; width: calc(var(--vk-spacing) * 12); height: calc(var(--vk-spacing) * 12); margin-bottom: calc(var(--vk-spacing) * 3); border-radius: var(--vk-radius-full); background-color: var(--vk-brand-subtler); color: var(--vk-fg-accent); }
|
|
44
|
+
[data-alert-mark="shown"] .o-alert-body[data-screen="phone"] .o-alert-mark { width: calc(var(--vk-spacing) * 14); height: calc(var(--vk-spacing) * 14); margin-bottom: calc(var(--vk-spacing) * 4); }
|
|
45
|
+
[data-alert-mark="shown"] .o-alert-body[data-kind="information"] .o-alert-mark { background-color: var(--vk-info-subtler); color: var(--vk-info); }
|
|
46
|
+
[data-alert-mark="shown"] .o-alert-body[data-kind="success"] .o-alert-mark { background-color: var(--vk-success-subtler); color: var(--vk-success); }
|
|
47
|
+
[data-alert-mark="shown"] .o-alert-body[data-kind="warning"] .o-alert-mark { background-color: var(--vk-warning-subtler); color: var(--vk-warning); }
|
|
48
|
+
[data-alert-mark="shown"] .o-alert-body[data-kind="danger"] .o-alert-mark { background-color: var(--vk-danger-subtler); color: var(--vk-danger); }
|
|
49
|
+
.o-alert-mark > svg { width: calc(var(--vk-spacing) * 6); height: calc(var(--vk-spacing) * 6); }
|
|
50
|
+
[data-alert-mark="shown"] :is(.o-alert-title, .o-alert-line) { text-align: center; }
|
|
51
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { BulkBarWords } from "./words.js";
|
|
2
|
+
/** What a verb, or Delete, hands back: what the Toast says, and how it is taken back. Nothing: no Toast. */
|
|
3
|
+
export interface BulkDone {
|
|
4
|
+
words: string;
|
|
5
|
+
undo?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export type BulkRun = () => BulkDone | void | Promise<BulkDone | void>;
|
|
8
|
+
/** One verb, or one row of a group: ViewKit's SelectionVerbItem, its press able to hand a Toast back. */
|
|
9
|
+
export interface BulkVerbItemOf<Icon = unknown> {
|
|
10
|
+
label: string;
|
|
11
|
+
icon?: Icon;
|
|
12
|
+
onClick: BulkRun;
|
|
13
|
+
destructive?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
disabledReason?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A verb: an `action` done at once; a `group`, a few actions behind one word, opening the Menu; or `options`, a field set on
|
|
18
|
+
* every picked row, picked in the Picker. `more`: kept off the bar, in More. */
|
|
19
|
+
export type BulkVerbOf<Icon = unknown, Option = unknown> = ({
|
|
20
|
+
kind: "action";
|
|
21
|
+
more?: boolean;
|
|
22
|
+
} & BulkVerbItemOf<Icon>) | {
|
|
23
|
+
kind: "group";
|
|
24
|
+
label: string;
|
|
25
|
+
icon?: Icon;
|
|
26
|
+
more?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
disabledReason?: string;
|
|
29
|
+
items: BulkVerbItemOf<Icon>[];
|
|
30
|
+
} | {
|
|
31
|
+
kind: "options";
|
|
32
|
+
label: string;
|
|
33
|
+
icon?: Icon;
|
|
34
|
+
more?: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
disabledReason?: string;
|
|
37
|
+
options: Option[];
|
|
38
|
+
/** What every picked row holds, when they hold the same: a value, or null when every one is empty. Left out, they differ,
|
|
39
|
+
* and nobody is marked (ViewKit hands none). */
|
|
40
|
+
value?: string | null;
|
|
41
|
+
/** The empty row's words ("No owner"); left out, the field can't be emptied. */
|
|
42
|
+
empty?: string;
|
|
43
|
+
/** What the search says before anything is typed ("Search people"); left out, no search. */
|
|
44
|
+
search?: string;
|
|
45
|
+
/** A pick sets every picked row: a value, or null for the empty row. A method, so ViewKit's (value: string) => void is one. */
|
|
46
|
+
onSelect(value: string | null): BulkDone | void | Promise<BulkDone | void>;
|
|
47
|
+
};
|
|
48
|
+
/** What a row is, one and many: "deal", "deals". */
|
|
49
|
+
export interface BulkNoun {
|
|
50
|
+
one: string;
|
|
51
|
+
other: string;
|
|
52
|
+
}
|
|
53
|
+
/** Its words, from the words it is handed: "3 deals selected", "3 deals", "Delete 3 deals", "Delete 3 deals?". */
|
|
54
|
+
export declare function wordsOf(count: number, noun: BulkNoun, words: Pick<BulkBarWords, "many" | "selected" | "del" | "ask">): {
|
|
55
|
+
selected: string;
|
|
56
|
+
many: string;
|
|
57
|
+
del: string;
|
|
58
|
+
ask: string;
|
|
59
|
+
};
|
|
60
|
+
/** How many of the bar's verbs stand on it, in order, the rest folding into More: the most that fit in `room` beside what always
|
|
61
|
+
* stands (`fixed`: the count, the hairline and Delete's own button with the gaps between them), with More's width and a gap
|
|
62
|
+
* before it once anything folds or More stands anyway. */
|
|
63
|
+
export declare function fitOnBar(widths: number[], room: number, fixed: number, more: number, gap: number, moreAnyway: boolean): number;
|
|
64
|
+
/** More's rows, in order: the verbs kept off the bar, then the bar's verbs that folded (those past `fitted`), each as an entry of
|
|
65
|
+
* its kind (`entry`); then, where Delete stands in More, a separator and Delete. */
|
|
66
|
+
export declare function moreRows<V, E>(onBar: V[], kept: V[], fitted: number, entry: (v: V) => E, del: E | null, separator: E): E[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function wordsOf(count, noun, words) {
|
|
2
|
+
const many = words.many(count, noun);
|
|
3
|
+
return { selected: words.selected(many), many, del: words.del(many), ask: words.ask(many) };
|
|
4
|
+
}
|
|
5
|
+
export function fitOnBar(widths, room, fixed, more, gap, moreAnyway) {
|
|
6
|
+
for (let n = widths.length; n > 0; n--) {
|
|
7
|
+
let need = fixed;
|
|
8
|
+
for (let i = 0; i < n; i++)
|
|
9
|
+
need += gap + widths[i];
|
|
10
|
+
if (moreAnyway || n < widths.length)
|
|
11
|
+
need += gap + more;
|
|
12
|
+
if (need <= room)
|
|
13
|
+
return n;
|
|
14
|
+
}
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
export function moreRows(onBar, kept, fitted, entry, del, separator) {
|
|
18
|
+
const verbs = [...kept, ...onBar.slice(fitted)].map(entry);
|
|
19
|
+
if (!del)
|
|
20
|
+
return verbs;
|
|
21
|
+
return verbs.length ? [...verbs, separator, del] : [del];
|
|
22
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type PickerItem } from "../picker/picker.js";
|
|
3
|
+
import { type BulkNoun, type BulkRun, type BulkVerbItemOf, type BulkVerbOf } from "./bulk-bar-of.js";
|
|
4
|
+
import { type BulkBarPicks } from "./looks.js";
|
|
5
|
+
import { type BulkBarWords } from "./words.js";
|
|
6
|
+
export type { BulkDone, BulkNoun, BulkRun } from "./bulk-bar-of.js";
|
|
7
|
+
export type BulkVerb = BulkVerbOf<React.ReactNode, PickerItem>;
|
|
8
|
+
export type BulkVerbItem = BulkVerbItemOf<React.ReactNode>;
|
|
9
|
+
export interface BulkBarProps {
|
|
10
|
+
/** How many rows are picked; at 0 it leaves. */
|
|
11
|
+
count: number;
|
|
12
|
+
/** What a row is, one and many ("deal", "deals"): its words ("3 deals selected", "Delete 3 deals"). Left out, `words.noun`. */
|
|
13
|
+
noun?: BulkNoun;
|
|
14
|
+
/** Clears the selection: the count, Escape, and after Delete. */
|
|
15
|
+
onClear: () => void;
|
|
16
|
+
/** What can be done to every picked row, in order: on the bar, the rest (`more`) in More. */
|
|
17
|
+
verbs: readonly BulkVerb[];
|
|
18
|
+
/** Deletes the picked rows, after the Alert Dialog asks; left out, no Delete. */
|
|
19
|
+
onDelete?: BulkRun;
|
|
20
|
+
/** The Alert's line under "Delete 3 deals?" ("They move to the trash. You can bring them back for 30 days."). */
|
|
21
|
+
deleteLine?: React.ReactNode;
|
|
22
|
+
/** Delete's name, in place of "Delete 3 deals". */
|
|
23
|
+
deleteLabel?: string;
|
|
24
|
+
/** A batch is running: every control can't be used until it ends. */
|
|
25
|
+
busy?: boolean;
|
|
26
|
+
/** Which form of the bar itself; by default the phone's in a phone's window or a PhoneHost screen, else the computer's. What it
|
|
27
|
+
* opens (its Menus, its question) takes its own form from the window or the screen, as every popup of the kit does. */
|
|
28
|
+
form?: "computer" | "phone";
|
|
29
|
+
/** It stands on a page that shows it (a component's page): what it opens leaves the page round it live, as the Menu's standing
|
|
30
|
+
* does, and its Picker's Popover takes no focus as it opens. In an app what it opens is modal. */
|
|
31
|
+
standing?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Its words, over the English. */
|
|
34
|
+
words?: Partial<BulkBarWords>;
|
|
35
|
+
}
|
|
36
|
+
type Worn = BulkBarPicks;
|
|
37
|
+
/** The bar's options as the frame round `el` picks them, kept up to date as they change. */
|
|
38
|
+
export declare function useBulkBarWorn(el: Element | null): Worn;
|
|
39
|
+
/** What picked rows bring: how many are picked, and what can be done to all of them at once. */
|
|
40
|
+
export declare function BulkBar({ count, noun: given, onClear, verbs, onDelete, deleteLine, deleteLabel, busy, form, standing, className, words: said }: BulkBarProps): import("react/jsx-runtime").JSX.Element;
|