@assure-one/design-system 1.22.0 → 1.25.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 +95 -4
- package/dist/index.js +576 -71
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2967,54 +2967,71 @@ function deriveFileType(name) {
|
|
|
2967
2967
|
return name.slice(dot + 1).toUpperCase();
|
|
2968
2968
|
}
|
|
2969
2969
|
var AttachmentChip = forwardRef(
|
|
2970
|
-
function AttachmentChip2({ name, fileType, meta, onView, onDownload, href, variant, className, ...props }, ref) {
|
|
2970
|
+
function AttachmentChip2({ name, fileType, meta, onView, onDownload, href, actions, variant, className, ...props }, ref) {
|
|
2971
2971
|
const resolvedType = fileType ?? deriveFileType(name);
|
|
2972
2972
|
const onAccent = variant === "onAccent";
|
|
2973
2973
|
const actionClassName = onAccent ? "text-fg-on-brand hover:bg-white/20 hover:text-fg-on-brand" : void 0;
|
|
2974
2974
|
const showView = Boolean(onView) || Boolean(href);
|
|
2975
|
-
return /* @__PURE__ */ jsxs(
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
{
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
2975
|
+
return /* @__PURE__ */ jsxs(
|
|
2976
|
+
"div",
|
|
2977
|
+
{
|
|
2978
|
+
ref,
|
|
2979
|
+
className: cn(
|
|
2980
|
+
attachmentChipVariants({ variant }),
|
|
2981
|
+
// Scoped group so `actions` nodes can react to the variant. The chip
|
|
2982
|
+
// resolves its own atoms in JS, but consumer-passed children are
|
|
2983
|
+
// outside that — a group selector is the only hook they get.
|
|
2984
|
+
"group/attachment-chip",
|
|
2985
|
+
className
|
|
2986
|
+
),
|
|
2987
|
+
...props,
|
|
2988
|
+
"data-variant": onAccent ? "onAccent" : "default",
|
|
2989
|
+
children: [
|
|
2990
|
+
/* @__PURE__ */ jsx(FileTypeBadge, { format: resolvedType, size: "md", className: "shrink-0" }),
|
|
2991
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
2992
|
+
/* @__PURE__ */ jsx("p", { className: cn("truncate text-sm font-medium", onAccent ? "text-fg-on-brand" : "text-fg"), children: name }),
|
|
2993
|
+
meta && /* @__PURE__ */ jsx("p", { className: cn("truncate text-xs", onAccent ? "text-fg-on-brand/75" : "text-fg-3"), children: meta })
|
|
2994
|
+
] }),
|
|
2995
|
+
(showView || onDownload || actions) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
2996
|
+
showView && (onView ? /* @__PURE__ */ jsx(
|
|
2997
|
+
Button,
|
|
2998
|
+
{
|
|
2999
|
+
type: "button",
|
|
3000
|
+
variant: "ghost",
|
|
3001
|
+
size: "icon-sm",
|
|
3002
|
+
"aria-label": `View ${name}`,
|
|
3003
|
+
onClick: onView,
|
|
3004
|
+
className: actionClassName,
|
|
3005
|
+
children: /* @__PURE__ */ jsx(EyeIcon, { size: 16 })
|
|
3006
|
+
}
|
|
3007
|
+
) : /* @__PURE__ */ jsx(
|
|
3008
|
+
Button,
|
|
3009
|
+
{
|
|
3010
|
+
asChild: true,
|
|
3011
|
+
variant: "ghost",
|
|
3012
|
+
size: "icon-sm",
|
|
3013
|
+
"aria-label": `View ${name}`,
|
|
3014
|
+
className: actionClassName,
|
|
3015
|
+
children: /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx(EyeIcon, { size: 16 }) })
|
|
3016
|
+
}
|
|
3017
|
+
)),
|
|
3018
|
+
onDownload && /* @__PURE__ */ jsx(
|
|
3019
|
+
Button,
|
|
3020
|
+
{
|
|
3021
|
+
type: "button",
|
|
3022
|
+
variant: "ghost",
|
|
3023
|
+
size: "icon-sm",
|
|
3024
|
+
"aria-label": `Download ${name}`,
|
|
3025
|
+
onClick: onDownload,
|
|
3026
|
+
className: actionClassName,
|
|
3027
|
+
children: /* @__PURE__ */ jsx(DownloadIcon, { size: 16 })
|
|
3028
|
+
}
|
|
3029
|
+
),
|
|
3030
|
+
actions
|
|
3031
|
+
] })
|
|
3032
|
+
]
|
|
3033
|
+
}
|
|
3034
|
+
);
|
|
3018
3035
|
}
|
|
3019
3036
|
);
|
|
3020
3037
|
AttachmentChip.displayName = "AttachmentChip";
|
|
@@ -5619,8 +5636,14 @@ var inputVariants = cva(
|
|
|
5619
5636
|
}
|
|
5620
5637
|
}
|
|
5621
5638
|
);
|
|
5639
|
+
var floatingLabelSize = {
|
|
5640
|
+
sm: "text-xs",
|
|
5641
|
+
md: "text-[13px]",
|
|
5642
|
+
lg: "text-sm"
|
|
5643
|
+
};
|
|
5622
5644
|
var Input = forwardRef(function Input2({
|
|
5623
5645
|
label,
|
|
5646
|
+
floatingLabel,
|
|
5624
5647
|
error,
|
|
5625
5648
|
prefixIcon,
|
|
5626
5649
|
suffixIcon,
|
|
@@ -5629,6 +5652,7 @@ var Input = forwardRef(function Input2({
|
|
|
5629
5652
|
type = "text",
|
|
5630
5653
|
className,
|
|
5631
5654
|
id: providedId,
|
|
5655
|
+
placeholder,
|
|
5632
5656
|
...props
|
|
5633
5657
|
}, ref) {
|
|
5634
5658
|
const generatedId = useId();
|
|
@@ -5637,8 +5661,10 @@ var Input = forwardRef(function Input2({
|
|
|
5637
5661
|
const [showPassword, setShowPassword] = useState(false);
|
|
5638
5662
|
const isPassword = type === "password";
|
|
5639
5663
|
const inputType = isPassword && showPassword ? "text" : type;
|
|
5664
|
+
const isFloating = !!floatingLabel && !!label;
|
|
5665
|
+
const resolvedPlaceholder = isFloating ? placeholder ?? " " : placeholder;
|
|
5640
5666
|
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
5641
|
-
label && /* @__PURE__ */ jsx("label", { htmlFor: id, className: "text-fg mb-1.5 block text-[13px] leading-none font-medium", children: label }),
|
|
5667
|
+
label && !isFloating && /* @__PURE__ */ jsx("label", { htmlFor: id, className: "text-fg mb-1.5 block text-[13px] leading-none font-medium", children: label }),
|
|
5642
5668
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
5643
5669
|
prefixIcon && /* @__PURE__ */ jsx(
|
|
5644
5670
|
"span",
|
|
@@ -5654,17 +5680,45 @@ var Input = forwardRef(function Input2({
|
|
|
5654
5680
|
ref,
|
|
5655
5681
|
id,
|
|
5656
5682
|
type: inputType,
|
|
5683
|
+
placeholder: resolvedPlaceholder,
|
|
5657
5684
|
"aria-invalid": !!error || void 0,
|
|
5658
5685
|
"aria-describedby": error ? errorId : void 0,
|
|
5659
5686
|
className: cn(
|
|
5660
5687
|
inputVariants({ variant, inputSize }),
|
|
5661
5688
|
prefixIcon && "pl-9",
|
|
5662
5689
|
(suffixIcon || isPassword) && "pr-9",
|
|
5690
|
+
isFloating && "peer placeholder:text-transparent focus:placeholder:text-fg-4",
|
|
5663
5691
|
className
|
|
5664
5692
|
),
|
|
5665
5693
|
...props
|
|
5666
5694
|
}
|
|
5667
5695
|
),
|
|
5696
|
+
isFloating && // Rendered after the input because `peer-*` compiles to a sibling
|
|
5697
|
+
// combinator; absolute positioning keeps the visual order intact.
|
|
5698
|
+
/* @__PURE__ */ jsx(
|
|
5699
|
+
"label",
|
|
5700
|
+
{
|
|
5701
|
+
htmlFor: id,
|
|
5702
|
+
className: cn(
|
|
5703
|
+
"pointer-events-none absolute left-3 origin-left px-1 leading-none",
|
|
5704
|
+
"bg-surface text-fg-4",
|
|
5705
|
+
"top-1/2 -translate-y-1/2",
|
|
5706
|
+
"transition-[top,transform,color] duration-[var(--duration-fast)] ease-[var(--ease-out-quart)]",
|
|
5707
|
+
"motion-reduce:transition-none",
|
|
5708
|
+
// Floated by focus or by content. Both branches declare the same
|
|
5709
|
+
// values, so their relative order in the emitted CSS is moot.
|
|
5710
|
+
"peer-focus:top-0 peer-focus:scale-[0.85]",
|
|
5711
|
+
"peer-[:not(:placeholder-shown)]:top-0 peer-[:not(:placeholder-shown)]:scale-[0.85]",
|
|
5712
|
+
// Colours are split on `:not(:focus)` so the two rules can never
|
|
5713
|
+
// both match, which would otherwise be an ordering coin flip.
|
|
5714
|
+
"peer-focus:text-brand",
|
|
5715
|
+
"peer-[:not(:placeholder-shown):not(:focus)]:text-fg-3",
|
|
5716
|
+
floatingLabelSize[inputSize ?? "md"],
|
|
5717
|
+
prefixIcon && "left-9"
|
|
5718
|
+
),
|
|
5719
|
+
children: label
|
|
5720
|
+
}
|
|
5721
|
+
),
|
|
5668
5722
|
isPassword && /* @__PURE__ */ jsx(
|
|
5669
5723
|
"button",
|
|
5670
5724
|
{
|
|
@@ -6962,7 +7016,7 @@ function CountrySelect({
|
|
|
6962
7016
|
type: "button",
|
|
6963
7017
|
disabled,
|
|
6964
7018
|
"aria-label": "Select country code",
|
|
6965
|
-
className: "flex h-
|
|
7019
|
+
className: "rounded-input flex h-9 w-[90px] shrink-0 items-center gap-1.5 border border-input bg-input-background px-2.5 text-sm text-foreground focus-visible:outline-none focus-visible:[box-shadow:var(--shadow-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50",
|
|
6966
7020
|
children: [
|
|
6967
7021
|
/* @__PURE__ */ jsx(CountryFlag, { iso: selected.iso }),
|
|
6968
7022
|
/* @__PURE__ */ jsx("span", { className: "text-xs tabular-nums text-muted-foreground", children: selected.dialCode }),
|
|
@@ -6977,7 +7031,7 @@ function CountrySelect({
|
|
|
6977
7031
|
align: "start",
|
|
6978
7032
|
sideOffset: 4,
|
|
6979
7033
|
style: { zIndex: 9999, minWidth: 248 },
|
|
6980
|
-
className: "rounded-
|
|
7034
|
+
className: "rounded-card border border-border bg-popover shadow-xl outline-none",
|
|
6981
7035
|
onOpenAutoFocus: (e) => {
|
|
6982
7036
|
e.preventDefault();
|
|
6983
7037
|
searchRef.current?.focus({ preventScroll: true });
|
|
@@ -6987,7 +7041,7 @@ function CountrySelect({
|
|
|
6987
7041
|
if (e.key !== "Escape") e.stopPropagation();
|
|
6988
7042
|
},
|
|
6989
7043
|
children: [
|
|
6990
|
-
/* @__PURE__ */ jsx("div", { className: "rounded-t-
|
|
7044
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-t-card border-b border-border px-3 py-2.5", children: /* @__PURE__ */ jsxs("div", { className: "rounded-input flex items-center gap-2 border border-input bg-input-background px-2.5", children: [
|
|
6991
7045
|
/* @__PURE__ */ jsxs("svg", { className: "size-3.5 shrink-0 text-muted-foreground", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
6992
7046
|
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
6993
7047
|
/* @__PURE__ */ jsx("path", { d: "m21 21-4.35-4.35" })
|
|
@@ -7007,7 +7061,7 @@ function CountrySelect({
|
|
|
7007
7061
|
/* @__PURE__ */ jsx(
|
|
7008
7062
|
"div",
|
|
7009
7063
|
{
|
|
7010
|
-
className: "max-h-56 overflow-y-auto
|
|
7064
|
+
className: "rounded-b-card max-h-56 overflow-y-auto",
|
|
7011
7065
|
style: { overscrollBehavior: "contain" },
|
|
7012
7066
|
onWheel: (e) => e.stopPropagation(),
|
|
7013
7067
|
children: filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-4 py-3 text-center text-xs text-muted-foreground", children: "No countries found" }) : filtered.map((c) => /* @__PURE__ */ jsxs(
|
|
@@ -7786,6 +7840,7 @@ function SearchSelect({
|
|
|
7786
7840
|
return order.map((g) => [g, byGroup.get(g)]);
|
|
7787
7841
|
}, [filtered]);
|
|
7788
7842
|
const hasGroups = React39.useMemo(() => groups.some(([g]) => g != null), [groups]);
|
|
7843
|
+
const hasLeadingDot = React39.useMemo(() => options.some((o) => !!o.color), [options]);
|
|
7789
7844
|
const pinnedSet = React39.useMemo(() => new Set(pinnedGroups ?? []), [pinnedGroups]);
|
|
7790
7845
|
const chips = React39.useMemo(() => {
|
|
7791
7846
|
if (!groupFilter || !hasGroups) return [];
|
|
@@ -8098,7 +8153,7 @@ function SearchSelect({
|
|
|
8098
8153
|
style: { backgroundColor: option.color },
|
|
8099
8154
|
"aria-hidden": "true"
|
|
8100
8155
|
}
|
|
8101
|
-
) : /* @__PURE__ */ jsx(
|
|
8156
|
+
) : hasLeadingDot && /* @__PURE__ */ jsx(
|
|
8102
8157
|
CheckIcon,
|
|
8103
8158
|
{
|
|
8104
8159
|
className: "size-4 shrink-0 text-transparent",
|
|
@@ -15409,6 +15464,7 @@ function DataTableView({
|
|
|
15409
15464
|
rowKey = "id",
|
|
15410
15465
|
pageSize = 15,
|
|
15411
15466
|
itemLabel = "items",
|
|
15467
|
+
selection,
|
|
15412
15468
|
className
|
|
15413
15469
|
}) {
|
|
15414
15470
|
const [search, setSearch] = useState("");
|
|
@@ -15455,6 +15511,31 @@ function DataTableView({
|
|
|
15455
15511
|
const current = Math.min(page, pageCount);
|
|
15456
15512
|
const pageRows = processed.slice((current - 1) * pageSize, current * pageSize);
|
|
15457
15513
|
const hasToolbar = searchKeys.length > 0 || filters.length > 0;
|
|
15514
|
+
const selectCol = selection != null;
|
|
15515
|
+
const idOf = (row) => String(row[rowKey]);
|
|
15516
|
+
const canSelect = (row) => selection?.isRowSelectable?.(row) ?? true;
|
|
15517
|
+
const scopeIds = selection ? (selection.selectAllScope === "filtered" ? processed : pageRows).filter(canSelect).map(idOf) : [];
|
|
15518
|
+
const selectedInScope = scopeIds.filter((id) => selection?.selectedIds.has(id));
|
|
15519
|
+
const allInScopeSelected = scopeIds.length > 0 && selectedInScope.length === scopeIds.length;
|
|
15520
|
+
const someInScopeSelected = selectedInScope.length > 0 && !allInScopeSelected;
|
|
15521
|
+
const toggleAll = () => {
|
|
15522
|
+
if (!selection) return;
|
|
15523
|
+
const next = new Set(selection.selectedIds);
|
|
15524
|
+
for (const id of scopeIds) {
|
|
15525
|
+
if (allInScopeSelected) next.delete(id);
|
|
15526
|
+
else next.add(id);
|
|
15527
|
+
}
|
|
15528
|
+
selection.onSelectionChange(next);
|
|
15529
|
+
};
|
|
15530
|
+
const toggleRow = (row) => {
|
|
15531
|
+
if (!selection) return;
|
|
15532
|
+
const id = idOf(row);
|
|
15533
|
+
const next = new Set(selection.selectedIds);
|
|
15534
|
+
if (next.has(id)) next.delete(id);
|
|
15535
|
+
else next.add(id);
|
|
15536
|
+
selection.onSelectionChange(next);
|
|
15537
|
+
};
|
|
15538
|
+
const selectAllLabel = selection?.selectAllScope === "filtered" ? `Select all ${scopeIds.length} ${itemLabel}` : `Select all ${itemLabel} on this page`;
|
|
15458
15539
|
return /* @__PURE__ */ jsxs(DataTable, { withToolbar: hasToolbar, className, children: [
|
|
15459
15540
|
hasToolbar && /* @__PURE__ */ jsxs(DataTableToolbar, { children: [
|
|
15460
15541
|
searchKeys.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -15489,32 +15570,67 @@ function DataTableView({
|
|
|
15489
15570
|
/* @__PURE__ */ jsx(DataTableResultsCount, { current: total, total: data.length })
|
|
15490
15571
|
] }),
|
|
15491
15572
|
/* @__PURE__ */ jsxs("table", { className: "table-auto", children: [
|
|
15492
|
-
/* @__PURE__ */
|
|
15493
|
-
|
|
15494
|
-
(c) =>
|
|
15495
|
-
|
|
15573
|
+
/* @__PURE__ */ jsxs("colgroup", { children: [
|
|
15574
|
+
selectCol && /* @__PURE__ */ jsx("col", { style: { width: "32px", minWidth: "32px" } }),
|
|
15575
|
+
columns.map((c) => /* @__PURE__ */ jsx("col", { style: colStyle(c.width) }, c.key))
|
|
15576
|
+
] }),
|
|
15577
|
+
/* @__PURE__ */ jsx(DataTableHead, { children: /* @__PURE__ */ jsxs(DataTableRow, { children: [
|
|
15578
|
+
selection && /* @__PURE__ */ jsx(
|
|
15579
|
+
DataTableCheckbox,
|
|
15496
15580
|
{
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
}
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15581
|
+
asHeader: true,
|
|
15582
|
+
checked: allInScopeSelected ? true : someInScopeSelected ? "indeterminate" : false,
|
|
15583
|
+
onCheckedChange: toggleAll,
|
|
15584
|
+
disabled: scopeIds.length === 0,
|
|
15585
|
+
ariaLabel: selectAllLabel
|
|
15586
|
+
}
|
|
15587
|
+
),
|
|
15588
|
+
columns.map(
|
|
15589
|
+
(c) => c.sortable ? /* @__PURE__ */ jsx(
|
|
15590
|
+
DataTableHeader,
|
|
15591
|
+
{
|
|
15592
|
+
sortable: true,
|
|
15593
|
+
sort: sort?.key === c.key ? sort.dir : null,
|
|
15594
|
+
onSortChange: (next) => setSort(next ? { key: c.key, dir: next } : null),
|
|
15595
|
+
className: c.align === "right" ? "text-right [&>button]:ml-auto" : void 0,
|
|
15596
|
+
children: c.header
|
|
15597
|
+
},
|
|
15598
|
+
c.key
|
|
15599
|
+
) : /* @__PURE__ */ jsx(DataTableHeader, { className: c.align === "right" ? "text-right" : void 0, children: c.header }, c.key)
|
|
15600
|
+
)
|
|
15601
|
+
] }) }),
|
|
15602
|
+
/* @__PURE__ */ jsx(DataTableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(
|
|
15603
|
+
DataTableCell,
|
|
15604
|
+
{
|
|
15605
|
+
colSpan: columns.length + (selectCol ? 1 : 0),
|
|
15606
|
+
className: "text-fg-3 py-12 text-center",
|
|
15607
|
+
children: [
|
|
15608
|
+
"No ",
|
|
15609
|
+
itemLabel,
|
|
15610
|
+
" match your filters."
|
|
15611
|
+
]
|
|
15612
|
+
}
|
|
15613
|
+
) }) : pageRows.map((row) => /* @__PURE__ */ jsxs(
|
|
15511
15614
|
DataTableRow,
|
|
15512
15615
|
{
|
|
15616
|
+
selected: selection ? selection.selectedIds.has(idOf(row)) : void 0,
|
|
15513
15617
|
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
15514
15618
|
className: onRowClick ? "cursor-pointer" : void 0,
|
|
15515
|
-
children:
|
|
15619
|
+
children: [
|
|
15620
|
+
selection && /* @__PURE__ */ jsx(
|
|
15621
|
+
DataTableCheckbox,
|
|
15622
|
+
{
|
|
15623
|
+
checked: selection.selectedIds.has(idOf(row)),
|
|
15624
|
+
onCheckedChange: () => toggleRow(row),
|
|
15625
|
+
disabled: !canSelect(row),
|
|
15626
|
+
ariaLabel: selection.rowLabel?.(row) ?? `Select ${idOf(row)}`,
|
|
15627
|
+
onClick: (event) => event.stopPropagation()
|
|
15628
|
+
}
|
|
15629
|
+
),
|
|
15630
|
+
columns.map((c) => /* @__PURE__ */ jsx(DataTableCell, { className: c.align === "right" ? "text-right" : void 0, children: c.render ? c.render(row) : row[c.key] ?? /* @__PURE__ */ jsx(Dash, {}) }, c.key))
|
|
15631
|
+
]
|
|
15516
15632
|
},
|
|
15517
|
-
|
|
15633
|
+
idOf(row)
|
|
15518
15634
|
)) })
|
|
15519
15635
|
] }),
|
|
15520
15636
|
/* @__PURE__ */ jsx(
|
|
@@ -18129,6 +18245,395 @@ function SignatureEditor({
|
|
|
18129
18245
|
] });
|
|
18130
18246
|
}
|
|
18131
18247
|
SignatureEditor.displayName = "SignatureEditor";
|
|
18248
|
+
var SEARCH_THRESHOLD = 8;
|
|
18249
|
+
var HOVER_OPEN_MS = 90;
|
|
18250
|
+
var HOVER_CLOSE_MS = 220;
|
|
18251
|
+
var FLYOUT_WIDTH = 224;
|
|
18252
|
+
var DEFAULT_GUTTER_PX = 24;
|
|
18253
|
+
function DisplayMenu({
|
|
18254
|
+
sections,
|
|
18255
|
+
onReset,
|
|
18256
|
+
isAtDefault,
|
|
18257
|
+
tooltip = "Filters, grouping, ordering, columns",
|
|
18258
|
+
dataTour,
|
|
18259
|
+
triggerIcon,
|
|
18260
|
+
triggerLabel = "Display",
|
|
18261
|
+
className,
|
|
18262
|
+
gutterPx = DEFAULT_GUTTER_PX
|
|
18263
|
+
}) {
|
|
18264
|
+
const [open, setOpen] = useState(false);
|
|
18265
|
+
const [openKey, setOpenKey] = useState(null);
|
|
18266
|
+
const [flyout, setFlyout] = useState({
|
|
18267
|
+
top: 0,
|
|
18268
|
+
side: "left"
|
|
18269
|
+
});
|
|
18270
|
+
const [panelShift, setPanelShift] = useState(0);
|
|
18271
|
+
const [rootQuery, setRootQuery] = useState("");
|
|
18272
|
+
const [sectionQuery, setSectionQuery] = useState("");
|
|
18273
|
+
const panelRef = useRef(null);
|
|
18274
|
+
const triggerRef = useRef(null);
|
|
18275
|
+
const rowRefs = useRef(/* @__PURE__ */ new Map());
|
|
18276
|
+
const openTimer = useRef(null);
|
|
18277
|
+
const closeTimer = useRef(null);
|
|
18278
|
+
const flyoutRef = useRef(null);
|
|
18279
|
+
const clearTimers = useCallback(() => {
|
|
18280
|
+
if (openTimer.current) clearTimeout(openTimer.current);
|
|
18281
|
+
if (closeTimer.current) clearTimeout(closeTimer.current);
|
|
18282
|
+
openTimer.current = null;
|
|
18283
|
+
closeTimer.current = null;
|
|
18284
|
+
}, []);
|
|
18285
|
+
useEffect(() => clearTimers, [clearTimers]);
|
|
18286
|
+
const positionFor = useCallback((key) => {
|
|
18287
|
+
const panel = panelRef.current;
|
|
18288
|
+
const row = rowRefs.current.get(key);
|
|
18289
|
+
if (!panel || !row) return;
|
|
18290
|
+
const panelRect = panel.getBoundingClientRect();
|
|
18291
|
+
const rowRect = row.getBoundingClientRect();
|
|
18292
|
+
const maxTop = Math.max(0, window.innerHeight - panelRect.top - 24 - 120);
|
|
18293
|
+
const top = Math.min(Math.max(rowRect.top - panelRect.top - 4, 0), maxTop);
|
|
18294
|
+
const side = panelRect.left >= FLYOUT_WIDTH + 16 ? "left" : "right";
|
|
18295
|
+
setFlyout({ top, side });
|
|
18296
|
+
}, []);
|
|
18297
|
+
const openSection = useCallback(
|
|
18298
|
+
(key) => {
|
|
18299
|
+
clearTimers();
|
|
18300
|
+
positionFor(key);
|
|
18301
|
+
setOpenKey(key);
|
|
18302
|
+
setSectionQuery("");
|
|
18303
|
+
},
|
|
18304
|
+
[clearTimers, positionFor]
|
|
18305
|
+
);
|
|
18306
|
+
const scheduleOpen = useCallback(
|
|
18307
|
+
(key) => {
|
|
18308
|
+
clearTimers();
|
|
18309
|
+
if (key === openKey) return;
|
|
18310
|
+
if (openKey !== null) {
|
|
18311
|
+
openSection(key);
|
|
18312
|
+
return;
|
|
18313
|
+
}
|
|
18314
|
+
openTimer.current = setTimeout(() => openSection(key), HOVER_OPEN_MS);
|
|
18315
|
+
},
|
|
18316
|
+
[clearTimers, openKey, openSection]
|
|
18317
|
+
);
|
|
18318
|
+
const scheduleClose = useCallback(() => {
|
|
18319
|
+
clearTimers();
|
|
18320
|
+
closeTimer.current = setTimeout(() => setOpenKey(null), HOVER_CLOSE_MS);
|
|
18321
|
+
}, [clearTimers]);
|
|
18322
|
+
useEffect(() => {
|
|
18323
|
+
if (!open) {
|
|
18324
|
+
clearTimers();
|
|
18325
|
+
setOpenKey(null);
|
|
18326
|
+
setRootQuery("");
|
|
18327
|
+
setSectionQuery("");
|
|
18328
|
+
setPanelShift(0);
|
|
18329
|
+
}
|
|
18330
|
+
}, [open, clearTimers]);
|
|
18331
|
+
useEffect(() => {
|
|
18332
|
+
if (!open) return;
|
|
18333
|
+
const reposition = () => {
|
|
18334
|
+
const trigger = triggerRef.current;
|
|
18335
|
+
if (!trigger) return;
|
|
18336
|
+
const viewport = document.documentElement.clientWidth;
|
|
18337
|
+
const shift = viewport - gutterPx - trigger.getBoundingClientRect().right;
|
|
18338
|
+
setPanelShift(Math.max(0, Math.round(shift)));
|
|
18339
|
+
};
|
|
18340
|
+
reposition();
|
|
18341
|
+
window.addEventListener("resize", reposition);
|
|
18342
|
+
return () => window.removeEventListener("resize", reposition);
|
|
18343
|
+
}, [open, gutterPx]);
|
|
18344
|
+
const activeSection = useMemo(
|
|
18345
|
+
() => sections.find((s) => s.key === openKey) ?? null,
|
|
18346
|
+
[sections, openKey]
|
|
18347
|
+
);
|
|
18348
|
+
const rootRows = useMemo(() => {
|
|
18349
|
+
const q = rootQuery.trim().toLowerCase();
|
|
18350
|
+
if (!q) return sections.map((section) => ({ kind: "section", section }));
|
|
18351
|
+
const rows = [];
|
|
18352
|
+
for (const section of sections) {
|
|
18353
|
+
if (section.label.toLowerCase().includes(q)) rows.push({ kind: "section", section });
|
|
18354
|
+
}
|
|
18355
|
+
for (const section of sections) {
|
|
18356
|
+
for (const option of section.options) {
|
|
18357
|
+
if (option.label.toLowerCase().includes(q)) rows.push({ kind: "option", section, option });
|
|
18358
|
+
}
|
|
18359
|
+
}
|
|
18360
|
+
return rows;
|
|
18361
|
+
}, [sections, rootQuery]);
|
|
18362
|
+
const sectionRows = useMemo(() => {
|
|
18363
|
+
if (!activeSection) return [];
|
|
18364
|
+
const q = sectionQuery.trim().toLowerCase();
|
|
18365
|
+
return q ? activeSection.options.filter((o) => o.label.toLowerCase().includes(q)) : activeSection.options;
|
|
18366
|
+
}, [activeSection, sectionQuery]);
|
|
18367
|
+
const showFlyoutSearch = !!activeSection && (activeSection.searchable ?? activeSection.options.length > SEARCH_THRESHOLD);
|
|
18368
|
+
const anySelected = sections.some((s) => s.mode === "multi" && s.selected.size > 0);
|
|
18369
|
+
const showDot = !isAtDefault || anySelected;
|
|
18370
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
18371
|
+
/* @__PURE__ */ jsxs(Tooltip, { delayMs: 300, children: [
|
|
18372
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
18373
|
+
Button,
|
|
18374
|
+
{
|
|
18375
|
+
ref: triggerRef,
|
|
18376
|
+
variant: "outline",
|
|
18377
|
+
size: "sm",
|
|
18378
|
+
"aria-label": showDot ? `${triggerLabel} (customised)` : triggerLabel,
|
|
18379
|
+
"data-tour": dataTour,
|
|
18380
|
+
className: cn("relative shrink-0", className),
|
|
18381
|
+
children: [
|
|
18382
|
+
triggerIcon,
|
|
18383
|
+
triggerLabel,
|
|
18384
|
+
showDot && /* @__PURE__ */ jsx(
|
|
18385
|
+
"span",
|
|
18386
|
+
{
|
|
18387
|
+
className: "absolute -right-1 -top-1 size-2 rounded-full bg-foreground",
|
|
18388
|
+
"aria-hidden": "true"
|
|
18389
|
+
}
|
|
18390
|
+
)
|
|
18391
|
+
]
|
|
18392
|
+
}
|
|
18393
|
+
) }) }),
|
|
18394
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: tooltip })
|
|
18395
|
+
] }),
|
|
18396
|
+
/* @__PURE__ */ jsx(
|
|
18397
|
+
PopoverContent,
|
|
18398
|
+
{
|
|
18399
|
+
align: "end",
|
|
18400
|
+
sideOffset: 6,
|
|
18401
|
+
style: panelShift ? { transform: `translateX(${panelShift}px)` } : void 0,
|
|
18402
|
+
className: "w-64 overflow-visible p-0",
|
|
18403
|
+
onKeyDown: (e) => {
|
|
18404
|
+
if (e.key === "Escape" && openKey) {
|
|
18405
|
+
e.preventDefault();
|
|
18406
|
+
e.stopPropagation();
|
|
18407
|
+
setOpenKey(null);
|
|
18408
|
+
}
|
|
18409
|
+
},
|
|
18410
|
+
children: /* @__PURE__ */ jsxs("div", { ref: panelRef, className: "relative", children: [
|
|
18411
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 border-b border-border px-2.5 py-1.5", children: [
|
|
18412
|
+
/* @__PURE__ */ jsx(SearchIcon, { size: 13, className: "shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
18413
|
+
/* @__PURE__ */ jsx(
|
|
18414
|
+
"input",
|
|
18415
|
+
{
|
|
18416
|
+
type: "text",
|
|
18417
|
+
value: rootQuery,
|
|
18418
|
+
onChange: (e) => setRootQuery(e.target.value),
|
|
18419
|
+
placeholder: "Filter\u2026",
|
|
18420
|
+
"aria-label": "Filter options and values",
|
|
18421
|
+
className: "h-6 w-full bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground"
|
|
18422
|
+
}
|
|
18423
|
+
)
|
|
18424
|
+
] }),
|
|
18425
|
+
/* @__PURE__ */ jsx("div", { role: "menu", "aria-label": triggerLabel, className: "max-h-80 overflow-y-auto p-1", children: rootRows.length === 0 ? /* @__PURE__ */ jsx(EmptyRow, {}) : rootRows.map((row) => {
|
|
18426
|
+
if (row.kind === "option") {
|
|
18427
|
+
const { section: section2, option } = row;
|
|
18428
|
+
const isActive = section2.selected.has(option.key);
|
|
18429
|
+
const isMulti = section2.mode === "multi";
|
|
18430
|
+
return /* @__PURE__ */ jsxs(
|
|
18431
|
+
"button",
|
|
18432
|
+
{
|
|
18433
|
+
type: "button",
|
|
18434
|
+
role: isMulti ? "menuitemcheckbox" : "menuitemradio",
|
|
18435
|
+
"aria-checked": isActive,
|
|
18436
|
+
onMouseEnter: () => {
|
|
18437
|
+
clearTimers();
|
|
18438
|
+
setOpenKey(null);
|
|
18439
|
+
},
|
|
18440
|
+
onClick: () => section2.onSelect(option.key),
|
|
18441
|
+
className: "flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-[13px] transition-colors hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:outline-none",
|
|
18442
|
+
children: [
|
|
18443
|
+
section2.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", "aria-hidden": "true", children: section2.icon }),
|
|
18444
|
+
/* @__PURE__ */ jsx("span", { className: "shrink-0 truncate text-muted-foreground", children: section2.label }),
|
|
18445
|
+
/* @__PURE__ */ jsx(
|
|
18446
|
+
ChevronRightIcon,
|
|
18447
|
+
{
|
|
18448
|
+
size: 12,
|
|
18449
|
+
className: "shrink-0 text-muted-foreground",
|
|
18450
|
+
"aria-hidden": "true"
|
|
18451
|
+
}
|
|
18452
|
+
),
|
|
18453
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-foreground", children: option.label }),
|
|
18454
|
+
isActive && /* @__PURE__ */ jsx(CheckIcon, { size: 14, className: "shrink-0 text-brand" })
|
|
18455
|
+
]
|
|
18456
|
+
},
|
|
18457
|
+
`${section2.key}:${option.key}`
|
|
18458
|
+
);
|
|
18459
|
+
}
|
|
18460
|
+
const { section } = row;
|
|
18461
|
+
const count = section.selected.size;
|
|
18462
|
+
const valueLabel = section.mode === "single" ? section.options.find((o) => section.selected.has(o.key))?.label ?? "" : "";
|
|
18463
|
+
const isOpen = section.key === openKey;
|
|
18464
|
+
return (
|
|
18465
|
+
/* Hover handlers sit on the wrapper so the cursor can cross
|
|
18466
|
+
* the gap to `section.trailing` without closing the flyout.
|
|
18467
|
+
* The wrapper is not itself a control — the button inside is,
|
|
18468
|
+
* and it carries the keyboard equivalent (ArrowRight / Enter /
|
|
18469
|
+
* Space open the same flyout). Nothing here is mouse-only. */
|
|
18470
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
18471
|
+
/* @__PURE__ */ jsxs(
|
|
18472
|
+
"div",
|
|
18473
|
+
{
|
|
18474
|
+
ref: (el) => {
|
|
18475
|
+
if (el) rowRefs.current.set(section.key, el);
|
|
18476
|
+
else rowRefs.current.delete(section.key);
|
|
18477
|
+
},
|
|
18478
|
+
className: "flex items-center gap-0.5",
|
|
18479
|
+
onMouseEnter: () => scheduleOpen(section.key),
|
|
18480
|
+
onMouseLeave: scheduleClose,
|
|
18481
|
+
children: [
|
|
18482
|
+
/* @__PURE__ */ jsxs(
|
|
18483
|
+
"button",
|
|
18484
|
+
{
|
|
18485
|
+
type: "button",
|
|
18486
|
+
role: "menuitem",
|
|
18487
|
+
"aria-haspopup": "menu",
|
|
18488
|
+
"aria-expanded": isOpen,
|
|
18489
|
+
onClick: () => openSection(section.key),
|
|
18490
|
+
onKeyDown: (e) => {
|
|
18491
|
+
if (e.key === "ArrowRight" || e.key === "Enter" || e.key === " ") {
|
|
18492
|
+
e.preventDefault();
|
|
18493
|
+
openSection(section.key);
|
|
18494
|
+
requestAnimationFrame(
|
|
18495
|
+
() => flyoutRef.current?.querySelector("input, [role='menuitemcheckbox'], [role='menuitemradio']")?.focus()
|
|
18496
|
+
);
|
|
18497
|
+
}
|
|
18498
|
+
},
|
|
18499
|
+
className: cn(
|
|
18500
|
+
"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] text-foreground transition-colors hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:outline-none",
|
|
18501
|
+
isOpen && "bg-muted/60"
|
|
18502
|
+
),
|
|
18503
|
+
children: [
|
|
18504
|
+
section.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", "aria-hidden": "true", children: section.icon }),
|
|
18505
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: section.label }),
|
|
18506
|
+
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 === "single" && valueLabel && /* @__PURE__ */ jsx("span", { className: "max-w-24 shrink-0 truncate text-[13px] text-muted-foreground", children: valueLabel }),
|
|
18508
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { size: 13, className: "shrink-0 text-muted-foreground" })
|
|
18509
|
+
]
|
|
18510
|
+
}
|
|
18511
|
+
),
|
|
18512
|
+
section.trailing
|
|
18513
|
+
]
|
|
18514
|
+
},
|
|
18515
|
+
section.key
|
|
18516
|
+
)
|
|
18517
|
+
);
|
|
18518
|
+
}) }),
|
|
18519
|
+
/* @__PURE__ */ jsx("div", { className: "border-t border-border p-1", children: /* @__PURE__ */ jsxs(
|
|
18520
|
+
Button,
|
|
18521
|
+
{
|
|
18522
|
+
variant: "ghost",
|
|
18523
|
+
size: "sm",
|
|
18524
|
+
onClick: onReset,
|
|
18525
|
+
disabled: isAtDefault,
|
|
18526
|
+
className: "h-7 w-full justify-start gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",
|
|
18527
|
+
children: [
|
|
18528
|
+
/* @__PURE__ */ jsx(RotateCcwIcon, { size: 13 }),
|
|
18529
|
+
"Reset to default"
|
|
18530
|
+
]
|
|
18531
|
+
}
|
|
18532
|
+
) }),
|
|
18533
|
+
activeSection && /* @__PURE__ */ jsxs(
|
|
18534
|
+
"div",
|
|
18535
|
+
{
|
|
18536
|
+
ref: flyoutRef,
|
|
18537
|
+
role: "menu",
|
|
18538
|
+
"aria-label": activeSection.label,
|
|
18539
|
+
tabIndex: -1,
|
|
18540
|
+
style: { top: flyout.top, width: FLYOUT_WIDTH },
|
|
18541
|
+
className: cn(
|
|
18542
|
+
"absolute z-50 rounded-lg border border-border bg-popover shadow-md",
|
|
18543
|
+
// -mx-1 lets the flyout tuck against the panel so there's no
|
|
18544
|
+
// dead gap for the cursor to fall through on the way over.
|
|
18545
|
+
flyout.side === "left" ? "right-full -mr-1" : "left-full -ml-1"
|
|
18546
|
+
),
|
|
18547
|
+
onMouseEnter: clearTimers,
|
|
18548
|
+
onMouseLeave: scheduleClose,
|
|
18549
|
+
children: [
|
|
18550
|
+
showFlyoutSearch && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 border-b border-border px-2.5 py-1.5", children: [
|
|
18551
|
+
/* @__PURE__ */ jsx(SearchIcon, { size: 13, className: "shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
18552
|
+
/* @__PURE__ */ jsx(
|
|
18553
|
+
"input",
|
|
18554
|
+
{
|
|
18555
|
+
type: "text",
|
|
18556
|
+
value: sectionQuery,
|
|
18557
|
+
onChange: (e) => setSectionQuery(e.target.value),
|
|
18558
|
+
placeholder: `Filter ${activeSection.label.toLowerCase()}\u2026`,
|
|
18559
|
+
"aria-label": `Filter ${activeSection.label}`,
|
|
18560
|
+
className: "h-6 w-full bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground"
|
|
18561
|
+
}
|
|
18562
|
+
)
|
|
18563
|
+
] }),
|
|
18564
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto p-1", children: sectionRows.length === 0 ? /* @__PURE__ */ jsx(
|
|
18565
|
+
EmptyRow,
|
|
18566
|
+
{
|
|
18567
|
+
label: activeSection.options.length === 0 ? "Nothing to filter by" : "No matches"
|
|
18568
|
+
}
|
|
18569
|
+
) : sectionRows.map((option) => {
|
|
18570
|
+
const isActive = activeSection.selected.has(option.key);
|
|
18571
|
+
const isMulti = activeSection.mode === "multi";
|
|
18572
|
+
return /* @__PURE__ */ jsxs(
|
|
18573
|
+
"button",
|
|
18574
|
+
{
|
|
18575
|
+
type: "button",
|
|
18576
|
+
role: isMulti ? "menuitemcheckbox" : "menuitemradio",
|
|
18577
|
+
"aria-checked": isActive,
|
|
18578
|
+
onClick: () => {
|
|
18579
|
+
activeSection.onSelect(option.key);
|
|
18580
|
+
if (!isMulti) setOpenKey(null);
|
|
18581
|
+
},
|
|
18582
|
+
onKeyDown: (e) => {
|
|
18583
|
+
if (e.key === "ArrowLeft") {
|
|
18584
|
+
e.preventDefault();
|
|
18585
|
+
setOpenKey(null);
|
|
18586
|
+
rowRefs.current.get(activeSection.key)?.querySelector("button")?.focus();
|
|
18587
|
+
}
|
|
18588
|
+
},
|
|
18589
|
+
className: cn(
|
|
18590
|
+
"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] transition-colors hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:outline-none",
|
|
18591
|
+
isActive ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
18592
|
+
),
|
|
18593
|
+
children: [
|
|
18594
|
+
isMulti && /* @__PURE__ */ jsx(
|
|
18595
|
+
"span",
|
|
18596
|
+
{
|
|
18597
|
+
"aria-hidden": "true",
|
|
18598
|
+
className: cn(
|
|
18599
|
+
"flex size-3.5 shrink-0 items-center justify-center rounded border transition-colors",
|
|
18600
|
+
isActive ? "border-brand bg-brand text-fg-on-brand" : "border-border"
|
|
18601
|
+
),
|
|
18602
|
+
children: isActive && /* @__PURE__ */ jsx(CheckIcon, { size: 10 })
|
|
18603
|
+
}
|
|
18604
|
+
),
|
|
18605
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate", children: option.label }),
|
|
18606
|
+
!isMulti && isActive && /* @__PURE__ */ jsx(CheckIcon, { size: 14, className: "shrink-0 text-brand" })
|
|
18607
|
+
]
|
|
18608
|
+
},
|
|
18609
|
+
option.key
|
|
18610
|
+
);
|
|
18611
|
+
}) }),
|
|
18612
|
+
activeSection.mode === "multi" && activeSection.selected.size > 0 && activeSection.onClear && /* @__PURE__ */ jsx("div", { className: "border-t border-border p-1", children: /* @__PURE__ */ jsxs(
|
|
18613
|
+
Button,
|
|
18614
|
+
{
|
|
18615
|
+
variant: "ghost",
|
|
18616
|
+
size: "sm",
|
|
18617
|
+
onClick: activeSection.onClear,
|
|
18618
|
+
className: "h-6 w-full justify-start px-2 text-[11px] text-muted-foreground hover:text-foreground",
|
|
18619
|
+
children: [
|
|
18620
|
+
"Clear ",
|
|
18621
|
+
activeSection.selected.size,
|
|
18622
|
+
" selected"
|
|
18623
|
+
]
|
|
18624
|
+
}
|
|
18625
|
+
) })
|
|
18626
|
+
]
|
|
18627
|
+
}
|
|
18628
|
+
)
|
|
18629
|
+
] })
|
|
18630
|
+
}
|
|
18631
|
+
)
|
|
18632
|
+
] });
|
|
18633
|
+
}
|
|
18634
|
+
function EmptyRow({ label = "No matches" }) {
|
|
18635
|
+
return /* @__PURE__ */ jsx("p", { className: "px-2 py-3 text-center text-[11px] text-muted-foreground", children: label });
|
|
18636
|
+
}
|
|
18132
18637
|
function brandScope(product) {
|
|
18133
18638
|
return { "data-brand": product };
|
|
18134
18639
|
}
|
|
@@ -18154,6 +18659,6 @@ var BrandScope = forwardRef(function BrandScope2({ product, children, ...props }
|
|
|
18154
18659
|
});
|
|
18155
18660
|
BrandScope.displayName = "BrandScope";
|
|
18156
18661
|
|
|
18157
|
-
export { AIReceiptPanel, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityEventItem, ActivityItem, ActivityList, AgreementPaneHeading, AgreementViewer, AiDraftCard, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, AppHeaderBreadcrumb, AppHeaderSearch, AppHeaderTitle, AreaChart, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, Assignee, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, AttentionItem, Avatar, BRAND_PRODUCTS, Badge, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, BrandScope, BrandScopeProvider, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, BulkActionBarSeparator, Button, COUNTRY_CODES, Calendar, CalendarIcon, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryDivider, CategoryTag, ChannelTabs, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleDotIcon, CircleIcon, ClientRailGroupHeader, ClientRailItem, ClientSelect, ClipboardCheckIcon, ClockIcon, CloseIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, ComingSoon, CommandIcon, CommandPalette, ConfirmActionButton, Content16 as Content, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DangerAction, Dash, DashGrid, DataItem, DataTable, DataTableBody, DataTableCell, DataTableCellDue, DataTableCellId, DataTableCellMono, DataTableCellName, DataTableCheckbox, DataTableHead, DataTableHeader, DataTablePagination, DataTableResultsCount, DataTableRow, DataTableSearch, DataTableSpacer, DataTableToolbar, DataTableView, DatePicker, DateRangePicker, DetailGrid, DetailMain, DetailSpine, DetailSpineHeader, DetailSpineSection, DetailSpineStats, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DocumentChecklist, DocumentDetailActions, DocumentDetailBody, DocumentDetailHeader, DocumentDetailMetaRow, DocumentDetailPanel, DocumentDetailRequester, DocumentDetailTitle, DocumentFileCard, DocumentFileLine, DocumentFileRow, DocumentIcon, DocumentList, DocumentListSection, DocumentRequestCard, DocumentRequestDetail, DocumentRequestField, DocumentRequestUpload, DocumentRow, DocumentSourceFilter, DocumentSourceTag, DocumentsWorkspaceLayout, DollarSignIcon, DonutChart, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmailMessageCard, EmptyState, EngagementCard, EngagementTimeline, EngagementTimelineStep, ExtractIcon, EyeIcon, EyeOffIcon, Eyebrow, FileChip, FileIcon, FileReturnIcon, FileTextIcon, FileTypeBadge, FileUpload, FilterChip, FilterIcon, FlagIcon, FolderClosedIcon, FolderOpenIcon, FolderPlusIcon, FolderTree, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, Grid, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, IconAction, IconTile, InboxIcon, InfoCircleSolidIcon, InfoIcon, Input, IntentBadge, ItalicIcon, Kanban, KanbanCard, KanbanColumn, KanbanIcon, KbdHint, KeyIcon, KeyboardShortcutsDialog, KpiCard, Label4 as Label, LandmarkIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, MapPinIcon, MasterDetailLayout, MenuIcon, MessageBubble, MessageBubbleAction, MessageBubbleTombstone, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, MetadataGrid, MicrosoftBrandIcon, MinusIcon, MissingDocumentsPanel, MoneyCell, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelectField, MutedSpec, NewMenu, NotificationFilter, NotificationItem, NotificationList, NotificationPanel, NotificationPanelFooter, NotificationPanelHeader, Numeric, OTPInput, PageHeader, PageHeaderSep, PageHeaderSpec, Pagination, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PaperclipIcon, PauseIcon, PdfPreview, PenSignIcon, PenToolIcon, PencilIcon, PhoneCountryInput, PhoneIcon, PhoneInput, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, PrimaryAction, PriorityIcon, ProgressBar, ProgressRing, ProposalAddOn, ProposalBillingTerms, ProposalConsentGate, ProposalCustomPage, ProposalNote, ProposalPackageCard, ProposalPaymentCapture, ProposalPricingSummary, ProposalServiceRow, ProposalSignatureBlock, ProposalSignerList, QuestionnairePanel, Questions, RadioGroup3 as RadioGroup, RadioGroupItem, RankedBars, ReceiptIcon, ReplyIcon, ResponsiveDialog, RotateCcwIcon, RouteTransition, SERVICE_TONES, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, SearchSelect, SecondaryAction, Section, SectionHead, SectionHeader, SegmentedProgress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, SendIcon, Separator4 as Separator, SettingsIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, SidebarBrandSwitcher, SidebarBrandSwitcherTile, SidebarBrandText, SidebarFooter, SidebarLink, SidebarLinkAction, SidebarLinkBadge, SidebarLinkGroup, SidebarLinkLabel, SidebarPinButton, SidebarProvider, SidebarSection, SidebarTrigger, SidebarUser, SignatureEditor, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, SparkleIcon, SparklesIcon, Spinner, SpreadsheetPreview, StackedBarChart, StagePill, StarIcon, StarRating, Stat, StatusDot, StatusIcon, StatusPill, Stepper, StickyActionBar, StopIcon, StrikethroughIcon, SubmitButton, SuggestionPills, SuiteProgress, SunIcon, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableIcon, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TagsCell, TeamIcon, TeamMemberSelect, Textarea, TimeLogger, TimeLoggerActions, TimeLoggerBillable, TimeLoggerContextRow, TimeLoggerEntry, TimeLoggerEntryList, TimeLoggerField, TimeLoggerFooter, TimeLoggerHeader, TimeLoggerNotes, TimeLoggerTimer, ToastProvider, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, UserCircleIcon, UserIcon, UsersIcon, VisuallyHidden, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, attachmentChipVariants, badgeVariants, brandLabel, brandScope, buttonVariants, cardVariants, cn, colors, dateToIso, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getFlagEmoji, iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, radii, reference, searchInputVariants, serviceToneLabel, serviceToneStyle, shadows, sidebarLinkBadgeVariants, spacing, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, surfaces, systemTokens, textareaVariants, typography, useBrandScope, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
|
|
18662
|
+
export { AIReceiptPanel, Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityEventItem, ActivityItem, ActivityList, AgreementPaneHeading, AgreementViewer, AiDraftCard, Alert, AlertCircleIcon, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AlertTriangleIcon, AlertTriangleSolidIcon, AppHeader, AppHeaderActions, AppHeaderBreadcrumb, AppHeaderSearch, AppHeaderTitle, AreaChart, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowRightSmallIcon, ArrowUpIcon, AspectRatio, Assignee, AssureAuditBrandIcon, AssureBooksBrandIcon, AssureProBrandIcon, AssureTaxBrandIcon, AtSignIcon, AttachmentChip, AttentionItem, Avatar, BRAND_PRODUCTS, Badge, BarChartIcon, BellIcon, Blockquote, BoldIcon, BottomNav, BrandScope, BrandScopeProvider, Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, BriefcaseIcon, Building2Icon, BuildingIcon, BulkActionBar, BulkActionBarAction, BulkActionBarSeparator, Button, COUNTRY_CODES, Calendar, CalendarIcon, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryDivider, CategoryTag, ChannelTabs, ChatBubbleIcon, CheckCircle2Icon, CheckCircleSolidIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleDotIcon, CircleIcon, ClientRailGroupHeader, ClientRailItem, ClientSelect, ClipboardCheckIcon, ClockIcon, CloseIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, ComingSoon, CommandIcon, CommandPalette, ConfirmActionButton, Content16 as Content, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, CopyIcon, CornerDownLeftIcon, CountryFlag, CountrySelect, CreditCardIcon, DATE_DISPLAY_PLACEHOLDER, DangerAction, Dash, DashGrid, DataItem, DataTable, DataTableBody, DataTableCell, DataTableCellDue, DataTableCellId, DataTableCellMono, DataTableCellName, DataTableCheckbox, DataTableHead, DataTableHeader, DataTablePagination, DataTableResultsCount, DataTableRow, DataTableSearch, DataTableSpacer, DataTableToolbar, DataTableView, DatePicker, DateRangePicker, DetailGrid, DetailMain, DetailSpine, DetailSpineHeader, DetailSpineSection, DetailSpineStats, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DismissibleChip, DisplayMenu, DocumentChecklist, DocumentDetailActions, DocumentDetailBody, DocumentDetailHeader, DocumentDetailMetaRow, DocumentDetailPanel, DocumentDetailRequester, DocumentDetailTitle, DocumentFileCard, DocumentFileLine, DocumentFileRow, DocumentIcon, DocumentList, DocumentListSection, DocumentRequestCard, DocumentRequestDetail, DocumentRequestField, DocumentRequestUpload, DocumentRow, DocumentSourceFilter, DocumentSourceTag, DocumentsWorkspaceLayout, DollarSignIcon, DonutChart, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmailMessageCard, EmptyState, EngagementCard, EngagementTimeline, EngagementTimelineStep, ExtractIcon, EyeIcon, EyeOffIcon, Eyebrow, FileChip, FileIcon, FileReturnIcon, FileTextIcon, FileTypeBadge, FileUpload, FilterChip, FilterIcon, FlagIcon, FolderClosedIcon, FolderOpenIcon, FolderPlusIcon, FolderTree, FolderUpIcon, FormError, FormSection, FormSuccess, GlobeIcon, GoogleBrandIcon, Grid, HelpCircleIcon, HistoryIcon, HomeIcon, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, IconAction, IconTile, InboxIcon, InfoCircleSolidIcon, InfoIcon, Input, IntentBadge, ItalicIcon, Kanban, KanbanCard, KanbanColumn, KanbanIcon, KbdHint, KeyIcon, KeyboardShortcutsDialog, KpiCard, Label4 as Label, LandmarkIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutListIcon, LightningIcon, Link2Icon, LinkAction, LinkButton, LinkIcon, ListChecksIcon, ListIcon, ListOrderedIcon, LoaderIcon, LoadingRows, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, Logo, MailIcon, Main, MapPinIcon, MasterDetailLayout, MenuIcon, MessageBubble, MessageBubbleAction, MessageBubbleTombstone, MessageCircleIcon, MessageCircleWarningIcon, MessageComposer, MetadataGrid, MicrosoftBrandIcon, MinusIcon, MissingDocumentsPanel, MoneyCell, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoveIcon, MultiFilterPill, MultiSelectField, MutedSpec, NewMenu, NotificationFilter, NotificationItem, NotificationList, NotificationPanel, NotificationPanelFooter, NotificationPanelHeader, Numeric, OTPInput, PageHeader, PageHeaderSep, PageHeaderSpec, Pagination, PaletteIcon, PanelLeftCloseIcon, PanelLeftIcon, PaperclipIcon, PauseIcon, PdfPreview, PenSignIcon, PenToolIcon, PencilIcon, PhoneCountryInput, PhoneIcon, PhoneInput, PlayIcon, PlusIcon, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, PrimaryAction, PriorityIcon, ProgressBar, ProgressRing, ProposalAddOn, ProposalBillingTerms, ProposalConsentGate, ProposalCustomPage, ProposalNote, ProposalPackageCard, ProposalPaymentCapture, ProposalPricingSummary, ProposalServiceRow, ProposalSignatureBlock, ProposalSignerList, QuestionnairePanel, Questions, RadioGroup3 as RadioGroup, RadioGroupItem, RankedBars, ReceiptIcon, ReplyIcon, ResponsiveDialog, RotateCcwIcon, RouteTransition, SERVICE_TONES, SaveIcon, ScrollArea, ScrollBar, SearchIcon, SearchInput, SearchSelect, SecondaryAction, Section, SectionHead, SectionHeader, SegmentedProgress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectableKpiCard, SendIcon, Separator4 as Separator, SettingsIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShieldIcon, SideDrawer, Sidebar, SidebarBrand, SidebarBrandSwitcher, SidebarBrandSwitcherTile, SidebarBrandText, SidebarFooter, SidebarLink, SidebarLinkAction, SidebarLinkBadge, SidebarLinkGroup, SidebarLinkLabel, SidebarPinButton, SidebarProvider, SidebarSection, SidebarTrigger, SidebarUser, SignatureEditor, Skeleton, SkeletonCircle, SkeletonText, SlashIcon, Slider, SmartphoneIcon, SparkleIcon, SparklesIcon, Spinner, SpreadsheetPreview, StackedBarChart, StagePill, StarIcon, StarRating, Stat, StatusDot, StatusIcon, StatusPill, Stepper, StickyActionBar, StopIcon, StrikethroughIcon, SubmitButton, SuggestionPills, SuiteProgress, SunIcon, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableIcon, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagIcon, TagsCell, TeamIcon, TeamMemberSelect, Textarea, TimeLogger, TimeLoggerActions, TimeLoggerBillable, TimeLoggerContextRow, TimeLoggerEntry, TimeLoggerEntryList, TimeLoggerField, TimeLoggerFooter, TimeLoggerHeader, TimeLoggerNotes, TimeLoggerTimer, ToastProvider, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Trash2Icon, TrashIcon, TrendingDownIcon, TrendingUpIcon, UnderlineIcon, UploadIcon, UserCircleIcon, UserIcon, UsersIcon, VisuallyHidden, WorkflowIcon, XCircleSolidIcon, XIcon, YEAR_DISPLAY_PLACEHOLDER, ZoomInIcon, ZoomOutIcon, alertVariants, applyMask, applyYearMask, attachmentChipVariants, badgeVariants, brandLabel, brandScope, buttonVariants, cardVariants, cn, colors, dateToIso, displayToIso, fileTypeBadgeVariants, fileTypeFromName, filterChipVariants, formatClock, formatCurrency, formatDuration, getFlagEmoji, iconTileVariants, inputVariants, isoToDate, isoToDisplay, isoToYear, labelVariants, parseDuration, parsePhoneForEditing, progressBarVariants, progressRingVariants, radii, reference, searchInputVariants, serviceToneLabel, serviceToneStyle, shadows, sidebarLinkBadgeVariants, spacing, spinnerVariants, starRatingVariants, statusDotVariants, suiteProgressFillVariants, surfaces, systemTokens, textareaVariants, typography, useBrandScope, useSidebarPeekLock, useSidebarState, useStopwatch, useToast, yearToIso };
|
|
18158
18663
|
//# sourceMappingURL=index.js.map
|
|
18159
18664
|
//# sourceMappingURL=index.js.map
|