viewkitjs 0.28.0 → 0.29.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 +107 -0
- package/MIGRATION.md +85 -4
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/contract.d.ts +149 -3
- package/views/dist/contract.js +157 -1
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/controls.d.ts +10 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/customize/customize.d.ts +125 -0
- package/views/dist/controls/customize/customize.js +243 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
- package/views/dist/controls/customize/map-customize-body.js +160 -0
- package/views/dist/controls/customize/rules.d.ts +23 -0
- package/views/dist/controls/customize/rules.js +19 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +58 -0
- package/views/dist/controls/customize/words.js +37 -0
- package/views/dist/controls/customize.css +54 -0
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +85 -43
- package/views/dist/controls/filter-editor/how.d.ts +1 -1
- package/views/dist/controls/filter-editor/how.js +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
- package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
- package/views/dist/controls/filter-editor/map-rules.js +73 -42
- package/views/dist/controls/filter-editor/rules.d.ts +43 -5
- package/views/dist/controls/filter-editor/rules.js +55 -2
- package/views/dist/controls/filter-editor/words.d.ts +15 -0
- package/views/dist/controls/filter-editor/words.js +6 -0
- package/views/dist/controls/filter-editor.css +18 -0
- package/views/dist/controls/index.d.ts +26 -2
- package/views/dist/controls/index.js +25 -2
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/pane.d.ts +4 -0
- package/views/dist/controls/pane/pane.js +2 -1
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/text-editor.js +1 -5
- package/views/dist/controls/toast/toast.d.ts +5 -1
- package/views/dist/controls/toast/toast.js +5 -3
- package/views/dist/controls/tokens.js +18 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +3 -3
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +3 -0
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/grid/chrome/GridHeader.js +2 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -0
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +10 -2
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +9 -4
- package/views/dist/panels/react/customize-body.js +39 -11
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +9 -6
- package/views/dist/panels/react/filter/FilterEditor.js +4 -4
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +3 -3
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/panel-step.d.ts +3 -0
- package/views/dist/panels/react/panel-step.js +2 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +13 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +40 -9
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.js +29 -5
- package/views/dist/provider/components.d.ts +149 -8
- package/views/dist/provider/context.d.ts +6 -0
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +4 -1
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +656 -25
- package/views/dist/styles.unlayered.css +653 -22
- package/views/docs/contract.md +44 -17
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +2 -2
- package/views/docs/guides/display.md +2 -2
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +6 -6
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +1 -1
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +1 -1
- package/views/docs/reference/controls.md +194 -13
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +7 -7
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +13 -6
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +7 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface QuickFiltersWords {
|
|
2
|
+
/** The strip's name to a screen reader ("Fields"). */
|
|
3
|
+
fields: string;
|
|
4
|
+
/** A field's search, where the field hands no words of its own ("Search Stage"). */
|
|
5
|
+
search: (field: string) => string;
|
|
6
|
+
/** What a held value says before its count ("Clear filter"). */
|
|
7
|
+
clear: string;
|
|
8
|
+
/** What a search that finds nothing says ("Nothing matches."). */
|
|
9
|
+
none: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const QUICK_FILTERS_WORDS: QuickFiltersWords;
|
|
12
|
+
/** The words handed, each left out the English. */
|
|
13
|
+
export declare const quickFiltersWords: (given?: Partial<QuickFiltersWords>) => QuickFiltersWords;
|
|
14
|
+
/** The reminder's words (QuickFiltersReminderControl): its name, its press's name over the held values' names, and its ✕. */
|
|
15
|
+
export interface QuickFiltersReminderWords {
|
|
16
|
+
/** Its name to a screen reader ("Quick filters held"). */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Its press's name, over the held values' names joined ("Quick filters: Won, Lost"). */
|
|
19
|
+
names: (names: string) => string;
|
|
20
|
+
/** Its ✕, letting every hold go ("Clear quick filters"). */
|
|
21
|
+
clear: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const QUICK_FILTERS_REMINDER_WORDS: QuickFiltersReminderWords;
|
|
24
|
+
/** The reminder's words handed, each left out the English. */
|
|
25
|
+
export declare const quickFiltersReminderWords: (given?: Partial<QuickFiltersReminderWords>) => QuickFiltersReminderWords;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const QUICK_FILTERS_WORDS = {
|
|
2
|
+
fields: "Fields",
|
|
3
|
+
search: (field) => `Search ${field}`,
|
|
4
|
+
clear: "Clear filter",
|
|
5
|
+
none: "Nothing matches.",
|
|
6
|
+
};
|
|
7
|
+
export const quickFiltersWords = (given) => given ? { ...QUICK_FILTERS_WORDS, ...Object.fromEntries(Object.entries(given).filter(([, w]) => w !== undefined)) } : QUICK_FILTERS_WORDS;
|
|
8
|
+
export const QUICK_FILTERS_REMINDER_WORDS = {
|
|
9
|
+
label: "Quick filters held",
|
|
10
|
+
names: (names) => `Quick filters: ${names}`,
|
|
11
|
+
clear: "Clear quick filters",
|
|
12
|
+
};
|
|
13
|
+
export const quickFiltersReminderWords = (given) => given ? { ...QUICK_FILTERS_REMINDER_WORDS, ...Object.fromEntries(Object.entries(given).filter(([, w]) => w !== undefined)) } : QUICK_FILTERS_REMINDER_WORDS;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* Quick filters: a body (the Outright kit's, KIT-684 and KIT-833; ViewKit's since VK-724). Every value it draws with is a name
|
|
2
|
+
ViewKit's controls read (docs/controls/quick-filters.md); this file lays out its own parts, as the toolbar's canvas draws them
|
|
3
|
+
(round 9's .facets, .srch and .qr): its top (the strip, then the search), the open field's values, and the phone's form of the
|
|
4
|
+
same. The strip is the Toggle group and the search the Input, each drawn by its own file. A held value is data-held on its row,
|
|
5
|
+
on a neutral ground; while its field holds one, the list is data-quiet and its other values go quiet. The rules sit in the
|
|
6
|
+
components layer. */
|
|
7
|
+
@layer components {
|
|
8
|
+
|
|
9
|
+
/* The strip: three across, each pill as wide as the others; over the Toggle group's own row (two classes, so it holds whichever
|
|
10
|
+
stylesheet comes last). */
|
|
11
|
+
.o-quick-filters-top > .o-quick-filters-strip { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
12
|
+
|
|
13
|
+
/* The body: its top (the strip, then the search), then the values, 8 apart. The values scroll while the top stays put: in a box of
|
|
14
|
+
their own where the Pane is as tall as the list, and under the top, pinned on the Pane's ground, where it fits what it holds (its
|
|
15
|
+
body then has no height of its own to fill, and scrolls). */
|
|
16
|
+
.o-quick-filters { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--vk-fg); }
|
|
17
|
+
.o-quick-filters-top {
|
|
18
|
+
position: sticky; top: 0; z-index: 1; flex: none; display: flex; flex-direction: column; gap: calc(var(--vk-spacing) * 2);
|
|
19
|
+
padding-bottom: calc(var(--vk-spacing) * 2); background-color: var(--vk-overlay);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* The values: rows 40 high, 12 in, the list's corners, 1 apart; under the pointer the overlay's hover. */
|
|
23
|
+
.o-quick-filters-values { display: flex; flex-direction: column; gap: var(--vk-border-width); flex: 1 1 auto; min-height: 0; overflow-y: auto; outline: none; }
|
|
24
|
+
.o-quick-filters-value {
|
|
25
|
+
flex: none; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2.5); height: calc(var(--vk-spacing) * 10); padding: 0 calc(var(--vk-spacing) * 3);
|
|
26
|
+
border-radius: var(--vk-radius-lg); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg);
|
|
27
|
+
cursor: pointer; user-select: none; outline: none;
|
|
28
|
+
}
|
|
29
|
+
@media (hover: hover) { .o-quick-filters-value:hover { background-color: var(--vk-overlay-hovered); } }
|
|
30
|
+
.o-quick-filters-value:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: calc(-1 * var(--vk-focus-width)); }
|
|
31
|
+
.o-quick-filters-mark { flex: none; display: inline-flex; align-items: center; }
|
|
32
|
+
.o-quick-filters-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
33
|
+
.o-quick-filters-count { flex: none; font-size: var(--vk-font-size-xs); color: var(--vk-fg-subtlest); font-variant-numeric: tabular-nums; }
|
|
34
|
+
.o-quick-filters-clear { flex: none; font-size: var(--vk-font-size-xs); color: var(--vk-fg-subtle); }
|
|
35
|
+
|
|
36
|
+
/* A search that finds nothing: the Picker's words where the values stand, drawn as its message is (.o-picker-message), centred. */
|
|
37
|
+
.o-quick-filters-none {
|
|
38
|
+
flex: none; margin: 0; padding: calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 2); text-align: center;
|
|
39
|
+
font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg-subtle);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Held: the overlay's card ground, a very subtle grey, never the brand (Mihai, 19 Nov 2026; KIT-778); its name at medium weight,
|
|
43
|
+
Clear filter before its count. Under the pointer a touch stronger, the card's pressed step: the overlay's own hover, pressed and
|
|
44
|
+
selected are one grey in dark, so this pair is the one a touch apart in both themes. */
|
|
45
|
+
.o-quick-filters-value[data-held] { background-color: var(--vk-overlay-card); }
|
|
46
|
+
.o-quick-filters-value[data-held] .o-quick-filters-name { font-weight: var(--vk-font-weight-medium); }
|
|
47
|
+
@media (hover: hover) { .o-quick-filters-value[data-held]:hover { background-color: var(--vk-overlay-card-pressed); } }
|
|
48
|
+
|
|
49
|
+
/* While its field holds a value, the others go quiet: their names and their counts. */
|
|
50
|
+
.o-quick-filters-values[data-quiet] .o-quick-filters-value:not([data-held]) .o-quick-filters-name { color: var(--vk-fg-subtlest); }
|
|
51
|
+
.o-quick-filters-values[data-quiet] .o-quick-filters-value:not([data-held]) .o-quick-filters-count { color: var(--vk-fg-disabled); }
|
|
52
|
+
|
|
53
|
+
/* On a phone (KIT-833): the same body in the full Sheet, a step up. The top 12 apart and 12 over the values; a value's row 44 high
|
|
54
|
+
in the phone's words, its count and Clear filter a size under them. No pointer to hover with: a press grounds its row while the
|
|
55
|
+
finger is on it, the computer's hover pair (the overlay's hover; held, the card's pressed step). The strip's pills and the search
|
|
56
|
+
take their phone sizes in the body (quick-filters.tsx). */
|
|
57
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-top { gap: calc(var(--vk-spacing) * 3); padding-bottom: calc(var(--vk-spacing) * 3); }
|
|
58
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-value {
|
|
59
|
+
height: calc(var(--vk-spacing) * 11); font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base));
|
|
60
|
+
}
|
|
61
|
+
.o-quick-filters[data-form="phone"] :is(.o-quick-filters-count, .o-quick-filters-clear) { font-size: var(--vk-font-size-sm); }
|
|
62
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-value:active { background-color: var(--vk-overlay-hovered); }
|
|
63
|
+
.o-quick-filters[data-form="phone"] .o-quick-filters-value[data-held]:active { background-color: var(--vk-overlay-card-pressed); }
|
|
64
|
+
|
|
65
|
+
/* The reminder (the Outright kit's, KIT-833; ViewKit's since VK-858; reminder.tsx): on a phone, what says a hold stands while quick filters are closed, the bulk bar's pill's
|
|
66
|
+
surface in its place (bulk-bar.css), at the centre of its holder's foot, its holder being the list's placed box, its parent.
|
|
67
|
+
Every value a token:
|
|
68
|
+
|
|
69
|
+
.o-quick-filters-reminder the pill; data-shown while something held is named, else gone (display none, after its going)
|
|
70
|
+
.o-quick-filters-reminder-words its own press: the first held value's mark and the names, which end in "…"
|
|
71
|
+
.o-quick-filters-reminder-more "+N", the names not shown
|
|
72
|
+
--quick-filters-reminder-bottom how far above the holder's foot it stands (the phone's own foot, or 16)
|
|
73
|
+
--quick-filters-reminder-height how tall it is (52, the pill's)
|
|
74
|
+
--quick-filters-room the room it takes at its holder's foot, handed to the holder while it is shown (none when it
|
|
75
|
+
isn't, or while the bulk bar shows there): a list that scrolls in the holder pads its foot by
|
|
76
|
+
it, and New's + stands on it, rising above the reminder */
|
|
77
|
+
:is(.o-quick-filters-reminder), :has(> .o-quick-filters-reminder) {
|
|
78
|
+
--quick-filters-reminder-bottom: max(var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)), calc(var(--vk-spacing) * 4));
|
|
79
|
+
--quick-filters-reminder-height: calc(var(--vk-spacing) * 13);
|
|
80
|
+
}
|
|
81
|
+
:has(> .o-quick-filters-reminder) { --quick-filters-room: 0px; }
|
|
82
|
+
:has(> .o-quick-filters-reminder[data-shown]) { --quick-filters-room: calc(var(--quick-filters-reminder-bottom) + var(--quick-filters-reminder-height) + var(--vk-spacing) * 2); }
|
|
83
|
+
/* While the bulk bar shows in the same list, it steps aside and gives its room back (after the rule above, which it outweighs by
|
|
84
|
+
order): two pills at a list's foot is one too many, and the bar is what the picked rows need. */
|
|
85
|
+
:has(> .o-bulk-bar[data-shown]) { --quick-filters-room: 0px; }
|
|
86
|
+
:has(> .o-bulk-bar[data-shown]) > .o-quick-filters-reminder { display: none; opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); transition: none; }
|
|
87
|
+
|
|
88
|
+
.o-quick-filters-reminder {
|
|
89
|
+
position: absolute; z-index: var(--vk-layer-sticky); left: 50%; bottom: var(--quick-filters-reminder-bottom); translate: -50% 0;
|
|
90
|
+
display: flex; align-items: center; box-sizing: border-box; width: max-content; height: var(--quick-filters-reminder-height); max-width: calc(100% - var(--vk-spacing) * 8);
|
|
91
|
+
padding-inline: calc(var(--vk-spacing) * 1.5); border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-full);
|
|
92
|
+
background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-menu); color: var(--vk-fg); white-space: nowrap; opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
.o-quick-filters-reminder > .o-toolbar { min-width: 0; }
|
|
95
|
+
.o-quick-filters-reminder:not([data-shown]) { display: none; opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); }
|
|
96
|
+
/* It comes up from just under its place and goes back down, as the bulk bar does. Still where a person asks for less motion. */
|
|
97
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
98
|
+
.o-quick-filters-reminder {
|
|
99
|
+
transition: opacity var(--vk-duration-base) var(--vk-ease-out), translate var(--vk-duration-base) var(--vk-ease-out), display var(--vk-duration-base) allow-discrete;
|
|
100
|
+
@starting-style { opacity: 0; translate: -50% calc(var(--vk-spacing) * 2); }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Its own press: round, 44 high, no ground at rest; under the pointer the overlay's hover, pressed its pressed step. */
|
|
105
|
+
.o-quick-filters-reminder-words {
|
|
106
|
+
display: inline-flex; flex: 0 1 auto; align-items: center; gap: calc(var(--vk-spacing) * 2); box-sizing: border-box; min-width: 0;
|
|
107
|
+
height: calc(var(--vk-spacing) * 11); margin: 0; padding-inline: calc(var(--vk-spacing) * 3); border: 0; border-radius: var(--vk-radius-full);
|
|
108
|
+
background-color: transparent; color: var(--vk-fg); font: inherit; font-size: var(--vk-font-size-base); line-height: var(--vk-line-height-base);
|
|
109
|
+
white-space: nowrap; cursor: pointer;
|
|
110
|
+
}
|
|
111
|
+
/* In the Toolbar, its names give way before its ✕ does, over the Toolbar's flex: none on what a line holds (VK-860). */
|
|
112
|
+
.o-toolbar-line > .o-quick-filters-reminder-words { flex: 0 1 auto; }
|
|
113
|
+
.o-quick-filters-reminder-words > span:not(.o-quick-filters-mark, .o-quick-filters-reminder-more) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
114
|
+
@media (hover: hover) { .o-quick-filters-reminder-words:hover { background-color: var(--vk-overlay-hovered); } }
|
|
115
|
+
.o-quick-filters-reminder-words:active { background-color: var(--vk-overlay-pressed); }
|
|
116
|
+
.o-quick-filters-reminder-words:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
|
|
117
|
+
.o-quick-filters-reminder-more { flex: none; color: var(--vk-fg-subtle); font-variant-numeric: tabular-nums; }
|
|
118
|
+
}
|
|
@@ -10,8 +10,11 @@ export declare const SheetClose: ({ children }: {
|
|
|
10
10
|
children: React.ReactElement;
|
|
11
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export interface SheetHeadProps {
|
|
13
|
-
/** What it is. */
|
|
14
|
-
title:
|
|
13
|
+
/** What it is: words, or words with a mark beside them. */
|
|
14
|
+
title: React.ReactNode;
|
|
15
|
+
/** Its name to screen readers where the title says it otherwise (a mark beside the words, other words): the title is what
|
|
16
|
+
* names the sheet, so this names the title. */
|
|
17
|
+
titleLabel?: string;
|
|
15
18
|
/** Where its title stands, which each sheet chooses: centred, or at the left. */
|
|
16
19
|
titleAt?: "center" | "left";
|
|
17
20
|
/** A second line under the title, quieter. */
|
|
@@ -46,7 +49,7 @@ export declare function SheetButton({ className, kind, children, ...props }: {
|
|
|
46
49
|
/** Its head, one of its kinds: the one header (HeaderBar), under its handle. Glass has on its left the X, or Back in its place, and on its right one action, or two, as the phone header's Two buttons says.
|
|
47
50
|
* Flat has Back on its left, if there is one, and its action and the X on its right. Or Decide, a button either side of its
|
|
48
51
|
* title. A sheet with no head is its handle alone. */
|
|
49
|
-
export declare function SheetHead({ title, titleAt, description, close, onBack, left, right, children, words }: SheetHeadProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function SheetHead({ title, titleLabel, titleAt, description, close, onBack, left, right, children, words }: SheetHeadProps): import("react/jsx-runtime").JSX.Element;
|
|
50
53
|
/** Its foot: stays at the foot of the screen at every stop, and leaves with the sheet. */
|
|
51
54
|
export declare const SheetFoot: ({ children }: {
|
|
52
55
|
children: React.ReactNode;
|
|
@@ -96,8 +99,10 @@ export interface SheetProps {
|
|
|
96
99
|
standing?: boolean;
|
|
97
100
|
/** Where focus goes once it shuts. Nothing found, or left out, focus goes back to what opened it. */
|
|
98
101
|
finalFocus?: () => HTMLElement | null;
|
|
102
|
+
/** A class on the sheet itself, after its own. */
|
|
103
|
+
className?: string;
|
|
99
104
|
/** Its head and its body. */
|
|
100
105
|
children: React.ReactNode;
|
|
101
106
|
}
|
|
102
107
|
/** What rises from the bottom of the phone, in a form, at stops. What it holds is poured in. */
|
|
103
|
-
export declare function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form, stops, openAt, stop, onStopChange, mark: marked, container, standing: stands, finalFocus, children }: SheetProps): import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
export declare function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form, stops, openAt, stop, onStopChange, mark: marked, container, standing: stands, finalFocus, className, children }: SheetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -20,10 +20,10 @@ export const SheetClose = ({ children }) => _jsx(Base.Close, { render: children
|
|
|
20
20
|
export function SheetButton({ className, kind, children, ...props }) {
|
|
21
21
|
return _jsxs(_Fragment, { children: [_jsx(GlassButton, { ...props, kind: kind, className: cx("o-sheet-glass", className), children: children }), _jsx(Button, { ...props, kind: kind ?? "quiet", shape: children == null ? "icon" : undefined, className: cx("o-sheet-plain", className), children: children })] });
|
|
22
22
|
}
|
|
23
|
-
export function SheetHead({ title, titleAt, description, close = true, onBack, left, right, children, words }) {
|
|
23
|
+
export function SheetHead({ title, titleLabel, titleAt, description, close = true, onBack, left, right, children, words }) {
|
|
24
24
|
const closeWord = words?.close ?? "Close", backWord = words?.back ?? "Back";
|
|
25
25
|
const sides = left != null || right != null;
|
|
26
|
-
return (_jsx("div", { className: "o-sheet-head", children: _jsx(HeaderBar, { className: "o-sheet-row", titleAt: titleAt, "data-sides": sides ? "" : undefined, left: sides ? left : onBack ? _jsx(SheetButton, { "aria-label": backWord, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack }) : close && _jsx(Base.Close, { render: _jsx(GlassButton, { "aria-label": closeWord, className: "o-sheet-glass", icon: glyph(X) }) }), title: _jsx(Base.Title, { className: "o-sheet-title", children: title }), description: description, descriptionRender: _jsx(Base.Description, {}), right: sides ? right : _jsxs(_Fragment, { children: [children, close && _jsx(Base.Close, { render: _jsx(Button, { kind: "quiet", shape: "icon", "aria-label": closeWord, className: "o-sheet-plain", icon: glyph(X) }) })] }) }) }));
|
|
26
|
+
return (_jsx("div", { className: "o-sheet-head", children: _jsx(HeaderBar, { className: "o-sheet-row", titleAt: titleAt, "data-sides": sides ? "" : undefined, left: sides ? left : onBack ? _jsx(SheetButton, { "aria-label": backWord, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack }) : close && _jsx(Base.Close, { render: _jsx(GlassButton, { "aria-label": closeWord, className: "o-sheet-glass", icon: glyph(X) }) }), title: _jsx(Base.Title, { className: "o-sheet-title", "aria-label": titleLabel, children: title }), description: description, descriptionRender: _jsx(Base.Description, {}), right: sides ? right : _jsxs(_Fragment, { children: [children, close && _jsx(Base.Close, { render: _jsx(Button, { kind: "quiet", shape: "icon", "aria-label": closeWord, className: "o-sheet-plain", icon: glyph(X) }) })] }) }) }));
|
|
27
27
|
}
|
|
28
28
|
export const SheetFoot = ({ children }) => _jsx("div", { className: "o-sheet-foot", children: children });
|
|
29
29
|
export const SheetBody = React.forwardRef(function SheetBody({ onScroll, children }, ref) {
|
|
@@ -246,7 +246,7 @@ function useKeyboardFoot(popup, on) {
|
|
|
246
246
|
return () => { vv.removeEventListener("resize", read); vv.removeEventListener("scroll", read); popup.style.removeProperty("--sheet-keyboard"); };
|
|
247
247
|
}, [typing, popup]);
|
|
248
248
|
}
|
|
249
|
-
export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form = "full", stops, openAt, stop, onStopChange, mark: marked = "[data-sheet-mark]", container, standing: stands, finalFocus, children }) {
|
|
249
|
+
export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form = "full", stops, openAt, stop, onStopChange, mark: marked = "[data-sheet-mark]", container, standing: stands, finalFocus, className, children }) {
|
|
250
250
|
const closeBelow = React.useContext(CloseAll), stacked = closeBelow !== null;
|
|
251
251
|
const standsBelow = React.useContext(Standing), standing = stands || standsBelow;
|
|
252
252
|
const [armed, setArmed] = React.useState(false);
|
|
@@ -372,5 +372,5 @@ export function Sheet({ open, onOpenChange, onOpenChangeComplete, label, form =
|
|
|
372
372
|
}, children: _jsxs(Base.Portal, { container: container, children: [_jsx(Base.Backdrop, { ref: backdrop, forceRender: stacked, className: "o-sheet-backdrop", "data-stacked": stacked ? "" : undefined }), _jsxs(Base.Viewport, { ref: setViewport, className: "o-sheet-viewport", "data-sheet-form": form, onClick: standing ? (e) => { if (e.target === e.currentTarget) {
|
|
373
373
|
release("closed");
|
|
374
374
|
close("outside-press");
|
|
375
|
-
} } : undefined, children: [_jsx(Base.Popup, { ref: bindPopup, initialFocus: popupRef, finalFocus: finalFocus ? () => finalFocus() ?? true : undefined, className: "o-sheet o-smooth", "data-sheet-form": form, "aria-label": label, "data-kit": "sheet", children: _jsxs("div", { className: "o-sheet-cut", children: [_jsx("div", { className: "o-sheet-handle", "aria-hidden": "true" }), _jsx(Standing.Provider, { value: standing, children: _jsx(Body.Provider, { value: body, children: _jsx(CloseAll.Provider, { value: closeAll, children: children }) }) })] }) }), coming && _jsx("div", { className: "o-sheet-shield", "aria-hidden": "true", "data-sheet-shield": "", onPointerDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onClick: (e) => e.stopPropagation() })] })] }) }));
|
|
375
|
+
} } : undefined, children: [_jsx(Base.Popup, { ref: bindPopup, initialFocus: popupRef, finalFocus: finalFocus ? () => finalFocus() ?? true : undefined, className: cx("o-sheet o-smooth", className), "data-sheet-form": form, "aria-label": label, "data-kit": "sheet", children: _jsxs("div", { className: "o-sheet-cut", children: [_jsx("div", { className: "o-sheet-handle", "aria-hidden": "true" }), _jsx(Standing.Provider, { value: standing, children: _jsx(Body.Provider, { value: body, children: _jsx(CloseAll.Provider, { value: closeAll, children: children }) }) })] }) }), coming && _jsx("div", { className: "o-sheet-shield", "aria-hidden": "true", "data-sheet-shield": "", onPointerDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onMouseDown: (e) => { e.preventDefault(); e.stopPropagation(); }, onClick: (e) => e.stopPropagation() })] })] }) }));
|
|
376
376
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { ViewsSheetProps } from "../../provider/components.js";
|
|
2
|
+
import { type SheetProps } from "./bottom-sheet.js";
|
|
3
|
+
/** The Sheet's form and stops for each height ViewKit asks for. */
|
|
4
|
+
export declare const SNAP_FORM: Readonly<Record<NonNullable<ViewsSheetProps["snap"]>, Pick<SheetProps, "form" | "stops" | "openAt">>>;
|
|
2
5
|
/** ViewKit's sheet, drawn as the kit's Sheet. */
|
|
3
|
-
export declare function MapSheet({ open, onOpenChange, label, actions, children }: ViewsSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function MapSheet({ open, onOpenChange, title, label, description, actions, snap, className, children }: ViewsSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
import { useViews } from "../../provider/context.js";
|
|
3
|
-
import { Sheet, SheetBody, SheetButton, SheetHead } from "./bottom-sheet.js";
|
|
4
|
-
|
|
4
|
+
import { Sheet, SheetBody, SheetButton, SheetFoot, SheetHead } from "./bottom-sheet.js";
|
|
5
|
+
import { STOPS } from "./forms.js";
|
|
6
|
+
import { SheetPartsFrom } from "./sheet-parts.js";
|
|
7
|
+
export const SNAP_FORM = {
|
|
8
|
+
full: { form: "full" },
|
|
9
|
+
auto: { form: "edge" },
|
|
10
|
+
half: { form: "blend" },
|
|
11
|
+
peek: { form: "full", stops: [STOPS.small, STOPS.full], openAt: STOPS.small },
|
|
12
|
+
};
|
|
13
|
+
export function MapSheet({ open, onOpenChange, title, label, description, actions, snap, className, children }) {
|
|
5
14
|
const { icons, messages } = useViews();
|
|
15
|
+
const [parts, setParts] = React.useState(null);
|
|
6
16
|
const words = { close: messages({ key: "views.panels.close" }), back: messages({ key: "views.panels.back" }) };
|
|
7
|
-
const name = label ?? "";
|
|
17
|
+
const name = label ?? "", shown = title ?? name;
|
|
18
|
+
const titleLabel = title != null && title !== name && label ? label : undefined;
|
|
8
19
|
const left = actions?.back ?? actions?.close;
|
|
9
20
|
const Back = icons.back, Close = icons.close, Check = icons.check;
|
|
10
|
-
return (_jsxs(Sheet, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), label: name, children: [
|
|
11
|
-
? _jsx(SheetHead, { title:
|
|
12
|
-
:
|
|
21
|
+
return (_jsxs(Sheet, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), label: name, ...SNAP_FORM[snap ?? "full"], className: className, children: [parts
|
|
22
|
+
? _jsx(SheetHead, { title: parts.title, ...parts.head, words: words })
|
|
23
|
+
: actions && left
|
|
24
|
+
? _jsx(SheetHead, { title: shown, titleLabel: titleLabel, description: description, left: _jsx(SheetButton, { "aria-label": left.label, className: actions.back ? "o-sheet-back" : undefined, icon: actions.back ? _jsx(Back, {}) : _jsx(Close, {}), onClick: left.onPress }), right: actions.done ? _jsx(SheetButton, { kind: "primary", "aria-label": actions.done.label, icon: _jsx(Check, {}), onClick: actions.done.onPress }) : _jsx("span", {}) })
|
|
25
|
+
: _jsx(SheetHead, { title: shown, titleLabel: titleLabel, description: description, words: words }), _jsx(SheetBody, { children: _jsx(SheetPartsFrom.Provider, { value: setParts, children: children }) }), parts?.foot && _jsx(SheetFoot, { children: parts.foot })] }));
|
|
13
26
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { SheetHeadProps } from "./bottom-sheet.js";
|
|
3
|
+
/** What a body hands its Sheet: its title, its Back and ✕, and its foot. */
|
|
4
|
+
export type SheetParts = {
|
|
5
|
+
title: string;
|
|
6
|
+
head: Pick<SheetHeadProps, "onBack" | "close">;
|
|
7
|
+
foot?: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
/** The Sheet's setter for its head's parts, held by a Sheet round what stands in it; null outside one. */
|
|
10
|
+
export declare const SheetPartsFrom: React.Context<((parts: SheetParts | null) => void) | null>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SwitchProps } from "../switch/switch.js";
|
|
3
|
+
export interface SwitchRowProps extends SwitchProps {
|
|
4
|
+
/** The setting's name ("Daily summary"), not the action. */
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
/** A line under it: what it does, or why it is locked. */
|
|
7
|
+
note?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** A setting in a settings list: its name and a line on the left, the switch on the right; the whole row presses it. */
|
|
10
|
+
export declare function SwitchRow({ label, note, ...props }: SwitchRowProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/** Settings rows in a bordered box, a line between each. */
|
|
12
|
+
export declare function SwitchRows({ className, children }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "../../internal/cx.js";
|
|
3
|
+
import { Switch } from "../switch/switch.js";
|
|
4
|
+
export function SwitchRow({ label, note, ...props }) {
|
|
5
|
+
return (_jsxs("label", { className: "o-switch-row", children: [_jsxs("span", { className: "o-choice-text", children: [_jsx("span", { className: "o-choice-label", children: label }), note != null && _jsx("span", { className: "o-choice-note", children: note })] }), _jsx(Switch, { ...props })] }));
|
|
6
|
+
}
|
|
7
|
+
export function SwitchRows({ className, children }) {
|
|
8
|
+
return _jsx("div", { className: cx("o-switch-rows o-smooth o-smooth-ease", className), children: children });
|
|
9
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const SWITCH_ROW_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-border";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--border";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-border-subtle";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--border-subtle";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-hovered";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--surface-hovered";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-border-width";
|
|
15
|
+
readonly kind: "size";
|
|
16
|
+
readonly outright: "--border-width";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-corner-smoothing";
|
|
19
|
+
readonly kind: "size";
|
|
20
|
+
readonly outright: "--corner-smoothing";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-font-size-sm";
|
|
23
|
+
readonly kind: "size";
|
|
24
|
+
readonly outright: "--text-sm";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-font-weight-medium";
|
|
27
|
+
readonly kind: "size";
|
|
28
|
+
readonly outright: "--font-weight-medium";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-line-height-sm";
|
|
31
|
+
readonly kind: "size";
|
|
32
|
+
readonly outright: "--text-sm--line-height";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-radius-lg";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--radius-lg";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-spacing";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--spacing";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-duration-fast";
|
|
43
|
+
readonly kind: "motion";
|
|
44
|
+
readonly outright: "--duration-fast";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-ease-out";
|
|
47
|
+
readonly kind: "motion";
|
|
48
|
+
readonly outright: "--ease-out";
|
|
49
|
+
}];
|
|
50
|
+
/** The rows' card's own machinery: the size its smooth corner is fitted to. */
|
|
51
|
+
export declare const SWITCH_ROW_PRIVATE: readonly ["--rows-card-"];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const SWITCH_ROW_TOKENS = [
|
|
2
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
3
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
4
|
+
{ name: "--vk-hovered", kind: "colour", outright: "--surface-hovered" },
|
|
5
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
6
|
+
{ name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
|
|
7
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
8
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
9
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
10
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
11
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
12
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
13
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
14
|
+
];
|
|
15
|
+
export const SWITCH_ROW_PRIVATE = ["--rows-card-"];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* The SwitchRow and SwitchRows, as the Outright kit draws them (switch-row/switch-row.tsx): a setting in a settings list, its
|
|
2
|
+
words (choice.css) on the left and the Switch (switch.css) on the right, which reads a row under the pointer as its own
|
|
3
|
+
hover; the rows in a bordered box.
|
|
4
|
+
|
|
5
|
+
The rules sit in the components layer, so a utility class on a row still wins. */
|
|
6
|
+
@layer components {
|
|
7
|
+
|
|
8
|
+
/* ── Settings rows: the words on the left, the switch on the right, in a bordered box ──────────────── */
|
|
9
|
+
.o-switch-rows { display: grid; border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-lg); overflow: hidden; }
|
|
10
|
+
.o-switch-row {
|
|
11
|
+
display: flex; align-items: center; justify-content: space-between; gap: calc(var(--vk-spacing) * 4);
|
|
12
|
+
padding: calc(var(--vk-spacing) * 3.5) calc(var(--vk-spacing) * 4); border-top: var(--vk-border-width) solid var(--vk-border-subtle);
|
|
13
|
+
cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--vk-duration-fast) var(--vk-ease-out);
|
|
14
|
+
}
|
|
15
|
+
.o-switch-row:first-child { border-top: 0; }
|
|
16
|
+
@media (hover: hover) { .o-switch-row:hover { background-color: var(--vk-hovered); } }
|
|
17
|
+
.o-switch-row .o-choice-label { font-weight: var(--vk-font-weight-medium); }
|
|
18
|
+
.o-switch-row:has(.o-switch[data-disabled]) { cursor: not-allowed; background-color: transparent; }
|
|
19
|
+
|
|
20
|
+
@media (prefers-reduced-motion: reduce) { .o-switch-row { transition: none; } }
|
|
21
|
+
/* ── The rows' card smooth: following the token corner-smoothing, drawn with the smooth outline (smooth.css) in every browser
|
|
22
|
+
that knows shape(); one that doesn't keeps the corners above. Its round part is fitted to one row, as a control's is.
|
|
23
|
+
Nothing stands outside it (its rows were hidden past its edge), so it is clipped itself, its rows with it, hiding nothing
|
|
24
|
+
more; its edge is a ring along the curve over its rows (::after), as the Kbd's is. The Switch itself, a pill, stays as it
|
|
25
|
+
draws. ── */
|
|
26
|
+
@supports (clip-path: shape(evenodd from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close, move to 0 0, hline to 1px, close)) and (width: calc(tan(atan2(1px, 1px)) * 1px)) {
|
|
27
|
+
.o-switch-rows {
|
|
28
|
+
--smooth-amount: var(--vk-corner-smoothing); --rows-card-side: calc(var(--vk-spacing) * 7 + var(--vk-font-size-sm) * var(--vk-line-height-sm));
|
|
29
|
+
--rows-card-fit: min(var(--vk-radius-lg), var(--rows-card-side) / (2 + 2 * var(--smooth-amount, 0.7)));
|
|
30
|
+
--smooth-t: var(--rows-card-fit); --smooth-side: var(--rows-card-side);
|
|
31
|
+
position: relative; overflow: visible; border-color: transparent; border-radius: var(--rows-card-fit); clip-path: shape(var(--smooth-outline));
|
|
32
|
+
}
|
|
33
|
+
.o-switch-rows::after {
|
|
34
|
+
--smooth-t: max(0px, var(--rows-card-fit) - var(--vk-border-width)); --smooth-in: var(--vk-border-width);
|
|
35
|
+
content: ""; position: absolute; inset: calc(var(--vk-border-width) * -1); z-index: 1; pointer-events: none;
|
|
36
|
+
background-color: var(--vk-border); clip-path: shape(var(--smooth-ring));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
(data-switch-shape), its shape on a phone (data-switch-phone), what it holds (data-switch-mark) and how it moves
|
|
8
8
|
(data-switch-motion). A shape sets its sizes and its resting paint as variables; the states after them (the pointer, on,
|
|
9
9
|
error, disabled) choose among those, a later one winning. The track is painted by ::before, since ::after is its pressing
|
|
10
|
-
area (
|
|
10
|
+
area (press.css's pressing area) and a thin track is narrower than the switch itself.
|
|
11
11
|
|
|
12
12
|
The rules sit in the components layer, so a utility class on a switch still wins. */
|
|
13
13
|
@layer components {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button as BaseButton } from "@base-ui/react/button";
|
|
3
3
|
import { cx } from "../../internal/cx.js";
|
|
4
|
+
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
4
5
|
const TAG = ["M7.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3z"];
|
|
5
6
|
const X = ["M18 6l-12 12", "M6 6l12 12"];
|
|
6
7
|
const glyph = (paths, className, strokeWidth) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", strokeWidth: strokeWidth, "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
|
|
@@ -15,5 +16,6 @@ export function TagCut() {
|
|
|
15
16
|
return _jsx("span", { className: "o-tag-cut o-smooth o-smooth-ease", "aria-hidden": "true" });
|
|
16
17
|
}
|
|
17
18
|
export function TagRemove({ word, onRemove, force }) {
|
|
18
|
-
|
|
19
|
+
const phone = usePhoneForm();
|
|
20
|
+
return _jsx(BaseButton, { type: "button", className: "o-tag-remove", "aria-label": word ? `Remove ${word}` : "Remove", "data-force": force, onClick: onRemove, ...phoneMark(phone), children: glyph(X, "", 2.5) });
|
|
19
21
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type FieldError } from "../field/field.js";
|
|
3
|
+
export interface TagFieldProps {
|
|
4
|
+
/** What the field holds, above it. */
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
/** Under the field: what the tags are for, or why it is off. */
|
|
7
|
+
note?: React.ReactNode;
|
|
8
|
+
/** Under the field in place of the note: the fix; several, as a list, each once. */
|
|
9
|
+
error?: FieldError;
|
|
10
|
+
/** Off: nothing typed in, and its tags have no remove button. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
defaultValue?: string[];
|
|
13
|
+
onValueChange?: (tags: string[]) => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Draws a state for a sheet ("hover", "focus"). */
|
|
17
|
+
"data-force"?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Tags inside the Input's field, before the caret, in a Field with its label, note and error. */
|
|
20
|
+
export declare function TagField({ label, note, error, disabled, defaultValue, onValueChange, placeholder, className, "data-force": force }: TagFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Field } from "../field/field.js";
|
|
4
|
+
import { Input, InputGroup } from "../input/input.js";
|
|
5
|
+
import { Tag } from "../tag/tag.js";
|
|
6
|
+
export function TagField({ label, note, error, disabled, defaultValue = [], onValueChange, placeholder = "Add a tag", className, "data-force": force }) {
|
|
7
|
+
const [tags, setTags] = React.useState(defaultValue), [draft, setDraft] = React.useState("");
|
|
8
|
+
const set = (next) => { setTags(next); onValueChange?.(next); };
|
|
9
|
+
const add = () => { const w = draft.trim(); if (w && !tags.includes(w))
|
|
10
|
+
set([...tags, w]); setDraft(""); };
|
|
11
|
+
return (_jsx(Field, { label: label, note: note, error: error, disabled: disabled, className: className, children: _jsxs(InputGroup, { className: "o-tag-field", "data-force": force, children: [tags.map((t) => _jsx(Tag, { onRemove: disabled ? undefined : () => set(tags.filter((x) => x !== t)), children: t }, t)), _jsx(Input, { className: "o-tag-field-input", value: draft, placeholder: placeholder, autoComplete: "off", onChange: (e) => setDraft(e.currentTarget.value), onBlur: add, onKeyDown: (e) => {
|
|
12
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
add();
|
|
15
|
+
}
|
|
16
|
+
else if (e.key === "Backspace" && !draft && tags.length)
|
|
17
|
+
set(tags.slice(0, -1));
|
|
18
|
+
} })] }) }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* The TagField, as the Outright kit draws it: the Tag in a field (tag-field/tag-field.tsx). The field is the Input's own (an
|
|
2
|
+
InputGroup, so input.css draws its edge, every state and option); the chip is the Tag's (tag.css).
|
|
3
|
+
|
|
4
|
+
The rules sit in the components layer, so a utility class on the field still wins. */
|
|
5
|
+
@layer components {
|
|
6
|
+
|
|
7
|
+
/* ── In a field: the tags before the caret, wrapping onto more lines as they grow; its words the Input's size, the box as tall
|
|
8
|
+
as its words, on the tags' line. Its rules outweigh the Input's (input.css may come after this file). On a phone (the
|
|
9
|
+
group's own mark, `data-vk-phone`) the field takes the phone's 44. ── */
|
|
10
|
+
.o-input.o-input-group.o-tag-field { flex-wrap: wrap; height: auto; min-height: calc(var(--vk-spacing) * 9); padding-block: calc(var(--vk-spacing) * 1.5); }
|
|
11
|
+
.o-input.o-input-group.o-tag-field:where([data-vk-phone], [data-vk-phone] *) { min-height: calc(var(--vk-spacing) * 11); padding-block: calc(var(--vk-spacing) * 2.5); }
|
|
12
|
+
.o-input-control.o-tag-field-input { align-self: center; min-width: calc(var(--vk-spacing) * 20); }
|
|
13
|
+
}
|
|
@@ -10,7 +10,7 @@ export const TEXT_EDITOR_LOOKS = {
|
|
|
10
10
|
options,
|
|
11
11
|
looks: [
|
|
12
12
|
{ id: "attio", name: "Attio", picks: { box: "over", long: "enter", phone: "country" } },
|
|
13
|
-
{ id: "mihais", name: "
|
|
13
|
+
{ id: "mihais", name: "Outright", picks: { box: "cell", long: "mod", phone: "line" } },
|
|
14
14
|
],
|
|
15
15
|
};
|
|
16
16
|
export const textEditorWornOf = (el) => lookWornOf(TEXT_EDITOR_LOOKS, el, ["box", "long", "phone"]);
|
|
@@ -14,6 +14,7 @@ import { countryName, dialOf, firstCountry, keepLast, patternOf, phoneHanded, ph
|
|
|
14
14
|
import { TEXT_EDITOR_ATTRS, textEditorWornOf } from "./looks.js";
|
|
15
15
|
import { Countries } from "./countries.js";
|
|
16
16
|
import { textWords } from "./words.js";
|
|
17
|
+
import { keepTypedRun } from "../internal/typed-run.js";
|
|
17
18
|
const COUNTRY = { edge: "none", corner: "round", radius: "sm", words: "inherit", colour: "text", pad: "6-4", gap: "3", icon: "14", iconColour: "subtle", hover: "neutral", open: "neutral" };
|
|
18
19
|
const glyph = (paths) => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
|
|
19
20
|
const X = ["M18 6l-12 12", "M6 6l12 12"], TICK = ["M5 12l5 5l10 -10"], DOWN = ["M6 9l6 6l6 -6"];
|
|
@@ -21,11 +22,6 @@ const toEnd = (el) => { try {
|
|
|
21
22
|
el.setSelectionRange(el.value.length, el.value.length);
|
|
22
23
|
}
|
|
23
24
|
catch { } };
|
|
24
|
-
const DEFAULT_VALUE = typeof HTMLTextAreaElement === "undefined" ? undefined : Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "defaultValue");
|
|
25
|
-
const keepTypedRun = (el) => {
|
|
26
|
-
if (DEFAULT_VALUE && !Object.prototype.hasOwnProperty.call(el, "defaultValue"))
|
|
27
|
-
Object.defineProperty(el, "defaultValue", { configurable: true, get: () => DEFAULT_VALUE.get.call(el), set: () => { } });
|
|
28
|
-
};
|
|
29
25
|
const ONE_LINE = new Set(["email", "link", "domain", "phone"]);
|
|
30
26
|
const ROWS = 8;
|
|
31
27
|
const startOf = (value, country) => phoneParts(value, firstCountry(country));
|
|
@@ -24,10 +24,12 @@ export interface ToastOptions {
|
|
|
24
24
|
* turned into its result. */
|
|
25
25
|
duration?: number;
|
|
26
26
|
}
|
|
27
|
-
/** The words a toast draws of its own: Undo,
|
|
27
|
+
/** The words a toast draws of its own: Undo, its ×'s name, and the name of the region its toasts stand in (Base UI names it
|
|
28
|
+
* "Notifications" unless told). */
|
|
28
29
|
export type ToastWords = {
|
|
29
30
|
undo: string;
|
|
30
31
|
close: string;
|
|
32
|
+
region?: string;
|
|
31
33
|
};
|
|
32
34
|
/** Its words in English. */
|
|
33
35
|
export declare const TOAST_WORDS: ToastWords;
|
|
@@ -53,6 +55,8 @@ export interface ToastManager {
|
|
|
53
55
|
}
|
|
54
56
|
/** A manager of toasts to call from anywhere; give it to the Toast that shows them. */
|
|
55
57
|
export declare function createToastManager(words?: Partial<ToastWords>): ToastManager;
|
|
58
|
+
/** Whether a Toast stands round it, so useToast can be reached. */
|
|
59
|
+
export declare const useInToast: () => boolean;
|
|
56
60
|
/** Where toasts are made and where they rise: everything inside can show one (useToast), and they rise
|
|
57
61
|
* centred at the bottom of the screen, 16px up, at most 460px wide. `inside`: at the bottom of the
|
|
58
62
|
* element around it instead (a sample on a page that shows how it looks). `manager`: show the toasts a
|