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,89 @@
|
|
|
1
|
+
/** What is held: each field's held values, by the field's id. A field holding nothing has no key. */
|
|
2
|
+
export type QuickHolds = Record<string, string[]>;
|
|
3
|
+
/** One hold in all, moved by each press (the default, the portal's), or several, each press adding one or letting it go. */
|
|
4
|
+
export type QuickHolding = "one" | "several";
|
|
5
|
+
/** What a record holds in a field: one value, several, or none. */
|
|
6
|
+
type ValueOf<T> = (record: T, field: string) => string | string[] | null | undefined;
|
|
7
|
+
/** The field's held values; none, []. */
|
|
8
|
+
export declare const heldIn: (holds: QuickHolds, field: string) => string[];
|
|
9
|
+
/** How many values are held, every field's. */
|
|
10
|
+
export declare const holdCount: (holds: QuickHolds) => number;
|
|
11
|
+
/** What is held after a press on `value` in `field`. One: the value alone held, or nothing where it was the one held. Several:
|
|
12
|
+
* the value let go where held, else added at its field's end; the other fields kept. */
|
|
13
|
+
export declare function holdAfter(holds: QuickHolds, field: string, value: string, holding?: QuickHolding): QuickHolds;
|
|
14
|
+
/** A value a field offers: its value, its name, its mark (a stage's, a face) and how many records hold it. */
|
|
15
|
+
export interface QuickValue {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
mark?: QuickMark;
|
|
19
|
+
count?: number;
|
|
20
|
+
}
|
|
21
|
+
/** A value's mark: a stage's Status glyph, or a person's or a company's face. */
|
|
22
|
+
export type QuickMark = {
|
|
23
|
+
status: "start" | "between" | "won" | "lost";
|
|
24
|
+
quarters?: 1 | 2 | 3;
|
|
25
|
+
} | {
|
|
26
|
+
avatar: "person" | "company";
|
|
27
|
+
id?: string;
|
|
28
|
+
};
|
|
29
|
+
/** A field's values past this many show a search over them (round 9: "past a handful"; the kit's lists search past 8). */
|
|
30
|
+
export declare const SEARCH_PAST = 8;
|
|
31
|
+
/** The values a search finds, by their names: those that start with what is typed first, then those that hold it; nothing typed,
|
|
32
|
+
* every value as it stood. */
|
|
33
|
+
export declare function valuesFound<T extends {
|
|
34
|
+
label: string;
|
|
35
|
+
}>(values: T[], query: string): T[];
|
|
36
|
+
/** The values as the list shows them. Counts on: the most first, ties in the field's own order, any with no count last. Off: the
|
|
37
|
+
* field's own order, with no count, whatever its holder hands. The field's own values are left as they were. */
|
|
38
|
+
export declare function valuesShown<T extends {
|
|
39
|
+
count?: number;
|
|
40
|
+
}>(values: T[], counts: boolean): T[];
|
|
41
|
+
/** The field open first: the first holding a value, else the first; none, "". */
|
|
42
|
+
export declare function firstOpen(fields: {
|
|
43
|
+
id: string;
|
|
44
|
+
}[], holds: QuickHolds): string;
|
|
45
|
+
/** The records a hold leaves: for every field holding values, the record's value, or one of its values, is held. No holds, all. */
|
|
46
|
+
export declare function narrowed<T>(records: T[], holds: QuickHolds, valueOf: ValueOf<T>): T[];
|
|
47
|
+
/** How many of `records` hold each value of `field`: a record with several counts once for each; none counts nothing. Handed the
|
|
48
|
+
* view's records under its filters and the search, never narrowed by a hold. */
|
|
49
|
+
export declare function countValues<T>(records: T[], field: string, valueOf: ValueOf<T>): Record<string, number>;
|
|
50
|
+
/** A held value, named: its field, its value, its name (the value's label, or its field's name where the field doesn't offer it)
|
|
51
|
+
* and its mark. */
|
|
52
|
+
export interface QuickHeldName {
|
|
53
|
+
field: string;
|
|
54
|
+
value: string;
|
|
55
|
+
name: string;
|
|
56
|
+
mark?: QuickMark;
|
|
57
|
+
}
|
|
58
|
+
/** Every held value, named (KIT-833: the reminder): in the fields' order, then each field's in the order it was held. A value is
|
|
59
|
+
* named by its label, never its key, so a hold kept as keys alone (after a reload) still reads as words; one its field no longer
|
|
60
|
+
* offers is named by the field. A field the holder doesn't hand is left out: there is nothing to name it by. */
|
|
61
|
+
export declare function heldNames(fields: {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
values: QuickValue[];
|
|
65
|
+
}[], holds: QuickHolds): QuickHeldName[];
|
|
66
|
+
/** The reminder's words: the first `shown` names, each once, ", " between; `more`, how many other names there are. */
|
|
67
|
+
export declare function reminderWords(names: string[], shown?: number): {
|
|
68
|
+
words: string;
|
|
69
|
+
more: number;
|
|
70
|
+
};
|
|
71
|
+
/** On a phone, whether a press closes the Sheet: with one hold at a time it finishes the job; with several, never. */
|
|
72
|
+
export declare const pressCloses: (holding: QuickHolding) => boolean;
|
|
73
|
+
/** The rules as one name, for the door (`viewkitjs/views/controls`): the panels' own quick filters' rules already hold most of
|
|
74
|
+
* these names there, with ViewKit's hold's shape, and one package holds no two public names alike. */
|
|
75
|
+
export declare const QUICK_FILTERS_RULES: {
|
|
76
|
+
readonly heldIn: (holds: QuickHolds, field: string) => string[];
|
|
77
|
+
readonly holdCount: (holds: QuickHolds) => number;
|
|
78
|
+
readonly holdAfter: typeof holdAfter;
|
|
79
|
+
readonly SEARCH_PAST: 8;
|
|
80
|
+
readonly valuesFound: typeof valuesFound;
|
|
81
|
+
readonly valuesShown: typeof valuesShown;
|
|
82
|
+
readonly firstOpen: typeof firstOpen;
|
|
83
|
+
readonly narrowed: typeof narrowed;
|
|
84
|
+
readonly countValues: typeof countValues;
|
|
85
|
+
readonly heldNames: typeof heldNames;
|
|
86
|
+
readonly reminderWords: typeof reminderWords;
|
|
87
|
+
readonly pressCloses: (holding: QuickHolding) => boolean;
|
|
88
|
+
};
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const asList = (v) => (v == null ? [] : Array.isArray(v) ? v : [v]);
|
|
2
|
+
export const heldIn = (holds, field) => holds[field] ?? [];
|
|
3
|
+
export const holdCount = (holds) => Object.values(holds).reduce((n, v) => n + v.length, 0);
|
|
4
|
+
export function holdAfter(holds, field, value, holding = "one") {
|
|
5
|
+
const now = heldIn(holds, field);
|
|
6
|
+
if (holding === "one")
|
|
7
|
+
return holdCount(holds) === 1 && now[0] === value ? {} : { [field]: [value] };
|
|
8
|
+
const { [field]: _, ...rest } = holds, next = now.includes(value) ? now.filter((v) => v !== value) : [...now, value];
|
|
9
|
+
return next.length ? { ...rest, [field]: next } : rest;
|
|
10
|
+
}
|
|
11
|
+
export const SEARCH_PAST = 8;
|
|
12
|
+
const fold = (s) => s.normalize("NFD").replace(/\p{M}/gu, "").trim().toLowerCase();
|
|
13
|
+
export function valuesFound(values, query) {
|
|
14
|
+
const q = fold(query);
|
|
15
|
+
if (!q)
|
|
16
|
+
return values;
|
|
17
|
+
const hold = values.filter((v) => fold(v.label).includes(q));
|
|
18
|
+
return [...hold.filter((v) => fold(v.label).startsWith(q)), ...hold.filter((v) => !fold(v.label).startsWith(q))];
|
|
19
|
+
}
|
|
20
|
+
export function valuesShown(values, counts) {
|
|
21
|
+
if (!counts)
|
|
22
|
+
return values.map(({ count: _, ...item }) => item);
|
|
23
|
+
return values.map((item, i) => ({ item, i })).sort((a, b) => (b.item.count ?? -1) - (a.item.count ?? -1) || a.i - b.i).map((x) => x.item);
|
|
24
|
+
}
|
|
25
|
+
export function firstOpen(fields, holds) {
|
|
26
|
+
return (fields.find((f) => heldIn(holds, f.id).length) ?? fields[0])?.id ?? "";
|
|
27
|
+
}
|
|
28
|
+
export function narrowed(records, holds, valueOf) {
|
|
29
|
+
const fields = Object.entries(holds).filter(([, v]) => v.length);
|
|
30
|
+
if (!fields.length)
|
|
31
|
+
return records;
|
|
32
|
+
return records.filter((r) => fields.every(([field, held]) => asList(valueOf(r, field)).some((v) => held.includes(v))));
|
|
33
|
+
}
|
|
34
|
+
export function countValues(records, field, valueOf) {
|
|
35
|
+
const counts = {};
|
|
36
|
+
for (const r of records)
|
|
37
|
+
for (const v of new Set(asList(valueOf(r, field))))
|
|
38
|
+
counts[v] = (counts[v] ?? 0) + 1;
|
|
39
|
+
return counts;
|
|
40
|
+
}
|
|
41
|
+
export function heldNames(fields, holds) {
|
|
42
|
+
return fields.flatMap((f) => heldIn(holds, f.id).map((value) => {
|
|
43
|
+
const v = f.values.find((x) => x.value === value);
|
|
44
|
+
return v ? { field: f.id, value, name: v.label, ...(v.mark ? { mark: v.mark } : {}) } : { field: f.id, value, name: f.name };
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
export function reminderWords(names, shown = 2) {
|
|
48
|
+
const once = [...new Set(names)];
|
|
49
|
+
return { words: once.slice(0, shown).join(", "), more: Math.max(0, once.length - shown) };
|
|
50
|
+
}
|
|
51
|
+
export const pressCloses = (holding) => holding === "one";
|
|
52
|
+
export const QUICK_FILTERS_RULES = { heldIn, holdCount, holdAfter, SEARCH_PAST, valuesFound, valuesShown, firstOpen, narrowed, countValues, heldNames, reminderWords, pressCloses };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export declare const QUICK_FILTERS_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-border";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--border";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-border-brand";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--border-focused";
|
|
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-fg";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--text";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-fg-disabled";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--text-disabled";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-fg-subtle";
|
|
31
|
+
readonly kind: "colour";
|
|
32
|
+
readonly outright: "--text-subtle";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-fg-subtlest";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--text-subtlest";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-focus-offset";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--focus-offset";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-focus-width";
|
|
43
|
+
readonly kind: "size";
|
|
44
|
+
readonly outright: "--focus-width";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-font-size-base";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--text-base";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-font-size-sm";
|
|
51
|
+
readonly kind: "size";
|
|
52
|
+
readonly outright: "--text-sm";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-font-size-xs";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--text-xs";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-font-weight-medium";
|
|
59
|
+
readonly kind: "size";
|
|
60
|
+
readonly outright: "--font-weight-medium";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-layer-sticky";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--layer-sticky";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-line-height-base";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--text-base--line-height";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-line-height-sm";
|
|
71
|
+
readonly kind: "size";
|
|
72
|
+
readonly outright: "--text-sm--line-height";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-overlay";
|
|
75
|
+
readonly kind: "colour";
|
|
76
|
+
readonly outright: "--surface-overlay";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-overlay-card";
|
|
79
|
+
readonly kind: "colour";
|
|
80
|
+
readonly outright: "--surface-overlay-card";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-overlay-card-pressed";
|
|
83
|
+
readonly kind: "colour";
|
|
84
|
+
readonly outright: "--surface-overlay-card-pressed";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-overlay-hovered";
|
|
87
|
+
readonly kind: "colour";
|
|
88
|
+
readonly outright: "--surface-overlay-hovered";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-overlay-pressed";
|
|
91
|
+
readonly kind: "colour";
|
|
92
|
+
readonly outright: "--surface-overlay-pressed";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "--vk-radius-full";
|
|
95
|
+
readonly kind: "size";
|
|
96
|
+
readonly outright: "--radius-full";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-radius-lg";
|
|
99
|
+
readonly kind: "size";
|
|
100
|
+
readonly outright: "--radius-lg";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "--vk-shadow-menu";
|
|
103
|
+
readonly kind: "shadow";
|
|
104
|
+
readonly outright: "--shadow-menu";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "--vk-spacing";
|
|
107
|
+
readonly kind: "size";
|
|
108
|
+
readonly outright: "--spacing";
|
|
109
|
+
}];
|
|
110
|
+
/** The reminder's own machinery (`--quick-filters-reminder-*`, `--quick-filters-room`), and the phone's safe area it stands above,
|
|
111
|
+
* as the Sheet reads it. */
|
|
112
|
+
export declare const QUICK_FILTERS_PRIVATE: readonly ["--quick-filters-", "--safe-area-"];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const QUICK_FILTERS_TOKENS = [
|
|
2
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
3
|
+
{ name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
|
|
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-fg", kind: "colour", outright: "--text" },
|
|
8
|
+
{ name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
|
|
9
|
+
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
10
|
+
{ name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
|
|
11
|
+
{ name: "--vk-focus-offset", kind: "size", outright: "--focus-offset" },
|
|
12
|
+
{ name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
|
|
13
|
+
{ name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
|
|
14
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
15
|
+
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
16
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
17
|
+
{ name: "--vk-layer-sticky", kind: "size", outright: "--layer-sticky" },
|
|
18
|
+
{ name: "--vk-line-height-base", kind: "size", outright: "--text-base--line-height" },
|
|
19
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
20
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
21
|
+
{ name: "--vk-overlay-card", kind: "colour", outright: "--surface-overlay-card" },
|
|
22
|
+
{ name: "--vk-overlay-card-pressed", kind: "colour", outright: "--surface-overlay-card-pressed" },
|
|
23
|
+
{ name: "--vk-overlay-hovered", kind: "colour", outright: "--surface-overlay-hovered" },
|
|
24
|
+
{ name: "--vk-overlay-pressed", kind: "colour", outright: "--surface-overlay-pressed" },
|
|
25
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
26
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
27
|
+
{ name: "--vk-shadow-menu", kind: "shadow", outright: "--shadow-menu" },
|
|
28
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
29
|
+
];
|
|
30
|
+
export const QUICK_FILTERS_PRIVATE = ["--quick-filters-", "--safe-area-"];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface QuickFiltersWords {
|
|
2
|
+
/** The strip's name to a screen reader ("Fields"). */
|
|
3
|
+
fields: string;
|
|
4
|
+
/** A field's search, where the field hands no words of its own ("Search Stage"). */
|
|
5
|
+
search: (field: string) => string;
|
|
6
|
+
/** What a held value says before its count ("Clear filter"). */
|
|
7
|
+
clear: string;
|
|
8
|
+
/** What a search that finds nothing says ("Nothing matches."). */
|
|
9
|
+
none: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const QUICK_FILTERS_WORDS: QuickFiltersWords;
|
|
12
|
+
/** The words handed, each left out the English. */
|
|
13
|
+
export declare const quickFiltersWords: (given?: Partial<QuickFiltersWords>) => QuickFiltersWords;
|
|
14
|
+
/** The reminder's words (QuickFiltersReminderControl): its name, its press's name over the held values' names, and its ✕. */
|
|
15
|
+
export interface QuickFiltersReminderWords {
|
|
16
|
+
/** Its name to a screen reader ("Quick filters held"). */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Its press's name, over the held values' names joined ("Quick filters: Won, Lost"). */
|
|
19
|
+
names: (names: string) => string;
|
|
20
|
+
/** Its ✕, letting every hold go ("Clear quick filters"). */
|
|
21
|
+
clear: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const QUICK_FILTERS_REMINDER_WORDS: QuickFiltersReminderWords;
|
|
24
|
+
/** The reminder's words handed, each left out the English. */
|
|
25
|
+
export declare const quickFiltersReminderWords: (given?: Partial<QuickFiltersReminderWords>) => QuickFiltersReminderWords;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const QUICK_FILTERS_WORDS = {
|
|
2
|
+
fields: "Fields",
|
|
3
|
+
search: (field) => `Search ${field}`,
|
|
4
|
+
clear: "Clear filter",
|
|
5
|
+
none: "Nothing matches.",
|
|
6
|
+
};
|
|
7
|
+
export const quickFiltersWords = (given) => given ? { ...QUICK_FILTERS_WORDS, ...Object.fromEntries(Object.entries(given).filter(([, w]) => w !== undefined)) } : QUICK_FILTERS_WORDS;
|
|
8
|
+
export const QUICK_FILTERS_REMINDER_WORDS = {
|
|
9
|
+
label: "Quick filters held",
|
|
10
|
+
names: (names) => `Quick filters: ${names}`,
|
|
11
|
+
clear: "Clear quick filters",
|
|
12
|
+
};
|
|
13
|
+
export const quickFiltersReminderWords = (given) => given ? { ...QUICK_FILTERS_REMINDER_WORDS, ...Object.fromEntries(Object.entries(given).filter(([, w]) => w !== undefined)) } : QUICK_FILTERS_REMINDER_WORDS;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* Quick filters: a body (the Outright kit's, KIT-684 and KIT-833; ViewKit's since VK-724). Every value it draws with is a name
|
|
2
|
+
ViewKit's controls read (docs/controls/quick-filters.md); this file lays out its own parts, as the toolbar's canvas draws them
|
|
3
|
+
(round 9's .facets, .srch and .qr): its top (the strip, then the search), the open field's values, and the phone's form of the
|
|
4
|
+
same. The strip is the Toggle group and the search the Input, each drawn by its own file. A held value is data-held on its row,
|
|
5
|
+
on a neutral ground; while its field holds one, the list is data-quiet and its other values go quiet. The rules sit in the
|
|
6
|
+
components layer. */
|
|
7
|
+
@layer components {
|
|
8
|
+
|
|
9
|
+
/* The strip: three across, each pill as wide as the others; over the Toggle group's own row (two classes, so it holds whichever
|
|
10
|
+
stylesheet comes last). */
|
|
11
|
+
.o-quick-filters-top > .o-quick-filters-strip { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
12
|
+
|
|
13
|
+
/* The body: its top (the strip, then the search), then the values, 8 apart. The values scroll while the top stays put: in a box of
|
|
14
|
+
their own where the Pane is as tall as the list, and under the top, pinned on the Pane's ground, where it fits what it holds (its
|
|
15
|
+
body then has no height of its own to fill, and scrolls). */
|
|
16
|
+
.o-quick-filters { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--vk-fg); }
|
|
17
|
+
.o-quick-filters-top {
|
|
18
|
+
position: sticky; top: 0; z-index: 1; flex: none; display: flex; flex-direction: column; gap: calc(var(--vk-spacing) * 2);
|
|
19
|
+
padding-bottom: calc(var(--vk-spacing) * 2); background-color: var(--vk-overlay);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* The values: rows 40 high, 12 in, the list's corners, 1 apart; under the pointer the overlay's hover. */
|
|
23
|
+
.o-quick-filters-values { display: flex; flex-direction: column; gap: var(--vk-border-width); flex: 1 1 auto; min-height: 0; overflow-y: auto; outline: none; }
|
|
24
|
+
.o-quick-filters-value {
|
|
25
|
+
flex: none; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2.5); height: calc(var(--vk-spacing) * 10); padding: 0 calc(var(--vk-spacing) * 3);
|
|
26
|
+
border-radius: var(--vk-radius-lg); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg);
|
|
27
|
+
cursor: pointer; user-select: none; outline: none;
|
|
28
|
+
}
|
|
29
|
+
@media (hover: hover) { .o-quick-filters-value:hover { background-color: var(--vk-overlay-hovered); } }
|
|
30
|
+
.o-quick-filters-value:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: calc(-1 * var(--vk-focus-width)); }
|
|
31
|
+
.o-quick-filters-mark { flex: none; display: inline-flex; align-items: center; }
|
|
32
|
+
.o-quick-filters-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
33
|
+
.o-quick-filters-count { flex: none; font-size: var(--vk-font-size-xs); color: var(--vk-fg-subtlest); font-variant-numeric: tabular-nums; }
|
|
34
|
+
.o-quick-filters-clear { flex: none; font-size: var(--vk-font-size-xs); color: var(--vk-fg-subtle); }
|
|
35
|
+
|
|
36
|
+
/* A search that finds nothing: the Picker's words where the values stand, drawn as its message is (.o-picker-message), centred. */
|
|
37
|
+
.o-quick-filters-none {
|
|
38
|
+
flex: none; margin: 0; padding: calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 2); text-align: center;
|
|
39
|
+
font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg-subtle);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Held: the overlay's card ground, a very subtle grey, never the brand (Mihai, 19 Nov 2026; KIT-778); its name at medium weight,
|
|
43
|
+
Clear filter before its count. Under the pointer a touch stronger, the card's pressed step: the overlay's own hover, pressed and
|
|
44
|
+
selected are one grey in dark, so this pair is the one a touch apart in both themes. */
|
|
45
|
+
.o-quick-filters-value[data-held] { background-color: var(--vk-overlay-card); }
|
|
46
|
+
.o-quick-filters-value[data-held] .o-quick-filters-name { font-weight: var(--vk-font-weight-medium); }
|
|
47
|
+
@media (hover: hover) { .o-quick-filters-value[data-held]:hover { background-color: var(--vk-overlay-card-pressed); } }
|
|
48
|
+
|
|
49
|
+
/* While its field holds a value, the others go quiet: their names and their counts. */
|
|
50
|
+
.o-quick-filters-values[data-quiet] .o-quick-filters-value:not([data-held]) .o-quick-filters-name { color: var(--vk-fg-subtlest); }
|
|
51
|
+
.o-quick-filters-values[data-quiet] .o-quick-filters-value:not([data-held]) .o-quick-filters-count { color: var(--vk-fg-disabled); }
|
|
52
|
+
|
|
53
|
+
/* On a phone (KIT-833): the same body in the full Sheet, a step up. The top 12 apart and 12 over the values; a value's row 44 high
|
|
54
|
+
in the phone's words, its count and Clear filter a size under them. No pointer to hover with: a press grounds its row while the
|
|
55
|
+
finger is on it, the computer's hover pair (the overlay's hover; held, the card's pressed step). The strip's pills and the search
|
|
56
|
+
take their phone sizes in the body (quick-filters.tsx). */
|
|
57
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-top { gap: calc(var(--vk-spacing) * 3); padding-bottom: calc(var(--vk-spacing) * 3); }
|
|
58
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-value {
|
|
59
|
+
height: calc(var(--vk-spacing) * 11); font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base));
|
|
60
|
+
}
|
|
61
|
+
.o-quick-filters[data-form="phone"] :is(.o-quick-filters-count, .o-quick-filters-clear) { font-size: var(--vk-font-size-sm); }
|
|
62
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-value:active { background-color: var(--vk-overlay-hovered); }
|
|
63
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-value[data-held]:active { background-color: var(--vk-overlay-card-pressed); }
|
|
64
|
+
|
|
65
|
+
/* The reminder (the Outright kit's, KIT-833; ViewKit's since VK-858; reminder.tsx): on a phone, what says a hold stands while quick filters are closed, the bulk bar's pill's
|
|
66
|
+
surface in its place (bulk-bar.css), at the centre of its holder's foot, its holder being the list's placed box, its parent.
|
|
67
|
+
Every value a token:
|
|
68
|
+
|
|
69
|
+
.o-quick-filters-reminder the pill; data-shown while something held is named, else gone (display none, after its going)
|
|
70
|
+
.o-quick-filters-reminder-words its own press: the first held value's mark and the names, which end in "…"
|
|
71
|
+
.o-quick-filters-reminder-more "+N", the names not shown
|
|
72
|
+
--quick-filters-reminder-bottom how far above the holder's foot it stands (the phone's own foot, or 16)
|
|
73
|
+
--quick-filters-reminder-height how tall it is (52, the pill's)
|
|
74
|
+
--quick-filters-room the room it takes at its holder's foot, handed to the holder while it is shown (none when it
|
|
75
|
+
isn't, or while the bulk bar shows there): a list that scrolls in the holder pads its foot by
|
|
76
|
+
it, and New's + stands on it, rising above the reminder */
|
|
77
|
+
:is(.o-quick-filters-reminder), :has(> .o-quick-filters-reminder) {
|
|
78
|
+
--quick-filters-reminder-bottom: max(var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)), calc(var(--vk-spacing) * 4));
|
|
79
|
+
--quick-filters-reminder-height: calc(var(--vk-spacing) * 13);
|
|
80
|
+
}
|
|
81
|
+
:has(> .o-quick-filters-reminder) { --quick-filters-room: 0px; }
|
|
82
|
+
:has(> .o-quick-filters-reminder[data-shown]) { --quick-filters-room: calc(var(--quick-filters-reminder-bottom) + var(--quick-filters-reminder-height) + var(--vk-spacing) * 2); }
|
|
83
|
+
/* While the bulk bar shows in the same list, it steps aside and gives its room back (after the rule above, which it outweighs by
|
|
84
|
+
order): two pills at a list's foot is one too many, and the bar is what the picked rows need. */
|
|
85
|
+
:has(> .o-bulk-bar[data-shown]) { --quick-filters-room: 0px; }
|
|
86
|
+
:has(> .o-bulk-bar[data-shown]) > .o-quick-filters-reminder { display: none; opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); transition: none; }
|
|
87
|
+
|
|
88
|
+
.o-quick-filters-reminder {
|
|
89
|
+
position: absolute; z-index: var(--vk-layer-sticky); left: 50%; bottom: var(--quick-filters-reminder-bottom); translate: -50% 0;
|
|
90
|
+
display: flex; align-items: center; box-sizing: border-box; width: max-content; height: var(--quick-filters-reminder-height); max-width: calc(100% - var(--vk-spacing) * 8);
|
|
91
|
+
padding-inline: calc(var(--vk-spacing) * 1.5); border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-full);
|
|
92
|
+
background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-menu); color: var(--vk-fg); white-space: nowrap; opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
.o-quick-filters-reminder > .o-toolbar { min-width: 0; }
|
|
95
|
+
.o-quick-filters-reminder:not([data-shown]) { display: none; opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); }
|
|
96
|
+
/* It comes up from just under its place and goes back down, as the bulk bar does. Still where a person asks for less motion. */
|
|
97
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
98
|
+
.o-quick-filters-reminder {
|
|
99
|
+
transition: opacity var(--vk-duration-base) var(--vk-ease-out), translate var(--vk-duration-base) var(--vk-ease-out), display var(--vk-duration-base) allow-discrete;
|
|
100
|
+
@starting-style { opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Its own press: round, 44 high, no ground at rest; under the pointer the overlay's hover, pressed its pressed step. */
|
|
105
|
+
.o-quick-filters-reminder-words {
|
|
106
|
+
display: inline-flex; flex: 0 1 auto; align-items: center; gap: calc(var(--vk-spacing) * 2); box-sizing: border-box; min-width: 0;
|
|
107
|
+
height: calc(var(--vk-spacing) * 11); margin: 0; padding-inline: calc(var(--vk-spacing) * 3); border: 0; border-radius: var(--vk-radius-full);
|
|
108
|
+
background-color: transparent; color: var(--vk-fg); font: inherit; font-size: var(--vk-font-size-base); line-height: var(--vk-line-height-base);
|
|
109
|
+
white-space: nowrap; cursor: pointer;
|
|
110
|
+
}
|
|
111
|
+
/* In the Toolbar, its names give way before its ✕ does, over the Toolbar's flex: none on what a line holds (VK-860). */
|
|
112
|
+
.o-toolbar-line > .o-quick-filters-reminder-words { flex: 0 1 auto; }
|
|
113
|
+
.o-quick-filters-reminder-words > span:not(.o-quick-filters-mark, .o-quick-filters-reminder-more) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
114
|
+
@media (hover: hover) { .o-quick-filters-reminder-words:hover { background-color: var(--vk-overlay-hovered); } }
|
|
115
|
+
.o-quick-filters-reminder-words:active { background-color: var(--vk-overlay-pressed); }
|
|
116
|
+
.o-quick-filters-reminder-words:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
|
|
117
|
+
.o-quick-filters-reminder-more { flex: none; color: var(--vk-fg-subtle); font-variant-numeric: tabular-nums; }
|
|
118
|
+
}
|
|
@@ -10,8 +10,11 @@ export declare const SheetClose: ({ children }: {
|
|
|
10
10
|
children: React.ReactElement;
|
|
11
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export interface SheetHeadProps {
|
|
13
|
-
/** What it is. */
|
|
14
|
-
title:
|
|
13
|
+
/** What it is: words, or words with a mark beside them. */
|
|
14
|
+
title: React.ReactNode;
|
|
15
|
+
/** Its name to screen readers where the title says it otherwise (a mark beside the words, other words): the title is what
|
|
16
|
+
* names the sheet, so this names the title. */
|
|
17
|
+
titleLabel?: string;
|
|
15
18
|
/** Where its title stands, which each sheet chooses: centred, or at the left. */
|
|
16
19
|
titleAt?: "center" | "left";
|
|
17
20
|
/** A second line under the title, quieter. */
|
|
@@ -46,7 +49,7 @@ export declare function SheetButton({ className, kind, children, ...props }: {
|
|
|
46
49
|
/** Its head, one of its kinds: the one header (HeaderBar), under its handle. Glass has on its left the X, or Back in its place, and on its right one action, or two, as the phone header's Two buttons says.
|
|
47
50
|
* Flat has Back on its left, if there is one, and its action and the X on its right. Or Decide, a button either side of its
|
|
48
51
|
* title. A sheet with no head is its handle alone. */
|
|
49
|
-
export declare function SheetHead({ title, titleAt, description, close, onBack, left, right, children, words }: SheetHeadProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function SheetHead({ title, titleLabel, titleAt, description, close, onBack, left, right, children, words }: SheetHeadProps): import("react/jsx-runtime").JSX.Element;
|
|
50
53
|
/** Its foot: stays at the foot of the screen at every stop, and leaves with the sheet. */
|
|
51
54
|
export declare const SheetFoot: ({ children }: {
|
|
52
55
|
children: React.ReactNode;
|
|
@@ -96,8 +99,10 @@ export interface SheetProps {
|
|
|
96
99
|
standing?: boolean;
|
|
97
100
|
/** Where focus goes once it shuts. Nothing found, or left out, focus goes back to what opened it. */
|
|
98
101
|
finalFocus?: () => HTMLElement | null;
|
|
102
|
+
/** A class on the sheet itself, after its own. */
|
|
103
|
+
className?: string;
|
|
99
104
|
/** Its head and its body. */
|
|
100
105
|
children: React.ReactNode;
|
|
101
106
|
}
|
|
102
107
|
/** What rises from the bottom of the phone, in a form, at stops. What it holds is poured in. */
|
|
103
|
-
export declare function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form, stops, openAt, stop, onStopChange, mark: marked, container, standing: stands, finalFocus, children }: SheetProps): import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
export declare function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form, stops, openAt, stop, onStopChange, mark: marked, container, standing: stands, finalFocus, className, children }: SheetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,10 +20,10 @@ export const SheetClose = ({ children }) => _jsx(Base.Close, { render: children
|
|
|
20
20
|
export function SheetButton({ className, kind, children, ...props }) {
|
|
21
21
|
return _jsxs(_Fragment, { children: [_jsx(GlassButton, { ...props, kind: kind, className: cx("o-sheet-glass", className), children: children }), _jsx(Button, { ...props, kind: kind ?? "quiet", shape: children == null ? "icon" : undefined, className: cx("o-sheet-plain", className), children: children })] });
|
|
22
22
|
}
|
|
23
|
-
export function SheetHead({ title, titleAt, description, close = true, onBack, left, right, children, words }) {
|
|
23
|
+
export function SheetHead({ title, titleLabel, titleAt, description, close = true, onBack, left, right, children, words }) {
|
|
24
24
|
const closeWord = words?.close ?? "Close", backWord = words?.back ?? "Back";
|
|
25
25
|
const sides = left != null || right != null;
|
|
26
|
-
return (_jsx("div", { className: "o-sheet-head", children: _jsx(HeaderBar, { className: "o-sheet-row", titleAt: titleAt, "data-sides": sides ? "" : undefined, left: sides ? left : onBack ? _jsx(SheetButton, { "aria-label": backWord, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack }) : close && _jsx(Base.Close, { render: _jsx(GlassButton, { "aria-label": closeWord, className: "o-sheet-glass", icon: glyph(X) }) }), title: _jsx(Base.Title, { className: "o-sheet-title", children: title }), description: description, descriptionRender: _jsx(Base.Description, {}), right: sides ? right : _jsxs(_Fragment, { children: [children, close && _jsx(Base.Close, { render: _jsx(Button, { kind: "quiet", shape: "icon", "aria-label": closeWord, className: "o-sheet-plain", icon: glyph(X) }) })] }) }) }));
|
|
26
|
+
return (_jsx("div", { className: "o-sheet-head", children: _jsx(HeaderBar, { className: "o-sheet-row", titleAt: titleAt, "data-sides": sides ? "" : undefined, left: sides ? left : onBack ? _jsx(SheetButton, { "aria-label": backWord, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack }) : close && _jsx(Base.Close, { render: _jsx(GlassButton, { "aria-label": closeWord, className: "o-sheet-glass", icon: glyph(X) }) }), title: _jsx(Base.Title, { className: "o-sheet-title", "aria-label": titleLabel, children: title }), description: description, descriptionRender: _jsx(Base.Description, {}), right: sides ? right : _jsxs(_Fragment, { children: [children, close && _jsx(Base.Close, { render: _jsx(Button, { kind: "quiet", shape: "icon", "aria-label": closeWord, className: "o-sheet-plain", icon: glyph(X) }) })] }) }) }));
|
|
27
27
|
}
|
|
28
28
|
export const SheetFoot = ({ children }) => _jsx("div", { className: "o-sheet-foot", children: children });
|
|
29
29
|
export const SheetBody = React.forwardRef(function SheetBody({ onScroll, children }, ref) {
|
|
@@ -246,7 +246,7 @@ function useKeyboardFoot(popup, on) {
|
|
|
246
246
|
return () => { vv.removeEventListener("resize", read); vv.removeEventListener("scroll", read); popup.style.removeProperty("--sheet-keyboard"); };
|
|
247
247
|
}, [typing, popup]);
|
|
248
248
|
}
|
|
249
|
-
export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form = "full", stops, openAt, stop, onStopChange, mark: marked = "[data-sheet-mark]", container, standing: stands, finalFocus, children }) {
|
|
249
|
+
export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form = "full", stops, openAt, stop, onStopChange, mark: marked = "[data-sheet-mark]", container, standing: stands, finalFocus, className, children }) {
|
|
250
250
|
const closeBelow = React.useContext(CloseAll), stacked = closeBelow !== null;
|
|
251
251
|
const standsBelow = React.useContext(Standing), standing = stands || standsBelow;
|
|
252
252
|
const [armed, setArmed] = React.useState(false);
|
|
@@ -372,5 +372,5 @@ export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form =
|
|
|
372
372
|
}, children: _jsxs(Base.Portal, { container: container, children: [_jsx(Base.Backdrop, { ref: backdrop, forceRender: stacked, className: "o-sheet-backdrop", "data-stacked": stacked ? "" : undefined }), _jsxs(Base.Viewport, { ref: setViewport, className: "o-sheet-viewport", "data-sheet-form": form, onClick: standing ? (e) => { if (e.target === e.currentTarget) {
|
|
373
373
|
release("closed");
|
|
374
374
|
close("outside-press");
|
|
375
|
-
} } : undefined, children: [_jsx(Base.Popup, { ref: bindPopup, initialFocus: popupRef, finalFocus: finalFocus ? () => finalFocus() ?? true : undefined, className: "o-sheet o-smooth", "data-sheet-form": form, "aria-label": label, "data-kit": "sheet", children: _jsxs("div", { className: "o-sheet-cut", children: [_jsx("div", { className: "o-sheet-handle", "aria-hidden": "true" }), _jsx(Standing.Provider, { value: standing, children: _jsx(Body.Provider, { value: body, children: _jsx(CloseAll.Provider, { value: closeAll, children: children }) }) })] }) }), coming && _jsx("div", { className: "o-sheet-shield", "aria-hidden": "true", "data-sheet-shield": "", onPointerDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onClick: (e) => e.stopPropagation() })] })] }) }));
|
|
375
|
+
} } : undefined, children: [_jsx(Base.Popup, { ref: bindPopup, initialFocus: popupRef, finalFocus: finalFocus ? () => finalFocus() ?? true : undefined, className: cx("o-sheet o-smooth", className), "data-sheet-form": form, "aria-label": label, "data-kit": "sheet", children: _jsxs("div", { className: "o-sheet-cut", children: [_jsx("div", { className: "o-sheet-handle", "aria-hidden": "true" }), _jsx(Standing.Provider, { value: standing, children: _jsx(Body.Provider, { value: body, children: _jsx(CloseAll.Provider, { value: closeAll, children: children }) }) })] }) }), coming && _jsx("div", { className: "o-sheet-shield", "aria-hidden": "true", "data-sheet-shield": "", onPointerDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onClick: (e) => e.stopPropagation() })] })] }) }));
|
|
376
376
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { ViewsSheetProps } from "../../provider/components.js";
|
|
2
|
+
import { type SheetProps } from "./bottom-sheet.js";
|
|
3
|
+
/** The Sheet's form and stops for each height ViewKit asks for. */
|
|
4
|
+
export declare const SNAP_FORM: Readonly<Record<NonNullable<ViewsSheetProps["snap"]>, Pick<SheetProps, "form" | "stops" | "openAt">>>;
|
|
2
5
|
/** ViewKit's sheet, drawn as the kit's Sheet. */
|
|
3
|
-
export declare function MapSheet({ open, onOpenChange, label, actions, children }: ViewsSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function MapSheet({ open, onOpenChange, title, label, description, actions, snap, className, children }: ViewsSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { useViews } from "../../provider/context.js";
|
|
3
|
-
import { Sheet, SheetBody, SheetButton, SheetHead } from "./bottom-sheet.js";
|
|
4
|
-
|
|
4
|
+
import { Sheet, SheetBody, SheetButton, SheetFoot, SheetHead } from "./bottom-sheet.js";
|
|
5
|
+
import { STOPS } from "./forms.js";
|
|
6
|
+
import { SheetPartsFrom } from "./sheet-parts.js";
|
|
7
|
+
export const SNAP_FORM = {
|
|
8
|
+
full: { form: "full" },
|
|
9
|
+
auto: { form: "edge" },
|
|
10
|
+
half: { form: "blend" },
|
|
11
|
+
peek: { form: "full", stops: [STOPS.small, STOPS.full], openAt: STOPS.small },
|
|
12
|
+
};
|
|
13
|
+
export function MapSheet({ open, onOpenChange, title, label, description, actions, snap, className, children }) {
|
|
5
14
|
const { icons, messages } = useViews();
|
|
15
|
+
const [parts, setParts] = React.useState(null);
|
|
6
16
|
const words = { close: messages({ key: "views.panels.close" }), back: messages({ key: "views.panels.back" }) };
|
|
7
|
-
const name = label ?? "";
|
|
17
|
+
const name = label ?? "", shown = title ?? name;
|
|
18
|
+
const titleLabel = title != null && title !== name && label ? label : undefined;
|
|
8
19
|
const left = actions?.back ?? actions?.close;
|
|
9
20
|
const Back = icons.back, Close = icons.close, Check = icons.check;
|
|
10
|
-
return (_jsxs(Sheet, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), label: name, children: [
|
|
11
|
-
? _jsx(SheetHead, { title:
|
|
12
|
-
:
|
|
21
|
+
return (_jsxs(Sheet, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), label: name, ...SNAP_FORM[snap ?? "full"], className: className, children: [parts
|
|
22
|
+
? _jsx(SheetHead, { title: parts.title, ...parts.head, words: words })
|
|
23
|
+
: actions && left
|
|
24
|
+
? _jsx(SheetHead, { title: shown, titleLabel: titleLabel, description: description, left: _jsx(SheetButton, { "aria-label": left.label, className: actions.back ? "o-sheet-back" : undefined, icon: actions.back ? _jsx(Back, {}) : _jsx(Close, {}), onClick: left.onPress }), right: actions.done ? _jsx(SheetButton, { kind: "primary", "aria-label": actions.done.label, icon: _jsx(Check, {}), onClick: actions.done.onPress }) : _jsx("span", {}) })
|
|
25
|
+
: (title != null || description != null) && _jsx(SheetHead, { title: shown, titleLabel: titleLabel, description: description, words: words }), _jsx(SheetBody, { children: _jsx(SheetPartsFrom.Provider, { value: setParts, children: children }) }), parts?.foot && _jsx(SheetFoot, { children: parts.foot })] }));
|
|
13
26
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { SheetHeadProps } from "./bottom-sheet.js";
|
|
3
|
+
/** What a body hands its Sheet: its title, its Back and ✕, and its foot. */
|
|
4
|
+
export type SheetParts = {
|
|
5
|
+
title: string;
|
|
6
|
+
head: Pick<SheetHeadProps, "onBack" | "close">;
|
|
7
|
+
foot?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
/** The Sheet's setter for its head's parts, held by a Sheet round what stands in it; null outside one. */
|
|
10
|
+
export declare const SheetPartsFrom: React.Context<((parts: SheetParts | null) => void) | null>;
|
|
@@ -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
|
+
}
|