@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.
- package/.turbo/turbo-build.log +193 -149
- package/CHANGELOG.md +28 -0
- package/dist/{chunk-4Y6R4WEC.mjs → chunk-2A5RRQGG.mjs} +9 -22
- package/dist/{chunk-TS2ZX2VS.mjs → chunk-2UM72RJ7.mjs} +11 -15
- package/dist/{chunk-A56YQQHG.mjs → chunk-3NCUZIFP.mjs} +2 -2
- package/dist/chunk-3OYFOX3X.mjs +79 -0
- package/dist/{chunk-RP3SQYA3.mjs → chunk-3TTACBDP.mjs} +9 -4
- package/dist/chunk-4GAWMKMI.mjs +710 -0
- package/dist/{chunk-VGSESELX.mjs → chunk-5FQIKDKP.mjs} +5 -5
- package/dist/{chunk-K3JYD4IU.mjs → chunk-5IS7G74I.mjs} +11 -4
- package/dist/chunk-6AW4KJHE.mjs +235 -0
- package/dist/chunk-6CR5N2JW.mjs +302 -0
- package/dist/{chunk-XIRTEFKH.mjs → chunk-6DZEXFNB.mjs} +36 -8
- package/dist/chunk-6O6KD7CE.mjs +271 -0
- package/dist/chunk-7PV3IWCN.mjs +33 -0
- package/dist/{chunk-SPJ5KXW7.mjs → chunk-7S5AESZO.mjs} +5 -5
- package/dist/{chunk-RYCLWMZ7.mjs → chunk-ABFDMHOR.mjs} +9 -7
- package/dist/{chunk-SWGT756Z.mjs → chunk-AMQZRHEZ.mjs} +10 -4
- package/dist/{chunk-WAZD7NFU.mjs → chunk-BKNFWEH2.mjs} +6 -6
- package/dist/{chunk-CLIN5525.mjs → chunk-C7CQJNMR.mjs} +1 -1
- package/dist/{chunk-D4ILTPOG.mjs → chunk-CFMQP5QS.mjs} +5 -4
- package/dist/{chunk-VPBN3WOO.mjs → chunk-DGHAXJBN.mjs} +9 -7
- package/dist/chunk-DOEO3CDL.mjs +27 -0
- package/dist/{chunk-5MEWU56Z.mjs → chunk-DUJTAXMH.mjs} +11 -6
- package/dist/{chunk-GGM2UYGG.mjs → chunk-EBXQWIYG.mjs} +10 -4
- package/dist/chunk-EWRB4PAD.mjs +468 -0
- package/dist/{chunk-ZSHYDDRB.mjs → chunk-FAKPBKLT.mjs} +6 -2
- package/dist/{chunk-A6AAWBPF.mjs → chunk-GHC7LLUX.mjs} +13 -4
- package/dist/chunk-HBZLGDIN.mjs +507 -0
- package/dist/{chunk-SIZMLSRU.mjs → chunk-HISNT2MG.mjs} +8 -6
- package/dist/{chunk-CGH4DRNG.mjs → chunk-HVY6KCCF.mjs} +10 -7
- package/dist/chunk-I3RZS7V2.mjs +136 -0
- package/dist/chunk-IAE3F7DR.mjs +1962 -0
- package/dist/{chunk-UT4KJR7V.mjs → chunk-IHMFS7NZ.mjs} +35 -74
- package/dist/{chunk-PCPLO5HT.mjs → chunk-IOJRDS6V.mjs} +96 -14
- package/dist/{chunk-LHYCMLVA.mjs → chunk-JKGDCQTZ.mjs} +11 -4
- package/dist/{chunk-H45TKD34.mjs → chunk-JMHR3YGZ.mjs} +1 -1
- package/dist/{chunk-4MN6UQHG.mjs → chunk-K5A5L6T2.mjs} +17 -39
- package/dist/chunk-LV35NGVG.mjs +272 -0
- package/dist/{chunk-FZIXGLMV.mjs → chunk-M3FV7LOK.mjs} +5 -12
- package/dist/{chunk-FMAXJ2SI.mjs → chunk-MBON7YRJ.mjs} +1 -1
- package/dist/chunk-MIZQHHUO.mjs +441 -0
- package/dist/chunk-MLNEWRWV.mjs +449 -0
- package/dist/chunk-MN5NYQCL.mjs +29 -0
- package/dist/chunk-NL3ZO62D.mjs +31 -0
- package/dist/{chunk-Q76O3RIQ.mjs → chunk-NMOI6CQD.mjs} +1 -1
- package/dist/{chunk-P6AM5V7O.mjs → chunk-OODBHKG7.mjs} +1 -1
- package/dist/chunk-PBL4OQV2.mjs +283 -0
- package/dist/{chunk-Y4QFWRNR.mjs → chunk-PU4YZQXV.mjs} +17 -18
- package/dist/chunk-Q2BGOAMG.mjs +202 -0
- package/dist/chunk-QMY3AZJH.mjs +80 -0
- package/dist/{chunk-BL3DXM2X.mjs → chunk-QZ4RE6NA.mjs} +11 -4
- package/dist/{chunk-VACKZOMY.mjs → chunk-R3VSPKNP.mjs} +3 -3
- package/dist/{chunk-OPNQAVVH.mjs → chunk-RJI6GKVF.mjs} +8 -6
- package/dist/{chunk-WG6JGJXB.mjs → chunk-T4BJLT57.mjs} +1 -1
- package/dist/chunk-UMTOX62O.mjs +415 -0
- package/dist/{chunk-7MMXNK3C.mjs → chunk-VLARHE5V.mjs} +8 -6
- package/dist/{chunk-2I5S2AMY.mjs → chunk-XREGSKX3.mjs} +2 -2
- package/dist/{chunk-JNQORUPP.mjs → chunk-YJG55G2H.mjs} +14 -11
- package/dist/components/ui/add-column-modal.js +42 -14
- package/dist/components/ui/add-column-modal.mjs +5 -5
- package/dist/components/ui/add-lead-modal.js +42 -11
- package/dist/components/ui/add-lead-modal.mjs +3 -3
- package/dist/components/ui/advisor-card.js +530 -0
- package/dist/components/ui/advisor-card.mjs +15 -0
- package/dist/components/ui/ai-assistant-drawer.js +11 -10
- package/dist/components/ui/ai-assistant-drawer.mjs +3 -3
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert-dialog.mjs +2 -2
- package/dist/components/ui/appointment-action-dialogs.js +1160 -0
- package/dist/components/ui/appointment-action-dialogs.mjs +23 -0
- package/dist/components/ui/appointment-availability-settings.js +1590 -0
- package/dist/components/ui/appointment-availability-settings.mjs +23 -0
- package/dist/components/ui/appointment-book-dialog.js +1744 -0
- package/dist/components/ui/appointment-book-dialog.mjs +27 -0
- package/dist/components/ui/appointment-calendar-view.js +833 -0
- package/dist/components/ui/appointment-calendar-view.mjs +14 -0
- package/dist/components/ui/appointment-detail-sheet.js +1517 -0
- package/dist/components/ui/appointment-detail-sheet.mjs +24 -0
- package/dist/components/ui/appointment-gmail-connect.js +467 -0
- package/dist/components/ui/appointment-gmail-connect.mjs +14 -0
- package/dist/components/ui/appointment-mini-card.js +345 -0
- package/dist/components/ui/appointment-mini-card.mjs +11 -0
- package/dist/components/ui/appointment-time-slot-picker.js +311 -0
- package/dist/components/ui/appointment-time-slot-picker.mjs +13 -0
- package/dist/components/ui/appointment-upcoming-card.js +1268 -0
- package/dist/components/ui/appointment-upcoming-card.mjs +21 -0
- package/dist/components/ui/backoffice-alert-history-chart.js +11 -5
- package/dist/components/ui/backoffice-alert-history-chart.mjs +5 -4
- package/dist/components/ui/backoffice-alerts-chart.js +786 -0
- package/dist/components/ui/backoffice-alerts-chart.mjs +19 -0
- package/dist/components/ui/backoffice-connections-chart.js +817 -0
- package/dist/components/ui/backoffice-connections-chart.mjs +19 -0
- package/dist/components/ui/backoffice-contact-history-chart.js +11 -5
- package/dist/components/ui/backoffice-contact-history-chart.mjs +5 -4
- package/dist/components/ui/badge.js +6 -6
- package/dist/components/ui/badge.mjs +1 -1
- package/dist/components/ui/borrowing-capacity-line-chart.js +30 -21
- package/dist/components/ui/borrowing-capacity-line-chart.mjs +5 -4
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.mjs +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/calendar.mjs +2 -2
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/card.mjs +1 -1
- package/dist/components/ui/cash-balance-line-chart.js +31 -23
- package/dist/components/ui/cash-balance-line-chart.mjs +5 -4
- package/dist/components/ui/cashflow-bar-chart.js +12 -5
- package/dist/components/ui/cashflow-bar-chart.mjs +5 -4
- package/dist/components/ui/chip.js +97 -18
- package/dist/components/ui/chip.mjs +3 -2
- package/dist/components/ui/color-picker.js +158 -28
- package/dist/components/ui/color-picker.mjs +3 -1
- package/dist/components/ui/data-table.js +140 -119
- package/dist/components/ui/data-table.mjs +3 -2
- package/dist/components/ui/date-picker.js +48 -27
- package/dist/components/ui/date-picker.mjs +4 -3
- package/dist/components/ui/dialog.js +37 -9
- package/dist/components/ui/dialog.mjs +2 -2
- package/dist/components/ui/expense-bar-chart.js +12 -5
- package/dist/components/ui/expense-bar-chart.mjs +5 -4
- package/dist/components/ui/field.mjs +2 -2
- package/dist/components/ui/financial-cards.js +322 -155
- package/dist/components/ui/financial-cards.mjs +5 -3
- package/dist/components/ui/financial-drawers.js +2 -2
- package/dist/components/ui/financial-drawers.mjs +3 -3
- package/dist/components/ui/financial-sections.js +14 -10
- package/dist/components/ui/financial-sections.mjs +6 -5
- package/dist/components/ui/income-bar-chart.js +12 -5
- package/dist/components/ui/income-bar-chart.mjs +5 -4
- package/dist/components/ui/input-group.js +2 -2
- package/dist/components/ui/input-group.mjs +2 -2
- package/dist/components/ui/kanban-column.js +52 -44
- package/dist/components/ui/kanban-column.mjs +7 -5
- package/dist/components/ui/opportunity-card.js +52 -44
- package/dist/components/ui/opportunity-card.mjs +6 -4
- package/dist/components/ui/opportunity-edit-modals.js +1367 -1263
- package/dist/components/ui/opportunity-edit-modals.mjs +8 -8
- package/dist/components/ui/opportunity-summary-tab.js +2744 -2157
- package/dist/components/ui/opportunity-summary-tab.mjs +14 -14
- package/dist/components/ui/page-header.js +92 -0
- package/dist/components/ui/page-header.mjs +8 -0
- package/dist/components/ui/page-top-bar.js +88 -0
- package/dist/components/ui/page-top-bar.mjs +8 -0
- package/dist/components/ui/pagination.js +303 -19
- package/dist/components/ui/pagination.mjs +11 -4
- package/dist/components/ui/pipeline-board.js +205 -191
- package/dist/components/ui/pipeline-board.mjs +9 -7
- package/dist/components/ui/pipeline-dialogs.js +114 -65
- package/dist/components/ui/pipeline-dialogs.mjs +7 -6
- package/dist/components/ui/pipeline-primitives.js +6 -6
- package/dist/components/ui/pipeline-primitives.mjs +2 -2
- package/dist/components/ui/property-cashflow-doughnut-chart.js +14 -12
- package/dist/components/ui/property-cashflow-doughnut-chart.mjs +5 -4
- package/dist/components/ui/property-debt-equity-doughnut-chart.js +14 -12
- package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +5 -4
- package/dist/components/ui/property-mobile-estimate-line-chart.js +16 -14
- package/dist/components/ui/property-mobile-estimate-line-chart.mjs +5 -4
- package/dist/components/ui/sidebar-nav.js +426 -191
- package/dist/components/ui/sidebar-nav.mjs +5 -1
- package/dist/components/ui/stage-timeline.js +6 -6
- package/dist/components/ui/stage-timeline.mjs +3 -3
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +18 -16
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +5 -4
- package/dist/components/ui/transactions-income-expense-bar-chart.js +28 -12
- package/dist/components/ui/transactions-income-expense-bar-chart.mjs +5 -4
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +18 -16
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +5 -4
- package/dist/index.js +12258 -8611
- package/dist/index.mjs +258 -190
- package/dist/styles.css +1 -1
- package/package.json +71 -1
- package/src/components/index.tsx +115 -9
- package/src/components/ui/add-column-modal.tsx +7 -7
- package/src/components/ui/add-lead-modal.tsx +6 -3
- package/src/components/ui/advisor-card.tsx +284 -0
- package/src/components/ui/ai-assistant-drawer.tsx +4 -3
- package/src/components/ui/appointment-action-dialogs.tsx +297 -0
- package/src/components/ui/appointment-availability-settings.tsx +645 -0
- package/src/components/ui/appointment-book-dialog.tsx +618 -0
- package/src/components/ui/appointment-calendar-view.tsx +510 -0
- package/src/components/ui/appointment-detail-sheet.tsx +415 -0
- package/src/components/ui/appointment-gmail-connect.tsx +188 -0
- package/src/components/ui/appointment-mini-card.tsx +104 -0
- package/src/components/ui/appointment-time-slot-picker.tsx +123 -0
- package/src/components/ui/appointment-upcoming-card.tsx +635 -0
- package/src/components/ui/backoffice-alert-history-chart.tsx +10 -2
- package/src/components/ui/backoffice-alerts-chart.tsx +312 -0
- package/src/components/ui/backoffice-connections-chart.tsx +339 -0
- package/src/components/ui/backoffice-contact-history-chart.tsx +10 -2
- package/src/components/ui/badge.tsx +12 -6
- package/src/components/ui/borrowing-capacity-line-chart.tsx +4 -11
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/cash-balance-line-chart.tsx +4 -23
- package/src/components/ui/cashflow-bar-chart.tsx +9 -2
- package/src/components/ui/chart-shared.tsx +4 -11
- package/src/components/ui/chip.tsx +23 -19
- package/src/components/ui/color-picker.tsx +4 -2
- package/src/components/ui/data-table.tsx +28 -74
- package/src/components/ui/date-picker.tsx +42 -37
- package/src/components/ui/dialog.tsx +72 -6
- package/src/components/ui/expense-bar-chart.tsx +11 -2
- package/src/components/ui/financial-cards.tsx +99 -10
- package/src/components/ui/income-bar-chart.tsx +11 -2
- package/src/components/ui/opportunity-card.tsx +10 -39
- package/src/components/ui/opportunity-edit-modals.tsx +98 -36
- package/src/components/ui/opportunity-summary-tab.tsx +548 -232
- package/src/components/ui/page-header.tsx +57 -0
- package/src/components/ui/page-top-bar.tsx +48 -0
- package/src/components/ui/pagination.tsx +171 -22
- package/src/components/ui/pipeline-board.tsx +12 -5
- package/src/components/ui/property-cashflow-doughnut-chart.tsx +3 -1
- package/src/components/ui/property-debt-equity-doughnut-chart.tsx +3 -1
- package/src/components/ui/property-mobile-estimate-line-chart.tsx +3 -1
- package/src/components/ui/sidebar-nav.tsx +213 -157
- package/src/components/ui/transactions-expense-categories-doughnut-chart.tsx +3 -1
- package/src/components/ui/transactions-income-expense-bar-chart.tsx +12 -9
- package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +3 -1
- package/src/lib/format-currency.ts +44 -0
- package/src/lib/format-date.ts +50 -0
- package/src/lib/opportunity-constants.ts +12 -0
- package/src/styles/globals.css +17 -15
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +14 -0
- package/dist/chunk-S4QRUQNW.mjs +0 -475
- package/dist/chunk-URGMJAE3.mjs +0 -1885
- package/dist/chunk-WNGWBVLV.mjs +0 -148
- package/dist/chunk-ZRSDX6OW.mjs +0 -385
- 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
|
+
};
|