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
|
@@ -9,7 +9,7 @@ import { Spinner } from "../spinner/spinner.js";
|
|
|
9
9
|
const glyph = (paths, className) => _jsx("svg", { className: className, 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)) });
|
|
10
10
|
const wrong = glyph(NOTICE_ICONS.danger, "o-toast-mark");
|
|
11
11
|
const X = ["M18 6l-12 12", "M6 6l12 12"];
|
|
12
|
-
export const TOAST_WORDS = { undo: "Undo", close: "Close" };
|
|
12
|
+
export const TOAST_WORDS = { undo: "Undo", close: "Close", region: "Notifications" };
|
|
13
13
|
function toastWait() {
|
|
14
14
|
if (typeof document === "undefined")
|
|
15
15
|
return 4000;
|
|
@@ -43,10 +43,12 @@ export function createToastManager(words) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
const Stacked = React.createContext(false);
|
|
46
|
+
const InToast = React.createContext(false);
|
|
47
|
+
export const useInToast = () => React.useContext(InToast);
|
|
46
48
|
const Said = React.createContext(TOAST_WORDS);
|
|
47
49
|
export function Toast({ inside = false, manager, stack = false, words, children }) {
|
|
48
50
|
const said = React.useMemo(() => ({ ...TOAST_WORDS, ...words }), [words]);
|
|
49
|
-
return _jsx(Said.Provider, { value: said, children: _jsx(Stacked.Provider, { value: stack, children: _jsxs(BaseToast.Provider, { toastManager: manager?.base, children: [children, _jsx(Viewport, { inside: inside, stack: stack })] }) }) });
|
|
51
|
+
return _jsx(InToast.Provider, { value: true, children: _jsx(Said.Provider, { value: said, children: _jsx(Stacked.Provider, { value: stack, children: _jsxs(BaseToast.Provider, { toastManager: manager?.base, children: [children, _jsx(Viewport, { inside: inside, stack: stack })] }) }) }) });
|
|
50
52
|
}
|
|
51
53
|
export function useToast() {
|
|
52
54
|
const m = BaseToast.useToastManager(), live = React.useRef(m.toasts), stack = React.useContext(Stacked), said = React.useContext(Said);
|
|
@@ -82,7 +84,7 @@ function Viewport({ inside, stack }) {
|
|
|
82
84
|
document.addEventListener("keydown", key);
|
|
83
85
|
return () => document.removeEventListener("keydown", key);
|
|
84
86
|
}, [toasts, close]);
|
|
85
|
-
return (_jsx(BaseToast.Viewport, { className: cx("o-toast-viewport", inside && "o-toast-viewport-inside"), ...(stack ? { "data-stack": "" } : {}), children: toasts.map((t) => (_jsxs(BaseToast.Root, { toast: t, className: "o-toast o-smooth o-smooth-ease", swipeDirection: "down", "data-kit": "toast", children: [_jsx(Mark, { type: t.type }), t.title ? _jsxs("span", { className: "o-toast-text", children: [_jsx(BaseToast.Title, { className: "o-toast-title" }), _jsx(BaseToast.Description, { className: "o-toast-words" })] }) : _jsx(BaseToast.Description, { className: "o-toast-words" }), _jsx(BaseToast.Action, { render: _jsx(Button, { kind: "text", size: "xs", className: "o-toast-act" }) }), t.data?.closable && _jsx(BaseToast.Close, { render: _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-toast-act o-toast-close", "aria-label": said.close, icon: glyph(X, "") }) })] }, t.id))) }));
|
|
87
|
+
return (_jsx(BaseToast.Viewport, { className: cx("o-toast-viewport", inside && "o-toast-viewport-inside"), "aria-label": said.region ?? TOAST_WORDS.region, ...(stack ? { "data-stack": "" } : {}), children: toasts.map((t) => (_jsxs(BaseToast.Root, { toast: t, className: "o-toast o-smooth o-smooth-ease", swipeDirection: "down", "data-kit": "toast", children: [_jsx(Mark, { type: t.type }), t.title ? _jsxs("span", { className: "o-toast-text", children: [_jsx(BaseToast.Title, { className: "o-toast-title" }), _jsx(BaseToast.Description, { className: "o-toast-words" })] }) : _jsx(BaseToast.Description, { className: "o-toast-words" }), _jsx(BaseToast.Action, { render: _jsx(Button, { kind: "text", size: "xs", className: "o-toast-act" }) }), t.data?.closable && _jsx(BaseToast.Close, { render: _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-toast-act o-toast-close", "aria-label": said.close, icon: glyph(X, "") }) })] }, t.id))) }));
|
|
86
88
|
}
|
|
87
89
|
function Mark({ type }) {
|
|
88
90
|
if (type === "working")
|
|
@@ -25,17 +25,22 @@ import { PICKER_PRIVATE, PICKER_TOKENS } from "./picker/tokens.js";
|
|
|
25
25
|
import { AVATAR_PRIVATE, AVATAR_TOKENS } from "./avatar/tokens.js";
|
|
26
26
|
import { POPUP_LINE_PRIVATE, POPUP_LINE_TOKENS } from "./popup-line/tokens.js";
|
|
27
27
|
import { PANE_PRIVATE, PANE_TOKENS } from "./pane/tokens.js";
|
|
28
|
+
import { TOOLBAR_BUTTON_PRIVATE, TOOLBAR_BUTTON_TOKENS } from "./toolbar-button/tokens.js";
|
|
28
29
|
import { RADIO_PRIVATE, RADIO_TOKENS } from "./radio/tokens.js";
|
|
29
30
|
import { SORT_EDITOR_PRIVATE, SORT_EDITOR_TOKENS } from "./sort-editor/tokens.js";
|
|
30
31
|
import { VIEWS_LIST_PRIVATE, VIEWS_LIST_TOKENS } from "./views-list/tokens.js";
|
|
31
32
|
import { FILTER_EDITOR_PRIVATE, FILTER_EDITOR_TOKENS } from "./filter-editor/tokens.js";
|
|
32
33
|
import { GROUP_EDITOR_PRIVATE, GROUP_EDITOR_TOKENS } from "./group-editor/tokens.js";
|
|
34
|
+
import { CUSTOMIZE_PRIVATE, CUSTOMIZE_TOKENS } from "./customize/tokens.js";
|
|
33
35
|
import { MODAL_PRIVATE, MODAL_TOKENS } from "./modal/tokens.js";
|
|
34
36
|
import { ALERT_DIALOG_PRIVATE, ALERT_DIALOG_TOKENS } from "./alert-dialog/tokens.js";
|
|
35
37
|
import { TOAST_PRIVATE, TOAST_TOKENS } from "./toast/tokens.js";
|
|
36
38
|
import { COLLAPSIBLE_PRIVATE, COLLAPSIBLE_TOKENS } from "./collapsible/tokens.js";
|
|
37
39
|
import { ALERT_PRIVATE, ALERT_TOKENS } from "./alert/tokens.js";
|
|
38
40
|
import { NOTICE_PRIVATE, NOTICE_TOKENS } from "./notice/tokens.js";
|
|
41
|
+
import { QUICK_FILTERS_PRIVATE, QUICK_FILTERS_TOKENS } from "./quick-filters/tokens.js";
|
|
42
|
+
import { TOOLBAR_PRIVATE, TOOLBAR_TOKENS } from "./toolbar/tokens.js";
|
|
43
|
+
import { BULK_BAR_PRIVATE, BULK_BAR_TOKENS } from "./bulk-bar/tokens.js";
|
|
39
44
|
import { TEXT_EDITOR_PRIVATE, TEXT_EDITOR_TOKENS } from "./text-editor/tokens.js";
|
|
40
45
|
import { DATE_EDITOR_PRIVATE, DATE_EDITOR_TOKENS } from "./date-editor/tokens.js";
|
|
41
46
|
import { COMPOUND_EDITOR_PRIVATE, COMPOUND_EDITOR_TOKENS } from "./compound-editor/tokens.js";
|
|
@@ -43,6 +48,10 @@ import { FLAG_PRIVATE, FLAG_TOKENS } from "./flag/tokens.js";
|
|
|
43
48
|
import { NUMBER_EDITOR_PRIVATE, NUMBER_EDITOR_TOKENS } from "./number-editor/tokens.js";
|
|
44
49
|
import { VALUES_EDITOR_PRIVATE, VALUES_EDITOR_TOKENS } from "./values-editor/tokens.js";
|
|
45
50
|
import { LINKS_EDITOR_PRIVATE, LINKS_EDITOR_TOKENS } from "./links-editor/tokens.js";
|
|
51
|
+
import { PRESS_PRIVATE, PRESS_TOKENS } from "./press/tokens.js";
|
|
52
|
+
import { CHOICE_PRIVATE, CHOICE_TOKENS } from "./choice/tokens.js";
|
|
53
|
+
import { TAG_FIELD_PRIVATE, TAG_FIELD_TOKENS } from "./tag-field/tokens.js";
|
|
54
|
+
import { SWITCH_ROW_PRIVATE, SWITCH_ROW_TOKENS } from "./switch-row/tokens.js";
|
|
46
55
|
const CONTROLS_OWN = {
|
|
47
56
|
button: { tokens: BUTTON_TOKENS, private: BUTTON_PRIVATE },
|
|
48
57
|
spinner: { tokens: SPINNER_TOKENS, private: SPINNER_PRIVATE },
|
|
@@ -71,17 +80,22 @@ const CONTROLS_OWN = {
|
|
|
71
80
|
picker: { tokens: PICKER_TOKENS, private: PICKER_PRIVATE },
|
|
72
81
|
avatar: { tokens: AVATAR_TOKENS, private: AVATAR_PRIVATE },
|
|
73
82
|
pane: { tokens: PANE_TOKENS, private: PANE_PRIVATE },
|
|
83
|
+
"toolbar-button": { tokens: TOOLBAR_BUTTON_TOKENS, private: TOOLBAR_BUTTON_PRIVATE },
|
|
74
84
|
radio: { tokens: RADIO_TOKENS, private: RADIO_PRIVATE },
|
|
75
85
|
"sort-editor": { tokens: SORT_EDITOR_TOKENS, private: SORT_EDITOR_PRIVATE },
|
|
76
86
|
"views-list": { tokens: VIEWS_LIST_TOKENS, private: VIEWS_LIST_PRIVATE },
|
|
77
87
|
"filter-editor": { tokens: FILTER_EDITOR_TOKENS, private: FILTER_EDITOR_PRIVATE },
|
|
78
88
|
"group-editor": { tokens: GROUP_EDITOR_TOKENS, private: GROUP_EDITOR_PRIVATE },
|
|
89
|
+
customize: { tokens: CUSTOMIZE_TOKENS, private: CUSTOMIZE_PRIVATE },
|
|
79
90
|
modal: { tokens: MODAL_TOKENS, private: MODAL_PRIVATE },
|
|
80
91
|
"alert-dialog": { tokens: ALERT_DIALOG_TOKENS, private: ALERT_DIALOG_PRIVATE },
|
|
81
92
|
toast: { tokens: TOAST_TOKENS, private: TOAST_PRIVATE },
|
|
82
93
|
collapsible: { tokens: COLLAPSIBLE_TOKENS, private: COLLAPSIBLE_PRIVATE },
|
|
83
94
|
alert: { tokens: ALERT_TOKENS, private: ALERT_PRIVATE },
|
|
84
95
|
notice: { tokens: NOTICE_TOKENS, private: NOTICE_PRIVATE },
|
|
96
|
+
"quick-filters": { tokens: QUICK_FILTERS_TOKENS, private: QUICK_FILTERS_PRIVATE },
|
|
97
|
+
toolbar: { tokens: TOOLBAR_TOKENS, private: TOOLBAR_PRIVATE },
|
|
98
|
+
"bulk-bar": { tokens: BULK_BAR_TOKENS, private: BULK_BAR_PRIVATE },
|
|
85
99
|
"text-editor": { tokens: TEXT_EDITOR_TOKENS, private: TEXT_EDITOR_PRIVATE },
|
|
86
100
|
"date-editor": { tokens: DATE_EDITOR_TOKENS, private: DATE_EDITOR_PRIVATE },
|
|
87
101
|
"compound-editor": { tokens: COMPOUND_EDITOR_TOKENS, private: COMPOUND_EDITOR_PRIVATE },
|
|
@@ -89,6 +103,10 @@ const CONTROLS_OWN = {
|
|
|
89
103
|
"number-editor": { tokens: NUMBER_EDITOR_TOKENS, private: NUMBER_EDITOR_PRIVATE },
|
|
90
104
|
"values-editor": { tokens: VALUES_EDITOR_TOKENS, private: VALUES_EDITOR_PRIVATE },
|
|
91
105
|
"links-editor": { tokens: LINKS_EDITOR_TOKENS, private: LINKS_EDITOR_PRIVATE },
|
|
106
|
+
press: { tokens: PRESS_TOKENS, private: PRESS_PRIVATE },
|
|
107
|
+
choice: { tokens: CHOICE_TOKENS, private: CHOICE_PRIVATE },
|
|
108
|
+
"tag-field": { tokens: TAG_FIELD_TOKENS, private: TAG_FIELD_PRIVATE },
|
|
109
|
+
"switch-row": { tokens: SWITCH_ROW_TOKENS, private: SWITCH_ROW_PRIVATE },
|
|
92
110
|
};
|
|
93
111
|
export const VK_CONTROL_TOKENS_BY_PIECE = Object.fromEntries(Object.entries(CONTROLS_OWN).map(([piece, own]) => [piece, own.tokens]));
|
|
94
112
|
export const VK_CONTROL_TOKENS = Object.entries(VK_CONTROL_TOKENS_BY_PIECE)
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** The keys of a line's items, from each one's key as React.Children.toArray hands it (`.$name` where its holder keyed it, a fragment's
|
|
2
|
+
* place before it, `.place` where not): its own where it has one, else its place; a key two items share, its place too. */
|
|
3
|
+
export declare function lineKeys(keys: (string | null)[], line: string): string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function lineKeys(keys, line) {
|
|
2
|
+
const taken = new Set();
|
|
3
|
+
return keys.map((k, i) => {
|
|
4
|
+
const at = k?.indexOf("$") ?? -1, own = k != null && at >= 0 ? `${line}-$${k.slice(at + 1)}` : null;
|
|
5
|
+
if (own && !taken.has(own)) {
|
|
6
|
+
taken.add(own);
|
|
7
|
+
return own;
|
|
8
|
+
}
|
|
9
|
+
return own ? `${line}-${i}${k}` : `${line}-${i}`;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PieceLooks } from "../../looks/looks.js";
|
|
2
|
+
export type ToolbarOptionId = "search" | "words" | "sortfilter" | "settings" | "bar" | "lines" | "save" | "sortfilterat" | "add" | "views" | "tabs" | "quick" | "searchphone" | "sortfilterphone";
|
|
3
|
+
/** One value for every option. */
|
|
4
|
+
export type ToolbarPicks = Record<ToolbarOptionId, string>;
|
|
5
|
+
/** The Toolbar's options and looks. */
|
|
6
|
+
export declare const TOOLBAR_LOOKS: PieceLooks<ToolbarOptionId>;
|
|
7
|
+
/** The options worn round `el`, each from the nearest frame that picks it; outside any frame, or a value it lacks, its default. */
|
|
8
|
+
export declare function toolbarWornOf(el: Element | null): ToolbarPicks;
|
|
9
|
+
/** The attributes the Toolbar watches, so an option changed while it stands reaches it. */
|
|
10
|
+
export declare const TOOLBAR_ATTRS: string[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { lookWornOf } from "../../looks/looks.js";
|
|
2
|
+
const ATTIO = {
|
|
3
|
+
search: "button", words: "icon", sortfilter: "bar", settings: "beside", bar: "always", lines: "across", save: "bar", sortfilterat: "both",
|
|
4
|
+
add: "primary", views: "button", tabs: "ghost", quick: "none", searchphone: "button", sortfilterphone: "beside",
|
|
5
|
+
};
|
|
6
|
+
const OUTRIGHT = { ...ATTIO, words: "both", sortfilter: "right", bar: "added", quick: "button", sortfilterphone: "right" };
|
|
7
|
+
const DEFAULTS = OUTRIGHT;
|
|
8
|
+
const raw = [
|
|
9
|
+
{ id: "search", name: "The search", device: "desktop", values: [{ id: "button", name: "A button" }, { id: "input", name: "An input" }] },
|
|
10
|
+
{ id: "words", name: "Buttons on the right", device: "desktop", values: [{ id: "both", name: "Icon and word" }, { id: "icon", name: "Icon" }] },
|
|
11
|
+
{ id: "sortfilter", name: "Sort and filters", device: "desktop", unless: ["sortfilterat", "pane"], values: [{ id: "bar", name: "On the bar" }, { id: "right", name: "On the right" }] },
|
|
12
|
+
{ id: "settings", name: "View settings", device: "desktop", values: [{ id: "beside", name: "Beside the views" }, { id: "right", name: "On the right" }] },
|
|
13
|
+
{ id: "bar", name: "The filter bar", device: "desktop", unless: ["sortfilter", "bar"], values: [{ id: "always", name: "Always" }, { id: "added", name: "Once added" }] },
|
|
14
|
+
{ id: "lines", name: "Lines", device: "desktop", values: [{ id: "across", name: "Across" }, { id: "none", name: "None" }] },
|
|
15
|
+
{ id: "save", name: "Clear and Save", device: "desktop", unless: ["sortfilterat", "pane"], values: [{ id: "bar", name: "On the bar" }, { id: "settings", name: "In View settings" }] },
|
|
16
|
+
{ id: "sortfilterat", name: "Sort and filters in", values: [{ id: "bar", name: "On the bar" }, { id: "pane", name: "In the Pane" }, { id: "both", name: "Both" }] },
|
|
17
|
+
{ id: "add", name: "New", device: "desktop", kind: "list", values: [
|
|
18
|
+
{ id: "primary", name: "Primary, its word" }, { id: "primary-icon", name: "Primary, its icon" },
|
|
19
|
+
{ id: "outline", name: "Outlined, its word" }, { id: "outline-icon", name: "Outlined, its icon" },
|
|
20
|
+
{ id: "like", name: "Like the others, its word" }, { id: "like-icon", name: "Like the others, its icon" },
|
|
21
|
+
] },
|
|
22
|
+
{ id: "views", name: "The view switcher", device: "desktop", values: [{ id: "button", name: "One button" }, { id: "tabs", name: "Tabs" }] },
|
|
23
|
+
{ id: "tabs", name: "The tabs", device: "desktop", unless: ["views", "button"], values: [{ id: "ghost", name: "Ghost" }, { id: "bordered", name: "Bordered" }, { id: "filled", name: "Filled" }] },
|
|
24
|
+
{ id: "quick", name: "Quick filters", values: [{ id: "none", name: "None" }, { id: "button", name: "A button" }] },
|
|
25
|
+
{ id: "searchphone", name: "The search", device: "phone", values: [{ id: "button", name: "A button" }, { id: "line", name: "Its own line" }] },
|
|
26
|
+
{ id: "sortfilterphone", name: "Sort and filters", device: "phone", unless: ["sortfilterat", "pane"], values: [{ id: "beside", name: "Beside the views" }, { id: "right", name: "On the right" }] },
|
|
27
|
+
];
|
|
28
|
+
const options = raw.map((o) => ({ ...o, def: DEFAULTS[o.id], demo: false }));
|
|
29
|
+
const looks = [
|
|
30
|
+
{ id: "mihai", name: "Outright", picks: OUTRIGHT },
|
|
31
|
+
{ id: "attio", name: "Attio", picks: ATTIO },
|
|
32
|
+
{ id: "attio-right", name: "Attio, buttons on the right", picks: { ...ATTIO, search: "input", words: "both", sortfilter: "right", settings: "right", bar: "added", sortfilterphone: "right" } },
|
|
33
|
+
{ id: "portal", name: "The portal's", picks: { ...ATTIO, sortfilter: "right", settings: "right", bar: "added", lines: "none", save: "settings", views: "tabs", quick: "button", sortfilterphone: "right" } },
|
|
34
|
+
];
|
|
35
|
+
export const TOOLBAR_LOOKS = { id: "toolbar", name: "Toolbar", options, looks };
|
|
36
|
+
const IDS = options.map((o) => o.id);
|
|
37
|
+
export function toolbarWornOf(el) {
|
|
38
|
+
return lookWornOf(TOOLBAR_LOOKS, el, IDS);
|
|
39
|
+
}
|
|
40
|
+
export const TOOLBAR_ATTRS = IDS.map((id) => `data-toolbar-${id}`);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const TOOLBAR_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-border-width";
|
|
11
|
+
readonly kind: "size";
|
|
12
|
+
readonly outright: "--border-width";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-duration-base";
|
|
15
|
+
readonly kind: "motion";
|
|
16
|
+
readonly outright: "--duration-base";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-ease-out";
|
|
19
|
+
readonly kind: "motion";
|
|
20
|
+
readonly outright: "--ease-out";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-spacing";
|
|
23
|
+
readonly kind: "size";
|
|
24
|
+
readonly outright: "--spacing";
|
|
25
|
+
}];
|
|
26
|
+
/** The Toolbar's own machinery: how far apart a line's items stand (`--toolbar-spacing`), the room at each line's sides
|
|
27
|
+
* (`--toolbar-inset`). */
|
|
28
|
+
export declare const TOOLBAR_PRIVATE: readonly ["--toolbar-"];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const TOOLBAR_TOKENS = [
|
|
2
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
3
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
4
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
5
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
6
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
7
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
8
|
+
];
|
|
9
|
+
export const TOOLBAR_PRIVATE = ["--toolbar-"];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
3
|
+
import { type InputProps } from "../input/input.js";
|
|
4
|
+
import { type ToolbarPicks } from "./looks.js";
|
|
5
|
+
import { type ToolbarWords } from "./words.js";
|
|
6
|
+
/** Where a list's part stands: on the row (where it begins), on the row's right, on the filter bar, or on a phone's one line. */
|
|
7
|
+
export type ToolbarAt = "row" | "right" | "bar" | "phone";
|
|
8
|
+
/** A list's part: what it is, or what it is where it stands. */
|
|
9
|
+
export type ToolbarPlace = React.ReactNode | ((at: ToolbarAt) => React.ReactNode);
|
|
10
|
+
/** The Toolbar's options as worn around `el`, kept up to date as Tweaks change them: what a holder reads to give a part its form
|
|
11
|
+
* (the view switcher as one button or tabs), to keep Clear and Save off the bar where they wait in View settings, or to stand the
|
|
12
|
+
* sort and the filters on the bar, in the Pane, or both. */
|
|
13
|
+
export declare function useToolbarWorn(el: Element | null): ToolbarPicks;
|
|
14
|
+
export interface ToolbarProps extends Omit<BaseToolbar.Root.Props, "className" | "render" | "orientation" | "children" | "style"> {
|
|
15
|
+
/** What it is for, to a screen reader ("Deals"). */
|
|
16
|
+
label: string;
|
|
17
|
+
/** The row; with a list's places, what stands on it after View settings. */
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/** The filter bar under the row, directly in it: what narrows the view (the sort, each filter, Clear and Save); with a list's
|
|
20
|
+
* places, what stands on it after the filters. */
|
|
21
|
+
bar?: React.ReactNode;
|
|
22
|
+
/** A list's places, each stood where the Toolbar's options pick. The view switcher: the row's first. */
|
|
23
|
+
views?: ToolbarPlace;
|
|
24
|
+
/** View settings: beside the view switcher, or with the buttons on the row's right. */
|
|
25
|
+
settings?: ToolbarPlace;
|
|
26
|
+
/** The search, a ToolbarInput with its icon: an icon that opens, or a box. */
|
|
27
|
+
search?: React.ReactElement;
|
|
28
|
+
/** New, a Button, at the row's end, in the form picked; on a phone the + at the list's foot, not here. */
|
|
29
|
+
add?: React.ReactElement;
|
|
30
|
+
/** The sort: on the filter bar (naming its rule), or on the row's right ("Sort"). */
|
|
31
|
+
sort?: ToolbarPlace;
|
|
32
|
+
/** Filter: on the filter bar while nothing is filtered (an empty place), or on the row's right. */
|
|
33
|
+
filter?: ToolbarPlace;
|
|
34
|
+
/** The filters in force, and what adds the next, on the filter bar in Filter's place. */
|
|
35
|
+
filters?: React.ReactNode;
|
|
36
|
+
/** The quick filters' button (KIT-685), a Toolbar button, where the option picks a button: on a computer on the row's right,
|
|
37
|
+
* after the sort and Filter there and before View settings there and New; on a phone's one line before View settings (KIT-836). */
|
|
38
|
+
quick?: ToolbarPlace;
|
|
39
|
+
/** Clear and Save, at the filter bar's end when Save waits there; a list gives them only while what stands on the bar (its sort,
|
|
40
|
+
* its filters) has changes. */
|
|
41
|
+
save?: React.ReactNode;
|
|
42
|
+
/** Something is added to the view (a filter, a sort, a change): the filter bar shows even when it shows only then. */
|
|
43
|
+
added?: boolean;
|
|
44
|
+
/** Its options as its holder says them, over what the frame picks. */
|
|
45
|
+
picks?: Partial<ToolbarPicks>;
|
|
46
|
+
/** The filter bar's name to a screen reader; by default `words.bar`. */
|
|
47
|
+
barLabel?: string;
|
|
48
|
+
/** Its own words, over the English (words.ts): the filter bar's name, the search's, and what holds what folded. */
|
|
49
|
+
words?: Partial<ToolbarWords>;
|
|
50
|
+
/** The row's height on a computer, its Toolbar buttons' and what stands beside them; by default the frame's Size. A phone's
|
|
51
|
+
* is the phone's Size, a finger's. */
|
|
52
|
+
size?: "28" | "32" | "36";
|
|
53
|
+
/** The filter bar's height on a computer; by default a step under the row's, never under 28. */
|
|
54
|
+
barSize?: "28" | "32" | "36";
|
|
55
|
+
/** How far apart what a line holds stands, in spacing steps: 2 (8px), on a phone 1.5. */
|
|
56
|
+
spacing?: number;
|
|
57
|
+
/** Whether what doesn't fit gives way (words to icons, then into ⋯); otherwise it runs past its end. */
|
|
58
|
+
fold?: boolean;
|
|
59
|
+
/** Holds every line as it stands, giving way no further and taking no step back: while what a folded item opened stands open
|
|
60
|
+
* under the button that holds it ("+N filters", ⋯), so that button keeps its place (KIT-624). */
|
|
61
|
+
holds?: boolean;
|
|
62
|
+
/** Which form; by default the phone's in a phone's window or in a PhoneHost screen, else the computer's. */
|
|
63
|
+
form?: "computer" | "phone";
|
|
64
|
+
/** "+N" on the view tabs, pressed: its holder opens what it opens under it, the views list (KIT-679). With none, "+N" opens its
|
|
65
|
+
* own Menu of the tabs that folded. */
|
|
66
|
+
onMoreViews?: (at: HTMLElement) => void;
|
|
67
|
+
/** Whether what "+N" opened stands open (its aria-expanded), where its holder opens it. */
|
|
68
|
+
moreViewsOpen?: boolean;
|
|
69
|
+
className?: string;
|
|
70
|
+
style?: React.CSSProperties;
|
|
71
|
+
}
|
|
72
|
+
type Step = {
|
|
73
|
+
i: number;
|
|
74
|
+
to: "icon" | "fold";
|
|
75
|
+
};
|
|
76
|
+
export interface ToolbarFoldsProps {
|
|
77
|
+
/** What it folds: filters, into its own "+N filters", or view tabs, into its own "+N". */
|
|
78
|
+
kind: "filters" | "tabs";
|
|
79
|
+
/** How many of them may fold. */
|
|
80
|
+
count: number;
|
|
81
|
+
/** What it draws, told how many of them are folded. */
|
|
82
|
+
children: (folded: number) => React.ReactNode;
|
|
83
|
+
}
|
|
84
|
+
/** Filters or view tabs a holder draws itself (ViewKit's, KIT-858), standing in a Toolbar's line: the line folds them one at a time
|
|
85
|
+
* among its own and tells it how many. Outside a line, nothing folded. */
|
|
86
|
+
export declare function ToolbarFolds({ children }: ToolbarFoldsProps): React.ReactNode;
|
|
87
|
+
/** The steps a line takes as it narrows, in order: words to icons from its end; then the view tabs fold into "+N" from their end,
|
|
88
|
+
* the views giving way before the tools, as the portal's row does; then the filters fold into "+N filters" from their end, only
|
|
89
|
+
* once nothing else gives words up (KIT-624); then the rest folds into ⋯ from its end. */
|
|
90
|
+
declare function stepsOf(items: React.ReactElement[]): Step[];
|
|
91
|
+
/** The steps a line takes as it narrows, for a test (stepsOf). */
|
|
92
|
+
export declare const toolbarSteps: typeof stepsOf;
|
|
93
|
+
/** The row and, under it, the filter bar: Base UI's toolbar, one Tab stop for the whole of it, the arrows inside. */
|
|
94
|
+
export declare function ToolbarControl({ label, children, bar, barLabel: barNamed, words: given, views, settings, search, add, sort, filter, filters, save, quick, added, picks: said, size, barSize, spacing, fold, holds, form, onMoreViews, moreViewsOpen, className, style, onKeyDown, ...props }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
/** A line between what belongs together and what doesn't, across a line. */
|
|
96
|
+
export declare function ToolbarSeparatorControl({ className }: {
|
|
97
|
+
className?: string;
|
|
98
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
/** Room that pushes what follows it to its line's far end (New, at the end of the row). */
|
|
100
|
+
export declare function ToolbarSpacer(): import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
export interface ToolbarInputProps extends InputProps {
|
|
102
|
+
/** An icon at its start side, inside the field: the search's. */
|
|
103
|
+
icon?: React.ReactNode;
|
|
104
|
+
}
|
|
105
|
+
/** The text box in the Toolbar: the Input, one of its stops, at its line's height unless it says its own (the search, its icon at
|
|
106
|
+
* its start side). It keeps its width, giving some up down to its narrowest when the line is tight. The arrows move its caret,
|
|
107
|
+
* and step to its neighbours at its ends. In a list's search place it may be a button that opens (the Toolbar's search option),
|
|
108
|
+
* its icon alone or with "Search": pressed, the box opens with the caret in it and a ✕ at its end; the ✕, Escape, or leaving it
|
|
109
|
+
* empty closes it, and Escape brings the focus back to the button, Escape being the search's alone (a Pane open beside it stays). */
|
|
110
|
+
export declare const ToolbarInput: React.ForwardRefExoticComponent<Omit<ToolbarInputProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
111
|
+
export {};
|