viewkitjs 0.34.0 → 0.36.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 +173 -0
- package/MIGRATION.md +7 -0
- package/package.json +1 -1
- package/views/README.md +1 -1
- package/views/dist/atoms/Avatar.js +2 -1
- package/views/dist/atoms/RelationChip.d.ts +2 -0
- package/views/dist/atoms/RelationChip.js +5 -0
- package/views/dist/atoms/RowMenu.d.ts +1 -1
- package/views/dist/atoms/RowMenu.js +15 -3
- package/views/dist/atoms/defaults.js +2 -0
- package/views/dist/atoms/types.d.ts +40 -4
- package/views/dist/cells/relation-wrap.js +9 -2
- package/views/dist/contract.d.ts +27 -7
- package/views/dist/contract.js +25 -2
- package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
- package/views/dist/controls/avatar/avatar-mark.js +5 -0
- package/views/dist/controls/avatar/avatar.d.ts +10 -5
- package/views/dist/controls/avatar/avatar.js +12 -6
- package/views/dist/controls/avatar/looks.d.ts +1 -1
- package/views/dist/controls/avatar/looks.js +3 -0
- package/views/dist/controls/avatar/record-mark.d.ts +16 -0
- package/views/dist/controls/avatar/record-mark.js +13 -0
- package/views/dist/controls/avatar/tokens.d.ts +12 -0
- package/views/dist/controls/avatar/tokens.js +3 -0
- package/views/dist/controls/avatar.css +54 -17
- package/views/dist/controls/bulk-bar/bulk-bar.js +4 -5
- package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
- package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
- package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
- package/views/dist/controls/compound-editor/map-parts-body.js +8 -1
- package/views/dist/controls/compound-editor/name-parts.js +3 -2
- package/views/dist/controls/compound-editor/place-parts.js +3 -3
- package/views/dist/controls/compound-editor/range-parts.js +11 -10
- package/views/dist/controls/compound-editor/words.d.ts +3 -0
- package/views/dist/controls/compound-editor/words.js +2 -0
- package/views/dist/controls/customize/customize.d.ts +22 -6
- package/views/dist/controls/customize/customize.js +154 -73
- package/views/dist/controls/customize/items.d.ts +49 -0
- package/views/dist/controls/customize/items.js +104 -0
- package/views/dist/controls/customize/map-customize-body.js +19 -15
- package/views/dist/controls/customize/words.d.ts +5 -3
- package/views/dist/controls/customize/words.js +1 -0
- package/views/dist/controls/filter-editor/block.js +5 -2
- package/views/dist/controls/filter-editor/filter-editor.d.ts +16 -1
- package/views/dist/controls/filter-editor/filter-editor.js +22 -16
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -2
- package/views/dist/controls/filter-editor/map-filter-body.js +16 -2
- package/views/dist/controls/filter-editor/map-rules.d.ts +9 -2
- package/views/dist/controls/filter-editor/map-rules.js +18 -13
- package/views/dist/controls/filter-editor/parts.d.ts +1 -1
- package/views/dist/controls/filter-editor/parts.js +16 -15
- package/views/dist/controls/filter-editor/rules.d.ts +4 -4
- package/views/dist/controls/filter-editor/rules.js +6 -3
- package/views/dist/controls/filter-editor/words.d.ts +2 -0
- package/views/dist/controls/filter-editor/words.js +1 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +3 -0
- package/views/dist/controls/group-editor/group-editor.js +21 -15
- package/views/dist/controls/group-editor/map-group-body.js +1 -0
- package/views/dist/controls/index.d.ts +1 -1
- package/views/dist/controls/internal/kit-words.d.ts +11 -0
- package/views/dist/controls/internal/kit-words.js +7 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +4 -1
- package/views/dist/controls/internal/map-panel-controls.js +23 -6
- package/views/dist/controls/internal/menu-items.d.ts +9 -0
- package/views/dist/controls/internal/menu-items.js +97 -0
- package/views/dist/controls/internal/panel-controls.d.ts +27 -3
- package/views/dist/controls/internal/panel-controls.js +142 -13
- package/views/dist/controls/links-editor/links-editor.js +5 -7
- package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
- package/views/dist/controls/links-editor/map-links-body.js +5 -1
- package/views/dist/controls/menu/menu.d.ts +4 -1
- package/views/dist/controls/menu/menu.js +3 -2
- package/views/dist/controls/number-editor/map-number-body.js +2 -0
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/number-editor/words.d.ts +3 -0
- package/views/dist/controls/number-editor/words.js +2 -0
- package/views/dist/controls/picker/fields-frame.d.ts +5 -0
- package/views/dist/controls/picker/fields-frame.js +30 -0
- package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
- package/views/dist/controls/picker/map-fields-body.js +7 -26
- package/views/dist/controls/picker/map-picker.d.ts +9 -3
- package/views/dist/controls/picker/map-picker.js +16 -3
- package/views/dist/controls/picker/picker.js +20 -10
- package/views/dist/controls/picker/rows.d.ts +9 -2
- package/views/dist/controls/picker.css +2 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +2 -1
- package/views/dist/controls/quick-filters/quick-filters.js +4 -4
- package/views/dist/controls/quick-filters/reminder.js +2 -2
- package/views/dist/controls/quick-filters/rules.d.ts +4 -1
- package/views/dist/controls/quick-filters/words.d.ts +2 -0
- package/views/dist/controls/quick-filters/words.js +1 -0
- package/views/dist/controls/select/map-select.d.ts +1 -1
- package/views/dist/controls/select/map-select.js +4 -1
- package/views/dist/controls/select/select.d.ts +5 -0
- package/views/dist/controls/select/select.js +11 -3
- package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
- package/views/dist/controls/sheet/bottom-sheet.js +3 -3
- package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
- package/views/dist/controls/sort-editor/sort-editor.js +9 -8
- package/views/dist/controls/tag/tag.js +4 -2
- package/views/dist/controls/text-editor/map-text-body.js +4 -1
- package/views/dist/controls/text-editor/text-editor.js +2 -2
- package/views/dist/controls/text-editor/words.d.ts +3 -0
- package/views/dist/controls/text-editor/words.js +1 -1
- package/views/dist/controls/toolbar/toolbar.d.ts +31 -12
- package/views/dist/controls/toolbar/toolbar.js +15 -20
- package/views/dist/controls/toolbar.css +0 -5
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +4 -2
- package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
- package/views/dist/controls/values-editor/map-values-body.js +5 -1
- package/views/dist/controls/values-editor/values-editor.js +8 -7
- package/views/dist/controls/views-list/map-views-list-body.js +9 -1
- package/views/dist/controls/views-list/rules.d.ts +1 -0
- package/views/dist/controls/views-list/rules.js +2 -2
- package/views/dist/controls/views-list/view-menu.js +2 -2
- package/views/dist/controls/views-list/words.d.ts +4 -0
- package/views/dist/controls/views-list/words.js +2 -1
- package/views/dist/display/option-badges.d.ts +17 -0
- package/views/dist/display/option-badges.js +11 -0
- package/views/dist/display/relation-link.d.ts +12 -0
- package/views/dist/display/relation-link.js +17 -0
- package/views/dist/display/relation.d.ts +1 -1
- package/views/dist/display/relation.js +10 -3
- package/views/dist/display/select.js +1 -8
- package/views/dist/editors/EditorPanel.js +1 -1
- package/views/dist/editors/RangeEditor.d.ts +3 -0
- package/views/dist/editors/RangeEditor.js +2 -2
- package/views/dist/editors/SelectEditor.d.ts +2 -2
- package/views/dist/editors/SelectEditor.js +1 -1
- package/views/dist/editors/TextEditor.js +4 -2
- package/views/dist/editors/ValueListEditor.js +2 -1
- package/views/dist/field-row/FieldRow.js +32 -5
- package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
- package/views/dist/grid/chrome/GridAddColumn.d.ts +7 -2
- package/views/dist/grid/chrome/GridAddColumn.js +13 -9
- package/views/dist/grid/chrome/GridCellEditors.js +1 -1
- package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
- package/views/dist/grid/chrome/GridCellOutline.js +16 -6
- package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
- package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
- package/views/dist/grid/chrome/GridFooter.js +4 -4
- package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
- package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
- package/views/dist/grid/chrome/GridHeader.js +4 -3
- package/views/dist/grid/chrome/GridNumberEditor.js +1 -1
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
- package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +11 -3
- package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
- package/views/dist/grid/chrome/GridRowActions.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +3 -2
- package/views/dist/grid/chrome/GridStructure.js +1 -1
- package/views/dist/grid/chrome/GridTable.js +32 -20
- package/views/dist/grid/chrome/GridTableSurface.js +2 -1
- package/views/dist/grid/chrome/checks.d.ts +1 -1
- package/views/dist/grid/chrome/checks.js +4 -1
- package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
- package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +5 -2
- package/views/dist/grid/chrome/grid-fitted-box.js +14 -4
- package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
- package/views/dist/grid/chrome/grid-hover.js +14 -4
- package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
- package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
- package/views/dist/grid/chrome/grid-table-props.d.ts +16 -4
- package/views/dist/grid/chrome/useGridScaleStyles.d.ts +9 -1
- package/views/dist/grid/chrome/useGridScaleStyles.js +1 -4
- package/views/dist/grid/grid-format-props.d.ts +1 -1
- package/views/dist/grid/grid-format-props.js +18 -5
- package/views/dist/grid/grid.css +11 -1
- package/views/dist/grid/looks.d.ts +3 -1
- package/views/dist/grid/looks.js +10 -4
- package/views/dist/grid/useGridTablePrefs.d.ts +1 -1
- package/views/dist/grid/useGridTableSettings.d.ts +1 -1
- package/views/dist/list/layer.d.ts +8 -0
- package/views/dist/list/layer.js +7 -0
- package/views/dist/list/list.js +2 -2
- package/views/dist/list/menu.d.ts +5 -4
- package/views/dist/list/store.d.ts +1 -1
- package/views/dist/list/toolbar.js +47 -20
- package/views/dist/list/views.js +1 -0
- package/views/dist/panels/availability.d.ts +5 -0
- package/views/dist/panels/availability.js +4 -5
- package/views/dist/panels/customize-body.d.ts +5 -1
- package/views/dist/panels/customize-body.js +21 -12
- package/views/dist/panels/model.d.ts +14 -4
- package/views/dist/panels/react/customize-body.js +15 -3
- package/views/dist/panels/react/customize.d.ts +8 -0
- package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
- package/views/dist/panels/react/filter/FilterEditor.js +7 -0
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +3 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +2 -2
- package/views/dist/panels/react/filter/filter-body.js +3 -1
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -1
- package/views/dist/panels/react/filter/filter-part-body.js +2 -2
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
- package/views/dist/panels/react/sort/SortEditor.js +3 -1
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -2
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +11 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +16 -6
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +5 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +12 -5
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +18 -8
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +9 -1
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +5 -4
- package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
- package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +4 -4
- package/views/dist/panels/react/toolbar/editor-menus.d.ts +8 -0
- package/views/dist/panels/react/toolbar/editor-menus.js +3 -0
- package/views/dist/panels/react/views-row/FoldingViewRow.js +3 -5
- package/views/dist/panels/react/views-row/HScrollRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/HScrollRow.js +6 -2
- package/views/dist/panels/react/views-row/ViewAxes.js +6 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +8 -3
- package/views/dist/panels/react/views-row/new-view.d.ts +11 -0
- package/views/dist/panels/react/views-row/new-view.js +21 -0
- package/views/dist/panels/react.d.ts +1 -1
- package/views/dist/panels/settings/layout.js +6 -38
- package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
- package/views/dist/panels/toolbar/page-resets.js +62 -0
- package/views/dist/panels/toolbar/same-item.d.ts +7 -0
- package/views/dist/panels/toolbar/same-item.js +9 -0
- package/views/dist/panels/view-state.d.ts +4 -0
- package/views/dist/provider/ViewsProvider.d.ts +9 -4
- package/views/dist/provider/ViewsProvider.js +13 -2
- package/views/dist/provider/components.d.ts +109 -7
- package/views/dist/provider/components.js +1 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/styles.css +115 -27
- package/views/dist/styles.unlayered.css +115 -27
- package/views/docs/contract.md +55 -35
- package/views/docs/controls/avatar.md +3 -0
- package/views/docs/controls/bulk-bar.md +3 -1
- package/views/docs/controls/compound-editor.md +2 -0
- package/views/docs/controls/customize.md +1 -1
- package/views/docs/controls/filter-editor.md +1 -1
- package/views/docs/controls/links-editor.md +2 -0
- package/views/docs/controls/pane.md +1 -1
- package/views/docs/controls/picker.md +2 -0
- package/views/docs/controls/quick-filters.md +1 -1
- package/views/docs/controls/text-editor.md +1 -1
- package/views/docs/controls/values-editor.md +2 -0
- package/views/docs/guides/atoms.md +54 -3
- package/views/docs/guides/display.md +1 -1
- package/views/docs/guides/looks.md +1 -1
- package/views/docs/guides/the-grid.md +4 -2
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/index.md +2 -2
- package/views/docs/install.md +198 -104
- package/views/docs/reference/controls.md +27 -24
- package/views/docs/reference/editors-range.md +1 -1
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +6 -5
- package/views/docs/reference/list.md +27 -7
- package/views/docs/reference/looks.md +5 -5
- package/views/docs/reference/panels-react.md +15 -14
- package/views/docs/reference/panels.md +5 -5
- package/views/docs/reference/react.md +25 -11
- package/views/docs/reference/views.md +2 -2
- package/views/docs/reshaping.md +22 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/* The Avatar. Every value it draws with is a
|
|
2
2
|
token (control tokens); this file only says which token each kind and size takes. People are circles on
|
|
3
3
|
their own tone (data-tone, 1 to 6); things are squares on a quiet ground; the workspace is the brand; an agent is a thing's
|
|
4
|
-
square holding its own icon; a square handed its own colour (data-colour, a label hue) stands on that hue instead.
|
|
4
|
+
square holding its own icon; a square handed its own colour (data-colour, a label hue) stands on that hue instead. A person or a
|
|
5
|
+
thing handed its object's icon draws it, with no picture, by the last three. Its options, on the frame around it (looks.ts):
|
|
5
6
|
|
|
6
|
-
data-avatar-corners small · medium · large · xlarge a radius token per size; nothing set is Medium
|
|
7
|
+
data-avatar-corners small · medium · large · xlarge a square's radius token per size; nothing set is Medium
|
|
7
8
|
data-avatar-smoothing round · smooth how a square's corners bend; nothing set is Smooth
|
|
9
|
+
data-avatar-mark icon · initials the object's icon, or its letters on today's look; nothing set is Icon
|
|
10
|
+
data-avatar-ground quiet · grey · outline · colour under the icon; nothing set is Quiet grey
|
|
11
|
+
data-avatar-icon-colour grey · colour the icon's ink; nothing set is Grey
|
|
8
12
|
|
|
9
13
|
The rules sit in the components layer, so a utility class on an avatar still wins. */
|
|
10
14
|
@layer components {
|
|
@@ -37,12 +41,12 @@
|
|
|
37
41
|
.o-avatar.o-avatar-96 { width: calc(var(--vk-spacing) * 24); height: calc(var(--vk-spacing) * 24); font-size: var(--vk-font-size-4xl); }
|
|
38
42
|
|
|
39
43
|
/* ── A thing: a square, its corners a step that grows with it, on the neutral ground, its edge inside ─ */
|
|
40
|
-
.o-avatar.o-avatar-thing { border-radius: var(--avatar-r); background-color: var(--vk-neutral); color: var(--vk-fg-subtle); box-shadow: inset 0 0 0 var(--vk-border-width) var(--
|
|
44
|
+
.o-avatar.o-avatar-thing { --avatar-edge: var(--vk-border-subtle); border-radius: var(--avatar-r); background-color: var(--vk-neutral); color: var(--vk-fg-subtle); box-shadow: inset 0 0 0 var(--vk-border-width) var(--avatar-edge); }
|
|
41
45
|
/* The workspace: the one square in the brand. */
|
|
42
|
-
.o-avatar.o-avatar-workspace { background-color: var(--vk-brand); color: var(--vk-fg-on-brand);
|
|
46
|
+
.o-avatar.o-avatar-workspace { --avatar-edge: transparent; background-color: var(--vk-brand); color: var(--vk-fg-on-brand); }
|
|
43
47
|
/* A square's own colour, the workspace's included: on the hue's fill, what it holds in the hue's strong ink, with no edge; grey
|
|
44
48
|
the neutral ground in the quieter ink. */
|
|
45
|
-
.o-avatar.o-avatar-thing[data-colour] {
|
|
49
|
+
.o-avatar.o-avatar-thing[data-colour] { --avatar-edge: transparent; }
|
|
46
50
|
.o-avatar.o-avatar-thing[data-colour="blue"] { background-color: var(--vk-label-blue-fill); color: var(--vk-label-blue-strong); }
|
|
47
51
|
.o-avatar.o-avatar-thing[data-colour="green"] { background-color: var(--vk-label-green-fill); color: var(--vk-label-green-strong); }
|
|
48
52
|
.o-avatar.o-avatar-thing[data-colour="amber"] { background-color: var(--vk-label-amber-fill); color: var(--vk-label-amber-strong); }
|
|
@@ -67,10 +71,43 @@
|
|
|
67
71
|
.o-avatar.o-avatar-agent[data-colour="teal"]:where([data-vk-phone] *) { background-color: var(--vk-label-teal); }
|
|
68
72
|
.o-avatar.o-avatar-agent[data-colour="grey"]:where([data-vk-phone] *) { background-color: var(--vk-fg-subtlest); }
|
|
69
73
|
|
|
70
|
-
/* ──
|
|
71
|
-
|
|
74
|
+
/* ── A record's mark, a person's or a thing's, when the app hands its object's icon (VK-1039, after Attio): with no picture
|
|
75
|
+
(the fallback holds the icon only while no photo or logo has loaded, so a src always wins) the icon, or under Initials its
|
|
76
|
+
letters on today's look. The icon stands on its Ground in its Icon colour, through the private properties below; a person
|
|
77
|
+
keeps its circle. The grey ink follows the ground, as the sketch drew it: the quietest on Quiet grey, the subtle one on the
|
|
78
|
+
rest. The object's colour is the hue handed (data-colour), its fill under the icon, its strong ink on it; handed none, the greys. */
|
|
79
|
+
.o-avatar-letters > :is(.o-avatar-icon, .o-avatar-initials) { display: contents; }
|
|
80
|
+
.o-avatar-letters > .o-avatar-initials { display: none; }
|
|
81
|
+
[data-avatar-mark="initials"] .o-avatar-letters > .o-avatar-initials { display: contents; }
|
|
82
|
+
[data-avatar-mark="initials"] .o-avatar-letters > .o-avatar-icon:has(+ .o-avatar-initials) { display: none; }
|
|
83
|
+
.o-avatar[data-colour="blue"] { --avatar-hue-fill: var(--vk-label-blue-fill); --avatar-hue-ink: var(--vk-label-blue-strong); }
|
|
84
|
+
.o-avatar[data-colour="green"] { --avatar-hue-fill: var(--vk-label-green-fill); --avatar-hue-ink: var(--vk-label-green-strong); }
|
|
85
|
+
.o-avatar[data-colour="amber"] { --avatar-hue-fill: var(--vk-label-amber-fill); --avatar-hue-ink: var(--vk-label-amber-strong); }
|
|
86
|
+
.o-avatar[data-colour="red"] { --avatar-hue-fill: var(--vk-label-red-fill); --avatar-hue-ink: var(--vk-label-red-strong); }
|
|
87
|
+
.o-avatar[data-colour="purple"] { --avatar-hue-fill: var(--vk-label-purple-fill); --avatar-hue-ink: var(--vk-label-purple-strong); }
|
|
88
|
+
.o-avatar[data-colour="pink"] { --avatar-hue-fill: var(--vk-label-pink-fill); --avatar-hue-ink: var(--vk-label-pink-strong); }
|
|
89
|
+
.o-avatar[data-colour="teal"] { --avatar-hue-fill: var(--vk-label-teal-fill); --avatar-hue-ink: var(--vk-label-teal-strong); }
|
|
90
|
+
.o-avatar[data-colour="grey"] { --avatar-hue-fill: var(--vk-neutral-hovered); --avatar-hue-ink: var(--vk-fg-subtle); }
|
|
91
|
+
/* Quiet grey, with nothing set: a step above background-neutral, so it shows on a drawer in dark; no edge. A person's circle
|
|
92
|
+
draws its edge inside, as a square's does without Smooth (a square's own rules draw its edge, the ring under Smooth too). */
|
|
93
|
+
.o-avatar:has(> .o-avatar-letters > .o-avatar-icon):not([data-avatar-mark="initials"] *) {
|
|
94
|
+
--avatar-ground: var(--vk-neutral-hovered); --avatar-grey-ink: var(--vk-fg-subtlest); --avatar-edge: transparent;
|
|
95
|
+
background-color: var(--avatar-ground); color: var(--avatar-ink, var(--avatar-grey-ink));
|
|
96
|
+
}
|
|
97
|
+
.o-avatar:not(.o-avatar-thing):has(> .o-avatar-letters > .o-avatar-icon):not([data-avatar-mark="initials"] *) { box-shadow: inset 0 0 0 var(--vk-border-width) var(--avatar-edge); }
|
|
98
|
+
/* Grey: two steps above. */
|
|
99
|
+
[data-avatar-ground="grey"] .o-avatar:has(> .o-avatar-letters > .o-avatar-icon):not([data-avatar-mark="initials"] *) { --avatar-ground: var(--vk-neutral-bold); --avatar-grey-ink: var(--vk-fg-subtle); }
|
|
100
|
+
/* Outline: no ground, its edge a field's. */
|
|
101
|
+
[data-avatar-ground="outline"] .o-avatar:has(> .o-avatar-letters > .o-avatar-icon):not([data-avatar-mark="initials"] *) { --avatar-ground: transparent; --avatar-grey-ink: var(--vk-fg-subtle); --avatar-edge: var(--vk-border-input); }
|
|
102
|
+
/* The object's colour: its hue's fill. */
|
|
103
|
+
[data-avatar-ground="colour"] .o-avatar[data-colour]:has(> .o-avatar-letters > .o-avatar-icon):not([data-avatar-mark="initials"] *) { --avatar-ground: var(--avatar-hue-fill); --avatar-grey-ink: var(--vk-fg-subtle); }
|
|
104
|
+
/* Icon colour, the object's: its hue's strong ink. */
|
|
105
|
+
[data-avatar-icon-colour="colour"] .o-avatar[data-colour]:has(> .o-avatar-letters > .o-avatar-icon):not([data-avatar-mark="initials"] *) { --avatar-ink: var(--avatar-hue-ink); }
|
|
106
|
+
|
|
107
|
+
/* ── Corners: a radius token per size, in steps, 56 taking 64's and 16 taking 20's; Medium with nothing set: sm at 16, 20, 24 and 32,
|
|
108
|
+
md at 40, lg at 56 and 64, 2xl at 96 (two steps past 64's, as round 3's photo draws it), between Small and Large. At 16 and 20
|
|
109
|
+
each step sits one past 24's (VK-1045): Small xs, Medium sm, Large md, Extra large lg, so Medium is no longer Small there. ── */
|
|
72
110
|
.o-avatar.o-avatar-thing { --avatar-r: var(--vk-radius-sm); }
|
|
73
|
-
.o-avatar.o-avatar-thing:is(.o-avatar-2xs, .o-avatar-xs) { --avatar-r: var(--vk-radius-xs); }
|
|
74
111
|
.o-avatar.o-avatar-thing.o-avatar-lg { --avatar-r: var(--vk-radius-md); }
|
|
75
112
|
.o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-lg); }
|
|
76
113
|
.o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-2xl); }
|
|
@@ -79,15 +116,15 @@
|
|
|
79
116
|
[data-avatar-corners="small"] .o-avatar.o-avatar-thing:is(.o-avatar-2xs, .o-avatar-xs, .o-avatar-sm) { --avatar-r: var(--vk-radius-xs); }
|
|
80
117
|
[data-avatar-corners="small"] .o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-md); }
|
|
81
118
|
[data-avatar-corners="small"] .o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-xl); }
|
|
82
|
-
/* Large, the radii before Medium came:
|
|
119
|
+
/* Large, the radii before Medium came (but 16 and 20's, VK-1045): md at 16 and 20, sm at 24, md at 32, lg at 40, xl at 56 and 64, 3xl at 96. */
|
|
83
120
|
[data-avatar-corners="large"] .o-avatar.o-avatar-thing { --avatar-r: var(--vk-radius-md); }
|
|
84
|
-
[data-avatar-corners="large"] .o-avatar.o-avatar-thing
|
|
121
|
+
[data-avatar-corners="large"] .o-avatar.o-avatar-thing.o-avatar-sm { --avatar-r: var(--vk-radius-sm); }
|
|
85
122
|
[data-avatar-corners="large"] .o-avatar.o-avatar-thing.o-avatar-lg { --avatar-r: var(--vk-radius-lg); }
|
|
86
123
|
[data-avatar-corners="large"] .o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-xl); }
|
|
87
124
|
[data-avatar-corners="large"] .o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-3xl); }
|
|
88
|
-
/* Extra large:
|
|
125
|
+
/* Extra large: lg at 16 and 20 (VK-1045), md at 24, lg at 32, xl at 40, 2xl at 56 and 64, 4xl at 96. */
|
|
89
126
|
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing { --avatar-r: var(--vk-radius-lg); }
|
|
90
|
-
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing
|
|
127
|
+
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing.o-avatar-sm { --avatar-r: var(--vk-radius-md); }
|
|
91
128
|
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing.o-avatar-lg { --avatar-r: var(--vk-radius-xl); }
|
|
92
129
|
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-2xl); }
|
|
93
130
|
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-4xl); }
|
|
@@ -97,7 +134,7 @@
|
|
|
97
134
|
smoothing eases off where a side is too short for 1.7 radii at each end, as the canvas drew it (o-smooth-ease, from its size and
|
|
98
135
|
its radius, both tokens, so it follows Corner radius). The outline would cut the edge drawn inside the square, so under it the
|
|
99
136
|
edge is a ring of its own (::before), between the outline and the same outline drawn a hairline in, under whatever the square
|
|
100
|
-
holds
|
|
137
|
+
holds, in --avatar-edge: the workspace and a square on its own colour draw it in none, a record's icon by its Ground. Its smoothing is its own Corner smoothing, never a host's: the outline's amount inherits, and a
|
|
101
138
|
crumb, a tab or a list's card that follows the token sets it on itself, so the square sets it back. ─────── */
|
|
102
139
|
@supports (clip-path: shape(evenodd from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close, move to 0 0, hline to 1px, close)) and (width: calc(tan(atan2(1px, 1px)) * 1px)) {
|
|
103
140
|
.o-avatar.o-avatar-thing { --smooth-amount: initial; }
|
|
@@ -105,11 +142,11 @@
|
|
|
105
142
|
--avatar-rr: min(var(--avatar-r), var(--avatar-size) / 2); --smooth-t: var(--avatar-rr); --smooth-side: var(--avatar-size);
|
|
106
143
|
position: relative; box-shadow: none; clip-path: shape(var(--smooth-outline));
|
|
107
144
|
}
|
|
108
|
-
/* Its edge, a hairline ring along the outline, under the picture or the letters it holds
|
|
109
|
-
own colour
|
|
110
|
-
.o-avatar.o-avatar-thing:not(
|
|
145
|
+
/* Its edge, a hairline ring along the outline, under the picture or the letters it holds, in --avatar-edge: the workspace and a
|
|
146
|
+
square on its own colour draw it in none. */
|
|
147
|
+
.o-avatar.o-avatar-thing:not([data-avatar-smoothing="round"] *)::before {
|
|
111
148
|
--smooth-t: calc(var(--avatar-rr) - var(--vk-border-width)); --smooth-in: var(--vk-border-width);
|
|
112
|
-
content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-color: var(--
|
|
149
|
+
content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-color: var(--avatar-edge);
|
|
113
150
|
clip-path: shape(var(--smooth-ring));
|
|
114
151
|
}
|
|
115
152
|
}
|
|
@@ -3,16 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
4
4
|
import { cx as cn } from "../../internal/cx.js";
|
|
5
5
|
import { AlertDialog } from "../alert-dialog/alert-dialog.js";
|
|
6
|
-
import {
|
|
7
|
-
import { Button } from "../button/button.js";
|
|
8
|
-
import { Menu } from "../menu/menu.js";
|
|
6
|
+
import { RecordMark } from "../avatar/record-mark.js";
|
|
9
7
|
import { Picker, usePicker } from "../picker/picker.js";
|
|
10
|
-
import { Popover } from "../popover/popover.js";
|
|
11
8
|
import { Sheet, SheetBody, SheetHead } from "../sheet/bottom-sheet.js";
|
|
12
9
|
import { StatusGlyph } from "../status/status.js";
|
|
13
10
|
import { Toast, createToastManager } from "../toast/toast.js";
|
|
14
11
|
import { ToolbarControl, ToolbarSeparatorControl } from "../toolbar/toolbar.js";
|
|
15
12
|
import { Icon } from "../internal/icons.js";
|
|
13
|
+
import { usePanelControls } from "../internal/panel-controls.js";
|
|
16
14
|
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
17
15
|
import { spacingPx } from "../internal/read-token.js";
|
|
18
16
|
import { fitOnBar, moreRows, wordsOf } from "./bulk-bar-of.js";
|
|
@@ -36,7 +34,7 @@ function markOf(as, label) {
|
|
|
36
34
|
if (!as)
|
|
37
35
|
return undefined;
|
|
38
36
|
if ("avatar" in as)
|
|
39
|
-
return _jsx(
|
|
37
|
+
return _jsx(RecordMark, { label: label, shape: as.avatar === "company" ? "thing" : "person", id: as.id, src: as.src, kind: as.kind, size: 20 });
|
|
40
38
|
if ("status" in as)
|
|
41
39
|
return _jsx(StatusGlyph, { place: as.status, quarters: as.quarters });
|
|
42
40
|
if ("mark" in as)
|
|
@@ -46,6 +44,7 @@ function markOf(as, label) {
|
|
|
46
44
|
const EMPTY = "\u0000empty", DIFFER = "\u0000differ";
|
|
47
45
|
export function BulkBar({ count, noun: given, onClear, verbs, onDelete, deleteLine, deleteLabel, busy = false, form, standing = false, className, words: said }) {
|
|
48
46
|
const w = React.useMemo(() => bulkBarWords(said), [said]);
|
|
47
|
+
const { Button, Menu, Popover } = usePanelControls();
|
|
49
48
|
const noun = given ?? w.noun;
|
|
50
49
|
const host = React.useContext(PhoneHost), narrow = usePhone();
|
|
51
50
|
const phone = form ? form === "phone" : host != null || narrow;
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { resolveViewsMessage } from "../../contract.js";
|
|
5
5
|
import { ViewsContext } from "../../provider/context.js";
|
|
6
|
+
import { PanelControlsFromViews } from "../internal/map-panel-controls.js";
|
|
6
7
|
import { menuWordsOf, pickerItemsOf, pickerWordsOf } from "../picker/map-picker.js";
|
|
7
8
|
import { BulkBar } from "./bulk-bar.js";
|
|
8
9
|
export function bulkBarWordsOf(say) {
|
|
@@ -53,5 +54,5 @@ export function MapSelectionBar({ count, noun, onClear, verbs, busy, onDelete, d
|
|
|
53
54
|
const words = React.useMemo(() => bulkBarWordsOf(messages), [messages]);
|
|
54
55
|
const AppIcon = views?.components.AppIcon;
|
|
55
56
|
const bulk = React.useMemo(() => bulkVerbsOf(verbs, AppIcon), [verbs, AppIcon]);
|
|
56
|
-
return (_jsx(BulkBar, { count: count, onClear: onClear, verbs: bulk, words: words, ...(noun ? { noun } : {}), ...(busy !== undefined ? { busy } : {}), ...(onDelete ? { onDelete: runOf(onDelete) } : {}), ...(deleteLabel !== undefined ? { deleteLabel } : {}), ...(deleteLine !== undefined ? { deleteLine } : {}) }));
|
|
57
|
+
return (_jsx(PanelControlsFromViews, { children: _jsx(BulkBar, { count: count, onClear: onClear, verbs: bulk, words: words, ...(noun ? { noun } : {}), ...(busy !== undefined ? { busy } : {}), ...(onDelete ? { onDelete: runOf(onDelete) } : {}), ...(deleteLabel !== undefined ? { deleteLabel } : {}), ...(deleteLine !== undefined ? { deleteLine } : {}) }) }));
|
|
57
58
|
}
|
|
@@ -65,6 +65,9 @@ export type CompoundEditorProps = PartsCommon & ({
|
|
|
65
65
|
bands?: RangeBand[];
|
|
66
66
|
/** It may be emptied; left out, it may. Can't, both ends cleared keeps the range it had, and says so. */
|
|
67
67
|
empty?: boolean;
|
|
68
|
+
/** The least and most each end may hold: its boxes step within them, and an end typed outside is drawn back as the box is left. */
|
|
69
|
+
min?: number;
|
|
70
|
+
max?: number;
|
|
68
71
|
});
|
|
69
72
|
export type NamePartsProps = Extract<CompoundEditorProps, {
|
|
70
73
|
kind: "name";
|
|
@@ -15,6 +15,6 @@ export declare function placeCountriesOf(p: PlaceBody): Country[];
|
|
|
15
15
|
export declare function compoundEditorWordsOf(say: ViewsMessageResolver): CompoundEditorWords;
|
|
16
16
|
/** ViewKit's parts body's props as the Compound editor's, held as a shell that keeps the draft. */
|
|
17
17
|
export declare function partsBodyPropsOf(p: ViewsPartsBodyProps, words?: CompoundEditorWords): CompoundEditorProps;
|
|
18
|
-
/** ViewKit's parts body,
|
|
18
|
+
/** ViewKit's parts body, its controls the app's where the provider's `panelControls` names them (VK-1022). */
|
|
19
19
|
export declare function MapPartsBody(props: ViewsPartsBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { resolveViewsMessage } from "../../contract.js";
|
|
5
5
|
import { ViewsContext } from "../../provider/context.js";
|
|
6
6
|
import { pickerWordsOf } from "../picker/map-picker.js";
|
|
7
7
|
import { useToldStep } from "../internal/told-step.js";
|
|
8
|
+
import { PanelControlsFromViews } from "../internal/map-panel-controls.js";
|
|
8
9
|
import { useCompoundEditor } from "./compound-editor.js";
|
|
9
10
|
const NO_NAME = { given: "", family: "", full: "" };
|
|
10
11
|
export function placeCountriesOf(p) {
|
|
@@ -46,6 +47,8 @@ export function compoundEditorWordsOf(say) {
|
|
|
46
47
|
own: { line1: say({ key: "views.editors.place-street-number" }), line2: say({ key: "views.editors.place-line2-plain" }), postalCode: say({ key: "views.editors.place-postcode" }), city, region: say({ key: "views.editors.place-region" }) },
|
|
47
48
|
short: { line1: say({ key: "views.editors.place-street-short" }) },
|
|
48
49
|
},
|
|
50
|
+
close: say({ key: "views.panels.close" }),
|
|
51
|
+
save: say({ key: "views.editors.save" }),
|
|
49
52
|
picker: pickerWordsOf(say),
|
|
50
53
|
};
|
|
51
54
|
}
|
|
@@ -58,9 +61,13 @@ export function partsBodyPropsOf(p, words) {
|
|
|
58
61
|
return { ...common, kind: "place", value: codelessRegion(p), parts: [...p.parts], required: [...p.required], countries: placeCountriesOf(p),
|
|
59
62
|
...(p.opens ? { opens: p.opens } : {}), onValueChange: (v) => p.onValueChange(v ?? {}), onDone: () => p.onDone() };
|
|
60
63
|
return { ...common, kind: "range", value: p.value, decimals: p.decimals, unit: p.unit, bands: p.bands ? [...p.bands] : undefined, empty: p.empty,
|
|
64
|
+
...(p.min !== undefined ? { min: p.min } : {}), ...(p.max !== undefined ? { max: p.max } : {}),
|
|
61
65
|
onValueChange: p.onValueChange, onDone: p.onDone };
|
|
62
66
|
}
|
|
63
67
|
export function MapPartsBody(props) {
|
|
68
|
+
return _jsx(PanelControlsFromViews, { children: _jsx(PartsBodyInner, { ...props }) });
|
|
69
|
+
}
|
|
70
|
+
function PartsBodyInner(props) {
|
|
64
71
|
const messages = React.useContext(ViewsContext)?.messages ?? resolveViewsMessage;
|
|
65
72
|
const words = React.useMemo(() => compoundEditorWordsOf(messages), [messages]);
|
|
66
73
|
const parts = useCompoundEditor(partsBodyPropsOf(props, words));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { midWord } from "../text-editor/check.js";
|
|
5
|
-
import {
|
|
5
|
+
import { usePanelControls } from "../internal/panel-controls.js";
|
|
6
6
|
import { SheetButton } from "../sheet/bottom-sheet.js";
|
|
7
7
|
import { fullOf, keptName, nameOf, ownOf, sameName } from "./name.js";
|
|
8
8
|
import { QuietField, PartsRow, MIHAI_CARD } from "./row.js";
|
|
@@ -20,6 +20,7 @@ const startOf = (value, typing) => ({
|
|
|
20
20
|
});
|
|
21
21
|
const NO_NAME = { full: "", given: "", family: "" };
|
|
22
22
|
export function useNameParts(props, worn, wornAt) {
|
|
23
|
+
const { Input } = usePanelControls();
|
|
23
24
|
const { label, value, onValueChange, onDone, empty = false, typing, autoFocus = true } = props;
|
|
24
25
|
const phone = usePhoneForm(props.form), device = phoneMark(usePhoneForm()), fields = worn.boxes === "fields", shownAs = worn.shown === "shown";
|
|
25
26
|
const shell = props.draft === "shell", w = compoundWords(props.words);
|
|
@@ -79,7 +80,7 @@ export function useNameParts(props, worn, wornAt) {
|
|
|
79
80
|
const body = fields ? (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "phone", ...device, children: [_jsxs(FieldRows, { look: MIHAI_CARD, className: "o-compound-editor-card", "data-slot": "vk-parts-card", children: [_jsx(FieldRow, { label: w.first, className: "o-compound-editor-card-row", "data-slot": "vk-parts-field", "data-key": "given", labelClassName: "o-compound-editor-card-label", children: _jsx(Input, { chrome: "bare", ref: first, className: "o-compound-editor-card-input", "data-slot": "vk-parts-box", "data-key": "given", value: given, autofill: false, enterKeyHint: "next", ...words, onChange: (e) => part("given", e.target.value), onKeyDown: (e) => enter(toLast)(e) }) }), _jsx(FieldRow, { label: w.last, className: "o-compound-editor-card-row", "data-slot": "vk-parts-field", "data-key": "family", labelClassName: "o-compound-editor-card-label", children: _jsx(Input, { chrome: "bare", ref: last, className: "o-compound-editor-card-input", "data-slot": "vk-parts-box", "data-key": "family", value: family, autofill: false, enterKeyHint: "done", ...words, onChange: (e) => part("family", e.target.value), onKeyDown: (e) => enter(keep)(e) }) })] }), shownAs && _jsxs("div", { className: "o-compound-editor-shown", children: [_jsx(FieldRows, { look: MIHAI_CARD, className: "o-compound-editor-card", "data-slot": "vk-parts-card", children: _jsx(FieldRow, { label: w.shownAs, className: "o-compound-editor-card-row", "data-slot": "vk-parts-field", "data-key": "shown", labelClassName: "o-compound-editor-card-label", children: _jsx(Input, { chrome: "bare", className: "o-compound-editor-card-input", "data-slot": "vk-parts-box", "data-key": "shown", value: line ?? joined, placeholder: joined || label, "data-follows": own ? undefined : "", autofill: false, enterKeyHint: "done", ...words, onChange: (e) => typeLine(e.target.value), onKeyDown: (e) => enter(keep)(e) }) }) }), _jsx("p", { className: "o-compound-editor-caption", "data-slot": "vk-parts-note", "data-bad": note ? "" : undefined, role: note ? "alert" : undefined, children: note ?? (own ? w.own : w.follows) })] }), !shownAs && note && _jsx("p", { className: "o-compound-editor-caption", "data-slot": "vk-parts-note", "data-bad": "", role: "alert", children: note })] })) : (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "phone", ...device, children: [_jsxs(PartsRow, { children: [_jsx(QuietField, { label: w.first, form: "phone", "data-slot": "vk-parts-field", "data-key": "given", children: _jsx(Input, { ref: first, size: "lg", "data-slot": "vk-parts-box", "data-key": "given", value: given, autofill: false, enterKeyHint: "next", ...words, onChange: (e) => part("given", e.target.value), onKeyDown: (e) => enter(toLast)(e) }) }), _jsx(QuietField, { label: w.last, form: "phone", "data-slot": "vk-parts-field", "data-key": "family", children: _jsx(Input, { ref: last, size: "lg", "data-slot": "vk-parts-box", "data-key": "family", value: family, autofill: false, enterKeyHint: "done", ...words, onChange: (e) => part("family", e.target.value), onKeyDown: (e) => enter(keep)(e) }) })] }), shownAs && _jsx(QuietField, { label: w.shownAs, form: "phone", "data-slot": "vk-parts-field", "data-key": "shown", children: _jsx(Input, { size: "lg", "data-slot": "vk-parts-box", "data-key": "shown", value: line ?? joined, placeholder: joined || label, "data-follows": own ? undefined : "", autofill: false, enterKeyHint: "done", ...words, onChange: (e) => typeLine(e.target.value), onKeyDown: (e) => enter(keep)(e) }) }), note && _jsx("p", { className: "o-compound-editor-note", "data-slot": "vk-parts-note", "data-bad": "", role: "alert", children: note })] }));
|
|
80
81
|
if (shell)
|
|
81
82
|
return { body, head: {} };
|
|
82
|
-
return { body, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label":
|
|
83
|
+
return { body, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label": w.close, icon: glyph(X), onClick: leave }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": w.save, icon: glyph(TICK), onClick: keep }) } };
|
|
83
84
|
}
|
|
84
85
|
const onKeyDown = (e) => {
|
|
85
86
|
if (midWord(e.nativeEvent))
|
|
@@ -3,8 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { midWord } from "../text-editor/check.js";
|
|
5
5
|
import { Field, FieldRowsRow as FieldRow, FieldRows } from "../field/field.js";
|
|
6
|
-
import {
|
|
7
|
-
import { Select } from "../select/select.js";
|
|
6
|
+
import { usePanelControls } from "../internal/panel-controls.js";
|
|
8
7
|
import { usePicker } from "../picker/picker.js";
|
|
9
8
|
import { SheetButton } from "../sheet/bottom-sheet.js";
|
|
10
9
|
import { Flag } from "../flag/flag.js";
|
|
@@ -21,6 +20,7 @@ const X = ["M18 6l-12 12", "M6 6l12 12"], TICK = ["M5 12l5 5l10 -10"];
|
|
|
21
20
|
let EVERY = null;
|
|
22
21
|
const TYPED = "\u0000typed";
|
|
23
22
|
export function usePlaceParts(props, worn, wornAt) {
|
|
23
|
+
const { Input, Select } = usePanelControls();
|
|
24
24
|
const { label, value, onValueChange, onDone, parts = PLACE_PARTS, autoFocus = true } = props;
|
|
25
25
|
const phone = usePhoneForm(props.form), device = phoneMark(usePhoneForm()), fields = worn.boxes === "fields", first = worn.country === "first", attio = !first;
|
|
26
26
|
const shell = props.draft === "shell", w = compoundWords(props.words);
|
|
@@ -161,7 +161,7 @@ export function usePlaceParts(props, worn, wornAt) {
|
|
|
161
161
|
return { body: shellBody, head: { onBack: back, backSlot: "vk-editor-back", close: false }, title: list === "countries" ? w.country : regionWord };
|
|
162
162
|
if (shell)
|
|
163
163
|
return { body: shellBody, head: {} };
|
|
164
|
-
return { body: shellBody, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label":
|
|
164
|
+
return { body: shellBody, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label": w.close, icon: glyph(X), onClick: leave }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": w.save, icon: glyph(TICK), onClick: keep }) } };
|
|
165
165
|
}
|
|
166
166
|
const inList = (t) => t instanceof Element && !!t.closest(".o-select-list");
|
|
167
167
|
const onBlur = (e) => { if (!shell && !swapping.current)
|
|
@@ -20,6 +20,7 @@ export function useRangeParts(props, worn, wornAt) {
|
|
|
20
20
|
const w = compoundWords(props.words), numberWords = { increase: w.increase, decrease: w.decrease, field: w.numberField };
|
|
21
21
|
const ENDS = [["low", w.from], ["high", w.to]];
|
|
22
22
|
const format = React.useMemo(() => bareOf(props.decimals), [props.decimals]);
|
|
23
|
+
const limits = { ...(props.min !== undefined ? { min: props.min } : {}), ...(props.max !== undefined ? { max: props.max } : {}) };
|
|
23
24
|
const phone = usePhoneForm(props.form), device = phoneMark(usePhoneForm()), fields = worn.boxes === "fields";
|
|
24
25
|
const shell = props.draft === "shell";
|
|
25
26
|
const [now, setNow] = React.useState(value);
|
|
@@ -84,7 +85,7 @@ export function useRangeParts(props, worn, wornAt) {
|
|
|
84
85
|
};
|
|
85
86
|
const kit = { "data-parts-kind": "range", "data-parts-boxes": worn.boxes, role: "group", "aria-label": label };
|
|
86
87
|
const note = unit && _jsx("p", { className: "o-compound-editor-note", "data-slot": "vk-parts-note", children: unit });
|
|
87
|
-
const boxes = (arrows, onPhone) => (_jsx(PartsRow, { children: ENDS.map(([k, name], i) => (_jsx(QuietField, { label: name, form: onPhone ? "phone" : "computer", "data-slot": "vk-parts-field", "data-key": k, children: _jsx(EndField, { part: k, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, phone: onPhone, arrows: arrows, format: format }) }, k))) }));
|
|
88
|
+
const boxes = (arrows, onPhone) => (_jsx(PartsRow, { children: ENDS.map(([k, name], i) => (_jsx(QuietField, { label: name, form: onPhone ? "phone" : "computer", "data-slot": "vk-parts-field", "data-key": k, children: _jsx(EndField, { part: k, limits: limits, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, phone: onPhone, arrows: arrows, format: format }) }, k))) }));
|
|
88
89
|
if (phone) {
|
|
89
90
|
const body = (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "phone", ...device, onKeyDown: (e) => {
|
|
90
91
|
if (e.key !== "Enter" || midWord(e.nativeEvent))
|
|
@@ -97,23 +98,23 @@ export function useRangeParts(props, worn, wornAt) {
|
|
|
97
98
|
ends[1].focus({ preventScroll: true });
|
|
98
99
|
else
|
|
99
100
|
keep();
|
|
100
|
-
}, children: [fields ? (_jsx(FieldRows, { look: MIHAI_CARD, className: "o-compound-editor-card", "data-slot": "vk-parts-card", children: ENDS.map(([k, name], i) => (_jsx(FieldRow, { label: name, className: "o-compound-editor-card-row", "data-slot": "vk-parts-field", "data-key": k, labelClassName: "o-compound-editor-card-label", children: _jsx(CardEnd, { part: k, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) }, k))) })) : boxes(false, true), note, clearedNote, bandList] }));
|
|
101
|
+
}, children: [fields ? (_jsx(FieldRows, { look: MIHAI_CARD, className: "o-compound-editor-card", "data-slot": "vk-parts-card", children: ENDS.map(([k, name], i) => (_jsx(FieldRow, { label: name, className: "o-compound-editor-card-row", "data-slot": "vk-parts-field", "data-key": k, labelClassName: "o-compound-editor-card-label", children: _jsx(CardEnd, { part: k, limits: limits, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) }, k))) })) : boxes(false, true), note, clearedNote, bandList] }));
|
|
101
102
|
if (shell)
|
|
102
103
|
return { body, head: {} };
|
|
103
|
-
return { body, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label":
|
|
104
|
+
return { body, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label": w.close, icon: glyph(X), onClick: leave }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": w.save, icon: glyph(TICK), onClick: keep }) } };
|
|
104
105
|
}
|
|
105
|
-
const body = (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "computer", ...device, onKeyDown: onKeyDown, onBlur: shell ? undefined : (e) => blurKeeps(settled, keep)(e), onFocus: () => { settled.current = false; }, children: [fields ? (_jsx("div", { className: "o-compound-editor-pair", "data-slot": "vk-parts-pair", children: ENDS.map(([k, name], i) => (_jsxs(React.Fragment, { children: [i === 1 && _jsx("span", { className: "o-compound-editor-dash", "aria-hidden": "true", children: "\u2013" }), _jsx(Field, { label: name, "data-slot": "vk-parts-field", "data-key": k, children: _jsx(PairField, { part: k, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) })] }, k))) })) : boxes(worn.arrows === "editing", false), note, clearedNote, bandList] }));
|
|
106
|
+
const body = (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "computer", ...device, onKeyDown: onKeyDown, onBlur: shell ? undefined : (e) => blurKeeps(settled, keep)(e), onFocus: () => { settled.current = false; }, children: [fields ? (_jsx("div", { className: "o-compound-editor-pair", "data-slot": "vk-parts-pair", children: ENDS.map(([k, name], i) => (_jsxs(React.Fragment, { children: [i === 1 && _jsx("span", { className: "o-compound-editor-dash", "aria-hidden": "true", children: "\u2013" }), _jsx(Field, { label: name, "data-slot": "vk-parts-field", "data-key": k, children: _jsx(PairField, { part: k, limits: limits, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) })] }, k))) })) : boxes(worn.arrows === "editing", false), note, clearedNote, bandList] }));
|
|
106
107
|
return { body, head: {} };
|
|
107
108
|
}
|
|
108
|
-
function EndField({ part, words, value, set, box, phone, arrows, format }) {
|
|
109
|
+
function EndField({ part, words, value, set, box, limits, phone, arrows, format }) {
|
|
109
110
|
const root = React.useCallback((el) => box?.(el?.querySelector("input") ?? null), [box]);
|
|
110
|
-
return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: phone ? "lg" : "sm", align: "end", steppers: arrows ? "arrows" : false, autofill: false, value: value, onValueChange: (v) => set(v), format: format });
|
|
111
|
+
return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: phone ? "lg" : "sm", align: "end", steppers: arrows ? "arrows" : false, autofill: false, value: value, onValueChange: (v) => set(v), format: format, ...limits });
|
|
111
112
|
}
|
|
112
|
-
function CardEnd({ part, words, value, set, box, format }) {
|
|
113
|
+
function CardEnd({ part, words, value, set, box, limits, format }) {
|
|
113
114
|
const root = React.useCallback((el) => box?.(el?.querySelector("input") ?? null), [box]);
|
|
114
|
-
return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, chrome: "bare", autofill: false, value: value, onValueChange: (v) => set(v), format: format });
|
|
115
|
+
return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, chrome: "bare", autofill: false, value: value, onValueChange: (v) => set(v), format: format, ...limits });
|
|
115
116
|
}
|
|
116
|
-
function PairField({ part, words, value, set, box, format }) {
|
|
117
|
+
function PairField({ part, words, value, set, box, limits, format }) {
|
|
117
118
|
const root = React.useCallback((el) => box?.(el?.querySelector("input") ?? null), [box]);
|
|
118
|
-
return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: "sm", steppers: false, autofill: false, value: value, onValueChange: (v) => set(v), format: format });
|
|
119
|
+
return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: "sm", steppers: false, autofill: false, value: value, onValueChange: (v) => set(v), format: format, ...limits });
|
|
119
120
|
}
|
|
@@ -33,6 +33,9 @@ export interface CompoundEditorWords {
|
|
|
33
33
|
/** A place's boxes while no country names them, in Attio's look and in the country-first one (`own`), and the short ones a
|
|
34
34
|
* phone's row takes there; each part left out says the editor's own English (place.ts). */
|
|
35
35
|
parts?: PlaceWords;
|
|
36
|
+
/** A phone's head where no holder keeps the draft: its ✕ and ✓ (VK-997). */
|
|
37
|
+
close: string;
|
|
38
|
+
save: string;
|
|
36
39
|
/** The words of its lists. */
|
|
37
40
|
picker?: Partial<PickerWords>;
|
|
38
41
|
}
|
|
@@ -20,5 +20,7 @@ export const COMPOUND_EDITOR_WORDS = {
|
|
|
20
20
|
increase: "Increase",
|
|
21
21
|
decrease: "Decrease",
|
|
22
22
|
numberField: "Number field",
|
|
23
|
+
close: "Close",
|
|
24
|
+
save: "Save",
|
|
23
25
|
};
|
|
24
26
|
export const compoundWords = (given) => (given ? { ...COMPOUND_EDITOR_WORDS, ...given } : COMPOUND_EDITOR_WORDS);
|
|
@@ -4,9 +4,12 @@ import { type SheetHeadProps } from "../sheet/bottom-sheet.js";
|
|
|
4
4
|
import { type CustomizeWorn } from "./looks.js";
|
|
5
5
|
import { type CustomizeColumn } from "./rules.js";
|
|
6
6
|
import { type CustomizeWords } from "./words.js";
|
|
7
|
+
import type { ViewsCustomizeItems } from "../../provider/components.js";
|
|
7
8
|
export type { CustomizeColumn } from "./rules.js";
|
|
8
9
|
/** Where it stands: its list, or a section's screen. */
|
|
9
|
-
export type CustomizeScreen = "list" | "layout" | "columns" | "filter" | "sort" | "group"
|
|
10
|
+
export type CustomizeScreen = "list" | "layout" | "columns" | "filter" | "sort" | "group" | `page:${string}`;
|
|
11
|
+
/** Customize's own five pages, each with its own Reset and mark (VK-1034, VK-1048). */
|
|
12
|
+
type CustomizePageKey = "layout" | "columns" | "filter" | "sort" | "group";
|
|
10
13
|
/** The view it sets: its name, its layout's id, its columns in order, Show counts, and a table's Freeze first column and Wrap text. */
|
|
11
14
|
export interface CustomizeView {
|
|
12
15
|
name: string;
|
|
@@ -35,14 +38,16 @@ export interface CustomizeSection {
|
|
|
35
38
|
back: () => void;
|
|
36
39
|
} | null;
|
|
37
40
|
}
|
|
38
|
-
/** A setting turned on or off: its key, words, value and write; `icon`, its mark before its name; `
|
|
39
|
-
*
|
|
41
|
+
/** A setting turned on or off: its key, words, value and write; `icon`, its mark before its name; `section`, the heading it
|
|
42
|
+
* stands under. */
|
|
40
43
|
export interface CustomizeToggle {
|
|
41
44
|
key: string;
|
|
42
45
|
label: string;
|
|
43
46
|
value: boolean;
|
|
44
47
|
onChange: (on: boolean) => void;
|
|
45
48
|
icon?: React.ReactNode;
|
|
49
|
+
/** @deprecated Drawn nowhere since a toggle carries no way back of its own (VK-1033): Customize's Reset is the way back. To be
|
|
50
|
+
* removed in a later release. */
|
|
46
51
|
reset?: () => void;
|
|
47
52
|
section?: string;
|
|
48
53
|
}
|
|
@@ -57,11 +62,11 @@ export interface CustomizeChoice {
|
|
|
57
62
|
}[];
|
|
58
63
|
onChange: (value: string) => void;
|
|
59
64
|
}
|
|
60
|
-
/** Layout's own settings, in place of a table's Freeze and Wrap: its pick-one settings
|
|
61
|
-
* over a shared view, with its way back. */
|
|
65
|
+
/** Layout's own settings, in place of a table's Freeze and Wrap: its pick-one settings and its toggles. */
|
|
62
66
|
export interface CustomizeLayoutSettings {
|
|
63
67
|
toggles: CustomizeToggle[];
|
|
64
68
|
choices: CustomizeChoice[];
|
|
69
|
+
/** @deprecated Drawn nowhere since the Layout page ends at its toggles (VK-1033). To be removed in a later release. */
|
|
65
70
|
personal?: {
|
|
66
71
|
label: string;
|
|
67
72
|
toggles: CustomizeToggle[];
|
|
@@ -131,7 +136,18 @@ export interface CustomizeProps {
|
|
|
131
136
|
toggles?: CustomizeToggle[];
|
|
132
137
|
/** Layout's own settings, in place of a table's Freeze and Wrap from the view. */
|
|
133
138
|
layoutSettings?: CustomizeLayoutSettings;
|
|
134
|
-
/**
|
|
139
|
+
/** Each page's own Reset, while that page differs from the view as saved (VK-1034): drawn on its screen, in the first
|
|
140
|
+
* page's Reset's word and look and place, never on a level the screen opened in place. Handed (even empty), these
|
|
141
|
+
* alone stand: `columnsReset` is not read. */
|
|
142
|
+
resets?: Partial<Record<CustomizePageKey, () => void>>;
|
|
143
|
+
/** A section differs from the view as saved (VK-1048): its value in the brand. Absent, Layout and Columns carry no mark;
|
|
144
|
+
* Filter, Sort and Group carry their own section's `inForce`. */
|
|
145
|
+
differs?: Partial<Record<CustomizePageKey, boolean>>;
|
|
146
|
+
/** Customize's rows as data (VK-1062): handed each page's default rows (its list's, Layout's, Columns'), it hands back the
|
|
147
|
+
* rows drawn. A default key keeps ViewKit's row with the item's words; any other key is the app's row, or on the list a page
|
|
148
|
+
* of its own. Absent, every row as ViewKit draws it. */
|
|
149
|
+
items?: ViewsCustomizeItems;
|
|
150
|
+
/** @deprecated Columns' page Reset where no `resets` is handed at all. To be removed in a later release. */
|
|
135
151
|
columnsReset?: () => void;
|
|
136
152
|
/** A card's field starting a new line, turned on or off (its column's `line`, VK-890). */
|
|
137
153
|
onLineChange?: (id: string) => void;
|