viewkitjs 0.26.0 → 0.28.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 +95 -0
- package/MIGRATION.md +122 -7
- package/package.json +1 -1
- package/views/dist/cells/cell-format.d.ts +3 -1
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/use-cell-format.d.ts +8 -1
- package/views/dist/cells/use-cell-format.js +13 -2
- package/views/dist/contract.d.ts +240 -3
- package/views/dist/contract.js +238 -0
- package/views/dist/controls/alert/alert.d.ts +46 -0
- package/views/dist/controls/alert/alert.js +11 -0
- package/views/dist/controls/alert/looks.d.ts +4 -0
- package/views/dist/controls/alert/looks.js +19 -0
- package/views/dist/controls/alert/tokens.d.ts +92 -0
- package/views/dist/controls/alert/tokens.js +25 -0
- package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
- package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
- package/views/dist/controls/alert-dialog/confirm.js +11 -0
- package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
- package/views/dist/controls/alert-dialog/looks.js +17 -0
- package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
- package/views/dist/controls/alert-dialog/tokens.js +32 -0
- package/views/dist/controls/alert-dialog.css +95 -0
- package/views/dist/controls/alert.css +51 -0
- package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
- package/views/dist/controls/collapsible/collapsible.js +18 -0
- package/views/dist/controls/collapsible/looks.d.ts +4 -0
- package/views/dist/controls/collapsible/looks.js +5 -0
- package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
- package/views/dist/controls/collapsible/map-collapse.js +6 -0
- package/views/dist/controls/collapsible/tokens.d.ts +68 -0
- package/views/dist/controls/collapsible/tokens.js +19 -0
- package/views/dist/controls/collapsible.css +83 -0
- package/views/dist/controls/compound-editor/map-parts-body.js +2 -1
- package/views/dist/controls/compound-editor/name-parts.js +10 -2
- package/views/dist/controls/compound-editor/place-parts.js +5 -1
- package/views/dist/controls/compound-editor/place.d.ts +2 -1
- package/views/dist/controls/compound-editor/place.js +2 -0
- package/views/dist/controls/controls.d.ts +17 -0
- package/views/dist/controls/controls.js +17 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
- package/views/dist/controls/date-editor/map-calendar.js +3 -1
- package/views/dist/controls/filter-editor/filter-editor.d.ts +56 -0
- package/views/dist/controls/filter-editor/filter-editor.js +208 -0
- package/views/dist/controls/filter-editor/how.d.ts +23 -0
- package/views/dist/controls/filter-editor/how.js +13 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +18 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +164 -0
- package/views/dist/controls/filter-editor/map-rules.d.ts +85 -0
- package/views/dist/controls/filter-editor/map-rules.js +273 -0
- package/views/dist/controls/filter-editor/parts.d.ts +46 -0
- package/views/dist/controls/filter-editor/parts.js +75 -0
- package/views/dist/controls/filter-editor/rules.d.ts +104 -0
- package/views/dist/controls/filter-editor/rules.js +148 -0
- package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
- package/views/dist/controls/filter-editor/tokens.js +23 -0
- package/views/dist/controls/filter-editor/words.d.ts +59 -0
- package/views/dist/controls/filter-editor/words.js +40 -0
- package/views/dist/controls/filter-editor.css +124 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
- package/views/dist/controls/group-editor/group-editor.js +126 -0
- package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
- package/views/dist/controls/group-editor/map-group-body.js +106 -0
- package/views/dist/controls/group-editor/rules.d.ts +48 -0
- package/views/dist/controls/group-editor/rules.js +41 -0
- package/views/dist/controls/group-editor/tokens.d.ts +15 -0
- package/views/dist/controls/group-editor/tokens.js +6 -0
- package/views/dist/controls/group-editor/words.d.ts +39 -0
- package/views/dist/controls/group-editor/words.js +21 -0
- package/views/dist/controls/group-editor.css +20 -0
- package/views/dist/controls/index.d.ts +35 -1
- package/views/dist/controls/index.js +35 -1
- package/views/dist/controls/internal/editor-parts.d.ts +47 -0
- package/views/dist/controls/internal/editor-parts.js +48 -0
- package/views/dist/controls/internal/step-return.d.ts +9 -0
- package/views/dist/controls/internal/step-return.js +27 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +80 -0
- package/views/dist/controls/links-editor/links-editor.js +329 -0
- package/views/dist/controls/links-editor/links.d.ts +62 -0
- package/views/dist/controls/links-editor/links.js +50 -0
- package/views/dist/controls/links-editor/map-links-body.d.ts +10 -0
- package/views/dist/controls/links-editor/map-links-body.js +74 -0
- package/views/dist/controls/links-editor/tokens.d.ts +71 -0
- package/views/dist/controls/links-editor/tokens.js +20 -0
- package/views/dist/controls/links-editor/words.d.ts +56 -0
- package/views/dist/controls/links-editor/words.js +33 -0
- package/views/dist/controls/links-editor.css +132 -0
- package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
- package/views/dist/controls/menu-list/menu-list.js +25 -16
- package/views/dist/controls/modal/looks.d.ts +4 -0
- package/views/dist/controls/modal/looks.js +25 -0
- package/views/dist/controls/modal/modal.d.ts +69 -0
- package/views/dist/controls/modal/modal.js +62 -0
- package/views/dist/controls/modal/tokens.d.ts +192 -0
- package/views/dist/controls/modal/tokens.js +50 -0
- package/views/dist/controls/modal.css +130 -0
- package/views/dist/controls/notice/notice.d.ts +49 -0
- package/views/dist/controls/notice/notice.js +35 -0
- package/views/dist/controls/notice/tokens.d.ts +99 -0
- package/views/dist/controls/notice/tokens.js +27 -0
- package/views/dist/controls/notice.css +100 -0
- package/views/dist/controls/number-editor/format.d.ts +31 -0
- package/views/dist/controls/number-editor/format.js +79 -0
- package/views/dist/controls/number-editor/looks.d.ts +14 -0
- package/views/dist/controls/number-editor/looks.js +17 -0
- package/views/dist/controls/number-editor/map-number-body.d.ts +16 -0
- package/views/dist/controls/number-editor/map-number-body.js +57 -0
- package/views/dist/controls/number-editor/number-editor.d.ts +72 -0
- package/views/dist/controls/number-editor/number-editor.js +202 -0
- package/views/dist/controls/number-editor/tokens.d.ts +28 -0
- package/views/dist/controls/number-editor/tokens.js +9 -0
- package/views/dist/controls/number-editor/words.d.ts +23 -0
- package/views/dist/controls/number-editor/words.js +13 -0
- package/views/dist/controls/number-editor.css +37 -0
- package/views/dist/controls/number-field/number-field.js +57 -5
- package/views/dist/controls/pane/looks.d.ts +4 -0
- package/views/dist/controls/pane/looks.js +11 -0
- package/views/dist/controls/pane/pane.d.ts +63 -0
- package/views/dist/controls/pane/pane.js +98 -0
- package/views/dist/controls/pane/state.d.ts +14 -0
- package/views/dist/controls/pane/state.js +7 -0
- package/views/dist/controls/pane/tokens.d.ts +79 -0
- package/views/dist/controls/pane/tokens.js +22 -0
- package/views/dist/controls/pane.css +104 -0
- package/views/dist/controls/picker/rows.d.ts +4 -2
- package/views/dist/controls/picker/rows.js +4 -3
- package/views/dist/controls/radio/radio.d.ts +33 -0
- package/views/dist/controls/radio/radio.js +19 -0
- package/views/dist/controls/radio/tokens.d.ts +127 -0
- package/views/dist/controls/radio/tokens.js +34 -0
- package/views/dist/controls/radio.css +104 -0
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
- package/views/dist/controls/sort-editor/rules.d.ts +48 -0
- package/views/dist/controls/sort-editor/rules.js +24 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
- package/views/dist/controls/sort-editor/sort-editor.js +180 -0
- package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
- package/views/dist/controls/sort-editor/tokens.js +22 -0
- package/views/dist/controls/sort-editor/words.d.ts +48 -0
- package/views/dist/controls/sort-editor/words.js +25 -0
- package/views/dist/controls/sort-editor.css +96 -0
- package/views/dist/controls/text-editor/phone-number.d.ts +4 -0
- package/views/dist/controls/text-editor/phone-number.js +20 -0
- package/views/dist/controls/text-editor/text-editor.js +2 -19
- package/views/dist/controls/toast/toast.d.ts +75 -0
- package/views/dist/controls/toast/toast.js +99 -0
- package/views/dist/controls/toast/tokens.d.ts +100 -0
- package/views/dist/controls/toast/tokens.js +27 -0
- package/views/dist/controls/toast.css +93 -0
- package/views/dist/controls/tokens.js +30 -0
- package/views/dist/controls/values-editor/looks.d.ts +16 -0
- package/views/dist/controls/values-editor/looks.js +19 -0
- package/views/dist/controls/values-editor/map-values-body.d.ts +12 -0
- package/views/dist/controls/values-editor/map-values-body.js +71 -0
- package/views/dist/controls/values-editor/tokens.d.ts +132 -0
- package/views/dist/controls/values-editor/tokens.js +35 -0
- package/views/dist/controls/values-editor/values-editor.d.ts +62 -0
- package/views/dist/controls/values-editor/values-editor.js +441 -0
- package/views/dist/controls/values-editor/values.d.ts +71 -0
- package/views/dist/controls/values-editor/values.js +59 -0
- package/views/dist/controls/values-editor/words.d.ts +50 -0
- package/views/dist/controls/values-editor/words.js +29 -0
- package/views/dist/controls/values-editor.css +207 -0
- package/views/dist/controls/views-list/looks.d.ts +13 -0
- package/views/dist/controls/views-list/looks.js +12 -0
- package/views/dist/controls/views-list/map-views-list-body.d.ts +19 -0
- package/views/dist/controls/views-list/map-views-list-body.js +65 -0
- package/views/dist/controls/views-list/rules.d.ts +72 -0
- package/views/dist/controls/views-list/rules.js +4 -0
- package/views/dist/controls/views-list/tokens.d.ts +11 -0
- package/views/dist/controls/views-list/tokens.js +5 -0
- package/views/dist/controls/views-list/views-list.d.ts +44 -0
- package/views/dist/controls/views-list/views-list.js +57 -0
- package/views/dist/controls/views-list/words.d.ts +22 -0
- package/views/dist/controls/views-list/words.js +3 -0
- package/views/dist/controls/views-list.css +8 -0
- package/views/dist/display/date.js +2 -2
- package/views/dist/display/format.js +10 -2
- package/views/dist/display/options.d.ts +3 -1
- package/views/dist/display/use-display-options.d.ts +3 -0
- package/views/dist/display/use-display-options.js +10 -2
- package/views/dist/display/viewer.d.ts +1 -1
- package/views/dist/display/viewer.js +1 -1
- package/views/dist/editors/DateEditor.js +11 -9
- package/views/dist/editors/NumberEditor.js +3 -1
- package/views/dist/editors/relation-panel.js +7 -1
- package/views/dist/editors/relation-picker.d.ts +2 -1
- package/views/dist/editors/relation-picker.js +4 -3
- package/views/dist/editors/relation-source.d.ts +4 -1
- package/views/dist/editors/relation-source.js +5 -2
- package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
- package/views/dist/fields/number-edit.d.ts +6 -0
- package/views/dist/fields/number-edit.js +8 -1
- package/views/dist/grid/chrome/GridCellEditors.js +3 -3
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
- package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
- package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
- package/views/dist/grid/chrome/GridDateEditor.d.ts +3 -1
- package/views/dist/grid/chrome/GridDateEditor.js +2 -1
- package/views/dist/grid/chrome/GridFooter.js +2 -2
- package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
- package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
- package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
- package/views/dist/grid/core/commit-model.d.ts +7 -0
- package/views/dist/grid/core/commit-model.js +5 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/editing-model.js +3 -7
- package/views/dist/grid/core/undo-owner.d.ts +6 -0
- package/views/dist/grid/core/undo-owner.js +13 -0
- package/views/dist/grid/core/useGridEditing.d.ts +2 -0
- package/views/dist/grid/core/useGridEditing.js +4 -0
- package/views/dist/looks/index.d.ts +8 -0
- package/views/dist/looks/index.js +8 -0
- package/views/dist/looks/pieces.js +16 -0
- package/views/dist/panels/model.d.ts +6 -1
- package/views/dist/panels/react/customize-body.d.ts +4 -2
- package/views/dist/panels/react/customize-body.js +3 -3
- package/views/dist/panels/react/customize.js +4 -2
- package/views/dist/panels/react/filter/FilterEditor.js +2 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +9 -6
- package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
- package/views/dist/panels/react/filter/filter-body.js +17 -6
- package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
- package/views/dist/panels/react/filter/filter-part-body.js +3 -1
- package/views/dist/panels/react/panel-sheet.d.ts +5 -1
- package/views/dist/panels/react/panel-sheet.js +6 -2
- package/views/dist/panels/react/panel-step.d.ts +12 -0
- package/views/dist/panels/react/panel-step.js +26 -0
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
- package/views/dist/panels/react/sort/SortEditor.js +5 -2
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +8 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +84 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +49 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +36 -21
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
- package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
- package/views/dist/panels/react/toolbar/panel-part.js +2 -2
- package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
- package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
- package/views/dist/panels/react.d.ts +1 -0
- package/views/dist/panels/react.js +1 -0
- package/views/dist/panels/settings/filter-groups.js +35 -1
- package/views/dist/panels/settings/group-buckets.js +1 -0
- package/views/dist/provider/ViewsProvider.d.ts +7 -1
- package/views/dist/provider/ViewsProvider.js +23 -3
- package/views/dist/provider/components.d.ts +34 -4
- package/views/dist/provider/moment.d.ts +6 -0
- package/views/dist/provider/moment.js +10 -0
- package/views/dist/styles.css +1276 -51
- package/views/dist/styles.unlayered.css +1277 -51
- package/views/docs/contract.md +23 -15
- package/views/docs/controls/alert-dialog.md +37 -0
- package/views/docs/controls/alert.md +30 -0
- package/views/docs/controls/collapsible.md +22 -0
- package/views/docs/controls/filter-editor.md +28 -0
- package/views/docs/controls/group-editor.md +11 -0
- package/views/docs/controls/links-editor.md +25 -0
- package/views/docs/controls/modal.md +55 -0
- package/views/docs/controls/notice.md +32 -0
- package/views/docs/controls/number-editor.md +12 -0
- package/views/docs/controls/pane.md +25 -0
- package/views/docs/controls/radio.md +39 -0
- package/views/docs/controls/sort-editor.md +27 -0
- package/views/docs/controls/toast.md +32 -0
- package/views/docs/controls/values-editor.md +40 -0
- package/views/docs/controls/views-list.md +8 -0
- package/views/docs/guides/cells.md +1 -1
- package/views/docs/guides/display.md +1 -1
- package/views/docs/guides/the-grid.md +1 -1
- package/views/docs/guides/the-provider.md +19 -0
- package/views/docs/reference/cells.md +2 -2
- package/views/docs/reference/controls.md +326 -8
- package/views/docs/reference/display.md +2 -2
- package/views/docs/reference/editors-relation.md +1 -1
- package/views/docs/reference/looks.md +20 -3
- package/views/docs/reference/panels-react.md +7 -6
- package/views/docs/reference/panels.md +1 -1
- package/views/docs/reference/react.md +8 -8
- package/views/docs/reference/views.md +1 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const PANE_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-radius-xl";
|
|
3
|
+
readonly kind: "size";
|
|
4
|
+
readonly outright: "--radius-xl";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-shadow-menu";
|
|
7
|
+
readonly kind: "shadow";
|
|
8
|
+
readonly outright: "--shadow-menu";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-border";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--border";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-spacing";
|
|
15
|
+
readonly kind: "size";
|
|
16
|
+
readonly outright: "--spacing";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-layer-drawer";
|
|
19
|
+
readonly kind: "size";
|
|
20
|
+
readonly outright: "--layer-drawer";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-overlay";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--surface-overlay";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-fg";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--text";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-font-size-sm";
|
|
31
|
+
readonly kind: "size";
|
|
32
|
+
readonly outright: "--text-sm";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-line-height-sm";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--text-sm--line-height";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-duration-fast";
|
|
39
|
+
readonly kind: "motion";
|
|
40
|
+
readonly outright: "--duration-fast";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-ease-out";
|
|
43
|
+
readonly kind: "motion";
|
|
44
|
+
readonly outright: "--ease-out";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-border-width";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--border-width";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-border-subtle";
|
|
51
|
+
readonly kind: "colour";
|
|
52
|
+
readonly outright: "--border-subtle";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-font-weight-medium";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--font-weight-medium";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-ease-in";
|
|
59
|
+
readonly kind: "motion";
|
|
60
|
+
readonly outright: "--ease-in";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-radius-lg";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--radius-lg";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-radius-2xl";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--radius-2xl";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-shadow-lg";
|
|
71
|
+
readonly kind: "shadow";
|
|
72
|
+
readonly outright: "--shadow-lg";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-shadow-xl";
|
|
75
|
+
readonly kind: "shadow";
|
|
76
|
+
readonly outright: "--shadow-xl";
|
|
77
|
+
}];
|
|
78
|
+
/** The Pane's own machinery: its corners, shadow, edge, gap and padding as its options set them, and its edge's corner. */
|
|
79
|
+
export declare const PANE_PRIVATE: readonly ["--pane-"];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const PANE_TOKENS = [
|
|
2
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
3
|
+
{ name: "--vk-shadow-menu", kind: "shadow", outright: "--shadow-menu" },
|
|
4
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
5
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
6
|
+
{ name: "--vk-layer-drawer", kind: "size", outright: "--layer-drawer" },
|
|
7
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
8
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
9
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
10
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
11
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
12
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
13
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
14
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
15
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
16
|
+
{ name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
|
|
17
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
18
|
+
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
19
|
+
{ name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
|
|
20
|
+
{ name: "--vk-shadow-xl", kind: "shadow", outright: "--shadow-xl" },
|
|
21
|
+
];
|
|
22
|
+
export const PANE_PRIVATE = ["--pane-"];
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* The Pane: a shell. Every value it draws with is a public name (controls/pane/tokens.ts); this file only says which
|
|
2
|
+
name each part takes. It
|
|
3
|
+
stands in the list's box it is handed (positioned, never scrolling), at its top right, a gap in from its edges. Base UI marks
|
|
4
|
+
it data-open, data-starting-style and data-ending-style as it comes and goes. What an app sets once is a data attribute on
|
|
5
|
+
the frame around it (looks.ts):
|
|
6
|
+
|
|
7
|
+
data-pane-place list · fit as tall as the list, or fitting what it holds
|
|
8
|
+
data-pane-corners lg · xl · 2xl which radius it takes
|
|
9
|
+
data-pane-smoothing round · smooth how its corners bend
|
|
10
|
+
data-pane-shadow none · menu · lg · xl its shadow
|
|
11
|
+
data-pane-edge outline · subtle · none one clear edge, a quieter one, or none
|
|
12
|
+
data-pane-gap 0 · 4 · 8 · 12 · 16 how far in from the list's top, right and bottom it stands
|
|
13
|
+
data-pane-padding 0 · 4 · 8 · 12 · 16 how far what it holds stands from its edge
|
|
14
|
+
|
|
15
|
+
300 wide, as Customize stands at the list's edge. The rules sit in the components layer, so a
|
|
16
|
+
utility class on it still wins. */
|
|
17
|
+
@layer components {
|
|
18
|
+
|
|
19
|
+
/* Its portal, in the list's box, takes no room there, whatever the box lays out. */
|
|
20
|
+
.o-pane-portal { display: contents; }
|
|
21
|
+
|
|
22
|
+
/* ── The shell: over the list and under every popup (layer-popup), a Drawer or a Modal opened later standing over it ── */
|
|
23
|
+
.o-pane {
|
|
24
|
+
--pane-corners: var(--vk-radius-xl); --pane-shadow: var(--vk-shadow-menu); --pane-edge: var(--vk-border);
|
|
25
|
+
--pane-gap: calc(var(--vk-spacing) * 2); --pane-pad: calc(var(--vk-spacing) * 2);
|
|
26
|
+
position: absolute; z-index: var(--vk-layer-drawer); top: var(--pane-gap); right: var(--pane-gap); bottom: var(--pane-gap);
|
|
27
|
+
box-sizing: border-box; display: flex; flex-direction: column;
|
|
28
|
+
width: calc(var(--vk-spacing) * 75); max-width: calc(100% - var(--pane-gap) * 2);
|
|
29
|
+
border-radius: var(--pane-corners); background-color: var(--vk-overlay); box-shadow: var(--pane-shadow); color: var(--vk-fg);
|
|
30
|
+
font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); outline: none;
|
|
31
|
+
transition: opacity var(--vk-duration-fast) var(--vk-ease-out), translate var(--vk-duration-fast) var(--vk-ease-out);
|
|
32
|
+
}
|
|
33
|
+
/* Fitting what it holds: as tall as that, never past a gap over the list's foot. */
|
|
34
|
+
[data-pane-place="fit"] .o-pane { bottom: auto; max-height: calc(100% - var(--pane-gap) * 2); }
|
|
35
|
+
|
|
36
|
+
/* What it holds, inside its edge. The edge is drawn as two shapes, never a border, as the Popover's is: its colour (::before),
|
|
37
|
+
and the ground just inside it (::after), one line narrower, each with its own corner, so the edge follows the corners
|
|
38
|
+
exactly, round or smooth. */
|
|
39
|
+
.o-pane-cut { position: relative; isolation: isolate; box-sizing: border-box; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; padding: var(--pane-pad); border-radius: inherit; }
|
|
40
|
+
.o-pane-cut::before, .o-pane-cut::after { content: ""; position: absolute; z-index: -1; border-radius: var(--pane-c); pointer-events: none; }
|
|
41
|
+
.o-pane-cut::before { --pane-c: var(--pane-corners); inset: 0; background-color: var(--pane-edge); }
|
|
42
|
+
.o-pane-cut::after { --pane-c: calc(var(--pane-corners) - var(--vk-border-width)); inset: var(--vk-border-width); background-color: var(--vk-overlay); }
|
|
43
|
+
|
|
44
|
+
/* Its head stays at its top, its body scrolls, its foot stays at its foot under a line across the whole Pane. The body scrolls up and
|
|
45
|
+
down only: a control's press area standing past its edge (a Switch's, at a row's end) made it scroll sideways, and where
|
|
46
|
+
scrollbars take room that bar stood at its foot. What it holds is clipped at its sides, where the body clips it anyway, so nothing
|
|
47
|
+
overhangs it to scroll to. */
|
|
48
|
+
.o-pane-head { flex: none; }
|
|
49
|
+
.o-pane-body { flex: 1 1 auto; min-height: 0; overflow: hidden auto; }
|
|
50
|
+
.o-pane-body > * { overflow-x: clip; }
|
|
51
|
+
/* What scrolls runs right to the foot's line: the foot has no margin over
|
|
52
|
+
it, and a body with a foot after it takes the Pane's padding at its end, inside what scrolls, so that room shows only at the scroll's
|
|
53
|
+
end. */
|
|
54
|
+
.o-pane-foot { flex: none; margin: 0 calc(var(--pane-pad) * -1) calc(var(--pane-pad) * -1); padding: var(--pane-pad); border-top: var(--vk-border-width) solid var(--pane-edge); }
|
|
55
|
+
.o-pane-body:has(~ .o-pane-foot) { padding-bottom: var(--pane-pad); }
|
|
56
|
+
[data-pane-edge="none"] .o-pane-foot { border-top-color: var(--vk-border-subtle); }
|
|
57
|
+
|
|
58
|
+
/* Its title, when what stands in it has one: text-sm at medium weight. */
|
|
59
|
+
.o-pane-title { margin: 0; font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); font-weight: var(--vk-font-weight-medium); color: var(--vk-fg); }
|
|
60
|
+
|
|
61
|
+
/* It fades in and moves a step in from the right; it leaves faster than it came. */
|
|
62
|
+
.o-pane[data-ending-style] { transition-timing-function: var(--vk-ease-in); }
|
|
63
|
+
.o-pane:is([data-starting-style], [data-ending-style]) { opacity: 0; translate: var(--vk-spacing) 0; }
|
|
64
|
+
|
|
65
|
+
/* ── What an app sets once ───────────────────────────────────────────────────────────────────────────────────── */
|
|
66
|
+
[data-pane-corners="lg"] .o-pane { --pane-corners: var(--vk-radius-lg); }
|
|
67
|
+
[data-pane-corners="2xl"] .o-pane { --pane-corners: var(--vk-radius-2xl); }
|
|
68
|
+
[data-pane-shadow="none"] .o-pane { --pane-shadow: none; }
|
|
69
|
+
[data-pane-shadow="lg"] .o-pane { --pane-shadow: var(--vk-shadow-lg); }
|
|
70
|
+
[data-pane-shadow="xl"] .o-pane { --pane-shadow: var(--vk-shadow-xl); }
|
|
71
|
+
[data-pane-edge="subtle"] .o-pane { --pane-edge: var(--vk-border-subtle); }
|
|
72
|
+
[data-pane-edge="none"] .o-pane { --pane-edge: var(--vk-overlay); }
|
|
73
|
+
[data-pane-gap="0"] .o-pane { --pane-gap: 0px; }
|
|
74
|
+
[data-pane-gap="4"] .o-pane { --pane-gap: var(--vk-spacing); }
|
|
75
|
+
[data-pane-gap="12"] .o-pane { --pane-gap: calc(var(--vk-spacing) * 3); }
|
|
76
|
+
[data-pane-gap="16"] .o-pane { --pane-gap: calc(var(--vk-spacing) * 4); }
|
|
77
|
+
[data-pane-padding="0"] .o-pane { --pane-pad: 0px; }
|
|
78
|
+
[data-pane-padding="4"] .o-pane { --pane-pad: var(--vk-spacing); }
|
|
79
|
+
[data-pane-padding="12"] .o-pane { --pane-pad: calc(var(--vk-spacing) * 3); }
|
|
80
|
+
[data-pane-padding="16"] .o-pane { --pane-pad: calc(var(--vk-spacing) * 4); }
|
|
81
|
+
|
|
82
|
+
/* ── Its corners smooth: the smooth outline (smooth.css), as the Popover's. A cut would take the shadow with it, so
|
|
83
|
+
.o-pane-cut inside it is cut instead, and the edge's two shapes each by the same outline. The shadow is cast from a layer under
|
|
84
|
+
the cut that stands wholly inside the outline: cast by the shell's own round box, whose corner stands up to 0.02 of a
|
|
85
|
+
radius outside the smooth one, its edge and the cut's met in a light rim round the bend. Its corner a quarter
|
|
86
|
+
circle of 1.2 radii, which lies inside the smooth curve (from 1.2 radii on, by smooth.css's numbers; a larger one stands further
|
|
87
|
+
in and lightens the shadow at the corner), and half a line in, so the cut covers its edge everywhere and the shadow runs on from
|
|
88
|
+
under the edge, as dark as Round's ────── */
|
|
89
|
+
@supports (clip-path: shape(from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close)) {
|
|
90
|
+
[data-pane-smoothing="smooth"] .o-pane { background-color: transparent; box-shadow: none; }
|
|
91
|
+
[data-pane-smoothing="smooth"] .o-pane::before {
|
|
92
|
+
content: ""; position: absolute; z-index: -1; inset: calc(var(--vk-border-width) / 2); border-radius: calc(var(--pane-corners) * 1.2);
|
|
93
|
+
box-shadow: var(--pane-shadow); pointer-events: none;
|
|
94
|
+
}
|
|
95
|
+
[data-pane-smoothing="smooth"] .o-pane-cut { --pane-c: var(--pane-corners); background-color: var(--vk-overlay); }
|
|
96
|
+
[data-pane-smoothing="smooth"] .o-pane-cut::before, [data-pane-smoothing="smooth"] .o-pane-cut::after { border-radius: 0; }
|
|
97
|
+
[data-pane-smoothing="smooth"] .o-pane-cut, [data-pane-smoothing="smooth"] .o-pane-cut::before, [data-pane-smoothing="smooth"] .o-pane-cut::after {
|
|
98
|
+
--smooth-t: var(--pane-c); clip-path: shape(var(--smooth-outline));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Under reduced motion it just appears. */
|
|
103
|
+
@media (prefers-reduced-motion: reduce) { .o-pane { transition: none; } }
|
|
104
|
+
}
|
|
@@ -23,11 +23,13 @@ export type PickerAs = {
|
|
|
23
23
|
* rows it leads one level in (a deal's Company, its Name, Industry and Region), which it opens and never picks; and its
|
|
24
24
|
* own menu, what can be done to that one row (a view's Rename…, Delete view…), ⋮ at its end opening it, never picking; and its
|
|
25
25
|
* count, how many records hold it (a quick filter's value), at its end, right before what says it is held.
|
|
26
|
-
* A row that leads one level in keeps its level's count and ›. And a mark after its name (a private view's lock), quieter.
|
|
26
|
+
* A row that leads one level in keeps its level's count and ›. And a mark after its name (a private view's lock), quieter. And
|
|
27
|
+
* `also`, words its search finds it by besides its name (a currency's code), never drawn.
|
|
27
28
|
*/
|
|
28
29
|
export interface PickerItem {
|
|
29
30
|
value: string;
|
|
30
31
|
label: string;
|
|
32
|
+
also?: readonly string[];
|
|
31
33
|
as?: PickerAs;
|
|
32
34
|
line?: string;
|
|
33
35
|
you?: boolean;
|
|
@@ -99,7 +101,7 @@ export interface RowsInput {
|
|
|
99
101
|
/** The levels open, by their rows' values, outermost first, as far as the items still hold them. */
|
|
100
102
|
export declare function openLevels(items: PickerItem[], values: string[]): PickerItem[];
|
|
101
103
|
export declare const fold: (s: string) => string;
|
|
102
|
-
/** The item whose name is what was typed, whatever its case and the spaces round it. */
|
|
104
|
+
/** The item whose name, or one of its `also` words, is what was typed, whatever its case and the spaces round it. */
|
|
103
105
|
export declare function exactMatch(items: PickerItem[], query: string): PickerItem | undefined;
|
|
104
106
|
export declare function pickerRows({ items, known, query, picked, empty, create, server, more, first, open, levelRow }: RowsInput): PickerRow[];
|
|
105
107
|
/** Every item's value in its order after `value` moved to where `target` stands: before it, moving up; after it, moving
|
|
@@ -10,9 +10,10 @@ export function openLevels(items, values) {
|
|
|
10
10
|
return out;
|
|
11
11
|
}
|
|
12
12
|
export const fold = (s) => s.normalize("NFD").replace(/\p{M}/gu, "").trim().toLowerCase();
|
|
13
|
+
const found = (i) => [i.label, ...(i.also ?? [])].map(fold);
|
|
13
14
|
export function exactMatch(items, query) {
|
|
14
15
|
const q = fold(query);
|
|
15
|
-
return q ? items.find((i) =>
|
|
16
|
+
return q ? items.find((i) => found(i).includes(q)) : undefined;
|
|
16
17
|
}
|
|
17
18
|
const itemRow = (item, held) => (item.level ? { kind: "item", item, picked: held.has(item.value), opens: true, count: item.level.length } : { kind: "item", item, picked: held.has(item.value) });
|
|
18
19
|
export function pickerRows({ items, known = items, query, picked, empty, create, server, more, first = [], open = [], levelRow = true }) {
|
|
@@ -25,12 +26,12 @@ export function pickerRows({ items, known = items, query, picked, empty, create,
|
|
|
25
26
|
return [{ kind: "parent", item: level }, ...rows.map((r) => (r.kind === "item" ? { ...r, indent: true } : r))];
|
|
26
27
|
}
|
|
27
28
|
const q = fold(query), held = new Set(picked);
|
|
28
|
-
const matching = server || !q ? items : items.filter((i) =>
|
|
29
|
+
const matching = server || !q ? items : items.filter((i) => found(i).some((w) => w.includes(q)));
|
|
29
30
|
const exact = q ? exactMatch(matching, query) : undefined;
|
|
30
31
|
const ahead = new Set(q ? [] : first), top = matching.filter((i) => ahead.has(i.value));
|
|
31
32
|
const shown = (exact ? matching.filter((i) => i !== exact) : matching).filter((i) => !ahead.has(i.value));
|
|
32
33
|
const ranked = (list) => (server || !q ? list
|
|
33
|
-
: [...list.filter((i) =>
|
|
34
|
+
: [...list.filter((i) => found(i).some((w) => w.startsWith(q))), ...list.filter((i) => !found(i).some((w) => w.startsWith(q)))]);
|
|
34
35
|
const rows = [];
|
|
35
36
|
if (empty !== undefined && !q && held.size)
|
|
36
37
|
rows.push({ kind: "empty", label: empty });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Radio as BaseRadio } from "@base-ui/react/radio";
|
|
3
|
+
import { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group";
|
|
4
|
+
export interface RadioGroupProps extends Omit<React.ComponentProps<typeof BaseRadioGroup>, "className"> {
|
|
5
|
+
/** The group's name, above its choices ("Who can see this deal"). Without one, give it an aria-label. */
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
/** Two to four short choices side by side, instead of one under another. Marked cards stand two across, and one under
|
|
8
|
+
* another on a phone. */
|
|
9
|
+
row?: boolean;
|
|
10
|
+
/** Its marked cards as tiles: three across, each its mark over its name, centred; on a phone on one card (Customize's
|
|
11
|
+
* Layout). */
|
|
12
|
+
tiles?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/** Exactly one of a few choices, all of them in sight: its name, then its Radios. With a name, the group is a
|
|
17
|
+
* FieldSet, its name the legend (Base UI names the radio group by it). */
|
|
18
|
+
export declare function RadioGroup({ label, row, tiles, className, children, ...props }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export interface RadioProps extends Omit<React.ComponentProps<typeof BaseRadio.Root>, "className"> {
|
|
20
|
+
/** The choice. Without one, give it an aria-label. */
|
|
21
|
+
label?: React.ReactNode;
|
|
22
|
+
/** A line under the label that explains it, or says why it is locked. */
|
|
23
|
+
note?: React.ReactNode;
|
|
24
|
+
/** Drawn as a card: an edge round the ring and its words, the whole card pressing it, the chosen one in
|
|
25
|
+
* the selected colours. For a few choices that each need their line read (a pipeline's start). */
|
|
26
|
+
card?: boolean;
|
|
27
|
+
/** 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
|
|
28
|
+
* the brand. Disabled, it stands dashed and greyed, with no line, and the arrows pass it by. */
|
|
29
|
+
mark?: React.ReactNode;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/** One choice of a RadioGroup: a ring that fills with the brand and a dot when it is the one chosen. */
|
|
33
|
+
export declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Radio as BaseRadio } from "@base-ui/react/radio";
|
|
5
|
+
import { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group";
|
|
6
|
+
import { cx } from "../../internal/cx.js";
|
|
7
|
+
import { FieldSet } from "../field/field.js";
|
|
8
|
+
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
9
|
+
export function RadioGroup({ label, row = false, tiles = false, className, children, ...props }) {
|
|
10
|
+
const phone = usePhoneForm();
|
|
11
|
+
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
|
+
return label != null ? _jsx(FieldSet, { legend: label, disabled: props.disabled, className: className, children: group }) : group;
|
|
13
|
+
}
|
|
14
|
+
export const Radio = React.forwardRef(function Radio({ label, note, card = false, mark, className, ...props }, ref) {
|
|
15
|
+
const marked = mark != null;
|
|
16
|
+
return (_jsxs("label", { className: cx("o-radio", (card || marked) && "o-choice-card", marked && "o-radio-marked", className), "data-kit": "radio", children: [marked
|
|
17
|
+
? _jsx(BaseRadio.Root, { ref: ref, className: "o-radio-mark", ...props, children: mark })
|
|
18
|
+
: _jsx(BaseRadio.Root, { ref: ref, className: "o-radio-ring", ...props, children: _jsx(BaseRadio.Indicator, { keepMounted: true, className: "o-radio-dot" }) }), (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 })] }))] }));
|
|
19
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export declare const RADIO_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-border-brand";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--border-focused";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-border-danger";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--border-danger";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-border-input";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--border-input";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-border-input-hovered";
|
|
15
|
+
readonly kind: "colour";
|
|
16
|
+
readonly outright: "--border-input-hovered";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-border-selected";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--border-selected";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-border-subtle";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--border-subtle";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-border-width";
|
|
27
|
+
readonly kind: "size";
|
|
28
|
+
readonly outright: "--border-width";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-brand";
|
|
31
|
+
readonly kind: "colour";
|
|
32
|
+
readonly outright: "--background-brand-bold";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-brand-hovered";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--background-brand-bold-hovered";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-danger-bold";
|
|
39
|
+
readonly kind: "colour";
|
|
40
|
+
readonly outright: "--background-danger-bold";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-danger-bold-hovered";
|
|
43
|
+
readonly kind: "colour";
|
|
44
|
+
readonly outright: "--background-danger-bold-hovered";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-duration-base";
|
|
47
|
+
readonly kind: "motion";
|
|
48
|
+
readonly outright: "--duration-base";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-duration-fast";
|
|
51
|
+
readonly kind: "motion";
|
|
52
|
+
readonly outright: "--duration-fast";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-ease-out";
|
|
55
|
+
readonly kind: "motion";
|
|
56
|
+
readonly outright: "--ease-out";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-fg-accent";
|
|
59
|
+
readonly kind: "colour";
|
|
60
|
+
readonly outright: "--text-brand";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-fg-disabled";
|
|
63
|
+
readonly kind: "colour";
|
|
64
|
+
readonly outright: "--text-disabled";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-fg-inverse";
|
|
67
|
+
readonly kind: "colour";
|
|
68
|
+
readonly outright: "--text-inverse";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-fg-on-brand";
|
|
71
|
+
readonly kind: "colour";
|
|
72
|
+
readonly outright: "--text-brand-inverse";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-fg-subtle";
|
|
75
|
+
readonly kind: "colour";
|
|
76
|
+
readonly outright: "--text-subtle";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-focus-offset";
|
|
79
|
+
readonly kind: "size";
|
|
80
|
+
readonly outright: "--focus-offset";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-focus-width";
|
|
83
|
+
readonly kind: "size";
|
|
84
|
+
readonly outright: "--focus-width";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-font-weight-normal";
|
|
87
|
+
readonly kind: "size";
|
|
88
|
+
readonly outright: "--font-weight-normal";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-ground";
|
|
91
|
+
readonly kind: "colour";
|
|
92
|
+
readonly outright: "--surface";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "--vk-hovered";
|
|
95
|
+
readonly kind: "colour";
|
|
96
|
+
readonly outright: "--surface-hovered";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-input";
|
|
99
|
+
readonly kind: "colour";
|
|
100
|
+
readonly outright: "--background-input";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "--vk-neutral";
|
|
103
|
+
readonly kind: "colour";
|
|
104
|
+
readonly outright: "--background-neutral";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "--vk-overlay-card";
|
|
107
|
+
readonly kind: "colour";
|
|
108
|
+
readonly outright: "--surface-overlay-card";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "--vk-radius-full";
|
|
111
|
+
readonly kind: "size";
|
|
112
|
+
readonly outright: "--radius-full";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "--vk-radius-lg";
|
|
115
|
+
readonly kind: "size";
|
|
116
|
+
readonly outright: "--radius-lg";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "--vk-radius-xl";
|
|
119
|
+
readonly kind: "size";
|
|
120
|
+
readonly outright: "--radius-xl";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "--vk-spacing";
|
|
123
|
+
readonly kind: "size";
|
|
124
|
+
readonly outright: "--spacing";
|
|
125
|
+
}];
|
|
126
|
+
/** The Radio has no machinery of its own. */
|
|
127
|
+
export declare const RADIO_PRIVATE: readonly [];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const RADIO_TOKENS = [
|
|
2
|
+
{ name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
|
|
3
|
+
{ name: "--vk-border-danger", kind: "colour", outright: "--border-danger" },
|
|
4
|
+
{ name: "--vk-border-input", kind: "colour", outright: "--border-input" },
|
|
5
|
+
{ name: "--vk-border-input-hovered", kind: "colour", outright: "--border-input-hovered" },
|
|
6
|
+
{ name: "--vk-border-selected", kind: "colour", outright: "--border-selected" },
|
|
7
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
8
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
9
|
+
{ name: "--vk-brand", kind: "colour", outright: "--background-brand-bold" },
|
|
10
|
+
{ name: "--vk-brand-hovered", kind: "colour", outright: "--background-brand-bold-hovered" },
|
|
11
|
+
{ name: "--vk-danger-bold", kind: "colour", outright: "--background-danger-bold" },
|
|
12
|
+
{ name: "--vk-danger-bold-hovered", kind: "colour", outright: "--background-danger-bold-hovered" },
|
|
13
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
14
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
15
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
16
|
+
{ name: "--vk-fg-accent", kind: "colour", outright: "--text-brand" },
|
|
17
|
+
{ name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
|
|
18
|
+
{ name: "--vk-fg-inverse", kind: "colour", outright: "--text-inverse" },
|
|
19
|
+
{ name: "--vk-fg-on-brand", kind: "colour", outright: "--text-brand-inverse" },
|
|
20
|
+
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
21
|
+
{ name: "--vk-focus-offset", kind: "size", outright: "--focus-offset" },
|
|
22
|
+
{ name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
|
|
23
|
+
{ name: "--vk-font-weight-normal", kind: "size", outright: "--font-weight-normal" },
|
|
24
|
+
{ name: "--vk-ground", kind: "colour", outright: "--surface" },
|
|
25
|
+
{ name: "--vk-hovered", kind: "colour", outright: "--surface-hovered" },
|
|
26
|
+
{ name: "--vk-input", kind: "colour", outright: "--background-input" },
|
|
27
|
+
{ name: "--vk-neutral", kind: "colour", outright: "--background-neutral" },
|
|
28
|
+
{ name: "--vk-overlay-card", kind: "colour", outright: "--surface-overlay-card" },
|
|
29
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
30
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
31
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
32
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
33
|
+
];
|
|
34
|
+
export const RADIO_PRIVATE = [];
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* The Radio, as its card draws it. Every value it draws with is a public name (radio/tokens.ts); this file only says which
|
|
2
|
+
token each part and state takes. Base UI marks the ring
|
|
3
|
+
data-checked and data-disabled; data-force draws a state for the sheet. The states come in the card's
|
|
4
|
+
order, a later one winning: the pointer, on, error, focus, disabled.
|
|
5
|
+
|
|
6
|
+
The rules sit in the components layer, so a utility class on a radio still wins. */
|
|
7
|
+
@layer components {
|
|
8
|
+
|
|
9
|
+
/* ── A group: its choices one under another, 14px apart, or two to four in a row; its name is the FieldSet's
|
|
10
|
+
legend (field.css) ─────────────────────────────────────────────────────────────────────────────────── */
|
|
11
|
+
.o-radio-group { display: grid; gap: calc(var(--vk-spacing) * 3.5); }
|
|
12
|
+
.o-radio-group.o-radio-row { display: flex; flex-wrap: wrap; gap: calc(var(--vk-spacing) * 2) calc(var(--vk-spacing) * 6); }
|
|
13
|
+
|
|
14
|
+
/* ── At rest: a 16px ring, see-through; the label 10px to its right presses it ─────────────────────── */
|
|
15
|
+
.o-radio { position: relative; display: inline-flex; align-items: flex-start; gap: calc(var(--vk-spacing) * 2.5); cursor: pointer; -webkit-tap-highlight-color: transparent; }
|
|
16
|
+
.o-radio-ring {
|
|
17
|
+
flex: none; box-sizing: border-box; display: grid; place-items: center;
|
|
18
|
+
width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); margin-top: calc(var(--vk-spacing) * 0.5);
|
|
19
|
+
border: var(--vk-border-width) solid var(--vk-border-input); border-radius: var(--vk-radius-full);
|
|
20
|
+
background-color: var(--vk-input); outline: none;
|
|
21
|
+
transition: background-color var(--vk-duration-fast) var(--vk-ease-out), border-color var(--vk-duration-fast) var(--vk-ease-out);
|
|
22
|
+
}
|
|
23
|
+
/* The dot grows in its middle when the ring is chosen. */
|
|
24
|
+
.o-radio-dot { width: calc(var(--vk-spacing) * 1.5); height: calc(var(--vk-spacing) * 1.5); border-radius: var(--vk-radius-full); background-color: var(--vk-fg-inverse); scale: 0; transition: scale var(--vk-duration-base) var(--vk-ease-out); }
|
|
25
|
+
|
|
26
|
+
/* ── Under the pointer, on the ring or its label: a louder edge; a chosen ring a deeper brand ─────── */
|
|
27
|
+
/* A hover only on a screen with a pointer (KIT-368: iOS keeps :hover on what was last tapped); a press and the forced state stay out. */
|
|
28
|
+
.o-radio-ring[data-force="hover"]:not([data-disabled]) { border-color: var(--vk-border-input-hovered); }
|
|
29
|
+
@media (hover: hover) { .o-radio:hover > .o-radio-ring:not([data-disabled]) { border-color: var(--vk-border-input-hovered); } }
|
|
30
|
+
|
|
31
|
+
/* ── On: the brand, with the dot ───────────────────────────────────────────────────────────────────── */
|
|
32
|
+
.o-radio-ring[data-checked] { border-color: var(--vk-brand); background-color: var(--vk-brand); }
|
|
33
|
+
.o-radio-ring[data-force="hover"][data-checked]:not([data-disabled]) { border-color: var(--vk-brand-hovered); background-color: var(--vk-brand-hovered); }
|
|
34
|
+
@media (hover: hover) { .o-radio:hover > .o-radio-ring[data-checked]:not([data-disabled]) { border-color: var(--vk-brand-hovered); background-color: var(--vk-brand-hovered); } }
|
|
35
|
+
.o-radio-ring[data-checked] .o-radio-dot { scale: 1; background-color: var(--vk-fg-on-brand); }
|
|
36
|
+
|
|
37
|
+
/* ── In error (aria-invalid, its Field's error, or a group in error around it): a red edge; chosen, the
|
|
38
|
+
danger colour fills it. The pointer never takes it away; focus rings it in red; disabled wins. ─── */
|
|
39
|
+
.o-radio-ring:is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *):not([data-disabled]),
|
|
40
|
+
.o-radio-ring[data-force="hover"]:is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *):not([data-disabled]) { border-color: var(--vk-border-danger); }
|
|
41
|
+
@media (hover: hover) { .o-radio:hover > .o-radio-ring:is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *):not([data-disabled]) { border-color: var(--vk-border-danger); } }
|
|
42
|
+
.o-radio-ring[data-checked]:is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *):not([data-disabled]) { border-color: var(--vk-danger-bold); background-color: var(--vk-danger-bold); }
|
|
43
|
+
.o-radio-ring[data-checked]:is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *):not([data-disabled]) .o-radio-dot { background-color: var(--vk-fg-inverse); }
|
|
44
|
+
.o-radio-ring[data-force="hover"][data-checked]:is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *):not([data-disabled]) { border-color: var(--vk-danger-bold-hovered); background-color: var(--vk-danger-bold-hovered); }
|
|
45
|
+
@media (hover: hover) { .o-radio:hover > .o-radio-ring[data-checked]:is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *):not([data-disabled]) { border-color: var(--vk-danger-bold-hovered); background-color: var(--vk-danger-bold-hovered); } }
|
|
46
|
+
.o-radio-ring:is(:focus-visible, [data-force="focus"]):is([aria-invalid="true"], [data-invalid], .o-fieldset[data-invalid] *) { outline-color: var(--vk-border-danger); }
|
|
47
|
+
|
|
48
|
+
/* ── Focus: the outline 2px outside the ring ───────────────────────────────────────────────────────── */
|
|
49
|
+
.o-radio-ring:is(:focus-visible, [data-force="focus"]) { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
|
|
50
|
+
|
|
51
|
+
/* ── Disabled: a grey ring, a softer edge, the dot and the label greyed ─────────────────────────────── */
|
|
52
|
+
.o-radio-ring[data-disabled] { border-color: var(--vk-border-subtle); background-color: var(--vk-neutral); }
|
|
53
|
+
.o-radio-ring[data-disabled] .o-radio-dot { background-color: var(--vk-fg-disabled); }
|
|
54
|
+
.o-radio:has(> .o-radio-ring[data-disabled]) { cursor: not-allowed; }
|
|
55
|
+
.o-radio:has(> .o-radio-ring[data-disabled]) .o-choice-label { color: var(--vk-fg-disabled); }
|
|
56
|
+
|
|
57
|
+
/* ── A marked card (KIT-668; the map, UI Kit · doc · list toolbar, parts 51 and 79; the canvas, rounds 5, 6 and 12): a mark
|
|
58
|
+
in place of the ring, the radio itself still, its name under it and an optional line under that. Its edge the field's;
|
|
59
|
+
chosen, ringed in the brand, its edge and a hairline just outside it as the map draws it (KIT-816), the mark in the brand, no
|
|
60
|
+
selected ground; one that can't be picked yet
|
|
61
|
+
dashed, all of it greyed, with no word under its name (KIT-777), which the arrows pass by. Focus rings the whole card. Each rule
|
|
62
|
+
carries a class more than choice.css's card, which it draws over. ─────────────────────────────────────────────────── */
|
|
63
|
+
.o-choice-card.o-radio-marked { flex-direction: column; align-items: flex-start; gap: var(--vk-spacing); padding: calc(var(--vk-spacing) * 3); border-color: var(--vk-border-input); }
|
|
64
|
+
.o-radio-mark { flex: none; display: grid; place-items: center; color: var(--vk-fg-subtle); outline: none; transition: color var(--vk-duration-fast) var(--vk-ease-out); }
|
|
65
|
+
.o-radio-mark > svg { width: calc(var(--vk-spacing) * 5); height: calc(var(--vk-spacing) * 5); }
|
|
66
|
+
.o-choice-card.o-radio-marked:has(> [data-checked]) { border-color: var(--vk-border-selected); box-shadow: 0 0 0 var(--vk-border-width) var(--vk-border-selected); background-color: var(--vk-ground); }
|
|
67
|
+
.o-radio-mark[data-checked] { color: var(--vk-fg-accent); }
|
|
68
|
+
.o-choice-card.o-radio-marked:has(> [data-force="hover"]:not([data-checked], [data-disabled])) { background-color: var(--vk-hovered); }
|
|
69
|
+
.o-choice-card.o-radio-marked:has(> .o-radio-mark:is(:focus-visible, [data-force="focus"])) { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
|
|
70
|
+
/* Marked cards in a row: two across, as New view's layouts; one under another on a phone. Marked cards, as a row or as tiles, keep
|
|
71
|
+
room on every side for what stands outside a card's edge, the chosen one's ring and the focus outline, so a holder that clips
|
|
72
|
+
its sides (the Pane's body) never cuts either (KIT-816); the map's tiles stand as far in. */
|
|
73
|
+
.o-radio-group.o-radio-row:has(> .o-radio-marked.o-choice-card) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
74
|
+
.o-radio-group:where(.o-radio-row, .o-radio-tiles):has(> .o-radio-marked.o-choice-card) { padding: calc(var(--vk-focus-width) + var(--vk-focus-offset)); }
|
|
75
|
+
|
|
76
|
+
/* ── Tiles: marked cards three across, each centred, its mark over its name in the card's quieter words; chosen, the mark
|
|
77
|
+
and the name in the brand. On a computer the marks of a row stand on one line, a tile with a line growing under its
|
|
78
|
+
name; on a phone they stand on one card, each at least 72 tall, what it holds in its middle. ──────────────────────── */
|
|
79
|
+
.o-radio-group.o-radio-tiles:has(> .o-choice-card) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--vk-spacing) * 1.5); }
|
|
80
|
+
.o-radio-tiles > .o-choice-card.o-radio-marked {
|
|
81
|
+
justify-content: flex-start; align-items: center; gap: calc(var(--vk-spacing) * 1.5); padding: calc(var(--vk-spacing) * 2.5) var(--vk-spacing);
|
|
82
|
+
border-radius: var(--vk-radius-lg); background-color: transparent; color: var(--vk-fg-subtle); text-align: center;
|
|
83
|
+
}
|
|
84
|
+
.o-radio-tiles > .o-radio-marked > .o-choice-text { max-width: 100%; }
|
|
85
|
+
.o-radio-tiles > .o-radio-marked .o-choice-label { font-weight: var(--vk-font-weight-normal); color: inherit; }
|
|
86
|
+
.o-radio-tiles > .o-radio-marked > .o-radio-mark { color: inherit; }
|
|
87
|
+
.o-radio-tiles > .o-radio-marked > .o-radio-mark > svg { width: calc(var(--vk-spacing) * 4.5); height: calc(var(--vk-spacing) * 4.5); }
|
|
88
|
+
.o-radio-tiles > .o-choice-card.o-radio-marked:has(> [data-checked]) { background-color: transparent; color: var(--vk-fg-accent); }
|
|
89
|
+
@media (hover: hover) { .o-radio-tiles > .o-choice-card.o-radio-marked:hover:not(:has(> :is([data-checked], [data-disabled]))) { background-color: var(--vk-hovered); } }
|
|
90
|
+
.o-radio-tiles > .o-choice-card.o-radio-marked:has(> [data-force="hover"]:not([data-checked], [data-disabled])) { background-color: var(--vk-hovered); }
|
|
91
|
+
|
|
92
|
+
/* ── A marked card that can't be picked yet: dashed, greyed, no ground; it wins over the tiles' colours. ──────────── */
|
|
93
|
+
.o-choice-card.o-radio-marked:has(> [data-disabled]) { border-style: dashed; border-color: var(--vk-border-input); box-shadow: none; background-color: transparent; cursor: not-allowed; }
|
|
94
|
+
.o-choice-card.o-radio-marked:has(> [data-disabled]) :is(.o-radio-mark, .o-choice-label, .o-choice-note) { color: var(--vk-fg-disabled); }
|
|
95
|
+
|
|
96
|
+
/* On a phone (`data-vk-phone`, the group's own mark from the device, or a phone frame round it): marked cards one under
|
|
97
|
+
another, tiles on one card. */
|
|
98
|
+
.o-radio-group.o-radio-row:where([data-vk-phone], [data-vk-phone] *):has(> .o-radio-marked.o-choice-card) { grid-template-columns: minmax(0, 1fr); }
|
|
99
|
+
.o-radio-group.o-radio-tiles:where([data-vk-phone], [data-vk-phone] *):has(> .o-choice-card) { gap: calc(var(--vk-spacing) * 2); padding: calc(var(--vk-spacing) * 3); border-radius: var(--vk-radius-xl); background-color: var(--vk-overlay-card); }
|
|
100
|
+
.o-radio-tiles:where([data-vk-phone], [data-vk-phone] *) > .o-choice-card.o-radio-marked { justify-content: center; min-height: calc(var(--vk-spacing) * 18); }
|
|
101
|
+
.o-radio-tiles:where([data-vk-phone], [data-vk-phone] *) > .o-radio-marked > .o-radio-mark > svg { width: calc(var(--vk-spacing) * 5.5); height: calc(var(--vk-spacing) * 5.5); }
|
|
102
|
+
|
|
103
|
+
@media (prefers-reduced-motion: reduce) { .o-radio-ring, .o-radio-dot, .o-radio-mark { transition: none; } }
|
|
104
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ViewsMessageResolver } from "../../contract.js";
|
|
2
|
+
import type { ViewsSortBodyProps } from "../../provider/components.js";
|
|
3
|
+
import { type SortEditorProps } from "./sort-editor.js";
|
|
4
|
+
import type { SortEditorWords } from "./words.js";
|
|
5
|
+
/** The sort editor's words in the app's messages. */
|
|
6
|
+
export declare function sortEditorWordsOf(say: ViewsMessageResolver): SortEditorWords;
|
|
7
|
+
/** ViewKit's sort body's props as the sort editor's. */
|
|
8
|
+
export declare function sortEditorPropsOf(p: ViewsSortBodyProps, words: SortEditorWords, say?: ViewsMessageResolver): SortEditorProps;
|
|
9
|
+
export declare function MapSortBody(props: ViewsSortBodyProps): import("react/jsx-runtime").JSX.Element;
|