@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,833 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, { get: all[name], enumerable: true });
40
+ };
41
+ var __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from === "object" || typeof from === "function") {
43
+ for (let key of __getOwnPropNames(from))
44
+ if (!__hasOwnProp.call(to, key) && key !== except)
45
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
+ }
47
+ return to;
48
+ };
49
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
+ // If the importer is in node compatibility mode or this is not an ESM
51
+ // file that has been converted to a CommonJS file using a Babel-
52
+ // compatible transform (i.e. "__esModule" has not been set), then set
53
+ // "default" to the CommonJS "module.exports" for node compatibility.
54
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
+ mod
56
+ ));
57
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
+
59
+ // src/components/ui/appointment-calendar-view.tsx
60
+ var appointment_calendar_view_exports = {};
61
+ __export(appointment_calendar_view_exports, {
62
+ AppointmentCalendarView: () => AppointmentCalendarView
63
+ });
64
+ module.exports = __toCommonJS(appointment_calendar_view_exports);
65
+
66
+ // src/components/ui/avatar.tsx
67
+ var import_avatar = require("@base-ui/react/avatar");
68
+
69
+ // src/lib/utils.ts
70
+ var import_clsx = require("clsx");
71
+ var import_tailwind_merge = require("tailwind-merge");
72
+ var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
73
+ extend: {
74
+ classGroups: {
75
+ "font-size": [
76
+ {
77
+ text: [
78
+ "display-large",
79
+ "display-medium",
80
+ "display-small",
81
+ "h1",
82
+ "h2",
83
+ "h3",
84
+ "h4",
85
+ "h5",
86
+ "h6",
87
+ "body-large",
88
+ "body-medium",
89
+ "body-small",
90
+ "label-large",
91
+ "label-medium",
92
+ "label-small",
93
+ "button",
94
+ "button-xs",
95
+ "caption",
96
+ "overline",
97
+ "code"
98
+ ]
99
+ }
100
+ ]
101
+ }
102
+ }
103
+ });
104
+ function cn(...inputs) {
105
+ return twMerge((0, import_clsx.clsx)(inputs));
106
+ }
107
+
108
+ // src/components/ui/avatar.tsx
109
+ var import_jsx_runtime = require("react/jsx-runtime");
110
+ function Avatar(_a) {
111
+ var _b = _a, {
112
+ className,
113
+ size = "default"
114
+ } = _b, props = __objRest(_b, [
115
+ "className",
116
+ "size"
117
+ ]);
118
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
+ import_avatar.Avatar.Root,
120
+ __spreadValues({
121
+ className: cn(
122
+ "group/avatar relative flex size-8 shrink-0 rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",
123
+ className
124
+ ),
125
+ "data-size": size,
126
+ "data-slot": "avatar"
127
+ }, props)
128
+ );
129
+ }
130
+ function AvatarFallback(_a) {
131
+ var _b = _a, {
132
+ className
133
+ } = _b, props = __objRest(_b, [
134
+ "className"
135
+ ]);
136
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
137
+ import_avatar.Avatar.Fallback,
138
+ __spreadValues({
139
+ className: cn(
140
+ "flex size-full items-center justify-center rounded-full overflow-hidden bg-muted text-body-small font-sans text-muted-foreground group-data-[size=sm]/avatar:text-caption",
141
+ className
142
+ ),
143
+ "data-slot": "avatar-fallback"
144
+ }, props)
145
+ );
146
+ }
147
+
148
+ // src/components/ui/badge.tsx
149
+ var import_class_variance_authority = require("class-variance-authority");
150
+
151
+ // src/lib/slot.tsx
152
+ var React = __toESM(require("react"));
153
+ function mergeRefs(...refs) {
154
+ return (value) => {
155
+ for (const ref of refs) {
156
+ if (typeof ref === "function") ref(value);
157
+ else if (ref !== null)
158
+ ref.current = value;
159
+ }
160
+ };
161
+ }
162
+ var Slot = React.forwardRef(
163
+ (_a, forwardedRef) => {
164
+ var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
165
+ const child = React.Children.only(children);
166
+ if (!React.isValidElement(child)) return null;
167
+ const childProps = child.props;
168
+ const merged = __spreadValues({}, props);
169
+ for (const key of Object.keys(childProps)) {
170
+ if (key === "className") {
171
+ merged.className = [props.className, childProps.className].filter(Boolean).join(" ");
172
+ } else if (key === "style") {
173
+ merged.style = __spreadValues(__spreadValues({}, props.style), childProps.style);
174
+ } else if (key.startsWith("on") && typeof childProps[key] === "function") {
175
+ const parentHandler = props[key];
176
+ if (typeof parentHandler === "function") {
177
+ merged[key] = (...args) => {
178
+ childProps[key](...args);
179
+ parentHandler(...args);
180
+ };
181
+ } else {
182
+ merged[key] = childProps[key];
183
+ }
184
+ } else {
185
+ merged[key] = childProps[key];
186
+ }
187
+ }
188
+ const childRef = child.ref;
189
+ merged.ref = forwardedRef ? mergeRefs(forwardedRef, childRef) : childRef;
190
+ return React.cloneElement(
191
+ child,
192
+ merged
193
+ );
194
+ }
195
+ );
196
+ Slot.displayName = "Slot";
197
+
198
+ // src/components/ui/badge.tsx
199
+ var import_jsx_runtime2 = require("react/jsx-runtime");
200
+ var badgeVariants = (0, import_class_variance_authority.cva)(
201
+ "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2.5 py-0.5 text-xs font-medium font-sans whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
202
+ {
203
+ variants: {
204
+ variant: {
205
+ default: "border-primary/40 bg-primary/10 text-foreground [a&]:hover:bg-primary/15",
206
+ secondary: "border-border bg-muted text-muted-foreground [a&]:hover:bg-muted/80",
207
+ destructive: "border-destructive/40 bg-destructive/10 text-destructive-text focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/15",
208
+ success: "border-success/40 bg-success/10 text-success-text [a&]:hover:bg-success/15",
209
+ warning: "border-warning/40 bg-warning/10 text-warning-text [a&]:hover:bg-warning/15",
210
+ info: "border-info/40 bg-info/10 text-info-text [a&]:hover:bg-info/15",
211
+ outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
212
+ ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
213
+ link: "text-primary underline-offset-4 [a&]:hover:underline"
214
+ }
215
+ },
216
+ defaultVariants: {
217
+ variant: "default"
218
+ }
219
+ }
220
+ );
221
+ function Badge(_a) {
222
+ var _b = _a, {
223
+ className,
224
+ variant = "default",
225
+ asChild = false
226
+ } = _b, props = __objRest(_b, [
227
+ "className",
228
+ "variant",
229
+ "asChild"
230
+ ]);
231
+ const Comp = asChild ? Slot : "span";
232
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
233
+ Comp,
234
+ __spreadValues({
235
+ className: cn(badgeVariants({ variant }), className),
236
+ "data-slot": "badge",
237
+ "data-variant": variant
238
+ }, props)
239
+ );
240
+ }
241
+
242
+ // src/components/ui/button.tsx
243
+ var import_react = require("react");
244
+ var import_class_variance_authority2 = require("class-variance-authority");
245
+ var import_lucide_react = require("lucide-react");
246
+ var import_jsx_runtime3 = require("react/jsx-runtime");
247
+ var buttonVariants = (0, import_class_variance_authority2.cva)(
248
+ "inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-button whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
249
+ {
250
+ variants: {
251
+ variant: {
252
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
253
+ secondary: "bg-brand-secondary text-brand-secondary-foreground shadow-xs hover:bg-brand-secondary/80 focus-visible:ring-brand-secondary/30",
254
+ destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
255
+ outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground focus-visible:ring-border/50 dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
256
+ "outline-primary": "border border-primary text-foreground bg-transparent shadow-xs hover:bg-primary/5 focus-visible:ring-primary/50",
257
+ "outline-secondary": "border border-brand-secondary text-brand-secondary bg-transparent shadow-xs hover:bg-brand-secondary/10 focus-visible:ring-brand-secondary/30",
258
+ ghost: "hover:bg-accent hover:text-accent-foreground hover:shadow-xs focus-visible:ring-border/50 dark:hover:bg-accent/50",
259
+ link: "text-primary underline-offset-4 hover:underline"
260
+ },
261
+ size: {
262
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
263
+ xs: "h-6 gap-1 px-2 text-button-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
264
+ sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
265
+ lg: "h-10 px-6 has-[>svg]:px-4",
266
+ icon: "size-9",
267
+ "icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
268
+ "icon-sm": "size-8",
269
+ "icon-lg": "size-10"
270
+ }
271
+ },
272
+ defaultVariants: {
273
+ variant: "default",
274
+ size: "default"
275
+ }
276
+ }
277
+ );
278
+ var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
279
+ var _b = _a, {
280
+ className,
281
+ variant,
282
+ size,
283
+ asChild = false,
284
+ loading = false,
285
+ disabled,
286
+ type = "button",
287
+ children
288
+ } = _b, props = __objRest(_b, [
289
+ "className",
290
+ "variant",
291
+ "size",
292
+ "asChild",
293
+ "loading",
294
+ "disabled",
295
+ "type",
296
+ "children"
297
+ ]);
298
+ const Comp = asChild ? Slot : "button";
299
+ const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
300
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
301
+ Comp,
302
+ __spreadProps(__spreadValues({
303
+ className: cn(buttonVariants({ variant, size, className })),
304
+ "data-size": size,
305
+ "data-slot": "button",
306
+ "data-variant": variant,
307
+ disabled: loading || disabled,
308
+ ref,
309
+ type
310
+ }, props), {
311
+ children: loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
312
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
313
+ !isIconOnly && children
314
+ ] }) : children
315
+ })
316
+ );
317
+ });
318
+
319
+ // src/components/ui/separator.tsx
320
+ var import_separator = require("@base-ui/react/separator");
321
+ var import_jsx_runtime4 = require("react/jsx-runtime");
322
+ function Separator(_a) {
323
+ var _b = _a, {
324
+ className,
325
+ orientation = "horizontal"
326
+ } = _b, props = __objRest(_b, [
327
+ "className",
328
+ "orientation"
329
+ ]);
330
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
331
+ import_separator.Separator,
332
+ __spreadValues({
333
+ className: cn(
334
+ "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
335
+ className
336
+ ),
337
+ "data-orientation": orientation,
338
+ "data-slot": "separator"
339
+ }, props)
340
+ );
341
+ }
342
+
343
+ // src/components/ui/tabs.tsx
344
+ var import_class_variance_authority3 = require("class-variance-authority");
345
+ var import_tabs = require("@base-ui/react/tabs");
346
+ var import_jsx_runtime5 = require("react/jsx-runtime");
347
+ function Tabs(_a) {
348
+ var _b = _a, {
349
+ className,
350
+ orientation = "horizontal"
351
+ } = _b, props = __objRest(_b, [
352
+ "className",
353
+ "orientation"
354
+ ]);
355
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
356
+ import_tabs.Tabs.Root,
357
+ __spreadValues({
358
+ className: cn(
359
+ "group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
360
+ className
361
+ ),
362
+ "data-orientation": orientation,
363
+ "data-slot": "tabs"
364
+ }, props)
365
+ );
366
+ }
367
+ var tabsListVariants = (0, import_class_variance_authority3.cva)(
368
+ "group/tabs-list inline-flex w-fit items-center justify-center gap-1 rounded-none p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
369
+ {
370
+ variants: {
371
+ variant: {
372
+ default: "bg-muted",
373
+ line: "bg-transparent p-0"
374
+ }
375
+ },
376
+ defaultVariants: {
377
+ variant: "default"
378
+ }
379
+ }
380
+ );
381
+ function TabsList(_a) {
382
+ var _b = _a, {
383
+ className,
384
+ variant = "default"
385
+ } = _b, props = __objRest(_b, [
386
+ "className",
387
+ "variant"
388
+ ]);
389
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
390
+ import_tabs.Tabs.List,
391
+ __spreadValues({
392
+ className: cn(tabsListVariants({ variant }), className),
393
+ "data-slot": "tabs-list",
394
+ "data-variant": variant
395
+ }, props)
396
+ );
397
+ }
398
+ function TabsTrigger(_a) {
399
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
400
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
401
+ import_tabs.Tabs.Tab,
402
+ __spreadValues({
403
+ className: cn(
404
+ // Base layout & typography
405
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap",
406
+ "rounded-none border border-transparent px-1.5 py-1 text-label-medium",
407
+ "text-muted-foreground transition-all",
408
+ // Vertical orientation
409
+ "group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start",
410
+ // Hover & focus
411
+ "hover:text-foreground",
412
+ "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring",
413
+ // Disabled
414
+ "disabled:pointer-events-none disabled:opacity-50",
415
+ // Active state — Default variant: primary/10 bg + subtle shadow
416
+ // Base UI uses data-active attribute for the active/selected tab
417
+ "data-active:bg-primary/10 data-active:text-foreground",
418
+ "group-data-[variant=default]/tabs-list:data-active:shadow-sm",
419
+ // Active state — Line variant: suppress bg & shadow
420
+ "group-data-[variant=line]/tabs-list:data-active:bg-transparent",
421
+ "group-data-[variant=line]/tabs-list:data-active:shadow-none",
422
+ // Indicator pseudo-element (visible only for Line variant, active state)
423
+ "after:absolute after:bg-primary after:opacity-0 after:transition-opacity",
424
+ "group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5",
425
+ "group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5",
426
+ "group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
427
+ // SVG icons
428
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
429
+ className
430
+ ),
431
+ "data-slot": "tabs-trigger"
432
+ }, props)
433
+ );
434
+ }
435
+ function TabsContent(_a) {
436
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
437
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
438
+ import_tabs.Tabs.Panel,
439
+ __spreadValues({
440
+ className: cn("flex-1 outline-none", className),
441
+ "data-slot": "tabs-content"
442
+ }, props)
443
+ );
444
+ }
445
+
446
+ // src/components/ui/appointment-calendar-view.tsx
447
+ var import_lucide_react2 = require("lucide-react");
448
+ var import_jsx_runtime6 = require("react/jsx-runtime");
449
+ var STATUS_COLORS = {
450
+ pending: "border-l-warning bg-warning/5",
451
+ confirmed: "border-l-success bg-success/5",
452
+ cancelled: "border-l-destructive bg-destructive/5",
453
+ rescheduled: "border-l-info bg-info/5"
454
+ };
455
+ var STATUS_CONFIG = {
456
+ pending: {
457
+ variant: "warning",
458
+ label: "Pending",
459
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.CalendarClock, { size: 12 })
460
+ },
461
+ confirmed: {
462
+ variant: "success",
463
+ label: "Confirmed",
464
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 12 })
465
+ },
466
+ cancelled: {
467
+ variant: "destructive",
468
+ label: "Cancelled",
469
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.X, { size: 12 })
470
+ },
471
+ rescheduled: {
472
+ variant: "info",
473
+ label: "Rescheduled",
474
+ icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.RefreshCw, { size: 12 })
475
+ }
476
+ };
477
+ function formatHour(h) {
478
+ if (h === 12) return "12 PM";
479
+ return h < 12 ? `${h} AM` : `${h - 12} PM`;
480
+ }
481
+ function getHourFromTime(time) {
482
+ const match = time.match(/^(\d+):/);
483
+ if (!match) return 0;
484
+ const h = parseInt(match[1], 10);
485
+ return time.includes("PM") && h !== 12 ? h + 12 : h;
486
+ }
487
+ var DEFAULT_HOURS = [9, 10, 11, 12, 13, 14, 15, 16, 17];
488
+ function DayView({
489
+ appointments,
490
+ date,
491
+ today,
492
+ hours,
493
+ onSelectAppointment
494
+ }) {
495
+ const d = /* @__PURE__ */ new Date(date + "T00:00:00");
496
+ const dayLabel = d.toLocaleDateString("en-AU", { weekday: "short" }).toUpperCase();
497
+ const dayShort = d.getDate();
498
+ const isToday = date === today;
499
+ const dayApts = appointments.filter((a) => a.date === date);
500
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col", children: [
501
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "grid grid-cols-[48px_1fr] border-b border-border", children: [
502
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "border-r border-border" }),
503
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
504
+ "div",
505
+ {
506
+ className: `flex flex-col items-center gap-1 py-3 ${isToday ? "bg-primary/5" : ""}`,
507
+ children: [
508
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
509
+ "span",
510
+ {
511
+ className: `text-xs font-medium tracking-wide ${isToday ? "font-semibold text-primary" : "text-muted-foreground"}`,
512
+ children: dayLabel
513
+ }
514
+ ),
515
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
516
+ "span",
517
+ {
518
+ className: `flex h-10 w-10 items-center justify-center text-xl font-semibold ${isToday ? "bg-primary text-primary-foreground" : ""}`,
519
+ children: dayShort
520
+ }
521
+ )
522
+ ]
523
+ }
524
+ )
525
+ ] }),
526
+ hours.map((hour) => {
527
+ const aptsAtHour = dayApts.filter(
528
+ (a) => getHourFromTime(a.timeStart) === hour
529
+ );
530
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
531
+ "div",
532
+ {
533
+ className: "grid min-h-[60px] grid-cols-[48px_1fr] border-b border-border/40 last:border-b-0",
534
+ children: [
535
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
536
+ "div",
537
+ {
538
+ className: `flex items-start justify-end border-r border-border pr-2 pt-1 ${isToday ? "bg-primary/5" : ""}`,
539
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] text-muted-foreground", children: formatHour(hour) })
540
+ }
541
+ ),
542
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
543
+ "div",
544
+ {
545
+ className: `flex flex-col gap-1.5 p-1.5 ${isToday ? "bg-primary/5" : ""}`,
546
+ children: aptsAtHour.map((apt) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
547
+ Button,
548
+ {
549
+ type: "button",
550
+ variant: "ghost",
551
+ onClick: () => onSelectAppointment == null ? void 0 : onSelectAppointment(apt),
552
+ className: `h-auto w-full justify-start gap-3 border-l-2 px-3 py-2 text-left hover:opacity-80 ${STATUS_COLORS[apt.status]}`,
553
+ children: [
554
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Avatar, { className: "h-7 w-7 shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AvatarFallback, { className: "text-xs", children: apt.clientAvatarInitials }) }),
555
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
556
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-sm font-semibold", children: apt.clientName }),
557
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
558
+ apt.timeStart,
559
+ " \u2013 ",
560
+ apt.timeEnd
561
+ ] })
562
+ ] }),
563
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Badge, { variant: STATUS_CONFIG[apt.status].variant, children: STATUS_CONFIG[apt.status].label })
564
+ ]
565
+ },
566
+ apt.id
567
+ ))
568
+ }
569
+ )
570
+ ]
571
+ },
572
+ hour
573
+ );
574
+ })
575
+ ] });
576
+ }
577
+ function WeekView({
578
+ appointments,
579
+ weekDays,
580
+ today,
581
+ hours,
582
+ onSelectAppointment
583
+ }) {
584
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col overflow-x-auto", children: [
585
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
586
+ "div",
587
+ {
588
+ className: "grid border-b border-border",
589
+ style: { gridTemplateColumns: `48px repeat(${weekDays.length}, 1fr)` },
590
+ children: [
591
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "border-r border-border" }),
592
+ weekDays.map((day) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
593
+ "div",
594
+ {
595
+ className: `flex flex-col items-center border-r border-border py-2 last:border-r-0 ${day.date === today ? "bg-primary/5" : ""}`,
596
+ children: [
597
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
598
+ "span",
599
+ {
600
+ className: `text-xs font-medium ${day.date === today ? "font-semibold text-primary" : "text-muted-foreground"}`,
601
+ children: day.label
602
+ }
603
+ ),
604
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
605
+ "span",
606
+ {
607
+ className: `text-sm font-semibold ${day.date === today ? "text-primary" : ""}`,
608
+ children: day.short
609
+ }
610
+ )
611
+ ]
612
+ },
613
+ day.date
614
+ ))
615
+ ]
616
+ }
617
+ ),
618
+ hours.map((hour) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
619
+ "div",
620
+ {
621
+ className: "grid border-b border-border/40 last:border-b-0",
622
+ style: {
623
+ gridTemplateColumns: `48px repeat(${weekDays.length}, 1fr)`
624
+ },
625
+ children: [
626
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-start justify-end border-r border-border pr-2 pt-1", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] text-muted-foreground", children: formatHour(hour) }) }),
627
+ weekDays.map((day) => {
628
+ const aptsAtCell = appointments.filter(
629
+ (a) => a.date === day.date && getHourFromTime(a.timeStart) === hour
630
+ );
631
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
632
+ "div",
633
+ {
634
+ className: `min-h-[44px] overflow-hidden border-r border-border/40 p-0.5 last:border-r-0 ${day.date === today ? "bg-primary/5" : ""}`,
635
+ children: aptsAtCell.map((apt) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
636
+ Button,
637
+ {
638
+ type: "button",
639
+ variant: "ghost",
640
+ className: `h-auto w-full justify-start truncate border-l-2 px-1 py-1 text-left text-xs font-medium hover:opacity-80 ${STATUS_COLORS[apt.status]}`,
641
+ onClick: () => onSelectAppointment == null ? void 0 : onSelectAppointment(apt),
642
+ children: [
643
+ apt.timeStart,
644
+ " ",
645
+ apt.clientName
646
+ ]
647
+ },
648
+ apt.id
649
+ ))
650
+ },
651
+ day.date
652
+ );
653
+ })
654
+ ]
655
+ },
656
+ hour
657
+ ))
658
+ ] });
659
+ }
660
+ var MONTH_DAY_HEADERS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
661
+ function generateMonthGrid(year, month) {
662
+ const firstDay = new Date(year, month, 1);
663
+ const lastDay = new Date(year, month + 1, 0);
664
+ const startDow = firstDay.getDay();
665
+ const grid = [];
666
+ let week = Array.from({ length: startDow }, () => null);
667
+ for (let day = 1; day <= lastDay.getDate(); day++) {
668
+ week.push(new Date(year, month, day));
669
+ if (week.length === 7) {
670
+ grid.push(week);
671
+ week = [];
672
+ }
673
+ }
674
+ if (week.length > 0) {
675
+ while (week.length < 7) week.push(null);
676
+ grid.push(week);
677
+ }
678
+ return grid;
679
+ }
680
+ function MonthView({
681
+ appointments,
682
+ today,
683
+ onSelectAppointment
684
+ }) {
685
+ const todayDate = /* @__PURE__ */ new Date(today + "T00:00:00");
686
+ const grid = generateMonthGrid(todayDate.getFullYear(), todayDate.getMonth());
687
+ const toIso = (d) => d.toISOString().slice(0, 10);
688
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col", children: [
689
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "grid grid-cols-7 border-b border-border", children: MONTH_DAY_HEADERS.map((d) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
690
+ "div",
691
+ {
692
+ className: "flex items-center justify-center border-r border-border/40 py-2 last:border-r-0",
693
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-xs font-medium text-muted-foreground", children: d })
694
+ },
695
+ d
696
+ )) }),
697
+ grid.map((week, wi) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
698
+ "div",
699
+ {
700
+ className: "grid grid-cols-7 border-b border-border last:border-b-0",
701
+ children: week.map((day, di) => {
702
+ const iso = day ? toIso(day) : null;
703
+ const dayApts = iso ? appointments.filter((a) => a.date === iso) : [];
704
+ const isToday = iso === today;
705
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
706
+ "div",
707
+ {
708
+ className: `min-h-[80px] border-r border-border/40 p-1 last:border-r-0 ${!day ? "bg-muted/20" : ""} ${isToday ? "bg-primary/5" : ""}`,
709
+ children: day && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
710
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
711
+ "div",
712
+ {
713
+ className: `mb-1 flex h-6 w-6 items-center justify-center text-xs font-semibold ${isToday ? "bg-primary text-primary-foreground" : "text-foreground"}`,
714
+ children: day.getDate()
715
+ }
716
+ ),
717
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col gap-0.5", children: [
718
+ dayApts.slice(0, 2).map((apt) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
719
+ Button,
720
+ {
721
+ type: "button",
722
+ variant: "ghost",
723
+ onClick: () => onSelectAppointment == null ? void 0 : onSelectAppointment(apt),
724
+ className: `h-auto w-full justify-start truncate border-l-2 px-1 py-0.5 text-left text-[10px] font-medium hover:opacity-80 ${STATUS_COLORS[apt.status]}`,
725
+ children: [
726
+ apt.timeStart,
727
+ " ",
728
+ apt.clientName
729
+ ]
730
+ },
731
+ apt.id
732
+ )),
733
+ dayApts.length > 2 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "px-1 text-[10px] text-muted-foreground", children: [
734
+ "+",
735
+ dayApts.length - 2,
736
+ " more"
737
+ ] })
738
+ ] })
739
+ ] })
740
+ },
741
+ di
742
+ );
743
+ })
744
+ },
745
+ wi
746
+ ))
747
+ ] });
748
+ }
749
+ function AppointmentCalendarView({
750
+ appointments,
751
+ today,
752
+ periodLabel,
753
+ weekDays,
754
+ hours = DEFAULT_HOURS,
755
+ dayViewDate,
756
+ defaultView = "week",
757
+ onPrev,
758
+ onNext,
759
+ onToday,
760
+ onSelectAppointment,
761
+ toolbarActions
762
+ }) {
763
+ const dayDate = dayViewDate != null ? dayViewDate : today;
764
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col border border-border bg-card", children: [
765
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center justify-between gap-4 px-4 py-3", children: [
766
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2", children: [
767
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
768
+ Button,
769
+ {
770
+ variant: "outline",
771
+ size: "sm",
772
+ className: "gap-1",
773
+ onClick: onPrev,
774
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.ChevronLeft, { className: "h-3.5 w-3.5" })
775
+ }
776
+ ),
777
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm font-medium", children: periodLabel }),
778
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
779
+ Button,
780
+ {
781
+ variant: "outline",
782
+ size: "sm",
783
+ className: "gap-1",
784
+ onClick: onNext,
785
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.ChevronRight, { className: "h-3.5 w-3.5" })
786
+ }
787
+ ),
788
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: "outline", size: "sm", onClick: onToday, children: "Today" })
789
+ ] }),
790
+ toolbarActions && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center gap-2", children: toolbarActions })
791
+ ] }),
792
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Separator, {}),
793
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Tabs, { defaultValue: defaultView, className: "flex flex-col", children: [
794
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "px-4 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(TabsList, { children: [
795
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "day", children: "Day" }),
796
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "week", children: "Week" }),
797
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsTrigger, { value: "month", children: "Month" })
798
+ ] }) }),
799
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "day", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
800
+ DayView,
801
+ {
802
+ appointments,
803
+ date: dayDate,
804
+ today,
805
+ hours,
806
+ onSelectAppointment
807
+ }
808
+ ) }),
809
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "week", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
810
+ WeekView,
811
+ {
812
+ appointments,
813
+ weekDays,
814
+ today,
815
+ hours,
816
+ onSelectAppointment
817
+ }
818
+ ) }),
819
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TabsContent, { value: "month", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
820
+ MonthView,
821
+ {
822
+ appointments,
823
+ today,
824
+ onSelectAppointment
825
+ }
826
+ ) })
827
+ ] })
828
+ ] });
829
+ }
830
+ // Annotate the CommonJS export names for ESM import in node:
831
+ 0 && (module.exports = {
832
+ AppointmentCalendarView
833
+ });