viewkitjs 0.31.0 → 0.33.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 +198 -0
- package/MIGRATION.md +40 -6
- package/README.md +1 -1
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/query/evaluate.d.ts +7 -0
- package/fields/dist/query/exact-number.d.ts +8 -2
- package/fields/dist/query/exact-number.js +14 -1
- package/fields/dist/query/index.d.ts +2 -0
- package/fields/dist/query/index.js +2 -0
- package/fields/dist/query/list-request.d.ts +148 -0
- package/fields/dist/query/list-request.js +125 -0
- package/fields/dist/query/saved-view.d.ts +15 -0
- package/fields/dist/query/saved-view.js +11 -0
- package/fields/dist/query/settings.d.ts +9 -0
- package/fields/dist/query/settings.js +9 -0
- package/fields/dist/query/sort.js +13 -10
- package/fields/dist/registry.js +5 -1
- package/fields/dist/types.d.ts +4 -1
- package/fields/dist/zod.d.ts +5 -0
- package/fields/dist/zod.js +10 -1
- package/fields/docs/guides/contact-values.md +12 -0
- package/fields/docs/guides/field-types.md +1 -1
- package/fields/docs/guides/queries.md +3 -1
- package/fields/docs/reference/fields.md +1 -0
- package/fields/docs/reference/query.md +66 -0
- package/package.json +5 -1
- package/postgres/README.md +1 -0
- package/postgres/dist/check.js +4 -1
- package/postgres/dist/definitions/formula-forms.js +3 -1
- package/postgres/dist/definitions/money.js +2 -1
- package/postgres/dist/handler.d.ts +53 -0
- package/postgres/dist/handler.js +211 -0
- package/postgres/dist/ids.d.ts +1 -1
- package/postgres/dist/ids.js +19 -1
- package/postgres/dist/index.d.ts +1 -0
- package/postgres/dist/index.js +1 -0
- package/postgres/dist/limits.d.ts +3 -1
- package/postgres/dist/limits.js +1 -1
- package/postgres/dist/list-fields.d.ts +10 -0
- package/postgres/dist/list-fields.js +36 -0
- package/postgres/dist/page.js +6 -3
- package/postgres/dist/readable.d.ts +4 -0
- package/postgres/dist/readable.js +4 -0
- package/postgres/dist/refusals.d.ts +9 -2
- package/postgres/dist/refusals.js +6 -0
- package/postgres/dist/rules.d.ts +15 -1
- package/postgres/dist/rules.js +16 -0
- package/postgres/dist/sort.js +7 -2
- package/postgres/docs/guides/definitions.md +1 -1
- package/postgres/docs/guides/field-map.md +3 -3
- package/postgres/docs/guides/list-handler.md +99 -0
- package/postgres/docs/index.md +1 -0
- package/postgres/docs/reference/definitions.md +1 -1
- package/postgres/docs/reference/postgres.md +12 -4
- package/views/README.md +2 -2
- package/views/dist/atoms/RowMenu.d.ts +7 -0
- package/views/dist/atoms/RowMenu.js +18 -16
- package/views/dist/atoms/ToolbarButton.d.ts +1 -1
- package/views/dist/atoms/ToolbarButton.js +4 -3
- package/views/dist/atoms/carried.d.ts +5 -0
- package/views/dist/atoms/carried.js +7 -0
- package/views/dist/atoms/frame-parts.d.ts +6 -0
- package/views/dist/atoms/frame-parts.js +15 -0
- package/views/dist/atoms/types.d.ts +19 -7
- package/views/dist/cells/cell-title.d.ts +3 -1
- package/views/dist/cells/cell-title.js +2 -2
- package/views/dist/cells/cell-values.js +2 -2
- package/views/dist/contract.d.ts +56 -11
- package/views/dist/contract.js +148 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +2 -1
- package/views/dist/controls/atoms.d.ts +2 -0
- package/views/dist/controls/atoms.js +2 -0
- package/views/dist/controls/avatar/avatar.d.ts +3 -3
- package/views/dist/controls/avatar/avatar.js +1 -1
- package/views/dist/controls/avatar/tokens.d.ts +44 -0
- package/views/dist/controls/avatar/tokens.js +11 -0
- package/views/dist/controls/avatar.css +22 -5
- package/views/dist/controls/button/map-button.js +2 -0
- package/views/dist/controls/checkbox/checkbox.d.ts +3 -2
- package/views/dist/controls/checkbox/checkbox.js +2 -2
- package/views/dist/controls/choice/tokens.d.ts +0 -4
- package/views/dist/controls/choice/tokens.js +0 -1
- package/views/dist/controls/choice.css +3 -3
- package/views/dist/controls/compound-editor/compound-editor.d.ts +1 -1
- package/views/dist/controls/compound-editor/name-parts.js +4 -4
- package/views/dist/controls/compound-editor/place-parts.js +19 -19
- package/views/dist/controls/compound-editor/range-parts.js +14 -14
- package/views/dist/controls/compound-editor/row.d.ts +3 -1
- package/views/dist/controls/compound-editor/row.js +2 -2
- package/views/dist/controls/controls.d.ts +8 -0
- package/views/dist/controls/controls.js +12 -2
- package/views/dist/controls/customize/customize.js +37 -35
- package/views/dist/controls/customize/map-customize-body.d.ts +2 -0
- package/views/dist/controls/customize/map-customize-body.js +5 -1
- package/views/dist/controls/date-editor/date-days.js +2 -2
- package/views/dist/controls/date-editor/date-editor.js +18 -18
- package/views/dist/controls/date-editor/date-parts.js +6 -6
- package/views/dist/controls/date-editor/map-calendar.js +1 -1
- package/views/dist/controls/date-editor.css +2 -2
- package/views/dist/controls/field/field.d.ts +22 -4
- package/views/dist/controls/field/field.js +63 -5
- package/views/dist/controls/field/tokens.d.ts +4 -0
- package/views/dist/controls/field/tokens.js +1 -0
- package/views/dist/controls/field.css +41 -16
- package/views/dist/controls/filter-editor/block.d.ts +2 -2
- package/views/dist/controls/filter-editor/block.js +5 -5
- package/views/dist/controls/filter-editor/filter-editor.js +31 -33
- package/views/dist/controls/filter-editor/how.d.ts +3 -1
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +7 -3
- package/views/dist/controls/filter-editor/map-rules.js +1 -1
- package/views/dist/controls/filter-editor/parts.js +2 -1
- package/views/dist/controls/glyphs/glyphs.d.ts +10 -0
- package/views/dist/controls/glyphs/glyphs.js +173 -0
- package/views/dist/controls/group-editor/group-editor.js +15 -13
- package/views/dist/controls/index.d.ts +4 -1
- package/views/dist/controls/index.js +3 -1
- package/views/dist/controls/input/input.js +6 -3
- package/views/dist/controls/input/map-input.js +2 -0
- package/views/dist/controls/input/tokens.d.ts +4 -0
- package/views/dist/controls/input/tokens.js +1 -0
- package/views/dist/controls/input.css +31 -3
- package/views/dist/controls/internal/editor-parts.js +1 -1
- package/views/dist/controls/internal/icons.js +10 -0
- package/views/dist/controls/internal/keep-focus.d.ts +2 -0
- package/views/dist/controls/internal/keep-focus.js +17 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +8 -0
- package/views/dist/controls/internal/map-panel-controls.js +20 -0
- package/views/dist/controls/internal/panel-controls.d.ts +50 -0
- package/views/dist/controls/internal/panel-controls.js +197 -0
- package/views/dist/controls/internal/part-slot.d.ts +12 -0
- package/views/dist/controls/internal/part-slot.js +5 -0
- package/views/dist/controls/internal/watch-frame.d.ts +2 -0
- package/views/dist/controls/internal/watch-frame.js +33 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +1 -1
- package/views/dist/controls/links-editor/links-editor.js +27 -27
- package/views/dist/controls/markdown/map-markdown.d.ts +4 -0
- package/views/dist/controls/markdown/map-markdown.js +5 -0
- package/views/dist/controls/menu/map-menu.d.ts +2 -2
- package/views/dist/controls/menu/map-menu.js +15 -12
- package/views/dist/controls/menu/menu.d.ts +2 -0
- package/views/dist/controls/menu/menu.js +3 -3
- package/views/dist/controls/menu-list/menu-list.d.ts +17 -4
- package/views/dist/controls/menu-list/menu-list.js +27 -25
- package/views/dist/controls/modal/modal.js +5 -1
- package/views/dist/controls/notice/notice.d.ts +3 -1
- package/views/dist/controls/notice/notice.js +2 -2
- package/views/dist/controls/number-editor/number-editor.d.ts +1 -1
- package/views/dist/controls/number-editor/number-editor.js +13 -13
- package/views/dist/controls/number-field/number-field.js +5 -3
- package/views/dist/controls/pane/pane.d.ts +4 -2
- package/views/dist/controls/pane/pane.js +6 -5
- package/views/dist/controls/phone-header/header-bar.d.ts +5 -1
- package/views/dist/controls/phone-header/header-bar.js +2 -2
- package/views/dist/controls/phone-header.css +11 -1
- package/views/dist/controls/picker/map-picker.js +3 -0
- package/views/dist/controls/picker/picker.d.ts +16 -0
- package/views/dist/controls/picker/picker.js +61 -40
- package/views/dist/controls/picker/rows.d.ts +4 -0
- package/views/dist/controls/picker.css +2 -0
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +4 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/quick-filters/quick-filters.js +4 -4
- package/views/dist/controls/radio/radio.d.ts +8 -3
- package/views/dist/controls/radio/radio.js +22 -5
- package/views/dist/controls/radio/tokens.d.ts +44 -0
- package/views/dist/controls/radio/tokens.js +11 -0
- package/views/dist/controls/radio.css +79 -1
- package/views/dist/controls/select/map-select.d.ts +3 -0
- package/views/dist/controls/select/map-select.js +8 -0
- package/views/dist/controls/select/select.d.ts +7 -0
- package/views/dist/controls/select/select.js +12 -6
- package/views/dist/controls/select/tokens.d.ts +8 -0
- package/views/dist/controls/select/tokens.js +2 -0
- package/views/dist/controls/select.css +17 -0
- package/views/dist/controls/setting-row/looks.d.ts +1 -1
- package/views/dist/controls/setting-row/looks.js +9 -4
- package/views/dist/controls/setting-row/setting-row.d.ts +45 -10
- package/views/dist/controls/setting-row/setting-row.js +82 -15
- package/views/dist/controls/setting-row/tokens.d.ts +74 -2
- package/views/dist/controls/setting-row/tokens.js +19 -1
- package/views/dist/controls/setting-row.css +135 -14
- package/views/dist/controls/sheet/bottom-sheet.d.ts +14 -2
- package/views/dist/controls/sheet/bottom-sheet.js +6 -3
- package/views/dist/controls/sheet/map-sheet.js +1 -1
- package/views/dist/controls/sheet.css +4 -1
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +1 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +7 -3
- package/views/dist/controls/sort-editor/sort-editor.js +25 -26
- package/views/dist/controls/sort-editor.css +13 -2
- package/views/dist/controls/switch-row/tokens.d.ts +0 -12
- package/views/dist/controls/switch-row/tokens.js +0 -3
- package/views/dist/controls/switch-row.css +3 -7
- package/views/dist/controls/switch.css +17 -7
- package/views/dist/controls/tag/tag.d.ts +3 -1
- package/views/dist/controls/tag/tag.js +2 -2
- package/views/dist/controls/tag/tokens.d.ts +4 -0
- package/views/dist/controls/tag/tokens.js +1 -0
- package/views/dist/controls/tag-field/tag-field.d.ts +5 -1
- package/views/dist/controls/tag-field/tag-field.js +11 -5
- package/views/dist/controls/tag-field/tokens.d.ts +16 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +19 -0
- package/views/dist/controls/tag.css +2 -0
- package/views/dist/controls/text-editor/text-editor.d.ts +1 -1
- package/views/dist/controls/text-editor/text-editor.js +8 -8
- package/views/dist/controls/toolbar/toolbar.d.ts +15 -3
- package/views/dist/controls/toolbar/toolbar.js +22 -15
- package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +14 -0
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +52 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +1 -1
- package/views/dist/controls/toolbar-button/toolbar-button.js +2 -3
- package/views/dist/controls/toolbar-button.css +4 -0
- package/views/dist/controls/toolbar.css +5 -0
- package/views/dist/controls/values-editor/values-editor.d.ts +1 -1
- package/views/dist/controls/values-editor/values-editor.js +22 -22
- package/views/dist/controls/views-list/map-view-menu.d.ts +3 -0
- package/views/dist/controls/views-list/map-view-menu.js +25 -0
- package/views/dist/controls/views-list/map-views-list-body.d.ts +28 -1
- package/views/dist/controls/views-list/map-views-list-body.js +39 -21
- package/views/dist/controls/views-list/rules.d.ts +2 -0
- package/views/dist/controls/views-list/view-menu.d.ts +7 -0
- package/views/dist/controls/views-list/view-menu.js +33 -29
- package/views/dist/controls/views-list/views-list.js +4 -4
- package/views/dist/controls/views-list/words.d.ts +2 -0
- package/views/dist/controls/views-list/words.js +1 -1
- package/views/dist/editors/EditorPanel.js +3 -2
- package/views/dist/editors/edit-session.js +2 -5
- package/views/dist/field-row/FieldRow.d.ts +4 -2
- package/views/dist/field-row/FieldRow.js +80 -20
- package/views/dist/field-row/FieldRowLane.d.ts +7 -2
- package/views/dist/field-row/FieldRowLane.js +4 -3
- package/views/dist/field-row/editors/RowEditor.d.ts +12 -0
- package/views/dist/field-row/editors/RowEditor.js +31 -1
- package/views/dist/field-row/editors/RowValueListEditor.d.ts +5 -1
- package/views/dist/field-row/editors/RowValueListEditor.js +4 -1
- package/views/dist/field-row/field-row-button.d.ts +5 -0
- package/views/dist/field-row/field-row-button.js +2 -0
- package/views/dist/fields/binding.d.ts +3 -2
- package/views/dist/fields/binding.js +38 -5
- package/views/dist/fields/money.d.ts +5 -2
- package/views/dist/fields/money.js +14 -2
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +4 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +3 -2
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -1
- package/views/dist/grid/chrome/GridGroupMenu.js +4 -3
- package/views/dist/grid/chrome/GridHeader.d.ts +4 -1
- package/views/dist/grid/chrome/GridHeader.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +6 -5
- package/views/dist/grid/chrome/GridRowCells.js +6 -9
- package/views/dist/grid/chrome/GridStructure.d.ts +4 -1
- package/views/dist/grid/chrome/GridStructure.js +4 -4
- package/views/dist/grid/chrome/GridTable.js +9 -3
- package/views/dist/grid/chrome/cell-clipboard.d.ts +4 -2
- package/views/dist/grid/chrome/cell-clipboard.js +2 -2
- package/views/dist/grid/chrome/cells.js +3 -1
- package/views/dist/grid/chrome/grid-column-menu-items.js +1 -1
- package/views/dist/grid/chrome/grid-row-menu-items.d.ts +27 -3
- package/views/dist/grid/chrome/grid-row-menu-items.js +93 -7
- package/views/dist/grid/chrome/grid-row-props.d.ts +7 -2
- package/views/dist/grid/chrome/grid-rows-menu.js +34 -6
- package/views/dist/grid/chrome/grid-table-props.d.ts +38 -7
- package/views/dist/grid/chrome/useGridBatchApi.d.ts +3 -1
- package/views/dist/grid/chrome/useGridBatchApi.js +4 -2
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +7 -2
- package/views/dist/grid/chrome/useGridKeyboard.js +43 -14
- package/views/dist/grid/chrome/useGridPendingReconciliation.js +1 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +20 -7
- package/views/dist/grid/core/clipboard-model.d.ts +3 -1
- package/views/dist/grid/core/clipboard-model.js +9 -8
- package/views/dist/grid/core/commit-model.d.ts +20 -2
- package/views/dist/grid/core/editing-controller.d.ts +21 -0
- package/views/dist/grid/core/editing-controller.js +194 -42
- package/views/dist/grid/core/editing-model.d.ts +3 -0
- package/views/dist/grid/core/editing-model.js +3 -0
- package/views/dist/grid/core/edits-sink.d.ts +19 -0
- package/views/dist/grid/core/edits-sink.js +2 -0
- package/views/dist/grid/core/save-path.d.ts +24 -0
- package/views/dist/grid/core/save-path.js +122 -0
- package/views/dist/grid/core/spreadsheet-operations.d.ts +3 -0
- package/views/dist/grid/core/spreadsheet-operations.js +24 -1
- package/views/dist/grid/core/useGridEditing.d.ts +5 -0
- package/views/dist/grid/core/useGridEditing.js +6 -0
- package/views/dist/grid/index.d.ts +3 -2
- package/views/dist/grid/index.js +1 -0
- package/views/dist/internal/field-rows.d.ts +26 -0
- package/views/dist/internal/field-rows.js +8 -0
- package/views/dist/internal/page-close.d.ts +7 -0
- package/views/dist/internal/page-close.js +43 -0
- package/views/dist/list/answer.d.ts +40 -0
- package/views/dist/list/answer.js +43 -0
- package/views/dist/list/browser-views-store.d.ts +10 -0
- package/views/dist/list/browser-views-store.js +182 -0
- package/views/dist/list/bulk-bar.d.ts +7 -0
- package/views/dist/list/bulk-bar.js +10 -0
- package/views/dist/list/columns.d.ts +24 -0
- package/views/dist/list/columns.js +27 -0
- package/views/dist/list/edits.d.ts +19 -0
- package/views/dist/list/edits.js +56 -0
- package/views/dist/list/grid.d.ts +11 -0
- package/views/dist/list/grid.js +76 -0
- package/views/dist/list/index.d.ts +36 -0
- package/views/dist/list/index.js +11 -0
- package/views/dist/list/link.d.ts +8 -0
- package/views/dist/list/link.js +78 -0
- package/views/dist/list/list.d.ts +70 -0
- package/views/dist/list/list.js +14 -0
- package/views/dist/list/menu.d.ts +31 -0
- package/views/dist/list/menu.js +76 -0
- package/views/dist/list/parts.d.ts +6 -0
- package/views/dist/list/parts.js +66 -0
- package/views/dist/list/registry.d.ts +11 -0
- package/views/dist/list/registry.js +31 -0
- package/views/dist/list/root-base.d.ts +46 -0
- package/views/dist/list/root-base.js +137 -0
- package/views/dist/list/root.d.ts +41 -0
- package/views/dist/list/root.js +168 -0
- package/views/dist/list/slot.d.ts +14 -0
- package/views/dist/list/slot.js +22 -0
- package/views/dist/list/source-answers.d.ts +39 -0
- package/views/dist/list/source-answers.js +225 -0
- package/views/dist/list/source.d.ts +11 -0
- package/views/dist/list/source.js +31 -0
- package/views/dist/list/store.d.ts +119 -0
- package/views/dist/list/store.js +146 -0
- package/views/dist/list/toolbar.d.ts +7 -0
- package/views/dist/list/toolbar.js +371 -0
- package/views/dist/list/views-axis.d.ts +5 -0
- package/views/dist/list/views-axis.js +98 -0
- package/views/dist/list/views-store.d.ts +41 -0
- package/views/dist/list/views-store.js +1 -0
- package/views/dist/list/views.d.ts +72 -0
- package/views/dist/list/views.js +411 -0
- package/views/dist/model/column-capabilities.d.ts +13 -0
- package/views/dist/model/column-capabilities.js +23 -2
- package/views/dist/model/column-schema.d.ts +11 -1
- package/views/dist/model/preferences.js +1 -1
- package/views/dist/model/prefs-buckets.js +1 -1
- package/views/dist/model/view-rules.js +1 -0
- package/views/dist/panels/index.d.ts +3 -1
- package/views/dist/panels/index.js +1 -0
- package/views/dist/panels/model.d.ts +2 -0
- package/views/dist/panels/react/customize-body.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +47 -4
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +6 -326
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +17 -2
- package/views/dist/panels/react/toolbar/Toolbar.js +43 -23
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -4
- package/views/dist/panels/react/toolbar/ToolbarButton.js +7 -1
- package/views/dist/panels/react/toolbar/ToolbarFilter.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarNew.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSort.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
- package/views/dist/panels/react/toolbar/context.d.ts +20 -3
- package/views/dist/panels/react/toolbar/context.js +3 -1
- package/views/dist/panels/react/toolbar/panel-part.d.ts +4 -1
- package/views/dist/panels/react/toolbar/panel-part.js +5 -3
- package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +1 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.js +15 -4
- package/views/dist/panels/react/views-row/PillGroup.d.ts +5 -2
- package/views/dist/panels/react/views-row/PillGroup.js +16 -7
- package/views/dist/panels/react/views-row/ViewPicker.js +2 -12
- package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/ViewPickerRow.js +9 -5
- package/views/dist/panels/react.d.ts +2 -2
- package/views/dist/panels/settings/filter-groups.js +6 -1
- package/views/dist/panels/toolbar/edit-view.d.ts +7 -1
- package/views/dist/panels/toolbar/edit-view.js +14 -0
- package/views/dist/panels/toolbar/model.d.ts +5 -0
- package/views/dist/panels/toolbar/model.js +7 -3
- package/views/dist/panels/view-state.d.ts +5 -3
- package/views/dist/panels/views-row/model.d.ts +19 -2
- package/views/dist/panels/views-row/model.js +14 -0
- package/views/dist/provider/ViewsProvider.d.ts +21 -8
- package/views/dist/provider/ViewsProvider.js +40 -5
- package/views/dist/provider/components.d.ts +102 -2
- package/views/dist/provider/components.js +1 -1
- package/views/dist/provider/context.d.ts +6 -2
- package/views/dist/provider/context.js +1 -1
- package/views/dist/provider/own-control.d.ts +4 -0
- package/views/dist/provider/own-control.js +7 -0
- package/views/dist/provider/ports.d.ts +19 -12
- package/views/dist/provider/ports.js +69 -1
- package/views/dist/provider/select-items.d.ts +3 -0
- package/views/dist/provider/select-items.js +6 -0
- package/views/dist/react.d.ts +4 -2
- package/views/dist/react.js +2 -0
- package/views/dist/styles.css +503 -136
- package/views/dist/styles.unlayered.css +503 -136
- package/views/docs/contract.md +292 -34
- package/views/docs/controls/avatar.md +11 -0
- package/views/docs/controls/choice.md +0 -1
- package/views/docs/controls/compound-editor.md +4 -0
- package/views/docs/controls/customize.md +6 -0
- package/views/docs/controls/date-editor.md +4 -0
- package/views/docs/controls/field.md +7 -0
- package/views/docs/controls/filter-editor.md +8 -0
- package/views/docs/controls/group-editor.md +6 -0
- package/views/docs/controls/input.md +5 -0
- package/views/docs/controls/links-editor.md +4 -0
- package/views/docs/controls/menu-list.md +8 -0
- package/views/docs/controls/menu.md +4 -0
- package/views/docs/controls/notice.md +4 -0
- package/views/docs/controls/number-editor.md +4 -0
- package/views/docs/controls/pane.md +4 -0
- package/views/docs/controls/picker.md +8 -0
- package/views/docs/controls/quick-filters.md +6 -0
- package/views/docs/controls/radio.md +20 -1
- package/views/docs/controls/select.md +10 -0
- package/views/docs/controls/setting-row.md +18 -0
- package/views/docs/controls/sheet.md +4 -0
- package/views/docs/controls/sort-editor.md +8 -0
- package/views/docs/controls/switch-row.md +0 -3
- package/views/docs/controls/tag-field.md +4 -0
- package/views/docs/controls/tag.md +1 -0
- package/views/docs/controls/text-editor.md +4 -0
- package/views/docs/controls/values-editor.md +4 -0
- package/views/docs/controls/views-list.md +6 -0
- package/views/docs/getting-started.md +2 -2
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/columns.md +1 -1
- package/views/docs/guides/ports.md +1 -1
- package/views/docs/guides/the-grid.md +36 -9
- package/views/docs/guides/the-provider.md +22 -3
- package/views/docs/index.md +1 -0
- package/views/docs/reference/controls.md +41 -29
- package/views/docs/reference/editors-session.md +1 -1
- package/views/docs/reference/field-row.md +9 -1
- package/views/docs/reference/grid.md +15 -9
- package/views/docs/reference/list.md +357 -0
- package/views/docs/reference/looks.md +1 -1
- package/views/docs/reference/panels-react.md +17 -12
- package/views/docs/reference/panels.md +8 -5
- package/views/docs/reference/react.md +24 -16
- package/views/docs/reference/views.md +10 -6
- package/views/docs/reshaping.md +6 -1
- package/views/skills/views/SKILL.md +9 -6
|
@@ -12,6 +12,7 @@ import { Option } from "../option/option.js";
|
|
|
12
12
|
import { Spinner } from "../spinner/spinner.js";
|
|
13
13
|
import { StatusGlyph } from "../status/status.js";
|
|
14
14
|
import { SheetButton } from "../sheet/bottom-sheet.js";
|
|
15
|
+
import { partAttrs } from "../internal/part-slot.js";
|
|
15
16
|
import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
|
|
16
17
|
import { cx } from "../../internal/cx.js";
|
|
17
18
|
import { Icon } from "../internal/icons.js";
|
|
@@ -47,6 +48,9 @@ export const PICKER_WORDS = {
|
|
|
47
48
|
noneTyped: (typed) => `Nothing matches “${typed}”.`,
|
|
48
49
|
create: (typed) => `Create “${typed}”`,
|
|
49
50
|
createButton: "Create",
|
|
51
|
+
add: (typed) => `Add “${typed}”`,
|
|
52
|
+
adding: (typed) => `Adding “${typed}”…`,
|
|
53
|
+
addButton: "Add",
|
|
50
54
|
loadingMore: "Loading more…",
|
|
51
55
|
chosen: (count) => `${count} chosen`,
|
|
52
56
|
clearAll: "Clear all",
|
|
@@ -63,11 +67,11 @@ export const PICKER_WORDS = {
|
|
|
63
67
|
};
|
|
64
68
|
function LeadMark({ lead, value }) {
|
|
65
69
|
if (lead.value === value)
|
|
66
|
-
return _jsx("span", { className: "o-picker-lead", children: lead.label });
|
|
70
|
+
return _jsx("span", { className: "o-picker-lead", "data-slot": "vk-picker-lead", children: lead.label });
|
|
67
71
|
const stop = (e) => e.stopPropagation();
|
|
68
|
-
return (_jsx(Button, { kind: "text", size: "2xs", className: "o-picker-lead-make", onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onPointerDown: stop, onClick: (e) => { e.preventDefault(); e.stopPropagation(); lead.onLead(value); }, children: lead.makeLabel }));
|
|
72
|
+
return (_jsx(Button, { kind: "text", size: "2xs", className: "o-picker-lead-make", "data-slot": "vk-picker-lead-make", onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onPointerDown: stop, onClick: (e) => { e.preventDefault(); e.stopPropagation(); lead.onLead(value); }, children: lead.makeLabel }));
|
|
69
73
|
}
|
|
70
|
-
const glyph = (paths, className, strokeWidth = 2) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
|
|
74
|
+
const glyph = (paths, className, strokeWidth = 2, slot) => (_jsx("svg", { className: className, "data-slot": slot, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
|
|
71
75
|
const TICK = ["M5 12l5 5l10 -10"], PLUS = ["M12 5v14", "M5 12h14"], SEARCH = ["M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "M21 21l-6 -6"];
|
|
72
76
|
const BACK = ["M15 6l-6 6l6 6"], MORE = ["M9 6l6 6l-6 6"];
|
|
73
77
|
const DOTS_V = ["M12 4a1 1 0 1 0 0 2a1 1 0 1 0 0 -2", "M12 11a1 1 0 1 0 0 2a1 1 0 1 0 0 -2", "M12 18a1 1 0 1 0 0 2a1 1 0 1 0 0 -2"];
|
|
@@ -116,7 +120,7 @@ function KindMark({ item, kind }) {
|
|
|
116
120
|
}
|
|
117
121
|
function ItemBody({ item, multiple, worn, lead, count, menu, you }) {
|
|
118
122
|
const mark = worn.mark, line = lineOf(item, worn.kind), opens = count !== undefined;
|
|
119
|
-
return (_jsxs(_Fragment, { children: [multiple && mark === "tick" && !opens && _jsx(CheckboxMark, {}), _jsx(Face, { item: item, size: line && worn.line === "below" ? Number(worn.face) : 20 }), _jsxs("span", { className: "o-list-text", children: [_jsxs("span", { className: "o-list-main", children: [_jsx(Name, { item: item }), item.you && _jsx("span", { className: "o-list-you", children: you }), _jsx(After, { item: item })] }), line && _jsx("span", { className: "o-list-line", children: line })] }), _jsx(KindMark, { item: item, kind: worn.kind }), lead, opens ? _jsx(Opens, { count: count }) : _jsxs(_Fragment, { children: [_jsx(RowCount, { item: item }), multiple && mark === "check" && _jsx(CheckboxMark, {}), !multiple && (mark === "check" ? _jsx("span", { className: "o-picker-check", children: glyph(TICK, undefined, 3) }) : glyph(TICK, "o-list-tick", 2.25))] }), menu] }));
|
|
123
|
+
return (_jsxs(_Fragment, { children: [multiple && mark === "tick" && !opens && _jsx(CheckboxMark, { "data-slot": "vk-picker-tick" }), _jsx(Face, { item: item, size: line && worn.line === "below" ? Number(worn.face) : 20 }), _jsxs("span", { className: "o-list-text", children: [_jsxs("span", { className: "o-list-main", children: [_jsx(Name, { item: item }), item.you && _jsx("span", { className: "o-list-you", children: you }), _jsx(After, { item: item })] }), line && _jsx("span", { className: "o-list-line", children: line })] }), _jsx(KindMark, { item: item, kind: worn.kind }), lead, opens ? _jsx(Opens, { count: count }) : _jsxs(_Fragment, { children: [_jsx(RowCount, { item: item }), multiple && mark === "check" && _jsx(CheckboxMark, { "data-slot": "vk-picker-tick" }), !multiple && (mark === "check" ? _jsx("span", { className: "o-picker-check", "data-slot": "vk-picker-tick", children: glyph(TICK, undefined, 3) }) : glyph(TICK, "o-list-tick", 2.25, "vk-picker-tick"))] }), menu] }));
|
|
120
124
|
}
|
|
121
125
|
function grouped(rows, apart) {
|
|
122
126
|
const out = [{ rows: [] }];
|
|
@@ -149,7 +153,7 @@ function PhoneRow({ item, circle, box, lead, kind, count, menu, you }) {
|
|
|
149
153
|
circle = null;
|
|
150
154
|
box = false;
|
|
151
155
|
}
|
|
152
|
-
return (_jsxs(_Fragment, { children: [_jsx(Face, { item: item, phone: true }), _jsxs("span", { className: "o-list-text", children: [_jsxs("span", { className: "o-list-main", children: [_jsx(Name, { item: item, phone: true }), item.you && _jsx("span", { className: "o-list-you", children: you }), _jsx(After, { item: item })] }), line && _jsx("span", { className: "o-list-line", children: line })] }), _jsx(KindMark, { item: item, kind: kind }), lead, count !== undefined && _jsx(Opens, { count: count }), count === undefined && _jsx(RowCount, { item: item }), box && _jsx(CheckboxMark, {}), !box && circle && _jsx("span", { className: cx("o-picker-circle", circle === "off" && "o-picker-circle-off", circle === "fixed" && "o-picker-circle-fixed"), children: circle !== "off" && glyph(TICK, undefined, 3) }), menu] }));
|
|
156
|
+
return (_jsxs(_Fragment, { children: [_jsx(Face, { item: item, phone: true }), _jsxs("span", { className: "o-list-text", children: [_jsxs("span", { className: "o-list-main", children: [_jsx(Name, { item: item, phone: true }), item.you && _jsx("span", { className: "o-list-you", children: you }), _jsx(After, { item: item })] }), line && _jsx("span", { className: "o-list-line", children: line })] }), _jsx(KindMark, { item: item, kind: kind }), lead, count !== undefined && _jsx(Opens, { count: count }), count === undefined && _jsx(RowCount, { item: item }), box && _jsx(CheckboxMark, { "data-slot": "vk-picker-tick" }), !box && circle && _jsx("span", { className: cx("o-picker-circle", circle === "off" && "o-picker-circle-off", circle === "fixed" && "o-picker-circle-fixed"), "data-slot": "vk-picker-tick", children: circle !== "off" && glyph(TICK, undefined, 3) }), menu] }));
|
|
153
157
|
}
|
|
154
158
|
function usePillTap(input) {
|
|
155
159
|
const start = React.useRef(null);
|
|
@@ -182,6 +186,7 @@ function usePickerAt(props, under) {
|
|
|
182
186
|
const w = { ...PICKER_WORDS, ...props.words };
|
|
183
187
|
const menuWords = { ...props.menuWords, ...(props.words ? { picker: props.words } : {}) };
|
|
184
188
|
const onValueChange = readOnly ? () => { } : props.onValueChange, onCreate = readOnly ? undefined : props.onCreate;
|
|
189
|
+
const onAdd = readOnly ? undefined : props.onAdd, add = !!onAdd, adding = onAdd ? props.adding : undefined;
|
|
185
190
|
const host = React.useContext(PhoneHost), small = usePhone();
|
|
186
191
|
const form = props.form ?? (host || small ? "phone" : "computer");
|
|
187
192
|
const inBox = under?.searchIn === "box", inBoxNow = React.useRef(inBox);
|
|
@@ -313,10 +318,18 @@ function usePickerAt(props, under) {
|
|
|
313
318
|
setAhead(heldNow.current); }, [props.firstFollows, heldKey]);
|
|
314
319
|
const listFirst = !!multiple && worn.picked === "first" && form === "computer";
|
|
315
320
|
const firstOnes = new Set(listFirst && !find.trim() ? ahead : []);
|
|
316
|
-
const server = !!onSearch, create = !!onCreate, own = (props.draft ?? "own") === "own";
|
|
321
|
+
const server = !!onSearch, create = !!onCreate || add, own = (props.draft ?? "own") === "own";
|
|
317
322
|
const openPath = openLevels(items, opened);
|
|
318
323
|
const level = openPath[openPath.length - 1];
|
|
319
|
-
const
|
|
324
|
+
const found = doing ? [] : pickerRows({ items: listed, known: items, query: find, picked: held, empty: multiple ? undefined : empty, create, server, more: !!onMore, first: listFirst ? ahead : undefined, open: level ? openPath : undefined, levelRow: !byHolder });
|
|
325
|
+
const rows = adding === undefined ? found : (() => {
|
|
326
|
+
const out = found.filter((r) => r.kind !== "create"), at = out.findIndex((r) => r.kind === "more");
|
|
327
|
+
out.splice(at < 0 ? out.length : at, 0, { kind: "create", typed: adding });
|
|
328
|
+
return out;
|
|
329
|
+
})();
|
|
330
|
+
const [refusal, setRefusal] = React.useState(null);
|
|
331
|
+
React.useLayoutEffect(() => { setRefusal(onAdd && props.addRefused !== undefined ? { words: props.addRefused, typed: find.trim() } : null); }, [props.addRefused]);
|
|
332
|
+
const refused = refusal && adding === undefined && fold(refusal.typed) === fold(find.trim()) ? refusal.words : undefined;
|
|
320
333
|
const shown = inBox || !!level || (props.searchShown ?? (worn.search === "always" || searchShown({ count: items.length, create, server, query })));
|
|
321
334
|
const none = !items.length && !find && !!nothingYet;
|
|
322
335
|
typedNow.current = query;
|
|
@@ -349,7 +362,7 @@ function usePickerAt(props, under) {
|
|
|
349
362
|
if (added?.kind === "action")
|
|
350
363
|
return added.action.onSelect();
|
|
351
364
|
if (added?.kind === "create")
|
|
352
|
-
return onValueChange([...held, make(added.typed)]);
|
|
365
|
+
return onAdd ? onAdd(added.typed) : onValueChange([...held, make(added.typed)]);
|
|
353
366
|
onValueChange(next.filter((e) => e.kind === "item").map((e) => e.item.value));
|
|
354
367
|
if (inBox)
|
|
355
368
|
ask("");
|
|
@@ -369,6 +382,8 @@ function usePickerAt(props, under) {
|
|
|
369
382
|
return next.action.onSelect();
|
|
370
383
|
if (next.kind === "item" && next.item.disabled)
|
|
371
384
|
return;
|
|
385
|
+
if (next.kind === "create" && onAdd)
|
|
386
|
+
return onAdd(next.typed);
|
|
372
387
|
onValueChange(next.kind === "item" ? next.item.value : next.kind === "create" ? make(next.typed) : null);
|
|
373
388
|
onDone?.();
|
|
374
389
|
};
|
|
@@ -570,24 +585,28 @@ function usePickerAt(props, under) {
|
|
|
570
585
|
"data-menu-open": menuOpenFor(item.value) ? "" : undefined,
|
|
571
586
|
onContextMenu: (e) => { e.preventDefault(); lightRow(e.currentTarget); setRowMenu({ value: item.value, anchor: { x: e.clientX, y: e.clientY } }); },
|
|
572
587
|
} : {};
|
|
573
|
-
return (_jsx(BaseCombobox.Item, { ref: keepsToItsList, value: itemEntry(r.item), disabled: r.item.disabled, className: "o-list-row o-smooth o-smooth-ease", "data-first": firstOnes.has(r.item.value) ? "" : undefined, "data-held": held.includes(r.item.value) ? "" : undefined, "data-indent": r.indent ? "" : undefined, "data-opens": r.opens ? "" : undefined, "data-name": r.item.label, ...more, ...orderProps(item.value), children: _jsx(ItemBody, { item: r.item, multiple: multiple, worn: worn, you: w.you, count: r.opens ? r.count : undefined, lead: multiple && !chips && props.lead && held.includes(r.item.value) ? _jsx(LeadMark, { lead: props.lead, value: r.item.value }) : undefined, menu: withMenu ? rowTrigger(item) : undefined }) }, r.item.value));
|
|
588
|
+
return (_jsx(BaseCombobox.Item, { ref: keepsToItsList, value: itemEntry(r.item), disabled: r.item.disabled, className: "o-list-row o-smooth o-smooth-ease", "data-first": firstOnes.has(r.item.value) ? "" : undefined, "data-held": held.includes(r.item.value) ? "" : undefined, "data-indent": r.indent ? "" : undefined, "data-opens": r.opens ? "" : undefined, "data-name": r.item.label, ...partAttrs(r.item.slot ?? { slot: "vk-picker-option", key: r.item.value }), ...more, ...orderProps(item.value), children: _jsx(ItemBody, { item: r.item, multiple: multiple, worn: worn, you: w.you, count: r.opens ? r.count : undefined, lead: multiple && !chips && props.lead && held.includes(r.item.value) ? _jsx(LeadMark, { lead: props.lead, value: r.item.value }) : undefined, menu: withMenu ? rowTrigger(item) : undefined }) }, r.item.value));
|
|
574
589
|
}
|
|
575
590
|
if (r.kind === "parent")
|
|
576
|
-
return (_jsxs("div", { className: "o-list-row o-smooth o-smooth-ease o-picker-parent", "data-parent": "", "aria-hidden": "true", children: [_jsx(Face, { item: r.item }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: _jsx(Name, { item: r.item }) }) })] }, "parent"));
|
|
591
|
+
return (_jsxs("div", { className: "o-list-row o-smooth o-smooth-ease o-picker-parent", "data-slot": "vk-picker-parent", "data-parent": "", "aria-hidden": "true", children: [_jsx(Face, { item: r.item }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: _jsx(Name, { item: r.item }) }) })] }, "parent"));
|
|
577
592
|
if (r.kind === "empty")
|
|
578
|
-
return (_jsx(BaseCombobox.Item, { ref: keepsToItsList, value: { key: "empty", kind: "empty", label: r.label }, className: "o-list-row o-smooth o-smooth-ease o-list-clear o-picker-empty", "data-name": r.label, children: _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: r.label }) }) }, "empty"));
|
|
579
|
-
if (r.kind === "create")
|
|
580
|
-
return (
|
|
593
|
+
return (_jsx(BaseCombobox.Item, { ref: keepsToItsList, value: { key: "empty", kind: "empty", label: r.label }, className: "o-list-row o-smooth o-smooth-ease o-list-clear o-picker-empty", "data-slot": "vk-picker-empty", "data-name": r.label, children: _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: r.label }) }) }, "empty"));
|
|
594
|
+
if (r.kind === "create" && refused !== undefined)
|
|
595
|
+
return (_jsx("div", { className: "o-picker-message", "data-slot": "vk-picker-message", role: "alert", children: _jsx("span", { className: "o-picker-message-text", children: refused }) }, "create"));
|
|
596
|
+
if (r.kind === "create") {
|
|
597
|
+
const busy = adding !== undefined;
|
|
598
|
+
return (_jsxs(BaseCombobox.Item, { ref: foot ? staysInView : keepsToItsList, value: { key: "create", kind: "create", typed: r.typed }, disabled: busy, className: cx("o-list-row o-smooth o-smooth-ease o-list-clear o-picker-create", worn.create === "apart" && "o-picker-create-apart"), "data-slot": add ? "vk-picker-add" : "vk-picker-create", children: [busy ? _jsx(Spinner, { size: 16, label: "" }) : glyph(PLUS, "o-list-plus"), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: around(add ? (busy ? w.adding(r.typed) : w.add(r.typed)) : w.create(r.typed), r.typed) }) })] }, "create"));
|
|
599
|
+
}
|
|
581
600
|
return _jsx(React.Fragment, {}, i);
|
|
582
601
|
};
|
|
583
|
-
const action = (a, foot = false) => (_jsxs(BaseCombobox.Item, { ref: foot ? staysInView : keepsToItsList, value: { key: `action:${a.id}`, kind: "action", action: a }, className: "o-list-row o-smooth o-smooth-ease o-picker-action", children: [_jsx("span", { className: "o-picker-icon", children: a.icon }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: a.label }) }), a.keys?.length ? _jsx(Kbd, { keys: a.keys }) : null] }, a.id));
|
|
602
|
+
const action = (a, foot = false) => (_jsxs(BaseCombobox.Item, { ref: foot ? staysInView : keepsToItsList, value: { key: `action:${a.id}`, kind: "action", action: a }, className: "o-list-row o-smooth o-smooth-ease o-picker-action", "data-slot": "vk-picker-action", "data-key": a.id, children: [_jsx("span", { className: "o-picker-icon", children: a.icon }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: a.label }) }), a.keys?.length ? _jsx(Kbd, { keys: a.keys }) : null] }, a.id));
|
|
584
603
|
const typed = find.trim();
|
|
585
604
|
const matches = rows.some((r) => r.kind === "item");
|
|
586
|
-
const message = doing === "searching" ? _jsxs("div", { className: "o-picker-message", children: [_jsx(Spinner, { size: 16, label: "" }), _jsx("span", { className: "o-picker-message-text", children: w.searching })] })
|
|
587
|
-
: doing === "failed" ? _jsxs("div", { className: "o-picker-message", children: [_jsx("span", { className: "o-picker-message-text", children: w.failed }), onRetry && _jsx(Button, { kind: "text", size: "2xs", onClick: onRetry, children: w.retry })] })
|
|
588
|
-
: typed && !matches ? _jsx("div", { className: "o-picker-message", children: _jsx("span", { className: "o-picker-message-text", children: noneWords ?? w.nothingMatches }) })
|
|
589
|
-
: none ? _jsx("div", { className: "o-picker-message", children: _jsx("span", { className: "o-picker-message-text", children: nothingYet.text }) })
|
|
590
|
-
: server && !typed && !items.length ? _jsx("div", { className: "o-picker-message", children: _jsx("span", { className: "o-picker-message-text", children: w.typeToSearch }) })
|
|
605
|
+
const message = doing === "searching" ? _jsxs("div", { className: "o-picker-message", "data-slot": "vk-picker-message", children: [_jsx(Spinner, { size: 16, label: "" }), _jsx("span", { className: "o-picker-message-text", children: w.searching })] })
|
|
606
|
+
: doing === "failed" ? _jsxs("div", { className: "o-picker-message", "data-slot": "vk-picker-message", children: [_jsx("span", { className: "o-picker-message-text", children: w.failed }), onRetry && _jsx(Button, { kind: "text", size: "2xs", "data-slot": "vk-picker-retry", onClick: onRetry, children: w.retry })] })
|
|
607
|
+
: typed && !matches ? _jsx("div", { className: "o-picker-message", "data-slot": "vk-picker-message", children: _jsx("span", { className: "o-picker-message-text", children: noneWords ?? w.nothingMatches }) })
|
|
608
|
+
: none ? _jsx("div", { className: "o-picker-message", "data-slot": "vk-picker-message", children: _jsx("span", { className: "o-picker-message-text", children: nothingYet.text }) })
|
|
609
|
+
: server && !typed && !items.length ? _jsx("div", { className: "o-picker-message", "data-slot": "vk-picker-message", children: _jsx("span", { className: "o-picker-message-text", children: w.typeToSearch }) })
|
|
591
610
|
: null;
|
|
592
611
|
const first = none ? { id: "first", label: nothingYet.action, icon: glyph(PLUS), onSelect: nothingYet.onAction } : null;
|
|
593
612
|
const [rowMenu, setMenuAt] = React.useState(null);
|
|
@@ -604,14 +623,14 @@ function usePickerAt(props, under) {
|
|
|
604
623
|
setRowMenu({ value: item.value, anchor: e.currentTarget });
|
|
605
624
|
};
|
|
606
625
|
return form === "phone"
|
|
607
|
-
? _jsx(MenuDots, { label: w.rowActions(item.label), className: "o-picker-row-menu", onClick: open, onKeyDown: stopKeys })
|
|
608
|
-
: _jsx(Button, { kind: "quiet", shape: "icon", size: "20", tabIndex: -1, className: "o-picker-row-menu", "data-shown": props.rowMenus ?? "always", "aria-label": w.rowActions(item.label), icon: glyph(DOTS_V), onClick: open, onKeyDown: stopKeys });
|
|
626
|
+
? _jsx(MenuDots, { label: w.rowActions(item.label), className: "o-picker-row-menu", "data-slot": "vk-picker-row-more", "data-key": item.value, onClick: open, onKeyDown: stopKeys })
|
|
627
|
+
: _jsx(Button, { kind: "quiet", shape: "icon", size: "20", tabIndex: -1, className: "o-picker-row-menu", "data-slot": "vk-picker-row-more", "data-key": item.value, "data-shown": props.rowMenus ?? "always", "aria-label": w.rowActions(item.label), icon: glyph(DOTS_V), onClick: open, onKeyDown: stopKeys });
|
|
609
628
|
};
|
|
610
629
|
const hasMenu = (item) => !!item.menu?.length;
|
|
611
630
|
const menuItem = rowMenu ? itemOf(rowMenu.value) : undefined;
|
|
612
631
|
const rowMenuEl = items.some(hasMenu)
|
|
613
632
|
? _jsx(Menu, { label: menuItem?.label ?? label, entries: menuItem?.menu ?? [], anchor: rowMenu?.anchor ?? null, align: rowMenu?.anchor instanceof HTMLElement ? "end" : "start", open: !!rowMenu?.open, onOpenChange: (o) => { if (!o)
|
|
614
|
-
setMenuAt((m) => m && { ...m, open: false }); }, frame: props.menuFrame, words: menuWords })
|
|
633
|
+
setMenuAt((m) => m && { ...m, open: false }); }, frame: props.menuFrame, words: menuWords, "data-slot": props.menuSlot })
|
|
615
634
|
: null;
|
|
616
635
|
const ordering = !!props.onOrderChange && !find.trim() && !level;
|
|
617
636
|
const keptNow = multiple && own ? draft : held;
|
|
@@ -722,6 +741,7 @@ function usePickerAt(props, under) {
|
|
|
722
741
|
const parent = listRows[0]?.kind === "parent" ? listRows[0] : undefined;
|
|
723
742
|
const rest = listRows.filter((r) => r.kind === "item" && !isKept(r.item.value));
|
|
724
743
|
const creatable = create && !!typed && !exactMatch(level?.level ?? items, query);
|
|
744
|
+
const addable = add && (adding !== undefined || (creatable && refused === undefined));
|
|
725
745
|
const leave = () => { setDraft(holdingNow.current); ask(""); onDone?.(); };
|
|
726
746
|
const createTyped = () => {
|
|
727
747
|
const v = make(typed);
|
|
@@ -771,9 +791,9 @@ function usePickerAt(props, under) {
|
|
|
771
791
|
}
|
|
772
792
|
};
|
|
773
793
|
const label_ = changing ? w.selectedCount(kept.length) : fixed ? w.selectedFixed : w.selected;
|
|
774
|
-
const note = doing === "searching" ? _jsxs("div", { className: "o-picker-note", children: [_jsx(Spinner, { size: 20, label: "" }), w.searching] })
|
|
775
|
-
: doing === "failed" ? _jsxs("div", { className: "o-picker-note", children: [_jsxs("span", { children: [_jsx("b", { children: w.failed }), _jsx("br", {}), w.failedLine] }), onRetry && _jsx(Button, { kind: "soft", size: "lg", icon: glyph(REFRESH), onClick: onRetry, children: w.retry })] })
|
|
776
|
-
: typed && !rest.length ? _jsx("div", { className: "o-picker-note", children: noneWords ?? around(w.noneTyped(typed), typed) })
|
|
794
|
+
const note = doing === "searching" ? _jsxs("div", { className: "o-picker-note", "data-slot": "vk-picker-message", children: [_jsx(Spinner, { size: 20, label: "" }), w.searching] })
|
|
795
|
+
: doing === "failed" ? _jsxs("div", { className: "o-picker-note", "data-slot": "vk-picker-message", children: [_jsxs("span", { children: [_jsx("b", { children: w.failed }), _jsx("br", {}), w.failedLine] }), onRetry && _jsx(Button, { kind: "soft", size: "lg", icon: glyph(REFRESH), "data-slot": "vk-picker-retry", onClick: onRetry, children: w.retry })] })
|
|
796
|
+
: typed && !rest.length ? _jsx("div", { className: "o-picker-note", "data-slot": "vk-picker-message", children: noneWords ?? around(w.noneTyped(typed), typed) })
|
|
777
797
|
: null;
|
|
778
798
|
const pill = props.searchShown ?? (worn.search === "always" || searchShown({ count: items.length, create, server, query }));
|
|
779
799
|
const at = (i, matching) => (typed ? (matching ? i : rest.length + i) : (matching ? keptItems.length + i : i));
|
|
@@ -784,28 +804,29 @@ function usePickerAt(props, under) {
|
|
|
784
804
|
e.preventBaseUIHandler?.();
|
|
785
805
|
};
|
|
786
806
|
const under = !!props.actionsUnder && !none;
|
|
787
|
-
const menu = under ? [] : actions.map((a) => ({ icon: a.icon, label: a.label, onSelect: a.onSelect }));
|
|
788
|
-
const underActions = under && !typed && actions.length > 0 && (_jsx("div", { className: "o-picker-under", children: actions.map((a) => _jsx(Button, { kind: "outline", size: "44", icon: a.icon, onClick: a.onSelect, children: a.label }, a.id)) }));
|
|
789
|
-
const showBar = !none && (pill || creatable || menu.length > 0 || (!!level && !byHolder));
|
|
790
|
-
const bar = showBar && (_jsxs("div", { className: "o-picker-bar", children: [level && !byHolder && _jsx(GlassButton, { "aria-label": w.back(level.label), icon: glyph(BACK), className: "o-picker-round", "data-back": "", onMouseDown: (e) => e.preventDefault(), onClick: () => back() }), pill && (_jsxs(InputGroup, { size: "lg", className: "o-picker-pill", ...pillTap, children: [_jsx(InputGroupAddon, { side: "start", children: glyph(SEARCH) }), _jsx(Input, { combobox: true, autofill: false, ref: pillInput, placeholder: search, "aria-label": search ?? label, onKeyDown: (e) => { if (!backKey(e))
|
|
791
|
-
enter(e); } })] })),
|
|
792
|
-
:
|
|
807
|
+
const menu = under ? [] : actions.map((a) => ({ icon: a.icon, label: a.label, onSelect: a.onSelect, slot: { slot: "vk-picker-action", key: a.id } }));
|
|
808
|
+
const underActions = under && !typed && actions.length > 0 && (_jsx("div", { className: "o-picker-under", children: actions.map((a) => _jsx(Button, { kind: "outline", size: "44", icon: a.icon, "data-slot": "vk-picker-action", "data-key": a.id, onClick: a.onSelect, children: a.label }, a.id)) }));
|
|
809
|
+
const showBar = !none && (pill || creatable || addable || menu.length > 0 || (!!level && !byHolder));
|
|
810
|
+
const bar = showBar && (_jsxs("div", { className: "o-picker-bar", children: [level && !byHolder && _jsx(GlassButton, { "aria-label": w.back(level.label), icon: glyph(BACK), className: "o-picker-round", "data-slot": "vk-picker-back", "data-back": "", onMouseDown: (e) => e.preventDefault(), onClick: () => back() }), pill && (_jsxs(InputGroup, { size: "lg", className: "o-picker-pill", "data-slot": "vk-picker-search", ...pillTap, children: [_jsx(InputGroupAddon, { side: "start", children: glyph(SEARCH) }), _jsx(Input, { combobox: true, autofill: false, ref: pillInput, placeholder: search, "aria-label": search ?? label, onKeyDown: (e) => { if (!backKey(e))
|
|
811
|
+
enter(e); } })] })), addable ? _jsx(Button, { kind: "primary", size: "lg", icon: glyph(PLUS), loading: adding !== undefined, className: "o-picker-create-button", "data-slot": "vk-picker-add", onClick: () => onAdd(typed), children: w.addButton })
|
|
812
|
+
: creatable && !add ? _jsx(Button, { kind: "primary", size: "lg", icon: glyph(PLUS), className: "o-picker-create-button", "data-slot": "vk-picker-create", onClick: createTyped, children: w.createButton })
|
|
813
|
+
: menu.length > 0 && _jsx(Menu, { label: label, entries: menu, words: menuWords, trigger: _jsx(GlassButton, { "aria-label": w.actions, icon: glyph(DOTS), className: "o-picker-round", "data-slot": "vk-picker-more" }) })] }));
|
|
793
814
|
const menuOpen = (item) => (menuOpenFor(item.value) ? { "data-menu-open": "" } : {});
|
|
794
815
|
const heldHere = (v) => inPlace && kept.includes(v);
|
|
795
816
|
const rowValue = (item) => (heldHere(item.value) && !changing ? { key: `unpick:${item.value}`, kind: "unpick", item } : itemEntry(item));
|
|
796
817
|
const circleOf = (v) => (changing ? (heldHere(v) ? "on" : "off") : heldHere(v) ? "on" : null);
|
|
797
|
-
const rowOf = (r, i) => _jsx(BaseCombobox.Item, { ref: keepsToItsList, index: at(i, true), value: rowValue(r.item), disabled: r.item.disabled, className: "o-picker-row", "data-indent": r.indent ? "" : undefined, "data-opens": r.opens ? "" : undefined, "data-name": r.item.label, ...menuOpen(r.item), ...orderProps(r.item.value), children: _jsx(PhoneRow, { item: r.item, kind: worn.kind, you: w.you, circle: circleOf(r.item.value), box: boxes, count: r.opens ? r.count : undefined, menu: hasMenu(r.item) ? rowTrigger(r.item) : undefined }) }, r.item.value);
|
|
818
|
+
const rowOf = (r, i) => _jsx(BaseCombobox.Item, { ref: keepsToItsList, index: at(i, true), value: rowValue(r.item), disabled: r.item.disabled, className: "o-picker-row", "data-indent": r.indent ? "" : undefined, "data-opens": r.opens ? "" : undefined, "data-name": r.item.label, ...partAttrs(r.item.slot ?? { slot: "vk-picker-option", key: r.item.value }), ...menuOpen(r.item), ...orderProps(r.item.value), children: _jsx(PhoneRow, { item: r.item, kind: worn.kind, you: w.you, circle: circleOf(r.item.value), box: boxes, count: r.opens ? r.count : undefined, menu: hasMenu(r.item) ? rowTrigger(r.item) : undefined }) }, r.item.value);
|
|
798
819
|
const listed = rest.map(rowOf);
|
|
799
820
|
const headed = inPlace && !parent && !typed && rest.some((r) => r.item.group);
|
|
800
821
|
const cards = headed ? (() => {
|
|
801
822
|
let k = 0;
|
|
802
823
|
return phoneGroups(rest.map((r) => r.item)).map((g) => {
|
|
803
824
|
const rows = g.items.map(() => { const r = rest[k]; return rowOf(r, k++); });
|
|
804
|
-
return (_jsxs(BaseCombobox.Group, { className: "o-picker-group", children: [g.name && _jsx(BaseCombobox.GroupLabel, { className: "o-picker-label", children: g.name }), _jsx("div", { className: "o-picker-card o-picker-list", "data-heading": g.name || undefined, children: rows })] }, g.name || "-"));
|
|
825
|
+
return (_jsxs(BaseCombobox.Group, { className: "o-picker-group", "data-slot": "vk-picker-group", children: [g.name && _jsx(BaseCombobox.GroupLabel, { className: "o-picker-label", "data-slot": "vk-picker-heading", children: g.name }), _jsx("div", { className: "o-picker-card o-picker-list", "data-slot": "vk-picker-card", "data-heading": g.name || undefined, children: rows })] }, g.name || "-"));
|
|
805
826
|
});
|
|
806
827
|
})() : null;
|
|
807
|
-
const body = (_jsxs(BaseCombobox.Root, { inline: true, open: true, multiple: changing, value: (changing ? kept.map((v) => itemEntry(itemOf(v))) : held[0] != null ? { key: `unpick:${held[0]}`, kind: "unpick", item: itemOf(held[0]) } : null), onValueChange: (v, d) => tap(v, d), inputValue: query, onInputValueChange: ask, autoHighlight: true, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [_jsxs("div", { ref: placeRoot, className: "o-picker", "data-kit": "picker", "data-picker-form": "phone", ...phoneMark(!!host || small), "data-typed": typed ? "" : undefined, style: room ? { "--picker-room": `${room.height}px`, "--picker-under": `${room.under}px` } : undefined, children: [none ? (_jsxs("div", { className: "o-picker-note o-picker-first", children: [_jsxs("span", { children: [_jsx("b", { children: nothingYet.text }), nothingYet.line && _jsxs(_Fragment, { children: [_jsx("br", {}), nothingYet.line] })] }), _jsx(Button, { kind: "primary", size: "lg", icon: glyph(PLUS), onClick: nothingYet.onAction, children: nothingYet.action })] })) : (_jsxs(_Fragment, { children: [_jsxs(BaseCombobox.List, { className: "o-picker-phone", "aria-label": label, children: [keptItems.length > 0 && (_jsxs(BaseCombobox.Group, { className: "o-picker-group", children: [_jsx(BaseCombobox.GroupLabel, { className: "o-picker-label", children: label_ }), _jsx("div", { className: "o-picker-card o-picker-selected", children: keptItems.map((item, i) => (_jsx(BaseCombobox.Item, { ref: keepsToItsList, index: at(i, false), value: changing ? itemEntry(item) : { key: `unpick:${item.value}`, kind: "unpick", item }, className: "o-picker-row", ...menuOpen(item), children: _jsx(PhoneRow, { item: item, kind: worn.kind, you: w.you, circle: fixed ? "fixed" : "on", box: boxes, lead: changing && !own && props.lead ? _jsx(LeadMark, { lead: props.lead, value: item.value }) : undefined, menu: hasMenu(item) ? rowTrigger(item) : undefined }) }, item.value))) })] })), headed && !note && cards, !headed && (parent || (!note && rest.length > 0)) && (_jsxs("div", { className: "o-picker-card o-picker-list", children: [parent && _jsx("div", { className: "o-picker-row o-picker-parent", "data-parent": "", "aria-hidden": "true", children: _jsx(PhoneRow, { item: parent.item, kind: worn.kind, you: w.you, circle: null }) }), !note && rest.length > 0 && (parent ? _jsx("div", { className: "o-picker-level", children: listed }) : listed)] }))] }), note, underActions, onMore && !doing && _jsxs("div", { ref: more, className: "o-picker-more", children: [_jsx(Spinner, { size: 16, label: "" }), w.loadingMore] })] })), bar] }), rowMenuEl] }));
|
|
808
|
-
const head = changing && own ? { left: _jsx(SheetButton, { onClick: leave, children: w.cancel }), right: _jsx(SheetButton, { kind: "primary", "aria-label": w.save, icon: glyph(TICK), onClick: () => { onValueChange(draft); ask(""); onDone?.(); } }) }
|
|
828
|
+
const body = (_jsxs(BaseCombobox.Root, { inline: true, open: true, multiple: changing, value: (changing ? kept.map((v) => itemEntry(itemOf(v))) : held[0] != null ? { key: `unpick:${held[0]}`, kind: "unpick", item: itemOf(held[0]) } : null), onValueChange: (v, d) => tap(v, d), inputValue: query, onInputValueChange: ask, autoHighlight: true, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [_jsxs("div", { ref: placeRoot, className: "o-picker", "data-slot": "vk-picker", "data-kit": "picker", "data-picker-form": "phone", ...phoneMark(!!host || small), "data-typed": typed ? "" : undefined, style: room ? { "--picker-room": `${room.height}px`, "--picker-under": `${room.under}px` } : undefined, children: [none ? (_jsxs("div", { className: "o-picker-note o-picker-first", "data-slot": "vk-picker-message", "data-key": "first", children: [_jsxs("span", { children: [_jsx("b", { children: nothingYet.text }), nothingYet.line && _jsxs(_Fragment, { children: [_jsx("br", {}), nothingYet.line] })] }), _jsx(Button, { kind: "primary", size: "lg", icon: glyph(PLUS), "data-slot": "vk-picker-action", "data-key": "first", onClick: nothingYet.onAction, children: nothingYet.action })] })) : (_jsxs(_Fragment, { children: [_jsxs(BaseCombobox.List, { className: "o-picker-phone", "data-slot": "vk-picker-list", "aria-label": label, children: [keptItems.length > 0 && (_jsxs(BaseCombobox.Group, { className: "o-picker-group", "data-slot": "vk-picker-group", children: [_jsx(BaseCombobox.GroupLabel, { className: "o-picker-label", "data-slot": "vk-picker-heading", children: label_ }), _jsx("div", { className: "o-picker-card o-picker-selected", "data-slot": "vk-picker-selected", children: keptItems.map((item, i) => (_jsx(BaseCombobox.Item, { ref: keepsToItsList, index: at(i, false), value: changing ? itemEntry(item) : { key: `unpick:${item.value}`, kind: "unpick", item }, className: "o-picker-row", ...partAttrs(item.slot ?? { slot: "vk-picker-option", key: item.value }), ...menuOpen(item), children: _jsx(PhoneRow, { item: item, kind: worn.kind, you: w.you, circle: fixed ? "fixed" : "on", box: boxes, lead: changing && !own && props.lead ? _jsx(LeadMark, { lead: props.lead, value: item.value }) : undefined, menu: hasMenu(item) ? rowTrigger(item) : undefined }) }, item.value))) })] })), headed && !note && cards, !headed && (parent || (!note && rest.length > 0)) && (_jsxs("div", { className: "o-picker-card o-picker-list", "data-slot": "vk-picker-card", children: [parent && _jsx("div", { className: "o-picker-row o-picker-parent", "data-slot": "vk-picker-parent", "data-parent": "", "aria-hidden": "true", children: _jsx(PhoneRow, { item: parent.item, kind: worn.kind, you: w.you, circle: null }) }), !note && rest.length > 0 && (parent ? _jsx("div", { className: "o-picker-level", children: listed }) : listed)] }))] }), note, refused !== undefined && !doing && _jsx("div", { className: "o-picker-note", "data-slot": "vk-picker-message", role: "alert", children: refused }), underActions, onMore && !doing && _jsxs("div", { ref: more, className: "o-picker-more", "data-slot": "vk-picker-loading", children: [_jsx(Spinner, { size: 16, label: "" }), w.loadingMore] })] })), bar] }), rowMenuEl] }));
|
|
829
|
+
const head = changing && own ? { left: _jsx(SheetButton, { "data-slot": "vk-editor-cancel", onClick: leave, children: w.cancel }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": w.save, icon: glyph(TICK), onClick: () => { onValueChange(draft); ask(""); onDone?.(); } }) }
|
|
809
830
|
: {};
|
|
810
831
|
return { body, head, step: changing && own ? "change" : null };
|
|
811
832
|
}
|
|
@@ -815,15 +836,15 @@ function usePickerAt(props, under) {
|
|
|
815
836
|
const groups = grouped((parent ? rows.slice(1) : rows).filter((r) => r !== footCreate), worn.create === "apart").map((g, gi) => {
|
|
816
837
|
const line = g.line && _jsx(BaseCombobox.Separator, { className: "o-list-sep" });
|
|
817
838
|
return g.heading
|
|
818
|
-
? _jsxs(BaseCombobox.Group, { children: [line, _jsx(BaseCombobox.GroupLabel, { className: "o-list-heading", children: g.heading }), g.rows.map((r, i) => row(r, i))] }, `g${gi}`)
|
|
839
|
+
? _jsxs(BaseCombobox.Group, { "data-slot": "vk-picker-group", children: [line, _jsx(BaseCombobox.GroupLabel, { className: "o-list-heading", "data-slot": "vk-picker-heading", children: g.heading }), g.rows.map((r, i) => row(r, i))] }, `g${gi}`)
|
|
819
840
|
: _jsxs(React.Fragment, { children: [line, g.rows.map((r, i) => row(r, i))] }, `g${gi}`);
|
|
820
841
|
});
|
|
821
842
|
const soft = props.searchLook === "soft" && !chips;
|
|
822
|
-
const backButton = level && !byHolder && _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", className: "o-picker-back", "aria-label": w.back(level.label), icon: glyph(BACK), onMouseDown: (e) => e.preventDefault(), onClick: (e) => back(e.detail === 0), children: null });
|
|
823
|
-
const list = (_jsxs("div", { ref: under ? placeRoot : root, className: "o-picker o-smooth o-smooth-ease", "data-kit": "picker", "data-picker-form": form, ...phoneMark(!!host || small), "data-standing": props.standing ? "" : undefined, "data-rest": atRest ? "" : undefined, onKeyDown: keys, children: [inBox && level && _jsx("div", { className: "o-picker-search o-popup-line", children: backButton }), !inBox && soft && (_jsx("div", { className: cx("o-picker-search o-picker-search-soft", !shown && "sr-only"), "data-hidden": shown ? undefined : "", children: _jsxs(InputGroup, { size: "sm", chrome: "soft", children: [_jsx(InputGroupAddon, { children: backButton || glyph(SEARCH) }), _jsx(Input, { combobox: true, autofill: false, ref: searchBox, className: "o-picker-input", placeholder: search, "aria-label": search ?? label, onKeyDown: ends, ...restAttrs })] }) })), !inBox && !soft && (_jsxs("div", { className: cx("o-picker-search o-popup-line", !shown && !chips && "sr-only"), "data-hidden": shown || chips ? undefined : "", children: [backButton || glyph(SEARCH), chips ? (_jsxs(BaseCombobox.Chips, { className: "o-picker-chips", onMouseDown: (e) => { if (e.target.closest(".o-tag-remove")) {
|
|
843
|
+
const backButton = level && !byHolder && _jsx(Button, { kind: "quiet", shape: "icon", size: "2xs", className: "o-picker-back", "data-slot": "vk-picker-back", "aria-label": w.back(level.label), icon: glyph(BACK), onMouseDown: (e) => e.preventDefault(), onClick: (e) => back(e.detail === 0), children: null });
|
|
844
|
+
const list = (_jsxs("div", { ref: under ? placeRoot : root, className: "o-picker o-smooth o-smooth-ease", "data-slot": "vk-picker", "data-kit": "picker", "data-picker-form": form, ...phoneMark(!!host || small), "data-standing": props.standing ? "" : undefined, "data-rest": atRest ? "" : undefined, onKeyDown: keys, children: [inBox && level && _jsx("div", { className: "o-picker-search o-popup-line", children: backButton }), !inBox && soft && (_jsx("div", { className: cx("o-picker-search o-picker-search-soft", !shown && "sr-only"), "data-hidden": shown ? undefined : "", children: _jsxs(InputGroup, { size: "sm", chrome: "soft", "data-slot": "vk-picker-search", children: [_jsx(InputGroupAddon, { children: backButton || glyph(SEARCH) }), _jsx(Input, { combobox: true, autofill: false, ref: searchBox, className: "o-picker-input", placeholder: search, "aria-label": search ?? label, onKeyDown: ends, ...restAttrs })] }) })), !inBox && !soft && (_jsxs("div", { className: cx("o-picker-search o-popup-line", !shown && !chips && "sr-only"), "data-slot": "vk-picker-search", "data-hidden": shown || chips ? undefined : "", children: [backButton || glyph(SEARCH), chips ? (_jsxs(BaseCombobox.Chips, { className: "o-picker-chips", "data-slot": "vk-picker-chips", onMouseDown: (e) => { if (e.target.closest(".o-tag-remove")) {
|
|
824
845
|
e.preventDefault();
|
|
825
846
|
input.current?.focus();
|
|
826
|
-
} }, children: [heldEntries.map((e) => _jsx(BaseCombobox.Chip, { render: _jsx(Option, { onRemove: () => onValueChange(held.filter((v) => `item:${v}` !== e.key)) }), children: entryLabel(e) }, e.key)), _jsx(Input, { combobox: true, chrome: "bare", autofill: false, ref: searchBox, className: "o-picker-input", placeholder: held.length ? undefined : search, "aria-label": search ?? label, onKeyDown: ends, ...restAttrs })] })) : _jsx(Input, { combobox: true, chrome: "bare", autofill: false, ref: searchBox, className: "o-picker-input", placeholder: search, "aria-label": search ?? label, onKeyDown: ends, ...restAttrs })] })), multiple && worn.picked === "count" && held.length > 0 && _jsxs("div", { className: "o-picker-count", children: [_jsx("span", { children: around(w.chosen(held.length), String(held.length)) }), _jsx(Button, { ref: focusesInPlace, kind: "text", size: "2xs", onClick: () => onValueChange([]), children: w.clearAll })] }), message, _jsxs(BaseCombobox.List, { className: "o-picker-listbox", "aria-label": label, children: [_jsxs("div", { className: "o-picker-rows", children: [parent ? _jsxs(_Fragment, { children: [row(parent, -1), _jsx("div", { className: "o-picker-level", children: groups })] }) : groups, rows.some((r) => r.kind === "more") && _jsxs("div", { ref: more, className: "o-picker-more", children: [_jsx(Spinner, { size: 14, label: "" }), w.loadingMore] }), first && action(first)] }), _jsx(Scrollbar, {}), (footCreate || actionsShown) && (_jsxs("div", { className: "o-picker-foot o-popup-line", "data-at": "foot", children: [footCreate && row(footCreate, -1, true), actionsShown && (_jsxs(BaseCombobox.Group, { children: [worn.heading === "shown" && _jsx(BaseCombobox.GroupLabel, { className: "o-list-heading", children: w.actions }), actions.map((a) => action(a, true))] }))] }))] })] }));
|
|
847
|
+
} }, children: [heldEntries.map((e) => _jsx(BaseCombobox.Chip, { "data-slot": "vk-picker-chip", "data-key": e.key.replace(/^item:/, ""), render: _jsx(Option, { onRemove: () => onValueChange(held.filter((v) => `item:${v}` !== e.key)) }), children: entryLabel(e) }, e.key)), _jsx(Input, { combobox: true, chrome: "bare", autofill: false, ref: searchBox, className: "o-picker-input", placeholder: held.length ? undefined : search, "aria-label": search ?? label, onKeyDown: ends, ...restAttrs })] })) : _jsx(Input, { combobox: true, chrome: "bare", autofill: false, ref: searchBox, className: "o-picker-input", placeholder: search, "aria-label": search ?? label, onKeyDown: ends, ...restAttrs })] })), multiple && worn.picked === "count" && held.length > 0 && _jsxs("div", { className: "o-picker-count", "data-slot": "vk-picker-count", children: [_jsx("span", { children: around(w.chosen(held.length), String(held.length)) }), _jsx(Button, { ref: focusesInPlace, kind: "text", size: "2xs", "data-slot": "vk-picker-clear", onClick: () => onValueChange([]), children: w.clearAll })] }), message, _jsxs(BaseCombobox.List, { className: "o-picker-listbox", "data-slot": "vk-picker-list", "aria-label": label, children: [_jsxs("div", { className: "o-picker-rows", children: [parent ? _jsxs(_Fragment, { children: [row(parent, -1), _jsx("div", { className: "o-picker-level", children: groups })] }) : groups, rows.some((r) => r.kind === "more") && _jsxs("div", { ref: more, className: "o-picker-more", "data-slot": "vk-picker-loading", children: [_jsx(Spinner, { size: 14, label: "" }), w.loadingMore] }), first && action(first)] }), _jsx(Scrollbar, {}), (footCreate || actionsShown) && (_jsxs("div", { className: "o-picker-foot o-popup-line", "data-slot": "vk-picker-foot", "data-at": "foot", children: [footCreate && row(footCreate, -1, true), actionsShown && (_jsxs(BaseCombobox.Group, { children: [worn.heading === "shown" && _jsx(BaseCombobox.GroupLabel, { className: "o-list-heading", "data-slot": "vk-picker-heading", children: w.actions }), actions.map((a) => action(a, true))] }))] }))] })] }));
|
|
827
848
|
const value_ = (multiple ? heldEntries : heldEntries[0] ?? null);
|
|
828
849
|
const highlighted = (v, d) => {
|
|
829
850
|
lit.current = d.index;
|
|
@@ -835,7 +856,7 @@ function usePickerAt(props, under) {
|
|
|
835
856
|
setListLit(byList);
|
|
836
857
|
};
|
|
837
858
|
const body = under ? (_jsxs(BaseCombobox.Root, { open: under.open, onOpenChange: (o, d) => {
|
|
838
|
-
if (!o && d.reason === "item-press" && litRow.current?.kind === "action") {
|
|
859
|
+
if (!o && d.reason === "item-press" && (litRow.current?.kind === "action" || (litRow.current?.kind === "create" && onAdd))) {
|
|
839
860
|
d.cancel();
|
|
840
861
|
return;
|
|
841
862
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PartSlot } from "../internal/part-slot.js";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
import type { StatusPlace } from "../status/status.js";
|
|
3
4
|
import type { MenuEntry } from "../menu-list/menu-list.js";
|
|
@@ -41,6 +42,9 @@ export interface PickerItem {
|
|
|
41
42
|
menu?: MenuEntry[];
|
|
42
43
|
count?: number;
|
|
43
44
|
after?: ReactNode;
|
|
45
|
+
/** Its public name and which one it is (VK-988), drawn on its row as `data-slot` and `data-key`: a panel's own row (a view in the
|
|
46
|
+
* views list). A name a panel hands wins over any the Picker draws by default. */
|
|
47
|
+
slot?: PartSlot;
|
|
44
48
|
}
|
|
45
49
|
export type PickerRow = {
|
|
46
50
|
kind: "empty";
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
.o-picker .o-list-row:is([data-selected], [aria-selected="true"]) > .o-picker-check { visibility: visible; }
|
|
29
29
|
/* Create below a line (Create: Below a line, Attio's): its words the text's, not the quieter ones. */
|
|
30
30
|
.o-list-row.o-picker-create-apart .o-list-main { color: var(--vk-fg); }
|
|
31
|
+
/* + Add while the app answers (Adding…): greyed, as a row that can't be picked is, wherever Create stands. */
|
|
32
|
+
.o-list-row.o-picker-create[data-disabled] .o-list-main { color: var(--vk-fg-disabled); }
|
|
31
33
|
|
|
32
34
|
/* ── The search: the shared line across a popup's top (popup-line.css), 6 above and below round its chips, 4 over the
|
|
33
35
|
rows. With nothing to search it stays, out of sight, so the keys still work; a letter typed brings it back holding the
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ViewsPopoverProps } from "../../provider/components.js";
|
|
2
2
|
/** ViewKit's popup, drawn as the kit's Popover. */
|
|
3
|
-
export declare function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, chrome, onPanelClick, panelData, style, className, children }: ViewsPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, chrome, onPanelClick, panelData, style, className, label, children }: ViewsPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Popover } from "./popover.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { markOwnControl } from "../../provider/own-control.js";
|
|
4
|
+
export function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, chrome, onPanelClick, panelData, style, className, label, children }) {
|
|
5
|
+
return (_jsx(Popover, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, initialFocus: initialFocus, onOutsidePress: onOutsidePress, onEscape: onEscape, style: style, onPopupClick: onPanelClick, popupData: chrome === "menu" ? { ...panelData, "data-popover-chrome": "menu" } : panelData, className: className, "aria-label": label, children: children }));
|
|
5
6
|
}
|
|
7
|
+
markOwnControl(MapPopover);
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
4
4
|
import { cx } from "../../internal/cx.js";
|
|
5
|
+
import { OutOfFieldRows } from "../../internal/field-rows.js";
|
|
5
6
|
import { anchorElement, isElement, positionerAnchor } from "../internal/anchor.js";
|
|
6
7
|
import { closeReasonOf } from "../internal/close-reason.js";
|
|
7
8
|
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
@@ -95,7 +96,7 @@ export function Popover({ open, defaultOpen, onOpenChange, trigger, anchor, side
|
|
|
95
96
|
setShown(next);
|
|
96
97
|
onOpenChange?.(next, { reason: reasonOf(details.reason), event: details.event });
|
|
97
98
|
};
|
|
98
|
-
return (_jsxs(BasePopover.Root, { open: isOpen, onOpenChange: change, children: [trigger && _jsx(BasePopover.Trigger, { ref: holdOpener, render: trigger }), _jsx(BasePopover.Portal, { container: host, children: _jsx(BasePopover.Positioner, { ref: setPositioner, className: "o-popover-positioner", anchor: placed, positionMethod: "fixed", side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, children: _jsxs(BasePopover.Popup, { ref: popup, className: cx("o-popover", className), "data-kit": "popover", "aria-label": label, initialFocus: initialFocus, finalFocus: finalFocus, style: style, onClick: onPopupClick, "data-over": sideOffset < 0 ? "" : undefined, ...phoneMark(phone), ...popupData, children: [_jsx("div", { className: "o-popover-cut o-smooth", children: _jsx(InPane.Provider, { value: false, children: children }) }), _jsx(Scrollbar, {})] }) }) })] }));
|
|
99
|
+
return (_jsxs(BasePopover.Root, { open: isOpen, onOpenChange: change, children: [trigger && _jsx(BasePopover.Trigger, { ref: holdOpener, render: trigger }), _jsx(BasePopover.Portal, { container: host, children: _jsx(BasePopover.Positioner, { ref: setPositioner, className: "o-popover-positioner", anchor: placed, positionMethod: "fixed", side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, children: _jsxs(BasePopover.Popup, { ref: popup, className: cx("o-popover", className), "data-kit": "popover", "aria-label": label, initialFocus: initialFocus, finalFocus: finalFocus, style: style, onClick: onPopupClick, "data-over": sideOffset < 0 ? "" : undefined, ...phoneMark(phone), ...popupData, children: [_jsx("div", { className: "o-popover-cut o-smooth", children: _jsx(InPane.Provider, { value: false, children: _jsx(OutOfFieldRows, { children: children }) }) }), _jsx(Scrollbar, {})] }) }) })] }));
|
|
99
100
|
}
|
|
100
101
|
export function PopoverTitle({ children, className }) {
|
|
101
102
|
return _jsx(BasePopover.Title, { className: cx("o-popover-title", className), children: children });
|
|
@@ -52,7 +52,7 @@ function Values({ field, values, held, several, onPress, search, phone, clear })
|
|
|
52
52
|
};
|
|
53
53
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "o-quick-filters-values", role: "listbox", "aria-label": field.name, "aria-multiselectable": several || undefined, "data-quiet": held.length ? "" : undefined, children: values.map((v, i) => {
|
|
54
54
|
const on = held.includes(v.value);
|
|
55
|
-
return (_jsxs("div", { ref: (el) => { rows.current[i] = el; }, role: "option", "aria-selected": on, tabIndex: i === here ? 0 : -1, className: "o-quick-filters-value", "data-held": on ? "" : undefined, onClick: () => { setAt(i); onPress(v.value); }, onKeyDown: (e) => keys(e, i), children: [_jsx(Mark, { value: v, phone: phone }), _jsx("span", { className: "o-quick-filters-name", children: v.label }), on && _jsx("span", { className: "o-quick-filters-clear", "aria-hidden": "true", children: clear }), v.count !== undefined && _jsx("span", { className: "o-quick-filters-count", children: v.count.toLocaleString("en-GB") })] }, v.value));
|
|
55
|
+
return (_jsxs("div", { ref: (el) => { rows.current[i] = el; }, role: "option", "aria-selected": on, tabIndex: i === here ? 0 : -1, className: "o-quick-filters-value", "data-slot": "vk-quick-value", "data-key": v.value, "data-held": on ? "" : undefined, onClick: () => { setAt(i); onPress(v.value); }, onKeyDown: (e) => keys(e, i), children: [_jsx(Mark, { value: v, phone: phone }), _jsx("span", { className: "o-quick-filters-name", children: v.label }), on && _jsx("span", { className: "o-quick-filters-clear", "data-slot": "vk-quick-clear", "aria-hidden": "true", children: clear }), v.count !== undefined && _jsx("span", { className: "o-quick-filters-count", "data-slot": "vk-quick-count", children: v.count.toLocaleString("en-GB") })] }, v.value));
|
|
56
56
|
}) }), _jsx(Scrollbar, {})] }));
|
|
57
57
|
}
|
|
58
58
|
export function QuickFilters({ fields, holds, onHoldsChange, open: openGiven, onOpenChange, counts = true, form: given, onDone, words, className }) {
|
|
@@ -82,8 +82,8 @@ export function QuickFilters({ fields, holds, onHoldsChange, open: openGiven, on
|
|
|
82
82
|
e.preventDefault();
|
|
83
83
|
root.current?.querySelector(".o-quick-filters-value")?.focus();
|
|
84
84
|
};
|
|
85
|
-
return (_jsxs("div", { ref: root, className: cx("o-quick-filters", className), "data-kit": "quick-filters", "data-form": form, children: [_jsxs("div", { className: "o-quick-filters-top", children: [_jsx(ToggleGroup, { "aria-label": w.fields, kind: "pill", size: phone ? "sm" : "xs", spacing: phone ? 2 : 1.5, value: [field.id], onValueChange: (v) => { if (v[0])
|
|
86
|
-
show(v[0]); }, className: "o-quick-filters-strip", children: fields.map((f) => _jsx(Toggle, { value: f.id, children: f.name }, f.id)) }), searching && (_jsxs(InputGroup, { size: phone ? "lg" : "sm", chrome: "soft", children: [_jsx(InputGroupAddon, { children: _jsx(Icon, { name: "search" }) }), _jsx(Input, { ref: searchBox, value: query, onValueChange: setQuery, placeholder: field.search, "aria-label": field.search ?? w.search(field.name), onKeyDown: toFirst })] }))] }), values.length || !query
|
|
85
|
+
return (_jsxs("div", { ref: root, className: cx("o-quick-filters", className), "data-slot": "vk-quick", "data-kit": "quick-filters", "data-form": form, children: [_jsxs("div", { className: "o-quick-filters-top", children: [_jsx(ToggleGroup, { "aria-label": w.fields, kind: "pill", size: phone ? "sm" : "xs", spacing: phone ? 2 : 1.5, value: [field.id], onValueChange: (v) => { if (v[0])
|
|
86
|
+
show(v[0]); }, className: "o-quick-filters-strip", children: fields.map((f) => _jsx(Toggle, { value: f.id, "data-slot": "vk-quick-field", "data-key": f.id, children: f.name }, f.id)) }), searching && (_jsxs(InputGroup, { size: phone ? "lg" : "sm", chrome: "soft", "data-slot": "vk-quick-search", children: [_jsx(InputGroupAddon, { children: _jsx(Icon, { name: "search" }) }), _jsx(Input, { ref: searchBox, value: query, onValueChange: setQuery, placeholder: field.search, "aria-label": field.search ?? w.search(field.name), onKeyDown: toFirst })] }))] }), values.length || !query
|
|
87
87
|
? _jsx(Values, { field: field, values: values, held: heldIn(holds, field.id), several: holding === "several", onPress: press, search: searchBox, phone: phone, clear: w.clear }, `${field.id}:${query}`)
|
|
88
|
-
: _jsx("p", { className: "o-quick-filters-none", role: "status", children: w.none })] }));
|
|
88
|
+
: _jsx("p", { className: "o-quick-filters-none", "data-slot": "vk-quick-none", role: "status", children: w.none })] }));
|
|
89
89
|
}
|
|
@@ -16,14 +16,18 @@ export interface RadioGroupProps extends Omit<React.ComponentProps<typeof BaseRa
|
|
|
16
16
|
}
|
|
17
17
|
/** Exactly one of a few choices, all of them in sight: its name, then its Radios. With a name, the group is a
|
|
18
18
|
* FieldSet, its name the legend (Base UI names the radio group by it). */
|
|
19
|
-
export declare function RadioGroup(
|
|
19
|
+
export declare function RadioGroup(props: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export interface RadioProps extends Omit<React.ComponentProps<typeof BaseRadio.Root>, "className"> {
|
|
21
|
+
/** Its public name where a panel names it (VK-988), drawn on its label with `data-key`: `vk-customize-layout`, say. */
|
|
22
|
+
"data-slot"?: string;
|
|
23
|
+
"data-key"?: string;
|
|
21
24
|
/** The choice. Without one, give it an aria-label. */
|
|
22
25
|
label?: React.ReactNode;
|
|
23
26
|
/** A line under the label that explains it, or says why it is locked. */
|
|
24
27
|
note?: React.ReactNode;
|
|
25
28
|
/** Drawn as a card: an edge round the ring and its words, the whole card pressing it, the chosen one in
|
|
26
|
-
* the selected colours. For a few choices that each need their line read (a pipeline's start).
|
|
29
|
+
* the selected colours. For a few choices that each need their line read (a pipeline's start). On a phone the cards are
|
|
30
|
+
* iOS's ✓ rows on one card (VK-968). */
|
|
27
31
|
card?: boolean;
|
|
28
32
|
/** A mark in place of the ring (a layout's icon): a card, the mark over its name and its line, the chosen one ringed in
|
|
29
33
|
* the brand. Disabled, it stands dashed and greyed, with no line, and the arrows pass it by. */
|
|
@@ -36,5 +40,6 @@ export interface RadioProps extends Omit<React.ComponentProps<typeof BaseRadio.R
|
|
|
36
40
|
picture?: React.ReactNode;
|
|
37
41
|
className?: string;
|
|
38
42
|
}
|
|
39
|
-
/** One choice of a RadioGroup: a ring that fills with the brand and a dot when it is the one chosen.
|
|
43
|
+
/** One choice of a RadioGroup: a ring that fills with the brand and a dot when it is the one chosen. On a phone a group of cards
|
|
44
|
+
* is iOS's ✓ rows: one card, a line between each, the chosen one's ✓ at its end. */
|
|
40
45
|
export declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -4,20 +4,37 @@ import * as React from "react";
|
|
|
4
4
|
import { Radio as BaseRadio } from "@base-ui/react/radio";
|
|
5
5
|
import { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group";
|
|
6
6
|
import { cx } from "../../internal/cx.js";
|
|
7
|
+
import { AtSettingRowEnd } from "../../internal/field-rows.js";
|
|
7
8
|
import { FieldSet } from "../field/field.js";
|
|
8
9
|
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
9
|
-
|
|
10
|
+
import { Select } from "../select/select.js";
|
|
11
|
+
export function RadioGroup(props) {
|
|
12
|
+
const end = React.useContext(AtSettingRowEnd), radios = radiosOf(props.children);
|
|
13
|
+
if (end && !radios.some((r) => r.props.swatch != null))
|
|
14
|
+
return _jsx(RadioSelect, { ...props, radios: radios, name: end.name });
|
|
15
|
+
return _jsx(RadioChoices, { ...props });
|
|
16
|
+
}
|
|
17
|
+
const radiosOf = (children) => React.Children.toArray(children).filter((c) => React.isValidElement(c) && c.type === Radio);
|
|
18
|
+
const asWords = (v) => (v == null ? undefined : String(v));
|
|
19
|
+
function RadioSelect({ radios, name, value, defaultValue, onValueChange, disabled, className, ...props }) {
|
|
20
|
+
const items = radios.map(({ props: r }) => ({ value: String(r.value), label: typeof r.label === "string" ? r.label : String(r.value) }));
|
|
21
|
+
return (_jsx(Select, { size: "md", className: cx("o-setting-row-select", className), items: items, value: asWords(value), defaultValue: asWords(defaultValue), disabled: disabled, "aria-label": props["aria-label"] ?? name ?? "Choose", onValueChange: (v) => { if (typeof v === "string")
|
|
22
|
+
onValueChange?.(v, undefined); } }));
|
|
23
|
+
}
|
|
24
|
+
function RadioChoices({ label, row = false, tiles = false, className, children, ...props }) {
|
|
10
25
|
const phone = usePhoneForm();
|
|
11
26
|
const group = (_jsx(BaseRadioGroup, { className: cx("o-radio-group", row && "o-radio-row", tiles && "o-radio-tiles", label == null && className), ...phoneMark(phone), ...props, children: children }));
|
|
12
27
|
return label != null ? _jsx(FieldSet, { legend: label, disabled: props.disabled, className: className, children: group }) : group;
|
|
13
28
|
}
|
|
14
|
-
|
|
29
|
+
const CHECK = (_jsx("svg", { className: "o-radio-check", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M5 12l5 5l10 -10" }) }));
|
|
30
|
+
export const Radio = React.forwardRef(function Radio({ label, note, card = false, mark, swatch, picture, className, "data-slot": slot, "data-key": key, ...props }, ref) {
|
|
31
|
+
const named = { "data-slot": slot, "data-key": key };
|
|
15
32
|
const text = (label != null || note != null) && (_jsxs("span", { className: "o-choice-text", children: [label != null && _jsx("span", { className: "o-choice-label", children: label }), note != null && _jsx("span", { className: "o-choice-note", children: note })] }));
|
|
16
33
|
if (swatch != null) {
|
|
17
|
-
return (_jsxs("label", { className: cx("o-radio", "o-radio-swatched", className), "data-kit": "radio", children: [_jsx(BaseRadio.Root, { ref: ref, className: "o-radio-swatch", "data-colour": swatch, ...props }), text] }));
|
|
34
|
+
return (_jsxs("label", { className: cx("o-radio", "o-radio-swatched", className), "data-kit": "radio", ...named, children: [_jsx(BaseRadio.Root, { ref: ref, className: "o-radio-swatch", "data-colour": swatch, ...props }), text] }));
|
|
18
35
|
}
|
|
19
36
|
const pictured = picture != null, marked = mark != null || pictured;
|
|
20
|
-
return (_jsxs("label", { className: cx("o-radio", (card || marked) && "o-choice-card", marked && "o-radio-marked", pictured && "o-radio-pictured", className), "data-kit": "radio", children: [pictured && _jsx("span", { className: "o-radio-picture", "aria-hidden": "true", children: picture }), marked
|
|
37
|
+
return (_jsxs("label", { className: cx("o-radio", (card || marked) && "o-choice-card", marked && "o-radio-marked", pictured && "o-radio-pictured", className), "data-kit": "radio", ...named, children: [pictured && _jsx("span", { className: "o-radio-picture", "aria-hidden": "true", children: picture }), marked
|
|
21
38
|
? _jsx(BaseRadio.Root, { ref: ref, className: "o-radio-mark", ...props, children: mark })
|
|
22
|
-
: _jsx(BaseRadio.Root, { ref: ref, className: "o-radio-ring", ...props, children: _jsx(BaseRadio.Indicator, { keepMounted: true, className: "o-radio-dot" }) }), text] }));
|
|
39
|
+
: _jsx(BaseRadio.Root, { ref: ref, className: "o-radio-ring", ...props, children: _jsx(BaseRadio.Indicator, { keepMounted: true, className: "o-radio-dot", children: card && CHECK }) }), text] }));
|
|
23
40
|
});
|
|
@@ -14,6 +14,10 @@ export declare const RADIO_TOKENS: readonly [{
|
|
|
14
14
|
readonly name: "--vk-border-input-hovered";
|
|
15
15
|
readonly kind: "colour";
|
|
16
16
|
readonly outright: "--border-input-hovered";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-border-overlay-card";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--border-overlay-card";
|
|
17
21
|
}, {
|
|
18
22
|
readonly name: "--vk-border-selected";
|
|
19
23
|
readonly kind: "colour";
|
|
@@ -78,6 +82,10 @@ export declare const RADIO_TOKENS: readonly [{
|
|
|
78
82
|
readonly name: "--vk-fg-subtle";
|
|
79
83
|
readonly kind: "colour";
|
|
80
84
|
readonly outright: "--text-subtle";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-fg-subtlest";
|
|
87
|
+
readonly kind: "colour";
|
|
88
|
+
readonly outright: "--text-subtlest";
|
|
81
89
|
}, {
|
|
82
90
|
readonly name: "--vk-focus-offset";
|
|
83
91
|
readonly kind: "size";
|
|
@@ -86,6 +94,10 @@ export declare const RADIO_TOKENS: readonly [{
|
|
|
86
94
|
readonly name: "--vk-focus-width";
|
|
87
95
|
readonly kind: "size";
|
|
88
96
|
readonly outright: "--focus-width";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-font-size-base";
|
|
99
|
+
readonly kind: "size";
|
|
100
|
+
readonly outright: "--text-base";
|
|
89
101
|
}, {
|
|
90
102
|
readonly name: "--vk-font-weight-medium";
|
|
91
103
|
readonly kind: "size";
|
|
@@ -106,30 +118,62 @@ export declare const RADIO_TOKENS: readonly [{
|
|
|
106
118
|
readonly name: "--vk-input";
|
|
107
119
|
readonly kind: "colour";
|
|
108
120
|
readonly outright: "--background-input";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "--vk-line-height-base";
|
|
123
|
+
readonly kind: "size";
|
|
124
|
+
readonly outright: "--text-base--line-height";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "--vk-label-amber";
|
|
127
|
+
readonly kind: "colour";
|
|
128
|
+
readonly outright: "--label-amber";
|
|
109
129
|
}, {
|
|
110
130
|
readonly name: "--vk-label-amber-fill";
|
|
111
131
|
readonly kind: "colour";
|
|
112
132
|
readonly outright: "--label-amber-fill";
|
|
133
|
+
}, {
|
|
134
|
+
readonly name: "--vk-label-blue";
|
|
135
|
+
readonly kind: "colour";
|
|
136
|
+
readonly outright: "--label-blue";
|
|
113
137
|
}, {
|
|
114
138
|
readonly name: "--vk-label-blue-fill";
|
|
115
139
|
readonly kind: "colour";
|
|
116
140
|
readonly outright: "--label-blue-fill";
|
|
141
|
+
}, {
|
|
142
|
+
readonly name: "--vk-label-green";
|
|
143
|
+
readonly kind: "colour";
|
|
144
|
+
readonly outright: "--label-green";
|
|
117
145
|
}, {
|
|
118
146
|
readonly name: "--vk-label-green-fill";
|
|
119
147
|
readonly kind: "colour";
|
|
120
148
|
readonly outright: "--label-green-fill";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "--vk-label-pink";
|
|
151
|
+
readonly kind: "colour";
|
|
152
|
+
readonly outright: "--label-pink";
|
|
121
153
|
}, {
|
|
122
154
|
readonly name: "--vk-label-pink-fill";
|
|
123
155
|
readonly kind: "colour";
|
|
124
156
|
readonly outright: "--label-pink-fill";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "--vk-label-purple";
|
|
159
|
+
readonly kind: "colour";
|
|
160
|
+
readonly outright: "--label-purple";
|
|
125
161
|
}, {
|
|
126
162
|
readonly name: "--vk-label-purple-fill";
|
|
127
163
|
readonly kind: "colour";
|
|
128
164
|
readonly outright: "--label-purple-fill";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "--vk-label-red";
|
|
167
|
+
readonly kind: "colour";
|
|
168
|
+
readonly outright: "--label-red";
|
|
129
169
|
}, {
|
|
130
170
|
readonly name: "--vk-label-red-fill";
|
|
131
171
|
readonly kind: "colour";
|
|
132
172
|
readonly outright: "--label-red-fill";
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "--vk-label-teal";
|
|
175
|
+
readonly kind: "colour";
|
|
176
|
+
readonly outright: "--label-teal";
|
|
133
177
|
}, {
|
|
134
178
|
readonly name: "--vk-label-teal-fill";
|
|
135
179
|
readonly kind: "colour";
|