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,58 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type PickerItem } from "../picker/picker.js";
|
|
3
|
+
import type { SheetHeadProps } from "../sheet/bottom-sheet.js";
|
|
4
|
+
import { type FieldOf, type SortAside, type SortRule } from "./rules.js";
|
|
5
|
+
import { type SortEditorWords } from "./words.js";
|
|
6
|
+
export type { SortAside, SortDirection, SortRule } from "./rules.js";
|
|
7
|
+
/** What a page shows standing open: a rule's field or direction, by its place (on a phone the direction's step). */
|
|
8
|
+
export type SortEditorOpens = {
|
|
9
|
+
list: "field" | "direction";
|
|
10
|
+
rule: number;
|
|
11
|
+
};
|
|
12
|
+
export interface SortEditorProps {
|
|
13
|
+
/** What it sorts, as its shell names it ("Sort"): the Sheet's title on a phone, and the rules' name to a screen reader. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** The fields a list sorts by, each with its type's mark; one leading one level in (a deal's Company) holds its own. */
|
|
16
|
+
fields: PickerItem[];
|
|
17
|
+
/** The view's rules, the first sorting first. */
|
|
18
|
+
rules: SortRule[];
|
|
19
|
+
/** Each change, as it is made: a rule added, moved, changed or taken away; and, when a sort set aside is pointed at a field, put
|
|
20
|
+
* back or deleted, the set-aside sorts left. */
|
|
21
|
+
onRulesChange: (rules: SortRule[], aside?: SortAside[]) => void;
|
|
22
|
+
/** The sorts set aside, after the rules: each holds one of the places until it is pointed at a field, put back or deleted. */
|
|
23
|
+
aside?: readonly SortAside[];
|
|
24
|
+
/** How many rules at most; three unless said. */
|
|
25
|
+
max?: number;
|
|
26
|
+
/** Which form; by default the phone's in a phone's window or in a PhoneHost screen, else the computer's. `narrow`, on a computer
|
|
27
|
+
* in a narrow place (Customize's Sort, in the Pane): the phone's structure at a computer's sizes. */
|
|
28
|
+
form?: "computer" | "phone" | "narrow";
|
|
29
|
+
/** The job is done and what holds it closes: ✓, or ✕ once the rules are back, on a phone. */
|
|
30
|
+
onDone?: () => void;
|
|
31
|
+
/** What the fields' search says before anything is typed ("Search deal fields"); the words' `search` unless said. */
|
|
32
|
+
search?: string;
|
|
33
|
+
/** For a page that shows a state, standing still: a rule held by its grip (its place); a list standing open, with a level open in
|
|
34
|
+
* the fields (its row's value). Nothing takes the focus. */
|
|
35
|
+
lifted?: number;
|
|
36
|
+
opens?: SortEditorOpens;
|
|
37
|
+
level?: string;
|
|
38
|
+
/** The field a sort key sorts, so a place sorts once, by one of its parts; each key its own field unless handed. */
|
|
39
|
+
fieldOf?: FieldOf;
|
|
40
|
+
/** On a computer, Add sort at the foot: what holds it has no + of its own to add a rule with. True unless said. */
|
|
41
|
+
addSort?: boolean;
|
|
42
|
+
/** Its words; English unless handed. */
|
|
43
|
+
words?: Partial<SortEditorWords>;
|
|
44
|
+
}
|
|
45
|
+
export interface SortEditorParts {
|
|
46
|
+
body: React.ReactNode;
|
|
47
|
+
/** On a phone, the Sheet head's ✕ and ✓, or on a step its Back (`onBack`) alone; {} on a computer and in the narrow form. */
|
|
48
|
+
head: Pick<SheetHeadProps, "close" | "left" | "right" | "onBack">;
|
|
49
|
+
/** On a phone's step, its title: Add sort, or the rule's field's name; absent off a step. */
|
|
50
|
+
title?: string;
|
|
51
|
+
}
|
|
52
|
+
/** The fields as a list's Sort offers them to add a rule: those the rules sort by already greyed with "Sorted", one level in too
|
|
53
|
+
* (what Sort on the row's right, and on the filter bar the empty Sort, open on a computer, KIT-623). */
|
|
54
|
+
export declare const sortableFields: (fields: PickerItem[], rules: SortRule[], fieldOf?: FieldOf, sorted?: string) => PickerItem[];
|
|
55
|
+
/** The sort editor's state and the parts a shell pours in. */
|
|
56
|
+
export declare function useSortEditor(props: SortEditorProps): SortEditorParts;
|
|
57
|
+
/** The body alone, for a shell that holds only a body (the Popover). */
|
|
58
|
+
export declare function SortEditor(props: SortEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Button } from "../button/button.js";
|
|
5
|
+
import { FieldRows, FieldRowsRow as FieldRow } from "../field/field.js";
|
|
6
|
+
import { Grip } from "../grip/grip.js";
|
|
7
|
+
import { asSelect, DOTS, DOTS_LOOK, DOTS_UP, glyph, MORE_LOOK, PLUS, TRASH, useDecide, useStandingRoom, X } from "../internal/editor-parts.js";
|
|
8
|
+
import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
|
|
9
|
+
import { moved, useReorder } from "../internal/reorder.js";
|
|
10
|
+
import { useStepReturn } from "../internal/step-return.js";
|
|
11
|
+
import { Menu } from "../menu/menu.js";
|
|
12
|
+
import { Picker, usePicker } from "../picker/picker.js";
|
|
13
|
+
import { findItem, itemLabel } from "../picker/rows.js";
|
|
14
|
+
import { Popover } from "../popover/popover.js";
|
|
15
|
+
import { Select } from "../select/select.js";
|
|
16
|
+
import { Tooltip } from "../tooltip/tooltip.js";
|
|
17
|
+
import { addSort, canAddSort, dropAside, openPlaces, putBack, repoint, SORT_MAX, takenBy } from "./rules.js";
|
|
18
|
+
import { sortWords } from "./words.js";
|
|
19
|
+
const ASCENDING = ["M4 6l7 0", "M4 12l7 0", "M4 18l9 0", "M15 9l3 -3l3 3", "M18 6l0 12"];
|
|
20
|
+
const DESCENDING = ["M4 6l9 0", "M4 12l7 0", "M4 18l7 0", "M15 15l3 3l3 -3", "M18 6l0 12"];
|
|
21
|
+
const markOf = (paths) => _jsx("span", { className: "o-sort-editor-mark", children: glyph(paths) });
|
|
22
|
+
const directionsOf = (w) => [
|
|
23
|
+
{ value: "ascending", label: w.ascending, as: { mark: markOf(ASCENDING) } },
|
|
24
|
+
{ value: "descending", label: w.descending, as: { mark: markOf(DESCENDING) } },
|
|
25
|
+
];
|
|
26
|
+
const isDirection = (v) => v === "ascending" || v === "descending";
|
|
27
|
+
const X_LOOK = { radius: "sm", corner: "round", edge: "none", words: "inherit", colour: "faint", icon: "16" };
|
|
28
|
+
const ROWS = { cards: "one", edge: "on", height: "56", label: "none", lines: "words" };
|
|
29
|
+
function fieldsFor(fields, rules, sorted, own, fieldOf) {
|
|
30
|
+
return fields.map((f) => (f.level ? { ...f, level: fieldsFor(f.level, rules, sorted, own, fieldOf) }
|
|
31
|
+
: f.value !== own && takenBy(rules, f.value, own, fieldOf) ? { ...f, disabled: true, line: sorted } : f));
|
|
32
|
+
}
|
|
33
|
+
export const sortableFields = (fields, rules, fieldOf, sorted = sortWords().sorted) => fieldsFor(fields, rules, sorted, undefined, fieldOf);
|
|
34
|
+
export function useSortEditor(props) {
|
|
35
|
+
const { label, fields, rules, onRulesChange, max = SORT_MAX, onDone, opens, fieldOf, addSort: adds = true } = props;
|
|
36
|
+
const aside = React.useMemo(() => props.aside ?? [], [props.aside]);
|
|
37
|
+
const w = sortWords(props.words), search = props.search ?? w.search, DIRECTIONS = directionsOf(w);
|
|
38
|
+
const words = w.picker ? { words: w.picker } : {};
|
|
39
|
+
const screen = React.useContext(PhoneHost), small = usePhone(), way = props.form ?? (screen || small ? "phone" : "computer");
|
|
40
|
+
const phone = way === "phone", narrow = way === "narrow";
|
|
41
|
+
const now = React.useRef(rules), asideNow = React.useRef(aside);
|
|
42
|
+
React.useLayoutEffect(() => { now.current = rules; asideNow.current = aside; });
|
|
43
|
+
const change = (next) => { now.current = next; onRulesChange(next); };
|
|
44
|
+
const write = (out) => { if (!out)
|
|
45
|
+
return; now.current = out.rules; asideNow.current = out.aside; onRulesChange(out.rules, out.aside); };
|
|
46
|
+
const repointed = React.useRef(null);
|
|
47
|
+
const pointAt = (key) => (v) => { if (typeof v === "string") {
|
|
48
|
+
repointed.current = v;
|
|
49
|
+
write(repoint(now.current, [...asideNow.current], key, v, fieldOf));
|
|
50
|
+
} };
|
|
51
|
+
const backOn = (key) => write(putBack(now.current, [...asideNow.current], key, fieldOf));
|
|
52
|
+
const drop = (key) => { const left = dropAside([...asideNow.current], key); asideNow.current = left; onRulesChange(now.current, left); };
|
|
53
|
+
const can = canAddSort(rules, openPlaces(max, aside));
|
|
54
|
+
const nameOf = (field) => itemLabel(fields, field);
|
|
55
|
+
const markFor = (field) => { const as = findItem(fields, field)?.item.as; return as && "mark" in as ? as.mark : null; };
|
|
56
|
+
const pickable = (own) => fieldsFor(fields, rules, w.sorted, own, fieldOf);
|
|
57
|
+
const free = (v) => !takenBy(now.current, v, undefined, fieldOf);
|
|
58
|
+
const dragged = React.useRef(false), [moving, setMoving] = React.useState(false);
|
|
59
|
+
const { gripProps, lift, dragging } = useReorder({ count: rules.length, grip: phone || narrow ? ".o-sort-editor-press" : ".o-sort-editor-grip",
|
|
60
|
+
onMove: (from, to) => { dragged.current = true; setMoving(true); change(moved(now.current, from, to)); } });
|
|
61
|
+
const liftedAt = (i) => ((dragging === i && (!narrow || moving)) || props.lifted === i ? "" : undefined);
|
|
62
|
+
const [root, setRoot] = React.useState(null);
|
|
63
|
+
const [refocus, setRefocus] = React.useState(null);
|
|
64
|
+
React.useLayoutEffect(() => {
|
|
65
|
+
if (refocus == null || !root)
|
|
66
|
+
return;
|
|
67
|
+
setRefocus(null);
|
|
68
|
+
const xs = root.querySelectorAll(".o-sort-editor-remove");
|
|
69
|
+
(xs[refocus] ?? xs[xs.length - 1])?.focus({ preventScroll: true });
|
|
70
|
+
}, [refocus, root]);
|
|
71
|
+
const remove = (i) => { root?.focus({ preventScroll: true }); change(now.current.filter((_, k) => k !== i)); setRefocus(i); };
|
|
72
|
+
const held = React.useMemo(() => ({ get current() { return { rules: now.current, aside: asideNow.current }; } }), []);
|
|
73
|
+
const restore = (was) => {
|
|
74
|
+
now.current = was.rules;
|
|
75
|
+
asideNow.current = was.aside;
|
|
76
|
+
if (props.aside)
|
|
77
|
+
onRulesChange(was.rules, [...was.aside]);
|
|
78
|
+
else
|
|
79
|
+
onRulesChange(was.rules);
|
|
80
|
+
};
|
|
81
|
+
const decide = useDecide(held, restore, onDone, { close: w.close, save: w.save }), placed = decide.place;
|
|
82
|
+
const placeRoot = React.useCallback((el) => { setRoot(el); placed(el); }, [placed]);
|
|
83
|
+
const room = useStandingRoom(root, "[data-sort-shown]", phone, [opens]);
|
|
84
|
+
const [pop, setPop] = React.useState(null);
|
|
85
|
+
const shownList = (items, value, name, searched) => (_jsx("div", { className: "o-sort-editor-shown o-list o-smooth o-smooth-ease", "data-sort-shown": "list", ...phoneMark(small), children: _jsx(Picker, { label: name, items: items, value: value, onValueChange: () => { }, search: searched ? search : undefined, searchShown: searched, form: "computer", standing: true, defaultLevel: props.level, ...words }) }));
|
|
86
|
+
const addField = (v) => { if (typeof v === "string" && free(v))
|
|
87
|
+
change(addSort(now.current, v)); };
|
|
88
|
+
const turn = (i) => (v) => { if (isDirection(v) && now.current[i] && now.current[i].direction !== v)
|
|
89
|
+
change(now.current.map((x, k) => (k === i ? { ...x, direction: v } : x))); };
|
|
90
|
+
const [step, setStep] = React.useState(() => (phone && opens?.list === "direction" ? { list: "direction", rule: opens.rule } : null));
|
|
91
|
+
const back = () => setStep(null);
|
|
92
|
+
const asideAt = (key) => `[data-aside-key="${CSS.escape(key)}"] .o-sort-editor-press`;
|
|
93
|
+
useStepReturn(root, !phone || !step ? [] : [step.list === "add" ? ".o-sort-editor-add"
|
|
94
|
+
: step.list === "direction" ? `.o-sort-editor-rule[data-row="${step.rule}"] .o-sort-editor-press`
|
|
95
|
+
: ((key) => (r) => {
|
|
96
|
+
const at = repointed.current == null ? -1 : now.current.findIndex((x) => x.field === repointed.current);
|
|
97
|
+
return (at >= 0 ? r.querySelector(`.o-sort-editor-rule[data-row="${at}"] .o-sort-editor-press`) : null)
|
|
98
|
+
?? r.querySelector(asideAt(key)) ?? r.querySelector(".o-sort-editor-add");
|
|
99
|
+
})(step.key)]);
|
|
100
|
+
const stepRule = step?.list === "direction" ? rules[step.rule] : undefined;
|
|
101
|
+
const stepAside = step?.list === "repoint" ? aside.find((a) => a.key === step.key) : undefined;
|
|
102
|
+
const stepList = usePicker(step?.list === "direction" && stepRule
|
|
103
|
+
? { label: nameOf(stepRule.field), items: DIRECTIONS, value: stepRule.direction, searchShown: false, form: "phone", onDone: back,
|
|
104
|
+
onValueChange: (v) => { turn(step.rule)(v); back(); }, ...words }
|
|
105
|
+
: { label: stepAside ? w.fieldNamed(stepAside.label) : w.add, items: pickable(), value: null, search, searchShown: true, defaultLevel: props.level, form: "phone", onDone: back,
|
|
106
|
+
onValueChange: (v) => { if (stepAside)
|
|
107
|
+
pointAt(stepAside.key)(v);
|
|
108
|
+
else
|
|
109
|
+
addField(v); back(); }, ...words });
|
|
110
|
+
React.useEffect(() => { if (step && step.list !== "add" && !stepRule && !(step.list === "repoint" && aside.some((a) => a.key === step.key)))
|
|
111
|
+
setStep(null); }, [step, stepRule, aside]);
|
|
112
|
+
const stepTitle = phone && step ? (stepRule ? nameOf(stepRule.field) : stepAside ? w.fieldNamed(stepAside.label) : step.list === "add" ? w.add : undefined) : undefined;
|
|
113
|
+
const addButton = (size) => (_jsx(Tooltip, { label: w.max(max), reason: true, side: "top", disabled: can, children: _jsx(Button, { kind: "outline", size: size, icon: glyph(PLUS), className: "o-sort-editor-add", disabled: !can, focusableWhenDisabled: true, "aria-haspopup": phone ? undefined : "dialog", "aria-expanded": phone ? undefined : pop?.list === "add", onClick: (e) => { const at = e.currentTarget; if (phone)
|
|
114
|
+
setStep({ list: "add" });
|
|
115
|
+
else
|
|
116
|
+
setPop((p) => (p?.list === "add" ? null : { list: "add", rule: -1, at })); }, children: w.add }) }));
|
|
117
|
+
const closePop = () => setPop(null);
|
|
118
|
+
const addPicker = _jsx(Picker, { label: w.add, items: pickable(), value: null, search: search, searchShown: true, form: "computer", defaultLevel: props.level, onDone: closePop, onValueChange: (v) => { addField(v); }, ...words });
|
|
119
|
+
const asideEntries = (a) => [
|
|
120
|
+
{ icon: null, label: a.why, disabled: a.why },
|
|
121
|
+
...(a.back != null ? [{ icon: null, label: w.putBack, onSelect: () => backOn(a.key) }] : []),
|
|
122
|
+
{ icon: glyph(TRASH), label: w.delete, danger: true, onSelect: () => drop(a.key) },
|
|
123
|
+
];
|
|
124
|
+
if (phone || narrow) {
|
|
125
|
+
const size = phone ? "44" : "sm";
|
|
126
|
+
const more = (name) => (phone
|
|
127
|
+
? _jsx(Button, { kind: "quiet", shape: "icon", size: "40x44", look: DOTS_LOOK, className: "o-sort-editor-more", "aria-label": w.actionsFor(name), icon: glyph(DOTS) })
|
|
128
|
+
: _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", look: MORE_LOOK, className: "o-sort-editor-more", "aria-label": w.actionsFor(name), icon: glyph(DOTS_UP) }));
|
|
129
|
+
const ruleRow = (r, i) => {
|
|
130
|
+
const name = nameOf(r.field), mark = markFor(r.field), g = gripProps(i), standing = narrow && opens?.list === "direction" && opens.rule === i;
|
|
131
|
+
const inner = _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "o-sort-editor-press", ...g, onPointerDown: (e) => { dragged.current = false; setMoving(false); g.onPointerDown(e); }, "aria-haspopup": narrow ? "dialog" : undefined, "aria-expanded": narrow ? pop?.list === "direction" && pop.rule === i : undefined, onClick: (e) => {
|
|
132
|
+
if (dragged.current) {
|
|
133
|
+
dragged.current = false;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const at = e.currentTarget;
|
|
137
|
+
if (narrow)
|
|
138
|
+
setPop((p) => (p?.list === "direction" && p.rule === i ? null : { list: "direction", rule: i, at }));
|
|
139
|
+
else
|
|
140
|
+
setStep({ list: "direction", rule: i });
|
|
141
|
+
}, children: [mark, _jsxs("span", { className: "o-sort-editor-words", children: [_jsx("span", { className: "o-sort-editor-name", children: name }), _jsx("span", { className: "o-sort-editor-way", children: r.direction === "ascending" ? w.ascending : w.descending })] })] }), _jsx(Menu, { label: w.sortBy(name), align: "end", entries: [{ icon: glyph(TRASH), label: w.delete, danger: true, onSelect: () => change(now.current.filter((_, k) => k !== i)) }], trigger: more(name) }), standing && shownList(DIRECTIONS, r.direction, w.direction, false)] });
|
|
142
|
+
return phone
|
|
143
|
+
? _jsx(FieldRow, { as: "div", role: "listitem", className: "o-sort-editor-rule", "data-row": i, "data-lifted": liftedAt(i), style: lift(i), children: inner }, r.field)
|
|
144
|
+
: _jsx("div", { role: "listitem", className: "o-sort-editor-rule", "data-row": i, "data-lifted": liftedAt(i), style: lift(i), children: inner }, r.field);
|
|
145
|
+
};
|
|
146
|
+
const asideRow = (a) => {
|
|
147
|
+
const inner = _jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "o-sort-editor-press", "aria-haspopup": narrow ? "dialog" : undefined, "aria-expanded": narrow ? pop?.list === "repoint" && pop.key === a.key : undefined, onClick: (e) => { const at = e.currentTarget; if (narrow)
|
|
148
|
+
setPop((p) => (p?.list === "repoint" && p.key === a.key ? null : { list: "repoint", rule: -1, key: a.key, at }));
|
|
149
|
+
else {
|
|
150
|
+
repointed.current = null;
|
|
151
|
+
setStep({ list: "repoint", key: a.key });
|
|
152
|
+
} }, children: _jsxs("span", { className: "o-sort-editor-words", children: [_jsx("span", { className: "o-sort-editor-name", children: a.label }), _jsx("span", { className: "o-sort-editor-way", children: a.why })] }) }), _jsx(Menu, { label: w.sortBy(a.label), align: "end", entries: asideEntries(a), trigger: more(a.label) })] });
|
|
153
|
+
return phone
|
|
154
|
+
? _jsx(FieldRow, { as: "div", role: "listitem", className: "o-sort-editor-rule o-sort-editor-aside", "data-aside": "", "data-aside-key": a.key, children: inner }, `aside-${a.key}`)
|
|
155
|
+
: _jsx("div", { role: "listitem", className: "o-sort-editor-rule o-sort-editor-aside", "data-aside": "", "data-aside-key": a.key, children: inner }, `aside-${a.key}`);
|
|
156
|
+
};
|
|
157
|
+
const popRule = pop?.list === "direction" ? rules[pop.rule] : undefined;
|
|
158
|
+
const popAside = pop?.list === "repoint" ? aside.find((a) => a.key === pop.key) : undefined;
|
|
159
|
+
const body = (_jsxs("div", { ref: placeRoot, className: "o-sort-editor", "data-kit": "sort-editor", "data-sort-form": way, role: narrow ? "group" : undefined, "aria-label": narrow ? label : undefined, tabIndex: -1, style: room ? { paddingBottom: room } : undefined, ...phoneMark(!!screen || small), "data-sort-step": stepTitle !== undefined ? step?.list : undefined, children: [stepTitle !== undefined ? stepList.body : _jsxs(_Fragment, { children: [rules.length || aside.length ? (phone
|
|
160
|
+
? _jsxs(FieldRows, { look: ROWS, className: "o-sort-editor-card", role: "list", "aria-label": label, children: [rules.map(ruleRow), aside.map(asideRow)] })
|
|
161
|
+
: _jsxs("div", { className: "o-sort-editor-rules", role: "list", "aria-label": label, children: [rules.map(ruleRow), aside.map(asideRow)] })) : (_jsxs("div", { className: "o-sort-editor-none", children: [_jsx("p", { className: "o-sort-editor-none-head", children: w.none }), _jsx("p", { className: "o-sort-editor-none-line", children: w.noneLine })] })), _jsxs("div", { className: "o-sort-editor-acts", children: [addButton(size), rules.length > 0 && _jsx(Button, { kind: "quiet", size: size, className: "o-sort-editor-clear", onClick: () => change([]), children: w.clearAll })] })] }), narrow && (_jsx(Popover, { open: !!pop && (pop.list === "add" || !!popRule || !!popAside), onOpenChange: (o) => { if (!o)
|
|
162
|
+
closePop(); }, anchor: pop?.at, className: "o-sort-editor-pop", "aria-label": pop?.list === "add" ? w.add : popAside ? w.fieldNamed(popAside.label) : popRule ? nameOf(popRule.field) : label, children: pop?.list === "add"
|
|
163
|
+
? addPicker
|
|
164
|
+
: popAside ? _jsx(Picker, { label: w.fieldNamed(popAside.label), items: pickable(), value: null, search: search, searchShown: true, form: "computer", defaultLevel: props.level, onDone: closePop, onValueChange: (v) => { pointAt(popAside.key)(v); closePop(); }, ...words })
|
|
165
|
+
: popRule && _jsx(Picker, { label: nameOf(popRule.field), items: DIRECTIONS, value: popRule.direction, searchShown: false, form: "computer", fromHeld: true, onDone: closePop, onValueChange: turn(pop?.rule ?? -1), ...words }) }))] }));
|
|
166
|
+
return { body, head: !phone ? {} : stepTitle !== undefined ? { onBack: back } : decide.head, ...(stepTitle !== undefined ? { title: stepTitle } : {}) };
|
|
167
|
+
}
|
|
168
|
+
const body = (_jsx("div", { ref: placeRoot, className: "o-sort-editor", "data-kit": "sort-editor", "data-sort-form": "computer", role: "group", "aria-label": label, tabIndex: -1, style: room ? { paddingBottom: room } : undefined, ...phoneMark(!!screen || small), children: (rules.length > 0 || aside.length > 0) && _jsxs(_Fragment, { children: [_jsxs("div", { className: "o-sort-editor-rules", role: "list", "aria-label": label, children: [rules.map((r, i) => {
|
|
169
|
+
const name = nameOf(r.field), g = gripProps(i), open = opens?.rule === i ? opens.list : null;
|
|
170
|
+
const items = pickable(r.field);
|
|
171
|
+
return (_jsxs("div", { role: "listitem", className: "o-sort-editor-rule", "data-row": i, "data-lifted": liftedAt(i), style: lift(i), children: [_jsx(Grip, { label: w.move(name), className: "o-sort-editor-grip", ...g }), _jsxs("div", { className: "o-sort-editor-field", children: [_jsx(Select, { size: "xs", listWidth: "rows", "aria-label": w.field, items: asSelect(items), value: r.field, search: search, "data-force": open === "field" ? "focus" : undefined, onValueChange: (v) => { if (typeof v === "string" && v !== r.field && !takenBy(now.current, v, r.field, fieldOf))
|
|
172
|
+
change(now.current.map((x, k) => (k === i ? { ...x, field: v } : x))); } }), open === "field" && shownList(items, r.field, w.field, true)] }), _jsxs("div", { className: "o-sort-editor-direction", children: [_jsx(Select, { size: "xs", listWidth: "rows", "aria-label": w.direction, items: asSelect(DIRECTIONS), value: r.direction, "data-force": open === "direction" ? "focus" : undefined, onValueChange: turn(i) }), open === "direction" && shownList(DIRECTIONS, r.direction, w.direction, false)] }), _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", look: X_LOOK, className: "o-sort-editor-remove", "aria-label": w.remove(name), icon: glyph(X), onClick: () => remove(i) })] }, r.field));
|
|
173
|
+
}), aside.map((a) => (_jsxs("div", { role: "listitem", className: "o-sort-editor-rule o-sort-editor-aside", "data-aside": "", "data-aside-key": a.key, children: [_jsx("span", { className: "o-sort-editor-grip-place", "aria-hidden": "true" }), _jsx("div", { className: "o-sort-editor-field", children: _jsx(Tooltip, { label: a.why, side: "bottom", children: _jsx("span", { className: "o-sort-editor-why", children: _jsx(Select, { size: "xs", listWidth: "rows", "aria-label": w.fieldNamed(a.label), items: asSelect(pickable()), value: null, placeholder: a.label, search: search, onValueChange: pointAt(a.key) }) }) }) }), _jsx("div", { className: "o-sort-editor-direction", children: _jsx(Tooltip, { label: a.why, side: "bottom", children: _jsx("span", { className: "o-sort-editor-why", children: _jsx(Select, { size: "xs", listWidth: "rows", "aria-label": w.direction, items: asSelect(DIRECTIONS), value: a.direction, disabled: true, onValueChange: () => { } }) }) }) }), _jsx(Menu, { label: w.sortBy(a.label), align: "end", entries: asideEntries(a), trigger: _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", look: X_LOOK, className: "o-sort-editor-more", "aria-label": w.actionsFor(a.label), icon: glyph(DOTS) }) })] }, `aside-${a.key}`)))] }), (adds || rules.length > 0) && _jsxs("div", { className: "o-sort-editor-foot", children: [adds && addButton("sm"), rules.length > 0 && _jsx(Button, { kind: "quiet", size: "sm", className: "o-sort-editor-clear", onClick: () => { closePop(); change([]); if (!asideNow.current.length)
|
|
174
|
+
onDone?.(); }, children: w.clearAllSorts })] }), _jsx(Popover, { open: pop?.list === "add", onOpenChange: (o) => { if (!o)
|
|
175
|
+
closePop(); }, anchor: pop?.at, className: "o-sort-editor-pop", "aria-label": w.add, children: pop?.list === "add" && addPicker })] }) }));
|
|
176
|
+
return { body, head: {} };
|
|
177
|
+
}
|
|
178
|
+
export function SortEditor(props) {
|
|
179
|
+
return _jsx(_Fragment, { children: useSortEditor(props).body });
|
|
180
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const SORT_EDITOR_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-border-brand";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--border-focused";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-border-warning";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--border-warning";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-border-width";
|
|
11
|
+
readonly kind: "size";
|
|
12
|
+
readonly outright: "--border-width";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-fg";
|
|
15
|
+
readonly kind: "colour";
|
|
16
|
+
readonly outright: "--text";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-fg-subtle";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--text-subtle";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-font-size-base";
|
|
23
|
+
readonly kind: "size";
|
|
24
|
+
readonly outright: "--text-base";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-font-size-sm";
|
|
27
|
+
readonly kind: "size";
|
|
28
|
+
readonly outright: "--text-sm";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-font-size-xs";
|
|
31
|
+
readonly kind: "size";
|
|
32
|
+
readonly outright: "--text-xs";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-font-weight-medium";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--font-weight-medium";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-layer-popup";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--layer-popup";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-line-height-base";
|
|
43
|
+
readonly kind: "size";
|
|
44
|
+
readonly outright: "--text-base--line-height";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-line-height-sm";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--text-sm--line-height";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-line-height-xs";
|
|
51
|
+
readonly kind: "size";
|
|
52
|
+
readonly outright: "--text-xs--line-height";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-overlay";
|
|
55
|
+
readonly kind: "colour";
|
|
56
|
+
readonly outright: "--surface-overlay";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-overlay-hovered";
|
|
59
|
+
readonly kind: "colour";
|
|
60
|
+
readonly outright: "--surface-overlay-hovered";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-radius-md";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--radius-md";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-shadow-lg";
|
|
67
|
+
readonly kind: "shadow";
|
|
68
|
+
readonly outright: "--shadow-lg";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-spacing";
|
|
71
|
+
readonly kind: "size";
|
|
72
|
+
readonly outright: "--spacing";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-warning";
|
|
75
|
+
readonly kind: "colour";
|
|
76
|
+
readonly outright: "--text-warning";
|
|
77
|
+
}];
|
|
78
|
+
/** The prefixes of the sort editor's own machinery, set and read by it alone: none. */
|
|
79
|
+
export declare const SORT_EDITOR_PRIVATE: readonly [];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const SORT_EDITOR_TOKENS = [
|
|
2
|
+
{ name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
|
|
3
|
+
{ name: "--vk-border-warning", kind: "colour", outright: "--border-warning" },
|
|
4
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
5
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
6
|
+
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
7
|
+
{ name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
|
|
8
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
9
|
+
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
10
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
11
|
+
{ name: "--vk-layer-popup", kind: "size", outright: "--layer-popup" },
|
|
12
|
+
{ name: "--vk-line-height-base", kind: "size", outright: "--text-base--line-height" },
|
|
13
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
14
|
+
{ name: "--vk-line-height-xs", kind: "size", outright: "--text-xs--line-height" },
|
|
15
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
16
|
+
{ name: "--vk-overlay-hovered", kind: "colour", outright: "--surface-overlay-hovered" },
|
|
17
|
+
{ name: "--vk-radius-md", kind: "size", outright: "--radius-md" },
|
|
18
|
+
{ name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
|
|
19
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
20
|
+
{ name: "--vk-warning", kind: "colour", outright: "--text-warning" },
|
|
21
|
+
];
|
|
22
|
+
export const SORT_EDITOR_PRIVATE = [];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PickerWords } from "../picker/picker.js";
|
|
2
|
+
export interface SortEditorWords {
|
|
3
|
+
/** A rule's field box, to a screen reader. */
|
|
4
|
+
field: string;
|
|
5
|
+
/** A rule's direction box, to a screen reader, and its list's name. */
|
|
6
|
+
direction: string;
|
|
7
|
+
ascending: string;
|
|
8
|
+
descending: string;
|
|
9
|
+
/** The line on a field another rule sorts already. */
|
|
10
|
+
sorted: string;
|
|
11
|
+
/** Why Add sort can't be used, at `max` rules. */
|
|
12
|
+
max: (max: number) => string;
|
|
13
|
+
/** Add sort, and its list's name. */
|
|
14
|
+
add: string;
|
|
15
|
+
/** A computer's Clear all, at the foot's end. */
|
|
16
|
+
clearAllSorts: string;
|
|
17
|
+
/** A phone's and the narrow form's Clear all. */
|
|
18
|
+
clearAll: string;
|
|
19
|
+
/** A rule's menu row taking it away. */
|
|
20
|
+
delete: string;
|
|
21
|
+
/** A rule's grip. */
|
|
22
|
+
move: (name: string) => string;
|
|
23
|
+
/** A rule's ×. */
|
|
24
|
+
remove: (name: string) => string;
|
|
25
|
+
/** The menu a rule's ⋯ opens, by its field. */
|
|
26
|
+
sortBy: (name: string) => string;
|
|
27
|
+
/** A rule's ⋯. */
|
|
28
|
+
actionsFor: (name: string) => string;
|
|
29
|
+
/** What the body says with nothing sorted, and its line under it. */
|
|
30
|
+
none: string;
|
|
31
|
+
noneLine: string;
|
|
32
|
+
/** The fields' search, before anything is typed. */
|
|
33
|
+
search: string;
|
|
34
|
+
/** A step's ‹, back to the rules. */
|
|
35
|
+
back: string;
|
|
36
|
+
/** The phone's ✕ and ✓, round an editor whose holder draws no head of its own (useDecide). */
|
|
37
|
+
close: string;
|
|
38
|
+
save: string;
|
|
39
|
+
/** A set-aside sort's menu row putting it back on its own field. */
|
|
40
|
+
putBack: string;
|
|
41
|
+
/** A set-aside sort's field box, and its step's title on a phone, by its words. */
|
|
42
|
+
fieldNamed: (label: string) => string;
|
|
43
|
+
/** The lists' own words (the Picker's). */
|
|
44
|
+
picker?: Partial<PickerWords>;
|
|
45
|
+
}
|
|
46
|
+
export declare const SORT_EDITOR_WORDS: SortEditorWords;
|
|
47
|
+
/** The sort editor's words: the handed ones over the English. */
|
|
48
|
+
export declare const sortWords: (given?: Partial<SortEditorWords>) => SortEditorWords;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const SORT_EDITOR_WORDS = {
|
|
2
|
+
field: "Field",
|
|
3
|
+
direction: "Direction",
|
|
4
|
+
ascending: "Ascending",
|
|
5
|
+
descending: "Descending",
|
|
6
|
+
sorted: "Sorted",
|
|
7
|
+
max: (max) => (max === 3 ? "Three at most" : `${max} at most`),
|
|
8
|
+
add: "Add sort",
|
|
9
|
+
clearAllSorts: "Clear all sorts",
|
|
10
|
+
clearAll: "Clear all",
|
|
11
|
+
delete: "Delete",
|
|
12
|
+
move: (name) => `Move ${name}`,
|
|
13
|
+
remove: (name) => `Remove the sort by ${name}`,
|
|
14
|
+
sortBy: (name) => `the sort by ${name}`,
|
|
15
|
+
actionsFor: (name) => `Actions for the sort by ${name}`,
|
|
16
|
+
none: "No sorting set up yet",
|
|
17
|
+
noneLine: "Choose a field to sort by",
|
|
18
|
+
search: "Search fields",
|
|
19
|
+
back: "Back",
|
|
20
|
+
close: "Close",
|
|
21
|
+
save: "Save",
|
|
22
|
+
putBack: "Put back",
|
|
23
|
+
fieldNamed: (label) => `Field: ${label}`,
|
|
24
|
+
};
|
|
25
|
+
export const sortWords = (given) => (given ? { ...SORT_EDITOR_WORDS, ...given } : SORT_EDITOR_WORDS);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* The sort editor: what a list's sort opens (KIT-623), after Attio's (the toolbar canvas's round 3 Sort board and round 11 PhoneSort
|
|
2
|
+
board). Every value is a public --vk-* name (sort-editor/tokens.ts). On a computer, what the Popover holds: the rules, each a row 28 high, 8 apart (its
|
|
3
|
+
grip, the field's box 208 wide, the direction's 152, ×: as wide as its two boxes need, Company › Industry and Descending whole,
|
|
4
|
+
Mihai, 17 Nov 2026), then 12 under them its foot, the filter editor's (KIT-794): a row, Add sort at its start, Clear all sorts at
|
|
5
|
+
its end. A rule held by its grip lifts on the overlay's ground with a shadow. On a phone, what the Sheet holds: Field rows' card, each rule 56 high (its field's mark, its name
|
|
6
|
+
and its direction under it, ⋯), or, with none, what it says; then Add sort and Clear all, the whole width. Its narrow form
|
|
7
|
+
(KIT-672), what Customize's Sort holds in the Pane on a computer: the phone's structure at a computer's sizes (Mihai, 19 Nov
|
|
8
|
+
2026), the rows on the Pane's ground with no card, each 44 (its mark 16, its name text-sm, its direction text-xs under it, ⋮ 28),
|
|
9
|
+
its hover the overlay's on the whole row, ⋮ inside it (KIT-819); Add sort and Clear all at 32, the whole width.
|
|
10
|
+
|
|
11
|
+
The rules sit in the components layer, so a utility class still wins. */
|
|
12
|
+
@layer components {
|
|
13
|
+
|
|
14
|
+
.o-sort-editor { position: relative; display: flex; flex-direction: column; min-width: 0; color: var(--vk-fg); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
|
|
15
|
+
.o-sort-editor:focus { outline: none; }
|
|
16
|
+
.o-sort-editor-mark { display: inline-flex; flex: none; align-items: center; color: var(--vk-fg-subtle); }
|
|
17
|
+
.o-sort-editor-mark svg { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
|
|
18
|
+
|
|
19
|
+
/* ── On a computer: the rules ────────────────────────────────────────────────────────────────────────────────────── */
|
|
20
|
+
.o-sort-editor[data-sort-form="computer"] { width: max-content; max-width: 100%; gap: calc(var(--vk-spacing) * 3); }
|
|
21
|
+
.o-sort-editor-foot { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); }
|
|
22
|
+
.o-sort-editor-foot .o-sort-editor-clear { margin-left: auto; }
|
|
23
|
+
.o-sort-editor-rules { display: flex; flex-direction: column; gap: calc(var(--vk-spacing) * 2); }
|
|
24
|
+
.o-sort-editor-rule { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); min-width: 0; border-radius: var(--vk-radius-md); }
|
|
25
|
+
.o-sort-editor-rule[data-lifted] { position: relative; z-index: var(--vk-layer-popup); background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-lg); }
|
|
26
|
+
.o-sort-editor-rule[data-lifted] .o-sort-editor-grip { cursor: grabbing; }
|
|
27
|
+
.o-sort-editor-grip { flex: none; touch-action: none; }
|
|
28
|
+
.o-sort-editor-field, .o-sort-editor-direction { position: relative; flex: none; min-width: 0; }
|
|
29
|
+
.o-sort-editor-field { width: calc(var(--vk-spacing) * 52); }
|
|
30
|
+
.o-sort-editor-direction { width: calc(var(--vk-spacing) * 38); }
|
|
31
|
+
.o-sort-editor-field > .o-select, .o-sort-editor-direction > .o-select { width: 100%; }
|
|
32
|
+
.o-sort-editor-remove { flex: none; }
|
|
33
|
+
|
|
34
|
+
/* Add sort's fields, and in the narrow form a rule's direction, in the Popover under what was pressed: as wide as its rows, never
|
|
35
|
+
under 192 (the kit's w-fit and min-w-48, written here since an app compiles no utilities of ViewKit's). */
|
|
36
|
+
.o-popover.o-sort-editor-pop { width: fit-content; min-width: calc(var(--vk-spacing) * 48); }
|
|
37
|
+
|
|
38
|
+
/* A list a page shows standing open: under what opens it, over the rules, as the Select's list stands, as wide as its rows, never
|
|
39
|
+
under 192 nor its box, never past 288 (listWidth, select.css). Scoped to the editor, so it wins over the smooth list's own
|
|
40
|
+
`position: relative` (list.css), which would stand it in the row and push the row's boxes apart (Mihai, 18 Nov 2026). */
|
|
41
|
+
.o-sort-editor .o-sort-editor-shown { position: absolute; z-index: var(--vk-layer-popup); top: 100%; left: 0; }
|
|
42
|
+
.o-sort-editor .o-sort-editor-shown[data-sort-shown="list"] {
|
|
43
|
+
top: calc(100% + var(--vk-spacing)); display: flex; flex-direction: column;
|
|
44
|
+
width: max-content; min-width: max(100%, calc(var(--vk-spacing) * 48)); max-width: calc(var(--vk-spacing) * 72);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ── On a phone: the rules in their card, or what it says with none; Add sort and Clear all ─────────────────────── */
|
|
48
|
+
.o-sort-editor[data-sort-form="phone"] { gap: calc(var(--vk-spacing) * 3); font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); }
|
|
49
|
+
.o-sort-editor-none { display: grid; gap: calc(var(--vk-spacing) * 0.5); padding: 0 calc(var(--vk-spacing) * 1); }
|
|
50
|
+
.o-sort-editor-none p { margin: 0; }
|
|
51
|
+
.o-sort-editor-none-head { font-weight: var(--vk-font-weight-medium); }
|
|
52
|
+
.o-sort-editor-none-line { color: var(--vk-fg-subtle); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
|
|
53
|
+
[data-sort-form="narrow"] .o-sort-editor-none-line { font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); }
|
|
54
|
+
.o-sort-editor-card .o-sort-editor-rule { gap: 0; padding-right: calc(var(--vk-spacing) * 1); border-radius: 0; }
|
|
55
|
+
.o-sort-editor-card .o-sort-editor-rule[data-lifted] { background-color: var(--vk-overlay); }
|
|
56
|
+
.o-sort-editor-press {
|
|
57
|
+
display: flex; flex: 1; align-items: center; gap: calc(var(--vk-spacing) * 3); align-self: stretch; min-width: 0; margin: 0; padding: 0;
|
|
58
|
+
border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent;
|
|
59
|
+
}
|
|
60
|
+
.o-sort-editor-press:focus-visible { outline: var(--vk-border-width) solid var(--vk-border-brand); outline-offset: calc(var(--vk-border-width) * -2); }
|
|
61
|
+
[data-sort-form="phone"] .o-sort-editor-press .o-sort-editor-mark svg { width: calc(var(--vk-spacing) * 5); height: calc(var(--vk-spacing) * 5); }
|
|
62
|
+
.o-sort-editor-words { display: grid; min-width: 0; }
|
|
63
|
+
.o-sort-editor-name, .o-sort-editor-way { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
64
|
+
.o-sort-editor-way { color: var(--vk-fg-subtle); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
|
|
65
|
+
[data-sort-form="narrow"] .o-sort-editor-way { font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); }
|
|
66
|
+
.o-sort-editor-more { flex: none; }
|
|
67
|
+
.o-sort-editor-acts { display: grid; gap: calc(var(--vk-spacing) * 2); }
|
|
68
|
+
.o-sort-editor-acts .o-button { width: 100%; }
|
|
69
|
+
|
|
70
|
+
/* ── The narrow form: the phone's rows on the Pane's ground at a computer's sizes; Add sort and Clear all at 32 ─────────────── */
|
|
71
|
+
.o-sort-editor[data-sort-form="narrow"] { gap: calc(var(--vk-spacing) * 3); }
|
|
72
|
+
[data-sort-form="narrow"] .o-sort-editor-rules { gap: 0; }
|
|
73
|
+
/* A rule's row is lit whole, ⋮ inside its ground at its end, as the Picker's row (KIT-676, KIT-819): under the pointer, lifted, and
|
|
74
|
+
while ⋮'s menu is open; a direction's list a page shows standing in the row never lights it. The press keeps its room and its
|
|
75
|
+
corners, for its focus ring, and has no ground of its own. */
|
|
76
|
+
[data-sort-form="narrow"] .o-sort-editor-rule { position: relative; gap: var(--vk-spacing); padding-right: var(--vk-spacing); border-radius: var(--vk-radius-md); }
|
|
77
|
+
[data-sort-form="narrow"] .o-sort-editor-press {
|
|
78
|
+
min-height: calc(var(--vk-spacing) * 11); padding: var(--vk-spacing) calc(var(--vk-spacing) * 2); gap: calc(var(--vk-spacing) * 2.5); border-radius: var(--vk-radius-md);
|
|
79
|
+
}
|
|
80
|
+
[data-sort-form="narrow"] .o-sort-editor-rule:is([data-lifted], :has(.o-sort-editor-more:is([aria-expanded="true"], [data-popup-open]))) { background-color: var(--vk-overlay-hovered); }
|
|
81
|
+
@media (hover: hover) { [data-sort-form="narrow"] .o-sort-editor-rule:hover:not(:has(.o-sort-editor-shown:hover)) { background-color: var(--vk-overlay-hovered); } }
|
|
82
|
+
[data-sort-form="narrow"] .o-sort-editor-none { padding: 0 calc(var(--vk-spacing) * 2); }
|
|
83
|
+
/* A list a page shows standing open, under its rule: never wider than the Pane's column. */
|
|
84
|
+
.o-sort-editor[data-sort-form="narrow"] .o-sort-editor-shown[data-sort-shown="list"] { min-width: min(100%, calc(var(--vk-spacing) * 48)); max-width: 100%; }
|
|
85
|
+
|
|
86
|
+
/* ── A sort set aside (its field deleted or hidden), after the rules (Mihai, 27 Nov 2026) ─────────────────────────────── */
|
|
87
|
+
/* On a computer an empty place where the grip stands; its field's box dashed in the warning colour, its words too; its
|
|
88
|
+
direction greyed. On a phone and in the narrow form its why stands under its name in the warning colour. */
|
|
89
|
+
.o-sort-editor-grip-place { flex: none; width: calc(var(--vk-spacing) * 5); }
|
|
90
|
+
.o-sort-editor-why { display: flex; width: 100%; }
|
|
91
|
+
.o-sort-editor-why > .o-select { width: 100%; }
|
|
92
|
+
/* --input-edge is the Input's own edge colour (input.css), which the Select's box draws its edge with. */
|
|
93
|
+
.o-sort-editor-aside .o-sort-editor-field .o-select-field { --input-edge: var(--vk-border-warning); border-style: dashed; color: var(--vk-warning); }
|
|
94
|
+
.o-sort-editor-aside .o-sort-editor-field .o-select-placeholder { color: var(--vk-warning); }
|
|
95
|
+
.o-sort-editor-aside .o-sort-editor-way { color: var(--vk-warning); }
|
|
96
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SwitchProps } from "../switch/switch.js";
|
|
3
|
+
export interface SwitchRowProps extends SwitchProps {
|
|
4
|
+
/** The setting's name ("Daily summary"), not the action. */
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
/** A line under it: what it does, or why it is locked. */
|
|
7
|
+
note?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** A setting in a settings list: its name and a line on the left, the switch on the right; the whole row presses it. */
|
|
10
|
+
export declare function SwitchRow({ label, note, ...props }: SwitchRowProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/** Settings rows in a bordered box, a line between each. */
|
|
12
|
+
export declare function SwitchRows({ className, children }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "../../internal/cx.js";
|
|
3
|
+
import { Switch } from "../switch/switch.js";
|
|
4
|
+
export function SwitchRow({ label, note, ...props }) {
|
|
5
|
+
return (_jsxs("label", { className: "o-switch-row", children: [_jsxs("span", { className: "o-choice-text", children: [_jsx("span", { className: "o-choice-label", children: label }), note != null && _jsx("span", { className: "o-choice-note", children: note })] }), _jsx(Switch, { ...props })] }));
|
|
6
|
+
}
|
|
7
|
+
export function SwitchRows({ className, children }) {
|
|
8
|
+
return _jsx("div", { className: cx("o-switch-rows o-smooth o-smooth-ease", className), children: children });
|
|
9
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const SWITCH_ROW_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-border";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--border";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-border-subtle";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--border-subtle";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-hovered";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--surface-hovered";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-border-width";
|
|
15
|
+
readonly kind: "size";
|
|
16
|
+
readonly outright: "--border-width";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-corner-smoothing";
|
|
19
|
+
readonly kind: "size";
|
|
20
|
+
readonly outright: "--corner-smoothing";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-font-size-sm";
|
|
23
|
+
readonly kind: "size";
|
|
24
|
+
readonly outright: "--text-sm";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-font-weight-medium";
|
|
27
|
+
readonly kind: "size";
|
|
28
|
+
readonly outright: "--font-weight-medium";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-line-height-sm";
|
|
31
|
+
readonly kind: "size";
|
|
32
|
+
readonly outright: "--text-sm--line-height";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-radius-lg";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--radius-lg";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-spacing";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--spacing";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-duration-fast";
|
|
43
|
+
readonly kind: "motion";
|
|
44
|
+
readonly outright: "--duration-fast";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-ease-out";
|
|
47
|
+
readonly kind: "motion";
|
|
48
|
+
readonly outright: "--ease-out";
|
|
49
|
+
}];
|
|
50
|
+
/** The rows' card's own machinery: the size its smooth corner is fitted to. */
|
|
51
|
+
export declare const SWITCH_ROW_PRIVATE: readonly ["--rows-card-"];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const SWITCH_ROW_TOKENS = [
|
|
2
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
3
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
4
|
+
{ name: "--vk-hovered", kind: "colour", outright: "--surface-hovered" },
|
|
5
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
6
|
+
{ name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
|
|
7
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
8
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
9
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
10
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
11
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
12
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
13
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
14
|
+
];
|
|
15
|
+
export const SWITCH_ROW_PRIVATE = ["--rows-card-"];
|