@wealthx/shadcn 1.2.0 → 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.
Files changed (110) hide show
  1. package/.turbo/turbo-build.log +93 -84
  2. package/CHANGELOG.md +13 -0
  3. package/dist/{chunk-NXA3CZ7A.mjs → chunk-4Y6R4WEC.mjs} +2 -0
  4. package/dist/{chunk-AH52LG6N.mjs → chunk-7MMXNK3C.mjs} +2 -0
  5. package/dist/{chunk-4CX4SBRO.mjs → chunk-A6AAWBPF.mjs} +1 -1
  6. package/dist/{chunk-WOEHFRGB.mjs → chunk-BDYZCBRT.mjs} +4 -4
  7. package/dist/{chunk-5QQVZTVZ.mjs → chunk-BL3DXM2X.mjs} +2 -1
  8. package/dist/{chunk-PMB3A7V3.mjs → chunk-EI5F6FMT.mjs} +1 -1
  9. package/dist/{chunk-QVKWW6KE.mjs → chunk-GGM2UYGG.mjs} +2 -1
  10. package/dist/{chunk-KMCGSZTX.mjs → chunk-JNQORUPP.mjs} +2 -1
  11. package/dist/{chunk-PJHPSRYD.mjs → chunk-K3JYD4IU.mjs} +2 -1
  12. package/dist/{chunk-CSDO6VBW.mjs → chunk-LBMRIB3G.mjs} +10 -10
  13. package/dist/{chunk-SMQ3DG25.mjs → chunk-LHYCMLVA.mjs} +2 -1
  14. package/dist/{chunk-NLCKVHWB.mjs → chunk-OPNQAVVH.mjs} +2 -1
  15. package/dist/{chunk-2SF672SZ.mjs → chunk-RYCLWMZ7.mjs} +2 -1
  16. package/dist/{chunk-PG6K5XEC.mjs → chunk-S4QRUQNW.mjs} +1 -1
  17. package/dist/{chunk-YKPROFLB.mjs → chunk-SIZMLSRU.mjs} +2 -1
  18. package/dist/{chunk-LE6YFY6D.mjs → chunk-SWGT756Z.mjs} +2 -1
  19. package/dist/{chunk-6FCGKSZX.mjs → chunk-TS2ZX2VS.mjs} +2 -0
  20. package/dist/chunk-U4NDAF2P.mjs +207 -0
  21. package/dist/{chunk-DOH3EHX7.mjs → chunk-U5X52X37.mjs} +1 -1
  22. package/dist/{chunk-WA6O6EUR.mjs → chunk-URGMJAE3.mjs} +9 -9
  23. package/dist/{chunk-ZRO5JO3H.mjs → chunk-UT4KJR7V.mjs} +48 -12
  24. package/dist/{chunk-SYOD63OZ.mjs → chunk-VGSESELX.mjs} +2 -2
  25. package/dist/{chunk-RRBS6D63.mjs → chunk-VPBN3WOO.mjs} +2 -1
  26. package/dist/chunk-ZRSDX6OW.mjs +385 -0
  27. package/dist/chunk-ZSHYDDRB.mjs +249 -0
  28. package/dist/components/ui/add-column-modal.mjs +3 -3
  29. package/dist/components/ui/add-lead-modal.mjs +2 -2
  30. package/dist/components/ui/backoffice-alert-history-chart.js +1 -1
  31. package/dist/components/ui/backoffice-alert-history-chart.mjs +1 -1
  32. package/dist/components/ui/backoffice-contact-history-chart.js +1 -1
  33. package/dist/components/ui/backoffice-contact-history-chart.mjs +1 -1
  34. package/dist/components/ui/borrowing-capacity-line-chart.js +1 -0
  35. package/dist/components/ui/borrowing-capacity-line-chart.mjs +1 -1
  36. package/dist/components/ui/cash-balance-line-chart.js +1 -0
  37. package/dist/components/ui/cash-balance-line-chart.mjs +1 -1
  38. package/dist/components/ui/cashflow-bar-chart.js +1 -1
  39. package/dist/components/ui/cashflow-bar-chart.mjs +1 -1
  40. package/dist/components/ui/color-picker.js +417 -0
  41. package/dist/components/ui/color-picker.mjs +22 -0
  42. package/dist/components/ui/data-table.js +44 -12
  43. package/dist/components/ui/data-table.mjs +1 -1
  44. package/dist/components/ui/date-picker.mjs +2 -2
  45. package/dist/components/ui/expense-bar-chart.js +1 -1
  46. package/dist/components/ui/expense-bar-chart.mjs +1 -1
  47. package/dist/components/ui/form-primitives.js +4 -4
  48. package/dist/components/ui/form-primitives.mjs +3 -3
  49. package/dist/components/ui/income-bar-chart.js +1 -1
  50. package/dist/components/ui/income-bar-chart.mjs +1 -1
  51. package/dist/components/ui/opportunity-edit-modals.js +4 -4
  52. package/dist/components/ui/opportunity-edit-modals.mjs +8 -8
  53. package/dist/components/ui/opportunity-summary-tab.js +4 -4
  54. package/dist/components/ui/opportunity-summary-tab.mjs +9 -9
  55. package/dist/components/ui/pipeline-board.js +4 -4
  56. package/dist/components/ui/pipeline-board.mjs +3 -3
  57. package/dist/components/ui/pipeline-dialogs.js +4 -4
  58. package/dist/components/ui/pipeline-dialogs.mjs +5 -5
  59. package/dist/components/ui/property-cashflow-doughnut-chart.js +1 -1
  60. package/dist/components/ui/property-cashflow-doughnut-chart.mjs +1 -1
  61. package/dist/components/ui/property-debt-equity-doughnut-chart.js +1 -1
  62. package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +1 -1
  63. package/dist/components/ui/property-mobile-estimate-line-chart.js +1 -0
  64. package/dist/components/ui/property-mobile-estimate-line-chart.mjs +1 -1
  65. package/dist/components/ui/sidebar-nav.js +540 -0
  66. package/dist/components/ui/sidebar-nav.mjs +11 -0
  67. package/dist/components/ui/stepper.js +283 -0
  68. package/dist/components/ui/stepper.mjs +18 -0
  69. package/dist/components/ui/toggle-group.js +4 -4
  70. package/dist/components/ui/toggle-group.mjs +2 -2
  71. package/dist/components/ui/toggle.js +4 -4
  72. package/dist/components/ui/toggle.mjs +1 -1
  73. package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +1 -1
  74. package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +1 -1
  75. package/dist/components/ui/transactions-income-expense-bar-chart.js +1 -1
  76. package/dist/components/ui/transactions-income-expense-bar-chart.mjs +1 -1
  77. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +1 -1
  78. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +1 -1
  79. package/dist/index.js +2154 -1302
  80. package/dist/index.mjs +115 -83
  81. package/dist/lib/typography.js +10 -10
  82. package/dist/lib/typography.mjs +1 -1
  83. package/dist/styles.css +1 -1
  84. package/package.json +16 -1
  85. package/src/components/index.tsx +41 -0
  86. package/src/components/ui/backoffice-alert-history-chart.tsx +2 -1
  87. package/src/components/ui/backoffice-contact-history-chart.tsx +2 -1
  88. package/src/components/ui/borrowing-capacity-line-chart.tsx +2 -0
  89. package/src/components/ui/cash-balance-line-chart.tsx +2 -0
  90. package/src/components/ui/cashflow-bar-chart.tsx +2 -1
  91. package/src/components/ui/color-picker.tsx +307 -0
  92. package/src/components/ui/data-table.tsx +91 -11
  93. package/src/components/ui/expense-bar-chart.tsx +2 -1
  94. package/src/components/ui/income-bar-chart.tsx +2 -1
  95. package/src/components/ui/property-cashflow-doughnut-chart.tsx +2 -1
  96. package/src/components/ui/property-debt-equity-doughnut-chart.tsx +2 -1
  97. package/src/components/ui/property-mobile-estimate-line-chart.tsx +2 -0
  98. package/src/components/ui/sidebar-nav.tsx +517 -0
  99. package/src/components/ui/stepper.tsx +347 -0
  100. package/src/components/ui/toggle.tsx +4 -4
  101. package/src/components/ui/transactions-expense-categories-doughnut-chart.tsx +2 -1
  102. package/src/components/ui/transactions-income-expense-bar-chart.tsx +2 -1
  103. package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +2 -1
  104. package/src/lib/typography.ts +11 -11
  105. package/src/styles/globals.css +19 -19
  106. package/src/styles/styles-css.ts +1 -1
  107. package/tsup.config.ts +3 -0
  108. package/dist/{chunk-KUDCQ4FI.mjs → chunk-5MEWU56Z.mjs} +3 -3
  109. package/dist/{chunk-PR6V5XKM.mjs → chunk-CGH4DRNG.mjs} +3 -3
  110. package/dist/{chunk-3WMX6KWS.mjs → chunk-Y4QFWRNR.mjs} +8 -8
@@ -0,0 +1,540 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+
59
+ // src/components/ui/sidebar-nav.tsx
60
+ var sidebar_nav_exports = {};
61
+ __export(sidebar_nav_exports, {
62
+ SidebarNav: () => SidebarNav
63
+ });
64
+ module.exports = __toCommonJS(sidebar_nav_exports);
65
+ var React2 = __toESM(require("react"));
66
+ var import_lucide_react = require("lucide-react");
67
+
68
+ // src/lib/utils.ts
69
+ var import_clsx = require("clsx");
70
+ var import_tailwind_merge = require("tailwind-merge");
71
+ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
72
+ extend: {
73
+ classGroups: {
74
+ "font-size": [
75
+ {
76
+ text: [
77
+ "display-large",
78
+ "display-medium",
79
+ "display-small",
80
+ "h1",
81
+ "h2",
82
+ "h3",
83
+ "h4",
84
+ "h5",
85
+ "h6",
86
+ "body-large",
87
+ "body-medium",
88
+ "body-small",
89
+ "label-large",
90
+ "label-medium",
91
+ "label-small",
92
+ "button",
93
+ "button-xs",
94
+ "caption",
95
+ "overline",
96
+ "code"
97
+ ]
98
+ }
99
+ ]
100
+ }
101
+ }
102
+ });
103
+ function cn(...inputs) {
104
+ return twMerge((0, import_clsx.clsx)(inputs));
105
+ }
106
+
107
+ // src/components/ui/tooltip.tsx
108
+ var import_tooltip = require("@base-ui/react/tooltip");
109
+
110
+ // src/lib/theme-provider.tsx
111
+ var import_react = require("react");
112
+ var import_jsx_runtime = require("react/jsx-runtime");
113
+ var ThemeVarsContext = (0, import_react.createContext)({});
114
+ function useThemeVars() {
115
+ return (0, import_react.useContext)(ThemeVarsContext);
116
+ }
117
+
118
+ // src/components/ui/tooltip.tsx
119
+ var import_jsx_runtime2 = require("react/jsx-runtime");
120
+ function TooltipProvider(_a) {
121
+ var _b = _a, {
122
+ delay = 0
123
+ } = _b, props = __objRest(_b, [
124
+ "delay"
125
+ ]);
126
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
127
+ import_tooltip.Tooltip.Provider,
128
+ __spreadValues({
129
+ "data-slot": "tooltip-provider",
130
+ delay
131
+ }, props)
132
+ );
133
+ }
134
+ function Tooltip(_a) {
135
+ var props = __objRest(_a, []);
136
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
137
+ }
138
+ function TooltipTrigger(_a) {
139
+ var props = __objRest(_a, []);
140
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
141
+ }
142
+ function TooltipContent(_a) {
143
+ var _b = _a, {
144
+ className,
145
+ sideOffset = 8,
146
+ side,
147
+ children,
148
+ style
149
+ } = _b, props = __objRest(_b, [
150
+ "className",
151
+ "sideOffset",
152
+ "side",
153
+ "children",
154
+ "style"
155
+ ]);
156
+ const themeVars = useThemeVars();
157
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_tooltip.Tooltip.Positioner, { sideOffset, side, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
158
+ import_tooltip.Tooltip.Popup,
159
+ __spreadProps(__spreadValues({
160
+ className: cn(
161
+ "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",
162
+ className
163
+ ),
164
+ "data-slot": "tooltip-content",
165
+ style: __spreadValues(__spreadValues({}, themeVars), style)
166
+ }, props), {
167
+ children: [
168
+ children,
169
+ /* @__PURE__ */ (0, import_jsx_runtime2.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" })
170
+ ]
171
+ })
172
+ ) }) });
173
+ }
174
+
175
+ // src/components/ui/sidebar-nav.tsx
176
+ var import_jsx_runtime3 = require("react/jsx-runtime");
177
+ function getInitials(name) {
178
+ return name.split(" ").filter(Boolean).map((word) => word[0]).join("").toUpperCase().slice(0, 2);
179
+ }
180
+ function formatCurrency(value, isNetItem = false) {
181
+ const abs = Math.abs(value);
182
+ const formatted = new Intl.NumberFormat("en-AU", {
183
+ style: "currency",
184
+ currency: "AUD",
185
+ minimumFractionDigits: 0,
186
+ maximumFractionDigits: 0
187
+ }).format(abs);
188
+ if (!isNetItem) return formatted;
189
+ if (value > 0) return `+${formatted}`;
190
+ if (value < 0) return `-${formatted}`;
191
+ return formatted;
192
+ }
193
+ function navIconCn(isActive) {
194
+ return cn(
195
+ "shrink-0 transition-colors",
196
+ isActive ? "text-primary" : "text-brand-secondary-foreground/50 group-hover:text-brand-secondary-foreground"
197
+ );
198
+ }
199
+ function NavTooltip({ label, collapsed, children }) {
200
+ if (!collapsed) return children;
201
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tooltip, { children: [
202
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipTrigger, { render: children }),
203
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipContent, { side: "right", children: label })
204
+ ] });
205
+ }
206
+ function MetricsGroup({ group }) {
207
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-b border-white/15 py-4 px-5 flex flex-col gap-1.5", children: group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
208
+ "div",
209
+ {
210
+ className: "flex items-center justify-between gap-2",
211
+ children: [
212
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-1 min-w-0", children: [
213
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
214
+ "span",
215
+ {
216
+ className: cn(
217
+ "text-sm truncate text-brand-secondary-foreground/80",
218
+ item.isNetItem && "font-semibold text-brand-secondary-foreground border-b-2 border-primary pb-px"
219
+ ),
220
+ children: item.name
221
+ }
222
+ ),
223
+ item.info && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
224
+ import_lucide_react.Info,
225
+ {
226
+ size: 11,
227
+ strokeWidth: 2,
228
+ className: "shrink-0 text-brand-secondary-foreground/50"
229
+ }
230
+ )
231
+ ] }),
232
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
233
+ "span",
234
+ {
235
+ className: cn(
236
+ "text-sm font-semibold tabular-nums shrink-0 text-brand-secondary-foreground",
237
+ item.isNetItem && item.value < 0 && "text-destructive"
238
+ ),
239
+ children: formatCurrency(item.value, item.isNetItem)
240
+ }
241
+ )
242
+ ]
243
+ },
244
+ item.name
245
+ )) });
246
+ }
247
+ function SidebarNavItemView({
248
+ item,
249
+ collapsed,
250
+ onNavigate
251
+ }) {
252
+ var _a;
253
+ const Icon = item.icon;
254
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(NavTooltip, { label: item.title, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
255
+ "button",
256
+ {
257
+ type: "button",
258
+ onClick: () => onNavigate == null ? void 0 : onNavigate(item.href),
259
+ className: cn(
260
+ "group flex w-full items-center gap-3 py-2.5 text-base font-medium transition-colors",
261
+ "text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
262
+ collapsed ? "justify-center px-2" : cn(
263
+ "px-3 border-l-4",
264
+ item.isActive ? "bg-white/15 text-brand-secondary-foreground border-primary" : "border-transparent"
265
+ )
266
+ ),
267
+ children: [
268
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
269
+ Icon,
270
+ {
271
+ className: navIconCn((_a = item.isActive) != null ? _a : false),
272
+ size: 18,
273
+ strokeWidth: 1.75
274
+ }
275
+ ),
276
+ !collapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "truncate", children: item.title })
277
+ ]
278
+ }
279
+ ) });
280
+ }
281
+ function CollapsibleNavItem({
282
+ item,
283
+ collapsed,
284
+ onNavigate
285
+ }) {
286
+ var _a, _b;
287
+ const Icon = item.icon;
288
+ const hasActiveChild = (_b = (_a = item.subItems) == null ? void 0 : _a.some((sub) => sub.isActive)) != null ? _b : false;
289
+ const [open, setOpen] = React2.useState(hasActiveChild);
290
+ React2.useEffect(() => {
291
+ if (hasActiveChild) setOpen(true);
292
+ }, [hasActiveChild]);
293
+ if (collapsed) {
294
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(NavTooltip, { label: item.title, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
295
+ "button",
296
+ {
297
+ type: "button",
298
+ onClick: () => onNavigate == null ? void 0 : onNavigate(item.href),
299
+ className: cn(
300
+ "group flex w-full items-center justify-center px-2 py-2.5 transition-colors",
301
+ "text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
302
+ hasActiveChild && "bg-white/15 text-brand-secondary-foreground"
303
+ ),
304
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
305
+ Icon,
306
+ {
307
+ className: navIconCn(hasActiveChild),
308
+ size: 18,
309
+ strokeWidth: 1.75
310
+ }
311
+ )
312
+ }
313
+ ) });
314
+ }
315
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
316
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
317
+ "button",
318
+ {
319
+ type: "button",
320
+ onClick: () => setOpen((prev) => !prev),
321
+ className: cn(
322
+ "group flex w-full items-center gap-3 px-3 py-2.5 text-base font-medium transition-colors",
323
+ "text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
324
+ "border-l-4 border-transparent",
325
+ hasActiveChild && "bg-white/15 text-brand-secondary-foreground border-primary"
326
+ ),
327
+ children: [
328
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
329
+ Icon,
330
+ {
331
+ className: navIconCn(hasActiveChild),
332
+ size: 18,
333
+ strokeWidth: 1.75
334
+ }
335
+ ),
336
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex-1 truncate text-left", children: item.title }),
337
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
338
+ import_lucide_react.ChevronDown,
339
+ {
340
+ className: cn(
341
+ "ml-auto shrink-0 text-brand-secondary-foreground/40 transition-transform duration-200",
342
+ open && "rotate-180"
343
+ ),
344
+ size: 14,
345
+ strokeWidth: 2
346
+ }
347
+ )
348
+ ]
349
+ }
350
+ ),
351
+ open && item.subItems && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "ml-9 border-l border-white/15 pl-3", children: item.subItems.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
352
+ "button",
353
+ {
354
+ type: "button",
355
+ onClick: () => onNavigate == null ? void 0 : onNavigate(sub.href),
356
+ className: cn(
357
+ "flex w-full items-center gap-2 py-1.5 pl-1 text-sm transition-colors",
358
+ "text-brand-secondary-foreground/50 hover:text-brand-secondary-foreground",
359
+ sub.isActive && "text-primary font-medium"
360
+ ),
361
+ children: [
362
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
363
+ import_lucide_react.ChevronRight,
364
+ {
365
+ size: 11,
366
+ strokeWidth: 2,
367
+ className: cn(
368
+ "shrink-0",
369
+ sub.isActive ? "text-primary" : "text-brand-secondary-foreground/30"
370
+ )
371
+ }
372
+ ),
373
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "truncate", children: sub.title })
374
+ ]
375
+ },
376
+ sub.href
377
+ )) })
378
+ ] });
379
+ }
380
+ function SidebarNav({
381
+ items,
382
+ userName = "Anonymous User",
383
+ collapsed = false,
384
+ logo,
385
+ logoCollapsed,
386
+ metricsGroups,
387
+ onNavigate,
388
+ onLogout,
389
+ onCollapsedChange,
390
+ className
391
+ }) {
392
+ const [userMenuOpen, setUserMenuOpen] = React2.useState(false);
393
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
394
+ "nav",
395
+ {
396
+ "data-slot": "sidebar-nav",
397
+ "data-collapsed": collapsed,
398
+ className: cn(
399
+ "flex h-full flex-col bg-brand-secondary text-brand-secondary-foreground",
400
+ "transition-all duration-200 ease-in-out",
401
+ collapsed ? "w-14" : "w-[279px]",
402
+ className
403
+ ),
404
+ children: [
405
+ !collapsed && logo && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center border-b border-white/15 px-5 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
406
+ "img",
407
+ {
408
+ src: logo,
409
+ alt: "Logo",
410
+ className: "h-8 w-auto object-contain object-left",
411
+ style: { filter: "brightness(0) invert(1)" }
412
+ }
413
+ ) }),
414
+ collapsed && logoCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center justify-center border-b border-white/15 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
415
+ "img",
416
+ {
417
+ src: logoCollapsed,
418
+ alt: "Logo",
419
+ className: "h-8 w-8 object-contain",
420
+ style: { filter: "brightness(0) invert(1)" }
421
+ }
422
+ ) }),
423
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "border-b border-white/15", children: [
424
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(NavTooltip, { label: userName, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
425
+ "button",
426
+ {
427
+ type: "button",
428
+ onClick: () => !collapsed && setUserMenuOpen((prev) => !prev),
429
+ className: cn(
430
+ "group flex w-full items-center gap-3 px-5 py-5 text-base transition-colors",
431
+ "text-brand-secondary-foreground hover:bg-white/10",
432
+ collapsed && "justify-center px-2 py-4"
433
+ ),
434
+ children: [
435
+ /* @__PURE__ */ (0, import_jsx_runtime3.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) }),
436
+ !collapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
437
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "flex-1 truncate text-left font-medium text-brand-secondary-foreground", children: userName }),
438
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
439
+ import_lucide_react.ChevronDown,
440
+ {
441
+ className: cn(
442
+ "shrink-0 text-brand-secondary-foreground/50 transition-transform duration-200",
443
+ userMenuOpen && "rotate-180"
444
+ ),
445
+ size: 16,
446
+ strokeWidth: 2
447
+ }
448
+ )
449
+ ] })
450
+ ]
451
+ }
452
+ ) }),
453
+ !collapsed && userMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-t border-white/15 bg-black/20", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
454
+ "button",
455
+ {
456
+ type: "button",
457
+ onClick: onLogout,
458
+ className: cn(
459
+ "flex w-full items-center gap-3 px-5 py-3 text-base",
460
+ "text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground transition-colors"
461
+ ),
462
+ children: [
463
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
464
+ import_lucide_react.LogOut,
465
+ {
466
+ size: 16,
467
+ strokeWidth: 1.75,
468
+ className: "shrink-0 text-destructive"
469
+ }
470
+ ),
471
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Logout" })
472
+ ]
473
+ }
474
+ ) })
475
+ ] }),
476
+ !collapsed && !!(metricsGroups == null ? void 0 : metricsGroups.length) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: metricsGroups.map((group, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MetricsGroup, { group }, i)) }),
477
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-col overflow-y-auto py-3", children: items.map(
478
+ (item) => item.isCollapsible ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
479
+ CollapsibleNavItem,
480
+ {
481
+ item,
482
+ collapsed,
483
+ onNavigate
484
+ },
485
+ item.href
486
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
487
+ SidebarNavItemView,
488
+ {
489
+ item,
490
+ collapsed,
491
+ onNavigate
492
+ },
493
+ item.href
494
+ )
495
+ ) }),
496
+ onCollapsedChange && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "mt-auto border-t border-white/15 bg-white/8", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
497
+ NavTooltip,
498
+ {
499
+ label: collapsed ? "Expand" : "Collapse",
500
+ collapsed,
501
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
502
+ "button",
503
+ {
504
+ type: "button",
505
+ onClick: () => onCollapsedChange(!collapsed),
506
+ className: cn(
507
+ "flex w-full items-center gap-3 px-3 py-3 transition-colors",
508
+ "text-brand-secondary-foreground/80 hover:bg-white/10 hover:text-brand-secondary-foreground",
509
+ collapsed && "justify-center px-2"
510
+ ),
511
+ children: [
512
+ collapsed ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
513
+ import_lucide_react.PanelLeftOpen,
514
+ {
515
+ size: 18,
516
+ strokeWidth: 1.75,
517
+ className: "shrink-0"
518
+ }
519
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
520
+ import_lucide_react.PanelLeftClose,
521
+ {
522
+ size: 18,
523
+ strokeWidth: 1.75,
524
+ className: "shrink-0"
525
+ }
526
+ ),
527
+ !collapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm", children: "Collapse" })
528
+ ]
529
+ }
530
+ )
531
+ }
532
+ ) })
533
+ ]
534
+ }
535
+ ) });
536
+ }
537
+ // Annotate the CommonJS export names for ESM import in node:
538
+ 0 && (module.exports = {
539
+ SidebarNav
540
+ });
@@ -0,0 +1,11 @@
1
+ import {
2
+ SidebarNav
3
+ } from "../../chunk-ZRSDX6OW.mjs";
4
+ import "../../chunk-6JQFUE5I.mjs";
5
+ import "../../chunk-FEZKMUCF.mjs";
6
+ import "../../chunk-QOJ2DQD6.mjs";
7
+ import "../../chunk-VLQZANBF.mjs";
8
+ import "../../chunk-FWCSY2DS.mjs";
9
+ export {
10
+ SidebarNav
11
+ };