@wealthx/shadcn 1.3.0 → 1.3.1
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 +43 -43
- package/CHANGELOG.md +6 -0
- package/dist/chunk-MLNEWRWV.mjs +449 -0
- package/dist/{chunk-FNQXOAYJ.mjs → chunk-Q2BGOAMG.mjs} +61 -28
- package/dist/components/ui/advisor-card.js +61 -28
- package/dist/components/ui/advisor-card.mjs +5 -3
- package/dist/components/ui/sidebar-nav.js +268 -172
- package/dist/components/ui/sidebar-nav.mjs +2 -1
- package/dist/index.js +515 -424
- package/dist/index.mjs +5 -3
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/index.tsx +2 -1
- package/src/components/ui/advisor-card.tsx +111 -54
- package/src/components/ui/sidebar-nav.tsx +194 -137
- package/src/styles/styles-css.ts +1 -1
- package/dist/chunk-ZC45IGZO.mjs +0 -388
|
@@ -63,7 +63,8 @@ __export(sidebar_nav_exports, {
|
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(sidebar_nav_exports);
|
|
65
65
|
var React3 = __toESM(require("react"));
|
|
66
|
-
var
|
|
66
|
+
var import_lucide_react3 = require("lucide-react");
|
|
67
|
+
var import_accordion2 = require("@base-ui/react/accordion");
|
|
67
68
|
|
|
68
69
|
// src/lib/utils.ts
|
|
69
70
|
var import_clsx = require("clsx");
|
|
@@ -120,10 +121,50 @@ function formatCurrency(value, options) {
|
|
|
120
121
|
return formatted;
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
// src/components/ui/accordion.tsx
|
|
125
|
+
var import_lucide_react = require("lucide-react");
|
|
126
|
+
var import_accordion = require("@base-ui/react/accordion");
|
|
127
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
128
|
+
function Accordion(props) {
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_accordion.Accordion.Root, __spreadValues({ "data-slot": "accordion" }, props));
|
|
130
|
+
}
|
|
131
|
+
function AccordionItem(_a) {
|
|
132
|
+
var _b = _a, {
|
|
133
|
+
className
|
|
134
|
+
} = _b, props = __objRest(_b, [
|
|
135
|
+
"className"
|
|
136
|
+
]);
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
import_accordion.Accordion.Item,
|
|
139
|
+
__spreadValues({
|
|
140
|
+
className: cn("border-b", className),
|
|
141
|
+
"data-slot": "accordion-item"
|
|
142
|
+
}, props)
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
function AccordionContent(_a) {
|
|
146
|
+
var _b = _a, {
|
|
147
|
+
className,
|
|
148
|
+
children
|
|
149
|
+
} = _b, props = __objRest(_b, [
|
|
150
|
+
"className",
|
|
151
|
+
"children"
|
|
152
|
+
]);
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
154
|
+
import_accordion.Accordion.Panel,
|
|
155
|
+
__spreadProps(__spreadValues({
|
|
156
|
+
className: "overflow-hidden text-body-small h-(--accordion-panel-height) transition-[height] duration-200 ease-out data-starting-style:h-0 data-ending-style:h-0",
|
|
157
|
+
"data-slot": "accordion-content"
|
|
158
|
+
}, props), {
|
|
159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("pb-4 text-muted-foreground", className), children })
|
|
160
|
+
})
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
123
164
|
// src/components/ui/button.tsx
|
|
124
165
|
var import_react = require("react");
|
|
125
166
|
var import_class_variance_authority = require("class-variance-authority");
|
|
126
|
-
var
|
|
167
|
+
var import_lucide_react2 = require("lucide-react");
|
|
127
168
|
|
|
128
169
|
// src/lib/slot.tsx
|
|
129
170
|
var React = __toESM(require("react"));
|
|
@@ -173,7 +214,7 @@ var Slot = React.forwardRef(
|
|
|
173
214
|
Slot.displayName = "Slot";
|
|
174
215
|
|
|
175
216
|
// src/components/ui/button.tsx
|
|
176
|
-
var
|
|
217
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
177
218
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
178
219
|
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-button whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
179
220
|
{
|
|
@@ -227,7 +268,7 @@ var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
|
227
268
|
]);
|
|
228
269
|
const Comp = asChild ? Slot : "button";
|
|
229
270
|
const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
|
|
230
|
-
return /* @__PURE__ */ (0,
|
|
271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
231
272
|
Comp,
|
|
232
273
|
__spreadProps(__spreadValues({
|
|
233
274
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -238,8 +279,8 @@ var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
|
238
279
|
ref,
|
|
239
280
|
type
|
|
240
281
|
}, props), {
|
|
241
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
242
|
-
/* @__PURE__ */ (0,
|
|
282
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
|
|
243
284
|
!isIconOnly && children
|
|
244
285
|
] }) : children
|
|
245
286
|
})
|
|
@@ -251,21 +292,21 @@ var import_tooltip = require("@base-ui/react/tooltip");
|
|
|
251
292
|
|
|
252
293
|
// src/lib/theme-provider.tsx
|
|
253
294
|
var import_react2 = require("react");
|
|
254
|
-
var
|
|
295
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
255
296
|
var ThemeVarsContext = (0, import_react2.createContext)({});
|
|
256
297
|
function useThemeVars() {
|
|
257
298
|
return (0, import_react2.useContext)(ThemeVarsContext);
|
|
258
299
|
}
|
|
259
300
|
|
|
260
301
|
// src/components/ui/tooltip.tsx
|
|
261
|
-
var
|
|
302
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
262
303
|
function TooltipProvider(_a) {
|
|
263
304
|
var _b = _a, {
|
|
264
305
|
delay = 0
|
|
265
306
|
} = _b, props = __objRest(_b, [
|
|
266
307
|
"delay"
|
|
267
308
|
]);
|
|
268
|
-
return /* @__PURE__ */ (0,
|
|
309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
269
310
|
import_tooltip.Tooltip.Provider,
|
|
270
311
|
__spreadValues({
|
|
271
312
|
"data-slot": "tooltip-provider",
|
|
@@ -275,11 +316,11 @@ function TooltipProvider(_a) {
|
|
|
275
316
|
}
|
|
276
317
|
function Tooltip(_a) {
|
|
277
318
|
var props = __objRest(_a, []);
|
|
278
|
-
return /* @__PURE__ */ (0,
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tooltip.Tooltip.Root, __spreadValues({ "data-slot": "tooltip" }, props));
|
|
279
320
|
}
|
|
280
321
|
function TooltipTrigger(_a) {
|
|
281
322
|
var props = __objRest(_a, []);
|
|
282
|
-
return /* @__PURE__ */ (0,
|
|
323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tooltip.Tooltip.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
283
324
|
}
|
|
284
325
|
function TooltipContent(_a) {
|
|
285
326
|
var _b = _a, {
|
|
@@ -296,7 +337,7 @@ function TooltipContent(_a) {
|
|
|
296
337
|
"style"
|
|
297
338
|
]);
|
|
298
339
|
const themeVars = useThemeVars();
|
|
299
|
-
return /* @__PURE__ */ (0,
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tooltip.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tooltip.Tooltip.Positioner, { sideOffset, side, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
300
341
|
import_tooltip.Tooltip.Popup,
|
|
301
342
|
__spreadProps(__spreadValues({
|
|
302
343
|
className: cn(
|
|
@@ -308,14 +349,14 @@ function TooltipContent(_a) {
|
|
|
308
349
|
}, props), {
|
|
309
350
|
children: [
|
|
310
351
|
children,
|
|
311
|
-
/* @__PURE__ */ (0,
|
|
352
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.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" })
|
|
312
353
|
]
|
|
313
354
|
})
|
|
314
355
|
) }) });
|
|
315
356
|
}
|
|
316
357
|
|
|
317
358
|
// src/components/ui/sidebar-nav.tsx
|
|
318
|
-
var
|
|
359
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
319
360
|
function getInitials(name) {
|
|
320
361
|
return name.split(" ").filter(Boolean).map((word) => word[0]).join("").toUpperCase().slice(0, 2);
|
|
321
362
|
}
|
|
@@ -327,19 +368,19 @@ function navIconCn(isActive) {
|
|
|
327
368
|
}
|
|
328
369
|
function NavTooltip({ label, collapsed, children }) {
|
|
329
370
|
if (!collapsed) return children;
|
|
330
|
-
return /* @__PURE__ */ (0,
|
|
331
|
-
/* @__PURE__ */ (0,
|
|
332
|
-
/* @__PURE__ */ (0,
|
|
371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Tooltip, { children: [
|
|
372
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TooltipTrigger, { render: children }),
|
|
373
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TooltipContent, { side: "right", children: label })
|
|
333
374
|
] });
|
|
334
375
|
}
|
|
335
376
|
function MetricsGroup({ group }) {
|
|
336
|
-
return /* @__PURE__ */ (0,
|
|
377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.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_runtime5.jsxs)(
|
|
337
378
|
"div",
|
|
338
379
|
{
|
|
339
380
|
className: "flex items-center justify-between gap-2",
|
|
340
381
|
children: [
|
|
341
|
-
/* @__PURE__ */ (0,
|
|
342
|
-
/* @__PURE__ */ (0,
|
|
382
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
383
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
343
384
|
"span",
|
|
344
385
|
{
|
|
345
386
|
className: cn(
|
|
@@ -349,8 +390,8 @@ function MetricsGroup({ group }) {
|
|
|
349
390
|
children: item.name
|
|
350
391
|
}
|
|
351
392
|
),
|
|
352
|
-
item.info && /* @__PURE__ */ (0,
|
|
353
|
-
|
|
393
|
+
item.info && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
394
|
+
import_lucide_react3.Info,
|
|
354
395
|
{
|
|
355
396
|
size: 11,
|
|
356
397
|
strokeWidth: 2,
|
|
@@ -358,7 +399,7 @@ function MetricsGroup({ group }) {
|
|
|
358
399
|
}
|
|
359
400
|
)
|
|
360
401
|
] }),
|
|
361
|
-
/* @__PURE__ */ (0,
|
|
402
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
362
403
|
"span",
|
|
363
404
|
{
|
|
364
405
|
className: cn(
|
|
@@ -380,7 +421,7 @@ function SidebarNavItemView({
|
|
|
380
421
|
}) {
|
|
381
422
|
var _a;
|
|
382
423
|
const Icon = item.icon;
|
|
383
|
-
return /* @__PURE__ */ (0,
|
|
424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavTooltip, { label: item.title, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
384
425
|
Button,
|
|
385
426
|
{
|
|
386
427
|
type: "button",
|
|
@@ -395,15 +436,15 @@ function SidebarNavItemView({
|
|
|
395
436
|
)
|
|
396
437
|
),
|
|
397
438
|
children: [
|
|
398
|
-
/* @__PURE__ */ (0,
|
|
439
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
399
440
|
Icon,
|
|
400
441
|
{
|
|
401
442
|
className: navIconCn((_a = item.isActive) != null ? _a : false),
|
|
402
|
-
size:
|
|
443
|
+
size: 24,
|
|
403
444
|
strokeWidth: 1.75
|
|
404
445
|
}
|
|
405
446
|
),
|
|
406
|
-
!collapsed && /* @__PURE__ */ (0,
|
|
447
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "truncate", children: item.title })
|
|
407
448
|
]
|
|
408
449
|
}
|
|
409
450
|
) });
|
|
@@ -421,7 +462,7 @@ function CollapsibleNavItem({
|
|
|
421
462
|
if (hasActiveChild) setOpen(true);
|
|
422
463
|
}, [hasActiveChild]);
|
|
423
464
|
if (collapsed) {
|
|
424
|
-
return /* @__PURE__ */ (0,
|
|
465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavTooltip, { label: item.title, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
425
466
|
Button,
|
|
426
467
|
{
|
|
427
468
|
type: "button",
|
|
@@ -432,83 +473,87 @@ function CollapsibleNavItem({
|
|
|
432
473
|
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
433
474
|
hasActiveChild && "bg-white/15 text-brand-secondary-foreground"
|
|
434
475
|
),
|
|
435
|
-
children: /* @__PURE__ */ (0,
|
|
476
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
436
477
|
Icon,
|
|
437
478
|
{
|
|
438
479
|
className: navIconCn(hasActiveChild),
|
|
439
|
-
size:
|
|
480
|
+
size: 24,
|
|
440
481
|
strokeWidth: 1.75
|
|
441
482
|
}
|
|
442
483
|
)
|
|
443
484
|
}
|
|
444
485
|
) });
|
|
445
486
|
}
|
|
446
|
-
return /* @__PURE__ */ (0,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
470
|
-
import_lucide_react2.ChevronDown,
|
|
471
|
-
{
|
|
472
|
-
className: cn(
|
|
473
|
-
"ml-auto shrink-0 text-brand-secondary-foreground/40 transition-transform duration-200",
|
|
474
|
-
open && "rotate-180"
|
|
487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
488
|
+
Accordion,
|
|
489
|
+
{
|
|
490
|
+
value: open ? [item.href] : [],
|
|
491
|
+
onValueChange: (values) => setOpen(values.length > 0),
|
|
492
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AccordionItem, { className: "border-none", value: item.href, children: [
|
|
493
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_accordion2.Accordion.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
494
|
+
import_accordion2.Accordion.Trigger,
|
|
495
|
+
{
|
|
496
|
+
className: cn(
|
|
497
|
+
"group flex h-auto w-full items-center justify-start gap-3 px-3 py-2.5 text-base font-medium transition-colors",
|
|
498
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
499
|
+
"border-l-4 border-transparent",
|
|
500
|
+
hasActiveChild && "bg-white/15 text-brand-secondary-foreground border-primary"
|
|
501
|
+
),
|
|
502
|
+
children: [
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
504
|
+
Icon,
|
|
505
|
+
{
|
|
506
|
+
className: navIconCn(hasActiveChild),
|
|
507
|
+
size: 24,
|
|
508
|
+
strokeWidth: 1.75
|
|
509
|
+
}
|
|
475
510
|
),
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
variant: "ghost",
|
|
488
|
-
onClick: () => onNavigate == null ? void 0 : onNavigate(sub.href),
|
|
489
|
-
className: cn(
|
|
490
|
-
"h-auto w-full justify-start gap-2 py-1.5 pl-1 text-sm transition-colors",
|
|
491
|
-
"text-brand-secondary-foreground/50 hover:text-brand-secondary-foreground",
|
|
492
|
-
sub.isActive && "text-primary font-medium"
|
|
493
|
-
),
|
|
494
|
-
children: [
|
|
495
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
496
|
-
import_lucide_react2.ChevronRight,
|
|
497
|
-
{
|
|
498
|
-
size: 11,
|
|
499
|
-
strokeWidth: 2,
|
|
500
|
-
className: cn(
|
|
501
|
-
"shrink-0",
|
|
502
|
-
sub.isActive ? "text-primary" : "text-brand-secondary-foreground/30"
|
|
511
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "flex-1 truncate text-left", children: item.title }),
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
513
|
+
import_lucide_react3.ChevronDown,
|
|
514
|
+
{
|
|
515
|
+
className: cn(
|
|
516
|
+
"ml-auto shrink-0 text-brand-secondary-foreground/40 transition-transform duration-200",
|
|
517
|
+
"group-data-[panel-open]:rotate-180"
|
|
518
|
+
),
|
|
519
|
+
size: 14,
|
|
520
|
+
strokeWidth: 2
|
|
521
|
+
}
|
|
503
522
|
)
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
) }),
|
|
526
|
+
item.subItems && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccordionContent, { className: "p-0 text-inherit", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "ml-9 border-l border-white/15 pl-3", children: item.subItems.map((sub) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
527
|
+
Button,
|
|
528
|
+
{
|
|
529
|
+
type: "button",
|
|
530
|
+
variant: "ghost",
|
|
531
|
+
onClick: () => onNavigate == null ? void 0 : onNavigate(sub.href),
|
|
532
|
+
className: cn(
|
|
533
|
+
"h-auto w-full justify-start gap-2 py-1.5 pl-1 text-sm transition-colors",
|
|
534
|
+
"text-brand-secondary-foreground/50 hover:text-brand-secondary-foreground",
|
|
535
|
+
sub.isActive && "text-primary font-medium"
|
|
536
|
+
),
|
|
537
|
+
children: [
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
539
|
+
import_lucide_react3.ChevronRight,
|
|
540
|
+
{
|
|
541
|
+
size: 11,
|
|
542
|
+
strokeWidth: 2,
|
|
543
|
+
className: cn(
|
|
544
|
+
"shrink-0",
|
|
545
|
+
sub.isActive ? "text-primary" : "text-brand-secondary-foreground/30"
|
|
546
|
+
)
|
|
547
|
+
}
|
|
548
|
+
),
|
|
549
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "truncate", children: sub.title })
|
|
550
|
+
]
|
|
551
|
+
},
|
|
552
|
+
sub.href
|
|
553
|
+
)) }) })
|
|
554
|
+
] })
|
|
555
|
+
}
|
|
556
|
+
);
|
|
512
557
|
}
|
|
513
558
|
function SidebarNav({
|
|
514
559
|
items,
|
|
@@ -523,7 +568,24 @@ function SidebarNav({
|
|
|
523
568
|
className
|
|
524
569
|
}) {
|
|
525
570
|
const [userMenuOpen, setUserMenuOpen] = React3.useState(false);
|
|
526
|
-
|
|
571
|
+
const navScrollRef = React3.useRef(null);
|
|
572
|
+
const expandedScrollRef = React3.useRef(0);
|
|
573
|
+
React3.useEffect(() => {
|
|
574
|
+
if (collapsed) setUserMenuOpen(false);
|
|
575
|
+
}, [collapsed]);
|
|
576
|
+
React3.useLayoutEffect(() => {
|
|
577
|
+
const nav = navScrollRef.current;
|
|
578
|
+
if (!nav) return;
|
|
579
|
+
if (!collapsed) {
|
|
580
|
+
nav.scrollTop = expandedScrollRef.current;
|
|
581
|
+
}
|
|
582
|
+
return () => {
|
|
583
|
+
if (!collapsed && nav) {
|
|
584
|
+
expandedScrollRef.current = nav.scrollTop;
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
}, [collapsed]);
|
|
588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
527
589
|
"nav",
|
|
528
590
|
{
|
|
529
591
|
"data-slot": "sidebar-nav",
|
|
@@ -538,82 +600,116 @@ function SidebarNav({
|
|
|
538
600
|
className
|
|
539
601
|
),
|
|
540
602
|
children: [
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
src: logo,
|
|
545
|
-
alt: "Logo",
|
|
546
|
-
className: "h-8 w-auto object-contain object-left",
|
|
547
|
-
style: { filter: "brightness(0) invert(1)" }
|
|
548
|
-
}
|
|
549
|
-
) }),
|
|
550
|
-
collapsed && logoCollapsed && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex items-center justify-center border-b border-white/15 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
551
|
-
"img",
|
|
552
|
-
{
|
|
553
|
-
src: logoCollapsed,
|
|
554
|
-
alt: "Logo",
|
|
555
|
-
className: "h-8 w-8 object-contain",
|
|
556
|
-
style: { filter: "brightness(0) invert(1)" }
|
|
557
|
-
}
|
|
558
|
-
) }),
|
|
559
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "border-b border-white/15", children: [
|
|
560
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NavTooltip, { label: userName, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
561
|
-
Button,
|
|
603
|
+
(logo || logoCollapsed) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative flex items-center border-b border-white/15 py-4 overflow-hidden", children: [
|
|
604
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
605
|
+
"img",
|
|
562
606
|
{
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
onClick: () => !collapsed && setUserMenuOpen((prev) => !prev),
|
|
607
|
+
src: logo,
|
|
608
|
+
alt: "Logo",
|
|
566
609
|
className: cn(
|
|
567
|
-
"
|
|
568
|
-
"
|
|
569
|
-
collapsed && "justify-center px-2 py-4"
|
|
610
|
+
"h-8 w-auto object-contain object-left px-5 transition-opacity duration-200",
|
|
611
|
+
collapsed ? "opacity-0" : "opacity-100"
|
|
570
612
|
),
|
|
571
|
-
|
|
572
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.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) }),
|
|
573
|
-
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
574
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "flex-1 truncate text-left font-medium text-brand-secondary-foreground", children: userName }),
|
|
575
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
576
|
-
import_lucide_react2.ChevronDown,
|
|
577
|
-
{
|
|
578
|
-
className: cn(
|
|
579
|
-
"shrink-0 text-brand-secondary-foreground/50 transition-transform duration-200",
|
|
580
|
-
userMenuOpen && "rotate-180"
|
|
581
|
-
),
|
|
582
|
-
size: 16,
|
|
583
|
-
strokeWidth: 2
|
|
584
|
-
}
|
|
585
|
-
)
|
|
586
|
-
] })
|
|
587
|
-
]
|
|
613
|
+
style: { filter: "brightness(0) invert(1)" }
|
|
588
614
|
}
|
|
589
|
-
)
|
|
590
|
-
|
|
591
|
-
|
|
615
|
+
),
|
|
616
|
+
logoCollapsed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
617
|
+
"img",
|
|
592
618
|
{
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
onClick: onLogout,
|
|
619
|
+
src: logoCollapsed,
|
|
620
|
+
alt: "Logo",
|
|
596
621
|
className: cn(
|
|
597
|
-
"
|
|
598
|
-
"
|
|
622
|
+
"absolute inset-y-0 left-0 right-0 m-auto h-8 w-8 object-contain transition-opacity duration-200",
|
|
623
|
+
collapsed ? "opacity-100" : "opacity-0"
|
|
599
624
|
),
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
625
|
+
style: { filter: "brightness(0) invert(1)" }
|
|
626
|
+
}
|
|
627
|
+
)
|
|
628
|
+
] }),
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative border-b border-white/15", children: [
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
631
|
+
"div",
|
|
632
|
+
{
|
|
633
|
+
className: cn(
|
|
634
|
+
collapsed ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
635
|
+
),
|
|
636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
637
|
+
Accordion,
|
|
638
|
+
{
|
|
639
|
+
value: userMenuOpen ? ["user-menu"] : [],
|
|
640
|
+
onValueChange: (values) => setUserMenuOpen(values.length > 0),
|
|
641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(AccordionItem, { className: "border-none", value: "user-menu", children: [
|
|
642
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_accordion2.Accordion.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
643
|
+
import_accordion2.Accordion.Trigger,
|
|
644
|
+
{
|
|
645
|
+
className: cn(
|
|
646
|
+
"group flex h-auto w-full items-center justify-start gap-3 px-5 py-5 text-base transition-colors",
|
|
647
|
+
"text-brand-secondary-foreground hover:bg-white/10"
|
|
648
|
+
),
|
|
649
|
+
children: [
|
|
650
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.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) }),
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "flex-1 truncate text-left font-medium text-brand-secondary-foreground", children: userName }),
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
653
|
+
import_lucide_react3.ChevronDown,
|
|
654
|
+
{
|
|
655
|
+
className: "ml-auto shrink-0 text-brand-secondary-foreground/50 transition-transform duration-200 group-data-[panel-open]:rotate-180",
|
|
656
|
+
size: 16,
|
|
657
|
+
strokeWidth: 2
|
|
658
|
+
}
|
|
659
|
+
)
|
|
660
|
+
]
|
|
661
|
+
}
|
|
662
|
+
) }),
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccordionContent, { className: "p-0 text-inherit", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "border-t border-white/15 bg-black/20", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
664
|
+
Button,
|
|
665
|
+
{
|
|
666
|
+
type: "button",
|
|
667
|
+
variant: "ghost",
|
|
668
|
+
onClick: onLogout,
|
|
669
|
+
className: cn(
|
|
670
|
+
"h-auto w-full justify-start gap-3 px-5 py-3 text-base",
|
|
671
|
+
"text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground transition-colors"
|
|
672
|
+
),
|
|
673
|
+
children: [
|
|
674
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
675
|
+
import_lucide_react3.LogOut,
|
|
676
|
+
{
|
|
677
|
+
size: 16,
|
|
678
|
+
strokeWidth: 1.75,
|
|
679
|
+
className: "shrink-0 text-destructive"
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Logout" })
|
|
683
|
+
]
|
|
684
|
+
}
|
|
685
|
+
) }) })
|
|
686
|
+
] })
|
|
687
|
+
}
|
|
688
|
+
)
|
|
689
|
+
}
|
|
690
|
+
),
|
|
691
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavTooltip, { label: userName, collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
692
|
+
"div",
|
|
693
|
+
{
|
|
694
|
+
className: cn(
|
|
695
|
+
"absolute inset-0 flex items-center justify-center transition-opacity duration-200",
|
|
696
|
+
collapsed ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
697
|
+
),
|
|
698
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.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) })
|
|
611
699
|
}
|
|
612
700
|
) })
|
|
613
701
|
] }),
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
702
|
+
!!(metricsGroups == null ? void 0 : metricsGroups.length) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
703
|
+
Accordion,
|
|
704
|
+
{
|
|
705
|
+
value: !collapsed ? ["metrics"] : [],
|
|
706
|
+
onValueChange: () => {
|
|
707
|
+
},
|
|
708
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccordionItem, { className: "border-none", value: "metrics", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AccordionContent, { className: "p-0 text-inherit", children: metricsGroups.map((group, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MetricsGroup, { group }, i)) }) })
|
|
709
|
+
}
|
|
710
|
+
),
|
|
711
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: navScrollRef, className: "flex flex-col overflow-y-auto py-3", children: items.map(
|
|
712
|
+
(item) => item.isCollapsible ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
617
713
|
CollapsibleNavItem,
|
|
618
714
|
{
|
|
619
715
|
item,
|
|
@@ -621,7 +717,7 @@ function SidebarNav({
|
|
|
621
717
|
onNavigate
|
|
622
718
|
},
|
|
623
719
|
item.href
|
|
624
|
-
) : /* @__PURE__ */ (0,
|
|
720
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
625
721
|
SidebarNavItemView,
|
|
626
722
|
{
|
|
627
723
|
item,
|
|
@@ -631,39 +727,39 @@ function SidebarNav({
|
|
|
631
727
|
item.href
|
|
632
728
|
)
|
|
633
729
|
) }),
|
|
634
|
-
onCollapsedChange && /* @__PURE__ */ (0,
|
|
730
|
+
onCollapsedChange && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "mt-auto border-t border-white/15 bg-white/8", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
635
731
|
NavTooltip,
|
|
636
732
|
{
|
|
637
733
|
label: collapsed ? "Expand" : "Collapse",
|
|
638
734
|
collapsed,
|
|
639
|
-
children: /* @__PURE__ */ (0,
|
|
735
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
640
736
|
Button,
|
|
641
737
|
{
|
|
642
738
|
type: "button",
|
|
643
739
|
variant: "ghost",
|
|
644
740
|
onClick: () => onCollapsedChange(!collapsed),
|
|
645
741
|
className: cn(
|
|
646
|
-
"h-
|
|
742
|
+
"h-12 w-full justify-start gap-3 px-3 py-3 transition-colors",
|
|
647
743
|
"text-brand-secondary-foreground/80 hover:bg-white/10 hover:text-brand-secondary-foreground",
|
|
648
744
|
collapsed && "justify-center px-2"
|
|
649
745
|
),
|
|
650
746
|
children: [
|
|
651
|
-
collapsed ? /* @__PURE__ */ (0,
|
|
652
|
-
|
|
747
|
+
collapsed ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
748
|
+
import_lucide_react3.PanelLeftOpen,
|
|
653
749
|
{
|
|
654
|
-
size:
|
|
750
|
+
size: 24,
|
|
655
751
|
strokeWidth: 1.75,
|
|
656
752
|
className: "shrink-0"
|
|
657
753
|
}
|
|
658
|
-
) : /* @__PURE__ */ (0,
|
|
659
|
-
|
|
754
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
755
|
+
import_lucide_react3.PanelLeftClose,
|
|
660
756
|
{
|
|
661
|
-
size:
|
|
757
|
+
size: 24,
|
|
662
758
|
strokeWidth: 1.75,
|
|
663
759
|
className: "shrink-0"
|
|
664
760
|
}
|
|
665
761
|
),
|
|
666
|
-
!collapsed && /* @__PURE__ */ (0,
|
|
762
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-sm", children: "Collapse" })
|
|
667
763
|
]
|
|
668
764
|
}
|
|
669
765
|
)
|