@wealthx/shadcn 1.2.1 → 1.3.0

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 (247) hide show
  1. package/.turbo/turbo-build.log +203 -150
  2. package/CHANGELOG.md +29 -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-SYOD63OZ.mjs → chunk-5FQIKDKP.mjs} +6 -6
  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-WOEHFRGB.mjs → chunk-BDYZCBRT.mjs} +4 -4
  20. package/dist/{chunk-WAZD7NFU.mjs → chunk-BKNFWEH2.mjs} +6 -6
  21. package/dist/{chunk-CLIN5525.mjs → chunk-C7CQJNMR.mjs} +1 -1
  22. package/dist/{chunk-D4ILTPOG.mjs → chunk-CFMQP5QS.mjs} +5 -4
  23. package/dist/{chunk-VPBN3WOO.mjs → chunk-DGHAXJBN.mjs} +9 -7
  24. package/dist/chunk-DOEO3CDL.mjs +27 -0
  25. package/dist/{chunk-KUDCQ4FI.mjs → chunk-DUJTAXMH.mjs} +9 -4
  26. package/dist/{chunk-GGM2UYGG.mjs → chunk-EBXQWIYG.mjs} +10 -4
  27. package/dist/{chunk-PMB3A7V3.mjs → chunk-EI5F6FMT.mjs} +1 -1
  28. package/dist/chunk-EWRB4PAD.mjs +468 -0
  29. package/dist/chunk-FAKPBKLT.mjs +253 -0
  30. package/dist/chunk-FNQXOAYJ.mjs +169 -0
  31. package/dist/{chunk-4CX4SBRO.mjs → chunk-GHC7LLUX.mjs} +14 -5
  32. package/dist/chunk-HBZLGDIN.mjs +507 -0
  33. package/dist/{chunk-SIZMLSRU.mjs → chunk-HISNT2MG.mjs} +8 -6
  34. package/dist/{chunk-PR6V5XKM.mjs → chunk-HVY6KCCF.mjs} +7 -4
  35. package/dist/chunk-I3RZS7V2.mjs +136 -0
  36. package/dist/chunk-IAE3F7DR.mjs +1962 -0
  37. package/dist/{chunk-ZRO5JO3H.mjs → chunk-IHMFS7NZ.mjs} +81 -84
  38. package/dist/{chunk-PCPLO5HT.mjs → chunk-IOJRDS6V.mjs} +96 -14
  39. package/dist/{chunk-LHYCMLVA.mjs → chunk-JKGDCQTZ.mjs} +11 -4
  40. package/dist/{chunk-H45TKD34.mjs → chunk-JMHR3YGZ.mjs} +1 -1
  41. package/dist/{chunk-4MN6UQHG.mjs → chunk-K5A5L6T2.mjs} +17 -39
  42. package/dist/{chunk-CSDO6VBW.mjs → chunk-LBMRIB3G.mjs} +10 -10
  43. package/dist/chunk-LV35NGVG.mjs +272 -0
  44. package/dist/{chunk-FZIXGLMV.mjs → chunk-M3FV7LOK.mjs} +5 -12
  45. package/dist/{chunk-FMAXJ2SI.mjs → chunk-MBON7YRJ.mjs} +1 -1
  46. package/dist/chunk-MIZQHHUO.mjs +441 -0
  47. package/dist/chunk-MN5NYQCL.mjs +29 -0
  48. package/dist/chunk-NL3ZO62D.mjs +31 -0
  49. package/dist/{chunk-Q76O3RIQ.mjs → chunk-NMOI6CQD.mjs} +1 -1
  50. package/dist/{chunk-P6AM5V7O.mjs → chunk-OODBHKG7.mjs} +1 -1
  51. package/dist/chunk-PBL4OQV2.mjs +283 -0
  52. package/dist/{chunk-3WMX6KWS.mjs → chunk-PU4YZQXV.mjs} +11 -12
  53. package/dist/chunk-QMY3AZJH.mjs +80 -0
  54. package/dist/{chunk-BL3DXM2X.mjs → chunk-QZ4RE6NA.mjs} +11 -4
  55. package/dist/{chunk-VACKZOMY.mjs → chunk-R3VSPKNP.mjs} +3 -3
  56. package/dist/{chunk-OPNQAVVH.mjs → chunk-RJI6GKVF.mjs} +8 -6
  57. package/dist/{chunk-WG6JGJXB.mjs → chunk-T4BJLT57.mjs} +1 -1
  58. package/dist/chunk-U4NDAF2P.mjs +207 -0
  59. package/dist/{chunk-DOH3EHX7.mjs → chunk-U5X52X37.mjs} +1 -1
  60. package/dist/chunk-UMTOX62O.mjs +415 -0
  61. package/dist/{chunk-7MMXNK3C.mjs → chunk-VLARHE5V.mjs} +8 -6
  62. package/dist/{chunk-2I5S2AMY.mjs → chunk-XREGSKX3.mjs} +2 -2
  63. package/dist/{chunk-JNQORUPP.mjs → chunk-YJG55G2H.mjs} +14 -11
  64. package/dist/chunk-ZC45IGZO.mjs +388 -0
  65. package/dist/components/ui/add-column-modal.js +42 -14
  66. package/dist/components/ui/add-column-modal.mjs +4 -4
  67. package/dist/components/ui/add-lead-modal.js +42 -11
  68. package/dist/components/ui/add-lead-modal.mjs +3 -3
  69. package/dist/components/ui/advisor-card.js +497 -0
  70. package/dist/components/ui/advisor-card.mjs +13 -0
  71. package/dist/components/ui/ai-assistant-drawer.js +11 -10
  72. package/dist/components/ui/ai-assistant-drawer.mjs +3 -3
  73. package/dist/components/ui/alert-dialog.js +2 -2
  74. package/dist/components/ui/alert-dialog.mjs +2 -2
  75. package/dist/components/ui/appointment-action-dialogs.js +1160 -0
  76. package/dist/components/ui/appointment-action-dialogs.mjs +23 -0
  77. package/dist/components/ui/appointment-availability-settings.js +1590 -0
  78. package/dist/components/ui/appointment-availability-settings.mjs +23 -0
  79. package/dist/components/ui/appointment-book-dialog.js +1744 -0
  80. package/dist/components/ui/appointment-book-dialog.mjs +27 -0
  81. package/dist/components/ui/appointment-calendar-view.js +833 -0
  82. package/dist/components/ui/appointment-calendar-view.mjs +14 -0
  83. package/dist/components/ui/appointment-detail-sheet.js +1517 -0
  84. package/dist/components/ui/appointment-detail-sheet.mjs +24 -0
  85. package/dist/components/ui/appointment-gmail-connect.js +467 -0
  86. package/dist/components/ui/appointment-gmail-connect.mjs +14 -0
  87. package/dist/components/ui/appointment-mini-card.js +345 -0
  88. package/dist/components/ui/appointment-mini-card.mjs +11 -0
  89. package/dist/components/ui/appointment-time-slot-picker.js +311 -0
  90. package/dist/components/ui/appointment-time-slot-picker.mjs +13 -0
  91. package/dist/components/ui/appointment-upcoming-card.js +1268 -0
  92. package/dist/components/ui/appointment-upcoming-card.mjs +21 -0
  93. package/dist/components/ui/backoffice-alert-history-chart.js +11 -5
  94. package/dist/components/ui/backoffice-alert-history-chart.mjs +5 -4
  95. package/dist/components/ui/backoffice-alerts-chart.js +786 -0
  96. package/dist/components/ui/backoffice-alerts-chart.mjs +19 -0
  97. package/dist/components/ui/backoffice-connections-chart.js +817 -0
  98. package/dist/components/ui/backoffice-connections-chart.mjs +19 -0
  99. package/dist/components/ui/backoffice-contact-history-chart.js +11 -5
  100. package/dist/components/ui/backoffice-contact-history-chart.mjs +5 -4
  101. package/dist/components/ui/badge.js +6 -6
  102. package/dist/components/ui/badge.mjs +1 -1
  103. package/dist/components/ui/borrowing-capacity-line-chart.js +30 -21
  104. package/dist/components/ui/borrowing-capacity-line-chart.mjs +5 -4
  105. package/dist/components/ui/button.js +2 -2
  106. package/dist/components/ui/button.mjs +1 -1
  107. package/dist/components/ui/calendar.js +2 -2
  108. package/dist/components/ui/calendar.mjs +2 -2
  109. package/dist/components/ui/card.js +1 -1
  110. package/dist/components/ui/card.mjs +1 -1
  111. package/dist/components/ui/cash-balance-line-chart.js +31 -23
  112. package/dist/components/ui/cash-balance-line-chart.mjs +5 -4
  113. package/dist/components/ui/cashflow-bar-chart.js +12 -5
  114. package/dist/components/ui/cashflow-bar-chart.mjs +5 -4
  115. package/dist/components/ui/chip.js +97 -18
  116. package/dist/components/ui/chip.mjs +3 -2
  117. package/dist/components/ui/color-picker.js +547 -0
  118. package/dist/components/ui/color-picker.mjs +24 -0
  119. package/dist/components/ui/data-table.js +182 -129
  120. package/dist/components/ui/data-table.mjs +3 -2
  121. package/dist/components/ui/date-picker.js +48 -27
  122. package/dist/components/ui/date-picker.mjs +4 -3
  123. package/dist/components/ui/dialog.js +37 -9
  124. package/dist/components/ui/dialog.mjs +2 -2
  125. package/dist/components/ui/expense-bar-chart.js +12 -5
  126. package/dist/components/ui/expense-bar-chart.mjs +5 -4
  127. package/dist/components/ui/field.mjs +2 -2
  128. package/dist/components/ui/financial-cards.js +322 -155
  129. package/dist/components/ui/financial-cards.mjs +5 -3
  130. package/dist/components/ui/financial-drawers.js +2 -2
  131. package/dist/components/ui/financial-drawers.mjs +3 -3
  132. package/dist/components/ui/financial-sections.js +14 -10
  133. package/dist/components/ui/financial-sections.mjs +6 -5
  134. package/dist/components/ui/form-primitives.js +4 -4
  135. package/dist/components/ui/form-primitives.mjs +3 -3
  136. package/dist/components/ui/income-bar-chart.js +12 -5
  137. package/dist/components/ui/income-bar-chart.mjs +5 -4
  138. package/dist/components/ui/input-group.js +2 -2
  139. package/dist/components/ui/input-group.mjs +2 -2
  140. package/dist/components/ui/kanban-column.js +52 -44
  141. package/dist/components/ui/kanban-column.mjs +7 -5
  142. package/dist/components/ui/opportunity-card.js +52 -44
  143. package/dist/components/ui/opportunity-card.mjs +6 -4
  144. package/dist/components/ui/opportunity-edit-modals.js +1371 -1267
  145. package/dist/components/ui/opportunity-edit-modals.mjs +10 -10
  146. package/dist/components/ui/opportunity-summary-tab.js +2748 -2161
  147. package/dist/components/ui/opportunity-summary-tab.mjs +16 -16
  148. package/dist/components/ui/page-header.js +92 -0
  149. package/dist/components/ui/page-header.mjs +8 -0
  150. package/dist/components/ui/page-top-bar.js +88 -0
  151. package/dist/components/ui/page-top-bar.mjs +8 -0
  152. package/dist/components/ui/pagination.js +303 -19
  153. package/dist/components/ui/pagination.mjs +11 -4
  154. package/dist/components/ui/pipeline-board.js +209 -195
  155. package/dist/components/ui/pipeline-board.mjs +10 -8
  156. package/dist/components/ui/pipeline-dialogs.js +118 -69
  157. package/dist/components/ui/pipeline-dialogs.mjs +8 -7
  158. package/dist/components/ui/pipeline-primitives.js +6 -6
  159. package/dist/components/ui/pipeline-primitives.mjs +2 -2
  160. package/dist/components/ui/property-cashflow-doughnut-chart.js +14 -12
  161. package/dist/components/ui/property-cashflow-doughnut-chart.mjs +5 -4
  162. package/dist/components/ui/property-debt-equity-doughnut-chart.js +14 -12
  163. package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +5 -4
  164. package/dist/components/ui/property-mobile-estimate-line-chart.js +16 -14
  165. package/dist/components/ui/property-mobile-estimate-line-chart.mjs +5 -4
  166. package/dist/components/ui/sidebar-nav.js +679 -0
  167. package/dist/components/ui/sidebar-nav.mjs +14 -0
  168. package/dist/components/ui/stage-timeline.js +6 -6
  169. package/dist/components/ui/stage-timeline.mjs +3 -3
  170. package/dist/components/ui/stepper.js +283 -0
  171. package/dist/components/ui/stepper.mjs +18 -0
  172. package/dist/components/ui/toggle-group.js +4 -4
  173. package/dist/components/ui/toggle-group.mjs +2 -2
  174. package/dist/components/ui/toggle.js +4 -4
  175. package/dist/components/ui/toggle.mjs +1 -1
  176. package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +18 -16
  177. package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +5 -4
  178. package/dist/components/ui/transactions-income-expense-bar-chart.js +28 -12
  179. package/dist/components/ui/transactions-income-expense-bar-chart.mjs +5 -4
  180. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +18 -16
  181. package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +5 -4
  182. package/dist/index.js +12927 -8522
  183. package/dist/index.mjs +288 -190
  184. package/dist/lib/typography.js +10 -10
  185. package/dist/lib/typography.mjs +1 -1
  186. package/dist/styles.css +1 -1
  187. package/package.json +86 -1
  188. package/src/components/index.tsx +146 -0
  189. package/src/components/ui/add-column-modal.tsx +7 -7
  190. package/src/components/ui/add-lead-modal.tsx +6 -3
  191. package/src/components/ui/advisor-card.tsx +227 -0
  192. package/src/components/ui/ai-assistant-drawer.tsx +4 -3
  193. package/src/components/ui/appointment-action-dialogs.tsx +297 -0
  194. package/src/components/ui/appointment-availability-settings.tsx +645 -0
  195. package/src/components/ui/appointment-book-dialog.tsx +618 -0
  196. package/src/components/ui/appointment-calendar-view.tsx +510 -0
  197. package/src/components/ui/appointment-detail-sheet.tsx +415 -0
  198. package/src/components/ui/appointment-gmail-connect.tsx +188 -0
  199. package/src/components/ui/appointment-mini-card.tsx +104 -0
  200. package/src/components/ui/appointment-time-slot-picker.tsx +123 -0
  201. package/src/components/ui/appointment-upcoming-card.tsx +635 -0
  202. package/src/components/ui/backoffice-alert-history-chart.tsx +10 -2
  203. package/src/components/ui/backoffice-alerts-chart.tsx +312 -0
  204. package/src/components/ui/backoffice-connections-chart.tsx +339 -0
  205. package/src/components/ui/backoffice-contact-history-chart.tsx +10 -2
  206. package/src/components/ui/badge.tsx +12 -6
  207. package/src/components/ui/borrowing-capacity-line-chart.tsx +4 -11
  208. package/src/components/ui/button.tsx +2 -2
  209. package/src/components/ui/card.tsx +1 -1
  210. package/src/components/ui/cash-balance-line-chart.tsx +4 -23
  211. package/src/components/ui/cashflow-bar-chart.tsx +9 -2
  212. package/src/components/ui/chart-shared.tsx +4 -11
  213. package/src/components/ui/chip.tsx +23 -19
  214. package/src/components/ui/color-picker.tsx +309 -0
  215. package/src/components/ui/data-table.tsx +117 -83
  216. package/src/components/ui/date-picker.tsx +42 -37
  217. package/src/components/ui/dialog.tsx +72 -6
  218. package/src/components/ui/expense-bar-chart.tsx +11 -2
  219. package/src/components/ui/financial-cards.tsx +99 -10
  220. package/src/components/ui/income-bar-chart.tsx +11 -2
  221. package/src/components/ui/opportunity-card.tsx +10 -39
  222. package/src/components/ui/opportunity-edit-modals.tsx +98 -36
  223. package/src/components/ui/opportunity-summary-tab.tsx +548 -232
  224. package/src/components/ui/page-header.tsx +57 -0
  225. package/src/components/ui/page-top-bar.tsx +48 -0
  226. package/src/components/ui/pagination.tsx +171 -22
  227. package/src/components/ui/pipeline-board.tsx +12 -5
  228. package/src/components/ui/property-cashflow-doughnut-chart.tsx +3 -1
  229. package/src/components/ui/property-debt-equity-doughnut-chart.tsx +3 -1
  230. package/src/components/ui/property-mobile-estimate-line-chart.tsx +3 -1
  231. package/src/components/ui/sidebar-nav.tsx +516 -0
  232. package/src/components/ui/stepper.tsx +347 -0
  233. package/src/components/ui/toggle.tsx +4 -4
  234. package/src/components/ui/transactions-expense-categories-doughnut-chart.tsx +3 -1
  235. package/src/components/ui/transactions-income-expense-bar-chart.tsx +12 -9
  236. package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +3 -1
  237. package/src/lib/format-currency.ts +44 -0
  238. package/src/lib/format-date.ts +50 -0
  239. package/src/lib/opportunity-constants.ts +12 -0
  240. package/src/lib/typography.ts +11 -11
  241. package/src/styles/globals.css +36 -34
  242. package/src/styles/styles-css.ts +1 -1
  243. package/tsup.config.ts +17 -0
  244. package/dist/chunk-PG6K5XEC.mjs +0 -475
  245. package/dist/chunk-WA6O6EUR.mjs +0 -1885
  246. package/dist/chunk-WNGWBVLV.mjs +0 -148
  247. package/dist/{chunk-LLVQKSU3.mjs → chunk-GD4BJDJR.mjs} +3 -3
@@ -0,0 +1,441 @@
1
+ import {
2
+ AddressAutocomplete
3
+ } from "./chunk-U5X52X37.mjs";
4
+ import {
5
+ RadioGroup,
6
+ RadioGroupCard,
7
+ RadioGroupItem
8
+ } from "./chunk-7XJHLGUV.mjs";
9
+ import {
10
+ AppointmentSlotSection
11
+ } from "./chunk-3OYFOX3X.mjs";
12
+ import {
13
+ Toggle
14
+ } from "./chunk-BDYZCBRT.mjs";
15
+ import {
16
+ Textarea
17
+ } from "./chunk-34NWQURD.mjs";
18
+ import {
19
+ Calendar
20
+ } from "./chunk-OODBHKG7.mjs";
21
+ import {
22
+ Avatar,
23
+ AvatarFallback
24
+ } from "./chunk-24FUO7TD.mjs";
25
+ import {
26
+ Select,
27
+ SelectContent,
28
+ SelectItem,
29
+ SelectTrigger,
30
+ SelectValue
31
+ } from "./chunk-7PYJD5JI.mjs";
32
+ import {
33
+ Label
34
+ } from "./chunk-NSLMILBT.mjs";
35
+ import {
36
+ Separator
37
+ } from "./chunk-FH6QVUVZ.mjs";
38
+ import {
39
+ Input
40
+ } from "./chunk-GYMYRIZP.mjs";
41
+ import {
42
+ Dialog,
43
+ DialogClose,
44
+ DialogContent,
45
+ DialogDescription,
46
+ DialogFooter,
47
+ DialogHeader,
48
+ DialogTitle
49
+ } from "./chunk-6DZEXFNB.mjs";
50
+ import {
51
+ Button
52
+ } from "./chunk-XREGSKX3.mjs";
53
+
54
+ // src/components/ui/appointment-book-dialog.tsx
55
+ import React from "react";
56
+ import { MapPin, Phone, Video } from "lucide-react";
57
+ import { jsx, jsxs } from "react/jsx-runtime";
58
+ function ClientSearch({
59
+ clients,
60
+ value,
61
+ onValueChange
62
+ }) {
63
+ const [query, setQuery] = React.useState("");
64
+ const [open, setOpen] = React.useState(false);
65
+ const selected = clients.find((c) => c.id === value);
66
+ const filtered = clients.filter((c) => {
67
+ const q = query.toLowerCase();
68
+ return c.name.toLowerCase().includes(q) || c.email.toLowerCase().includes(q);
69
+ });
70
+ return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
71
+ /* @__PURE__ */ jsx(
72
+ Input,
73
+ {
74
+ value: selected ? selected.name : query,
75
+ onChange: (e) => {
76
+ setQuery(e.target.value);
77
+ if (selected) onValueChange(void 0);
78
+ setOpen(e.target.value.length > 0);
79
+ },
80
+ onBlur: () => setTimeout(() => setOpen(false), 150),
81
+ placeholder: "Search by name or email\u2026",
82
+ autoComplete: "off"
83
+ }
84
+ ),
85
+ open && (filtered.length > 0 || query.length > 0) && /* @__PURE__ */ jsx("div", { className: "absolute z-50 mt-1 w-full border border-border bg-popover shadow-md", children: filtered.length === 0 ? /* @__PURE__ */ jsx("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No clients found." }) : filtered.map((c) => /* @__PURE__ */ jsxs(
86
+ Button,
87
+ {
88
+ type: "button",
89
+ variant: "ghost",
90
+ className: "h-auto w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-primary/5",
91
+ onMouseDown: (e) => e.preventDefault(),
92
+ onClick: () => {
93
+ onValueChange(c.id);
94
+ setQuery("");
95
+ setOpen(false);
96
+ },
97
+ children: [
98
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: c.name }),
99
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: c.email })
100
+ ]
101
+ },
102
+ c.id
103
+ )) })
104
+ ] });
105
+ }
106
+ var FORMAT_OPTIONS = [
107
+ { value: "call", label: "Call", icon: /* @__PURE__ */ jsx(Phone, { className: "h-4 w-4" }) },
108
+ {
109
+ value: "google-meet",
110
+ label: "Google Meet",
111
+ icon: /* @__PURE__ */ jsx(Video, { className: "h-4 w-4" })
112
+ },
113
+ {
114
+ value: "offline",
115
+ label: "Offline",
116
+ icon: /* @__PURE__ */ jsx(MapPin, { className: "h-4 w-4" })
117
+ }
118
+ ];
119
+ function MeetingFormatSection({
120
+ format,
121
+ onFormatChange,
122
+ offlineLocation,
123
+ onOfflineLocationChange,
124
+ customAddress,
125
+ onCustomAddressChange,
126
+ advisorOfficeAddress,
127
+ clientHomeAddress,
128
+ isClientMode
129
+ }) {
130
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
131
+ /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: FORMAT_OPTIONS.map((opt) => /* @__PURE__ */ jsxs(
132
+ Toggle,
133
+ {
134
+ variant: "outline",
135
+ pressed: format === opt.value,
136
+ onPressedChange: () => onFormatChange(opt.value),
137
+ className: "flex-1 gap-1.5",
138
+ children: [
139
+ opt.icon,
140
+ opt.label
141
+ ]
142
+ },
143
+ opt.value
144
+ )) }),
145
+ format === "offline" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 border border-border p-3", children: [
146
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Location" }),
147
+ /* @__PURE__ */ jsxs(
148
+ RadioGroup,
149
+ {
150
+ value: offlineLocation,
151
+ onValueChange: (v) => onOfflineLocationChange(v),
152
+ className: "gap-2",
153
+ children: [
154
+ advisorOfficeAddress && /* @__PURE__ */ jsx(
155
+ RadioGroupCard,
156
+ {
157
+ value: "office",
158
+ label: "Advisor's Office",
159
+ description: advisorOfficeAddress
160
+ }
161
+ ),
162
+ clientHomeAddress && /* @__PURE__ */ jsx(
163
+ RadioGroupCard,
164
+ {
165
+ value: "home",
166
+ label: isClientMode ? "Home" : "Client's Home",
167
+ description: clientHomeAddress
168
+ }
169
+ ),
170
+ /* @__PURE__ */ jsx(
171
+ RadioGroupCard,
172
+ {
173
+ value: "custom",
174
+ label: "Custom address",
175
+ description: "Enter a specific location"
176
+ }
177
+ )
178
+ ]
179
+ }
180
+ ),
181
+ offlineLocation === "custom" && /* @__PURE__ */ jsx(
182
+ AddressAutocomplete,
183
+ {
184
+ value: customAddress,
185
+ onValueChange: onCustomAddressChange,
186
+ placeholder: "e.g. 123 Collins St, Melbourne VIC 3000"
187
+ }
188
+ )
189
+ ] })
190
+ ] });
191
+ }
192
+ function AppointmentBookDialog({
193
+ open,
194
+ onOpenChange,
195
+ clients = [],
196
+ meetingTypes = [],
197
+ amSlots,
198
+ pmSlots,
199
+ schedule,
200
+ advisorOfficeAddress,
201
+ clientHomeAddress,
202
+ advisorInfo,
203
+ initialClientId,
204
+ onBook
205
+ }) {
206
+ const isClientMode = clients.length === 0;
207
+ const DAY_MAP = {
208
+ Sun: 0,
209
+ Mon: 1,
210
+ Tue: 2,
211
+ Wed: 3,
212
+ Thu: 4,
213
+ Fri: 5,
214
+ Sat: 6
215
+ };
216
+ const disabledDayOfWeek = schedule == null ? void 0 : schedule.filter((d) => !d.enabled).map((d) => DAY_MAP[d.day]).filter((n) => n !== void 0);
217
+ const [clientId, setClientId] = React.useState(void 0);
218
+ const [meetingType, setMeetingType] = React.useState("");
219
+ const [meetingFormat, setMeetingFormat] = React.useState("call");
220
+ const [offlineLocation, setOfflineLocation] = React.useState(
221
+ advisorOfficeAddress ? "office" : "custom"
222
+ );
223
+ const [customAddress, setCustomAddress] = React.useState("");
224
+ const [date, setDate] = React.useState(/* @__PURE__ */ new Date());
225
+ const [selectedSlot, setSelectedSlot] = React.useState(void 0);
226
+ const [notes, setNotes] = React.useState("");
227
+ const [selectedPhone, setSelectedPhone] = React.useState(
228
+ void 0
229
+ );
230
+ const selectedClient = clients.find((c) => c.id === clientId);
231
+ React.useEffect(() => {
232
+ if (open && initialClientId) {
233
+ setClientId(initialClientId);
234
+ }
235
+ }, [open, initialClientId]);
236
+ React.useEffect(() => {
237
+ setSelectedPhone(void 0);
238
+ }, [clientId]);
239
+ React.useEffect(() => {
240
+ if (meetingFormat !== "call") {
241
+ setSelectedPhone(void 0);
242
+ }
243
+ }, [meetingFormat]);
244
+ const clientReady = isClientMode || !!clientId;
245
+ const meetingTypeReady = meetingTypes.length === 0 || !!meetingType;
246
+ const offlineReady = meetingFormat !== "offline" || offlineLocation !== "custom" || !!customAddress.trim();
247
+ const canSubmit = clientReady && meetingTypeReady && !!date && !!selectedSlot && offlineReady;
248
+ const handleOpenChange = (next) => {
249
+ if (!next) {
250
+ setClientId(void 0);
251
+ setMeetingType("");
252
+ setMeetingFormat("call");
253
+ setOfflineLocation(advisorOfficeAddress ? "office" : "custom");
254
+ setCustomAddress("");
255
+ setDate(/* @__PURE__ */ new Date());
256
+ setSelectedSlot(void 0);
257
+ setNotes("");
258
+ setSelectedPhone(void 0);
259
+ }
260
+ onOpenChange(next);
261
+ };
262
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { size: "2xl", align: "top", children: [
263
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
264
+ /* @__PURE__ */ jsx(DialogTitle, { children: isClientMode ? "Book an Appointment" : "New appointment" }),
265
+ /* @__PURE__ */ jsx(DialogDescription, { children: isClientMode ? "Request a meeting with your advisor. They will confirm once the appointment is reviewed." : "Book a meeting with a client. They will receive a confirmation email once the appointment is created." }),
266
+ isClientMode && advisorInfo && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-3 border border-border bg-muted/30 px-3 py-2", children: [
267
+ /* @__PURE__ */ jsx(Avatar, { className: "h-8 w-8 shrink-0", children: /* @__PURE__ */ jsx(AvatarFallback, { className: "text-xs", children: advisorInfo.initials }) }),
268
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
269
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: advisorInfo.name }),
270
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: advisorInfo.role })
271
+ ] })
272
+ ] })
273
+ ] }),
274
+ /* @__PURE__ */ jsx(Separator, {}),
275
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
276
+ !isClientMode && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
277
+ /* @__PURE__ */ jsx(Label, { children: "Client" }),
278
+ /* @__PURE__ */ jsx(
279
+ ClientSearch,
280
+ {
281
+ clients,
282
+ value: clientId,
283
+ onValueChange: setClientId
284
+ }
285
+ )
286
+ ] }),
287
+ meetingTypes.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
288
+ /* @__PURE__ */ jsx(Label, { htmlFor: "book-apt-type", children: isClientMode ? "Appointment type" : "Meeting type" }),
289
+ /* @__PURE__ */ jsxs(Select, { onValueChange: (v) => setMeetingType(v), children: [
290
+ /* @__PURE__ */ jsx(SelectTrigger, { id: "book-apt-type", className: "w-full", children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select meeting type\u2026" }) }),
291
+ /* @__PURE__ */ jsx(SelectContent, { children: meetingTypes.map((t) => /* @__PURE__ */ jsx(SelectItem, { value: t, children: t }, t)) })
292
+ ] })
293
+ ] }),
294
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
295
+ /* @__PURE__ */ jsx(Label, { children: "Meeting format" }),
296
+ /* @__PURE__ */ jsx(
297
+ MeetingFormatSection,
298
+ {
299
+ format: meetingFormat,
300
+ onFormatChange: setMeetingFormat,
301
+ offlineLocation,
302
+ onOfflineLocationChange: setOfflineLocation,
303
+ customAddress,
304
+ onCustomAddressChange: setCustomAddress,
305
+ advisorOfficeAddress,
306
+ clientHomeAddress,
307
+ isClientMode
308
+ }
309
+ )
310
+ ] }),
311
+ !isClientMode && meetingFormat === "call" && (selectedClient == null ? void 0 : selectedClient.phones) && selectedClient.phones.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
312
+ /* @__PURE__ */ jsx(Label, { children: selectedClient.accountType === "Joint" ? "Select a contact number" : "Phone number" }),
313
+ /* @__PURE__ */ jsx(
314
+ RadioGroup,
315
+ {
316
+ value: selectedPhone != null ? selectedPhone : "",
317
+ onValueChange: (v) => setSelectedPhone(v),
318
+ className: "gap-1 border border-border p-3",
319
+ children: selectedClient.phones.map((phone) => /* @__PURE__ */ jsxs(
320
+ "div",
321
+ {
322
+ className: "flex items-center gap-3 p-2 hover:bg-muted/50",
323
+ children: [
324
+ /* @__PURE__ */ jsx(RadioGroupItem, { value: phone, id: `phone-${phone}` }),
325
+ /* @__PURE__ */ jsxs(
326
+ Label,
327
+ {
328
+ htmlFor: `phone-${phone}`,
329
+ className: "flex cursor-pointer items-center gap-2 font-normal",
330
+ children: [
331
+ /* @__PURE__ */ jsx(Phone, { className: "h-4 w-4 text-muted-foreground" }),
332
+ phone
333
+ ]
334
+ }
335
+ )
336
+ ]
337
+ },
338
+ phone
339
+ ))
340
+ }
341
+ )
342
+ ] }),
343
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[auto_1fr] items-start gap-5", children: [
344
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
345
+ /* @__PURE__ */ jsx(Label, { children: "Date" }),
346
+ /* @__PURE__ */ jsx(
347
+ Calendar,
348
+ {
349
+ mode: "single",
350
+ selected: date,
351
+ onSelect: (d) => {
352
+ setDate(d);
353
+ setSelectedSlot(void 0);
354
+ },
355
+ captionLayout: "label",
356
+ fromDate: /* @__PURE__ */ new Date(),
357
+ disabled: disabledDayOfWeek && disabledDayOfWeek.length > 0 ? [{ before: /* @__PURE__ */ new Date() }, { dayOfWeek: disabledDayOfWeek }] : { before: /* @__PURE__ */ new Date() },
358
+ className: "border border-border"
359
+ }
360
+ )
361
+ ] }),
362
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
363
+ /* @__PURE__ */ jsx(Label, { children: "Time slot" }),
364
+ date ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
365
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: date.toLocaleDateString("en-AU", {
366
+ weekday: "long",
367
+ day: "numeric",
368
+ month: "long"
369
+ }) }),
370
+ /* @__PURE__ */ jsx(
371
+ AppointmentSlotSection,
372
+ {
373
+ label: "Morning",
374
+ slots: amSlots,
375
+ selectedSlotId: selectedSlot == null ? void 0 : selectedSlot.id,
376
+ onSelect: setSelectedSlot
377
+ }
378
+ ),
379
+ /* @__PURE__ */ jsx(
380
+ AppointmentSlotSection,
381
+ {
382
+ label: "Afternoon",
383
+ slots: pmSlots,
384
+ selectedSlotId: selectedSlot == null ? void 0 : selectedSlot.id,
385
+ onSelect: setSelectedSlot
386
+ }
387
+ )
388
+ ] }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Select a date to see available slots." })
389
+ ] })
390
+ ] }),
391
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
392
+ /* @__PURE__ */ jsxs(Label, { htmlFor: "book-apt-notes", children: [
393
+ "Notes",
394
+ " ",
395
+ /* @__PURE__ */ jsx("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
396
+ ] }),
397
+ /* @__PURE__ */ jsx(
398
+ Textarea,
399
+ {
400
+ id: "book-apt-notes",
401
+ placeholder: isClientMode ? "Let your advisor know what you'd like to discuss\u2026" : "e.g. Client wants to discuss refinancing their investment property\u2026",
402
+ value: notes,
403
+ onChange: (e) => setNotes(e.target.value),
404
+ className: "w-full resize-none",
405
+ rows: 2
406
+ }
407
+ )
408
+ ] })
409
+ ] }),
410
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
411
+ /* @__PURE__ */ jsx(DialogClose, { render: /* @__PURE__ */ jsx(Button, { variant: "outline" }), children: "Cancel" }),
412
+ /* @__PURE__ */ jsx(
413
+ Button,
414
+ {
415
+ disabled: !canSubmit,
416
+ onClick: () => {
417
+ if (canSubmit && date && selectedSlot) {
418
+ onBook == null ? void 0 : onBook({
419
+ clientId: clientId != null ? clientId : "",
420
+ meetingType,
421
+ date,
422
+ slot: selectedSlot,
423
+ notes,
424
+ meetingFormat,
425
+ offlineLocation: meetingFormat === "offline" ? offlineLocation : void 0,
426
+ customAddress: meetingFormat === "offline" && offlineLocation === "custom" ? customAddress : void 0,
427
+ callPhone: meetingFormat === "call" ? selectedPhone : void 0
428
+ });
429
+ handleOpenChange(false);
430
+ }
431
+ },
432
+ children: isClientMode ? "Book Appointment" : "Create appointment"
433
+ }
434
+ )
435
+ ] })
436
+ ] }) });
437
+ }
438
+
439
+ export {
440
+ AppointmentBookDialog
441
+ };
@@ -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";