@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
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OpportunitySummaryTab
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-S4QRUQNW.mjs";
|
|
4
|
+
import "../../chunk-URGMJAE3.mjs";
|
|
5
5
|
import "../../chunk-JHJHG4GO.mjs";
|
|
6
6
|
import "../../chunk-A56YQQHG.mjs";
|
|
7
7
|
import "../../chunk-PCPLO5HT.mjs";
|
|
8
8
|
import "../../chunk-7XJHLGUV.mjs";
|
|
9
9
|
import "../../chunk-OGOYQ7BG.mjs";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-U5X52X37.mjs";
|
|
11
11
|
import "../../chunk-Y6DWJSKZ.mjs";
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-3GF7OVTP.mjs";
|
|
12
|
+
import "../../chunk-EI5F6FMT.mjs";
|
|
13
|
+
import "../../chunk-BDYZCBRT.mjs";
|
|
14
|
+
import "../../chunk-5MEWU56Z.mjs";
|
|
16
15
|
import "../../chunk-P6AM5V7O.mjs";
|
|
16
|
+
import "../../chunk-3GF7OVTP.mjs";
|
|
17
17
|
import "../../chunk-34NWQURD.mjs";
|
|
18
18
|
import "../../chunk-WAZD7NFU.mjs";
|
|
19
19
|
import "../../chunk-MARPPFOJ.mjs";
|
|
20
|
-
import "../../chunk-7PYJD5JI.mjs";
|
|
21
20
|
import "../../chunk-FH6QVUVZ.mjs";
|
|
22
21
|
import "../../chunk-NSLMILBT.mjs";
|
|
22
|
+
import "../../chunk-7PYJD5JI.mjs";
|
|
23
23
|
import "../../chunk-RGVKLTLH.mjs";
|
|
24
|
-
import "../../chunk-GYMYRIZP.mjs";
|
|
25
24
|
import "../../chunk-XIRTEFKH.mjs";
|
|
25
|
+
import "../../chunk-GYMYRIZP.mjs";
|
|
26
26
|
import "../../chunk-2I5S2AMY.mjs";
|
|
27
27
|
import "../../chunk-DBHJ5KC3.mjs";
|
|
28
28
|
import "../../chunk-FEZKMUCF.mjs";
|
|
@@ -132,7 +132,7 @@ var import_class_variance_authority = require("class-variance-authority");
|
|
|
132
132
|
var import_toggle = require("@base-ui/react/toggle");
|
|
133
133
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
134
134
|
var toggleVariants = (0, import_class_variance_authority.cva)(
|
|
135
|
-
"inline-flex items-center justify-center gap-2
|
|
135
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap transition-[color,box-shadow] 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 data-pressed:bg-primary/10 data-pressed:inset-ring data-pressed:inset-ring-primary data-pressed:text-foreground data-pressed:hover:bg-primary/10 data-pressed:hover:text-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
136
136
|
{
|
|
137
137
|
variants: {
|
|
138
138
|
variant: {
|
|
@@ -140,9 +140,9 @@ var toggleVariants = (0, import_class_variance_authority.cva)(
|
|
|
140
140
|
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
141
141
|
},
|
|
142
142
|
size: {
|
|
143
|
-
default: "h-9 min-w-9 px-2",
|
|
144
|
-
sm: "h-8 min-w-8 px-1.5 text-
|
|
145
|
-
lg: "h-10 min-w-10 px-2.5"
|
|
143
|
+
default: "h-9 min-w-9 px-2 text-label-large",
|
|
144
|
+
sm: "h-8 min-w-8 px-1.5 text-label-medium",
|
|
145
|
+
lg: "h-10 min-w-10 px-2.5 text-h5"
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
defaultVariants: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PipelineBoard
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-A6AAWBPF.mjs";
|
|
4
4
|
import "../../chunk-VACKZOMY.mjs";
|
|
5
5
|
import "../../chunk-4MN6UQHG.mjs";
|
|
6
6
|
import "../../chunk-FMAXJ2SI.mjs";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-EI5F6FMT.mjs";
|
|
8
|
+
import "../../chunk-BDYZCBRT.mjs";
|
|
9
9
|
import "../../chunk-EFRENWEJ.mjs";
|
|
10
10
|
import "../../chunk-WAZD7NFU.mjs";
|
|
11
11
|
import "../../chunk-MARPPFOJ.mjs";
|
|
@@ -541,7 +541,7 @@ var import_class_variance_authority2 = require("class-variance-authority");
|
|
|
541
541
|
var import_toggle = require("@base-ui/react/toggle");
|
|
542
542
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
543
543
|
var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
544
|
-
"inline-flex items-center justify-center gap-2
|
|
544
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap transition-[color,box-shadow] 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 data-pressed:bg-primary/10 data-pressed:inset-ring data-pressed:inset-ring-primary data-pressed:text-foreground data-pressed:hover:bg-primary/10 data-pressed:hover:text-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
545
545
|
{
|
|
546
546
|
variants: {
|
|
547
547
|
variant: {
|
|
@@ -549,9 +549,9 @@ var toggleVariants = (0, import_class_variance_authority2.cva)(
|
|
|
549
549
|
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
550
550
|
},
|
|
551
551
|
size: {
|
|
552
|
-
default: "h-9 min-w-9 px-2",
|
|
553
|
-
sm: "h-8 min-w-8 px-1.5 text-
|
|
554
|
-
lg: "h-10 min-w-10 px-2.5"
|
|
552
|
+
default: "h-9 min-w-9 px-2 text-label-large",
|
|
553
|
+
sm: "h-8 min-w-8 px-1.5 text-label-medium",
|
|
554
|
+
lg: "h-10 min-w-10 px-2.5 text-h5"
|
|
555
555
|
}
|
|
556
556
|
},
|
|
557
557
|
defaultVariants: {
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
ChangePriorityDialog,
|
|
3
3
|
DeleteOpportunityDialog,
|
|
4
4
|
PutOnHoldDialog
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-3GF7OVTP.mjs";
|
|
5
|
+
} from "../../chunk-VGSESELX.mjs";
|
|
6
|
+
import "../../chunk-EI5F6FMT.mjs";
|
|
7
|
+
import "../../chunk-BDYZCBRT.mjs";
|
|
8
|
+
import "../../chunk-5MEWU56Z.mjs";
|
|
10
9
|
import "../../chunk-P6AM5V7O.mjs";
|
|
10
|
+
import "../../chunk-3GF7OVTP.mjs";
|
|
11
11
|
import "../../chunk-7PYJD5JI.mjs";
|
|
12
12
|
import "../../chunk-XIRTEFKH.mjs";
|
|
13
13
|
import "../../chunk-2I5S2AMY.mjs";
|
|
@@ -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
|
+
};
|