@wealthx/shadcn 1.5.0 → 1.5.2

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.
Files changed (36) hide show
  1. package/.turbo/turbo-build.log +119 -119
  2. package/CHANGELOG.md +12 -0
  3. package/dist/chunk-G2EWIP2N.mjs +960 -0
  4. package/dist/{chunk-MHHA7QGO.mjs → chunk-ODO6BUOF.mjs} +1 -1
  5. package/dist/chunk-PX4M67XQ.mjs +301 -0
  6. package/dist/{chunk-FYUSF5KO.mjs → chunk-QRVEI6J3.mjs} +1 -1
  7. package/dist/{chunk-42NEC57Y.mjs → chunk-RAKBWNQH.mjs} +272 -3
  8. package/dist/components/ui/{contact-alert-dialog.js → contact-alert-dialog/index.js} +1029 -593
  9. package/dist/components/ui/contact-alert-dialog/index.mjs +31 -0
  10. package/dist/components/ui/file-preview-dialog.js +407 -100
  11. package/dist/components/ui/file-preview-dialog.mjs +3 -1
  12. package/dist/components/ui/kanban-column.js +408 -113
  13. package/dist/components/ui/kanban-column.mjs +3 -2
  14. package/dist/components/ui/opportunity-card.js +383 -88
  15. package/dist/components/ui/opportunity-card.mjs +2 -1
  16. package/dist/components/ui/pipeline-board.js +424 -129
  17. package/dist/components/ui/pipeline-board.mjs +4 -3
  18. package/dist/index.js +3081 -2282
  19. package/dist/index.mjs +39 -35
  20. package/dist/styles.css +1 -1
  21. package/package.json +6 -5
  22. package/src/components/index.tsx +3 -2
  23. package/src/components/ui/contact-alert-dialog/builder-ui.tsx +556 -0
  24. package/src/components/ui/contact-alert-dialog/config.ts +262 -0
  25. package/src/components/ui/contact-alert-dialog/contact-alert-dialog.tsx +214 -0
  26. package/src/components/ui/contact-alert-dialog/index.tsx +15 -0
  27. package/src/components/ui/contact-alert-dialog/types.ts +61 -0
  28. package/src/components/ui/contact-alert-dialog/utils.ts +93 -0
  29. package/src/components/ui/file-preview-dialog.tsx +299 -99
  30. package/src/components/ui/opportunity-card.tsx +328 -1
  31. package/src/styles/styles-css.ts +1 -1
  32. package/tsup.config.ts +1 -1
  33. package/dist/chunk-5WMFKQZ6.mjs +0 -180
  34. package/dist/chunk-Y24TXIFJ.mjs +0 -518
  35. package/dist/components/ui/contact-alert-dialog.mjs +0 -27
  36. package/src/components/ui/contact-alert-dialog.tsx +0 -710
@@ -0,0 +1,31 @@
1
+ import {
2
+ ALERT_QUERY_FIELDS,
3
+ AlertSharingType,
4
+ ContactAlertDialog,
5
+ ContactAlertQueryBuilder,
6
+ createAlertTree
7
+ } from "../../../chunk-G2EWIP2N.mjs";
8
+ import "../../../chunk-7YI3HEBH.mjs";
9
+ import "../../../chunk-MUV4EGDW.mjs";
10
+ import "../../../chunk-IKXYTCSB.mjs";
11
+ import "../../../chunk-TAX3KL66.mjs";
12
+ import "../../../chunk-2GIYVERS.mjs";
13
+ import "../../../chunk-BS75ICOO.mjs";
14
+ import "../../../chunk-NCUH54IZ.mjs";
15
+ import "../../../chunk-P7CEBZM6.mjs";
16
+ import "../../../chunk-OWFQSXVD.mjs";
17
+ import "../../../chunk-6QAFGZC2.mjs";
18
+ import "../../../chunk-LBTHZSBT.mjs";
19
+ import "../../../chunk-WDTXHLYM.mjs";
20
+ import "../../../chunk-S4CTM3UE.mjs";
21
+ import "../../../chunk-NOOEKOWY.mjs";
22
+ import "../../../chunk-R4HCRDU5.mjs";
23
+ import "../../../chunk-AFML43VJ.mjs";
24
+ import "../../../chunk-WNQUEZJF.mjs";
25
+ export {
26
+ ALERT_QUERY_FIELDS,
27
+ AlertSharingType,
28
+ ContactAlertDialog,
29
+ ContactAlertQueryBuilder,
30
+ createAlertTree
31
+ };
@@ -63,7 +63,7 @@ __export(file_preview_dialog_exports, {
63
63
  });
64
64
  module.exports = __toCommonJS(file_preview_dialog_exports);
65
65
  var React3 = __toESM(require("react"));
66
- var import_lucide_react4 = require("lucide-react");
66
+ var import_lucide_react5 = require("lucide-react");
67
67
 
68
68
  // src/components/ui/dialog.tsx
69
69
  var import_lucide_react2 = require("lucide-react");
@@ -555,42 +555,272 @@ function TableCell(_a) {
555
555
  );
556
556
  }
557
557
 
558
- // src/components/ui/file-preview-dialog.tsx
558
+ // src/components/ui/tooltip.tsx
559
+ var import_tooltip = require("@base-ui/react/tooltip");
559
560
  var import_jsx_runtime8 = require("react/jsx-runtime");
561
+ function TooltipProvider(_a) {
562
+ var _b = _a, {
563
+ delay = 0
564
+ } = _b, props = __objRest(_b, [
565
+ "delay"
566
+ ]);
567
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
568
+ import_tooltip.Tooltip.Provider,
569
+ __spreadValues({
570
+ "data-slot": "tooltip-provider",
571
+ delay
572
+ }, props)
573
+ );
574
+ }
575
+ function Tooltip(_a) {
576
+ var props = __objRest(_a, []);
577
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
578
+ }
579
+ function TooltipTrigger(_a) {
580
+ var props = __objRest(_a, []);
581
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
582
+ }
583
+ function TooltipContent(_a) {
584
+ var _b = _a, {
585
+ className,
586
+ sideOffset = 8,
587
+ side,
588
+ children,
589
+ style
590
+ } = _b, props = __objRest(_b, [
591
+ "className",
592
+ "sideOffset",
593
+ "side",
594
+ "children",
595
+ "style"
596
+ ]);
597
+ const themeVars = useThemeVars();
598
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Positioner, { sideOffset, side, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
599
+ import_tooltip.Tooltip.Popup,
600
+ __spreadProps(__spreadValues({
601
+ className: cn(
602
+ "relative z-50 w-fit animate-in overflow-visible bg-brand-secondary px-3 py-1.5 text-caption text-balance text-brand-secondary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards",
603
+ className
604
+ ),
605
+ "data-slot": "tooltip-content",
606
+ style: __spreadValues(__spreadValues({}, themeVars), style)
607
+ }, props), {
608
+ children: [
609
+ children,
610
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tooltip.Tooltip.Arrow, { className: "z-50 size-2.5 rotate-45 bg-brand-secondary data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1 data-[side=top]:-bottom-1" })
611
+ ]
612
+ })
613
+ ) }) });
614
+ }
615
+
616
+ // src/components/ui/select.tsx
617
+ var import_lucide_react4 = require("lucide-react");
618
+ var import_select = require("@base-ui/react/select");
619
+ var import_jsx_runtime9 = require("react/jsx-runtime");
620
+ function Select(_a) {
621
+ var props = __objRest(_a, []);
622
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_select.Select.Root, __spreadValues({ "data-slot": "select" }, props));
623
+ }
624
+ function SelectValue(_a) {
625
+ var props = __objRest(_a, []);
626
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_select.Select.Value, __spreadValues({ "data-slot": "select-value" }, props));
627
+ }
628
+ function SelectTrigger(_a) {
629
+ var _b = _a, {
630
+ className,
631
+ size = "default",
632
+ children
633
+ } = _b, props = __objRest(_b, [
634
+ "className",
635
+ "size",
636
+ "children"
637
+ ]);
638
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
639
+ import_select.Select.Trigger,
640
+ __spreadProps(__spreadValues({
641
+ className: cn(
642
+ "flex w-fit items-center justify-between gap-2 border border-input bg-transparent px-3 py-2 text-body-medium whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 data-popup-open:border-primary data-popup-open:ring-[3px] data-popup-open:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:font-normal data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
643
+ className
644
+ ),
645
+ "data-size": size,
646
+ "data-slot": "select-trigger"
647
+ }, props), {
648
+ children: [
649
+ children,
650
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_select.Select.Icon, { className: "transition-transform duration-200 data-popup-open:rotate-180", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ChevronDownIcon, { className: "size-4 opacity-50" }) })
651
+ ]
652
+ })
653
+ );
654
+ }
655
+ function SelectContent(_a) {
656
+ var _b = _a, {
657
+ className,
658
+ children,
659
+ style
660
+ } = _b, props = __objRest(_b, [
661
+ "className",
662
+ "children",
663
+ "style"
664
+ ]);
665
+ const themeVars = useThemeVars();
666
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_select.Select.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
667
+ import_select.Select.Positioner,
668
+ {
669
+ className: "z-[200]",
670
+ align: "start",
671
+ alignItemWithTrigger: false,
672
+ sideOffset: 4,
673
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
674
+ import_select.Select.Popup,
675
+ __spreadProps(__spreadValues({
676
+ className: cn(
677
+ "relative max-h-[var(--available-height)] min-w-[var(--anchor-width,8rem)] overflow-x-hidden overflow-y-auto border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-ending-style:animate-out data-ending-style:fade-out-0 data-ending-style:zoom-out-95 data-ending-style:fill-mode-forwards data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
678
+ className
679
+ ),
680
+ "data-slot": "select-content",
681
+ style: __spreadValues(__spreadValues({}, themeVars), style)
682
+ }, props), {
683
+ children: [
684
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectScrollUpButton, {}),
685
+ children,
686
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectScrollDownButton, {})
687
+ ]
688
+ })
689
+ )
690
+ }
691
+ ) });
692
+ }
693
+ function SelectItem(_a) {
694
+ var _b = _a, {
695
+ className,
696
+ children
697
+ } = _b, props = __objRest(_b, [
698
+ "className",
699
+ "children"
700
+ ]);
701
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
702
+ import_select.Select.Item,
703
+ __spreadProps(__spreadValues({
704
+ className: cn(
705
+ "relative flex w-full cursor-default items-center gap-2 py-1.5 pr-8 pl-2 text-body-small outline-hidden select-none data-highlighted:bg-primary/5 data-highlighted:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
706
+ className
707
+ ),
708
+ "data-slot": "select-item"
709
+ }, props), {
710
+ children: [
711
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
712
+ "span",
713
+ {
714
+ className: "absolute right-2 flex size-3.5 items-center justify-center",
715
+ "data-slot": "select-item-indicator",
716
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_select.Select.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.CheckIcon, { className: "size-4" }) })
717
+ }
718
+ ),
719
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_select.Select.ItemText, { children })
720
+ ]
721
+ })
722
+ );
723
+ }
724
+ function SelectScrollUpButton(_a) {
725
+ var _b = _a, {
726
+ className
727
+ } = _b, props = __objRest(_b, [
728
+ "className"
729
+ ]);
730
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
731
+ import_select.Select.ScrollUpArrow,
732
+ __spreadProps(__spreadValues({
733
+ className: cn(
734
+ "flex cursor-default items-center justify-center py-1",
735
+ className
736
+ ),
737
+ "data-slot": "select-scroll-up-button"
738
+ }, props), {
739
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ChevronUpIcon, { className: "size-4" })
740
+ })
741
+ );
742
+ }
743
+ function SelectScrollDownButton(_a) {
744
+ var _b = _a, {
745
+ className
746
+ } = _b, props = __objRest(_b, [
747
+ "className"
748
+ ]);
749
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
750
+ import_select.Select.ScrollDownArrow,
751
+ __spreadProps(__spreadValues({
752
+ className: cn(
753
+ "flex cursor-default items-center justify-center py-1",
754
+ className
755
+ ),
756
+ "data-slot": "select-scroll-down-button"
757
+ }, props), {
758
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react4.ChevronDownIcon, { className: "size-4" })
759
+ })
760
+ );
761
+ }
762
+
763
+ // src/components/ui/file-preview-dialog.tsx
764
+ var import_jsx_runtime10 = require("react/jsx-runtime");
560
765
  function LoadingState({ columnCount }) {
561
766
  const cols = Math.max(columnCount, 3);
562
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Table, { children: [
563
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableRow, { children: Array.from({ length: cols }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { className: "h-4 w-24" }) }, i)) }) }),
564
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableBody, { children: Array.from({ length: 4 }).map((_, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableRow, { children: Array.from({ length: cols }).map((_2, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { className: "h-4 w-full" }) }, colIdx)) }, rowIdx)) })
767
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Table, { children: [
768
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableRow, { children: Array.from({ length: cols }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Skeleton, { className: "h-4 w-24" }) }, i)) }) }),
769
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableBody, { children: Array.from({ length: 4 }).map((_, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableRow, { children: Array.from({ length: cols }).map((_2, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Skeleton, { className: "h-4 w-full" }) }, colIdx)) }, rowIdx)) })
565
770
  ] });
566
771
  }
567
772
  function EmptyState() {
568
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col items-center gap-3 py-12 text-center", children: [
569
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react4.FileTextIcon, { className: "size-10 text-muted-foreground/40" }),
570
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm font-medium text-foreground", children: "No data found" }),
571
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-xs text-muted-foreground", children: "The CSV file appears to be empty or contains only headers." })
773
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col items-center gap-3 py-12 text-center", children: [
774
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.FileTextIcon, { className: "size-10 text-muted-foreground/40" }),
775
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm font-medium text-foreground", children: "No data found" }),
776
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-muted-foreground", children: "The CSV file appears to be empty or contains only headers." })
572
777
  ] });
573
778
  }
574
779
  function ErrorState({ message }) {
575
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col items-center gap-3 py-12 text-center", children: [
576
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react4.AlertCircleIcon, { className: "size-10 text-destructive/60" }),
577
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Unable to parse file" }),
578
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-xs text-muted-foreground", children: message != null ? message : "The file could not be read. Please check the format and try again." })
780
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col items-center gap-3 py-12 text-center", children: [
781
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.AlertCircleIcon, { className: "size-10 text-destructive/60" }),
782
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Unable to parse file" }),
783
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-muted-foreground", children: message != null ? message : "The file could not be read. Please check the format and try again." })
579
784
  ] });
580
785
  }
581
- function ImportingState({ progress }) {
582
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col items-center gap-4 py-12", children: [
583
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Spinner, { className: "size-6" }),
584
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-full max-w-sm space-y-2", children: [
585
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Progress, { value: progress, className: "h-1.5" }),
586
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "text-center text-xs text-muted-foreground", children: [
587
- "Importing\u2026 ",
588
- progress,
589
- "%"
786
+ function ImportingState({
787
+ progress,
788
+ successCount,
789
+ failedCount
790
+ }) {
791
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col items-center gap-4 py-8", children: [
792
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Spinner, { className: "size-6" }),
793
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w-full max-w-sm space-y-2", children: [
794
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Progress, { value: progress, className: "h-1.5" }),
795
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
796
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
797
+ "Importing\u2026 ",
798
+ progress,
799
+ "%"
800
+ ] }),
801
+ (successCount > 0 || failedCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
802
+ successCount,
803
+ " success \xB7 ",
804
+ failedCount,
805
+ " failed"
806
+ ] })
590
807
  ] })
591
808
  ] })
592
809
  ] });
593
810
  }
811
+ function RowStatusCell({ row }) {
812
+ const { _status, _statusMessage } = row;
813
+ if (_status === "success") {
814
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex items-center justify-center h-full px-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.CheckCircle2Icon, { className: "size-4 text-success" }) });
815
+ }
816
+ if (_status === "failed") {
817
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Tooltip, { children: [
818
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex items-center justify-center h-full px-2 cursor-default", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.CircleAlertIcon, { className: "size-4 text-destructive" }) }) }),
819
+ _statusMessage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipContent, { side: "top", children: _statusMessage })
820
+ ] }) });
821
+ }
822
+ return null;
823
+ }
594
824
  function FilePreviewDialog({
595
825
  open,
596
826
  onOpenChange,
@@ -599,42 +829,37 @@ function FilePreviewDialog({
599
829
  errorMessage,
600
830
  columns = [],
601
831
  rows = [],
602
- onColumnReorder,
603
832
  onRowChange,
833
+ onRowDelete,
604
834
  onImport,
835
+ onCancelImport,
605
836
  importProgress = 0,
606
837
  totalRows,
607
838
  validRows,
839
+ pageSize = 10,
840
+ staffOptions,
841
+ selectedStaffId,
842
+ onStaffSelect,
608
843
  className
609
844
  }) {
610
- const dragSourceRef = React3.useRef(null);
611
- const [dragOverIndex, setDragOverIndex] = React3.useState(null);
612
- function handleDragStart(index) {
613
- dragSourceRef.current = index;
614
- }
615
- function handleDragOver(e, index) {
616
- e.preventDefault();
617
- setDragOverIndex(index);
618
- }
619
- function handleDrop(targetIndex) {
620
- const source = dragSourceRef.current;
621
- if (source !== null && source !== targetIndex) {
622
- onColumnReorder == null ? void 0 : onColumnReorder(source, targetIndex);
623
- }
624
- dragSourceRef.current = null;
625
- setDragOverIndex(null);
626
- }
627
- function handleDragEnd() {
628
- dragSourceRef.current = null;
629
- setDragOverIndex(null);
630
- }
845
+ const [page, setPage] = React3.useState(0);
846
+ React3.useEffect(() => {
847
+ setPage(0);
848
+ }, [rows.length]);
849
+ const totalPages = Math.ceil(rows.length / pageSize);
850
+ const pagedRows = rows.slice(page * pageSize, (page + 1) * pageSize);
851
+ const pageStart = page * pageSize;
631
852
  const isImporting = state === "importing";
632
- const canImport = state === "preview" && rows.length > 0;
633
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Dialog, { open, onOpenChange: isImporting ? void 0 : onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogContent, { size: "3xl", className, children: [
634
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogTitle, { children: "Preview Import" }) }),
635
- fileName && state !== "error" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
636
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-medium text-foreground", children: fileName }),
637
- state === "preview" && totalRows !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
853
+ const hasStaffSelector = !!staffOptions && staffOptions.length > 0;
854
+ const canImport = state === "preview" && rows.length > 0 && (!hasStaffSelector || !!selectedStaffId);
855
+ const successCount = rows.filter((r) => r._status === "success").length;
856
+ const failedCount = rows.filter((r) => r._status === "failed").length;
857
+ const hasStatus = rows.some((r) => r._status !== void 0);
858
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog, { open, onOpenChange: isImporting ? void 0 : onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogContent, { size: "3xl", className, children: [
859
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogTitle, { children: "Preview Import" }) }),
860
+ fileName && state !== "error" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
861
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-medium text-foreground", children: fileName }),
862
+ state === "preview" && totalRows !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
638
863
  validRows != null ? validRows : rows.length,
639
864
  " valid row",
640
865
  (validRows != null ? validRows : rows.length) !== 1 ? "s" : "",
@@ -642,60 +867,142 @@ function FilePreviewDialog({
642
867
  totalRows,
643
868
  " ",
644
869
  "total"
870
+ ] }),
871
+ hasStatus && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
872
+ successCount,
873
+ " success \xB7 ",
874
+ failedCount,
875
+ " failed"
645
876
  ] })
646
877
  ] }),
647
- state === "loading" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LoadingState, { columnCount: columns.length }),
648
- state === "empty" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(EmptyState, {}),
649
- state === "error" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ErrorState, { message: errorMessage }),
650
- state === "importing" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ImportingState, { progress: importProgress }),
651
- state === "preview" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "max-h-[400px] overflow-auto border border-border", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Table, { children: [
652
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableHeader, { className: "sticky top-0 z-10 bg-muted/80 backdrop-blur-sm", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableRow, { children: columns.map((col, colIdx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
653
- TableHead,
654
- {
655
- draggable: true,
656
- onDragStart: () => handleDragStart(colIdx),
657
- onDragOver: (e) => handleDragOver(e, colIdx),
658
- onDrop: () => handleDrop(colIdx),
659
- onDragEnd: handleDragEnd,
660
- className: cn(
661
- "cursor-grab select-none transition-colors",
662
- dragOverIndex === colIdx && dragSourceRef.current !== colIdx && "bg-primary/10"
663
- ),
664
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-1.5", children: [
665
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react4.GripVerticalIcon, { className: "size-3.5 shrink-0 text-muted-foreground" }),
666
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: col.label })
667
- ] })
668
- },
669
- col.key
670
- )) }) }),
671
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableBody, { children: rows.map((row, rowIdx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableRow, { children: columns.map((col) => {
672
- var _a;
673
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TableCell, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
674
- "input",
878
+ state === "loading" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoadingState, { columnCount: columns.length }),
879
+ state === "empty" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(EmptyState, {}),
880
+ state === "error" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ErrorState, { message: errorMessage }),
881
+ state === "importing" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
882
+ ImportingState,
883
+ {
884
+ progress: importProgress,
885
+ successCount,
886
+ failedCount
887
+ }
888
+ ),
889
+ state === "preview" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
890
+ hasStaffSelector && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-1", children: [
891
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "text-label-medium text-foreground", children: [
892
+ "Assign staff",
893
+ " ",
894
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-destructive", "aria-hidden": "true", children: "*" })
895
+ ] }),
896
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
897
+ Select,
675
898
  {
676
- type: "text",
677
- value: (_a = row[col.key]) != null ? _a : "",
678
- onChange: (e) => onRowChange == null ? void 0 : onRowChange(rowIdx, col.key, e.target.value),
679
- className: cn(
680
- "w-full bg-transparent px-4 py-3 text-sm text-foreground",
681
- "focus:outline-none focus:ring-1 focus:ring-inset focus:ring-primary"
682
- )
899
+ value: selectedStaffId != null ? selectedStaffId : "",
900
+ onValueChange: (id) => onStaffSelect == null ? void 0 : onStaffSelect(id),
901
+ children: [
902
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectTrigger, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectValue, { placeholder: "Select a staff member" }) }),
903
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectContent, { children: staffOptions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectItem, { value: s.id, children: s.name }, s.id)) })
904
+ ]
683
905
  }
684
- ) }, col.key);
685
- }) }, rowIdx)) })
686
- ] }) }),
687
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogFooter, { children: [
688
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
689
- Button,
690
- {
691
- variant: "outline",
692
- onClick: () => onOpenChange(false),
693
- disabled: isImporting,
694
- children: "Cancel"
695
- }
696
- ),
697
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { disabled: !canImport, onClick: onImport, children: "Import" })
698
- ] })
906
+ ),
907
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-xs text-muted-foreground", children: "All contacts in this import will be assigned to the selected staff member." })
908
+ ] }),
909
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "max-h-[360px] overflow-auto border border-border", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Table, { children: [
910
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHeader, { className: "sticky top-0 z-10 bg-muted/80 backdrop-blur-sm", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(TableRow, { children: [
911
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHead, { className: "w-10 text-center select-none", children: "#" }),
912
+ columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHead, { className: "select-none", children: col.label }, col.key)),
913
+ hasStatus && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHead, { className: "w-16 text-center select-none", children: "Status" }),
914
+ onRowDelete && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableHead, { className: "w-10 select-none" })
915
+ ] }) }),
916
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableBody, { children: pagedRows.map((row, pageRowIdx) => {
917
+ const absoluteIdx = pageStart + pageRowIdx;
918
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
919
+ TableRow,
920
+ {
921
+ className: cn(
922
+ row._status === "failed" && "bg-destructive/5",
923
+ row._status === "success" && "bg-success/5"
924
+ ),
925
+ children: [
926
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableCell, { className: "text-center text-xs text-muted-foreground select-none w-10", children: absoluteIdx + 1 }),
927
+ columns.map((col) => {
928
+ var _a;
929
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableCell, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
930
+ "input",
931
+ {
932
+ type: "text",
933
+ value: (_a = row[col.key]) != null ? _a : "",
934
+ onChange: (e) => onRowChange == null ? void 0 : onRowChange(
935
+ absoluteIdx,
936
+ col.key,
937
+ e.target.value
938
+ ),
939
+ className: cn(
940
+ "w-full bg-transparent px-4 py-3 text-sm text-foreground",
941
+ "focus:outline-none focus:ring-1 focus:ring-inset focus:ring-primary"
942
+ )
943
+ }
944
+ ) }, col.key);
945
+ }),
946
+ hasStatus && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableCell, { className: "text-center w-16 p-0", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RowStatusCell, { row }) }),
947
+ onRowDelete && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TableCell, { className: "w-10 p-0 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
948
+ Button,
949
+ {
950
+ variant: "ghost",
951
+ size: "icon-sm",
952
+ "aria-label": `Delete row ${absoluteIdx + 1}`,
953
+ onClick: () => onRowDelete(absoluteIdx),
954
+ className: "text-muted-foreground hover:text-destructive",
955
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react5.Trash2Icon, { className: "size-3.5" })
956
+ }
957
+ ) })
958
+ ]
959
+ },
960
+ absoluteIdx
961
+ );
962
+ }) })
963
+ ] }) }),
964
+ totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between text-xs text-muted-foreground pt-1", children: [
965
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
966
+ "Showing ",
967
+ pageStart + 1,
968
+ "\u2013",
969
+ Math.min(pageStart + pageSize, rows.length),
970
+ " of ",
971
+ rows.length
972
+ ] }),
973
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
974
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
975
+ Button,
976
+ {
977
+ variant: "outline",
978
+ size: "sm",
979
+ onClick: () => setPage((p) => Math.max(0, p - 1)),
980
+ disabled: page === 0,
981
+ children: "Previous"
982
+ }
983
+ ),
984
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "px-2", children: [
985
+ page + 1,
986
+ " / ",
987
+ totalPages
988
+ ] }),
989
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
990
+ Button,
991
+ {
992
+ variant: "outline",
993
+ size: "sm",
994
+ onClick: () => setPage((p) => Math.min(totalPages - 1, p + 1)),
995
+ disabled: page >= totalPages - 1,
996
+ children: "Next"
997
+ }
998
+ )
999
+ ] })
1000
+ ] })
1001
+ ] }),
1002
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogFooter, { children: isImporting ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "outline", onClick: onCancelImport, children: "Cancel Import" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1003
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }),
1004
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { disabled: !canImport, onClick: onImport, children: "Import" })
1005
+ ] }) })
699
1006
  ] }) });
700
1007
  }
701
1008
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  FilePreviewDialog
3
- } from "../../chunk-5WMFKQZ6.mjs";
3
+ } from "../../chunk-PX4M67XQ.mjs";
4
4
  import "../../chunk-JPGL36WQ.mjs";
5
5
  import "../../chunk-GTAVSBDO.mjs";
6
6
  import "../../chunk-GT3RU6GA.mjs";
7
+ import "../../chunk-TAX3KL66.mjs";
7
8
  import "../../chunk-JVMXMFBB.mjs";
9
+ import "../../chunk-6SR4K5T5.mjs";
8
10
  import "../../chunk-NCUH54IZ.mjs";
9
11
  import "../../chunk-WDTXHLYM.mjs";
10
12
  import "../../chunk-S4CTM3UE.mjs";