@fayz-ai/ui 0.14.0 → 0.15.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/{ChartWidgetInner-GDE5PBTR.js → ChartWidgetInner-IOLIUYTB.js} +21 -8
- package/dist/ChartWidgetInner-IOLIUYTB.js.map +1 -0
- package/dist/analytics/AnalyticsCard.d.ts.map +1 -1
- package/dist/analytics/AnalyticsControls.d.ts.map +1 -1
- package/dist/chunk-3OVZ5JJQ.js +540 -0
- package/dist/chunk-3OVZ5JJQ.js.map +1 -0
- package/dist/{chunk-UZYXFEQS.js → chunk-4GK6IHOI.js} +16 -3
- package/dist/chunk-4GK6IHOI.js.map +1 -0
- package/dist/{chunk-46UZAKFJ.js → chunk-5KMAEQA3.js} +7 -6
- package/dist/chunk-5KMAEQA3.js.map +1 -0
- package/dist/chunk-AASANYXN.js +601 -0
- package/dist/chunk-AASANYXN.js.map +1 -0
- package/dist/{chunk-LFZFBN3P.js → chunk-FFJ2C5YH.js} +11 -61
- package/dist/chunk-FFJ2C5YH.js.map +1 -0
- package/dist/{chunk-5KAGNW45.js → chunk-J7F3Z52K.js} +4 -4
- package/dist/{chunk-5KAGNW45.js.map → chunk-J7F3Z52K.js.map} +1 -1
- package/dist/{chunk-2EFRFYGF.js → chunk-KD2V3TAX.js} +180 -33
- package/dist/chunk-KD2V3TAX.js.map +1 -0
- package/dist/{chunk-MVH64JFG.js → chunk-NA3GE4H3.js} +488 -537
- package/dist/chunk-NA3GE4H3.js.map +1 -0
- package/dist/chunk-OKZ6WQB3.js +57 -0
- package/dist/chunk-OKZ6WQB3.js.map +1 -0
- package/dist/{chunk-77CUIMOI.js → chunk-SLWTKHNY.js} +103 -158
- package/dist/chunk-SLWTKHNY.js.map +1 -0
- package/dist/dashboard/ChartWidgetInner.d.ts.map +1 -1
- package/dist/dashboard/index.js +5 -4
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -16
- package/dist/index.js.map +1 -1
- package/dist/layout/AppShell.d.ts +7 -2
- package/dist/layout/AppShell.d.ts.map +1 -1
- package/dist/layout/Sidebar.d.ts +27 -4
- package/dist/layout/Sidebar.d.ts.map +1 -1
- package/dist/layout/Topbar.d.ts +10 -3
- package/dist/layout/Topbar.d.ts.map +1 -1
- package/dist/layout/index.js +5 -4
- package/dist/primitives/SearchCombobox.d.ts +9 -1
- package/dist/primitives/SearchCombobox.d.ts.map +1 -1
- package/dist/primitives/color-palette.d.ts +24 -0
- package/dist/primitives/color-palette.d.ts.map +1 -0
- package/dist/primitives/header-tabs.d.ts +11 -1
- package/dist/primitives/header-tabs.d.ts.map +1 -1
- package/dist/primitives/image-drop.d.ts +28 -0
- package/dist/primitives/image-drop.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +8 -3
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +7 -5
- package/dist/primitives/list-view.d.ts +7 -1
- package/dist/primitives/list-view.d.ts.map +1 -1
- package/dist/primitives/option-select.d.ts +46 -0
- package/dist/primitives/option-select.d.ts.map +1 -0
- package/dist/primitives/page-toolbar.d.ts +20 -1
- package/dist/primitives/page-toolbar.d.ts.map +1 -1
- package/dist/primitives/sheet.d.ts.map +1 -1
- package/dist/primitives/step-progress.d.ts +20 -0
- package/dist/primitives/step-progress.d.ts.map +1 -0
- package/dist/primitives/use-row-selection.d.ts +50 -0
- package/dist/primitives/use-row-selection.d.ts.map +1 -0
- package/dist/styles.css +20 -0
- package/dist/wizard/Wizard.d.ts +38 -0
- package/dist/wizard/Wizard.d.ts.map +1 -0
- package/dist/wizard/WizardField.d.ts +22 -0
- package/dist/wizard/WizardField.d.ts.map +1 -0
- package/dist/wizard/index.d.ts +6 -0
- package/dist/wizard/index.d.ts.map +1 -0
- package/dist/wizard/index.js +5 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/logic.d.ts +39 -0
- package/dist/wizard/logic.d.ts.map +1 -0
- package/dist/wizard/types.d.ts +95 -0
- package/dist/wizard/types.d.ts.map +1 -0
- package/dist/wizard/useWizard.d.ts +47 -0
- package/dist/wizard/useWizard.d.ts.map +1 -0
- package/package.json +12 -6
- package/dist/ChartWidgetInner-GDE5PBTR.js.map +0 -1
- package/dist/chunk-2EFRFYGF.js.map +0 -1
- package/dist/chunk-46UZAKFJ.js.map +0 -1
- package/dist/chunk-77CUIMOI.js.map +0 -1
- package/dist/chunk-LFZFBN3P.js.map +0 -1
- package/dist/chunk-MVH64JFG.js.map +0 -1
- package/dist/chunk-UZYXFEQS.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// src/lib/cn.ts
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
var buttonVariants = cva(
|
|
13
|
+
"inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-button text-sm font-semibold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
// Polaris primary — near-black brand with the stronger primary bevel
|
|
18
|
+
default: "bg-primary text-primary-foreground border border-primary shadow-button-primary hover:bg-primary/90 active:shadow-button-inset",
|
|
19
|
+
destructive: "bg-destructive text-destructive-foreground border border-destructive shadow-button-primary hover:bg-destructive/90 active:shadow-button-inset",
|
|
20
|
+
// Default/secondary surface — white with hairline + bevel
|
|
21
|
+
outline: "border border-border bg-card text-foreground shadow-button hover:bg-muted active:shadow-button-inset",
|
|
22
|
+
secondary: "border border-border bg-card text-foreground shadow-button hover:bg-muted active:shadow-button-inset",
|
|
23
|
+
ghost: "hover:bg-muted hover:text-foreground",
|
|
24
|
+
link: "text-info underline-offset-4 hover:underline"
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
// Polaris button sizes: md 30px, sm 26px, lg 36px
|
|
28
|
+
default: "h-[30px] px-3 py-1",
|
|
29
|
+
sm: "h-[26px] rounded-button px-2.5 text-xs",
|
|
30
|
+
lg: "h-9 rounded-button px-4 text-sm",
|
|
31
|
+
icon: "h-[30px] w-[30px]"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "default",
|
|
36
|
+
size: "default"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
var Button = React.forwardRef(
|
|
41
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
42
|
+
const Comp = asChild ? Slot : "button";
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Comp,
|
|
45
|
+
{
|
|
46
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
47
|
+
ref,
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
Button.displayName = "Button";
|
|
54
|
+
|
|
55
|
+
export { Button, buttonVariants, cn };
|
|
56
|
+
//# sourceMappingURL=chunk-OKZ6WQB3.js.map
|
|
57
|
+
//# sourceMappingURL=chunk-OKZ6WQB3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/cn.ts","../src/primitives/button.tsx"],"names":[],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB,sSAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA;AAAA,QAEP,OAAA,EACE,+HAAA;AAAA,QACF,WAAA,EACE,+IAAA;AAAA;AAAA,QAEF,OAAA,EACE,sGAAA;AAAA,QACF,SAAA,EACE,sGAAA;AAAA,QACF,KAAA,EAAO,sCAAA;AAAA,QACP,IAAA,EAAM;AAAA,OACR;AAAA,MACA,IAAA,EAAM;AAAA;AAAA,QAEJ,OAAA,EAAS,oBAAA;AAAA,QACT,EAAA,EAAI,wCAAA;AAAA,QACJ,EAAA,EAAI,iCAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AAQA,IAAM,MAAA,GAAe,KAAA,CAAA,UAAA;AAAA,EACnB,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,IAAA,EAAM,UAAU,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAChE,IAAA,MAAM,IAAA,GAAO,UAAU,IAAA,GAAO,QAAA;AAC9B,IAAA,uBACE,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAC,CAAA;AAAA,QAC1D,GAAA;AAAA,QACC,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AACA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"chunk-OKZ6WQB3.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/cn'\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-button text-sm font-semibold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n // Polaris primary — near-black brand with the stronger primary bevel\n default:\n 'bg-primary text-primary-foreground border border-primary shadow-button-primary hover:bg-primary/90 active:shadow-button-inset',\n destructive:\n 'bg-destructive text-destructive-foreground border border-destructive shadow-button-primary hover:bg-destructive/90 active:shadow-button-inset',\n // Default/secondary surface — white with hairline + bevel\n outline:\n 'border border-border bg-card text-foreground shadow-button hover:bg-muted active:shadow-button-inset',\n secondary:\n 'border border-border bg-card text-foreground shadow-button hover:bg-muted active:shadow-button-inset',\n ghost: 'hover:bg-muted hover:text-foreground',\n link: 'text-info underline-offset-4 hover:underline',\n },\n size: {\n // Polaris button sizes: md 30px, sm 26px, lg 36px\n default: 'h-[30px] px-3 py-1',\n sm: 'h-[26px] rounded-button px-2.5 text-xs',\n lg: 'h-9 rounded-button px-4 text-sm',\n icon: 'h-[30px] w-[30px]',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions } from './chunk-
|
|
2
|
-
import { Dropdown, DropdownTrigger, DropdownContent, DropdownItem, Card, DataTable } from './chunk-
|
|
3
|
-
import { cn, Button } from './chunk-
|
|
1
|
+
import { useSaveBarVisible, useCrossModuleBack, useBackHandler, PageHeaderActions } from './chunk-NA3GE4H3.js';
|
|
2
|
+
import { Dropdown, DropdownTrigger, DropdownContent, DropdownItem, Card, DataTable } from './chunk-KD2V3TAX.js';
|
|
3
|
+
import { cn, Button } from './chunk-OKZ6WQB3.js';
|
|
4
4
|
import * as React14 from 'react';
|
|
5
5
|
import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
|
-
import { X, ChevronDown, ChevronUp, Check, ArrowLeft, Search, ChevronLeft, ChevronRight, MoreHorizontal, ImageIcon, RefreshCw, Clock, Plus, Download, Calendar, Loader2
|
|
9
|
+
import { X, ChevronDown, ChevronUp, Check, ArrowLeft, Search, ChevronLeft, ChevronRight, MoreHorizontal, ImageIcon, RefreshCw, Clock, Plus, Download, Calendar, Loader2 } from 'lucide-react';
|
|
10
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
11
11
|
import { Toaster } from 'sonner';
|
|
12
12
|
export { toast } from 'sonner';
|
|
@@ -741,65 +741,6 @@ function StatTiles({ tiles, loading, className }) {
|
|
|
741
741
|
] }, tile.id);
|
|
742
742
|
}) });
|
|
743
743
|
}
|
|
744
|
-
var TRACK = {
|
|
745
|
-
sm: "h-4 w-7",
|
|
746
|
-
md: "h-5 w-9"
|
|
747
|
-
};
|
|
748
|
-
var THUMB = {
|
|
749
|
-
sm: "h-3 w-3 data-[on=true]:translate-x-3",
|
|
750
|
-
md: "h-4 w-4 data-[on=true]:translate-x-4"
|
|
751
|
-
};
|
|
752
|
-
var Switch = React14.forwardRef(function Switch2({ checked, onCheckedChange, size = "sm", label, className, disabled, ...rest }, ref) {
|
|
753
|
-
const control = /* @__PURE__ */ jsx(
|
|
754
|
-
"button",
|
|
755
|
-
{
|
|
756
|
-
ref,
|
|
757
|
-
type: "button",
|
|
758
|
-
role: "switch",
|
|
759
|
-
"aria-checked": checked,
|
|
760
|
-
disabled,
|
|
761
|
-
onClick: (e) => {
|
|
762
|
-
e.stopPropagation();
|
|
763
|
-
rest.onClick?.(e);
|
|
764
|
-
if (!disabled) onCheckedChange(!checked);
|
|
765
|
-
},
|
|
766
|
-
className: cn(
|
|
767
|
-
"relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-colors",
|
|
768
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
769
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
770
|
-
TRACK[size],
|
|
771
|
-
checked ? "bg-primary" : "bg-muted-foreground/30",
|
|
772
|
-
className
|
|
773
|
-
),
|
|
774
|
-
...rest,
|
|
775
|
-
children: /* @__PURE__ */ jsx(
|
|
776
|
-
"span",
|
|
777
|
-
{
|
|
778
|
-
"data-on": checked,
|
|
779
|
-
className: cn(
|
|
780
|
-
"pointer-events-none ml-0.5 inline-block rounded-full bg-background shadow-sm transition-transform",
|
|
781
|
-
THUMB[size]
|
|
782
|
-
)
|
|
783
|
-
}
|
|
784
|
-
)
|
|
785
|
-
}
|
|
786
|
-
);
|
|
787
|
-
if (label == null) return control;
|
|
788
|
-
return /* @__PURE__ */ jsxs(
|
|
789
|
-
"label",
|
|
790
|
-
{
|
|
791
|
-
className: cn(
|
|
792
|
-
"inline-flex items-center gap-2 text-xs text-muted-foreground",
|
|
793
|
-
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
794
|
-
),
|
|
795
|
-
onClick: (e) => e.stopPropagation(),
|
|
796
|
-
children: [
|
|
797
|
-
control,
|
|
798
|
-
/* @__PURE__ */ jsx("span", { children: label })
|
|
799
|
-
]
|
|
800
|
-
}
|
|
801
|
-
);
|
|
802
|
-
});
|
|
803
744
|
var Hint = React14.forwardRef(function Hint2({ label, children, side = "top", delayDuration = 0, ...rest }, ref) {
|
|
804
745
|
if (!label) return React14.cloneElement(children, { ...rest, ref });
|
|
805
746
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
@@ -884,7 +825,7 @@ function TimePicker({ value, onChange, interval = 15, min = "00:00", max = "23:4
|
|
|
884
825
|
onClick: () => !readOnly && setOpen((p) => !p),
|
|
885
826
|
onKeyDown: handleKeyDown,
|
|
886
827
|
disabled: readOnly,
|
|
887
|
-
className: `flex items-center gap-2 rounded-
|
|
828
|
+
className: `flex items-center gap-2 rounded-button border px-3 py-2 text-sm w-full text-left transition-colors ${readOnly ? "bg-muted/40 text-muted-foreground cursor-default" : "bg-background hover:bg-muted/30"}`,
|
|
888
829
|
children: [
|
|
889
830
|
/* @__PURE__ */ jsx(Clock, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
|
|
890
831
|
/* @__PURE__ */ jsx("span", { children: displayValue || "--:--" })
|
|
@@ -922,6 +863,58 @@ function TimePicker({ value, onChange, interval = 15, min = "00:00", max = "23:4
|
|
|
922
863
|
)
|
|
923
864
|
] });
|
|
924
865
|
}
|
|
866
|
+
function useRowSelection({
|
|
867
|
+
rows,
|
|
868
|
+
actions,
|
|
869
|
+
getRowId,
|
|
870
|
+
enabled = true
|
|
871
|
+
}) {
|
|
872
|
+
const identify = React14.useCallback(
|
|
873
|
+
(row) => getRowId ? getRowId(row) : String(row?.id ?? ""),
|
|
874
|
+
[getRowId]
|
|
875
|
+
);
|
|
876
|
+
const visible = React14.useMemo(() => rows ?? [], [rows]);
|
|
877
|
+
const [rawSelection, setRawSelection] = React14.useState([]);
|
|
878
|
+
const visibleIds = React14.useMemo(() => new Set(visible.map(identify)), [visible, identify]);
|
|
879
|
+
const selectedIds = React14.useMemo(
|
|
880
|
+
() => rawSelection.filter((id) => visibleIds.has(id)),
|
|
881
|
+
[rawSelection, visibleIds]
|
|
882
|
+
);
|
|
883
|
+
const selectedRows = React14.useMemo(() => {
|
|
884
|
+
const picked = new Set(selectedIds);
|
|
885
|
+
return visible.filter((row) => picked.has(identify(row)));
|
|
886
|
+
}, [visible, selectedIds, identify]);
|
|
887
|
+
const clear = React14.useCallback(() => setRawSelection([]), []);
|
|
888
|
+
const selectAll = React14.useCallback(
|
|
889
|
+
() => setRawSelection(visible.map(identify)),
|
|
890
|
+
[visible, identify]
|
|
891
|
+
);
|
|
892
|
+
const barActions = React14.useMemo(
|
|
893
|
+
() => (actions ?? []).map((action) => ({
|
|
894
|
+
id: action.id,
|
|
895
|
+
label: action.label,
|
|
896
|
+
icon: action.icon,
|
|
897
|
+
destructive: action.destructive,
|
|
898
|
+
overflow: action.overflow,
|
|
899
|
+
disabled: action.disabled,
|
|
900
|
+
onSelect: () => action.onSelect(selectedRows)
|
|
901
|
+
})),
|
|
902
|
+
[actions, selectedRows]
|
|
903
|
+
);
|
|
904
|
+
const selectable = enabled && barActions.length > 0;
|
|
905
|
+
return {
|
|
906
|
+
selectedIds,
|
|
907
|
+
selectedRows,
|
|
908
|
+
setSelectedIds: setRawSelection,
|
|
909
|
+
clear,
|
|
910
|
+
selectAll,
|
|
911
|
+
barActions,
|
|
912
|
+
selectable,
|
|
913
|
+
hasSelection: selectable && selectedIds.length > 0,
|
|
914
|
+
getRowId: identify,
|
|
915
|
+
total: visible.length
|
|
916
|
+
};
|
|
917
|
+
}
|
|
925
918
|
function FilterChip({ allLabel, options, value, onChange, label, icon: Icon2, className }) {
|
|
926
919
|
const active = value != null && value !== "";
|
|
927
920
|
const current = options.find((o) => o.value === value);
|
|
@@ -972,6 +965,8 @@ function ListView({
|
|
|
972
965
|
newLabel,
|
|
973
966
|
onNew,
|
|
974
967
|
onRowClick,
|
|
968
|
+
bulkActions,
|
|
969
|
+
getRowId,
|
|
975
970
|
emptyIcon: EmptyIcon,
|
|
976
971
|
emptyMessage = "No results found.",
|
|
977
972
|
emptyActionLabel,
|
|
@@ -1008,6 +1003,7 @@ function ListView({
|
|
|
1008
1003
|
const showPagination = onPageChange && totalItems > pageSize;
|
|
1009
1004
|
const showSearch = !!onSearchChange;
|
|
1010
1005
|
const showTags = tags && tags.length > 0 && onTagChange;
|
|
1006
|
+
const selection = useRowSelection({ rows: loading ? [] : data, actions: bulkActions, getRowId });
|
|
1011
1007
|
const tagFilter = showTags ? /* @__PURE__ */ jsx(
|
|
1012
1008
|
FilterChip,
|
|
1013
1009
|
{
|
|
@@ -1036,7 +1032,17 @@ function ListView({
|
|
|
1036
1032
|
] }) }),
|
|
1037
1033
|
toolbar,
|
|
1038
1034
|
/* @__PURE__ */ jsxs(Card, { className: "overflow-hidden", children: [
|
|
1039
|
-
(showSearch || tagFilter || filters || onRefresh || onExport) && /* @__PURE__ */
|
|
1035
|
+
(showSearch || tagFilter || filters || onRefresh || onExport || selection.hasSelection) && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: selection.hasSelection ? /* @__PURE__ */ jsx(
|
|
1036
|
+
BulkActionBar,
|
|
1037
|
+
{
|
|
1038
|
+
variant: "inline",
|
|
1039
|
+
count: selection.selectedIds.length,
|
|
1040
|
+
total: selection.total,
|
|
1041
|
+
onSelectAll: selection.selectAll,
|
|
1042
|
+
onClear: selection.clear,
|
|
1043
|
+
actions: selection.barActions
|
|
1044
|
+
}
|
|
1045
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1040
1046
|
showSearch && /* @__PURE__ */ jsxs("div", { className: "relative min-w-0 flex-1", children: [
|
|
1041
1047
|
/* @__PURE__ */ jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
1042
1048
|
/* @__PURE__ */ jsx(
|
|
@@ -1056,7 +1062,7 @@ function ListView({
|
|
|
1056
1062
|
onRefresh && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": refreshLabel, title: refreshLabel, onClick: onRefresh, className: ICON_BTN, children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }) }),
|
|
1057
1063
|
onExport && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": exportLabel, title: exportLabel, onClick: onExport, className: ICON_BTN, children: /* @__PURE__ */ jsx(Download, { className: "h-4 w-4" }) })
|
|
1058
1064
|
] })
|
|
1059
|
-
] }),
|
|
1065
|
+
] }) }),
|
|
1060
1066
|
/* @__PURE__ */ jsx(
|
|
1061
1067
|
DataTable,
|
|
1062
1068
|
{
|
|
@@ -1066,7 +1072,11 @@ function ListView({
|
|
|
1066
1072
|
loading,
|
|
1067
1073
|
skeletonRows: loading ? 3 : void 0,
|
|
1068
1074
|
emptyMessage: emptyState,
|
|
1069
|
-
onRowClick
|
|
1075
|
+
onRowClick,
|
|
1076
|
+
selectable: selection.selectable,
|
|
1077
|
+
selectedIds: selection.selectedIds,
|
|
1078
|
+
onSelectedIdsChange: selection.setSelectedIds,
|
|
1079
|
+
getRowId
|
|
1070
1080
|
}
|
|
1071
1081
|
)
|
|
1072
1082
|
] }),
|
|
@@ -1622,92 +1632,9 @@ function CurrencyInput({
|
|
|
1622
1632
|
)
|
|
1623
1633
|
] });
|
|
1624
1634
|
}
|
|
1625
|
-
var VARIANT_CONFIG = {
|
|
1626
|
-
default: {
|
|
1627
|
-
icon: Info,
|
|
1628
|
-
iconBg: "bg-info/10",
|
|
1629
|
-
iconColor: "text-info",
|
|
1630
|
-
buttonVariant: "default"
|
|
1631
|
-
},
|
|
1632
|
-
destructive: {
|
|
1633
|
-
icon: XCircle,
|
|
1634
|
-
iconBg: "bg-destructive/10",
|
|
1635
|
-
iconColor: "text-destructive",
|
|
1636
|
-
buttonVariant: "destructive"
|
|
1637
|
-
},
|
|
1638
|
-
warning: {
|
|
1639
|
-
icon: AlertTriangle,
|
|
1640
|
-
iconBg: "bg-warning/10",
|
|
1641
|
-
iconColor: "text-warning",
|
|
1642
|
-
buttonVariant: "destructive"
|
|
1643
|
-
},
|
|
1644
|
-
success: {
|
|
1645
|
-
icon: CheckCircle2,
|
|
1646
|
-
iconBg: "bg-success/10",
|
|
1647
|
-
iconColor: "text-success",
|
|
1648
|
-
buttonVariant: "default"
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
function ConfirmDialog({
|
|
1652
|
-
open,
|
|
1653
|
-
onConfirm,
|
|
1654
|
-
onCancel,
|
|
1655
|
-
title,
|
|
1656
|
-
description,
|
|
1657
|
-
confirmLabel = "Confirm",
|
|
1658
|
-
cancelLabel = "Cancel",
|
|
1659
|
-
variant = "default",
|
|
1660
|
-
loading = false
|
|
1661
|
-
}) {
|
|
1662
|
-
const config = VARIANT_CONFIG[variant];
|
|
1663
|
-
const Icon2 = config.icon;
|
|
1664
|
-
React14.useEffect(() => {
|
|
1665
|
-
if (!open) return;
|
|
1666
|
-
function handleKey(e) {
|
|
1667
|
-
if (e.key === "Escape") onCancel();
|
|
1668
|
-
}
|
|
1669
|
-
document.addEventListener("keydown", handleKey);
|
|
1670
|
-
return () => document.removeEventListener("keydown", handleKey);
|
|
1671
|
-
}, [open, onCancel]);
|
|
1672
|
-
if (!open) return null;
|
|
1673
|
-
return createPortal(
|
|
1674
|
-
/* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[60] flex items-center justify-center", children: [
|
|
1675
|
-
/* @__PURE__ */ jsx(
|
|
1676
|
-
"div",
|
|
1677
|
-
{
|
|
1678
|
-
className: "absolute inset-0 bg-black/50 backdrop-blur-[2px] animate-fade-in",
|
|
1679
|
-
onClick: onCancel
|
|
1680
|
-
}
|
|
1681
|
-
),
|
|
1682
|
-
/* @__PURE__ */ jsx(
|
|
1683
|
-
"div",
|
|
1684
|
-
{
|
|
1685
|
-
className: "relative z-10 w-full max-w-sm mx-4 rounded-modal border border-border bg-card shadow-lg animate-zoom-in",
|
|
1686
|
-
role: "alertdialog",
|
|
1687
|
-
"aria-modal": "true",
|
|
1688
|
-
"aria-labelledby": "confirm-title",
|
|
1689
|
-
"aria-describedby": description ? "confirm-desc" : void 0,
|
|
1690
|
-
children: /* @__PURE__ */ jsxs("div", { className: "p-6", children: [
|
|
1691
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
1692
|
-
/* @__PURE__ */ jsx("div", { className: cn("flex h-10 w-10 items-center justify-center rounded-full shrink-0", config.iconBg), children: /* @__PURE__ */ jsx(Icon2, { className: cn("h-5 w-5", config.iconColor) }) }),
|
|
1693
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 pt-0.5", children: [
|
|
1694
|
-
/* @__PURE__ */ jsx("h3", { id: "confirm-title", className: "text-sm font-semibold text-foreground", children: title }),
|
|
1695
|
-
description && /* @__PURE__ */ jsx("p", { id: "confirm-desc", className: "text-xs text-muted-foreground mt-1 leading-relaxed", children: description })
|
|
1696
|
-
] })
|
|
1697
|
-
] }),
|
|
1698
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2 mt-5", children: [
|
|
1699
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: onCancel, disabled: loading, children: cancelLabel }),
|
|
1700
|
-
/* @__PURE__ */ jsx(Button, { variant: config.buttonVariant, size: "sm", onClick: onConfirm, disabled: loading, children: loading ? "Processing..." : confirmLabel })
|
|
1701
|
-
] })
|
|
1702
|
-
] })
|
|
1703
|
-
}
|
|
1704
|
-
)
|
|
1705
|
-
] }),
|
|
1706
|
-
document.body
|
|
1707
|
-
);
|
|
1708
|
-
}
|
|
1709
1635
|
var Popover = PopoverPrimitive.Root;
|
|
1710
1636
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1637
|
+
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
1711
1638
|
var PopoverContent = React14.forwardRef(({ className, align = "start", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1712
1639
|
PopoverPrimitive.Content,
|
|
1713
1640
|
{
|
|
@@ -1935,7 +1862,9 @@ function SearchCombobox({
|
|
|
1935
1862
|
inlineLabel,
|
|
1936
1863
|
inlineIcon = "search",
|
|
1937
1864
|
loading,
|
|
1938
|
-
onFocus: onFocusProp
|
|
1865
|
+
onFocus: onFocusProp,
|
|
1866
|
+
chevron,
|
|
1867
|
+
required
|
|
1939
1868
|
}) {
|
|
1940
1869
|
const [open, setOpen] = useState(false);
|
|
1941
1870
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
@@ -2020,10 +1949,11 @@ function SearchCombobox({
|
|
|
2020
1949
|
setExpanded(true);
|
|
2021
1950
|
setTimeout(() => inputRef.current?.focus(), 50);
|
|
2022
1951
|
},
|
|
2023
|
-
className: `flex items-center gap-1.5 w-full text-left text-sm py-1.5 pl-2 transition-colors ${isPlus ? "text-primary hover:text-primary/80" : "text-muted-foreground hover:text-foreground"} ${className ?? ""}`,
|
|
1952
|
+
className: `flex items-center gap-1.5 w-full text-left text-sm py-1.5 pl-2 ${chevron ? "pr-2" : ""} transition-colors ${isPlus ? "text-primary hover:text-primary/80" : "text-muted-foreground hover:text-foreground"} ${className ?? ""}`,
|
|
2024
1953
|
children: [
|
|
2025
1954
|
isPlus && /* @__PURE__ */ jsx(Plus, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
2026
|
-
inlineLabel
|
|
1955
|
+
inlineLabel,
|
|
1956
|
+
chevron && /* @__PURE__ */ jsx(ChevronDown, { className: "ml-auto h-3 w-3 shrink-0 text-muted-foreground" })
|
|
2027
1957
|
]
|
|
2028
1958
|
}
|
|
2029
1959
|
);
|
|
@@ -2050,13 +1980,28 @@ function SearchCombobox({
|
|
|
2050
1980
|
onKeyDown: handleKeyDown,
|
|
2051
1981
|
placeholder,
|
|
2052
1982
|
autoFocus,
|
|
2053
|
-
className: minimal ?
|
|
1983
|
+
className: minimal ? `w-full bg-transparent pl-2 ${chevron ? "pr-7" : "pr-3"} py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none border-b border-transparent hover:border-border focus:border-foreground transition-colors` : `w-full rounded-lg border bg-background pl-8 ${chevron ? "pr-8" : "pr-3"} py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring`,
|
|
2054
1984
|
role: "combobox",
|
|
2055
1985
|
"aria-expanded": hasDropdown,
|
|
2056
1986
|
"aria-autocomplete": "list",
|
|
1987
|
+
"aria-required": required || void 0,
|
|
2057
1988
|
"aria-activedescendant": activeIndex >= 0 ? `combobox-opt-${activeIndex}` : void 0
|
|
2058
1989
|
}
|
|
2059
1990
|
),
|
|
1991
|
+
chevron && /* @__PURE__ */ jsx(
|
|
1992
|
+
"button",
|
|
1993
|
+
{
|
|
1994
|
+
type: "button",
|
|
1995
|
+
tabIndex: -1,
|
|
1996
|
+
"aria-hidden": "true",
|
|
1997
|
+
onMouseDown: (e) => {
|
|
1998
|
+
e.preventDefault();
|
|
1999
|
+
inputRef.current?.focus();
|
|
2000
|
+
},
|
|
2001
|
+
className: `absolute ${minimal ? "right-2" : "right-2.5"} top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors`,
|
|
2002
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
2003
|
+
}
|
|
2004
|
+
),
|
|
2060
2005
|
hasDropdown && dropRect && createPortal(
|
|
2061
2006
|
/* @__PURE__ */ jsxs(
|
|
2062
2007
|
"div",
|
|
@@ -2129,6 +2074,6 @@ function SearchCombobox({
|
|
|
2129
2074
|
] });
|
|
2130
2075
|
}
|
|
2131
2076
|
|
|
2132
|
-
export { Badge, Breadcrumb, BulkActionBar, ChevronPager,
|
|
2133
|
-
//# sourceMappingURL=chunk-
|
|
2134
|
-
//# sourceMappingURL=chunk-
|
|
2077
|
+
export { Badge, Breadcrumb, BulkActionBar, ChevronPager, CurrencyInput, DatePicker, FilterChip, Hint, Input, ListView, Markdown, MarkdownEditor, Modal, ModalBody, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalOverlay, ModalPortal, ModalTitle, ModalTrigger, PhoneField, PhoneLink, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RefreshButton, SearchCombobox, SearchField, SearchSelect, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, StatTiles, Tabs, TabsContent, TabsList, TabsTrigger, Thumbnail, TimePicker, ToastProvider, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, formatPhone2 as formatPhone, normalizePhone, renderMarkdown, useRowSelection };
|
|
2078
|
+
//# sourceMappingURL=chunk-SLWTKHNY.js.map
|
|
2079
|
+
//# sourceMappingURL=chunk-SLWTKHNY.js.map
|