viewkitjs 0.28.0 → 0.30.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 +218 -0
- package/MIGRATION.md +181 -11
- 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 +2 -2
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/cell-values.js +9 -12
- package/views/dist/contract.d.ts +161 -18
- package/views/dist/contract.js +170 -28
- 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/compound-editor/looks.js +1 -1
- package/views/dist/controls/controls.d.ts +8 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/customize/customize.d.ts +176 -0
- package/views/dist/controls/customize/customize.js +348 -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 +15 -0
- package/views/dist/controls/customize/map-customize-body.js +195 -0
- package/views/dist/controls/customize/map-ranges.d.ts +23 -0
- package/views/dist/controls/customize/map-ranges.js +41 -0
- package/views/dist/controls/customize/rules.d.ts +39 -0
- package/views/dist/controls/customize/rules.js +21 -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 +65 -0
- package/views/dist/controls/customize/words.js +42 -0
- package/views/dist/controls/customize.css +57 -0
- package/views/dist/controls/date-editor/looks.js +1 -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 +4 -0
- package/views/dist/controls/filter-editor/filter-editor.js +86 -43
- package/views/dist/controls/filter-editor/how.d.ts +1 -1
- package/views/dist/controls/filter-editor/how.js +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
- package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
- package/views/dist/controls/filter-editor/map-rules.js +73 -42
- package/views/dist/controls/filter-editor/rules.d.ts +42 -5
- package/views/dist/controls/filter-editor/rules.js +55 -2
- package/views/dist/controls/filter-editor/words.d.ts +15 -0
- package/views/dist/controls/filter-editor/words.js +6 -0
- package/views/dist/controls/filter-editor.css +18 -0
- package/views/dist/controls/index.d.ts +33 -9
- package/views/dist/controls/index.js +32 -9
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- 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/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/menu-list/menu-list.d.ts +16 -1
- package/views/dist/controls/menu-list/menu-list.js +26 -8
- package/views/dist/controls/menu-list.css +8 -0
- package/views/dist/controls/number-editor/looks.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/pane.d.ts +4 -0
- package/views/dist/controls/pane/pane.js +2 -1
- 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/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 +59 -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/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/map-text-body.d.ts +1 -1
- package/views/dist/controls/text-editor/map-text-body.js +2 -2
- package/views/dist/controls/text-editor/text-editor.d.ts +3 -0
- package/views/dist/controls/text-editor/text-editor.js +17 -7
- package/views/dist/controls/text-editor.css +11 -0
- package/views/dist/controls/toast/toast.d.ts +5 -1
- package/views/dist/controls/toast/toast.js +5 -3
- package/views/dist/controls/tokens.js +18 -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.js +6 -2
- 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 +3 -3
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +3 -0
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/options.d.ts +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/display/rich-text.js +0 -1
- package/views/dist/editors/ChipsEditor.d.ts +4 -5
- package/views/dist/editors/ChipsEditor.js +12 -78
- package/views/dist/editors/DateEditor.d.ts +12 -16
- package/views/dist/editors/DateEditor.js +40 -191
- package/views/dist/editors/EditorPanel.d.ts +2 -6
- package/views/dist/editors/EditorPanel.js +2 -2
- package/views/dist/editors/LocationEditor.d.ts +11 -19
- package/views/dist/editors/LocationEditor.js +19 -211
- package/views/dist/editors/NameEditor.d.ts +8 -16
- package/views/dist/editors/NameEditor.js +11 -100
- package/views/dist/editors/NumberEditor.d.ts +14 -21
- package/views/dist/editors/NumberEditor.js +22 -49
- package/views/dist/editors/RangeEditor.d.ts +9 -33
- package/views/dist/editors/RangeEditor.js +12 -97
- package/views/dist/editors/RelationEditor.d.ts +6 -9
- package/views/dist/editors/RelationEditor.js +11 -30
- package/views/dist/editors/RelationSetEditor.d.ts +13 -24
- package/views/dist/editors/RelationSetEditor.js +33 -101
- package/views/dist/editors/SelectEditor.d.ts +15 -17
- package/views/dist/editors/SelectEditor.js +15 -94
- package/views/dist/editors/TextEditor.d.ts +23 -26
- package/views/dist/editors/TextEditor.js +11 -48
- package/views/dist/editors/ValueListEditor.d.ts +14 -23
- package/views/dist/editors/ValueListEditor.js +16 -202
- package/views/dist/editors/body-panel.d.ts +13 -7
- package/views/dist/editors/body-panel.js +3 -7
- package/views/dist/editors/edit-cores.d.ts +15 -15
- package/views/dist/editors/edit-cores.js +14 -14
- package/views/dist/editors/number-body.d.ts +1 -1
- package/views/dist/editors/number-step.d.ts +0 -34
- package/views/dist/editors/number-step.js +0 -37
- package/views/dist/editors/option-add-flow.d.ts +1 -13
- package/views/dist/editors/option-add-flow.js +0 -22
- package/views/dist/editors/relation-links-body.d.ts +2 -3
- package/views/dist/editors/relation-picker.d.ts +13 -3
- package/views/dist/editors/relation-source.d.ts +0 -22
- package/views/dist/editors/relation-source.js +0 -21
- package/views/dist/field-row/FieldRow.js +5 -6
- package/views/dist/field-row/FieldRowLane.js +0 -1
- package/views/dist/field-row/editors/RowChipsEditor.js +2 -2
- package/views/dist/field-row/editors/RowDateEditor.d.ts +2 -2
- package/views/dist/field-row/editors/RowDateEditor.js +2 -2
- package/views/dist/field-row/editors/RowNameEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowNameEditor.js +7 -12
- package/views/dist/field-row/editors/RowNumberEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowNumberEditor.js +4 -4
- package/views/dist/field-row/editors/RowPlaceEditor.js +3 -3
- package/views/dist/field-row/editors/RowRangeEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowRangeEditor.js +7 -14
- package/views/dist/field-row/editors/RowRelationEditor.js +3 -3
- package/views/dist/field-row/editors/RowSelectEditor.js +2 -2
- package/views/dist/field-row/editors/RowTextEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowTextEditor.js +3 -4
- package/views/dist/field-row/editors/RowValueListEditor.js +5 -5
- package/views/dist/field-row/field-row-button.d.ts +6 -9
- package/views/dist/field-row/field-row-button.js +1 -6
- package/views/dist/field-row/field-row-checkbox.d.ts +1 -1
- package/views/dist/field-row/row-target.d.ts +0 -7
- package/views/dist/field-row/row-target.js +0 -2
- package/views/dist/grid/chrome/GridAddColumn.d.ts +2 -1
- package/views/dist/grid/chrome/GridAddColumn.js +8 -66
- package/views/dist/grid/chrome/GridAggregateMenu.d.ts +5 -7
- package/views/dist/grid/chrome/GridAggregateMenu.js +20 -39
- package/views/dist/grid/chrome/GridCellEditors.d.ts +2 -2
- package/views/dist/grid/chrome/GridCellEditors.js +12 -12
- package/views/dist/grid/chrome/GridChipsEditor.js +3 -3
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +11 -12
- package/views/dist/grid/chrome/GridColumnMenu.js +32 -93
- package/views/dist/grid/chrome/GridDateEditor.d.ts +6 -6
- package/views/dist/grid/chrome/GridDateEditor.js +3 -3
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -6
- package/views/dist/grid/chrome/GridGroupMenu.js +21 -62
- package/views/dist/grid/chrome/GridHeader.d.ts +1 -2
- package/views/dist/grid/chrome/GridHeader.js +3 -2
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +17 -38
- package/views/dist/grid/chrome/GridLongTextEditor.js +6 -7
- package/views/dist/grid/chrome/GridNameEditor.js +4 -4
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +4 -5
- package/views/dist/grid/chrome/GridNumberEditor.js +5 -6
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +2 -5
- package/views/dist/grid/chrome/GridPlaceEditor.js +5 -5
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +6 -12
- package/views/dist/grid/chrome/GridRangeEditor.js +7 -15
- package/views/dist/grid/chrome/GridRelationEditor.js +5 -5
- package/views/dist/grid/chrome/GridRow.js +0 -3
- package/views/dist/grid/chrome/GridRowActions.d.ts +1 -1
- package/views/dist/grid/chrome/GridRowActions.js +0 -5
- package/views/dist/grid/chrome/GridRowCells.js +11 -7
- package/views/dist/grid/chrome/GridSelectEditor.js +3 -3
- package/views/dist/grid/chrome/GridStructure.js +0 -1
- package/views/dist/grid/chrome/GridTable.js +1 -1
- package/views/dist/grid/chrome/GridTextEditor.d.ts +5 -7
- package/views/dist/grid/chrome/GridTextEditor.js +5 -18
- package/views/dist/grid/chrome/GridValueListEditor.js +4 -4
- package/views/dist/grid/chrome/grid-body-place.d.ts +2 -3
- package/views/dist/grid/chrome/grid-body-place.js +4 -8
- package/views/dist/grid/chrome/grid-button.d.ts +7 -10
- package/views/dist/grid/chrome/grid-button.js +1 -6
- package/views/dist/grid/chrome/grid-cell-classes.js +1 -1
- package/views/dist/grid/chrome/grid-column-menu-items.d.ts +4 -4
- package/views/dist/grid/chrome/grid-column-menu-items.js +10 -6
- 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/grid-group-menu-parts.d.ts +5 -9
- package/views/dist/grid/chrome/grid-group-menu-parts.js +1 -3
- package/views/dist/grid/chrome/grid-hover.js +0 -1
- package/views/dist/grid/chrome/grid-menu-focus.d.ts +7 -31
- package/views/dist/grid/chrome/grid-menu-focus.js +7 -47
- package/views/dist/grid/chrome/grid-styles.d.ts +0 -3
- package/views/dist/grid/chrome/grid-styles.js +0 -1
- package/views/dist/grid/chrome/grid-table-props.d.ts +6 -10
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -4
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/core/editing-controller.d.ts +2 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
- package/views/dist/grid/core/refusal-sentence.js +2 -2
- package/views/dist/grid/core/write-states.d.ts +3 -1
- package/views/dist/grid/core/write-states.js +6 -2
- 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 +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -0
- package/views/dist/model/body-frame.d.ts +0 -32
- package/views/dist/model/body-frame.js +1 -15
- 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/column-inspect.d.ts +5 -5
- package/views/dist/model/column-inspect.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/customize-body.d.ts +1 -10
- package/views/dist/panels/customize-body.js +0 -3
- package/views/dist/panels/filter/MenuSelect.js +0 -5
- package/views/dist/panels/filter/RangeFilterBody.js +0 -1
- package/views/dist/panels/filter/details.d.ts +1 -5
- package/views/dist/panels/filter/details.js +0 -13
- package/views/dist/panels/filter/filter-list.d.ts +0 -1
- package/views/dist/panels/filter/filter-list.js +1 -1
- 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 +10 -2
- package/views/dist/panels/panel-button.d.ts +10 -12
- package/views/dist/panels/panel-button.js +1 -6
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/chrome.d.ts +0 -17
- package/views/dist/panels/react/chrome.js +0 -8
- package/views/dist/panels/react/customize-body.d.ts +14 -12
- package/views/dist/panels/react/customize-body.js +93 -19
- package/views/dist/panels/react/customize.d.ts +16 -12
- package/views/dist/panels/react/customize.js +4 -110
- package/views/dist/panels/react/filter/FilterEditor.d.ts +4 -18
- package/views/dist/panels/react/filter/FilterEditor.js +6 -330
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +1 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +27 -51
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +1 -11
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +8 -144
- package/views/dist/panels/react/filter/editor-ctx.d.ts +1 -33
- package/views/dist/panels/react/filter/editor-ctx.js +5 -33
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -6
- package/views/dist/panels/react/filter/filter-part-body.js +0 -5
- package/views/dist/panels/react/filter/rule-writes.d.ts +1 -26
- package/views/dist/panels/react/filter/rule-writes.js +4 -95
- package/views/dist/panels/react/order-details.d.ts +1 -26
- package/views/dist/panels/react/order-details.js +3 -69
- package/views/dist/panels/react/panel-header.js +0 -1
- package/views/dist/panels/react/panel-step.d.ts +3 -0
- package/views/dist/panels/react/panel-step.js +2 -1
- package/views/dist/panels/react/popover.d.ts +4 -7
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +2 -4
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +16 -136
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -4
- package/views/dist/panels/react/sort/SortEditor.js +8 -245
- package/views/dist/panels/react/sort/SortFieldList.d.ts +1 -1
- package/views/dist/panels/react/sort/SortFieldList.js +11 -25
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +16 -18
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
- 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.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +0 -4
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +0 -1
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -3
- package/views/dist/panels/react/view-actions.js +0 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.js +2 -5
- package/views/dist/panels/react/views-row/ViewCreatePill.js +0 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +30 -45
- package/views/dist/panels/react/views-row/ViewPickerRow.js +0 -2
- package/views/dist/panels/react/views-row/menu-classes.d.ts +0 -4
- package/views/dist/panels/react/views-row/menu-classes.js +0 -2
- package/views/dist/panels/react.d.ts +5 -12
- package/views/dist/panels/react.js +5 -12
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +40 -9
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.d.ts +2 -46
- package/views/dist/provider/ViewsProvider.js +31 -27
- package/views/dist/provider/components.d.ts +295 -107
- package/views/dist/provider/context.d.ts +7 -21
- package/views/dist/provider/missing-slot.d.ts +3 -7
- package/views/dist/provider/missing-slot.js +2 -9
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -3
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +6 -4
- 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 +694 -191
- package/views/dist/styles.unlayered.css +691 -188
- package/views/docs/contract.md +133 -130
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/customize.md +17 -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/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/getting-started.md +222 -2
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +224 -4
- package/views/docs/guides/display.md +3 -3
- package/views/docs/guides/editors.md +235 -20
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +7 -7
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +15 -17
- package/views/docs/guides/the-provider.md +9 -15
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +2 -2
- package/views/docs/reference/controls.md +215 -21
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/editors-chips.md +2 -2
- package/views/docs/reference/editors-date.md +4 -4
- package/views/docs/reference/editors-location.md +4 -7
- package/views/docs/reference/editors-name.md +3 -5
- package/views/docs/reference/editors-number.md +10 -10
- package/views/docs/reference/editors-panel.md +3 -3
- package/views/docs/reference/editors-range.md +3 -5
- package/views/docs/reference/editors-relation.md +4 -4
- package/views/docs/reference/editors-select.md +3 -3
- package/views/docs/reference/editors-text.md +3 -4
- package/views/docs/reference/editors-value-list.md +3 -3
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +2 -2
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +23 -37
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +24 -24
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +12 -11
- package/views/skills/views/SKILL.md +2 -2
- package/views/dist/editors/relation-panel.d.ts +0 -69
- package/views/dist/editors/relation-panel.js +0 -46
- package/views/dist/grid/chrome/GridColumnColorSection.d.ts +0 -13
- package/views/dist/grid/chrome/GridColumnColorSection.js +0 -40
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +0 -28
- package/views/dist/grid/chrome/GridColumnDateSection.js +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.js +0 -24
- package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +0 -29
- package/views/dist/grid/chrome/GridColumnNumberSection.js +0 -27
- package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +0 -16
- package/views/dist/grid/chrome/GridColumnPercentSection.js +0 -16
- package/views/dist/grid/chrome/GridColumnSortSection.d.ts +0 -38
- package/views/dist/grid/chrome/GridColumnSortSection.js +0 -33
- package/views/dist/grid/chrome/GridFlyout.d.ts +0 -44
- package/views/dist/grid/chrome/GridFlyout.js +0 -80
- package/views/dist/grid/chrome/GridMenuRow.d.ts +0 -15
- package/views/dist/grid/chrome/GridMenuRow.js +0 -15
- package/views/dist/grid/chrome/grid-menu-search.d.ts +0 -7
- package/views/dist/grid/chrome/grid-menu-search.js +0 -7
- package/views/dist/panels/react/GroupBucketsList.d.ts +0 -16
- package/views/dist/panels/react/GroupBucketsList.js +0 -44
- package/views/dist/panels/react/LayoutColumnsList.d.ts +0 -24
- package/views/dist/panels/react/LayoutColumnsList.js +0 -101
- package/views/dist/panels/react/PopoverColumnDetail.d.ts +0 -11
- package/views/dist/panels/react/PopoverColumnDetail.js +0 -24
- package/views/dist/panels/react/drag.d.ts +0 -2
- package/views/dist/panels/react/drag.js +0 -5
- package/views/dist/panels/react/layout-detail.d.ts +0 -4
- package/views/dist/panels/react/layout-detail.js +0 -29
- package/views/dist/panels/react/root-list.d.ts +0 -6
- package/views/dist/panels/react/root-list.js +0 -31
- package/views/dist/panels/react/sort/use-sort-drag.d.ts +0 -17
- package/views/dist/panels/react/sort/use-sort-drag.js +0 -39
- package/views/dist/panels/react/view-footer.d.ts +0 -20
- package/views/dist/panels/react/view-footer.js +0 -41
|
@@ -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-"];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* The SwitchRow and SwitchRows, as the Outright kit draws them (switch-row/switch-row.tsx): a setting in a settings list, its
|
|
2
|
+
words (choice.css) on the left and the Switch (switch.css) on the right, which reads a row under the pointer as its own
|
|
3
|
+
hover; the rows in a bordered box.
|
|
4
|
+
|
|
5
|
+
The rules sit in the components layer, so a utility class on a row still wins. */
|
|
6
|
+
@layer components {
|
|
7
|
+
|
|
8
|
+
/* ── Settings rows: the words on the left, the switch on the right, in a bordered box ──────────────── */
|
|
9
|
+
.o-switch-rows { display: grid; border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-lg); overflow: hidden; }
|
|
10
|
+
.o-switch-row {
|
|
11
|
+
display: flex; align-items: center; justify-content: space-between; gap: calc(var(--vk-spacing) * 4);
|
|
12
|
+
padding: calc(var(--vk-spacing) * 3.5) calc(var(--vk-spacing) * 4); border-top: var(--vk-border-width) solid var(--vk-border-subtle);
|
|
13
|
+
cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--vk-duration-fast) var(--vk-ease-out);
|
|
14
|
+
}
|
|
15
|
+
.o-switch-row:first-child { border-top: 0; }
|
|
16
|
+
@media (hover: hover) { .o-switch-row:hover { background-color: var(--vk-hovered); } }
|
|
17
|
+
.o-switch-row .o-choice-label { font-weight: var(--vk-font-weight-medium); }
|
|
18
|
+
.o-switch-row:has(.o-switch[data-disabled]) { cursor: not-allowed; background-color: transparent; }
|
|
19
|
+
|
|
20
|
+
@media (prefers-reduced-motion: reduce) { .o-switch-row { transition: none; } }
|
|
21
|
+
/* ── The rows' card smooth: following the token corner-smoothing, drawn with the smooth outline (smooth.css) in every browser
|
|
22
|
+
that knows shape(); one that doesn't keeps the corners above. Its round part is fitted to one row, as a control's is.
|
|
23
|
+
Nothing stands outside it (its rows were hidden past its edge), so it is clipped itself, its rows with it, hiding nothing
|
|
24
|
+
more; its edge is a ring along the curve over its rows (::after), as the Kbd's is. The Switch itself, a pill, stays as it
|
|
25
|
+
draws. ── */
|
|
26
|
+
@supports (clip-path: shape(evenodd from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close, move to 0 0, hline to 1px, close)) and (width: calc(tan(atan2(1px, 1px)) * 1px)) {
|
|
27
|
+
.o-switch-rows {
|
|
28
|
+
--smooth-amount: var(--vk-corner-smoothing); --rows-card-side: calc(var(--vk-spacing) * 7 + var(--vk-font-size-sm) * var(--vk-line-height-sm));
|
|
29
|
+
--rows-card-fit: min(var(--vk-radius-lg), var(--rows-card-side) / (2 + 2 * var(--smooth-amount, 0.7)));
|
|
30
|
+
--smooth-t: var(--rows-card-fit); --smooth-side: var(--rows-card-side);
|
|
31
|
+
position: relative; overflow: visible; border-color: transparent; border-radius: var(--rows-card-fit); clip-path: shape(var(--smooth-outline));
|
|
32
|
+
}
|
|
33
|
+
.o-switch-rows::after {
|
|
34
|
+
--smooth-t: max(0px, var(--rows-card-fit) - var(--vk-border-width)); --smooth-in: var(--vk-border-width);
|
|
35
|
+
content: ""; position: absolute; inset: calc(var(--vk-border-width) * -1); z-index: 1; pointer-events: none;
|
|
36
|
+
background-color: var(--vk-border); clip-path: shape(var(--smooth-ring));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
(data-switch-shape), its shape on a phone (data-switch-phone), what it holds (data-switch-mark) and how it moves
|
|
8
8
|
(data-switch-motion). A shape sets its sizes and its resting paint as variables; the states after them (the pointer, on,
|
|
9
9
|
error, disabled) choose among those, a later one winning. The track is painted by ::before, since ::after is its pressing
|
|
10
|
-
area (
|
|
10
|
+
area (press.css's pressing area) and a thin track is narrower than the switch itself.
|
|
11
11
|
|
|
12
12
|
The rules sit in the components layer, so a utility class on a switch still wins. */
|
|
13
13
|
@layer components {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button as BaseButton } from "@base-ui/react/button";
|
|
3
3
|
import { cx } from "../../internal/cx.js";
|
|
4
|
+
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
4
5
|
const TAG = ["M7.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3z"];
|
|
5
6
|
const X = ["M18 6l-12 12", "M6 6l12 12"];
|
|
6
7
|
const glyph = (paths, className, strokeWidth) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", strokeWidth: strokeWidth, "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
|
|
@@ -15,5 +16,6 @@ export function TagCut() {
|
|
|
15
16
|
return _jsx("span", { className: "o-tag-cut o-smooth o-smooth-ease", "aria-hidden": "true" });
|
|
16
17
|
}
|
|
17
18
|
export function TagRemove({ word, onRemove, force }) {
|
|
18
|
-
|
|
19
|
+
const phone = usePhoneForm();
|
|
20
|
+
return _jsx(BaseButton, { type: "button", className: "o-tag-remove", "aria-label": word ? `Remove ${word}` : "Remove", "data-force": force, onClick: onRemove, ...phoneMark(phone), children: glyph(X, "", 2.5) });
|
|
19
21
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type FieldError } from "../field/field.js";
|
|
3
|
+
export interface TagFieldProps {
|
|
4
|
+
/** What the field holds, above it. */
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
/** Under the field: what the tags are for, or why it is off. */
|
|
7
|
+
note?: React.ReactNode;
|
|
8
|
+
/** Under the field in place of the note: the fix; several, as a list, each once. */
|
|
9
|
+
error?: FieldError;
|
|
10
|
+
/** Off: nothing typed in, and its tags have no remove button. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
defaultValue?: string[];
|
|
13
|
+
onValueChange?: (tags: string[]) => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Draws a state for a sheet ("hover", "focus"). */
|
|
17
|
+
"data-force"?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Tags inside the Input's field, before the caret, in a Field with its label, note and error. */
|
|
20
|
+
export declare function TagField({ label, note, error, disabled, defaultValue, onValueChange, placeholder, className, "data-force": force }: TagFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Field } from "../field/field.js";
|
|
4
|
+
import { Input, InputGroup } from "../input/input.js";
|
|
5
|
+
import { Tag } from "../tag/tag.js";
|
|
6
|
+
export function TagField({ label, note, error, disabled, defaultValue = [], onValueChange, placeholder = "Add a tag", className, "data-force": force }) {
|
|
7
|
+
const [tags, setTags] = React.useState(defaultValue), [draft, setDraft] = React.useState("");
|
|
8
|
+
const set = (next) => { setTags(next); onValueChange?.(next); };
|
|
9
|
+
const add = () => { const w = draft.trim(); if (w && !tags.includes(w))
|
|
10
|
+
set([...tags, w]); setDraft(""); };
|
|
11
|
+
return (_jsx(Field, { label: label, note: note, error: error, disabled: disabled, className: className, children: _jsxs(InputGroup, { className: "o-tag-field", "data-force": force, children: [tags.map((t) => _jsx(Tag, { onRemove: disabled ? undefined : () => set(tags.filter((x) => x !== t)), children: t }, t)), _jsx(Input, { className: "o-tag-field-input", value: draft, placeholder: placeholder, autoComplete: "off", onChange: (e) => setDraft(e.currentTarget.value), onBlur: add, onKeyDown: (e) => {
|
|
12
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
add();
|
|
15
|
+
}
|
|
16
|
+
else if (e.key === "Backspace" && !draft && tags.length)
|
|
17
|
+
set(tags.slice(0, -1));
|
|
18
|
+
} })] }) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* The TagField, as the Outright kit draws it: the Tag in a field (tag-field/tag-field.tsx). The field is the Input's own (an
|
|
2
|
+
InputGroup, so input.css draws its edge, every state and option); the chip is the Tag's (tag.css).
|
|
3
|
+
|
|
4
|
+
The rules sit in the components layer, so a utility class on the field still wins. */
|
|
5
|
+
@layer components {
|
|
6
|
+
|
|
7
|
+
/* ── In a field: the tags before the caret, wrapping onto more lines as they grow; its words the Input's size, the box as tall
|
|
8
|
+
as its words, on the tags' line. Its rules outweigh the Input's (input.css may come after this file). On a phone (the
|
|
9
|
+
group's own mark, `data-vk-phone`) the field takes the phone's 44. ── */
|
|
10
|
+
.o-input.o-input-group.o-tag-field { flex-wrap: wrap; height: auto; min-height: calc(var(--vk-spacing) * 9); padding-block: calc(var(--vk-spacing) * 1.5); }
|
|
11
|
+
.o-input.o-input-group.o-tag-field:where([data-vk-phone], [data-vk-phone] *) { min-height: calc(var(--vk-spacing) * 11); padding-block: calc(var(--vk-spacing) * 2.5); }
|
|
12
|
+
.o-input-control.o-tag-field-input { align-self: center; min-width: calc(var(--vk-spacing) * 20); }
|
|
13
|
+
}
|
|
@@ -10,7 +10,7 @@ export const TEXT_EDITOR_LOOKS = {
|
|
|
10
10
|
options,
|
|
11
11
|
looks: [
|
|
12
12
|
{ id: "attio", name: "Attio", picks: { box: "over", long: "enter", phone: "country" } },
|
|
13
|
-
{ id: "mihais", name: "
|
|
13
|
+
{ id: "mihais", name: "Outright", picks: { box: "cell", long: "mod", phone: "line" } },
|
|
14
14
|
],
|
|
15
15
|
};
|
|
16
16
|
export const textEditorWornOf = (el) => lookWornOf(TEXT_EDITOR_LOOKS, el, ["box", "long", "phone"]);
|
|
@@ -3,7 +3,7 @@ import type { ViewsTextBodyProps } from "../../provider/components.js";
|
|
|
3
3
|
import { type TextEditorProps } from "./text-editor.js";
|
|
4
4
|
import type { TextEditorWords } from "./words.js";
|
|
5
5
|
/** ViewKit's text body's props as the Text editor's, held as a shell that keeps the draft. */
|
|
6
|
-
export declare function textEditorPropsOf({ label, kind, paragraph, value, onValueChange, onDone, check, region, autoFocus, form }: ViewsTextBodyProps): TextEditorProps;
|
|
6
|
+
export declare function textEditorPropsOf({ label, kind, paragraph, value, onValueChange, onDone, check, region, autoFocus, form, place }: ViewsTextBodyProps): TextEditorProps;
|
|
7
7
|
/** The Text editor's words in the app's messages: a place's country and its search, as the old location editor's, and the
|
|
8
8
|
* list's own (the Picker's). */
|
|
9
9
|
export declare function textEditorWordsOf(say: ViewsMessageResolver): TextEditorWords;
|
|
@@ -6,9 +6,9 @@ import { ViewsContext } from "../../provider/context.js";
|
|
|
6
6
|
import { pickerWordsOf } from "../picker/map-picker.js";
|
|
7
7
|
import { useToldStep } from "../internal/told-step.js";
|
|
8
8
|
import { useTextEditor } from "./text-editor.js";
|
|
9
|
-
export function textEditorPropsOf({ label, kind, paragraph, value, onValueChange, onDone, check, region, autoFocus, form }) {
|
|
9
|
+
export function textEditorPropsOf({ label, kind, paragraph, value, onValueChange, onDone, check, region, autoFocus, form, place }) {
|
|
10
10
|
const as = paragraph || kind === "rich_text" ? "long" : kind === "url" ? "link" : kind;
|
|
11
|
-
return { label, kind: as, value, onValueChange, onDone, check, autoFocus, form, draft: "shell", ...(region ? { country: region } : {}) };
|
|
11
|
+
return { label, kind: as, value, onValueChange, onDone, check, autoFocus, form, ...(place ? { place } : {}), draft: "shell", ...(region ? { country: region } : {}) };
|
|
12
12
|
}
|
|
13
13
|
export function textEditorWordsOf(say) {
|
|
14
14
|
return { country: say({ key: "views.editors.place-country" }), searchCountry: say({ key: "views.editors.place-country-search" }), picker: pickerWordsOf(say) };
|
|
@@ -33,6 +33,9 @@ export interface TextEditorProps {
|
|
|
33
33
|
country?: string;
|
|
34
34
|
/** Which form; by default the phone's in a phone's window or in a PhoneHost screen, else the computer's. */
|
|
35
35
|
form?: "computer" | "phone";
|
|
36
|
+
/** Where it stands on a computer: `cell` (the default), over a cell whose box it fills, growing over the rows below; `row`,
|
|
37
|
+
* in a record's row, in the row's flow, as tall as its text up to its cap, so the row grows with it. */
|
|
38
|
+
place?: "cell" | "row";
|
|
36
39
|
/** Where the draft, the close and a phone's ✕ and ✓ stand: `own` (the default), the Text editor's; `shell`, its holder's
|
|
37
40
|
* (ViewKit's text editor, CONTROLS.TextBody): it hands every change through onValueChange as it is made,
|
|
38
41
|
* the whole text each time (a phone with its country as phoneHanded hands it), and its own change coming back as its value
|
|
@@ -14,6 +14,7 @@ import { countryName, dialOf, firstCountry, keepLast, patternOf, phoneHanded, ph
|
|
|
14
14
|
import { TEXT_EDITOR_ATTRS, textEditorWornOf } from "./looks.js";
|
|
15
15
|
import { Countries } from "./countries.js";
|
|
16
16
|
import { textWords } from "./words.js";
|
|
17
|
+
import { keepTypedRun } from "../internal/typed-run.js";
|
|
17
18
|
const COUNTRY = { edge: "none", corner: "round", radius: "sm", words: "inherit", colour: "text", pad: "6-4", gap: "3", icon: "14", iconColour: "subtle", hover: "neutral", open: "neutral" };
|
|
18
19
|
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)) }));
|
|
19
20
|
const X = ["M18 6l-12 12", "M6 6l12 12"], TICK = ["M5 12l5 5l10 -10"], DOWN = ["M6 9l6 6l6 -6"];
|
|
@@ -21,11 +22,6 @@ const toEnd = (el) => { try {
|
|
|
21
22
|
el.setSelectionRange(el.value.length, el.value.length);
|
|
22
23
|
}
|
|
23
24
|
catch { } };
|
|
24
|
-
const DEFAULT_VALUE = typeof HTMLTextAreaElement === "undefined" ? undefined : Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "defaultValue");
|
|
25
|
-
const keepTypedRun = (el) => {
|
|
26
|
-
if (DEFAULT_VALUE && !Object.prototype.hasOwnProperty.call(el, "defaultValue"))
|
|
27
|
-
Object.defineProperty(el, "defaultValue", { configurable: true, get: () => DEFAULT_VALUE.get.call(el), set: () => { } });
|
|
28
|
-
};
|
|
29
25
|
const ONE_LINE = new Set(["email", "link", "domain", "phone"]);
|
|
30
26
|
const ROWS = 8;
|
|
31
27
|
const startOf = (value, country) => phoneParts(value, firstCountry(country));
|
|
@@ -47,6 +43,7 @@ export function useTextEditor(props) {
|
|
|
47
43
|
const w = textWords(props.words), language = props.language ?? "en";
|
|
48
44
|
const host = React.useContext(PhoneHost), small = usePhone();
|
|
49
45
|
const form = props.form ?? (host || small ? "phone" : "computer");
|
|
46
|
+
const place = props.place ?? "cell";
|
|
50
47
|
const long = kind === "long", keys = TEXT_KEYS[kind];
|
|
51
48
|
const [root, setRoot] = React.useState(null);
|
|
52
49
|
const worn = useWorn(root);
|
|
@@ -186,6 +183,19 @@ export function useTextEditor(props) {
|
|
|
186
183
|
React.useLayoutEffect(() => {
|
|
187
184
|
if (!root || form !== "computer")
|
|
188
185
|
return;
|
|
186
|
+
if (place === "row") {
|
|
187
|
+
const fit = () => {
|
|
188
|
+
const b = boxRef.current;
|
|
189
|
+
if (!(b instanceof HTMLTextAreaElement))
|
|
190
|
+
return;
|
|
191
|
+
b.style.height = "0px";
|
|
192
|
+
b.style.height = `${b.scrollHeight + b.offsetHeight - b.clientHeight}px`;
|
|
193
|
+
};
|
|
194
|
+
fit();
|
|
195
|
+
const watch = new ResizeObserver(fit);
|
|
196
|
+
watch.observe(root);
|
|
197
|
+
return () => watch.disconnect();
|
|
198
|
+
}
|
|
189
199
|
const size = () => {
|
|
190
200
|
const at = root.getBoundingClientRect(), k = drawnAt(root), row = at.height / k || 36;
|
|
191
201
|
let edge = window.innerWidth;
|
|
@@ -219,7 +229,7 @@ export function useTextEditor(props) {
|
|
|
219
229
|
const watch = new ResizeObserver(size);
|
|
220
230
|
watch.observe(root);
|
|
221
231
|
return () => watch.disconnect();
|
|
222
|
-
}, [root, form, draft, worn.box, worn.long, worn.phone, kind, long, shown]);
|
|
232
|
+
}, [root, form, place, draft, worn.box, worn.long, worn.phone, kind, long, shown]);
|
|
223
233
|
if (form === "phone") {
|
|
224
234
|
const step = withCountry && open;
|
|
225
235
|
const field = withCountry ? (_jsxs(InputGroup, { size: "lg", children: [_jsxs(InputGroupAddon, { side: "start", children: [_jsx(InputGroupButton, { className: "o-text-editor-country", "aria-label": `${w.country}: ${countryName(phone.country, language)}`, iconEnd: glyph(DOWN), onClick: () => setOpen(true), children: _jsx("span", { className: "o-text-editor-country-code", children: phone.country }) }), _jsx("span", { className: "o-text-editor-dial", children: dialOf(phone.country) })] }), _jsx(Input, { ref: number, autofill: false, type: "tel", inputMode: "tel", enterKeyHint: "done", value: phone.digits, ...common, placeholder: patternOf(phone.country), spellCheck: false, onChange: (e) => movePhone({ digits: e.target.value }), onKeyDown: onKeyDown })] })) : (_jsx(Input, { ref: box, size: "lg", autofill: false, multiline: long || kind === "text", grow: long || kind === "text", className: long ? "o-text-editor-tall" : undefined, type: long || kind === "text" ? undefined : keys.type, inputMode: keys.inputMode, enterKeyHint: long ? undefined : "done", value: draft, ...common, onChange: change, onKeyDown: long ? undefined : onKeyDown }));
|
|
@@ -243,7 +253,7 @@ export function useTextEditor(props) {
|
|
|
243
253
|
keep();
|
|
244
254
|
};
|
|
245
255
|
const note = refused && _jsxs("div", { className: "o-text-editor-note", id: noteId, role: "alert", children: [glyph(["M12 8v5", "M12 16.5v.01", "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"]), _jsx("span", { children: refused })] });
|
|
246
|
-
const body = (_jsxs("div", { ref: placeRoot, className: "o-text-editor", "data-kit": "text-editor", "data-text-form": "computer", ...phoneMark(!!host || small), "data-text-kind": kind, "data-text-box": worn.box, "data-refused": refused ? "" : undefined, onBlur: blur, children: [withCountry ? _jsxs(_Fragment, { children: [_jsxs(InlineInputGroup, { className: "o-text-editor-phone", "data-refused": refused ? "" : undefined, children: [_jsx(InputGroupAddon, { side: "start", children: _jsx(InputGroupButton, { className: "o-text-editor-country", look: COUNTRY, "aria-label": `${w.country}: ${countryName(phone.country, language)}`, "aria-haspopup": "listbox", "aria-expanded": open, iconEnd: glyph(DOWN), onClick: () => setOpen((o) => !o), children: _jsx("span", { className: "o-text-editor-country-code", children: phone.country }) }) }), _jsx(InputGroupAddon, { side: "start", children: _jsx("span", { className: "o-text-editor-dial", children: dialOf(phone.country) }) }), _jsx(Input, { ref: number, className: "o-text-editor-number", type: "tel", inputMode: "tel", enterKeyHint: "done", value: phone.digits, ...common, autofill: false, placeholder: patternOf(phone.country), spellCheck: false, onChange: (e) => movePhone({ digits: e.target.value }), onKeyDown: onKeyDown, "aria-invalid": refused ? true : undefined, "aria-describedby": refused ? noteId : undefined })] }), _jsx(Popover, { open: open, onOpenChange: (o, d) => {
|
|
256
|
+
const body = (_jsxs("div", { ref: placeRoot, className: "o-text-editor", "data-kit": "text-editor", "data-text-form": "computer", ...phoneMark(!!host || small), "data-text-kind": kind, "data-text-box": worn.box, "data-text-place": place, "data-refused": refused ? "" : undefined, onBlur: blur, children: [withCountry ? _jsxs(_Fragment, { children: [_jsxs(InlineInputGroup, { className: "o-text-editor-phone", "data-refused": refused ? "" : undefined, children: [_jsx(InputGroupAddon, { side: "start", children: _jsx(InputGroupButton, { className: "o-text-editor-country", look: COUNTRY, "aria-label": `${w.country}: ${countryName(phone.country, language)}`, "aria-haspopup": "listbox", "aria-expanded": open, iconEnd: glyph(DOWN), onClick: () => setOpen((o) => !o), children: _jsx("span", { className: "o-text-editor-country-code", children: phone.country }) }) }), _jsx(InputGroupAddon, { side: "start", children: _jsx("span", { className: "o-text-editor-dial", children: dialOf(phone.country) }) }), _jsx(Input, { ref: number, className: "o-text-editor-number", type: "tel", inputMode: "tel", enterKeyHint: "done", value: phone.digits, ...common, autofill: false, placeholder: patternOf(phone.country), spellCheck: false, onChange: (e) => movePhone({ digits: e.target.value }), onKeyDown: onKeyDown, "aria-invalid": refused ? true : undefined, "aria-describedby": refused ? noteId : undefined })] }), _jsx(Popover, { open: open, onOpenChange: (o, d) => {
|
|
247
257
|
setOpen(o);
|
|
248
258
|
if (shell)
|
|
249
259
|
return;
|
|
@@ -62,6 +62,17 @@
|
|
|
62
62
|
}
|
|
63
63
|
.o-text-editor-note svg { flex: none; width: calc(var(--vk-spacing) * 3.5); height: calc(var(--vk-spacing) * 3.5); margin-top: var(--vk-border-width); color: var(--vk-danger); }
|
|
64
64
|
|
|
65
|
+
/* ── In a record's row (data-text-place="row"): the box stands in the row's flow, a line one list row high (28), long text
|
|
66
|
+
as tall as its text up to 320, then it scrolls; a phone's box and what is refused stand under it in the flow too. The row
|
|
67
|
+
grows with it, so a section that clips the row never cuts its edge (VK-889). (0,4,0): over the cell's looks. ────── */
|
|
68
|
+
.o-text-editor[data-text-place="row"][data-text-form="computer"] { height: auto; --inline-input-row: calc(var(--vk-spacing) * 7); }
|
|
69
|
+
.o-text-editor[data-text-place="row"][data-text-form] .o-text-editor-box {
|
|
70
|
+
position: relative; top: auto; left: auto; width: 100%; min-width: 0; max-width: none; height: auto; min-height: var(--inline-input-row);
|
|
71
|
+
max-height: calc(var(--vk-spacing) * 80); box-shadow: inset 0 0 0 var(--inline-input-ring, 0px) var(--inline-input-colour);
|
|
72
|
+
}
|
|
73
|
+
.o-text-editor[data-text-place="row"][data-text-form] .o-text-editor-phone { position: relative; top: auto; left: auto; width: 100%; height: var(--inline-input-row); }
|
|
74
|
+
.o-text-editor[data-text-place="row"][data-text-form] .o-text-editor-note { position: relative; top: auto; left: auto; margin-top: var(--vk-spacing); max-width: 100%; }
|
|
75
|
+
|
|
65
76
|
/* ── On a phone: the Input at the phone's size; long text one tall box; a phone's country in the box's start side ──── */
|
|
66
77
|
.o-text-editor[data-text-form="phone"] { display: grid; }
|
|
67
78
|
.o-text-editor[data-text-form="phone"] .o-text-editor-country { gap: calc(var(--vk-spacing) * 0.75); }
|
|
@@ -24,10 +24,12 @@ export interface ToastOptions {
|
|
|
24
24
|
* turned into its result. */
|
|
25
25
|
duration?: number;
|
|
26
26
|
}
|
|
27
|
-
/** The words a toast draws of its own: Undo,
|
|
27
|
+
/** The words a toast draws of its own: Undo, its ×'s name, and the name of the region its toasts stand in (Base UI names it
|
|
28
|
+
* "Notifications" unless told). */
|
|
28
29
|
export type ToastWords = {
|
|
29
30
|
undo: string;
|
|
30
31
|
close: string;
|
|
32
|
+
region?: string;
|
|
31
33
|
};
|
|
32
34
|
/** Its words in English. */
|
|
33
35
|
export declare const TOAST_WORDS: ToastWords;
|
|
@@ -53,6 +55,8 @@ export interface ToastManager {
|
|
|
53
55
|
}
|
|
54
56
|
/** A manager of toasts to call from anywhere; give it to the Toast that shows them. */
|
|
55
57
|
export declare function createToastManager(words?: Partial<ToastWords>): ToastManager;
|
|
58
|
+
/** Whether a Toast stands round it, so useToast can be reached. */
|
|
59
|
+
export declare const useInToast: () => boolean;
|
|
56
60
|
/** Where toasts are made and where they rise: everything inside can show one (useToast), and they rise
|
|
57
61
|
* centred at the bottom of the screen, 16px up, at most 460px wide. `inside`: at the bottom of the
|
|
58
62
|
* element around it instead (a sample on a page that shows how it looks). `manager`: show the toasts a
|
|
@@ -9,7 +9,7 @@ import { Spinner } from "../spinner/spinner.js";
|
|
|
9
9
|
const glyph = (paths, className) => _jsx("svg", { className: className, 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)) });
|
|
10
10
|
const wrong = glyph(NOTICE_ICONS.danger, "o-toast-mark");
|
|
11
11
|
const X = ["M18 6l-12 12", "M6 6l12 12"];
|
|
12
|
-
export const TOAST_WORDS = { undo: "Undo", close: "Close" };
|
|
12
|
+
export const TOAST_WORDS = { undo: "Undo", close: "Close", region: "Notifications" };
|
|
13
13
|
function toastWait() {
|
|
14
14
|
if (typeof document === "undefined")
|
|
15
15
|
return 4000;
|
|
@@ -43,10 +43,12 @@ export function createToastManager(words) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
const Stacked = React.createContext(false);
|
|
46
|
+
const InToast = React.createContext(false);
|
|
47
|
+
export const useInToast = () => React.useContext(InToast);
|
|
46
48
|
const Said = React.createContext(TOAST_WORDS);
|
|
47
49
|
export function Toast({ inside = false, manager, stack = false, words, children }) {
|
|
48
50
|
const said = React.useMemo(() => ({ ...TOAST_WORDS, ...words }), [words]);
|
|
49
|
-
return _jsx(Said.Provider, { value: said, children: _jsx(Stacked.Provider, { value: stack, children: _jsxs(BaseToast.Provider, { toastManager: manager?.base, children: [children, _jsx(Viewport, { inside: inside, stack: stack })] }) }) });
|
|
51
|
+
return _jsx(InToast.Provider, { value: true, children: _jsx(Said.Provider, { value: said, children: _jsx(Stacked.Provider, { value: stack, children: _jsxs(BaseToast.Provider, { toastManager: manager?.base, children: [children, _jsx(Viewport, { inside: inside, stack: stack })] }) }) }) });
|
|
50
52
|
}
|
|
51
53
|
export function useToast() {
|
|
52
54
|
const m = BaseToast.useToastManager(), live = React.useRef(m.toasts), stack = React.useContext(Stacked), said = React.useContext(Said);
|
|
@@ -82,7 +84,7 @@ function Viewport({ inside, stack }) {
|
|
|
82
84
|
document.addEventListener("keydown", key);
|
|
83
85
|
return () => document.removeEventListener("keydown", key);
|
|
84
86
|
}, [toasts, close]);
|
|
85
|
-
return (_jsx(BaseToast.Viewport, { className: cx("o-toast-viewport", inside && "o-toast-viewport-inside"), ...(stack ? { "data-stack": "" } : {}), children: toasts.map((t) => (_jsxs(BaseToast.Root, { toast: t, className: "o-toast o-smooth o-smooth-ease", swipeDirection: "down", "data-kit": "toast", children: [_jsx(Mark, { type: t.type }), t.title ? _jsxs("span", { className: "o-toast-text", children: [_jsx(BaseToast.Title, { className: "o-toast-title" }), _jsx(BaseToast.Description, { className: "o-toast-words" })] }) : _jsx(BaseToast.Description, { className: "o-toast-words" }), _jsx(BaseToast.Action, { render: _jsx(Button, { kind: "text", size: "xs", className: "o-toast-act" }) }), t.data?.closable && _jsx(BaseToast.Close, { render: _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-toast-act o-toast-close", "aria-label": said.close, icon: glyph(X, "") }) })] }, t.id))) }));
|
|
87
|
+
return (_jsx(BaseToast.Viewport, { className: cx("o-toast-viewport", inside && "o-toast-viewport-inside"), "aria-label": said.region ?? TOAST_WORDS.region, ...(stack ? { "data-stack": "" } : {}), children: toasts.map((t) => (_jsxs(BaseToast.Root, { toast: t, className: "o-toast o-smooth o-smooth-ease", swipeDirection: "down", "data-kit": "toast", children: [_jsx(Mark, { type: t.type }), t.title ? _jsxs("span", { className: "o-toast-text", children: [_jsx(BaseToast.Title, { className: "o-toast-title" }), _jsx(BaseToast.Description, { className: "o-toast-words" })] }) : _jsx(BaseToast.Description, { className: "o-toast-words" }), _jsx(BaseToast.Action, { render: _jsx(Button, { kind: "text", size: "xs", className: "o-toast-act" }) }), t.data?.closable && _jsx(BaseToast.Close, { render: _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-toast-act o-toast-close", "aria-label": said.close, icon: glyph(X, "") }) })] }, t.id))) }));
|
|
86
88
|
}
|
|
87
89
|
function Mark({ type }) {
|
|
88
90
|
if (type === "working")
|
|
@@ -25,17 +25,22 @@ import { PICKER_PRIVATE, PICKER_TOKENS } from "./picker/tokens.js";
|
|
|
25
25
|
import { AVATAR_PRIVATE, AVATAR_TOKENS } from "./avatar/tokens.js";
|
|
26
26
|
import { POPUP_LINE_PRIVATE, POPUP_LINE_TOKENS } from "./popup-line/tokens.js";
|
|
27
27
|
import { PANE_PRIVATE, PANE_TOKENS } from "./pane/tokens.js";
|
|
28
|
+
import { TOOLBAR_BUTTON_PRIVATE, TOOLBAR_BUTTON_TOKENS } from "./toolbar-button/tokens.js";
|
|
28
29
|
import { RADIO_PRIVATE, RADIO_TOKENS } from "./radio/tokens.js";
|
|
29
30
|
import { SORT_EDITOR_PRIVATE, SORT_EDITOR_TOKENS } from "./sort-editor/tokens.js";
|
|
30
31
|
import { VIEWS_LIST_PRIVATE, VIEWS_LIST_TOKENS } from "./views-list/tokens.js";
|
|
31
32
|
import { FILTER_EDITOR_PRIVATE, FILTER_EDITOR_TOKENS } from "./filter-editor/tokens.js";
|
|
32
33
|
import { GROUP_EDITOR_PRIVATE, GROUP_EDITOR_TOKENS } from "./group-editor/tokens.js";
|
|
34
|
+
import { CUSTOMIZE_PRIVATE, CUSTOMIZE_TOKENS } from "./customize/tokens.js";
|
|
33
35
|
import { MODAL_PRIVATE, MODAL_TOKENS } from "./modal/tokens.js";
|
|
34
36
|
import { ALERT_DIALOG_PRIVATE, ALERT_DIALOG_TOKENS } from "./alert-dialog/tokens.js";
|
|
35
37
|
import { TOAST_PRIVATE, TOAST_TOKENS } from "./toast/tokens.js";
|
|
36
38
|
import { COLLAPSIBLE_PRIVATE, COLLAPSIBLE_TOKENS } from "./collapsible/tokens.js";
|
|
37
39
|
import { ALERT_PRIVATE, ALERT_TOKENS } from "./alert/tokens.js";
|
|
38
40
|
import { NOTICE_PRIVATE, NOTICE_TOKENS } from "./notice/tokens.js";
|
|
41
|
+
import { QUICK_FILTERS_PRIVATE, QUICK_FILTERS_TOKENS } from "./quick-filters/tokens.js";
|
|
42
|
+
import { TOOLBAR_PRIVATE, TOOLBAR_TOKENS } from "./toolbar/tokens.js";
|
|
43
|
+
import { BULK_BAR_PRIVATE, BULK_BAR_TOKENS } from "./bulk-bar/tokens.js";
|
|
39
44
|
import { TEXT_EDITOR_PRIVATE, TEXT_EDITOR_TOKENS } from "./text-editor/tokens.js";
|
|
40
45
|
import { DATE_EDITOR_PRIVATE, DATE_EDITOR_TOKENS } from "./date-editor/tokens.js";
|
|
41
46
|
import { COMPOUND_EDITOR_PRIVATE, COMPOUND_EDITOR_TOKENS } from "./compound-editor/tokens.js";
|
|
@@ -43,6 +48,10 @@ import { FLAG_PRIVATE, FLAG_TOKENS } from "./flag/tokens.js";
|
|
|
43
48
|
import { NUMBER_EDITOR_PRIVATE, NUMBER_EDITOR_TOKENS } from "./number-editor/tokens.js";
|
|
44
49
|
import { VALUES_EDITOR_PRIVATE, VALUES_EDITOR_TOKENS } from "./values-editor/tokens.js";
|
|
45
50
|
import { LINKS_EDITOR_PRIVATE, LINKS_EDITOR_TOKENS } from "./links-editor/tokens.js";
|
|
51
|
+
import { PRESS_PRIVATE, PRESS_TOKENS } from "./press/tokens.js";
|
|
52
|
+
import { CHOICE_PRIVATE, CHOICE_TOKENS } from "./choice/tokens.js";
|
|
53
|
+
import { TAG_FIELD_PRIVATE, TAG_FIELD_TOKENS } from "./tag-field/tokens.js";
|
|
54
|
+
import { SWITCH_ROW_PRIVATE, SWITCH_ROW_TOKENS } from "./switch-row/tokens.js";
|
|
46
55
|
const CONTROLS_OWN = {
|
|
47
56
|
button: { tokens: BUTTON_TOKENS, private: BUTTON_PRIVATE },
|
|
48
57
|
spinner: { tokens: SPINNER_TOKENS, private: SPINNER_PRIVATE },
|
|
@@ -71,17 +80,22 @@ const CONTROLS_OWN = {
|
|
|
71
80
|
picker: { tokens: PICKER_TOKENS, private: PICKER_PRIVATE },
|
|
72
81
|
avatar: { tokens: AVATAR_TOKENS, private: AVATAR_PRIVATE },
|
|
73
82
|
pane: { tokens: PANE_TOKENS, private: PANE_PRIVATE },
|
|
83
|
+
"toolbar-button": { tokens: TOOLBAR_BUTTON_TOKENS, private: TOOLBAR_BUTTON_PRIVATE },
|
|
74
84
|
radio: { tokens: RADIO_TOKENS, private: RADIO_PRIVATE },
|
|
75
85
|
"sort-editor": { tokens: SORT_EDITOR_TOKENS, private: SORT_EDITOR_PRIVATE },
|
|
76
86
|
"views-list": { tokens: VIEWS_LIST_TOKENS, private: VIEWS_LIST_PRIVATE },
|
|
77
87
|
"filter-editor": { tokens: FILTER_EDITOR_TOKENS, private: FILTER_EDITOR_PRIVATE },
|
|
78
88
|
"group-editor": { tokens: GROUP_EDITOR_TOKENS, private: GROUP_EDITOR_PRIVATE },
|
|
89
|
+
customize: { tokens: CUSTOMIZE_TOKENS, private: CUSTOMIZE_PRIVATE },
|
|
79
90
|
modal: { tokens: MODAL_TOKENS, private: MODAL_PRIVATE },
|
|
80
91
|
"alert-dialog": { tokens: ALERT_DIALOG_TOKENS, private: ALERT_DIALOG_PRIVATE },
|
|
81
92
|
toast: { tokens: TOAST_TOKENS, private: TOAST_PRIVATE },
|
|
82
93
|
collapsible: { tokens: COLLAPSIBLE_TOKENS, private: COLLAPSIBLE_PRIVATE },
|
|
83
94
|
alert: { tokens: ALERT_TOKENS, private: ALERT_PRIVATE },
|
|
84
95
|
notice: { tokens: NOTICE_TOKENS, private: NOTICE_PRIVATE },
|
|
96
|
+
"quick-filters": { tokens: QUICK_FILTERS_TOKENS, private: QUICK_FILTERS_PRIVATE },
|
|
97
|
+
toolbar: { tokens: TOOLBAR_TOKENS, private: TOOLBAR_PRIVATE },
|
|
98
|
+
"bulk-bar": { tokens: BULK_BAR_TOKENS, private: BULK_BAR_PRIVATE },
|
|
85
99
|
"text-editor": { tokens: TEXT_EDITOR_TOKENS, private: TEXT_EDITOR_PRIVATE },
|
|
86
100
|
"date-editor": { tokens: DATE_EDITOR_TOKENS, private: DATE_EDITOR_PRIVATE },
|
|
87
101
|
"compound-editor": { tokens: COMPOUND_EDITOR_TOKENS, private: COMPOUND_EDITOR_PRIVATE },
|
|
@@ -89,6 +103,10 @@ const CONTROLS_OWN = {
|
|
|
89
103
|
"number-editor": { tokens: NUMBER_EDITOR_TOKENS, private: NUMBER_EDITOR_PRIVATE },
|
|
90
104
|
"values-editor": { tokens: VALUES_EDITOR_TOKENS, private: VALUES_EDITOR_PRIVATE },
|
|
91
105
|
"links-editor": { tokens: LINKS_EDITOR_TOKENS, private: LINKS_EDITOR_PRIVATE },
|
|
106
|
+
press: { tokens: PRESS_TOKENS, private: PRESS_PRIVATE },
|
|
107
|
+
choice: { tokens: CHOICE_TOKENS, private: CHOICE_PRIVATE },
|
|
108
|
+
"tag-field": { tokens: TAG_FIELD_TOKENS, private: TAG_FIELD_PRIVATE },
|
|
109
|
+
"switch-row": { tokens: SWITCH_ROW_TOKENS, private: SWITCH_ROW_PRIVATE },
|
|
92
110
|
};
|
|
93
111
|
export const VK_CONTROL_TOKENS_BY_PIECE = Object.fromEntries(Object.entries(CONTROLS_OWN).map(([piece, own]) => [piece, own.tokens]));
|
|
94
112
|
export const VK_CONTROL_TOKENS = Object.entries(VK_CONTROL_TOKENS_BY_PIECE)
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** The keys of a line's items, from each one's key as React.Children.toArray hands it (`.$name` where its holder keyed it, a fragment's
|
|
2
|
+
* place before it, `.place` where not): its own where it has one, else its place; a key two items share, its place too. */
|
|
3
|
+
export declare function lineKeys(keys: (string | null)[], line: string): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function lineKeys(keys, line) {
|
|
2
|
+
const taken = new Set();
|
|
3
|
+
return keys.map((k, i) => {
|
|
4
|
+
const at = k?.indexOf("$") ?? -1, own = k != null && at >= 0 ? `${line}-$${k.slice(at + 1)}` : null;
|
|
5
|
+
if (own && !taken.has(own)) {
|
|
6
|
+
taken.add(own);
|
|
7
|
+
return own;
|
|
8
|
+
}
|
|
9
|
+
return own ? `${line}-${i}${k}` : `${line}-${i}`;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PieceLooks } from "../../looks/looks.js";
|
|
2
|
+
export type ToolbarOptionId = "search" | "words" | "sortfilter" | "settings" | "bar" | "lines" | "save" | "sortfilterat" | "add" | "views" | "tabs" | "quick" | "searchphone" | "sortfilterphone";
|
|
3
|
+
/** One value for every option. */
|
|
4
|
+
export type ToolbarPicks = Record<ToolbarOptionId, string>;
|
|
5
|
+
/** The Toolbar's options and looks. */
|
|
6
|
+
export declare const TOOLBAR_LOOKS: PieceLooks<ToolbarOptionId>;
|
|
7
|
+
/** The options worn round `el`, each from the nearest frame that picks it; outside any frame, or a value it lacks, its default. */
|
|
8
|
+
export declare function toolbarWornOf(el: Element | null): ToolbarPicks;
|
|
9
|
+
/** The attributes the Toolbar watches, so an option changed while it stands reaches it. */
|
|
10
|
+
export declare const TOOLBAR_ATTRS: string[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { lookWornOf } from "../../looks/looks.js";
|
|
2
|
+
const ATTIO = {
|
|
3
|
+
search: "button", words: "icon", sortfilter: "bar", settings: "beside", bar: "always", lines: "across", save: "bar", sortfilterat: "both",
|
|
4
|
+
add: "primary", views: "button", tabs: "ghost", quick: "none", searchphone: "button", sortfilterphone: "beside",
|
|
5
|
+
};
|
|
6
|
+
const OUTRIGHT = { ...ATTIO, words: "both", sortfilter: "right", bar: "added", quick: "button", sortfilterphone: "right" };
|
|
7
|
+
const DEFAULTS = OUTRIGHT;
|
|
8
|
+
const raw = [
|
|
9
|
+
{ id: "search", name: "The search", device: "desktop", values: [{ id: "button", name: "A button" }, { id: "input", name: "An input" }] },
|
|
10
|
+
{ id: "words", name: "Buttons on the right", device: "desktop", values: [{ id: "both", name: "Icon and word" }, { id: "icon", name: "Icon" }] },
|
|
11
|
+
{ id: "sortfilter", name: "Sort and filters", device: "desktop", unless: ["sortfilterat", "pane"], values: [{ id: "bar", name: "On the bar" }, { id: "right", name: "On the right" }] },
|
|
12
|
+
{ id: "settings", name: "View settings", device: "desktop", values: [{ id: "beside", name: "Beside the views" }, { id: "right", name: "On the right" }] },
|
|
13
|
+
{ id: "bar", name: "The filter bar", device: "desktop", unless: ["sortfilter", "bar"], values: [{ id: "always", name: "Always" }, { id: "added", name: "Once added" }] },
|
|
14
|
+
{ id: "lines", name: "Lines", device: "desktop", values: [{ id: "across", name: "Across" }, { id: "none", name: "None" }] },
|
|
15
|
+
{ id: "save", name: "Clear and Save", device: "desktop", unless: ["sortfilterat", "pane"], values: [{ id: "bar", name: "On the bar" }, { id: "settings", name: "In View settings" }] },
|
|
16
|
+
{ id: "sortfilterat", name: "Sort and filters in", values: [{ id: "bar", name: "On the bar" }, { id: "pane", name: "In the Pane" }, { id: "both", name: "Both" }] },
|
|
17
|
+
{ id: "add", name: "New", device: "desktop", kind: "list", values: [
|
|
18
|
+
{ id: "primary", name: "Primary, its word" }, { id: "primary-icon", name: "Primary, its icon" },
|
|
19
|
+
{ id: "outline", name: "Outlined, its word" }, { id: "outline-icon", name: "Outlined, its icon" },
|
|
20
|
+
{ id: "like", name: "Like the others, its word" }, { id: "like-icon", name: "Like the others, its icon" },
|
|
21
|
+
] },
|
|
22
|
+
{ id: "views", name: "The view switcher", device: "desktop", values: [{ id: "button", name: "One button" }, { id: "tabs", name: "Tabs" }] },
|
|
23
|
+
{ id: "tabs", name: "The tabs", device: "desktop", unless: ["views", "button"], values: [{ id: "ghost", name: "Ghost" }, { id: "bordered", name: "Bordered" }, { id: "filled", name: "Filled" }] },
|
|
24
|
+
{ id: "quick", name: "Quick filters", values: [{ id: "none", name: "None" }, { id: "button", name: "A button" }] },
|
|
25
|
+
{ id: "searchphone", name: "The search", device: "phone", values: [{ id: "button", name: "A button" }, { id: "line", name: "Its own line" }] },
|
|
26
|
+
{ id: "sortfilterphone", name: "Sort and filters", device: "phone", unless: ["sortfilterat", "pane"], values: [{ id: "beside", name: "Beside the views" }, { id: "right", name: "On the right" }] },
|
|
27
|
+
];
|
|
28
|
+
const options = raw.map((o) => ({ ...o, def: DEFAULTS[o.id], demo: false }));
|
|
29
|
+
const looks = [
|
|
30
|
+
{ id: "mihai", name: "Outright", picks: OUTRIGHT },
|
|
31
|
+
{ id: "attio", name: "Attio", picks: ATTIO },
|
|
32
|
+
{ id: "attio-right", name: "Attio, buttons on the right", picks: { ...ATTIO, search: "input", words: "both", sortfilter: "right", settings: "right", bar: "added", sortfilterphone: "right" } },
|
|
33
|
+
{ id: "portal", name: "The portal's", picks: { ...ATTIO, sortfilter: "right", settings: "right", bar: "added", lines: "none", save: "settings", views: "tabs", quick: "button", sortfilterphone: "right" } },
|
|
34
|
+
];
|
|
35
|
+
export const TOOLBAR_LOOKS = { id: "toolbar", name: "Toolbar", options, looks };
|
|
36
|
+
const IDS = options.map((o) => o.id);
|
|
37
|
+
export function toolbarWornOf(el) {
|
|
38
|
+
return lookWornOf(TOOLBAR_LOOKS, el, IDS);
|
|
39
|
+
}
|
|
40
|
+
export const TOOLBAR_ATTRS = IDS.map((id) => `data-toolbar-${id}`);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const TOOLBAR_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-border-width";
|
|
11
|
+
readonly kind: "size";
|
|
12
|
+
readonly outright: "--border-width";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-duration-base";
|
|
15
|
+
readonly kind: "motion";
|
|
16
|
+
readonly outright: "--duration-base";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-ease-out";
|
|
19
|
+
readonly kind: "motion";
|
|
20
|
+
readonly outright: "--ease-out";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-spacing";
|
|
23
|
+
readonly kind: "size";
|
|
24
|
+
readonly outright: "--spacing";
|
|
25
|
+
}];
|
|
26
|
+
/** The Toolbar's own machinery: how far apart a line's items stand (`--toolbar-spacing`), the room at each line's sides
|
|
27
|
+
* (`--toolbar-inset`). */
|
|
28
|
+
export declare const TOOLBAR_PRIVATE: readonly ["--toolbar-"];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const TOOLBAR_TOKENS = [
|
|
2
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
3
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
4
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
5
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
6
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
7
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
8
|
+
];
|
|
9
|
+
export const TOOLBAR_PRIVATE = ["--toolbar-"];
|