@kumix/ui 0.3.7 → 0.3.8
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/README.md +25 -24
- package/dist/cascader-types-BnH6wYD-.d.ts +183 -0
- package/dist/cascader-types-BnH6wYD-.d.ts.map +1 -0
- package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
- package/dist/components/motion/animated-sidebar.js +12 -3
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +9 -5
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +77 -74
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
- package/dist/components/motion/center-morph-modal.js +82 -88
- package/dist/components/motion/center-morph-modal.js.map +1 -1
- package/dist/components/motion/command-palette.d.ts.map +1 -1
- package/dist/components/motion/command-palette.js +48 -26
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/drawer.js +30 -30
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/loader.js +20 -22
- package/dist/components/motion/loader.js.map +1 -1
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.js +83 -83
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.d.ts +28 -0
- package/dist/components/motion/morphing-search.d.ts.map +1 -0
- package/dist/components/motion/morphing-search.js +418 -0
- package/dist/components/motion/morphing-search.js.map +1 -0
- package/dist/components/motion/project-folder.js +20 -20
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +90 -0
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-async.js +549 -0
- package/dist/components/reui/cascader/cascader-async.js.map +1 -0
- package/dist/components/reui/cascader/cascader-columns.d.ts +29 -0
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-columns.js +135 -0
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -0
- package/dist/components/reui/cascader/cascader-context.d.ts +193 -0
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-context.js +59 -0
- package/dist/components/reui/cascader/cascader-context.js.map +1 -0
- package/dist/components/reui/cascader/cascader-footer.d.ts +85 -0
- package/dist/components/reui/cascader/cascader-footer.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-footer.js +456 -0
- package/dist/components/reui/cascader/cascader-footer.js.map +1 -0
- package/dist/components/reui/cascader/cascader-i18n.d.ts +17 -0
- package/dist/components/reui/cascader/cascader-i18n.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-i18n.js +68 -0
- package/dist/components/reui/cascader/cascader-i18n.js.map +1 -0
- package/dist/components/reui/cascader/cascader-item.d.ts +115 -0
- package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-item.js +530 -0
- package/dist/components/reui/cascader/cascader-item.js.map +1 -0
- package/dist/components/reui/cascader/cascader-lib.d.ts +141 -0
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-lib.js +576 -0
- package/dist/components/reui/cascader/cascader-lib.js.map +1 -0
- package/dist/components/reui/cascader/cascader-nav.d.ts +59 -0
- package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-nav.js +312 -0
- package/dist/components/reui/cascader/cascader-nav.js.map +1 -0
- package/dist/components/reui/cascader/cascader-types.d.ts +2 -0
- package/dist/components/reui/cascader/cascader-types.js +2 -0
- package/dist/components/reui/cascader/cascader-virtual.d.ts +65 -0
- package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-virtual.js +240 -0
- package/dist/components/reui/cascader/cascader-virtual.js.map +1 -0
- package/dist/components/reui/cascader/cascader.d.ts +322 -0
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader.js +1459 -0
- package/dist/components/reui/cascader/cascader.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts +28 -47
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +26 -44
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts +19 -57
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-advanced.d.ts +52 -0
- package/dist/components/reui/filters/filters-advanced.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-advanced.js +1191 -0
- package/dist/components/reui/filters/filters-advanced.js.map +1 -0
- package/dist/components/reui/filters/filters-builder.d.ts +43 -0
- package/dist/components/reui/filters/filters-builder.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-builder.js +152 -0
- package/dist/components/reui/filters/filters-builder.js.map +1 -0
- package/dist/components/reui/filters/filters-chip.d.ts +79 -0
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-chip.js +553 -0
- package/dist/components/reui/filters/filters-chip.js.map +1 -0
- package/dist/components/reui/filters/filters-context.d.ts +290 -0
- package/dist/components/reui/filters/filters-context.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-context.js +277 -0
- package/dist/components/reui/filters/filters-context.js.map +1 -0
- package/dist/components/reui/filters/filters-date.d.ts +43 -0
- package/dist/components/reui/filters/filters-date.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-date.js +143 -0
- package/dist/components/reui/filters/filters-date.js.map +1 -0
- package/dist/components/reui/filters/filters-dnd.d.ts +101 -0
- package/dist/components/reui/filters/filters-dnd.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-dnd.js +454 -0
- package/dist/components/reui/filters/filters-dnd.js.map +1 -0
- package/dist/components/reui/filters/filters-draft.d.ts +2 -0
- package/dist/components/reui/filters/filters-draft.js +128 -0
- package/dist/components/reui/filters/filters-draft.js.map +1 -0
- package/dist/components/reui/filters/filters-editors.d.ts +91 -0
- package/dist/components/reui/filters/filters-editors.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-editors.js +773 -0
- package/dist/components/reui/filters/filters-editors.js.map +1 -0
- package/dist/components/reui/filters/filters-i18n.d.ts +24 -0
- package/dist/components/reui/filters/filters-i18n.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-i18n.js +127 -0
- package/dist/components/reui/filters/filters-i18n.js.map +1 -0
- package/dist/components/reui/filters/filters-lib.d.ts +171 -0
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-lib.js +336 -0
- package/dist/components/reui/filters/filters-lib.js.map +1 -0
- package/dist/components/reui/filters/filters-operators.d.ts +49 -0
- package/dist/components/reui/filters/filters-operators.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-operators.js +300 -0
- package/dist/components/reui/filters/filters-operators.js.map +1 -0
- package/dist/components/reui/filters/filters-query.d.ts +132 -0
- package/dist/components/reui/filters/filters-query.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-query.js +476 -0
- package/dist/components/reui/filters/filters-query.js.map +1 -0
- package/dist/components/reui/filters/filters-types.d.ts +452 -0
- package/dist/components/reui/filters/filters-types.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-types.js +2 -0
- package/dist/components/reui/filters/filters.d.ts +114 -0
- package/dist/components/reui/filters/filters.d.ts.map +1 -0
- package/dist/components/reui/filters/filters.js +638 -0
- package/dist/components/reui/filters/filters.js.map +1 -0
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +1 -1
- package/dist/components/reui/gantt/gantt-types.d.ts +25 -71
- package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +2 -2
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/filters-draft-DEAl3TO-.d.ts +70 -0
- package/dist/filters-draft-DEAl3TO-.d.ts.map +1 -0
- package/dist/lib/text-shimmer.d.ts +2 -2
- package/dist/lib/text-shimmer.d.ts.map +1 -1
- package/dist/lib/text-shimmer.js +2 -2
- package/dist/lib/text-shimmer.js.map +1 -1
- package/dist/presence-gate-BekdC4Bo.js +24 -0
- package/dist/presence-gate-BekdC4Bo.js.map +1 -0
- package/package.json +9 -9
- package/dist/components/reui/filters.d.ts +0 -176
- package/dist/components/reui/filters.d.ts.map +0 -1
- package/dist/components/reui/filters.js +0 -1223
- package/dist/components/reui/filters.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/reui/cascader/cascader-i18n.tsx
|
|
3
|
+
/** Name of the root level. Hoisted so the root announcement can reuse it. */
|
|
4
|
+
const ROOT_LEVEL = "Top level";
|
|
5
|
+
/** Hoisted for the same reason: several defaults end in an item count. */
|
|
6
|
+
const itemCount = (count) => `${count} ${count === 1 ? "item" : "items"}`;
|
|
7
|
+
/**
|
|
8
|
+
* English defaults. Every string the primitive can render lives here, so a
|
|
9
|
+
* consumer can translate the whole surface by passing `labels`.
|
|
10
|
+
*/
|
|
11
|
+
const CASCADER_LABELS = {
|
|
12
|
+
search: (parentLabel) => parentLabel ? `Search ${parentLabel}...` : "Search...",
|
|
13
|
+
back: "Back",
|
|
14
|
+
loading: "Loading...",
|
|
15
|
+
loadingMore: "Loading more...",
|
|
16
|
+
loadMore: "Load more",
|
|
17
|
+
error: "Could not load items.",
|
|
18
|
+
retry: "Retry",
|
|
19
|
+
empty: "No results found.",
|
|
20
|
+
selectedCount: (count) => `${count} selected`,
|
|
21
|
+
breadcrumbLabel: "Breadcrumb",
|
|
22
|
+
chipsLabel: "Selected items",
|
|
23
|
+
removeChip: (label) => `Remove ${label}`,
|
|
24
|
+
pathSeparator: "/",
|
|
25
|
+
rootLevel: ROOT_LEVEL,
|
|
26
|
+
itemCount,
|
|
27
|
+
branchAffordance: "submenu",
|
|
28
|
+
selectedState: "selected",
|
|
29
|
+
partiallySelectedState: "partially selected",
|
|
30
|
+
columnsLabel: "Levels",
|
|
31
|
+
actionsLabel: "Actions",
|
|
32
|
+
submenuAffordance: "opens a menu",
|
|
33
|
+
panelLabel: "Options",
|
|
34
|
+
keyboardHint: (mode, dir) => {
|
|
35
|
+
const open = dir === "rtl" ? "Left" : "Right";
|
|
36
|
+
const back = dir === "rtl" ? "Right" : "Left";
|
|
37
|
+
if (mode === "tree") return `Use the ${open} Arrow key to expand and the ${back} Arrow key to collapse.`;
|
|
38
|
+
if (mode === "columns") return `Use the ${open} Arrow key to open the next column and the ${back} Arrow key to go back.`;
|
|
39
|
+
return `Use the ${open} Arrow key to open a branch and the ${back} Arrow key to go back.`;
|
|
40
|
+
},
|
|
41
|
+
rootAnnouncement: (count) => `${ROOT_LEVEL}, ${itemCount(count)}`,
|
|
42
|
+
expandedAnnouncement: (label, count) => `${label} expanded, ${itemCount(count)}`,
|
|
43
|
+
collapsedAnnouncement: (label) => `${label} collapsed`,
|
|
44
|
+
levelAnnouncement: (parentLabel, depth, count) => `${parentLabel}, level ${depth}, ${itemCount(count)}`,
|
|
45
|
+
resultsAnnouncement: (count) => count === 1 ? "1 result" : `${count} results`,
|
|
46
|
+
maxReachedAnnouncement: (max) => `Selection limit of ${max} reached`,
|
|
47
|
+
cascadeAnnouncement: (label, count, selecting) => `${label} ${selecting ? "selected" : "deselected"}, ${itemCount(count)} followed`,
|
|
48
|
+
searchingAnnouncement: "Searching..."
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Shallow-merges consumer overrides over the defaults, so `labels` can carry a
|
|
52
|
+
* single key without restating the rest.
|
|
53
|
+
*/
|
|
54
|
+
function resolveCascaderLabels(labels) {
|
|
55
|
+
if (!labels) return CASCADER_LABELS;
|
|
56
|
+
return {
|
|
57
|
+
...CASCADER_LABELS,
|
|
58
|
+
...labels
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Resolves the search placeholder, which may be a string or a function. */
|
|
62
|
+
function resolveCascaderSearchLabel(labels, parentLabel) {
|
|
63
|
+
return typeof labels.search === "function" ? labels.search(parentLabel) : labels.search;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { CASCADER_LABELS, resolveCascaderLabels, resolveCascaderSearchLabel };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=cascader-i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascader-i18n.js","names":[],"sources":["../../../../src/components/reui/cascader/cascader-i18n.tsx"],"sourcesContent":["\"use client\";\n\nimport type { CascaderLabels, CascaderMode } from \"./cascader-types\";\n\n/** Name of the root level. Hoisted so the root announcement can reuse it. */\nconst ROOT_LEVEL = \"Top level\";\n\n/** Hoisted for the same reason: several defaults end in an item count. */\nconst itemCount = (count: number) => `${count} ${count === 1 ? \"item\" : \"items\"}`;\n\n/**\n * English defaults. Every string the primitive can render lives here, so a\n * consumer can translate the whole surface by passing `labels`.\n */\nexport const CASCADER_LABELS: CascaderLabels = {\n // Deliberately NOT lowercased. `toLowerCase()` is locale-hostile - it maps\n // Turkish \"İ\" to a two-code-point sequence and German \"İstanbul\" style\n // proper nouns lose their casing - and a label is already written the way\n // its author wants it read.\n search: (parentLabel) => (parentLabel ? `Search ${parentLabel}...` : \"Search...\"),\n back: \"Back\",\n loading: \"Loading...\",\n loadingMore: \"Loading more...\",\n loadMore: \"Load more\",\n error: \"Could not load items.\",\n retry: \"Retry\",\n empty: \"No results found.\",\n selectedCount: (count) => `${count} selected`,\n breadcrumbLabel: \"Breadcrumb\",\n chipsLabel: \"Selected items\",\n removeChip: (label) => `Remove ${label}`,\n pathSeparator: \"/\",\n rootLevel: ROOT_LEVEL,\n itemCount,\n branchAffordance: \"submenu\",\n selectedState: \"selected\",\n partiallySelectedState: \"partially selected\",\n columnsLabel: \"Levels\",\n actionsLabel: \"Actions\",\n submenuAffordance: \"opens a menu\",\n panelLabel: \"Options\",\n keyboardHint: (mode: CascaderMode, dir: \"ltr\" | \"rtl\") => {\n // \"Deeper\" is the direction the text runs, so the level keys mirror in\n // RTL and the hint has to name the mirrored pair there - an LTR-worded\n // hint would teach exactly the wrong keys.\n const open = dir === \"rtl\" ? \"Left\" : \"Right\";\n const back = dir === \"rtl\" ? \"Right\" : \"Left\";\n if (mode === \"tree\") {\n return `Use the ${open} Arrow key to expand and the ${back} Arrow key to collapse.`;\n }\n if (mode === \"columns\") {\n return `Use the ${open} Arrow key to open the next column and the ${back} Arrow key to go back.`;\n }\n return `Use the ${open} Arrow key to open a branch and the ${back} Arrow key to go back.`;\n },\n rootAnnouncement: (count) => `${ROOT_LEVEL}, ${itemCount(count)}`,\n expandedAnnouncement: (label, count) => `${label} expanded, ${itemCount(count)}`,\n collapsedAnnouncement: (label) => `${label} collapsed`,\n levelAnnouncement: (parentLabel, depth, count) =>\n `${parentLabel}, level ${depth}, ${itemCount(count)}`,\n resultsAnnouncement: (count) => (count === 1 ? \"1 result\" : `${count} results`),\n maxReachedAnnouncement: (max) => `Selection limit of ${max} reached`,\n cascadeAnnouncement: (label, count, selecting) =>\n `${label} ${selecting ? \"selected\" : \"deselected\"}, ${itemCount(count)} followed`,\n searchingAnnouncement: \"Searching...\",\n};\n\n/**\n * Shallow-merges consumer overrides over the defaults, so `labels` can carry a\n * single key without restating the rest.\n */\nexport function resolveCascaderLabels(labels?: Partial<CascaderLabels>): CascaderLabels {\n if (!labels) return CASCADER_LABELS;\n return { ...CASCADER_LABELS, ...labels };\n}\n\n/** Resolves the search placeholder, which may be a string or a function. */\nexport function resolveCascaderSearchLabel(labels: CascaderLabels, parentLabel?: string): string {\n return typeof labels.search === \"function\" ? labels.search(parentLabel) : labels.search;\n}\n"],"mappings":";;;AAKA,MAAM,aAAa;;AAGnB,MAAM,aAAa,UAAkB,GAAG,MAAM,GAAG,UAAU,IAAI,SAAS;;;;;AAMxE,MAAa,kBAAkC;CAK7C,SAAS,gBAAiB,cAAc,UAAU,YAAY,OAAO;CACrE,MAAM;CACN,SAAS;CACT,aAAa;CACb,UAAU;CACV,OAAO;CACP,OAAO;CACP,OAAO;CACP,gBAAgB,UAAU,GAAG,MAAM;CACnC,iBAAiB;CACjB,YAAY;CACZ,aAAa,UAAU,UAAU;CACjC,eAAe;CACf,WAAW;CACX;CACA,kBAAkB;CAClB,eAAe;CACf,wBAAwB;CACxB,cAAc;CACd,cAAc;CACd,mBAAmB;CACnB,YAAY;CACZ,eAAe,MAAoB,QAAuB;EAIxD,MAAM,OAAO,QAAQ,QAAQ,SAAS;EACtC,MAAM,OAAO,QAAQ,QAAQ,UAAU;EACvC,IAAI,SAAS,QACX,OAAO,WAAW,KAAK,+BAA+B,KAAK;EAE7D,IAAI,SAAS,WACX,OAAO,WAAW,KAAK,6CAA6C,KAAK;EAE3E,OAAO,WAAW,KAAK,sCAAsC,KAAK;CACpE;CACA,mBAAmB,UAAU,GAAG,WAAW,IAAI,UAAU,KAAK;CAC9D,uBAAuB,OAAO,UAAU,GAAG,MAAM,aAAa,UAAU,KAAK;CAC7E,wBAAwB,UAAU,GAAG,MAAM;CAC3C,oBAAoB,aAAa,OAAO,UACtC,GAAG,YAAY,UAAU,MAAM,IAAI,UAAU,KAAK;CACpD,sBAAsB,UAAW,UAAU,IAAI,aAAa,GAAG,MAAM;CACrE,yBAAyB,QAAQ,sBAAsB,IAAI;CAC3D,sBAAsB,OAAO,OAAO,cAClC,GAAG,MAAM,GAAG,YAAY,aAAa,aAAa,IAAI,UAAU,KAAK,EAAE;CACzE,uBAAuB;AACzB;;;;;AAMA,SAAgB,sBAAsB,QAAkD;CACtF,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO;EAAE,GAAG;EAAiB,GAAG;CAAO;AACzC;;AAGA,SAAgB,2BAA2B,QAAwB,aAA8B;CAC/F,OAAO,OAAO,OAAO,WAAW,aAAa,OAAO,OAAO,WAAW,IAAI,OAAO;AACnF"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { d as CascaderLoadState, p as CascaderNode } from "../../../cascader-types-BnH6wYD-.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { Combobox } from "@base-ui/react";
|
|
4
|
+
//#region src/components/reui/cascader/cascader-item.d.ts
|
|
5
|
+
type VetoableEvent = {
|
|
6
|
+
preventBaseUIHandler?: () => void;
|
|
7
|
+
};
|
|
8
|
+
/** A row press. The veto hook is optional: an `as="button"` row is outside Base
|
|
9
|
+
* UI's listbox and gets a plain React event. */
|
|
10
|
+
type CascaderRowEvent = React$1.MouseEvent<HTMLElement> & VetoableEvent;
|
|
11
|
+
/** A footer COMMAND: the row theme, so it cannot drift from the list, plus the
|
|
12
|
+
* hover and `focus-visible` fills a plain button never gets. Fills, never a
|
|
13
|
+
* ring: a ring under rows that all paint with a fill read as a different
|
|
14
|
+
* widget bolted on. `focus-visible`, not `focus`, so a pointer press does not
|
|
15
|
+
* leave a command painted as if it were still hovered. Disabled keys off
|
|
16
|
+
* `aria-disabled`, not `:disabled`, to keep it FOCUSABLE: a footer whose only
|
|
17
|
+
* row is disabled has no tab stop. */
|
|
18
|
+
declare const CASCADER_ACTION_CLASS = "data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 rounded-md py-1 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [--cascader-row-inset:6px] text-sm ps-[var(--cascader-row-inset,8px)]! pe-[var(--cascader-row-inset,8px)]! hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground cursor-pointer gap-2 transition-colors aria-disabled:pointer-events-none aria-disabled:opacity-50";
|
|
19
|
+
interface CascaderItemProps extends Omit<Combobox.Item.Props, "value" | "children" | "className" | "style" | "onClick" | "onMouseUp"> {
|
|
20
|
+
/** No state callback: the row merges `className` and `style` itself. */
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React$1.CSSProperties;
|
|
23
|
+
onClick?: (event: CascaderRowEvent) => void;
|
|
24
|
+
onMouseUp?: (event: CascaderRowEvent) => void;
|
|
25
|
+
node: CascaderNode;
|
|
26
|
+
/** Explicit render index. Required while virtualized and DELIBERATELY IGNORED
|
|
27
|
+
* otherwise: it self-registers the row and breaks `aria-activedescendant`. */
|
|
28
|
+
index?: number;
|
|
29
|
+
/** Indentation depth. Drives `--cascader-indent` in tree mode. */
|
|
30
|
+
depth?: number;
|
|
31
|
+
/** Renders the ancestor chain under the label, for deep-search results. */
|
|
32
|
+
showPath?: boolean;
|
|
33
|
+
/** `option` renders a real `Combobox.Item`; `button` renders identical markup
|
|
34
|
+
* outside the listbox, for the ancestor columns in columns mode. */
|
|
35
|
+
as?: "option" | "button";
|
|
36
|
+
/** Tree mode: this row is an expanded branch. */
|
|
37
|
+
expanded?: boolean;
|
|
38
|
+
/** Indent each depth by this many pixels. Tree mode only. */
|
|
39
|
+
indent?: number;
|
|
40
|
+
/** Whether the node has children. Defaults to the cascader's own answer, as do
|
|
41
|
+
* the three below: callers pass them because they already hold the level,
|
|
42
|
+
* which keeps a memoised row off the volatile context. */
|
|
43
|
+
branch?: boolean;
|
|
44
|
+
/** Whether the node may be committed. Defaults to the cascader's own answer. */
|
|
45
|
+
selectable?: boolean;
|
|
46
|
+
/** Whether the node is currently selected. Defaults to the cascader's answer. */
|
|
47
|
+
selected?: boolean;
|
|
48
|
+
/** Some but not all of the loaded subtree selected. `cascade` only. */
|
|
49
|
+
indeterminate?: boolean;
|
|
50
|
+
/** Selected nodes below this one, at any depth. Drives the trailing count. */
|
|
51
|
+
selectedCount?: number;
|
|
52
|
+
/** Paging row only: a request for this level is in flight. */
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
/** Paging row only: this level's last request failed. */
|
|
55
|
+
error?: boolean;
|
|
56
|
+
/** Branch row only: this node's OWN children are being fetched. The chevron
|
|
57
|
+
* (or, in tree mode, the expander) becomes a spinner IN PLACE, in the same
|
|
58
|
+
* 16px box: no skeleton row appears below, nothing reflows. */
|
|
59
|
+
childrenLoading?: boolean;
|
|
60
|
+
/** Branch row only: the last fetch of this node's children failed. The same
|
|
61
|
+
* box becomes the retry. The press path is unchanged: it goes through
|
|
62
|
+
* `navigate`, which refires the failed level rather than moving. */
|
|
63
|
+
childrenError?: boolean;
|
|
64
|
+
children?: React$1.ReactNode;
|
|
65
|
+
}
|
|
66
|
+
/** One row. Branch presses navigate instead of selecting, vetoed here with
|
|
67
|
+
* `preventBaseUIHandler()` on `onClick` (Enter too) and on `onMouseUp`. */
|
|
68
|
+
declare const CascaderItem: React$1.MemoExoticComponent<({ node, index, depth, showPath, as, expanded, indent, branch: branchProp, selectable: selectableProp, selected: selectedProp, indeterminate: indeterminateProp, selectedCount: selectedCountProp, loading, error, childrenLoading, childrenError, className, children, onClick, onMouseUp, style, ...props }: CascaderItemProps) => React$1.JSX.Element>;
|
|
69
|
+
/** Every load-derived prop a row needs. A PAGING row reports the level it
|
|
70
|
+
* belongs to, a BRANCH row the level it OWNS; mutually exclusive, so one call
|
|
71
|
+
* answers both. Exported because a memoised row cannot read them itself. */
|
|
72
|
+
declare function getCascaderMoreProps(node: CascaderNode, loadStates: ReadonlyMap<string, CascaderLoadState>): {
|
|
73
|
+
loading: boolean;
|
|
74
|
+
error: boolean;
|
|
75
|
+
childrenLoading: boolean;
|
|
76
|
+
childrenError: boolean;
|
|
77
|
+
};
|
|
78
|
+
interface CascaderItemsProps {
|
|
79
|
+
/** Replaces the default row for every item. */
|
|
80
|
+
children?: (node: CascaderNode, index: number) => React$1.ReactNode;
|
|
81
|
+
}
|
|
82
|
+
/** Whatever the active view is: the current level, the deepest column, or the
|
|
83
|
+
* flattened tree rows. Lives here so `cascader.tsx` never imports a row
|
|
84
|
+
* component, which would cycle with the context. `index` is deliberately not
|
|
85
|
+
* passed; see `CascaderItemProps`. */
|
|
86
|
+
declare function CascaderItems({ children }: CascaderItemsProps): React$1.JSX.Element;
|
|
87
|
+
interface CascaderGroupProps extends Omit<Combobox.Group.Props, "className"> {
|
|
88
|
+
/** Base UI also accepts a state callback here; the group has no state. */
|
|
89
|
+
className?: string;
|
|
90
|
+
}
|
|
91
|
+
/** A run of related rows, named by the `CascaderLabel` inside it: the group is
|
|
92
|
+
* `role="group"` and Base UI points its `aria-labelledby` at the label, where a
|
|
93
|
+
* heading alone inside a listbox is dropped from the accessibility tree.
|
|
94
|
+
* Grouping is composition, not data: `CascaderItems` renders one flat run per
|
|
95
|
+
* level, so its indices line up with `listRef`. */
|
|
96
|
+
declare function CascaderGroup({ className, ...props }: CascaderGroupProps): React$1.JSX.Element;
|
|
97
|
+
interface CascaderLabelProps extends Omit<Combobox.GroupLabel.Props, "className" | "style"> {
|
|
98
|
+
/** No state callback; outside a group this is not a Base UI part at all. */
|
|
99
|
+
className?: string;
|
|
100
|
+
style?: React$1.CSSProperties;
|
|
101
|
+
}
|
|
102
|
+
/** A heading. Inside `CascaderGroup` it is the group's accessible name; outside
|
|
103
|
+
* one (the footer flyout is a menu, not a listbox) it is decoration only. */
|
|
104
|
+
declare function CascaderLabel(props: CascaderLabelProps): React$1.JSX.Element;
|
|
105
|
+
interface CascaderSeparatorProps extends Omit<Combobox.Separator.Props, "className"> {
|
|
106
|
+
/** Base UI also accepts a state callback here; only the orientation varies. */
|
|
107
|
+
className?: string;
|
|
108
|
+
}
|
|
109
|
+
/** Decorative on purpose: Base UI's separator is `role="separator"`, which a
|
|
110
|
+
* `listbox` may not own, and a run that needs separating for a screen reader
|
|
111
|
+
* needs a `CascaderGroup`, not a line. A consumer can pass the role back. */
|
|
112
|
+
declare function CascaderSeparator({ className, ...props }: CascaderSeparatorProps): React$1.JSX.Element;
|
|
113
|
+
//#endregion
|
|
114
|
+
export { CASCADER_ACTION_CLASS, CascaderGroup, CascaderGroupProps, CascaderItem, CascaderItemProps, CascaderItems, CascaderItemsProps, CascaderLabel, CascaderLabelProps, CascaderRowEvent, CascaderSeparator, CascaderSeparatorProps, getCascaderMoreProps };
|
|
115
|
+
//# sourceMappingURL=cascader-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascader-item.d.ts","names":[],"sources":["../../../../src/components/reui/cascader/cascader-item.tsx"],"mappings":";;;;KA0BK;EAAkB;;;;KAIX,mBAAmB,QAAM,WAAW,eAAe;;;;;;;;cAsDlD;UAyBI,0BACP,KACN,SAAkB,KAAK;;EAIzB;EACA,QAAQ,QAAM;EACd,WAAW,OAAO;EAClB,aAAa,OAAO;EACpB,MAAM;;;EAGN;;EAEA;;EAEA;;;EAGA;;EAEA;;EAEA;;;;EAIA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;EAIA;;;;EAIA;EACA,WAAW,QAAM;;;;cAKb,cAAY,QAAA,uBAAA,MAAA,OAAA,OAAA,UAAA,IAAA,UAAA,QAAA,QAAA,YAAA,YAAA,gBAAA,UAAA,cAAA,eAAA,mBAAA,eAAA,mBAAA,SAAA,OAAA,iBAAA,eAAA,WAAA,UAAA,SAAA,WAAA,UAAA,SAuBf,sBAAiB,QAAA,IAAA;;;;iBAunBJ,qBACd,MAAM,cACN,YAAY,oBAAoB;EAEhC;EACA;EACA;EACA;;UAqBe;;EAEf,YAAY,MAAM,cAAc,kBAAkB,QAAM;;;;;;iBAOjD,gBAAgB,YAAY,qBAAkB,QAAA,IAAA;UA0EtC,2BAA2B,KAAK,SAAkB,MAAM;;EAEvE;;;;;;;iBAQO,gBAAgB,cAAc,SAAS,qBAAkB,QAAA,IAAA;UAYjD,2BACP,KAAK,SAAkB,WAAW;;EAE1C;EACA,QAAQ,QAAM;;;;iBA+BP,cAAc,OAAO,qBAAkB,QAAA,IAAA;UAK/B,+BACP,KAAK,SAAkB,UAAU;;EAEzC;;;;;iBAMO,oBAAoB,cAAc,SAAS,yBAAsB,QAAA,IAAA"}
|