@wealthx/shadcn 1.5.22 → 1.5.24

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/dist/index.js CHANGED
@@ -2803,6 +2803,7 @@ function ChatComposer({
2803
2803
  mode,
2804
2804
  channel: channelProp = "chat",
2805
2805
  onChannelChange,
2806
+ channelType = "chat",
2806
2807
  isEmailIntegrated = false,
2807
2808
  contactEmail = "",
2808
2809
  inputValue = "",
@@ -2813,8 +2814,10 @@ function ChatComposer({
2813
2814
  onLetAiHandle,
2814
2815
  className
2815
2816
  }) {
2817
+ const showIntegrateEmailPrompt = channelType === "email" && !isEmailIntegrated;
2818
+ const initialChannel = channelType === "email" && isEmailIntegrated ? "email" : channelProp;
2816
2819
  const [channel, setChannel] = import_react5.default.useState(
2817
- isEmailIntegrated ? channelProp : "chat"
2820
+ isEmailIntegrated ? initialChannel : "chat"
2818
2821
  );
2819
2822
  const [emailTo, setEmailTo] = import_react5.default.useState(contactEmail);
2820
2823
  const [emailCc, setEmailCc] = import_react5.default.useState("");
@@ -2839,6 +2842,22 @@ function ChatComposer({
2839
2842
  setChannel(c);
2840
2843
  onChannelChange == null ? void 0 : onChannelChange(c);
2841
2844
  };
2845
+ if (showIntegrateEmailPrompt) {
2846
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2847
+ "div",
2848
+ {
2849
+ className: cn(
2850
+ "flex flex-col items-center justify-center gap-2 border-t border-border bg-muted/30 px-6 py-8 text-center",
2851
+ className
2852
+ ),
2853
+ children: [
2854
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react6.Mail, { className: "h-8 w-8 text-muted-foreground" }),
2855
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm font-medium text-foreground", children: "Email integration required" }),
2856
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-muted-foreground", children: "Please integrate your email to reply to this conversation." })
2857
+ ]
2858
+ }
2859
+ );
2860
+ }
2842
2861
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2843
2862
  "div",
2844
2863
  {
@@ -3038,6 +3057,7 @@ function ChatThread({
3038
3057
  isAiTyping = false,
3039
3058
  channel,
3040
3059
  onChannelChange,
3060
+ channelType,
3041
3061
  isEmailIntegrated,
3042
3062
  inputValue,
3043
3063
  onInputChange,
@@ -3229,6 +3249,7 @@ function ChatThread({
3229
3249
  mode,
3230
3250
  channel,
3231
3251
  onChannelChange,
3252
+ channelType,
3232
3253
  isEmailIntegrated,
3233
3254
  contactEmail: contact.email,
3234
3255
  inputValue,
@@ -3617,6 +3638,7 @@ function ConversationsPage({
3617
3638
  onChannelFilterChange,
3618
3639
  channel,
3619
3640
  onChannelChange,
3641
+ channelType,
3620
3642
  isEmailIntegrated,
3621
3643
  inputValue,
3622
3644
  internalNotes,
@@ -3703,6 +3725,7 @@ function ConversationsPage({
3703
3725
  isAiTyping,
3704
3726
  channel,
3705
3727
  onChannelChange,
3728
+ channelType,
3706
3729
  isEmailIntegrated,
3707
3730
  inputValue,
3708
3731
  onInputChange,
@@ -8384,6 +8407,15 @@ function AppointmentConfirmDialog({
8384
8407
  ] })
8385
8408
  ] }) });
8386
8409
  }
8410
+ var DAY_MAP = {
8411
+ Sun: 0,
8412
+ Mon: 1,
8413
+ Tue: 2,
8414
+ Wed: 3,
8415
+ Thu: 4,
8416
+ Fri: 5,
8417
+ Sat: 6
8418
+ };
8387
8419
  function AppointmentRescheduleDialog({
8388
8420
  open,
8389
8421
  onOpenChange,
@@ -8392,11 +8424,19 @@ function AppointmentRescheduleDialog({
8392
8424
  currentDate,
8393
8425
  currentTimeStart,
8394
8426
  currentTimeEnd,
8427
+ onDateChange,
8428
+ schedule,
8429
+ isLoadingSlots,
8395
8430
  onReschedule
8396
8431
  }) {
8397
8432
  const [date, setDate] = import_react13.default.useState(/* @__PURE__ */ new Date());
8398
8433
  const [slot, setSlot] = import_react13.default.useState();
8399
8434
  const [note, setNote] = import_react13.default.useState("");
8435
+ const today = import_react13.default.useMemo(() => /* @__PURE__ */ new Date(), []);
8436
+ const disabledDayOfWeek = import_react13.default.useMemo(
8437
+ () => schedule == null ? void 0 : schedule.filter((d) => !d.enabled).map((d) => DAY_MAP[d.day]).filter((n) => n !== void 0),
8438
+ [schedule]
8439
+ );
8400
8440
  const handleOpenChange = (next) => {
8401
8441
  if (!next) {
8402
8442
  setDate(/* @__PURE__ */ new Date());
@@ -8414,87 +8454,93 @@ function AppointmentRescheduleDialog({
8414
8454
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DialogDescription, { children: "Select a new date and time slot. The client will be notified by email." })
8415
8455
  ] }),
8416
8456
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Separator, {}),
8417
- (currentDate || currentTimeStart) && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
8418
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Current booking" }),
8419
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-4 border border-border bg-muted/30 px-3 py-2.5 text-sm text-muted-foreground", children: [
8420
- currentDate && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "flex items-center gap-1.5", children: [
8421
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.Calendar, { className: "h-3.5 w-3.5 shrink-0" }),
8422
- currentDate
8423
- ] }),
8424
- currentTimeStart && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "flex items-center gap-1.5", children: [
8425
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.Clock, { className: "h-3.5 w-3.5 shrink-0" }),
8426
- currentTimeStart,
8427
- currentTimeEnd ? ` \u2013 ${currentTimeEnd}` : ""
8457
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-4 overflow-y-auto max-h-[calc(90vh-200px)]", children: [
8458
+ (currentDate || currentTimeStart) && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
8459
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Current booking" }),
8460
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center gap-4 border border-border bg-muted/30 px-3 py-2.5 text-sm text-muted-foreground", children: [
8461
+ currentDate && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "flex items-center gap-1.5", children: [
8462
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.Calendar, { className: "h-3.5 w-3.5 shrink-0" }),
8463
+ currentDate
8464
+ ] }),
8465
+ currentTimeStart && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "flex items-center gap-1.5", children: [
8466
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react23.Clock, { className: "h-3.5 w-3.5 shrink-0" }),
8467
+ currentTimeStart,
8468
+ currentTimeEnd ? ` \u2013 ${currentTimeEnd}` : ""
8469
+ ] })
8428
8470
  ] })
8429
- ] })
8430
- ] }),
8431
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid grid-cols-[auto_1fr] items-start gap-5", children: [
8432
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
8433
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Label, { children: "New date" }),
8434
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8435
- Calendar3,
8436
- {
8437
- mode: "single",
8438
- selected: date,
8439
- onSelect: (d) => {
8440
- setDate(d);
8441
- setSlot(void 0);
8442
- },
8443
- captionLayout: "label",
8444
- fromDate: /* @__PURE__ */ new Date(),
8445
- disabled: { before: /* @__PURE__ */ new Date() },
8446
- className: "border border-border"
8447
- }
8448
- )
8449
8471
  ] }),
8450
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex flex-col gap-5", children: date ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
8451
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
8472
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid grid-cols-[auto_1fr] items-start gap-5", children: [
8473
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
8474
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Label, { children: "New date" }),
8475
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8476
+ Calendar3,
8477
+ {
8478
+ mode: "single",
8479
+ selected: date,
8480
+ onSelect: (d) => {
8481
+ setDate(d);
8482
+ setSlot(void 0);
8483
+ if (d) onDateChange == null ? void 0 : onDateChange(d);
8484
+ },
8485
+ captionLayout: "label",
8486
+ fromDate: today,
8487
+ disabled: disabledDayOfWeek && disabledDayOfWeek.length > 0 ? [{ before: today }, { dayOfWeek: disabledDayOfWeek }] : { before: today },
8488
+ className: "border border-border"
8489
+ }
8490
+ )
8491
+ ] }),
8492
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex flex-col gap-5", children: date ? isLoadingSlots ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-8 text-center", children: [
8493
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm font-semibold", children: "Loading slots\u2026" }),
8494
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "Fetching available times for the selected date." })
8495
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
8496
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex items-center justify-between", children: [
8497
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm font-semibold", children: "Select a time slot" }),
8498
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
8499
+ totalAvailable,
8500
+ " available"
8501
+ ] })
8502
+ ] }),
8503
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8504
+ AppointmentSlotSection,
8505
+ {
8506
+ label: "Morning",
8507
+ slots: amSlots,
8508
+ selectedSlotId: slot == null ? void 0 : slot.id,
8509
+ onSelect: setSlot
8510
+ }
8511
+ ),
8512
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8513
+ AppointmentSlotSection,
8514
+ {
8515
+ label: "Afternoon",
8516
+ slots: pmSlots,
8517
+ selectedSlotId: slot == null ? void 0 : slot.id,
8518
+ onSelect: setSlot
8519
+ }
8520
+ )
8521
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-8 text-center", children: [
8452
8522
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm font-semibold", children: "Select a time slot" }),
8453
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
8454
- totalAvailable,
8455
- " available"
8456
- ] })
8523
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "Pick a date on the left to see available slots." })
8524
+ ] }) })
8525
+ ] }),
8526
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
8527
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Label, { htmlFor: "reschedule-note", children: [
8528
+ "Note",
8529
+ " ",
8530
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
8457
8531
  ] }),
8458
8532
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8459
- AppointmentSlotSection,
8460
- {
8461
- label: "Morning",
8462
- slots: amSlots,
8463
- selectedSlotId: slot == null ? void 0 : slot.id,
8464
- onSelect: setSlot
8465
- }
8466
- ),
8467
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8468
- AppointmentSlotSection,
8533
+ Textarea,
8469
8534
  {
8470
- label: "Afternoon",
8471
- slots: pmSlots,
8472
- selectedSlotId: slot == null ? void 0 : slot.id,
8473
- onSelect: setSlot
8535
+ id: "reschedule-note",
8536
+ placeholder: "e.g. Rescheduling due to an internal conflict \u2014 apologies for the inconvenience\u2026",
8537
+ value: note,
8538
+ onChange: (e) => setNote(e.target.value),
8539
+ className: "w-full resize-none",
8540
+ rows: 2
8474
8541
  }
8475
8542
  )
8476
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-8 text-center", children: [
8477
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm font-semibold", children: "Select a time slot" }),
8478
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs text-muted-foreground", children: "Pick a date on the left to see available slots." })
8479
- ] }) })
8480
- ] }),
8481
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
8482
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Label, { htmlFor: "reschedule-note", children: [
8483
- "Note",
8484
- " ",
8485
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "font-normal text-muted-foreground", children: "(optional)" })
8486
- ] }),
8487
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8488
- Textarea,
8489
- {
8490
- id: "reschedule-note",
8491
- placeholder: "e.g. Rescheduling due to an internal conflict \u2014 apologies for the inconvenience\u2026",
8492
- value: note,
8493
- onChange: (e) => setNote(e.target.value),
8494
- className: "w-full resize-none",
8495
- rows: 2
8496
- }
8497
- )
8543
+ ] })
8498
8544
  ] }),
8499
8545
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(DialogFooter, { children: [
8500
8546
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DialogClose, { render: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Button, { variant: "outline" }), children: "Cancel" }),
@@ -9058,12 +9104,17 @@ var import_jsx_runtime46 = require("react/jsx-runtime");
9058
9104
  function ClientSearch({
9059
9105
  clients,
9060
9106
  value,
9061
- onValueChange
9107
+ onValueChange,
9108
+ onSearch,
9109
+ isSearching,
9110
+ hasMore,
9111
+ onLoadMore,
9112
+ isLoadingMore
9062
9113
  }) {
9063
9114
  const [query, setQuery] = import_react14.default.useState("");
9064
9115
  const [open, setOpen] = import_react14.default.useState(false);
9065
9116
  const selected = clients.find((c) => c.id === value);
9066
- const filtered = clients.filter((c) => {
9117
+ const filtered = onSearch ? clients : clients.filter((c) => {
9067
9118
  const q = query.toLowerCase();
9068
9119
  return c.name.toLowerCase().includes(q) || c.email.toLowerCase().includes(q);
9069
9120
  });
@@ -9073,67 +9124,79 @@ function ClientSearch({
9073
9124
  {
9074
9125
  value: selected ? selected.name : query,
9075
9126
  onChange: (e) => {
9076
- setQuery(e.target.value);
9127
+ const v = e.target.value;
9128
+ setQuery(v);
9077
9129
  if (selected) onValueChange(void 0);
9078
- setOpen(e.target.value.length > 0);
9130
+ setOpen(v.length > 0);
9131
+ onSearch == null ? void 0 : onSearch(v);
9079
9132
  },
9080
9133
  onBlur: () => setTimeout(() => setOpen(false), 150),
9081
9134
  placeholder: "Search by name or email\u2026",
9082
9135
  autoComplete: "off"
9083
9136
  }
9084
9137
  ),
9085
- open && (filtered.length > 0 || query.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "absolute z-50 mt-1 w-full border border-border bg-popover shadow-md", children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No clients found." }) : filtered.map((c) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
9086
- Button,
9087
- {
9088
- type: "button",
9089
- variant: "ghost",
9090
- className: "h-auto w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-primary/5",
9091
- onMouseDown: (e) => e.preventDefault(),
9092
- onClick: () => {
9093
- onValueChange(c.id);
9094
- setQuery("");
9095
- setOpen(false);
9138
+ open && (filtered.length > 0 || query.length > 0 || isSearching) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "absolute z-50 mt-1 max-h-64 w-full overflow-y-auto border border-border bg-popover shadow-md", children: isSearching ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "Searching..." }) : filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No clients found." }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
9139
+ filtered.map((c) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
9140
+ Button,
9141
+ {
9142
+ type: "button",
9143
+ variant: "ghost",
9144
+ className: "h-auto w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-primary/5",
9145
+ onMouseDown: (e) => e.preventDefault(),
9146
+ onClick: () => {
9147
+ onValueChange(c.id);
9148
+ setQuery("");
9149
+ setOpen(false);
9150
+ },
9151
+ children: [
9152
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-medium", children: c.name }),
9153
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-muted-foreground", children: c.email })
9154
+ ]
9096
9155
  },
9097
- children: [
9098
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-medium", children: c.name }),
9099
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-muted-foreground", children: c.email })
9100
- ]
9101
- },
9102
- c.id
9103
- )) })
9156
+ c.id
9157
+ )),
9158
+ hasMore && onLoadMore && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
9159
+ Button,
9160
+ {
9161
+ type: "button",
9162
+ variant: "ghost",
9163
+ size: "sm",
9164
+ className: "w-full text-sm text-primary",
9165
+ disabled: isLoadingMore,
9166
+ onMouseDown: (e) => e.preventDefault(),
9167
+ onClick: onLoadMore,
9168
+ children: isLoadingMore ? "Loading..." : "Load more"
9169
+ }
9170
+ )
9171
+ ] }) })
9104
9172
  ] });
9105
9173
  }
9106
- var FORMAT_OPTIONS = [
9107
- { value: "call", label: "Call", icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.Phone, { className: "h-4 w-4" }) },
9108
- {
9174
+ function getFormatOptions(platform) {
9175
+ const call = {
9176
+ value: "call",
9177
+ label: "Call",
9178
+ icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.Phone, { className: "h-4 w-4" })
9179
+ };
9180
+ const googleMeet = {
9109
9181
  value: "google-meet",
9110
9182
  label: "Google Meet",
9111
9183
  icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.Video, { className: "h-4 w-4" })
9112
- },
9113
- {
9184
+ };
9185
+ const msTeams = {
9114
9186
  value: "microsoft-teams",
9115
9187
  label: "MS Teams",
9116
9188
  icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.Users, { className: "h-4 w-4" })
9117
- },
9118
- {
9119
- value: "offline",
9120
- label: "Offline",
9121
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.MapPin, { className: "h-4 w-4" })
9122
- }
9123
- ];
9124
- var CLIENT_FORMAT_OPTIONS = [
9125
- { value: "call", label: "Call", icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.Phone, { className: "h-4 w-4" }) },
9126
- {
9127
- value: "online",
9128
- label: "Online Meeting",
9129
- icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.Video, { className: "h-4 w-4" })
9130
- },
9131
- {
9189
+ };
9190
+ const offline = {
9132
9191
  value: "offline",
9133
9192
  label: "Offline Meeting",
9134
9193
  icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react26.MapPin, { className: "h-4 w-4" })
9135
- }
9136
- ];
9194
+ };
9195
+ if (platform === "google-meet") return [call, googleMeet, offline];
9196
+ if (platform === "microsoft-teams") return [call, msTeams, offline];
9197
+ if (platform === "any") return [call, googleMeet, msTeams, offline];
9198
+ return [call, offline];
9199
+ }
9137
9200
  function MeetingFormatSection({
9138
9201
  format: format5,
9139
9202
  onFormatChange,
@@ -9250,7 +9313,7 @@ function BookingConfirmationScreen({
9250
9313
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Button, { className: "w-full", onClick: onDone, children: "Done" })
9251
9314
  ] });
9252
9315
  }
9253
- var DAY_MAP = {
9316
+ var DAY_MAP2 = {
9254
9317
  Sun: 0,
9255
9318
  Mon: 1,
9256
9319
  Tue: 2,
@@ -9263,6 +9326,11 @@ function AppointmentBookDialog({
9263
9326
  open,
9264
9327
  onOpenChange,
9265
9328
  clients = [],
9329
+ onSearchClients,
9330
+ isSearchingClients,
9331
+ hasMoreClients,
9332
+ onLoadMoreClients,
9333
+ isLoadingMoreClients,
9266
9334
  meetingTypes = [],
9267
9335
  amSlots,
9268
9336
  pmSlots,
@@ -9273,14 +9341,15 @@ function AppointmentBookDialog({
9273
9341
  advisorInfo,
9274
9342
  initialClientId,
9275
9343
  defaultMeetingFormat,
9344
+ onlinePlatform,
9276
9345
  guestInfo,
9277
9346
  onBook
9278
9347
  }) {
9279
9348
  var _a, _b, _c;
9280
- const isClientMode = clients.length === 0;
9349
+ const isClientMode = clients.length === 0 && !onSearchClients;
9281
9350
  const showGuestForm = isClientMode && !((guestInfo == null ? void 0 : guestInfo.name) && (guestInfo == null ? void 0 : guestInfo.email));
9282
9351
  const disabledDayOfWeek = import_react14.default.useMemo(
9283
- () => schedule == null ? void 0 : schedule.filter((d) => !d.enabled).map((d) => DAY_MAP[d.day]).filter((n) => n !== void 0),
9352
+ () => schedule == null ? void 0 : schedule.filter((d) => !d.enabled).map((d) => DAY_MAP2[d.day]).filter((n) => n !== void 0),
9284
9353
  [schedule]
9285
9354
  );
9286
9355
  const today = import_react14.default.useMemo(() => /* @__PURE__ */ new Date(), []);
@@ -9369,7 +9438,12 @@ function AppointmentBookDialog({
9369
9438
  {
9370
9439
  clients,
9371
9440
  value: clientId,
9372
- onValueChange: setClientId
9441
+ onValueChange: setClientId,
9442
+ onSearch: onSearchClients,
9443
+ isSearching: isSearchingClients,
9444
+ hasMore: hasMoreClients,
9445
+ onLoadMore: onLoadMoreClients,
9446
+ isLoadingMore: isLoadingMoreClients
9373
9447
  }
9374
9448
  )
9375
9449
  ] }),
@@ -9427,7 +9501,7 @@ function AppointmentBookDialog({
9427
9501
  )
9428
9502
  ] })
9429
9503
  ] }),
9430
- !(isClientMode && defaultMeetingFormat) && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
9504
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex flex-col gap-1.5", children: [
9431
9505
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Label, { children: "Meeting format" }),
9432
9506
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
9433
9507
  MeetingFormatSection,
@@ -9441,7 +9515,7 @@ function AppointmentBookDialog({
9441
9515
  advisorOfficeAddress,
9442
9516
  clientHomeAddress,
9443
9517
  isClientMode,
9444
- formatOptions: isClientMode ? CLIENT_FORMAT_OPTIONS : FORMAT_OPTIONS
9518
+ formatOptions: getFormatOptions(onlinePlatform)
9445
9519
  }
9446
9520
  )
9447
9521
  ] }),
@@ -10041,6 +10115,9 @@ function AppointmentDetailSheet({
10041
10115
  clientProfile,
10042
10116
  amSlots,
10043
10117
  pmSlots,
10118
+ onDateChange,
10119
+ schedule,
10120
+ isLoadingSlots,
10044
10121
  onAccept,
10045
10122
  onDecline,
10046
10123
  onReschedule,
@@ -10241,6 +10318,9 @@ function AppointmentDetailSheet({
10241
10318
  currentDate: appointment.date,
10242
10319
  currentTimeStart: appointment.timeStart,
10243
10320
  currentTimeEnd: appointment.timeEnd,
10321
+ onDateChange,
10322
+ schedule,
10323
+ isLoadingSlots,
10244
10324
  onReschedule: (date, slot, note) => {
10245
10325
  onReschedule == null ? void 0 : onReschedule(appointment.id, date, slot, note);
10246
10326
  setRescheduleOpen(false);
package/dist/index.mjs CHANGED
@@ -364,7 +364,7 @@ import {
364
364
  } from "./chunk-R2ON6CAN.mjs";
365
365
  import {
366
366
  AppointmentBookDialog
367
- } from "./chunk-NEMWMXGL.mjs";
367
+ } from "./chunk-3HFOSFOM.mjs";
368
368
  import {
369
369
  RadioGroup,
370
370
  RadioGroupCard,
@@ -384,7 +384,7 @@ import {
384
384
  } from "./chunk-V23CBULF.mjs";
385
385
  import {
386
386
  AppointmentDetailSheet
387
- } from "./chunk-F3MIRXRF.mjs";
387
+ } from "./chunk-ONYADWSO.mjs";
388
388
  import {
389
389
  AppointmentGmailConnect
390
390
  } from "./chunk-7TMPOZDE.mjs";
@@ -408,7 +408,7 @@ import {
408
408
  import {
409
409
  AppointmentConfirmDialog,
410
410
  AppointmentRescheduleDialog
411
- } from "./chunk-SET6GFGL.mjs";
411
+ } from "./chunk-ZSMQZ3VN.mjs";
412
412
  import {
413
413
  AppointmentSlotSection,
414
414
  AppointmentTimeSlotPicker
@@ -517,7 +517,7 @@ import {
517
517
  ConversationStatusChip,
518
518
  ConversationsPage,
519
519
  LeadInfoPanel
520
- } from "./chunk-K4GJTP6N.mjs";
520
+ } from "./chunk-RYGZRDP6.mjs";
521
521
  import {
522
522
  Tooltip,
523
523
  TooltipContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wealthx/shadcn",
3
- "version": "1.5.22",
3
+ "version": "1.5.24",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",