@wealthx/shadcn 1.2.1 → 1.2.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.
- package/.turbo/turbo-build.log +76 -67
- package/CHANGELOG.md +7 -0
- package/dist/{chunk-4CX4SBRO.mjs → chunk-A6AAWBPF.mjs} +1 -1
- package/dist/{chunk-WOEHFRGB.mjs → chunk-BDYZCBRT.mjs} +4 -4
- package/dist/{chunk-PMB3A7V3.mjs → chunk-EI5F6FMT.mjs} +1 -1
- package/dist/{chunk-CSDO6VBW.mjs → chunk-LBMRIB3G.mjs} +10 -10
- package/dist/{chunk-PG6K5XEC.mjs → chunk-S4QRUQNW.mjs} +1 -1
- package/dist/chunk-U4NDAF2P.mjs +207 -0
- package/dist/{chunk-DOH3EHX7.mjs → chunk-U5X52X37.mjs} +1 -1
- package/dist/{chunk-WA6O6EUR.mjs → chunk-URGMJAE3.mjs} +9 -9
- package/dist/{chunk-ZRO5JO3H.mjs → chunk-UT4KJR7V.mjs} +48 -12
- package/dist/{chunk-SYOD63OZ.mjs → chunk-VGSESELX.mjs} +2 -2
- package/dist/chunk-ZRSDX6OW.mjs +385 -0
- package/dist/chunk-ZSHYDDRB.mjs +249 -0
- package/dist/components/ui/add-column-modal.mjs +3 -3
- package/dist/components/ui/add-lead-modal.mjs +2 -2
- package/dist/components/ui/color-picker.js +417 -0
- package/dist/components/ui/color-picker.mjs +22 -0
- package/dist/components/ui/data-table.js +44 -12
- package/dist/components/ui/data-table.mjs +1 -1
- package/dist/components/ui/date-picker.mjs +2 -2
- package/dist/components/ui/form-primitives.js +4 -4
- package/dist/components/ui/form-primitives.mjs +3 -3
- package/dist/components/ui/opportunity-edit-modals.js +4 -4
- package/dist/components/ui/opportunity-edit-modals.mjs +8 -8
- package/dist/components/ui/opportunity-summary-tab.js +4 -4
- package/dist/components/ui/opportunity-summary-tab.mjs +9 -9
- package/dist/components/ui/pipeline-board.js +4 -4
- package/dist/components/ui/pipeline-board.mjs +3 -3
- package/dist/components/ui/pipeline-dialogs.js +4 -4
- package/dist/components/ui/pipeline-dialogs.mjs +5 -5
- package/dist/components/ui/sidebar-nav.js +540 -0
- package/dist/components/ui/sidebar-nav.mjs +11 -0
- package/dist/components/ui/stepper.js +283 -0
- package/dist/components/ui/stepper.mjs +18 -0
- package/dist/components/ui/toggle-group.js +4 -4
- package/dist/components/ui/toggle-group.mjs +2 -2
- package/dist/components/ui/toggle.js +4 -4
- package/dist/components/ui/toggle.mjs +1 -1
- package/dist/index.js +2141 -1292
- package/dist/index.mjs +103 -71
- package/dist/lib/typography.js +10 -10
- package/dist/lib/typography.mjs +1 -1
- package/dist/styles.css +1 -1
- package/package.json +16 -1
- package/src/components/index.tsx +41 -0
- package/src/components/ui/color-picker.tsx +307 -0
- package/src/components/ui/data-table.tsx +91 -11
- package/src/components/ui/sidebar-nav.tsx +517 -0
- package/src/components/ui/stepper.tsx +347 -0
- package/src/components/ui/toggle.tsx +4 -4
- package/src/lib/typography.ts +11 -11
- package/src/styles/globals.css +19 -19
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +3 -0
- package/dist/{chunk-KUDCQ4FI.mjs → chunk-5MEWU56Z.mjs} +3 -3
- package/dist/{chunk-PR6V5XKM.mjs → chunk-CGH4DRNG.mjs} +3 -3
- package/dist/{chunk-3WMX6KWS.mjs → chunk-Y4QFWRNR.mjs} +8 -8
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip,
|
|
3
|
+
TooltipContent,
|
|
4
|
+
TooltipProvider,
|
|
5
|
+
TooltipTrigger
|
|
6
|
+
} from "./chunk-6JQFUE5I.mjs";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "./chunk-VLQZANBF.mjs";
|
|
10
|
+
|
|
11
|
+
// src/components/ui/sidebar-nav.tsx
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import {
|
|
14
|
+
ChevronDown,
|
|
15
|
+
ChevronRight,
|
|
16
|
+
Info,
|
|
17
|
+
LogOut,
|
|
18
|
+
PanelLeftClose,
|
|
19
|
+
PanelLeftOpen
|
|
20
|
+
} from "lucide-react";
|
|
21
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
function getInitials(name) {
|
|
23
|
+
return name.split(" ").filter(Boolean).map((word) => word[0]).join("").toUpperCase().slice(0, 2);
|
|
24
|
+
}
|
|
25
|
+
function formatCurrency(value, isNetItem = false) {
|
|
26
|
+
const abs = Math.abs(value);
|
|
27
|
+
const formatted = new Intl.NumberFormat("en-AU", {
|
|
28
|
+
style: "currency",
|
|
29
|
+
currency: "AUD",
|
|
30
|
+
minimumFractionDigits: 0,
|
|
31
|
+
maximumFractionDigits: 0
|
|
32
|
+
}).format(abs);
|
|
33
|
+
if (!isNetItem) return formatted;
|
|
34
|
+
if (value > 0) return `+${formatted}`;
|
|
35
|
+
if (value < 0) return `-${formatted}`;
|
|
36
|
+
return formatted;
|
|
37
|
+
}
|
|
38
|
+
function navIconCn(isActive) {
|
|
39
|
+
return cn(
|
|
40
|
+
"shrink-0 transition-colors",
|
|
41
|
+
isActive ? "text-primary" : "text-brand-secondary-foreground/50 group-hover:text-brand-secondary-foreground"
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function NavTooltip({ label, collapsed, children }) {
|
|
45
|
+
if (!collapsed) return children;
|
|
46
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { render: children }),
|
|
48
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "right", children: label })
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
function MetricsGroup({ group }) {
|
|
52
|
+
return /* @__PURE__ */ jsx("div", { className: "border-b border-white/15 py-4 px-5 flex flex-col gap-1.5", children: group.items.map((item) => /* @__PURE__ */ jsxs(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: "flex items-center justify-between gap-2",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
"span",
|
|
60
|
+
{
|
|
61
|
+
className: cn(
|
|
62
|
+
"text-sm truncate text-brand-secondary-foreground/80",
|
|
63
|
+
item.isNetItem && "font-semibold text-brand-secondary-foreground border-b-2 border-primary pb-px"
|
|
64
|
+
),
|
|
65
|
+
children: item.name
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
item.info && /* @__PURE__ */ jsx(
|
|
69
|
+
Info,
|
|
70
|
+
{
|
|
71
|
+
size: 11,
|
|
72
|
+
strokeWidth: 2,
|
|
73
|
+
className: "shrink-0 text-brand-secondary-foreground/50"
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
"span",
|
|
79
|
+
{
|
|
80
|
+
className: cn(
|
|
81
|
+
"text-sm font-semibold tabular-nums shrink-0 text-brand-secondary-foreground",
|
|
82
|
+
item.isNetItem && item.value < 0 && "text-destructive"
|
|
83
|
+
),
|
|
84
|
+
children: formatCurrency(item.value, item.isNetItem)
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
item.name
|
|
90
|
+
)) });
|
|
91
|
+
}
|
|
92
|
+
function SidebarNavItemView({
|
|
93
|
+
item,
|
|
94
|
+
collapsed,
|
|
95
|
+
onNavigate
|
|
96
|
+
}) {
|
|
97
|
+
var _a;
|
|
98
|
+
const Icon = item.icon;
|
|
99
|
+
return /* @__PURE__ */ jsx(NavTooltip, { label: item.title, collapsed, children: /* @__PURE__ */ jsxs(
|
|
100
|
+
"button",
|
|
101
|
+
{
|
|
102
|
+
type: "button",
|
|
103
|
+
onClick: () => onNavigate == null ? void 0 : onNavigate(item.href),
|
|
104
|
+
className: cn(
|
|
105
|
+
"group flex w-full items-center gap-3 py-2.5 text-base font-medium transition-colors",
|
|
106
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
107
|
+
collapsed ? "justify-center px-2" : cn(
|
|
108
|
+
"px-3 border-l-4",
|
|
109
|
+
item.isActive ? "bg-white/15 text-brand-secondary-foreground border-primary" : "border-transparent"
|
|
110
|
+
)
|
|
111
|
+
),
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
Icon,
|
|
115
|
+
{
|
|
116
|
+
className: navIconCn((_a = item.isActive) != null ? _a : false),
|
|
117
|
+
size: 18,
|
|
118
|
+
strokeWidth: 1.75
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
!collapsed && /* @__PURE__ */ jsx("span", { className: "truncate", children: item.title })
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
) });
|
|
125
|
+
}
|
|
126
|
+
function CollapsibleNavItem({
|
|
127
|
+
item,
|
|
128
|
+
collapsed,
|
|
129
|
+
onNavigate
|
|
130
|
+
}) {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
const Icon = item.icon;
|
|
133
|
+
const hasActiveChild = (_b = (_a = item.subItems) == null ? void 0 : _a.some((sub) => sub.isActive)) != null ? _b : false;
|
|
134
|
+
const [open, setOpen] = React.useState(hasActiveChild);
|
|
135
|
+
React.useEffect(() => {
|
|
136
|
+
if (hasActiveChild) setOpen(true);
|
|
137
|
+
}, [hasActiveChild]);
|
|
138
|
+
if (collapsed) {
|
|
139
|
+
return /* @__PURE__ */ jsx(NavTooltip, { label: item.title, collapsed, children: /* @__PURE__ */ jsx(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "button",
|
|
143
|
+
onClick: () => onNavigate == null ? void 0 : onNavigate(item.href),
|
|
144
|
+
className: cn(
|
|
145
|
+
"group flex w-full items-center justify-center px-2 py-2.5 transition-colors",
|
|
146
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
147
|
+
hasActiveChild && "bg-white/15 text-brand-secondary-foreground"
|
|
148
|
+
),
|
|
149
|
+
children: /* @__PURE__ */ jsx(
|
|
150
|
+
Icon,
|
|
151
|
+
{
|
|
152
|
+
className: navIconCn(hasActiveChild),
|
|
153
|
+
size: 18,
|
|
154
|
+
strokeWidth: 1.75
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
) });
|
|
159
|
+
}
|
|
160
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
161
|
+
/* @__PURE__ */ jsxs(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
type: "button",
|
|
165
|
+
onClick: () => setOpen((prev) => !prev),
|
|
166
|
+
className: cn(
|
|
167
|
+
"group flex w-full items-center gap-3 px-3 py-2.5 text-base font-medium transition-colors",
|
|
168
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
169
|
+
"border-l-4 border-transparent",
|
|
170
|
+
hasActiveChild && "bg-white/15 text-brand-secondary-foreground border-primary"
|
|
171
|
+
),
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ jsx(
|
|
174
|
+
Icon,
|
|
175
|
+
{
|
|
176
|
+
className: navIconCn(hasActiveChild),
|
|
177
|
+
size: 18,
|
|
178
|
+
strokeWidth: 1.75
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: item.title }),
|
|
182
|
+
/* @__PURE__ */ jsx(
|
|
183
|
+
ChevronDown,
|
|
184
|
+
{
|
|
185
|
+
className: cn(
|
|
186
|
+
"ml-auto shrink-0 text-brand-secondary-foreground/40 transition-transform duration-200",
|
|
187
|
+
open && "rotate-180"
|
|
188
|
+
),
|
|
189
|
+
size: 14,
|
|
190
|
+
strokeWidth: 2
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
open && item.subItems && /* @__PURE__ */ jsx("div", { className: "ml-9 border-l border-white/15 pl-3", children: item.subItems.map((sub) => /* @__PURE__ */ jsxs(
|
|
197
|
+
"button",
|
|
198
|
+
{
|
|
199
|
+
type: "button",
|
|
200
|
+
onClick: () => onNavigate == null ? void 0 : onNavigate(sub.href),
|
|
201
|
+
className: cn(
|
|
202
|
+
"flex w-full items-center gap-2 py-1.5 pl-1 text-sm transition-colors",
|
|
203
|
+
"text-brand-secondary-foreground/50 hover:text-brand-secondary-foreground",
|
|
204
|
+
sub.isActive && "text-primary font-medium"
|
|
205
|
+
),
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ jsx(
|
|
208
|
+
ChevronRight,
|
|
209
|
+
{
|
|
210
|
+
size: 11,
|
|
211
|
+
strokeWidth: 2,
|
|
212
|
+
className: cn(
|
|
213
|
+
"shrink-0",
|
|
214
|
+
sub.isActive ? "text-primary" : "text-brand-secondary-foreground/30"
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: sub.title })
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
sub.href
|
|
222
|
+
)) })
|
|
223
|
+
] });
|
|
224
|
+
}
|
|
225
|
+
function SidebarNav({
|
|
226
|
+
items,
|
|
227
|
+
userName = "Anonymous User",
|
|
228
|
+
collapsed = false,
|
|
229
|
+
logo,
|
|
230
|
+
logoCollapsed,
|
|
231
|
+
metricsGroups,
|
|
232
|
+
onNavigate,
|
|
233
|
+
onLogout,
|
|
234
|
+
onCollapsedChange,
|
|
235
|
+
className
|
|
236
|
+
}) {
|
|
237
|
+
const [userMenuOpen, setUserMenuOpen] = React.useState(false);
|
|
238
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
|
|
239
|
+
"nav",
|
|
240
|
+
{
|
|
241
|
+
"data-slot": "sidebar-nav",
|
|
242
|
+
"data-collapsed": collapsed,
|
|
243
|
+
className: cn(
|
|
244
|
+
"flex h-full flex-col bg-brand-secondary text-brand-secondary-foreground",
|
|
245
|
+
"transition-all duration-200 ease-in-out",
|
|
246
|
+
collapsed ? "w-14" : "w-[279px]",
|
|
247
|
+
className
|
|
248
|
+
),
|
|
249
|
+
children: [
|
|
250
|
+
!collapsed && logo && /* @__PURE__ */ jsx("div", { className: "flex items-center border-b border-white/15 px-5 py-4", children: /* @__PURE__ */ jsx(
|
|
251
|
+
"img",
|
|
252
|
+
{
|
|
253
|
+
src: logo,
|
|
254
|
+
alt: "Logo",
|
|
255
|
+
className: "h-8 w-auto object-contain object-left",
|
|
256
|
+
style: { filter: "brightness(0) invert(1)" }
|
|
257
|
+
}
|
|
258
|
+
) }),
|
|
259
|
+
collapsed && logoCollapsed && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center border-b border-white/15 py-4", children: /* @__PURE__ */ jsx(
|
|
260
|
+
"img",
|
|
261
|
+
{
|
|
262
|
+
src: logoCollapsed,
|
|
263
|
+
alt: "Logo",
|
|
264
|
+
className: "h-8 w-8 object-contain",
|
|
265
|
+
style: { filter: "brightness(0) invert(1)" }
|
|
266
|
+
}
|
|
267
|
+
) }),
|
|
268
|
+
/* @__PURE__ */ jsxs("div", { className: "border-b border-white/15", children: [
|
|
269
|
+
/* @__PURE__ */ jsx(NavTooltip, { label: userName, collapsed, children: /* @__PURE__ */ jsxs(
|
|
270
|
+
"button",
|
|
271
|
+
{
|
|
272
|
+
type: "button",
|
|
273
|
+
onClick: () => !collapsed && setUserMenuOpen((prev) => !prev),
|
|
274
|
+
className: cn(
|
|
275
|
+
"group flex w-full items-center gap-3 px-5 py-5 text-base transition-colors",
|
|
276
|
+
"text-brand-secondary-foreground hover:bg-white/10",
|
|
277
|
+
collapsed && "justify-center px-2 py-4"
|
|
278
|
+
),
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center font-semibold text-xs bg-primary text-primary-foreground", children: getInitials(userName) }),
|
|
281
|
+
!collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
282
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left font-medium text-brand-secondary-foreground", children: userName }),
|
|
283
|
+
/* @__PURE__ */ jsx(
|
|
284
|
+
ChevronDown,
|
|
285
|
+
{
|
|
286
|
+
className: cn(
|
|
287
|
+
"shrink-0 text-brand-secondary-foreground/50 transition-transform duration-200",
|
|
288
|
+
userMenuOpen && "rotate-180"
|
|
289
|
+
),
|
|
290
|
+
size: 16,
|
|
291
|
+
strokeWidth: 2
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
] })
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
) }),
|
|
298
|
+
!collapsed && userMenuOpen && /* @__PURE__ */ jsx("div", { className: "border-t border-white/15 bg-black/20", children: /* @__PURE__ */ jsxs(
|
|
299
|
+
"button",
|
|
300
|
+
{
|
|
301
|
+
type: "button",
|
|
302
|
+
onClick: onLogout,
|
|
303
|
+
className: cn(
|
|
304
|
+
"flex w-full items-center gap-3 px-5 py-3 text-base",
|
|
305
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground transition-colors"
|
|
306
|
+
),
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ jsx(
|
|
309
|
+
LogOut,
|
|
310
|
+
{
|
|
311
|
+
size: 16,
|
|
312
|
+
strokeWidth: 1.75,
|
|
313
|
+
className: "shrink-0 text-destructive"
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
/* @__PURE__ */ jsx("span", { children: "Logout" })
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
) })
|
|
320
|
+
] }),
|
|
321
|
+
!collapsed && !!(metricsGroups == null ? void 0 : metricsGroups.length) && /* @__PURE__ */ jsx("div", { children: metricsGroups.map((group, i) => /* @__PURE__ */ jsx(MetricsGroup, { group }, i)) }),
|
|
322
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col overflow-y-auto py-3", children: items.map(
|
|
323
|
+
(item) => item.isCollapsible ? /* @__PURE__ */ jsx(
|
|
324
|
+
CollapsibleNavItem,
|
|
325
|
+
{
|
|
326
|
+
item,
|
|
327
|
+
collapsed,
|
|
328
|
+
onNavigate
|
|
329
|
+
},
|
|
330
|
+
item.href
|
|
331
|
+
) : /* @__PURE__ */ jsx(
|
|
332
|
+
SidebarNavItemView,
|
|
333
|
+
{
|
|
334
|
+
item,
|
|
335
|
+
collapsed,
|
|
336
|
+
onNavigate
|
|
337
|
+
},
|
|
338
|
+
item.href
|
|
339
|
+
)
|
|
340
|
+
) }),
|
|
341
|
+
onCollapsedChange && /* @__PURE__ */ jsx("div", { className: "mt-auto border-t border-white/15 bg-white/8", children: /* @__PURE__ */ jsx(
|
|
342
|
+
NavTooltip,
|
|
343
|
+
{
|
|
344
|
+
label: collapsed ? "Expand" : "Collapse",
|
|
345
|
+
collapsed,
|
|
346
|
+
children: /* @__PURE__ */ jsxs(
|
|
347
|
+
"button",
|
|
348
|
+
{
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: () => onCollapsedChange(!collapsed),
|
|
351
|
+
className: cn(
|
|
352
|
+
"flex w-full items-center gap-3 px-3 py-3 transition-colors",
|
|
353
|
+
"text-brand-secondary-foreground/80 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
354
|
+
collapsed && "justify-center px-2"
|
|
355
|
+
),
|
|
356
|
+
children: [
|
|
357
|
+
collapsed ? /* @__PURE__ */ jsx(
|
|
358
|
+
PanelLeftOpen,
|
|
359
|
+
{
|
|
360
|
+
size: 18,
|
|
361
|
+
strokeWidth: 1.75,
|
|
362
|
+
className: "shrink-0"
|
|
363
|
+
}
|
|
364
|
+
) : /* @__PURE__ */ jsx(
|
|
365
|
+
PanelLeftClose,
|
|
366
|
+
{
|
|
367
|
+
size: 18,
|
|
368
|
+
strokeWidth: 1.75,
|
|
369
|
+
className: "shrink-0"
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
!collapsed && /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Collapse" })
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
)
|
|
376
|
+
}
|
|
377
|
+
) })
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
) });
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export {
|
|
384
|
+
SidebarNav
|
|
385
|
+
};
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Popover,
|
|
3
|
+
PopoverContent,
|
|
4
|
+
PopoverTrigger
|
|
5
|
+
} from "./chunk-3GF7OVTP.mjs";
|
|
6
|
+
import {
|
|
7
|
+
Input
|
|
8
|
+
} from "./chunk-GYMYRIZP.mjs";
|
|
9
|
+
import {
|
|
10
|
+
cn
|
|
11
|
+
} from "./chunk-VLQZANBF.mjs";
|
|
12
|
+
|
|
13
|
+
// src/components/ui/color-picker.tsx
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
var COLOR_PICKER_PRESETS = [
|
|
17
|
+
// Blues
|
|
18
|
+
"#1E40AF",
|
|
19
|
+
"#2563EB",
|
|
20
|
+
"#3B82F6",
|
|
21
|
+
"#60A5FA",
|
|
22
|
+
// Purples
|
|
23
|
+
"#7C3AED",
|
|
24
|
+
"#8B5CF6",
|
|
25
|
+
"#A78BFA",
|
|
26
|
+
"#C4B5FD",
|
|
27
|
+
// Greens
|
|
28
|
+
"#15803D",
|
|
29
|
+
"#16A34A",
|
|
30
|
+
"#22C55E",
|
|
31
|
+
"#4ADE80",
|
|
32
|
+
// Reds
|
|
33
|
+
"#B91C1C",
|
|
34
|
+
"#DC2626",
|
|
35
|
+
"#EF4444",
|
|
36
|
+
"#F87171",
|
|
37
|
+
// Oranges
|
|
38
|
+
"#C2410C",
|
|
39
|
+
"#EA580C",
|
|
40
|
+
"#F97316",
|
|
41
|
+
"#FB923C",
|
|
42
|
+
// Teals
|
|
43
|
+
"#0F766E",
|
|
44
|
+
"#0D9488",
|
|
45
|
+
"#14B8A6",
|
|
46
|
+
"#2DD4BF",
|
|
47
|
+
// Neutrals
|
|
48
|
+
"#111827",
|
|
49
|
+
"#374151",
|
|
50
|
+
"#6B7280",
|
|
51
|
+
"#D1D5DB"
|
|
52
|
+
];
|
|
53
|
+
function isValidHex(value) {
|
|
54
|
+
return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(value);
|
|
55
|
+
}
|
|
56
|
+
function normalizeHex(value) {
|
|
57
|
+
const stripped = value.replace(/^#/, "");
|
|
58
|
+
return `#${stripped}`;
|
|
59
|
+
}
|
|
60
|
+
function ColorSwatch({
|
|
61
|
+
color,
|
|
62
|
+
selected,
|
|
63
|
+
size = "md",
|
|
64
|
+
onClick,
|
|
65
|
+
className
|
|
66
|
+
}) {
|
|
67
|
+
return /* @__PURE__ */ jsx(
|
|
68
|
+
"button",
|
|
69
|
+
{
|
|
70
|
+
type: "button",
|
|
71
|
+
title: color,
|
|
72
|
+
"aria-label": `Select color ${color}`,
|
|
73
|
+
"aria-pressed": selected,
|
|
74
|
+
onClick: () => onClick == null ? void 0 : onClick(color),
|
|
75
|
+
className: cn(
|
|
76
|
+
"relative shrink-0 transition-all outline-none shadow-[inset_0_0_0_1px_rgba(0,0,0,0.12)]",
|
|
77
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
78
|
+
size === "md" ? "size-7" : "size-5",
|
|
79
|
+
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background",
|
|
80
|
+
className
|
|
81
|
+
),
|
|
82
|
+
style: { backgroundColor: color }
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
function ColorPickerContent({
|
|
87
|
+
value,
|
|
88
|
+
onChange,
|
|
89
|
+
presets = COLOR_PICKER_PRESETS
|
|
90
|
+
}) {
|
|
91
|
+
const [hexInput, setHexInput] = React.useState(value);
|
|
92
|
+
React.useEffect(() => {
|
|
93
|
+
setHexInput(value);
|
|
94
|
+
}, [value]);
|
|
95
|
+
function handleHexInputChange(e) {
|
|
96
|
+
const raw = e.target.value;
|
|
97
|
+
setHexInput(raw);
|
|
98
|
+
const normalized = normalizeHex(raw);
|
|
99
|
+
if (isValidHex(normalized)) {
|
|
100
|
+
onChange(normalized);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function handleHexBlur() {
|
|
104
|
+
const normalized = normalizeHex(hexInput);
|
|
105
|
+
if (isValidHex(normalized)) {
|
|
106
|
+
setHexInput(normalized);
|
|
107
|
+
if (normalized !== value) onChange(normalized);
|
|
108
|
+
} else {
|
|
109
|
+
setHexInput(value);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const normalizedInput = normalizeHex(hexInput);
|
|
113
|
+
const isValid = isValidHex(normalizedInput);
|
|
114
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "color-picker-content", className: "flex flex-col gap-4", children: [
|
|
115
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
116
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "Presets" }),
|
|
117
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1.5", children: presets.map((color) => /* @__PURE__ */ jsx(
|
|
118
|
+
ColorSwatch,
|
|
119
|
+
{
|
|
120
|
+
color,
|
|
121
|
+
selected: value.toLowerCase() === color.toLowerCase(),
|
|
122
|
+
onClick: onChange
|
|
123
|
+
},
|
|
124
|
+
color
|
|
125
|
+
)) })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
128
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "Custom hex" }),
|
|
129
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
"label",
|
|
132
|
+
{
|
|
133
|
+
className: "relative size-9 shrink-0 cursor-pointer border border-border",
|
|
134
|
+
title: "Open color picker",
|
|
135
|
+
style: {
|
|
136
|
+
backgroundColor: isValid ? normalizedInput : value
|
|
137
|
+
},
|
|
138
|
+
children: /* @__PURE__ */ jsx(
|
|
139
|
+
"input",
|
|
140
|
+
{
|
|
141
|
+
type: "color",
|
|
142
|
+
"aria-label": "Native color picker",
|
|
143
|
+
value: isValid ? normalizedInput : value,
|
|
144
|
+
onChange: (e) => {
|
|
145
|
+
setHexInput(e.target.value);
|
|
146
|
+
onChange(e.target.value);
|
|
147
|
+
},
|
|
148
|
+
className: "absolute inset-0 h-full w-full cursor-pointer opacity-0"
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsx(
|
|
154
|
+
Input,
|
|
155
|
+
{
|
|
156
|
+
"aria-label": "Hex color value",
|
|
157
|
+
placeholder: "#000000",
|
|
158
|
+
value: hexInput,
|
|
159
|
+
onChange: handleHexInputChange,
|
|
160
|
+
onBlur: handleHexBlur,
|
|
161
|
+
maxLength: 7,
|
|
162
|
+
className: "h-9 flex-1 font-mono text-sm uppercase"
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] })
|
|
166
|
+
] })
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
function ColorPicker({
|
|
170
|
+
value: controlledValue,
|
|
171
|
+
defaultValue = "#3B82F6",
|
|
172
|
+
onChange,
|
|
173
|
+
presets,
|
|
174
|
+
disabled,
|
|
175
|
+
label,
|
|
176
|
+
className
|
|
177
|
+
}) {
|
|
178
|
+
const isControlled = controlledValue !== void 0;
|
|
179
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
180
|
+
const color = isControlled ? controlledValue : internalValue;
|
|
181
|
+
const [open, setOpen] = React.useState(false);
|
|
182
|
+
React.useEffect(() => {
|
|
183
|
+
if (disabled) setOpen(false);
|
|
184
|
+
}, [disabled]);
|
|
185
|
+
function handleChange(newColor) {
|
|
186
|
+
if (!isControlled) setInternalValue(newColor);
|
|
187
|
+
onChange == null ? void 0 : onChange(newColor);
|
|
188
|
+
}
|
|
189
|
+
return /* @__PURE__ */ jsxs(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
"data-slot": "color-picker",
|
|
193
|
+
className: cn("inline-flex flex-col gap-1.5 font-sans", className),
|
|
194
|
+
children: [
|
|
195
|
+
label && /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-foreground", children: label }),
|
|
196
|
+
/* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
197
|
+
/* @__PURE__ */ jsxs(
|
|
198
|
+
PopoverTrigger,
|
|
199
|
+
{
|
|
200
|
+
disabled,
|
|
201
|
+
className: cn(
|
|
202
|
+
"flex h-9 min-w-[140px] cursor-pointer items-center gap-2.5 border border-input bg-background px-3 text-sm outline-none transition-colors",
|
|
203
|
+
"hover:border-ring",
|
|
204
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
205
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
206
|
+
),
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ jsx(
|
|
209
|
+
"span",
|
|
210
|
+
{
|
|
211
|
+
"aria-hidden": true,
|
|
212
|
+
className: "size-5 shrink-0 border border-border/50",
|
|
213
|
+
style: { backgroundColor: color }
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs uppercase tracking-wide", children: color })
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
),
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
PopoverContent,
|
|
222
|
+
{
|
|
223
|
+
className: "w-[220px] p-4",
|
|
224
|
+
align: "start",
|
|
225
|
+
"data-shadcn-scope": true,
|
|
226
|
+
children: /* @__PURE__ */ jsx(
|
|
227
|
+
ColorPickerContent,
|
|
228
|
+
{
|
|
229
|
+
value: color,
|
|
230
|
+
onChange: handleChange,
|
|
231
|
+
presets
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
)
|
|
236
|
+
] })
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export {
|
|
243
|
+
COLOR_PICKER_PRESETS,
|
|
244
|
+
isValidHex,
|
|
245
|
+
normalizeHex,
|
|
246
|
+
ColorSwatch,
|
|
247
|
+
ColorPickerContent,
|
|
248
|
+
ColorPicker
|
|
249
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddColumnModal
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-7PYJD5JI.mjs";
|
|
3
|
+
} from "../../chunk-Y4QFWRNR.mjs";
|
|
5
4
|
import "../../chunk-FH6QVUVZ.mjs";
|
|
6
5
|
import "../../chunk-NSLMILBT.mjs";
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-7PYJD5JI.mjs";
|
|
8
7
|
import "../../chunk-XIRTEFKH.mjs";
|
|
8
|
+
import "../../chunk-GYMYRIZP.mjs";
|
|
9
9
|
import "../../chunk-2I5S2AMY.mjs";
|
|
10
10
|
import "../../chunk-DBHJ5KC3.mjs";
|
|
11
11
|
import "../../chunk-FEZKMUCF.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AddLeadModal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-CGH4DRNG.mjs";
|
|
4
4
|
import "../../chunk-RGVKLTLH.mjs";
|
|
5
5
|
import "../../chunk-7YAU5CY6.mjs";
|
|
6
|
-
import "../../chunk-GYMYRIZP.mjs";
|
|
7
6
|
import "../../chunk-XIRTEFKH.mjs";
|
|
7
|
+
import "../../chunk-GYMYRIZP.mjs";
|
|
8
8
|
import "../../chunk-2I5S2AMY.mjs";
|
|
9
9
|
import "../../chunk-DBHJ5KC3.mjs";
|
|
10
10
|
import "../../chunk-FEZKMUCF.mjs";
|