@wealthx/shadcn 1.5.1 → 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 +118 -118
  2. package/CHANGELOG.md +6 -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 +5 -4
  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
package/tsup.config.ts CHANGED
@@ -86,7 +86,7 @@ export default defineConfig((options) => ({
86
86
  "src/components/ui/delete-contact-component.tsx",
87
87
  "src/components/ui/file-preview-dialog.tsx",
88
88
  "src/components/ui/review-alerts-dialog.tsx",
89
- "src/components/ui/contact-alert-dialog.tsx",
89
+ "src/components/ui/contact-alert-dialog/index.tsx",
90
90
  "src/components/ui/share-details-dialog.tsx",
91
91
  "src/components/ui/pipeline-alerts.tsx",
92
92
  "src/components/ui/pipeline-chart.tsx",
@@ -1,180 +0,0 @@
1
- import {
2
- Progress
3
- } from "./chunk-JPGL36WQ.mjs";
4
- import {
5
- Skeleton
6
- } from "./chunk-GTAVSBDO.mjs";
7
- import {
8
- Table,
9
- TableBody,
10
- TableCell,
11
- TableHead,
12
- TableHeader,
13
- TableRow
14
- } from "./chunk-GT3RU6GA.mjs";
15
- import {
16
- Spinner
17
- } from "./chunk-JVMXMFBB.mjs";
18
- import {
19
- Dialog,
20
- DialogContent,
21
- DialogFooter,
22
- DialogHeader,
23
- DialogTitle
24
- } from "./chunk-NCUH54IZ.mjs";
25
- import {
26
- Button
27
- } from "./chunk-NOOEKOWY.mjs";
28
- import {
29
- cn
30
- } from "./chunk-AFML43VJ.mjs";
31
-
32
- // src/components/ui/file-preview-dialog.tsx
33
- import * as React from "react";
34
- import { AlertCircleIcon, FileTextIcon, GripVerticalIcon } from "lucide-react";
35
- import { jsx, jsxs } from "react/jsx-runtime";
36
- function LoadingState({ columnCount }) {
37
- const cols = Math.max(columnCount, 3);
38
- return /* @__PURE__ */ jsxs(Table, { children: [
39
- /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, { children: Array.from({ length: cols }).map((_, i) => /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }) }, i)) }) }),
40
- /* @__PURE__ */ jsx(TableBody, { children: Array.from({ length: 4 }).map((_, rowIdx) => /* @__PURE__ */ jsx(TableRow, { children: Array.from({ length: cols }).map((_2, colIdx) => /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }) }, colIdx)) }, rowIdx)) })
41
- ] });
42
- }
43
- function EmptyState() {
44
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3 py-12 text-center", children: [
45
- /* @__PURE__ */ jsx(FileTextIcon, { className: "size-10 text-muted-foreground/40" }),
46
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: "No data found" }),
47
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "The CSV file appears to be empty or contains only headers." })
48
- ] });
49
- }
50
- function ErrorState({ message }) {
51
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3 py-12 text-center", children: [
52
- /* @__PURE__ */ jsx(AlertCircleIcon, { className: "size-10 text-destructive/60" }),
53
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: "Unable to parse file" }),
54
- /* @__PURE__ */ 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." })
55
- ] });
56
- }
57
- function ImportingState({ progress }) {
58
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 py-12", children: [
59
- /* @__PURE__ */ jsx(Spinner, { className: "size-6" }),
60
- /* @__PURE__ */ jsxs("div", { className: "w-full max-w-sm space-y-2", children: [
61
- /* @__PURE__ */ jsx(Progress, { value: progress, className: "h-1.5" }),
62
- /* @__PURE__ */ jsxs("p", { className: "text-center text-xs text-muted-foreground", children: [
63
- "Importing\u2026 ",
64
- progress,
65
- "%"
66
- ] })
67
- ] })
68
- ] });
69
- }
70
- function FilePreviewDialog({
71
- open,
72
- onOpenChange,
73
- fileName,
74
- state = "preview",
75
- errorMessage,
76
- columns = [],
77
- rows = [],
78
- onColumnReorder,
79
- onRowChange,
80
- onImport,
81
- importProgress = 0,
82
- totalRows,
83
- validRows,
84
- className
85
- }) {
86
- const dragSourceRef = React.useRef(null);
87
- const [dragOverIndex, setDragOverIndex] = React.useState(null);
88
- function handleDragStart(index) {
89
- dragSourceRef.current = index;
90
- }
91
- function handleDragOver(e, index) {
92
- e.preventDefault();
93
- setDragOverIndex(index);
94
- }
95
- function handleDrop(targetIndex) {
96
- const source = dragSourceRef.current;
97
- if (source !== null && source !== targetIndex) {
98
- onColumnReorder == null ? void 0 : onColumnReorder(source, targetIndex);
99
- }
100
- dragSourceRef.current = null;
101
- setDragOverIndex(null);
102
- }
103
- function handleDragEnd() {
104
- dragSourceRef.current = null;
105
- setDragOverIndex(null);
106
- }
107
- const isImporting = state === "importing";
108
- const canImport = state === "preview" && rows.length > 0;
109
- return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: isImporting ? void 0 : onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { size: "3xl", className, children: [
110
- /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Preview Import" }) }),
111
- fileName && state !== "error" && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
112
- /* @__PURE__ */ jsx("span", { className: "font-medium text-foreground", children: fileName }),
113
- state === "preview" && totalRows !== void 0 && /* @__PURE__ */ jsxs("span", { children: [
114
- validRows != null ? validRows : rows.length,
115
- " valid row",
116
- (validRows != null ? validRows : rows.length) !== 1 ? "s" : "",
117
- " / ",
118
- totalRows,
119
- " ",
120
- "total"
121
- ] })
122
- ] }),
123
- state === "loading" && /* @__PURE__ */ jsx(LoadingState, { columnCount: columns.length }),
124
- state === "empty" && /* @__PURE__ */ jsx(EmptyState, {}),
125
- state === "error" && /* @__PURE__ */ jsx(ErrorState, { message: errorMessage }),
126
- state === "importing" && /* @__PURE__ */ jsx(ImportingState, { progress: importProgress }),
127
- state === "preview" && /* @__PURE__ */ jsx("div", { className: "max-h-[400px] overflow-auto border border-border", children: /* @__PURE__ */ jsxs(Table, { children: [
128
- /* @__PURE__ */ jsx(TableHeader, { className: "sticky top-0 z-10 bg-muted/80 backdrop-blur-sm", children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((col, colIdx) => /* @__PURE__ */ jsx(
129
- TableHead,
130
- {
131
- draggable: true,
132
- onDragStart: () => handleDragStart(colIdx),
133
- onDragOver: (e) => handleDragOver(e, colIdx),
134
- onDrop: () => handleDrop(colIdx),
135
- onDragEnd: handleDragEnd,
136
- className: cn(
137
- "cursor-grab select-none transition-colors",
138
- dragOverIndex === colIdx && dragSourceRef.current !== colIdx && "bg-primary/10"
139
- ),
140
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
141
- /* @__PURE__ */ jsx(GripVerticalIcon, { className: "size-3.5 shrink-0 text-muted-foreground" }),
142
- /* @__PURE__ */ jsx("span", { children: col.label })
143
- ] })
144
- },
145
- col.key
146
- )) }) }),
147
- /* @__PURE__ */ jsx(TableBody, { children: rows.map((row, rowIdx) => /* @__PURE__ */ jsx(TableRow, { children: columns.map((col) => {
148
- var _a;
149
- return /* @__PURE__ */ jsx(TableCell, { className: "p-0", children: /* @__PURE__ */ jsx(
150
- "input",
151
- {
152
- type: "text",
153
- value: (_a = row[col.key]) != null ? _a : "",
154
- onChange: (e) => onRowChange == null ? void 0 : onRowChange(rowIdx, col.key, e.target.value),
155
- className: cn(
156
- "w-full bg-transparent px-4 py-3 text-sm text-foreground",
157
- "focus:outline-none focus:ring-1 focus:ring-inset focus:ring-primary"
158
- )
159
- }
160
- ) }, col.key);
161
- }) }, rowIdx)) })
162
- ] }) }),
163
- /* @__PURE__ */ jsxs(DialogFooter, { children: [
164
- /* @__PURE__ */ jsx(
165
- Button,
166
- {
167
- variant: "outline",
168
- onClick: () => onOpenChange(false),
169
- disabled: isImporting,
170
- children: "Cancel"
171
- }
172
- ),
173
- /* @__PURE__ */ jsx(Button, { disabled: !canImport, onClick: onImport, children: "Import" })
174
- ] })
175
- ] }) });
176
- }
177
-
178
- export {
179
- FilePreviewDialog
180
- };