@senitix/ui 0.4.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.
Files changed (206) hide show
  1. package/dist/avatar-C0aVNCG9.cjs +2 -0
  2. package/dist/avatar-C0aVNCG9.cjs.map +1 -0
  3. package/dist/avatar-CN6wcrqY.js +288 -0
  4. package/dist/avatar-CN6wcrqY.js.map +1 -0
  5. package/dist/calendar-BFWc4IB7.js +1182 -0
  6. package/dist/calendar-BFWc4IB7.js.map +1 -0
  7. package/dist/calendar-BUm7YrNf.cjs +2 -0
  8. package/dist/calendar-BUm7YrNf.cjs.map +1 -0
  9. package/dist/calendar-ChJkFXXr.js +11 -0
  10. package/dist/calendar-ChJkFXXr.js.map +1 -0
  11. package/dist/calendar-SwL5isYC.cjs +2 -0
  12. package/dist/calendar-SwL5isYC.cjs.map +1 -0
  13. package/dist/card-K4fxyYwE.js +51 -0
  14. package/dist/card-K4fxyYwE.js.map +1 -0
  15. package/dist/card-tMkUxpmW.cjs +2 -0
  16. package/dist/card-tMkUxpmW.cjs.map +1 -0
  17. package/dist/checkbox-CpOq5hkT.js +289 -0
  18. package/dist/checkbox-CpOq5hkT.js.map +1 -0
  19. package/dist/checkbox-D7-LQyCl.cjs +2 -0
  20. package/dist/checkbox-D7-LQyCl.cjs.map +1 -0
  21. package/dist/chevron-down-DHdXqOqK.cjs +2 -0
  22. package/dist/chevron-down-DHdXqOqK.cjs.map +1 -0
  23. package/dist/chevron-down-DJ1_YIFu.js +8 -0
  24. package/dist/chevron-down-DJ1_YIFu.js.map +1 -0
  25. package/dist/chevron-right-B3bovvh0.js +8 -0
  26. package/dist/chevron-right-B3bovvh0.js.map +1 -0
  27. package/dist/chevron-right-Dvyd11q0.cjs +2 -0
  28. package/dist/chevron-right-Dvyd11q0.cjs.map +1 -0
  29. package/dist/chevron-up-B9fuiZhc.cjs +2 -0
  30. package/dist/chevron-up-B9fuiZhc.cjs.map +1 -0
  31. package/dist/chevron-up-CGtXOr51.js +6 -0
  32. package/dist/chevron-up-CGtXOr51.js.map +1 -0
  33. package/dist/components/charts/index.cjs.js +2 -0
  34. package/dist/components/charts/index.cjs.js.map +1 -0
  35. package/dist/components/charts/index.es.js +12 -0
  36. package/dist/components/charts/index.es.js.map +1 -0
  37. package/dist/components/data-display/index.cjs.js +2 -0
  38. package/dist/components/data-display/index.cjs.js.map +1 -0
  39. package/dist/components/data-display/index.es.js +25 -0
  40. package/dist/components/data-display/index.es.js.map +1 -0
  41. package/dist/components/dnd/index.cjs.js +2 -0
  42. package/dist/components/dnd/index.cjs.js.map +1 -0
  43. package/dist/components/dnd/index.es.js +9 -0
  44. package/dist/components/dnd/index.es.js.map +1 -0
  45. package/dist/components/feedback/index.cjs.js +2 -0
  46. package/dist/components/feedback/index.cjs.js.map +1 -0
  47. package/dist/components/feedback/index.es.js +16 -0
  48. package/dist/components/feedback/index.es.js.map +1 -0
  49. package/dist/components/forms/index.cjs.js +2 -0
  50. package/dist/components/forms/index.cjs.js.map +1 -0
  51. package/dist/components/forms/index.es.js +27 -0
  52. package/dist/components/forms/index.es.js.map +1 -0
  53. package/dist/components/layouts/index.cjs.js +2 -0
  54. package/dist/components/layouts/index.cjs.js.map +1 -0
  55. package/dist/components/layouts/index.es.js +25 -0
  56. package/dist/components/layouts/index.es.js.map +1 -0
  57. package/dist/components/navigation/index.cjs.js +2 -0
  58. package/dist/components/navigation/index.cjs.js.map +1 -0
  59. package/dist/components/navigation/index.es.js +42 -0
  60. package/dist/components/navigation/index.es.js.map +1 -0
  61. package/dist/components/ui/index.cjs.js +2 -0
  62. package/dist/components/ui/index.cjs.js.map +1 -0
  63. package/dist/components/ui/index.es.js +165 -0
  64. package/dist/components/ui/index.es.js.map +1 -0
  65. package/dist/createLucideIcon-BbeNo6vq.js +56 -0
  66. package/dist/createLucideIcon-BbeNo6vq.js.map +1 -0
  67. package/dist/createLucideIcon-i5GEhNMV.cjs +2 -0
  68. package/dist/createLucideIcon-i5GEhNMV.cjs.map +1 -0
  69. package/dist/ellipsis-BW2gWki8.cjs +2 -0
  70. package/dist/ellipsis-BW2gWki8.cjs.map +1 -0
  71. package/dist/ellipsis-CiKEaUNP.js +10 -0
  72. package/dist/ellipsis-CiKEaUNP.js.map +1 -0
  73. package/dist/file-V_hhCUhr.cjs +2 -0
  74. package/dist/file-V_hhCUhr.cjs.map +1 -0
  75. package/dist/file-wzTXnWqz.js +9 -0
  76. package/dist/file-wzTXnWqz.js.map +1 -0
  77. package/dist/filter-tags-DjUaNXHR.cjs +5 -0
  78. package/dist/filter-tags-DjUaNXHR.cjs.map +1 -0
  79. package/dist/filter-tags-i_I8qV1N.js +2658 -0
  80. package/dist/filter-tags-i_I8qV1N.js.map +1 -0
  81. package/dist/full-calendar-7ac2FFU6.js +3518 -0
  82. package/dist/full-calendar-7ac2FFU6.js.map +1 -0
  83. package/dist/full-calendar-Cpeh5xMP.cjs +8 -0
  84. package/dist/full-calendar-Cpeh5xMP.cjs.map +1 -0
  85. package/dist/global-search-UNXjoFlI.cjs +2 -0
  86. package/dist/global-search-UNXjoFlI.cjs.map +1 -0
  87. package/dist/global-search-h1rVbP2q.js +1188 -0
  88. package/dist/global-search-h1rVbP2q.js.map +1 -0
  89. package/dist/hooks/index.cjs.js +2 -0
  90. package/dist/hooks/index.cjs.js.map +1 -0
  91. package/dist/hooks/index.es.js +13 -0
  92. package/dist/hooks/index.es.js.map +1 -0
  93. package/dist/index-Co9o9StL.js +33 -0
  94. package/dist/index-Co9o9StL.js.map +1 -0
  95. package/dist/index-CwJPJKOE.js +2278 -0
  96. package/dist/index-CwJPJKOE.js.map +1 -0
  97. package/dist/index-CzVK9Zyb.cjs +6 -0
  98. package/dist/index-CzVK9Zyb.cjs.map +1 -0
  99. package/dist/index-l828OqQN.js +288 -0
  100. package/dist/index-l828OqQN.js.map +1 -0
  101. package/dist/index-lGzB9daF.cjs +2 -0
  102. package/dist/index-lGzB9daF.cjs.map +1 -0
  103. package/dist/index-lT9bLt9X.cjs +2 -0
  104. package/dist/index-lT9bLt9X.cjs.map +1 -0
  105. package/dist/index.cjs.js +2 -0
  106. package/dist/index.cjs.js.map +1 -0
  107. package/dist/index.es.js +332 -0
  108. package/dist/index.es.js.map +1 -0
  109. package/dist/input-CZrckPLk.cjs +42 -0
  110. package/dist/input-CZrckPLk.cjs.map +1 -0
  111. package/dist/input-D4AoiWxo.js +3629 -0
  112. package/dist/input-D4AoiWxo.js.map +1 -0
  113. package/dist/locale-provider-DHMwuneF.cjs +2 -0
  114. package/dist/locale-provider-DHMwuneF.cjs.map +1 -0
  115. package/dist/locale-provider-DanG6RRG.js +1012 -0
  116. package/dist/locale-provider-DanG6RRG.js.map +1 -0
  117. package/dist/locale-selector-Ppe0KTi-.cjs +2 -0
  118. package/dist/locale-selector-Ppe0KTi-.cjs.map +1 -0
  119. package/dist/locale-selector-xn2GpdP9.js +1745 -0
  120. package/dist/locale-selector-xn2GpdP9.js.map +1 -0
  121. package/dist/minus-BXBFZSZs.cjs +2 -0
  122. package/dist/minus-BXBFZSZs.cjs.map +1 -0
  123. package/dist/minus-DvlYtl96.js +6 -0
  124. package/dist/minus-DvlYtl96.js.map +1 -0
  125. package/dist/multi-container-C2UpSw5f.js +731 -0
  126. package/dist/multi-container-C2UpSw5f.js.map +1 -0
  127. package/dist/multi-container-DMKL8c9B.cjs +2 -0
  128. package/dist/multi-container-DMKL8c9B.cjs.map +1 -0
  129. package/dist/pipeline-By5_8AFg.cjs +2 -0
  130. package/dist/pipeline-By5_8AFg.cjs.map +1 -0
  131. package/dist/pipeline-D-QNSU0U.js +1036 -0
  132. package/dist/pipeline-D-QNSU0U.js.map +1 -0
  133. package/dist/plus-8wKRkVu-.cjs +2 -0
  134. package/dist/plus-8wKRkVu-.cjs.map +1 -0
  135. package/dist/plus-CJD68KQD.js +9 -0
  136. package/dist/plus-CJD68KQD.js.map +1 -0
  137. package/dist/popover-4V4sGe1U.js +765 -0
  138. package/dist/popover-4V4sGe1U.js.map +1 -0
  139. package/dist/popover-ivh-plLc.cjs +2 -0
  140. package/dist/popover-ivh-plLc.cjs.map +1 -0
  141. package/dist/progress-CFnuLqnS.cjs +7 -0
  142. package/dist/progress-CFnuLqnS.cjs.map +1 -0
  143. package/dist/progress-D5AsrWa6.js +222 -0
  144. package/dist/progress-D5AsrWa6.js.map +1 -0
  145. package/dist/providers/index.cjs.js +2 -0
  146. package/dist/providers/index.cjs.js.map +1 -0
  147. package/dist/providers/index.es.js +9 -0
  148. package/dist/providers/index.es.js.map +1 -0
  149. package/dist/scroll-area-DQeqDp3Y.js +952 -0
  150. package/dist/scroll-area-DQeqDp3Y.js.map +1 -0
  151. package/dist/scroll-area-DYOiJMXh.cjs +2 -0
  152. package/dist/scroll-area-DYOiJMXh.cjs.map +1 -0
  153. package/dist/select-C1rNBi6c.js +974 -0
  154. package/dist/select-C1rNBi6c.js.map +1 -0
  155. package/dist/select-m-Mqwxu3.cjs +2 -0
  156. package/dist/select-m-Mqwxu3.cjs.map +1 -0
  157. package/dist/separator-DBUivkHq.cjs +2 -0
  158. package/dist/separator-DBUivkHq.cjs.map +1 -0
  159. package/dist/separator-DsfoJx-2.js +395 -0
  160. package/dist/separator-DsfoJx-2.js.map +1 -0
  161. package/dist/sheet-BVWCpq7E.js +84 -0
  162. package/dist/sheet-BVWCpq7E.js.map +1 -0
  163. package/dist/sheet-mKiFLVnK.cjs +2 -0
  164. package/dist/sheet-mKiFLVnK.cjs.map +1 -0
  165. package/dist/skeleton-BSwwYaQU.cjs +2 -0
  166. package/dist/skeleton-BSwwYaQU.cjs.map +1 -0
  167. package/dist/skeleton-BmGbfJw3.js +9 -0
  168. package/dist/skeleton-BmGbfJw3.js.map +1 -0
  169. package/dist/sortable.esm-Blhf_jh1.js +3391 -0
  170. package/dist/sortable.esm-Blhf_jh1.js.map +1 -0
  171. package/dist/sortable.esm-DcQYlXi3.cjs +6 -0
  172. package/dist/sortable.esm-DcQYlXi3.cjs.map +1 -0
  173. package/dist/sparkline-chart-Da-ehDGv.js +21082 -0
  174. package/dist/sparkline-chart-Da-ehDGv.js.map +1 -0
  175. package/dist/sparkline-chart-ca3uTzVK.cjs +68 -0
  176. package/dist/sparkline-chart-ca3uTzVK.cjs.map +1 -0
  177. package/dist/trending-up-D3Nfrhi3.cjs +2 -0
  178. package/dist/trending-up-D3Nfrhi3.cjs.map +1 -0
  179. package/dist/trending-up-DPwlYzQb.js +9 -0
  180. package/dist/trending-up-DPwlYzQb.js.map +1 -0
  181. package/dist/ui.css +1 -0
  182. package/dist/use-formatters-d97RVcmg.cjs +2 -0
  183. package/dist/use-formatters-d97RVcmg.cjs.map +1 -0
  184. package/dist/use-formatters-l1_2c8z0.js +6682 -0
  185. package/dist/use-formatters-l1_2c8z0.js.map +1 -0
  186. package/dist/use-local-storage-BjlrKzE-.js +42 -0
  187. package/dist/use-local-storage-BjlrKzE-.js.map +1 -0
  188. package/dist/use-local-storage-q-1odzIu.cjs +2 -0
  189. package/dist/use-local-storage-q-1odzIu.cjs.map +1 -0
  190. package/dist/use-mobile-C-LMK4T8.js +15 -0
  191. package/dist/use-mobile-C-LMK4T8.js.map +1 -0
  192. package/dist/use-mobile-DY7TJ5lx.cjs +2 -0
  193. package/dist/use-mobile-DY7TJ5lx.cjs.map +1 -0
  194. package/dist/use-toast-DG2qdYhl.js +97 -0
  195. package/dist/use-toast-DG2qdYhl.js.map +1 -0
  196. package/dist/use-toast-DxZJ8uUm.cjs +2 -0
  197. package/dist/use-toast-DxZJ8uUm.cjs.map +1 -0
  198. package/dist/utils/index.cjs.js +2 -0
  199. package/dist/utils/index.cjs.js.map +1 -0
  200. package/dist/utils/index.es.js +5 -0
  201. package/dist/utils/index.es.js.map +1 -0
  202. package/dist/welcome-card-CPolYl1D.cjs +2 -0
  203. package/dist/welcome-card-CPolYl1D.cjs.map +1 -0
  204. package/dist/welcome-card-CxMJZ8bv.js +963 -0
  205. package/dist/welcome-card-CxMJZ8bv.js.map +1 -0
  206. package/package.json +179 -0
@@ -0,0 +1,1036 @@
1
+ import { jsx as e, jsxs as r, Fragment as de } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { c as N } from "./index-CwJPJKOE.js";
4
+ import { u as ce } from "./use-mobile-C-LMK4T8.js";
5
+ import { S as me, e as ue } from "./sheet-BVWCpq7E.js";
6
+ import { a as he, b as W, D as pe, j as fe, e as xe, s as ge, K as be, P as ye, S as Ne, v as ve, u as we, C as ke } from "./sortable.esm-Blhf_jh1.js";
7
+ import { B as L, a as I, S as E, d as Ce } from "./scroll-area-DQeqDp3Y.js";
8
+ import { I as De, D as K, a as Q, b as q, c as j, g as $ } from "./input-D4AoiWxo.js";
9
+ import { C as X, e as Y } from "./card-K4fxyYwE.js";
10
+ import { C as G } from "./checkbox-CpOq5hkT.js";
11
+ import { u as F } from "./use-formatters-l1_2c8z0.js";
12
+ import { c as T } from "./createLucideIcon-BbeNo6vq.js";
13
+ import { C as Se } from "./calendar-ChJkFXXr.js";
14
+ import { S as Me } from "./index-l828OqQN.js";
15
+ import { P as Z } from "./plus-CJD68KQD.js";
16
+ import { E as _ } from "./ellipsis-CiKEaUNP.js";
17
+ const Ie = T("Filter", [
18
+ ["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
19
+ ]);
20
+ const Pe = T("GripVertical", [
21
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
22
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
23
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
24
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
25
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
26
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
27
+ ]);
28
+ const Re = T("LayoutGrid", [
29
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
30
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
31
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
32
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
33
+ ]);
34
+ const Le = T("List", [
35
+ ["line", { x1: "8", x2: "21", y1: "6", y2: "6", key: "7ey8pc" }],
36
+ ["line", { x1: "8", x2: "21", y1: "12", y2: "12", key: "rjfblc" }],
37
+ ["line", { x1: "8", x2: "21", y1: "18", y2: "18", key: "c3b1m8" }],
38
+ ["line", { x1: "3", x2: "3.01", y1: "6", y2: "6", key: "1g7gq3" }],
39
+ ["line", { x1: "3", x2: "3.01", y1: "12", y2: "12", key: "1pjlvk" }],
40
+ ["line", { x1: "3", x2: "3.01", y1: "18", y2: "18", key: "28t2mc" }]
41
+ ]);
42
+ const je = T("Table2", [
43
+ [
44
+ "path",
45
+ {
46
+ d: "M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",
47
+ key: "gugj83"
48
+ }
49
+ ]
50
+ ]), Fe = l.forwardRef(
51
+ ({ className: i, children: s, ...n }, o) => /* @__PURE__ */ e(
52
+ "div",
53
+ {
54
+ ref: o,
55
+ className: N("flex min-h-screen w-full flex-col bg-background", i),
56
+ ...n,
57
+ children: s
58
+ }
59
+ )
60
+ );
61
+ Fe.displayName = "AppShell";
62
+ const Ee = l.forwardRef(
63
+ ({ className: i, ...s }, n) => /* @__PURE__ */ e(
64
+ "header",
65
+ {
66
+ ref: n,
67
+ className: N(
68
+ "sticky top-0 z-50 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6",
69
+ i
70
+ ),
71
+ ...s
72
+ }
73
+ )
74
+ );
75
+ Ee.displayName = "AppShellHeader";
76
+ const Te = l.forwardRef(
77
+ ({ className: i, ...s }, n) => /* @__PURE__ */ e(
78
+ "main",
79
+ {
80
+ ref: n,
81
+ className: N("flex flex-1 flex-col gap-4 p-4 md:gap-8 md:p-6", i),
82
+ ...s
83
+ }
84
+ )
85
+ );
86
+ Te.displayName = "AppShellMain";
87
+ const Oe = l.forwardRef(
88
+ ({ className: i, ...s }, n) => /* @__PURE__ */ e(
89
+ "footer",
90
+ {
91
+ ref: n,
92
+ className: N("border-t bg-background px-4 py-6 md:px-6", i),
93
+ ...s
94
+ }
95
+ )
96
+ );
97
+ Oe.displayName = "AppShellFooter";
98
+ const ze = l.forwardRef(
99
+ ({ className: i, heading: s, description: n, actions: o, children: d, ...u }, m) => /* @__PURE__ */ r(
100
+ "div",
101
+ {
102
+ ref: m,
103
+ className: N("flex flex-col gap-4 md:flex-row md:items-center md:justify-between", i),
104
+ ...u,
105
+ children: [
106
+ /* @__PURE__ */ r("div", { className: "space-y-1", children: [
107
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight md:text-3xl", children: s }),
108
+ n && /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: n })
109
+ ] }),
110
+ o && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: o }),
111
+ d
112
+ ]
113
+ }
114
+ )
115
+ );
116
+ ze.displayName = "PageHeader";
117
+ const ee = l.createContext(null);
118
+ function ae() {
119
+ const i = l.useContext(ee);
120
+ if (!i)
121
+ throw new Error("useDashboardLayout must be used within a DashboardLayout.");
122
+ return i;
123
+ }
124
+ const Ae = l.forwardRef(
125
+ ({
126
+ className: i,
127
+ children: s,
128
+ defaultSidebarOpen: n = !0,
129
+ defaultSidebarCollapsed: o = !1,
130
+ sidebarWidth: d = "16rem",
131
+ sidebarCollapsedWidth: u = "4rem",
132
+ ...m
133
+ }, v) => {
134
+ const b = ce(), [k, f] = l.useState(n), [g, y] = l.useState(o), x = l.useCallback(() => {
135
+ b ? f((c) => !c) : y((c) => !c);
136
+ }, [b]);
137
+ l.useEffect(() => {
138
+ const c = (h) => {
139
+ h.key === "b" && (h.metaKey || h.ctrlKey) && (h.preventDefault(), x());
140
+ };
141
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
142
+ }, [x]);
143
+ const C = l.useMemo(
144
+ () => ({
145
+ sidebarOpen: k,
146
+ setSidebarOpen: f,
147
+ sidebarCollapsed: g,
148
+ setSidebarCollapsed: y,
149
+ isMobile: b,
150
+ toggleSidebar: x
151
+ }),
152
+ [k, g, b, x]
153
+ );
154
+ return /* @__PURE__ */ e(ee.Provider, { value: C, children: /* @__PURE__ */ e(
155
+ "div",
156
+ {
157
+ ref: v,
158
+ style: {
159
+ "--sidebar-width": d,
160
+ "--sidebar-collapsed-width": u
161
+ },
162
+ className: N("flex min-h-screen w-full bg-background", i),
163
+ ...m,
164
+ children: s
165
+ }
166
+ ) });
167
+ }
168
+ );
169
+ Ae.displayName = "DashboardLayout";
170
+ const He = l.forwardRef(
171
+ ({ className: i, children: s, ...n }, o) => {
172
+ const { sidebarOpen: d, setSidebarOpen: u, sidebarCollapsed: m, isMobile: v } = ae();
173
+ return v ? /* @__PURE__ */ e(me, { open: d, onOpenChange: u, children: /* @__PURE__ */ e(
174
+ ue,
175
+ {
176
+ side: "left",
177
+ className: "w-[var(--sidebar-width)] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
178
+ children: /* @__PURE__ */ e("aside", { className: "flex h-full w-full flex-col", children: s })
179
+ }
180
+ ) }) : /* @__PURE__ */ e(
181
+ "aside",
182
+ {
183
+ ref: o,
184
+ "data-collapsed": m,
185
+ className: N(
186
+ "fixed inset-y-0 left-0 z-30 flex h-screen flex-col border-r bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-in-out",
187
+ m ? "w-[var(--sidebar-collapsed-width)]" : "w-[var(--sidebar-width)]",
188
+ i
189
+ ),
190
+ ...n,
191
+ children: s
192
+ }
193
+ );
194
+ }
195
+ );
196
+ He.displayName = "DashboardSidebar";
197
+ const Be = l.forwardRef(
198
+ ({ className: i, children: s, ...n }, o) => {
199
+ const { sidebarCollapsed: d, isMobile: u } = ae();
200
+ return /* @__PURE__ */ e(
201
+ "div",
202
+ {
203
+ ref: o,
204
+ className: N(
205
+ "flex flex-1 flex-col transition-[margin-left] duration-200 ease-in-out",
206
+ !u && (d ? "ml-[var(--sidebar-collapsed-width)]" : "ml-[var(--sidebar-width)]"),
207
+ i
208
+ ),
209
+ ...n,
210
+ children: s
211
+ }
212
+ );
213
+ }
214
+ );
215
+ Be.displayName = "DashboardContent";
216
+ const Ve = l.forwardRef(
217
+ ({ className: i, children: s, ...n }, o) => /* @__PURE__ */ e(
218
+ "header",
219
+ {
220
+ ref: o,
221
+ className: N(
222
+ "sticky top-0 z-20 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6",
223
+ i
224
+ ),
225
+ ...n,
226
+ children: s
227
+ }
228
+ )
229
+ );
230
+ Ve.displayName = "DashboardHeader";
231
+ const Ge = l.forwardRef(
232
+ ({ className: i, children: s, ...n }, o) => /* @__PURE__ */ e(
233
+ "main",
234
+ {
235
+ ref: o,
236
+ className: N("flex-1 overflow-auto p-4 md:p-6", i),
237
+ ...n,
238
+ children: s
239
+ }
240
+ )
241
+ );
242
+ Ge.displayName = "DashboardMain";
243
+ const Ke = l.forwardRef(
244
+ ({ className: i, children: s, ...n }, o) => /* @__PURE__ */ e(
245
+ "footer",
246
+ {
247
+ ref: o,
248
+ className: N("border-t bg-background px-4 py-4 md:px-6", i),
249
+ ...n,
250
+ children: s
251
+ }
252
+ )
253
+ );
254
+ Ke.displayName = "DashboardFooter";
255
+ const te = l.createContext(null);
256
+ function P() {
257
+ const i = l.useContext(te);
258
+ if (!i)
259
+ throw new Error("usePipeline must be used within a Pipeline component");
260
+ return i;
261
+ }
262
+ const Qe = l.forwardRef(
263
+ ({
264
+ className: i,
265
+ stages: s,
266
+ items: n,
267
+ defaultView: o = "kanban",
268
+ view: d,
269
+ onViewChange: u,
270
+ onItemMove: m,
271
+ onItemClick: v,
272
+ onItemAdd: b,
273
+ onItemEdit: k,
274
+ onItemDelete: f,
275
+ children: g,
276
+ ...y
277
+ }, x) => {
278
+ const [C, c] = l.useState(o), [h, a] = l.useState([]), [t, w] = l.useState(""), [M, H] = l.useState(), O = d ?? C, B = (D) => {
279
+ d === void 0 && c(D), u?.(D);
280
+ }, z = l.useMemo(() => {
281
+ if (!t) return n;
282
+ const D = t.toLowerCase();
283
+ return n.filter(
284
+ (S) => S.title.toLowerCase().includes(D) || S.company?.toLowerCase().includes(D) || S.owner?.name.toLowerCase().includes(D)
285
+ );
286
+ }, [n, t]), p = l.useMemo(
287
+ () => ({
288
+ view: O,
289
+ setView: B,
290
+ stages: s,
291
+ items: z,
292
+ selectedItems: h,
293
+ setSelectedItems: a,
294
+ onItemMove: m,
295
+ onItemClick: v,
296
+ onItemAdd: b,
297
+ onItemEdit: k,
298
+ onItemDelete: f,
299
+ searchQuery: t,
300
+ setSearchQuery: w,
301
+ groupBy: M,
302
+ setGroupBy: H
303
+ }),
304
+ [
305
+ O,
306
+ s,
307
+ z,
308
+ h,
309
+ t,
310
+ M,
311
+ m,
312
+ v,
313
+ b,
314
+ k,
315
+ f
316
+ ]
317
+ );
318
+ return /* @__PURE__ */ e(te.Provider, { value: p, children: /* @__PURE__ */ e(
319
+ "div",
320
+ {
321
+ ref: x,
322
+ className: N("flex h-full flex-col", i),
323
+ ...y,
324
+ children: g
325
+ }
326
+ ) });
327
+ }
328
+ );
329
+ Qe.displayName = "Pipeline";
330
+ const qe = l.forwardRef(
331
+ ({
332
+ className: i,
333
+ showViewSelector: s = !0,
334
+ showSearch: n = !0,
335
+ showAddButton: o = !0,
336
+ addButtonLabel: d,
337
+ onAdd: u,
338
+ title: m,
339
+ actions: v,
340
+ ...b
341
+ }, k) => {
342
+ const { view: f, setView: g, searchQuery: y, setSearchQuery: x, selectedItems: C } = P(), { t: c } = F(), h = [
343
+ { value: "kanban", icon: /* @__PURE__ */ e(Re, { className: "h-4 w-4" }), label: "Kanban" },
344
+ { value: "list", icon: /* @__PURE__ */ e(Le, { className: "h-4 w-4" }), label: c("calendar.agenda") },
345
+ { value: "table", icon: /* @__PURE__ */ e(je, { className: "h-4 w-4" }), label: "Table" },
346
+ { value: "timeline", icon: /* @__PURE__ */ e(Se, { className: "h-4 w-4" }), label: "Timeline" }
347
+ ];
348
+ return /* @__PURE__ */ r(
349
+ "div",
350
+ {
351
+ ref: k,
352
+ className: N(
353
+ "flex flex-wrap items-center justify-between gap-4 border-b bg-background p-4",
354
+ i
355
+ ),
356
+ ...b,
357
+ children: [
358
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-4", children: [
359
+ m && /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: m }),
360
+ C.length > 0 && /* @__PURE__ */ r(L, { variant: "secondary", children: [
361
+ C.length,
362
+ " selected"
363
+ ] })
364
+ ] }),
365
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
366
+ n && /* @__PURE__ */ r("div", { className: "relative", children: [
367
+ /* @__PURE__ */ e(Me, { className: "absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
368
+ /* @__PURE__ */ e(
369
+ De,
370
+ {
371
+ placeholder: c("common.search"),
372
+ value: y,
373
+ onChange: (a) => x(a.target.value),
374
+ className: "h-9 w-[200px] pl-8"
375
+ }
376
+ )
377
+ ] }),
378
+ s && /* @__PURE__ */ e("div", { className: "flex items-center rounded-md border bg-muted/50 p-1", children: h.map((a) => /* @__PURE__ */ e(
379
+ I,
380
+ {
381
+ variant: f === a.value ? "secondary" : "ghost",
382
+ size: "sm",
383
+ className: "h-7 px-2",
384
+ onClick: () => g(a.value),
385
+ title: a.label,
386
+ children: a.icon
387
+ },
388
+ a.value
389
+ )) }),
390
+ /* @__PURE__ */ r(I, { variant: "outline", size: "sm", className: "h-9", children: [
391
+ /* @__PURE__ */ e(Ie, { className: "mr-2 h-4 w-4" }),
392
+ c("common.filter")
393
+ ] }),
394
+ v,
395
+ o && /* @__PURE__ */ r(I, { size: "sm", className: "h-9", onClick: u, children: [
396
+ /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4" }),
397
+ d || c("common.create")
398
+ ] })
399
+ ] })
400
+ ]
401
+ }
402
+ );
403
+ }
404
+ );
405
+ qe.displayName = "PipelineHeader";
406
+ const $e = l.forwardRef(
407
+ ({ className: i, children: s, ...n }, o) => {
408
+ const { view: d } = P();
409
+ return /* @__PURE__ */ e("div", { ref: o, className: N("flex-1 overflow-hidden", i), ...n, children: s || /* @__PURE__ */ r(de, { children: [
410
+ d === "kanban" && /* @__PURE__ */ e(re, {}),
411
+ d === "list" && /* @__PURE__ */ e(se, {}),
412
+ d === "table" && /* @__PURE__ */ e(le, {}),
413
+ d === "timeline" && /* @__PURE__ */ e(ne, {})
414
+ ] }) });
415
+ }
416
+ );
417
+ $e.displayName = "PipelineContent";
418
+ const _e = l.memo(function({
419
+ item: s,
420
+ stageId: n,
421
+ renderItem: o,
422
+ defaultRenderItem: d,
423
+ onItemClick: u
424
+ }) {
425
+ const {
426
+ attributes: m,
427
+ listeners: v,
428
+ setNodeRef: b,
429
+ transform: k,
430
+ transition: f,
431
+ isDragging: g
432
+ } = we({
433
+ id: s.id,
434
+ data: {
435
+ type: "item",
436
+ item: s,
437
+ stageId: n
438
+ }
439
+ }), y = {
440
+ transform: ke.Transform.toString(k),
441
+ transition: f,
442
+ opacity: g ? 0.5 : 1,
443
+ cursor: "grab"
444
+ };
445
+ return /* @__PURE__ */ e(
446
+ "div",
447
+ {
448
+ ref: b,
449
+ style: y,
450
+ ...m,
451
+ ...v,
452
+ onClick: (x) => {
453
+ x.stopPropagation(), u?.(s);
454
+ },
455
+ children: o ? o(s, n) : d(s)
456
+ }
457
+ );
458
+ }), Je = l.memo(function({
459
+ stage: s,
460
+ items: n,
461
+ columnWidth: o,
462
+ showAddButton: d,
463
+ onItemAdd: u,
464
+ onItemClick: m,
465
+ renderItem: v,
466
+ defaultRenderItem: b,
467
+ getStageTotal: k,
468
+ formatCurrency: f,
469
+ t: g
470
+ }) {
471
+ const y = l.useMemo(() => n.map((x) => x.id), [n]);
472
+ return /* @__PURE__ */ r(
473
+ "div",
474
+ {
475
+ className: "flex shrink-0 flex-col rounded-lg bg-muted/30",
476
+ style: { width: o },
477
+ children: [
478
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between p-3 border-b", children: [
479
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
480
+ s.color && /* @__PURE__ */ e(
481
+ "div",
482
+ {
483
+ className: "h-3 w-3 rounded-full",
484
+ style: { backgroundColor: s.color }
485
+ }
486
+ ),
487
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: s.name }),
488
+ /* @__PURE__ */ e(L, { variant: "secondary", className: "text-xs", children: n.length })
489
+ ] }),
490
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
491
+ d && u && /* @__PURE__ */ e(
492
+ I,
493
+ {
494
+ variant: "ghost",
495
+ size: "icon",
496
+ className: "h-6 w-6",
497
+ onClick: () => u(s.id),
498
+ children: /* @__PURE__ */ e(Z, { className: "h-4 w-4" })
499
+ }
500
+ ),
501
+ /* @__PURE__ */ r(K, { children: [
502
+ /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(I, { variant: "ghost", size: "icon", className: "h-6 w-6", children: /* @__PURE__ */ e(_, { className: "h-4 w-4" }) }) }),
503
+ /* @__PURE__ */ r(q, { align: "end", children: [
504
+ /* @__PURE__ */ e(j, { children: g("common.edit") }),
505
+ /* @__PURE__ */ e($, {}),
506
+ /* @__PURE__ */ e(j, { className: "text-destructive", children: g("common.delete") })
507
+ ] })
508
+ ] })
509
+ ] })
510
+ ] }),
511
+ /* @__PURE__ */ r("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: [
512
+ g("deal.value"),
513
+ ":",
514
+ " ",
515
+ /* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: f(k(s.id), {
516
+ minimumFractionDigits: 0,
517
+ maximumFractionDigits: 0
518
+ }) })
519
+ ] }),
520
+ /* @__PURE__ */ e(E, { className: "flex-1", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-2 p-2 min-h-[100px]", children: [
521
+ /* @__PURE__ */ e(Ne, { items: y, strategy: ve, children: n.map((x) => /* @__PURE__ */ e(
522
+ _e,
523
+ {
524
+ item: x,
525
+ stageId: s.id,
526
+ renderItem: v,
527
+ defaultRenderItem: b,
528
+ onItemClick: m
529
+ },
530
+ x.id
531
+ )) }),
532
+ n.length === 0 && /* @__PURE__ */ e("div", { className: "py-8 text-center text-sm text-muted-foreground", children: g("common.noData") })
533
+ ] }) })
534
+ ]
535
+ }
536
+ );
537
+ }), re = l.forwardRef(
538
+ ({ className: i, columnWidth: s = 320, showAddButton: n = !0, renderItem: o, ...d }, u) => {
539
+ const { stages: m, items: v, onItemMove: b, onItemClick: k, onItemAdd: f } = P(), { formatCurrency: g, formatDate: y, t: x } = F(), [C, c] = l.useState(null), h = he(
540
+ W(ye, {
541
+ activationConstraint: {
542
+ delay: 150,
543
+ tolerance: 5
544
+ }
545
+ }),
546
+ W(be, {
547
+ coordinateGetter: ge
548
+ })
549
+ ), a = l.useMemo(() => {
550
+ const p = {};
551
+ return m.forEach((D) => {
552
+ p[D.id] = v.filter((S) => S.stageId === D.id);
553
+ }), p;
554
+ }, [m, v]), t = l.useCallback(
555
+ (p) => a[p]?.reduce((D, S) => D + (S.value || 0), 0) || 0,
556
+ [a]
557
+ ), w = {
558
+ low: "bg-muted text-muted-foreground",
559
+ medium: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",
560
+ high: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"
561
+ }, M = l.useCallback(
562
+ (p) => /* @__PURE__ */ e(X, { className: "cursor-pointer transition-all hover:shadow-md", children: /* @__PURE__ */ r(Y, { className: "p-3 space-y-2", children: [
563
+ /* @__PURE__ */ r("div", { className: "flex items-start justify-between", children: [
564
+ /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
565
+ /* @__PURE__ */ e("h4", { className: "font-medium text-sm truncate", children: p.title }),
566
+ p.company && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground truncate", children: p.company })
567
+ ] }),
568
+ p.priority && /* @__PURE__ */ e(L, { className: N("text-[10px] ml-2", w[p.priority]), children: p.priority })
569
+ ] }),
570
+ p.value !== void 0 && /* @__PURE__ */ e("div", { className: "text-sm font-semibold", children: g(p.value, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) }),
571
+ /* @__PURE__ */ r("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
572
+ p.dueDate && /* @__PURE__ */ e("span", { children: y(p.dueDate) }),
573
+ p.owner && /* @__PURE__ */ e("span", { className: "truncate max-w-[100px]", children: p.owner.name })
574
+ ] }),
575
+ p.probability !== void 0 && /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
576
+ /* @__PURE__ */ e("div", { className: "flex-1 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ e(
577
+ "div",
578
+ {
579
+ className: "h-full bg-primary rounded-full",
580
+ style: { width: `${p.probability}%` }
581
+ }
582
+ ) }),
583
+ /* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground", children: [
584
+ p.probability,
585
+ "%"
586
+ ] })
587
+ ] })
588
+ ] }) }),
589
+ [g, y, w]
590
+ ), H = l.useCallback(
591
+ (p) => {
592
+ const { active: D } = p, S = D.data.current;
593
+ S?.item && c(S.item);
594
+ },
595
+ []
596
+ ), O = l.useCallback((p) => {
597
+ }, []), B = l.useCallback(
598
+ (p) => {
599
+ const { active: D, over: S } = p;
600
+ if (c(null), !S) return;
601
+ const V = D.data.current, A = S.data.current;
602
+ if (!V) return;
603
+ const ie = V.item, J = V.stageId;
604
+ let R = null;
605
+ if (A?.type === "item")
606
+ R = A.stageId;
607
+ else if (A?.type === "column")
608
+ R = A.stageId;
609
+ else {
610
+ const U = v.find((oe) => oe.id === S.id);
611
+ U && (R = U.stageId);
612
+ }
613
+ R && J !== R && b?.(ie.id, J, R);
614
+ },
615
+ [v, b]
616
+ ), z = l.useMemo(
617
+ () => [...m].sort((p, D) => p.order - D.order),
618
+ [m]
619
+ );
620
+ return /* @__PURE__ */ e("div", { ref: u, className: N("h-full", i), ...d, children: /* @__PURE__ */ r(
621
+ pe,
622
+ {
623
+ sensors: h,
624
+ collisionDetection: fe,
625
+ onDragStart: H,
626
+ onDragOver: O,
627
+ onDragEnd: B,
628
+ children: [
629
+ /* @__PURE__ */ r(E, { className: "h-full", children: [
630
+ /* @__PURE__ */ e("div", { className: "flex gap-4 p-4 h-full", children: z.map((p) => /* @__PURE__ */ e(
631
+ Je,
632
+ {
633
+ stage: p,
634
+ items: a[p.id] || [],
635
+ columnWidth: s,
636
+ showAddButton: n,
637
+ onItemAdd: f,
638
+ onItemClick: k,
639
+ renderItem: o,
640
+ defaultRenderItem: M,
641
+ getStageTotal: t,
642
+ formatCurrency: g,
643
+ t: x
644
+ },
645
+ p.id
646
+ )) }),
647
+ /* @__PURE__ */ e(Ce, { orientation: "horizontal" })
648
+ ] }),
649
+ /* @__PURE__ */ e(xe, { dropAnimation: {
650
+ duration: 200,
651
+ easing: "cubic-bezier(0.18, 0.67, 0.6, 1.22)"
652
+ }, children: C ? /* @__PURE__ */ e("div", { className: "opacity-90 shadow-xl rotate-3 scale-105", children: o ? o(C, C.stageId) : M(C) }) : null })
653
+ ]
654
+ }
655
+ ) });
656
+ }
657
+ );
658
+ re.displayName = "PipelineKanban";
659
+ const se = l.forwardRef(
660
+ ({ className: i, renderItem: s, ...n }, o) => {
661
+ const { stages: d, items: u, selectedItems: m, setSelectedItems: v, onItemClick: b, onItemEdit: k, onItemDelete: f } = P(), { formatCurrency: g, formatDate: y, t: x } = F(), C = l.useMemo(() => {
662
+ const t = {};
663
+ return d.forEach((w) => {
664
+ t[w.id] = u.filter((M) => M.stageId === w.id);
665
+ }), t;
666
+ }, [d, u]), c = (t) => {
667
+ m.includes(t) ? v(m.filter((w) => w !== t)) : v([...m, t]);
668
+ }, h = {
669
+ low: "bg-muted text-muted-foreground",
670
+ medium: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",
671
+ high: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"
672
+ }, a = (t, w) => /* @__PURE__ */ r(
673
+ "div",
674
+ {
675
+ className: N(
676
+ "flex items-center gap-4 rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50",
677
+ m.includes(t.id) && "bg-muted/50 border-primary"
678
+ ),
679
+ children: [
680
+ /* @__PURE__ */ e(
681
+ G,
682
+ {
683
+ checked: m.includes(t.id),
684
+ onCheckedChange: () => c(t.id)
685
+ }
686
+ ),
687
+ /* @__PURE__ */ e(Pe, { className: "h-4 w-4 text-muted-foreground cursor-grab" }),
688
+ /* @__PURE__ */ r("div", { className: "flex-1 min-w-0 cursor-pointer", onClick: () => b?.(t), children: [
689
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-1", children: [
690
+ /* @__PURE__ */ e("h4", { className: "font-medium truncate", children: t.title }),
691
+ t.priority && /* @__PURE__ */ e(L, { className: N("text-xs", h[t.priority]), children: t.priority })
692
+ ] }),
693
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-4 text-sm text-muted-foreground", children: [
694
+ t.company && /* @__PURE__ */ e("span", { children: t.company }),
695
+ t.owner && /* @__PURE__ */ e("span", { children: t.owner.name })
696
+ ] })
697
+ ] }),
698
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-4", children: [
699
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
700
+ w.color && /* @__PURE__ */ e(
701
+ "div",
702
+ {
703
+ className: "h-2 w-2 rounded-full",
704
+ style: { backgroundColor: w.color }
705
+ }
706
+ ),
707
+ /* @__PURE__ */ e("span", { className: "text-sm", children: w.name })
708
+ ] }),
709
+ t.value !== void 0 && /* @__PURE__ */ e("div", { className: "font-semibold min-w-[100px] text-right", children: g(t.value, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) }),
710
+ t.dueDate && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground min-w-[100px]", children: y(t.dueDate) }),
711
+ /* @__PURE__ */ r(K, { children: [
712
+ /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(I, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ e(_, { className: "h-4 w-4" }) }) }),
713
+ /* @__PURE__ */ r(q, { align: "end", children: [
714
+ /* @__PURE__ */ e(j, { onClick: () => k?.(t), children: x("common.edit") }),
715
+ /* @__PURE__ */ e($, {}),
716
+ /* @__PURE__ */ e(
717
+ j,
718
+ {
719
+ className: "text-destructive",
720
+ onClick: () => f?.(t.id),
721
+ children: x("common.delete")
722
+ }
723
+ )
724
+ ] })
725
+ ] })
726
+ ] })
727
+ ]
728
+ }
729
+ );
730
+ return /* @__PURE__ */ e("div", { ref: o, className: N("h-full", i), ...n, children: /* @__PURE__ */ e(E, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "p-4 space-y-6", children: d.sort((t, w) => t.order - w.order).map((t) => /* @__PURE__ */ r("div", { children: [
731
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2 mb-3", children: [
732
+ t.color && /* @__PURE__ */ e(
733
+ "div",
734
+ {
735
+ className: "h-3 w-3 rounded-full",
736
+ style: { backgroundColor: t.color }
737
+ }
738
+ ),
739
+ /* @__PURE__ */ e("h3", { className: "font-semibold", children: t.name }),
740
+ /* @__PURE__ */ e(L, { variant: "secondary", children: C[t.id]?.length || 0 })
741
+ ] }),
742
+ /* @__PURE__ */ r("div", { className: "space-y-2", children: [
743
+ C[t.id]?.map(
744
+ (w) => s ? /* @__PURE__ */ e("div", { children: s(w) }, w.id) : /* @__PURE__ */ e("div", { children: a(w, t) }, w.id)
745
+ ),
746
+ C[t.id]?.length === 0 && /* @__PURE__ */ e("div", { className: "py-4 text-center text-sm text-muted-foreground border rounded-lg", children: x("common.noData") })
747
+ ] })
748
+ ] }, t.id)) }) }) });
749
+ }
750
+ );
751
+ se.displayName = "PipelineList";
752
+ const le = l.forwardRef(
753
+ ({ className: i, ...s }, n) => {
754
+ const {
755
+ stages: o,
756
+ items: d,
757
+ selectedItems: u,
758
+ setSelectedItems: m,
759
+ onItemClick: v,
760
+ onItemEdit: b,
761
+ onItemDelete: k
762
+ } = P(), { formatCurrency: f, formatDate: g, t: y } = F(), x = l.useMemo(() => {
763
+ const a = {};
764
+ return o.forEach((t) => {
765
+ a[t.id] = t;
766
+ }), a;
767
+ }, [o]), C = () => {
768
+ u.length === d.length ? m([]) : m(d.map((a) => a.id));
769
+ }, c = (a) => {
770
+ u.includes(a) ? m(u.filter((t) => t !== a)) : m([...u, a]);
771
+ }, h = {
772
+ low: "bg-muted text-muted-foreground",
773
+ medium: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",
774
+ high: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"
775
+ };
776
+ return /* @__PURE__ */ e("div", { ref: n, className: N("h-full", i), ...s, children: /* @__PURE__ */ e(E, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e("div", { className: "rounded-lg border", children: /* @__PURE__ */ r("table", { className: "w-full", children: [
777
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { className: "border-b bg-muted/50", children: [
778
+ /* @__PURE__ */ e("th", { className: "w-[40px] p-3", children: /* @__PURE__ */ e(
779
+ G,
780
+ {
781
+ checked: u.length === d.length && d.length > 0,
782
+ onCheckedChange: C
783
+ }
784
+ ) }),
785
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: "Title" }),
786
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: "Company" }),
787
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: y("deal.stage") }),
788
+ /* @__PURE__ */ e("th", { className: "text-right p-3 font-medium text-sm", children: y("deal.value") }),
789
+ /* @__PURE__ */ e("th", { className: "text-center p-3 font-medium text-sm", children: y("deal.probability") }),
790
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: "Owner" }),
791
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: y("deal.closeDate") }),
792
+ /* @__PURE__ */ e("th", { className: "text-left p-3 font-medium text-sm", children: "Priority" }),
793
+ /* @__PURE__ */ e("th", { className: "w-[60px] p-3" })
794
+ ] }) }),
795
+ /* @__PURE__ */ r("tbody", { children: [
796
+ d.map((a) => {
797
+ const t = x[a.stageId];
798
+ return /* @__PURE__ */ r(
799
+ "tr",
800
+ {
801
+ className: N(
802
+ "border-b transition-colors hover:bg-muted/50",
803
+ u.includes(a.id) && "bg-muted/50"
804
+ ),
805
+ children: [
806
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ e(
807
+ G,
808
+ {
809
+ checked: u.includes(a.id),
810
+ onCheckedChange: () => c(a.id)
811
+ }
812
+ ) }),
813
+ /* @__PURE__ */ e(
814
+ "td",
815
+ {
816
+ className: "p-3 font-medium cursor-pointer",
817
+ onClick: () => v?.(a),
818
+ children: a.title
819
+ }
820
+ ),
821
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: a.company }),
822
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
823
+ t?.color && /* @__PURE__ */ e(
824
+ "div",
825
+ {
826
+ className: "h-2 w-2 rounded-full",
827
+ style: { backgroundColor: t.color }
828
+ }
829
+ ),
830
+ /* @__PURE__ */ e("span", { children: t?.name })
831
+ ] }) }),
832
+ /* @__PURE__ */ e("td", { className: "p-3 text-right font-medium", children: a.value !== void 0 ? f(a.value, {
833
+ minimumFractionDigits: 0,
834
+ maximumFractionDigits: 0
835
+ }) : "-" }),
836
+ /* @__PURE__ */ e("td", { className: "p-3 text-center", children: a.probability !== void 0 ? `${a.probability}%` : "-" }),
837
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: a.owner?.name || "-" }),
838
+ /* @__PURE__ */ e("td", { className: "p-3 text-muted-foreground", children: a.dueDate ? g(a.dueDate) : "-" }),
839
+ /* @__PURE__ */ e("td", { className: "p-3", children: a.priority && /* @__PURE__ */ e(L, { className: N("text-xs", h[a.priority]), children: a.priority }) }),
840
+ /* @__PURE__ */ e("td", { className: "p-3", children: /* @__PURE__ */ r(K, { children: [
841
+ /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ e(I, { variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ e(_, { className: "h-4 w-4" }) }) }),
842
+ /* @__PURE__ */ r(q, { align: "end", children: [
843
+ /* @__PURE__ */ e(j, { onClick: () => b?.(a), children: y("common.edit") }),
844
+ /* @__PURE__ */ e($, {}),
845
+ /* @__PURE__ */ e(
846
+ j,
847
+ {
848
+ className: "text-destructive",
849
+ onClick: () => k?.(a.id),
850
+ children: y("common.delete")
851
+ }
852
+ )
853
+ ] })
854
+ ] }) })
855
+ ]
856
+ },
857
+ a.id
858
+ );
859
+ }),
860
+ d.length === 0 && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 10, className: "p-8 text-center text-muted-foreground", children: y("common.noData") }) })
861
+ ] })
862
+ ] }) }) }) }) });
863
+ }
864
+ );
865
+ le.displayName = "PipelineTable";
866
+ const ne = l.forwardRef(
867
+ ({ className: i, ...s }, n) => {
868
+ const { stages: o, items: d, onItemClick: u } = P(), { formatCurrency: m, formatDate: v, t: b } = F(), k = l.useMemo(() => {
869
+ const c = {};
870
+ return (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0), d.filter((a) => a.dueDate).sort((a, t) => {
871
+ const w = new Date(a.dueDate), M = new Date(t.dueDate);
872
+ return w.getTime() - M.getTime();
873
+ }).forEach((a) => {
874
+ const w = new Date(a.dueDate).toISOString().split("T")[0];
875
+ c[w] || (c[w] = []), c[w].push(a);
876
+ }), c;
877
+ }, [d]), f = l.useMemo(() => {
878
+ const c = {};
879
+ return o.forEach((h) => {
880
+ c[h.id] = h;
881
+ }), c;
882
+ }, [o]), g = Object.keys(k).sort(), y = (/* @__PURE__ */ new Date()).toISOString().split("T")[0], x = (c) => {
883
+ const h = new Date(c), a = /* @__PURE__ */ new Date();
884
+ a.setHours(0, 0, 0, 0);
885
+ const t = Math.ceil((h.getTime() - a.getTime()) / (1e3 * 60 * 60 * 24));
886
+ return t === 0 ? b("date.today") : t === 1 ? b("date.tomorrow") : t === -1 ? b("date.yesterday") : v(h, "EEEE, MMMM d");
887
+ }, C = (c) => c < y;
888
+ return /* @__PURE__ */ e("div", { ref: n, className: N("h-full", i), ...s, children: /* @__PURE__ */ e(E, { className: "h-full", children: /* @__PURE__ */ e("div", { className: "p-4", children: g.length === 0 ? /* @__PURE__ */ e("div", { className: "py-12 text-center text-muted-foreground", children: b("common.noData") }) : /* @__PURE__ */ e("div", { className: "relative space-y-8 before:absolute before:inset-0 before:ml-5 before:h-full before:w-0.5 before:-translate-x-px before:bg-border md:before:mx-auto md:before:translate-x-0", children: g.map((c) => /* @__PURE__ */ r("div", { className: "relative flex items-start gap-6 md:gap-12", children: [
889
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-10 h-10 rounded-full bg-background border-2 border-muted shrink-0 md:order-1 md:mx-auto", children: /* @__PURE__ */ e(
890
+ "div",
891
+ {
892
+ className: N(
893
+ "w-3 h-3 rounded-full",
894
+ C(c) ? "bg-destructive" : "bg-primary"
895
+ )
896
+ }
897
+ ) }),
898
+ /* @__PURE__ */ r("div", { className: "hidden md:block md:w-1/2 md:text-right md:pr-8", children: [
899
+ /* @__PURE__ */ e(
900
+ "span",
901
+ {
902
+ className: N(
903
+ "font-semibold",
904
+ C(c) && "text-destructive"
905
+ ),
906
+ children: x(c)
907
+ }
908
+ ),
909
+ /* @__PURE__ */ r("span", { className: "block text-sm text-muted-foreground", children: [
910
+ k[c].length,
911
+ " item(s)"
912
+ ] })
913
+ ] }),
914
+ /* @__PURE__ */ r("div", { className: "flex-1 md:w-1/2 md:pl-8", children: [
915
+ /* @__PURE__ */ e("div", { className: "md:hidden mb-2", children: /* @__PURE__ */ e(
916
+ "span",
917
+ {
918
+ className: N(
919
+ "font-semibold",
920
+ C(c) && "text-destructive"
921
+ ),
922
+ children: x(c)
923
+ }
924
+ ) }),
925
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: k[c].map((h) => {
926
+ const a = f[h.stageId];
927
+ return /* @__PURE__ */ e(
928
+ X,
929
+ {
930
+ className: "cursor-pointer hover:shadow-md transition-shadow",
931
+ onClick: () => u?.(h),
932
+ children: /* @__PURE__ */ r(Y, { className: "p-4", children: [
933
+ /* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-4", children: [
934
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
935
+ /* @__PURE__ */ e("h4", { className: "font-medium truncate", children: h.title }),
936
+ h.company && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: h.company })
937
+ ] }),
938
+ h.value !== void 0 && /* @__PURE__ */ e("div", { className: "font-semibold", children: m(h.value, {
939
+ minimumFractionDigits: 0,
940
+ maximumFractionDigits: 0
941
+ }) })
942
+ ] }),
943
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-3 mt-3 text-sm", children: [
944
+ a && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
945
+ a.color && /* @__PURE__ */ e(
946
+ "div",
947
+ {
948
+ className: "h-2 w-2 rounded-full",
949
+ style: { backgroundColor: a.color }
950
+ }
951
+ ),
952
+ /* @__PURE__ */ e("span", { children: a.name })
953
+ ] }),
954
+ h.owner && /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: h.owner.name })
955
+ ] })
956
+ ] })
957
+ },
958
+ h.id
959
+ );
960
+ }) })
961
+ ] })
962
+ ] }, c)) }) }) }) });
963
+ }
964
+ );
965
+ ne.displayName = "PipelineTimeline";
966
+ const Ue = l.forwardRef(
967
+ ({ className: i, ...s }, n) => {
968
+ const { stages: o, items: d } = P(), { formatCurrency: u, t: m } = F(), v = d.reduce((f, g) => f + (g.value || 0), 0), b = d.length, k = l.useMemo(() => o.map((f) => {
969
+ const g = d.filter((x) => x.stageId === f.id), y = g.reduce((x, C) => x + (C.value || 0), 0);
970
+ return {
971
+ ...f,
972
+ count: g.length,
973
+ value: y
974
+ };
975
+ }), [o, d]);
976
+ return /* @__PURE__ */ e(
977
+ "div",
978
+ {
979
+ ref: n,
980
+ className: N("border-t bg-muted/30 px-4 py-3", i),
981
+ ...s,
982
+ children: /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center justify-between gap-4", children: [
983
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-6", children: [
984
+ /* @__PURE__ */ r("div", { children: [
985
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: m("common.total") }),
986
+ /* @__PURE__ */ e("div", { className: "font-semibold", children: u(v, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) })
987
+ ] }),
988
+ /* @__PURE__ */ r("div", { children: [
989
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: m("common.items") }),
990
+ /* @__PURE__ */ e("div", { className: "font-semibold", children: b })
991
+ ] })
992
+ ] }),
993
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-4", children: k.map((f) => /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-sm", children: [
994
+ f.color && /* @__PURE__ */ e(
995
+ "div",
996
+ {
997
+ className: "h-2 w-2 rounded-full",
998
+ style: { backgroundColor: f.color }
999
+ }
1000
+ ),
1001
+ /* @__PURE__ */ r("span", { className: "text-muted-foreground", children: [
1002
+ f.name,
1003
+ ":"
1004
+ ] }),
1005
+ /* @__PURE__ */ e("span", { className: "font-medium", children: f.count })
1006
+ ] }, f.id)) })
1007
+ ] })
1008
+ }
1009
+ );
1010
+ }
1011
+ );
1012
+ Ue.displayName = "PipelineSummary";
1013
+ export {
1014
+ Fe as A,
1015
+ Ae as D,
1016
+ ze as P,
1017
+ Ee as a,
1018
+ Te as b,
1019
+ Oe as c,
1020
+ He as d,
1021
+ Be as e,
1022
+ Ve as f,
1023
+ Ge as g,
1024
+ Ke as h,
1025
+ P as i,
1026
+ Qe as j,
1027
+ qe as k,
1028
+ $e as l,
1029
+ re as m,
1030
+ se as n,
1031
+ le as o,
1032
+ ne as p,
1033
+ Ue as q,
1034
+ ae as u
1035
+ };
1036
+ //# sourceMappingURL=pipeline-D-QNSU0U.js.map