@assure-one/design-system 1.25.0 → 1.26.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/dist/index.d.ts +8 -0
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5662,6 +5662,14 @@ interface DisplayMenuSection {
|
|
|
5662
5662
|
trailing?: ReactNode;
|
|
5663
5663
|
/** Force the flyout search box. Auto-enabled past SEARCH_THRESHOLD options. */
|
|
5664
5664
|
searchable?: boolean;
|
|
5665
|
+
/** Escape hatch: renders in the flyout *instead of* the option list, for
|
|
5666
|
+
* dimensions a list can't express (a date range, a numeric bound). Sections
|
|
5667
|
+
* using this supply their own controls and are skipped by root search —
|
|
5668
|
+
* there are no option labels to match. Prefer `options` where it fits. */
|
|
5669
|
+
content?: ReactNode;
|
|
5670
|
+
/** Value summary on the root row. `single` sections derive this from the
|
|
5671
|
+
* selected option; `content` sections have no options, so pass it here. */
|
|
5672
|
+
summary?: string;
|
|
5665
5673
|
}
|
|
5666
5674
|
interface DisplayMenuProps {
|
|
5667
5675
|
sections: DisplayMenuSection[];
|
package/dist/index.js
CHANGED
|
@@ -18353,6 +18353,7 @@ function DisplayMenu({
|
|
|
18353
18353
|
if (section.label.toLowerCase().includes(q)) rows.push({ kind: "section", section });
|
|
18354
18354
|
}
|
|
18355
18355
|
for (const section of sections) {
|
|
18356
|
+
if (section.content) continue;
|
|
18356
18357
|
for (const option of section.options) {
|
|
18357
18358
|
if (option.label.toLowerCase().includes(q)) rows.push({ kind: "option", section, option });
|
|
18358
18359
|
}
|
|
@@ -18364,7 +18365,7 @@ function DisplayMenu({
|
|
|
18364
18365
|
const q = sectionQuery.trim().toLowerCase();
|
|
18365
18366
|
return q ? activeSection.options.filter((o) => o.label.toLowerCase().includes(q)) : activeSection.options;
|
|
18366
18367
|
}, [activeSection, sectionQuery]);
|
|
18367
|
-
const showFlyoutSearch = !!activeSection && (activeSection.searchable ?? activeSection.options.length > SEARCH_THRESHOLD);
|
|
18368
|
+
const showFlyoutSearch = !!activeSection && !activeSection.content && (activeSection.searchable ?? activeSection.options.length > SEARCH_THRESHOLD);
|
|
18368
18369
|
const anySelected = sections.some((s) => s.mode === "multi" && s.selected.size > 0);
|
|
18369
18370
|
const showDot = !isAtDefault || anySelected;
|
|
18370
18371
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
@@ -18459,7 +18460,7 @@ function DisplayMenu({
|
|
|
18459
18460
|
}
|
|
18460
18461
|
const { section } = row;
|
|
18461
18462
|
const count = section.selected.size;
|
|
18462
|
-
const valueLabel = section.mode === "single" ? section.options.find((o) => section.selected.has(o.key))?.label ?? "" : "";
|
|
18463
|
+
const valueLabel = section.summary ?? (section.mode === "single" ? section.options.find((o) => section.selected.has(o.key))?.label ?? "" : "");
|
|
18463
18464
|
const isOpen = section.key === openKey;
|
|
18464
18465
|
return (
|
|
18465
18466
|
/* Hover handlers sit on the wrapper so the cursor can cross
|
|
@@ -18504,7 +18505,7 @@ function DisplayMenu({
|
|
|
18504
18505
|
section.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", "aria-hidden": "true", children: section.icon }),
|
|
18505
18506
|
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: section.label }),
|
|
18506
18507
|
section.mode === "multi" && count > 0 && /* @__PURE__ */ jsx("span", { className: "shrink-0 rounded-full bg-brand-bg px-1.5 text-[11px] font-medium text-brand", children: count }),
|
|
18507
|
-
section.mode
|
|
18508
|
+
section.mode !== "multi" && valueLabel && /* @__PURE__ */ jsx("span", { className: "max-w-24 shrink-0 truncate text-[13px] text-muted-foreground", children: valueLabel }),
|
|
18508
18509
|
/* @__PURE__ */ jsx(ChevronRightIcon, { size: 13, className: "shrink-0 text-muted-foreground" })
|
|
18509
18510
|
]
|
|
18510
18511
|
}
|
|
@@ -18561,7 +18562,12 @@ function DisplayMenu({
|
|
|
18561
18562
|
}
|
|
18562
18563
|
)
|
|
18563
18564
|
] }),
|
|
18564
|
-
/* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto p-1", children:
|
|
18565
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto p-1", children: activeSection.content ? (
|
|
18566
|
+
/* Consumer-supplied controls (date range, numeric bound).
|
|
18567
|
+
* Rendered raw — the section owns its own labelling and
|
|
18568
|
+
* layout; the flyout only provides the surface. */
|
|
18569
|
+
/* @__PURE__ */ jsx("div", { className: "p-1.5", children: activeSection.content })
|
|
18570
|
+
) : sectionRows.length === 0 ? /* @__PURE__ */ jsx(
|
|
18565
18571
|
EmptyRow,
|
|
18566
18572
|
{
|
|
18567
18573
|
label: activeSection.options.length === 0 ? "Nothing to filter by" : "No matches"
|