@wealthx/shadcn 1.2.2 → 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.
Files changed (230) hide show
  1. package/.turbo/turbo-build.log +193 -149
  2. package/CHANGELOG.md +28 -0
  3. package/dist/{chunk-4Y6R4WEC.mjs → chunk-2A5RRQGG.mjs} +9 -22
  4. package/dist/{chunk-TS2ZX2VS.mjs → chunk-2UM72RJ7.mjs} +11 -15
  5. package/dist/{chunk-A56YQQHG.mjs → chunk-3NCUZIFP.mjs} +2 -2
  6. package/dist/chunk-3OYFOX3X.mjs +79 -0
  7. package/dist/{chunk-RP3SQYA3.mjs → chunk-3TTACBDP.mjs} +9 -4
  8. package/dist/chunk-4GAWMKMI.mjs +710 -0
  9. package/dist/{chunk-VGSESELX.mjs → chunk-5FQIKDKP.mjs} +5 -5
  10. package/dist/{chunk-K3JYD4IU.mjs → chunk-5IS7G74I.mjs} +11 -4
  11. package/dist/chunk-6AW4KJHE.mjs +235 -0
  12. package/dist/chunk-6CR5N2JW.mjs +302 -0
  13. package/dist/{chunk-XIRTEFKH.mjs → chunk-6DZEXFNB.mjs} +36 -8
  14. package/dist/chunk-6O6KD7CE.mjs +271 -0
  15. package/dist/chunk-7PV3IWCN.mjs +33 -0
  16. package/dist/{chunk-SPJ5KXW7.mjs → chunk-7S5AESZO.mjs} +5 -5
  17. package/dist/{chunk-RYCLWMZ7.mjs → chunk-ABFDMHOR.mjs} +9 -7
  18. package/dist/{chunk-SWGT756Z.mjs → chunk-AMQZRHEZ.mjs} +10 -4
  19. package/dist/{chunk-WAZD7NFU.mjs → chunk-BKNFWEH2.mjs} +6 -6
  20. package/dist/{chunk-CLIN5525.mjs → chunk-C7CQJNMR.mjs} +1 -1
  21. package/dist/{chunk-D4ILTPOG.mjs → chunk-CFMQP5QS.mjs} +5 -4
  22. package/dist/{chunk-VPBN3WOO.mjs → chunk-DGHAXJBN.mjs} +9 -7
  23. package/dist/chunk-DOEO3CDL.mjs +27 -0
  24. package/dist/{chunk-5MEWU56Z.mjs → chunk-DUJTAXMH.mjs} +11 -6
  25. package/dist/{chunk-GGM2UYGG.mjs → chunk-EBXQWIYG.mjs} +10 -4
  26. package/dist/chunk-EWRB4PAD.mjs +468 -0
  27. package/dist/{chunk-ZSHYDDRB.mjs → chunk-FAKPBKLT.mjs} +6 -2
  28. package/dist/{chunk-A6AAWBPF.mjs → chunk-GHC7LLUX.mjs} +13 -4
  29. package/dist/chunk-HBZLGDIN.mjs +507 -0
  30. package/dist/{chunk-SIZMLSRU.mjs → chunk-HISNT2MG.mjs} +8 -6
  31. package/dist/{chunk-CGH4DRNG.mjs → chunk-HVY6KCCF.mjs} +10 -7
  32. package/dist/chunk-I3RZS7V2.mjs +136 -0
  33. package/dist/chunk-IAE3F7DR.mjs +1962 -0
  34. package/dist/{chunk-UT4KJR7V.mjs → chunk-IHMFS7NZ.mjs} +35 -74
  35. package/dist/{chunk-PCPLO5HT.mjs → chunk-IOJRDS6V.mjs} +96 -14
  36. package/dist/{chunk-LHYCMLVA.mjs → chunk-JKGDCQTZ.mjs} +11 -4
  37. package/dist/{chunk-H45TKD34.mjs → chunk-JMHR3YGZ.mjs} +1 -1
  38. package/dist/{chunk-4MN6UQHG.mjs → chunk-K5A5L6T2.mjs} +17 -39
  39. package/dist/chunk-LV35NGVG.mjs +272 -0
  40. package/dist/{chunk-FZIXGLMV.mjs → chunk-M3FV7LOK.mjs} +5 -12
  41. package/dist/{chunk-FMAXJ2SI.mjs → chunk-MBON7YRJ.mjs} +1 -1
  42. package/dist/chunk-MIZQHHUO.mjs +441 -0
  43. package/dist/chunk-MLNEWRWV.mjs +449 -0
  44. package/dist/chunk-MN5NYQCL.mjs +29 -0
  45. package/dist/chunk-NL3ZO62D.mjs +31 -0
  46. package/dist/{chunk-Q76O3RIQ.mjs → chunk-NMOI6CQD.mjs} +1 -1
  47. package/dist/{chunk-P6AM5V7O.mjs → chunk-OODBHKG7.mjs} +1 -1
  48. package/dist/chunk-PBL4OQV2.mjs +283 -0
  49. package/dist/{chunk-Y4QFWRNR.mjs → chunk-PU4YZQXV.mjs} +17 -18
  50. package/dist/chunk-Q2BGOAMG.mjs +202 -0
  51. package/dist/chunk-QMY3AZJH.mjs +80 -0
  52. package/dist/{chunk-BL3DXM2X.mjs → chunk-QZ4RE6NA.mjs} +11 -4
  53. package/dist/{chunk-VACKZOMY.mjs → chunk-R3VSPKNP.mjs} +3 -3
  54. package/dist/{chunk-OPNQAVVH.mjs → chunk-RJI6GKVF.mjs} +8 -6
  55. package/dist/{chunk-WG6JGJXB.mjs → chunk-T4BJLT57.mjs} +1 -1
  56. package/dist/chunk-UMTOX62O.mjs +415 -0
  57. package/dist/{chunk-7MMXNK3C.mjs → chunk-VLARHE5V.mjs} +8 -6
  58. package/dist/{chunk-2I5S2AMY.mjs → chunk-XREGSKX3.mjs} +2 -2
  59. package/dist/{chunk-JNQORUPP.mjs → chunk-YJG55G2H.mjs} +14 -11
  60. package/dist/components/ui/add-column-modal.js +42 -14
  61. package/dist/components/ui/add-column-modal.mjs +5 -5
  62. package/dist/components/ui/add-lead-modal.js +42 -11
  63. package/dist/components/ui/add-lead-modal.mjs +3 -3
  64. package/dist/components/ui/advisor-card.js +530 -0
  65. package/dist/components/ui/advisor-card.mjs +15 -0
  66. package/dist/components/ui/ai-assistant-drawer.js +11 -10
  67. package/dist/components/ui/ai-assistant-drawer.mjs +3 -3
  68. package/dist/components/ui/alert-dialog.js +2 -2
  69. package/dist/components/ui/alert-dialog.mjs +2 -2
  70. package/dist/components/ui/appointment-action-dialogs.js +1160 -0
  71. package/dist/components/ui/appointment-action-dialogs.mjs +23 -0
  72. package/dist/components/ui/appointment-availability-settings.js +1590 -0
  73. package/dist/components/ui/appointment-availability-settings.mjs +23 -0
  74. package/dist/components/ui/appointment-book-dialog.js +1744 -0
  75. package/dist/components/ui/appointment-book-dialog.mjs +27 -0
  76. package/dist/components/ui/appointment-calendar-view.js +833 -0
  77. package/dist/components/ui/appointment-calendar-view.mjs +14 -0
  78. package/dist/components/ui/appointment-detail-sheet.js +1517 -0
  79. package/dist/components/ui/appointment-detail-sheet.mjs +24 -0
  80. package/dist/components/ui/appointment-gmail-connect.js +467 -0
  81. package/dist/components/ui/appointment-gmail-connect.mjs +14 -0
  82. package/dist/components/ui/appointment-mini-card.js +345 -0
  83. package/dist/components/ui/appointment-mini-card.mjs +11 -0
  84. package/dist/components/ui/appointment-time-slot-picker.js +311 -0
  85. package/dist/components/ui/appointment-time-slot-picker.mjs +13 -0
  86. package/dist/components/ui/appointment-upcoming-card.js +1268 -0
  87. package/dist/components/ui/appointment-upcoming-card.mjs +21 -0
  88. package/dist/components/ui/backoffice-alert-history-chart.js +11 -5
  89. package/dist/components/ui/backoffice-alert-history-chart.mjs +5 -4
  90. package/dist/components/ui/backoffice-alerts-chart.js +786 -0
  91. package/dist/components/ui/backoffice-alerts-chart.mjs +19 -0
  92. package/dist/components/ui/backoffice-connections-chart.js +817 -0
  93. package/dist/components/ui/backoffice-connections-chart.mjs +19 -0
  94. package/dist/components/ui/backoffice-contact-history-chart.js +11 -5
  95. package/dist/components/ui/backoffice-contact-history-chart.mjs +5 -4
  96. package/dist/components/ui/badge.js +6 -6
  97. package/dist/components/ui/badge.mjs +1 -1
  98. package/dist/components/ui/borrowing-capacity-line-chart.js +30 -21
  99. package/dist/components/ui/borrowing-capacity-line-chart.mjs +5 -4
  100. package/dist/components/ui/button.js +2 -2
  101. package/dist/components/ui/button.mjs +1 -1
  102. package/dist/components/ui/calendar.js +2 -2
  103. package/dist/components/ui/calendar.mjs +2 -2
  104. package/dist/components/ui/card.js +1 -1
  105. package/dist/components/ui/card.mjs +1 -1
  106. package/dist/components/ui/cash-balance-line-chart.js +31 -23
  107. package/dist/components/ui/cash-balance-line-chart.mjs +5 -4
  108. package/dist/components/ui/cashflow-bar-chart.js +12 -5
  109. package/dist/components/ui/cashflow-bar-chart.mjs +5 -4
  110. package/dist/components/ui/chip.js +97 -18
  111. package/dist/components/ui/chip.mjs +3 -2
  112. package/dist/components/ui/color-picker.js +158 -28
  113. package/dist/components/ui/color-picker.mjs +3 -1
  114. package/dist/components/ui/data-table.js +140 -119
  115. package/dist/components/ui/data-table.mjs +3 -2
  116. package/dist/components/ui/date-picker.js +48 -27
  117. package/dist/components/ui/date-picker.mjs +4 -3
  118. package/dist/components/ui/dialog.js +37 -9
  119. package/dist/components/ui/dialog.mjs +2 -2
  120. package/dist/components/ui/expense-bar-chart.js +12 -5
  121. package/dist/components/ui/expense-bar-chart.mjs +5 -4
  122. package/dist/components/ui/field.mjs +2 -2
  123. package/dist/components/ui/financial-cards.js +322 -155
  124. package/dist/components/ui/financial-cards.mjs +5 -3
  125. package/dist/components/ui/financial-drawers.js +2 -2
  126. package/dist/components/ui/financial-drawers.mjs +3 -3
  127. package/dist/components/ui/financial-sections.js +14 -10
  128. package/dist/components/ui/financial-sections.mjs +6 -5
  129. package/dist/components/ui/income-bar-chart.js +12 -5
  130. package/dist/components/ui/income-bar-chart.mjs +5 -4
  131. package/dist/components/ui/input-group.js +2 -2
  132. package/dist/components/ui/input-group.mjs +2 -2
  133. package/dist/components/ui/kanban-column.js +52 -44
  134. package/dist/components/ui/kanban-column.mjs +7 -5
  135. package/dist/components/ui/opportunity-card.js +52 -44
  136. package/dist/components/ui/opportunity-card.mjs +6 -4
  137. package/dist/components/ui/opportunity-edit-modals.js +1367 -1263
  138. package/dist/components/ui/opportunity-edit-modals.mjs +8 -8
  139. package/dist/components/ui/opportunity-summary-tab.js +2744 -2157
  140. package/dist/components/ui/opportunity-summary-tab.mjs +14 -14
  141. package/dist/components/ui/page-header.js +92 -0
  142. package/dist/components/ui/page-header.mjs +8 -0
  143. package/dist/components/ui/page-top-bar.js +88 -0
  144. package/dist/components/ui/page-top-bar.mjs +8 -0
  145. package/dist/components/ui/pagination.js +303 -19
  146. package/dist/components/ui/pagination.mjs +11 -4
  147. package/dist/components/ui/pipeline-board.js +205 -191
  148. package/dist/components/ui/pipeline-board.mjs +9 -7
  149. package/dist/components/ui/pipeline-dialogs.js +114 -65
  150. package/dist/components/ui/pipeline-dialogs.mjs +7 -6
  151. package/dist/components/ui/pipeline-primitives.js +6 -6
  152. package/dist/components/ui/pipeline-primitives.mjs +2 -2
  153. package/dist/components/ui/property-cashflow-doughnut-chart.js +14 -12
  154. package/dist/components/ui/property-cashflow-doughnut-chart.mjs +5 -4
  155. package/dist/components/ui/property-debt-equity-doughnut-chart.js +14 -12
  156. package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +5 -4
  157. package/dist/components/ui/property-mobile-estimate-line-chart.js +16 -14
  158. package/dist/components/ui/property-mobile-estimate-line-chart.mjs +5 -4
  159. package/dist/components/ui/sidebar-nav.js +426 -191
  160. package/dist/components/ui/sidebar-nav.mjs +5 -1
  161. package/dist/components/ui/stage-timeline.js +6 -6
  162. package/dist/components/ui/stage-timeline.mjs +3 -3
  163. package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +18 -16
  164. package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +5 -4
  165. package/dist/components/ui/transactions-income-expense-bar-chart.js +28 -12
  166. package/dist/components/ui/transactions-income-expense-bar-chart.mjs +5 -4
  167. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +18 -16
  168. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +5 -4
  169. package/dist/index.js +12258 -8611
  170. package/dist/index.mjs +258 -190
  171. package/dist/styles.css +1 -1
  172. package/package.json +71 -1
  173. package/src/components/index.tsx +115 -9
  174. package/src/components/ui/add-column-modal.tsx +7 -7
  175. package/src/components/ui/add-lead-modal.tsx +6 -3
  176. package/src/components/ui/advisor-card.tsx +284 -0
  177. package/src/components/ui/ai-assistant-drawer.tsx +4 -3
  178. package/src/components/ui/appointment-action-dialogs.tsx +297 -0
  179. package/src/components/ui/appointment-availability-settings.tsx +645 -0
  180. package/src/components/ui/appointment-book-dialog.tsx +618 -0
  181. package/src/components/ui/appointment-calendar-view.tsx +510 -0
  182. package/src/components/ui/appointment-detail-sheet.tsx +415 -0
  183. package/src/components/ui/appointment-gmail-connect.tsx +188 -0
  184. package/src/components/ui/appointment-mini-card.tsx +104 -0
  185. package/src/components/ui/appointment-time-slot-picker.tsx +123 -0
  186. package/src/components/ui/appointment-upcoming-card.tsx +635 -0
  187. package/src/components/ui/backoffice-alert-history-chart.tsx +10 -2
  188. package/src/components/ui/backoffice-alerts-chart.tsx +312 -0
  189. package/src/components/ui/backoffice-connections-chart.tsx +339 -0
  190. package/src/components/ui/backoffice-contact-history-chart.tsx +10 -2
  191. package/src/components/ui/badge.tsx +12 -6
  192. package/src/components/ui/borrowing-capacity-line-chart.tsx +4 -11
  193. package/src/components/ui/button.tsx +2 -2
  194. package/src/components/ui/card.tsx +1 -1
  195. package/src/components/ui/cash-balance-line-chart.tsx +4 -23
  196. package/src/components/ui/cashflow-bar-chart.tsx +9 -2
  197. package/src/components/ui/chart-shared.tsx +4 -11
  198. package/src/components/ui/chip.tsx +23 -19
  199. package/src/components/ui/color-picker.tsx +4 -2
  200. package/src/components/ui/data-table.tsx +28 -74
  201. package/src/components/ui/date-picker.tsx +42 -37
  202. package/src/components/ui/dialog.tsx +72 -6
  203. package/src/components/ui/expense-bar-chart.tsx +11 -2
  204. package/src/components/ui/financial-cards.tsx +99 -10
  205. package/src/components/ui/income-bar-chart.tsx +11 -2
  206. package/src/components/ui/opportunity-card.tsx +10 -39
  207. package/src/components/ui/opportunity-edit-modals.tsx +98 -36
  208. package/src/components/ui/opportunity-summary-tab.tsx +548 -232
  209. package/src/components/ui/page-header.tsx +57 -0
  210. package/src/components/ui/page-top-bar.tsx +48 -0
  211. package/src/components/ui/pagination.tsx +171 -22
  212. package/src/components/ui/pipeline-board.tsx +12 -5
  213. package/src/components/ui/property-cashflow-doughnut-chart.tsx +3 -1
  214. package/src/components/ui/property-debt-equity-doughnut-chart.tsx +3 -1
  215. package/src/components/ui/property-mobile-estimate-line-chart.tsx +3 -1
  216. package/src/components/ui/sidebar-nav.tsx +213 -157
  217. package/src/components/ui/transactions-expense-categories-doughnut-chart.tsx +3 -1
  218. package/src/components/ui/transactions-income-expense-bar-chart.tsx +12 -9
  219. package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +3 -1
  220. package/src/lib/format-currency.ts +44 -0
  221. package/src/lib/format-date.ts +50 -0
  222. package/src/lib/opportunity-constants.ts +12 -0
  223. package/src/styles/globals.css +17 -15
  224. package/src/styles/styles-css.ts +1 -1
  225. package/tsup.config.ts +14 -0
  226. package/dist/chunk-S4QRUQNW.mjs +0 -475
  227. package/dist/chunk-URGMJAE3.mjs +0 -1885
  228. package/dist/chunk-WNGWBVLV.mjs +0 -148
  229. package/dist/chunk-ZRSDX6OW.mjs +0 -385
  230. package/dist/{chunk-LLVQKSU3.mjs → chunk-GD4BJDJR.mjs} +3 -3
@@ -0,0 +1,449 @@
1
+ import {
2
+ Tooltip,
3
+ TooltipContent,
4
+ TooltipProvider,
5
+ TooltipTrigger
6
+ } from "./chunk-6JQFUE5I.mjs";
7
+ import {
8
+ formatCurrency
9
+ } from "./chunk-MN5NYQCL.mjs";
10
+ import {
11
+ Accordion,
12
+ AccordionContent,
13
+ AccordionItem
14
+ } from "./chunk-MARPPFOJ.mjs";
15
+ import {
16
+ Button
17
+ } from "./chunk-XREGSKX3.mjs";
18
+ import {
19
+ cn
20
+ } from "./chunk-VLQZANBF.mjs";
21
+
22
+ // src/components/ui/sidebar-nav.tsx
23
+ import * as React from "react";
24
+ import {
25
+ ChevronDown,
26
+ ChevronRight,
27
+ Info,
28
+ LogOut,
29
+ PanelLeftClose,
30
+ PanelLeftOpen
31
+ } from "lucide-react";
32
+ import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
33
+ import { jsx, jsxs } from "react/jsx-runtime";
34
+ function getInitials(name) {
35
+ return name.split(" ").filter(Boolean).map((word) => word[0]).join("").toUpperCase().slice(0, 2);
36
+ }
37
+ function navIconCn(isActive) {
38
+ return cn(
39
+ "shrink-0 transition-colors",
40
+ isActive ? "text-primary" : "text-brand-secondary-foreground/50 group-hover:text-brand-secondary-foreground"
41
+ );
42
+ }
43
+ function NavTooltip({ label, collapsed, children }) {
44
+ if (!collapsed) return children;
45
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
46
+ /* @__PURE__ */ jsx(TooltipTrigger, { render: children }),
47
+ /* @__PURE__ */ jsx(TooltipContent, { side: "right", children: label })
48
+ ] });
49
+ }
50
+ function MetricsGroup({ group }) {
51
+ 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(
52
+ "div",
53
+ {
54
+ className: "flex items-center justify-between gap-2",
55
+ children: [
56
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 min-w-0", children: [
57
+ /* @__PURE__ */ jsx(
58
+ "span",
59
+ {
60
+ className: cn(
61
+ "text-sm truncate text-brand-secondary-foreground/80",
62
+ item.isNetItem && "font-semibold text-brand-secondary-foreground border-b-2 border-primary pb-px"
63
+ ),
64
+ children: item.name
65
+ }
66
+ ),
67
+ item.info && /* @__PURE__ */ jsx(
68
+ Info,
69
+ {
70
+ size: 11,
71
+ strokeWidth: 2,
72
+ className: "shrink-0 text-brand-secondary-foreground/50"
73
+ }
74
+ )
75
+ ] }),
76
+ /* @__PURE__ */ jsx(
77
+ "span",
78
+ {
79
+ className: cn(
80
+ "text-sm font-semibold tabular-nums shrink-0 text-brand-secondary-foreground",
81
+ item.isNetItem && item.value < 0 && "text-destructive"
82
+ ),
83
+ children: formatCurrency(item.value, { showSign: item.isNetItem })
84
+ }
85
+ )
86
+ ]
87
+ },
88
+ item.name
89
+ )) });
90
+ }
91
+ function SidebarNavItemView({
92
+ item,
93
+ collapsed,
94
+ onNavigate
95
+ }) {
96
+ var _a;
97
+ const Icon = item.icon;
98
+ return /* @__PURE__ */ jsx(NavTooltip, { label: item.title, collapsed, children: /* @__PURE__ */ jsxs(
99
+ Button,
100
+ {
101
+ type: "button",
102
+ variant: "ghost",
103
+ onClick: () => onNavigate == null ? void 0 : onNavigate(item.href),
104
+ className: cn(
105
+ "group h-auto 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
+ "justify-start 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: 24,
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
+ variant: "ghost",
144
+ onClick: () => onNavigate == null ? void 0 : onNavigate(item.href),
145
+ className: cn(
146
+ "group h-auto w-full justify-center px-2 py-2.5 transition-colors",
147
+ "text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
148
+ hasActiveChild && "bg-white/15 text-brand-secondary-foreground"
149
+ ),
150
+ children: /* @__PURE__ */ jsx(
151
+ Icon,
152
+ {
153
+ className: navIconCn(hasActiveChild),
154
+ size: 24,
155
+ strokeWidth: 1.75
156
+ }
157
+ )
158
+ }
159
+ ) });
160
+ }
161
+ return /* @__PURE__ */ jsx(
162
+ Accordion,
163
+ {
164
+ value: open ? [item.href] : [],
165
+ onValueChange: (values) => setOpen(values.length > 0),
166
+ children: /* @__PURE__ */ jsxs(AccordionItem, { className: "border-none", value: item.href, children: [
167
+ /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
168
+ AccordionPrimitive.Trigger,
169
+ {
170
+ className: cn(
171
+ "group flex h-auto w-full items-center justify-start gap-3 px-3 py-2.5 text-base font-medium transition-colors",
172
+ "text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground",
173
+ "border-l-4 border-transparent",
174
+ hasActiveChild && "bg-white/15 text-brand-secondary-foreground border-primary"
175
+ ),
176
+ children: [
177
+ /* @__PURE__ */ jsx(
178
+ Icon,
179
+ {
180
+ className: navIconCn(hasActiveChild),
181
+ size: 24,
182
+ strokeWidth: 1.75
183
+ }
184
+ ),
185
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left", children: item.title }),
186
+ /* @__PURE__ */ jsx(
187
+ ChevronDown,
188
+ {
189
+ className: cn(
190
+ "ml-auto shrink-0 text-brand-secondary-foreground/40 transition-transform duration-200",
191
+ "group-data-[panel-open]:rotate-180"
192
+ ),
193
+ size: 14,
194
+ strokeWidth: 2
195
+ }
196
+ )
197
+ ]
198
+ }
199
+ ) }),
200
+ item.subItems && /* @__PURE__ */ jsx(AccordionContent, { className: "p-0 text-inherit", children: /* @__PURE__ */ jsx("div", { className: "ml-9 border-l border-white/15 pl-3", children: item.subItems.map((sub) => /* @__PURE__ */ jsxs(
201
+ Button,
202
+ {
203
+ type: "button",
204
+ variant: "ghost",
205
+ onClick: () => onNavigate == null ? void 0 : onNavigate(sub.href),
206
+ className: cn(
207
+ "h-auto w-full justify-start gap-2 py-1.5 pl-1 text-sm transition-colors",
208
+ "text-brand-secondary-foreground/50 hover:text-brand-secondary-foreground",
209
+ sub.isActive && "text-primary font-medium"
210
+ ),
211
+ children: [
212
+ /* @__PURE__ */ jsx(
213
+ ChevronRight,
214
+ {
215
+ size: 11,
216
+ strokeWidth: 2,
217
+ className: cn(
218
+ "shrink-0",
219
+ sub.isActive ? "text-primary" : "text-brand-secondary-foreground/30"
220
+ )
221
+ }
222
+ ),
223
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: sub.title })
224
+ ]
225
+ },
226
+ sub.href
227
+ )) }) })
228
+ ] })
229
+ }
230
+ );
231
+ }
232
+ function SidebarNav({
233
+ items,
234
+ userName = "Anonymous User",
235
+ collapsed = false,
236
+ logo,
237
+ logoCollapsed,
238
+ metricsGroups,
239
+ onNavigate,
240
+ onLogout,
241
+ onCollapsedChange,
242
+ className
243
+ }) {
244
+ const [userMenuOpen, setUserMenuOpen] = React.useState(false);
245
+ const navScrollRef = React.useRef(null);
246
+ const expandedScrollRef = React.useRef(0);
247
+ React.useEffect(() => {
248
+ if (collapsed) setUserMenuOpen(false);
249
+ }, [collapsed]);
250
+ React.useLayoutEffect(() => {
251
+ const nav = navScrollRef.current;
252
+ if (!nav) return;
253
+ if (!collapsed) {
254
+ nav.scrollTop = expandedScrollRef.current;
255
+ }
256
+ return () => {
257
+ if (!collapsed && nav) {
258
+ expandedScrollRef.current = nav.scrollTop;
259
+ }
260
+ };
261
+ }, [collapsed]);
262
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
263
+ "nav",
264
+ {
265
+ "data-slot": "sidebar-nav",
266
+ "data-collapsed": collapsed,
267
+ className: cn(
268
+ // Force dark-mode CSS variable resolution — sidebar is always dark-backgrounded
269
+ // regardless of system theme, so semantic tokens (destructive, success, etc.)
270
+ // must use their dark-mode values to maintain WCAG contrast.
271
+ "dark flex h-full flex-col bg-brand-secondary text-brand-secondary-foreground",
272
+ "transition-all duration-200 ease-in-out",
273
+ collapsed ? "w-14" : "w-[279px]",
274
+ className
275
+ ),
276
+ children: [
277
+ (logo || logoCollapsed) && /* @__PURE__ */ jsxs("div", { className: "relative flex items-center border-b border-white/15 py-4 overflow-hidden", children: [
278
+ logo && /* @__PURE__ */ jsx(
279
+ "img",
280
+ {
281
+ src: logo,
282
+ alt: "Logo",
283
+ className: cn(
284
+ "h-8 w-auto object-contain object-left px-5 transition-opacity duration-200",
285
+ collapsed ? "opacity-0" : "opacity-100"
286
+ ),
287
+ style: { filter: "brightness(0) invert(1)" }
288
+ }
289
+ ),
290
+ logoCollapsed && /* @__PURE__ */ jsx(
291
+ "img",
292
+ {
293
+ src: logoCollapsed,
294
+ alt: "Logo",
295
+ className: cn(
296
+ "absolute inset-y-0 left-0 right-0 m-auto h-8 w-8 object-contain transition-opacity duration-200",
297
+ collapsed ? "opacity-100" : "opacity-0"
298
+ ),
299
+ style: { filter: "brightness(0) invert(1)" }
300
+ }
301
+ )
302
+ ] }),
303
+ /* @__PURE__ */ jsxs("div", { className: "relative border-b border-white/15", children: [
304
+ /* @__PURE__ */ jsx(
305
+ "div",
306
+ {
307
+ className: cn(
308
+ collapsed ? "opacity-0 pointer-events-none" : "opacity-100"
309
+ ),
310
+ children: /* @__PURE__ */ jsx(
311
+ Accordion,
312
+ {
313
+ value: userMenuOpen ? ["user-menu"] : [],
314
+ onValueChange: (values) => setUserMenuOpen(values.length > 0),
315
+ children: /* @__PURE__ */ jsxs(AccordionItem, { className: "border-none", value: "user-menu", children: [
316
+ /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
317
+ AccordionPrimitive.Trigger,
318
+ {
319
+ className: cn(
320
+ "group flex h-auto w-full items-center justify-start gap-3 px-5 py-5 text-base transition-colors",
321
+ "text-brand-secondary-foreground hover:bg-white/10"
322
+ ),
323
+ children: [
324
+ /* @__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) }),
325
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-left font-medium text-brand-secondary-foreground", children: userName }),
326
+ /* @__PURE__ */ jsx(
327
+ ChevronDown,
328
+ {
329
+ className: "ml-auto shrink-0 text-brand-secondary-foreground/50 transition-transform duration-200 group-data-[panel-open]:rotate-180",
330
+ size: 16,
331
+ strokeWidth: 2
332
+ }
333
+ )
334
+ ]
335
+ }
336
+ ) }),
337
+ /* @__PURE__ */ jsx(AccordionContent, { className: "p-0 text-inherit", children: /* @__PURE__ */ jsx("div", { className: "border-t border-white/15 bg-black/20", children: /* @__PURE__ */ jsxs(
338
+ Button,
339
+ {
340
+ type: "button",
341
+ variant: "ghost",
342
+ onClick: onLogout,
343
+ className: cn(
344
+ "h-auto w-full justify-start gap-3 px-5 py-3 text-base",
345
+ "text-brand-secondary-foreground/70 hover:bg-white/10 hover:text-brand-secondary-foreground transition-colors"
346
+ ),
347
+ children: [
348
+ /* @__PURE__ */ jsx(
349
+ LogOut,
350
+ {
351
+ size: 16,
352
+ strokeWidth: 1.75,
353
+ className: "shrink-0 text-destructive"
354
+ }
355
+ ),
356
+ /* @__PURE__ */ jsx("span", { children: "Logout" })
357
+ ]
358
+ }
359
+ ) }) })
360
+ ] })
361
+ }
362
+ )
363
+ }
364
+ ),
365
+ /* @__PURE__ */ jsx(NavTooltip, { label: userName, collapsed, children: /* @__PURE__ */ jsx(
366
+ "div",
367
+ {
368
+ className: cn(
369
+ "absolute inset-0 flex items-center justify-center transition-opacity duration-200",
370
+ collapsed ? "opacity-100" : "opacity-0 pointer-events-none"
371
+ ),
372
+ children: /* @__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) })
373
+ }
374
+ ) })
375
+ ] }),
376
+ !!(metricsGroups == null ? void 0 : metricsGroups.length) && /* @__PURE__ */ jsx(
377
+ Accordion,
378
+ {
379
+ value: !collapsed ? ["metrics"] : [],
380
+ onValueChange: () => {
381
+ },
382
+ children: /* @__PURE__ */ jsx(AccordionItem, { className: "border-none", value: "metrics", children: /* @__PURE__ */ jsx(AccordionContent, { className: "p-0 text-inherit", children: metricsGroups.map((group, i) => /* @__PURE__ */ jsx(MetricsGroup, { group }, i)) }) })
383
+ }
384
+ ),
385
+ /* @__PURE__ */ jsx("div", { ref: navScrollRef, className: "flex flex-col overflow-y-auto py-3", children: items.map(
386
+ (item) => item.isCollapsible ? /* @__PURE__ */ jsx(
387
+ CollapsibleNavItem,
388
+ {
389
+ item,
390
+ collapsed,
391
+ onNavigate
392
+ },
393
+ item.href
394
+ ) : /* @__PURE__ */ jsx(
395
+ SidebarNavItemView,
396
+ {
397
+ item,
398
+ collapsed,
399
+ onNavigate
400
+ },
401
+ item.href
402
+ )
403
+ ) }),
404
+ onCollapsedChange && /* @__PURE__ */ jsx("div", { className: "mt-auto border-t border-white/15 bg-white/8", children: /* @__PURE__ */ jsx(
405
+ NavTooltip,
406
+ {
407
+ label: collapsed ? "Expand" : "Collapse",
408
+ collapsed,
409
+ children: /* @__PURE__ */ jsxs(
410
+ Button,
411
+ {
412
+ type: "button",
413
+ variant: "ghost",
414
+ onClick: () => onCollapsedChange(!collapsed),
415
+ className: cn(
416
+ "h-12 w-full justify-start gap-3 px-3 py-3 transition-colors",
417
+ "text-brand-secondary-foreground/80 hover:bg-white/10 hover:text-brand-secondary-foreground",
418
+ collapsed && "justify-center px-2"
419
+ ),
420
+ children: [
421
+ collapsed ? /* @__PURE__ */ jsx(
422
+ PanelLeftOpen,
423
+ {
424
+ size: 24,
425
+ strokeWidth: 1.75,
426
+ className: "shrink-0"
427
+ }
428
+ ) : /* @__PURE__ */ jsx(
429
+ PanelLeftClose,
430
+ {
431
+ size: 24,
432
+ strokeWidth: 1.75,
433
+ className: "shrink-0"
434
+ }
435
+ ),
436
+ !collapsed && /* @__PURE__ */ jsx("span", { className: "text-sm", children: "Collapse" })
437
+ ]
438
+ }
439
+ )
440
+ }
441
+ ) })
442
+ ]
443
+ }
444
+ ) });
445
+ }
446
+
447
+ export {
448
+ SidebarNav
449
+ };
@@ -0,0 +1,29 @@
1
+ // src/lib/format-currency.ts
2
+ function formatCurrency(value, options) {
3
+ const { decimals = 0, showSign = false } = options != null ? options : {};
4
+ const abs = Math.abs(value);
5
+ const formatted = new Intl.NumberFormat("en-AU", {
6
+ style: "currency",
7
+ currency: "AUD",
8
+ minimumFractionDigits: decimals,
9
+ maximumFractionDigits: decimals
10
+ }).format(abs);
11
+ if (!showSign) return value < 0 ? `-${formatted}` : formatted;
12
+ if (value > 0) return `+${formatted}`;
13
+ if (value < 0) return `-${formatted}`;
14
+ return formatted;
15
+ }
16
+ function formatCurrencyAbbrev(value) {
17
+ const abs = Math.abs(value);
18
+ const sign = value < 0 ? "-" : "";
19
+ if (abs >= 1e9)
20
+ return `${sign}$${(abs / 1e9).toFixed(1)}B`;
21
+ if (abs >= 1e6) return `${sign}$${(abs / 1e6).toFixed(1)}M`;
22
+ if (abs >= 1e3) return `${sign}$${(abs / 1e3).toFixed(0)}K`;
23
+ return `${sign}$${abs.toFixed(0)}`;
24
+ }
25
+
26
+ export {
27
+ formatCurrency,
28
+ formatCurrencyAbbrev
29
+ };
@@ -0,0 +1,31 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-VLQZANBF.mjs";
4
+
5
+ // src/components/ui/page-header.tsx
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ function PageHeader({
8
+ title,
9
+ description,
10
+ actions,
11
+ className
12
+ }) {
13
+ return /* @__PURE__ */ jsxs(
14
+ "div",
15
+ {
16
+ "data-slot": "page-header",
17
+ className: cn("flex items-start justify-between gap-4", className),
18
+ children: [
19
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
20
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold leading-tight", children: title }),
21
+ description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: description })
22
+ ] }),
23
+ actions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })
24
+ ]
25
+ }
26
+ );
27
+ }
28
+
29
+ export {
30
+ PageHeader
31
+ };
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-GYMYRIZP.mjs";
7
7
  import {
8
8
  Button
9
- } from "./chunk-2I5S2AMY.mjs";
9
+ } from "./chunk-XREGSKX3.mjs";
10
10
  import {
11
11
  cn
12
12
  } from "./chunk-VLQZANBF.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Button,
3
3
  buttonVariants
4
- } from "./chunk-2I5S2AMY.mjs";
4
+ } from "./chunk-XREGSKX3.mjs";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-VLQZANBF.mjs";