@alfadocs/ui-kit 0.25.0 → 0.25.2

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 (178) hide show
  1. package/dist/_chunks/{agenda-card-BmpaUG1h.js → agenda-card-CznB7K8e.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-DiInnVqk.js → agenda-tray-C_bha7oK.js} +4 -4
  3. package/dist/_chunks/{ai-prompt-input-B5MdixzR.js → ai-prompt-input-Bka3jX3i.js} +2 -2
  4. package/dist/_chunks/{alia-sidebar-CUi2UCbY.js → alia-sidebar-CnvXq95r.js} +92 -109
  5. package/dist/_chunks/{audio-recorder-D4xM3H5i.js → audio-recorder-OB6IV9B1.js} +2 -2
  6. package/dist/_chunks/{autocomplete-C7xq06bP.js → autocomplete-CUh0f7Dj.js} +2 -2
  7. package/dist/_chunks/{avatar-BpFohgWG.js → avatar-D_H4emLo.js} +7 -7
  8. package/dist/_chunks/{benefit-card-DXmrAyfn.js → benefit-card-CjYM8vNr.js} +29 -29
  9. package/dist/_chunks/booking-CXngC-1u.js +1743 -0
  10. package/dist/_chunks/{calendar-zy0tUUVG.js → calendar-9eOXumpH.js} +113 -142
  11. package/dist/_chunks/{card-C353dU-H.js → card-DKTMLVrw.js} +11 -11
  12. package/dist/_chunks/{carousel.agent-DnPiqijR.js → carousel.agent-C9swH-Uf.js} +2 -2
  13. package/dist/_chunks/{chat-input-B3XmFGDw.js → chat-input-BfDcz1Yi.js} +2 -2
  14. package/dist/_chunks/{chat-message-W3k8rLOA.js → chat-message-fg221-yx.js} +2 -2
  15. package/dist/_chunks/{command-palette-DkL-aW4O.js → command-palette-11BieSNq.js} +2 -2
  16. package/dist/_chunks/{contact-card-CjG7c-1q.js → contact-card-CeEfEAxh.js} +2 -2
  17. package/dist/_chunks/{date-picker-BIoSLRly.js → date-picker-D0Ry1dMz.js} +26 -27
  18. package/dist/_chunks/{date-range-picker-9gANFNG9.js → date-range-picker-DYgHzMOo.js} +19 -20
  19. package/dist/_chunks/{date-time-picker-DG7BiGdb.js → date-time-picker-CGmGtcyc.js} +10 -11
  20. package/dist/_chunks/{description-list-Bsga4IW8.js → description-list-yl3y3QKg.js} +34 -24
  21. package/dist/_chunks/{dialog-DUomPCRS.js → dialog-BBXqpZIt.js} +2 -2
  22. package/dist/_chunks/{editable-currency-cell-renderer-DJB5MxAI.js → editable-currency-cell-renderer-DSReCae7.js} +7 -7
  23. package/dist/_chunks/{empty-state-3CLJIXSj.js → empty-state-BLy7tigq.js} +13 -33
  24. package/dist/_chunks/eye-LHlSU38h.js +21 -0
  25. package/dist/_chunks/{freemium-paywall-CM6V1zNf.js → freemium-paywall-B9c8Ylww.js} +11 -11
  26. package/dist/_chunks/{header-DqmKROIY.js → header-B8V_sNPy.js} +2 -2
  27. package/dist/_chunks/icon-button-BRHSSFmZ.js +70 -0
  28. package/dist/_chunks/{isSameDay-ecuM8PBB.js → isSameDay-DHG8Xade.js} +4 -4
  29. package/dist/_chunks/{key-value-pair-DBuOCtIc.js → key-value-pair-CqeKiP__.js} +2 -2
  30. package/dist/_chunks/{locale-picker-BxEUUPW7.js → locale-picker-BHxbTNmR.js} +297 -208
  31. package/dist/_chunks/{map-view-CcwycFQX.js → map-view-DyB8tr6c.js} +9 -9
  32. package/dist/_chunks/{matrix-rain-CRPMXcVx.js → matrix-rain-sDOUUwZp.js} +35 -35
  33. package/dist/_chunks/{message-card-i61k1TGc.js → message-card-DjRtA8GG.js} +3 -3
  34. package/dist/_chunks/{message-tray-DrV7G-wR.js → message-tray-DfsAMncP.js} +3 -3
  35. package/dist/_chunks/monitor-D-SFdbrU.js +16 -0
  36. package/dist/_chunks/{notification-card-ejOw5g6g.js → notification-card-B_847w5g.js} +3 -3
  37. package/dist/_chunks/{notification-tray-D_69dXFY.js → notification-tray-6f7smmT1.js} +22 -19
  38. package/dist/_chunks/patient-shell-Bq8CjRYF.js +173 -0
  39. package/dist/_chunks/{payment-form-F7uh0Rqr.js → payment-form-Ds3rxvad.js} +2 -2
  40. package/dist/_chunks/{pdf-viewer-CuYaVR1I.js → pdf-viewer-CIuaocnq.js} +2 -2
  41. package/dist/_chunks/{popover--derJ_wq.js → popover-D0slaBB9.js} +17 -13
  42. package/dist/_chunks/{privacy-lock-BKsI6ReN.js → privacy-lock-BI4vi9Ud.js} +2 -2
  43. package/dist/_chunks/{public-header.agent-BQ3r6Hgq.js → public-header.agent-5U3S9QiC.js} +49 -41
  44. package/dist/_chunks/react-day-picker-D3yzgvDB.js +3127 -0
  45. package/dist/_chunks/{recaptcha-widget-Kp1XntuE.js → recaptcha-widget-BtBNb6tB.js} +2 -2
  46. package/dist/_chunks/{search-bar-DORSAzNt.js → search-bar-BRMW1-WG.js} +2 -2
  47. package/dist/_chunks/{search-input-BtEJAJHa.js → search-input-CIA6pPfn.js} +2 -2
  48. package/dist/_chunks/{sheet-BT0izeoI.js → sheet-D8M8hf8B.js} +2 -2
  49. package/dist/_chunks/{sign-in-with-alfadocs-button-4zZC-I6y.js → sign-in-with-alfadocs-button-BI0fVonM.js} +2 -2
  50. package/dist/_chunks/{slot-grid-CgpYgBkW.js → slot-grid-DoodeQGZ.js} +4 -4
  51. package/dist/_chunks/sparkles-CuYXqQLg.js +23 -0
  52. package/dist/_chunks/{spinner-DirtWZNG.js → spinner-CCByyvcb.js} +2 -2
  53. package/dist/_chunks/stepper-accordion-BfS6lUB9.js +257 -0
  54. package/dist/_chunks/stepper-accordion.agent-C4quJ-MD.js +71 -0
  55. package/dist/_chunks/stethoscope-B8kpbtjh.js +35 -0
  56. package/dist/_chunks/{sun-Eweh5fvi.js → sun-BuXE0xUS.js} +3 -15
  57. package/dist/_chunks/{task-tray-B3A2fRGR.js → task-tray-Bcmrrs8m.js} +3 -3
  58. package/dist/_chunks/{theme-toggle-FrotC2VI.js → theme-toggle-nPzb378f.js} +37 -36
  59. package/dist/_chunks/{timeline-jmd7lfDf.js → timeline-CR7HjZCK.js} +3 -3
  60. package/dist/_chunks/{toast.agent-32WNQ-_x.js → toast.agent-CTF6nIj5.js} +2 -2
  61. package/dist/_chunks/{transcript-panel-DUrjx5sa.js → transcript-panel-QUQ9XJmf.js} +2 -2
  62. package/dist/_chunks/{use-password-requirements-C9vKBSVn.js → use-password-requirements-E0sSfx5X.js} +38 -53
  63. package/dist/_chunks/use-theme-C2dHKUAN.js +145 -0
  64. package/dist/_chunks/{workflow-map-BR6txfFX.js → workflow-map-BKsKdYvZ.js} +5 -5
  65. package/dist/agent-catalog.json +56 -51
  66. package/dist/components/agenda-card/index.js +1 -1
  67. package/dist/components/agenda-tray/index.js +1 -1
  68. package/dist/components/ai-prompt-input/index.js +1 -1
  69. package/dist/components/audio-recorder/index.js +1 -1
  70. package/dist/components/autocomplete/index.js +1 -1
  71. package/dist/components/avatar/index.js +1 -1
  72. package/dist/components/benefit-card/index.js +1 -1
  73. package/dist/components/booking/booking.agent.d.ts +4 -0
  74. package/dist/components/booking/booking.d.ts +91 -0
  75. package/dist/components/booking/index.d.ts +4 -0
  76. package/dist/components/booking/index.js +6 -0
  77. package/dist/components/button/index.js +1 -1
  78. package/dist/components/calendar/index.js +1 -1
  79. package/dist/components/card/index.js +1 -1
  80. package/dist/components/carousel/index.js +1 -1
  81. package/dist/components/chat-input/index.js +1 -1
  82. package/dist/components/chat-message/index.js +1 -1
  83. package/dist/components/command-palette/index.js +1 -1
  84. package/dist/components/contact-card/index.js +1 -1
  85. package/dist/components/data-table/index.js +1 -1
  86. package/dist/components/date-picker/index.js +1 -1
  87. package/dist/components/date-range-picker/index.js +1 -1
  88. package/dist/components/date-time-picker/index.js +1 -1
  89. package/dist/components/description-list/index.js +1 -1
  90. package/dist/components/dialog/index.js +1 -1
  91. package/dist/components/empty-state/index.js +1 -1
  92. package/dist/components/freemium-paywall/index.js +1 -1
  93. package/dist/components/header/index.js +1 -1
  94. package/dist/components/header-settings/index.js +60 -48
  95. package/dist/components/icon-button/index.js +1 -1
  96. package/dist/components/index.d.ts +1 -1
  97. package/dist/components/key-value-pair/index.js +1 -1
  98. package/dist/components/locale-picker/index.js +1 -1
  99. package/dist/components/map-view/index.js +1 -1
  100. package/dist/components/matrix-rain/index.js +1 -1
  101. package/dist/components/message-card/index.js +1 -1
  102. package/dist/components/message-tray/index.js +1 -1
  103. package/dist/components/notification-card/index.js +1 -1
  104. package/dist/components/notification-tray/index.js +1 -1
  105. package/dist/components/password-input/index.js +1 -1
  106. package/dist/components/payment-form/index.js +1 -1
  107. package/dist/components/pdf-viewer/index.js +1 -1
  108. package/dist/components/popover/index.js +1 -1
  109. package/dist/components/privacy-lock/index.js +1 -1
  110. package/dist/components/public-header/index.js +1 -1
  111. package/dist/components/recaptcha-widget/index.js +1 -1
  112. package/dist/components/search-bar/index.js +1 -1
  113. package/dist/components/search-input/index.js +1 -1
  114. package/dist/components/sheet/index.js +1 -1
  115. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  116. package/dist/components/slot-grid/index.js +1 -1
  117. package/dist/components/spinner/index.js +1 -1
  118. package/dist/components/stepper-accordion/index.js +4 -3
  119. package/dist/components/task-tray/index.js +1 -1
  120. package/dist/components/theme-toggle/index.js +1 -1
  121. package/dist/components/timeline/index.js +1 -1
  122. package/dist/components/toast/index.js +1 -1
  123. package/dist/components/transcript-panel/index.js +1 -1
  124. package/dist/components/workflow/index.js +1 -1
  125. package/dist/hooks/index.js +1 -1
  126. package/dist/i18n/config.js +1090 -46
  127. package/dist/i18n/locales/ar.d.ts +58 -0
  128. package/dist/i18n/locales/de.d.ts +58 -0
  129. package/dist/i18n/locales/el.d.ts +58 -0
  130. package/dist/i18n/locales/es.d.ts +58 -0
  131. package/dist/i18n/locales/fr.d.ts +58 -0
  132. package/dist/i18n/locales/hi.d.ts +58 -0
  133. package/dist/i18n/locales/ja.d.ts +58 -0
  134. package/dist/i18n/locales/nl.d.ts +58 -0
  135. package/dist/i18n/locales/pl.d.ts +58 -0
  136. package/dist/i18n/locales/pt.d.ts +58 -0
  137. package/dist/i18n/locales/ro.d.ts +58 -0
  138. package/dist/i18n/locales/ru.d.ts +58 -0
  139. package/dist/i18n/locales/sq.d.ts +58 -0
  140. package/dist/i18n/locales/sv.d.ts +58 -0
  141. package/dist/i18n/locales/tr.d.ts +58 -0
  142. package/dist/i18n/locales/zh.d.ts +58 -0
  143. package/dist/i18n/resources.d.ts +116 -0
  144. package/dist/index.js +270 -269
  145. package/dist/locales/ar.json +59 -1
  146. package/dist/locales/de.json +59 -1
  147. package/dist/locales/el.json +59 -1
  148. package/dist/locales/en.json +59 -1
  149. package/dist/locales/es.json +59 -1
  150. package/dist/locales/fr.json +59 -1
  151. package/dist/locales/hi.json +59 -1
  152. package/dist/locales/it.json +59 -1
  153. package/dist/locales/ja.json +59 -1
  154. package/dist/locales/nl.json +59 -1
  155. package/dist/locales/pl.json +59 -1
  156. package/dist/locales/pt.json +59 -1
  157. package/dist/locales/ro.json +59 -1
  158. package/dist/locales/ru.json +59 -1
  159. package/dist/locales/sq.json +59 -1
  160. package/dist/locales/sv.json +59 -1
  161. package/dist/locales/tr.json +59 -1
  162. package/dist/locales/zh.json +59 -1
  163. package/dist/patterns/alia-assistant/index.js +1 -1
  164. package/dist/patterns/patient-shell/index.js +1 -1
  165. package/dist/tokens.css +1 -1
  166. package/package.json +5 -1
  167. package/dist/_chunks/icon-button-C4CGcYuz.js +0 -54
  168. package/dist/_chunks/isSameMonth-5wNF2f4I.js +0 -1307
  169. package/dist/_chunks/patient-shell-B164drIa.js +0 -173
  170. package/dist/_chunks/react-day-picker-C5F3-TTX.js +0 -1827
  171. package/dist/_chunks/stepper-C-sIpRRU.js +0 -7
  172. package/dist/_chunks/stepper-accordion.agent-ckKYZCIP.js +0 -322
  173. package/dist/_chunks/stepper-calendar-BLOJUE0-.js +0 -648
  174. package/dist/_chunks/use-theme-B1cwAXJR.js +0 -145
  175. package/dist/components/stepper-calendar/index.d.ts +0 -4
  176. package/dist/components/stepper-calendar/index.js +0 -6
  177. package/dist/components/stepper-calendar/stepper-calendar.agent.d.ts +0 -4
  178. package/dist/components/stepper-calendar/stepper-calendar.d.ts +0 -62
@@ -1,648 +0,0 @@
1
- import { jsx as a, jsxs as C } from "react/jsx-runtime";
2
- import { forwardRef as ee, useMemo as N, useState as Z, useEffect as q, useRef as z, useCallback as Q, useImperativeHandle as Te } from "react";
3
- import { c as M } from "./index-D2ZczOXr.js";
4
- import { useTranslation as Ae } from "react-i18next";
5
- import { s as De } from "./stepper-C-sIpRRU.js";
6
- import { S as Le } from "./stepper-progress-jFY8BSf7.js";
7
- import { u as Re } from "./registry-C9nwlNyL.js";
8
- import { B as U } from "./button-DD_0Xdmr.js";
9
- import { I as se } from "./icon-button-C4CGcYuz.js";
10
- import { p as $, S as oe } from "./slot-grid-CgpYgBkW.js";
11
- import { S as ie } from "./skeleton-CZbwyJAA.js";
12
- import { E as pe } from "./empty-state-3CLJIXSj.js";
13
- import { a as Ie } from "./calendar-zy0tUUVG.js";
14
- import { a as X, s as de, b as V, c as _, f as Y, i as le } from "./isSameMonth-5wNF2f4I.js";
15
- import { C as ze } from "./chevron-left-CX1jqD2M.js";
16
- import { C as je } from "./chevron-right-BrpYejk0.js";
17
- import { i as Be } from "./isSameDay-ecuM8PBB.js";
18
- function ce(e, l, v) {
19
- return X(e, -1, v);
20
- }
21
- const Ee = {
22
- id: "stepper-calendar",
23
- capabilities: ["navigate", "view_change"],
24
- state: {
25
- currentStep: {
26
- type: "number",
27
- descriptionKey: "ui.agent.stepperCalendar.state.currentStep",
28
- description: "Zero-indexed active step (0 = service, 1 = date, 2 = time, 3 = details).",
29
- read: (e) => e.getCurrentStep()
30
- },
31
- totalSteps: {
32
- type: "number",
33
- descriptionKey: "ui.agent.stepperCalendar.state.totalSteps",
34
- description: "Total number of steps in the booking flow (always 4).",
35
- read: (e) => e.getTotalSteps()
36
- }
37
- },
38
- actions: {
39
- goto_step: {
40
- safety: "read",
41
- argsType: "{ step: number }",
42
- descriptionKey: "ui.agent.stepperCalendar.actions.gotoStep",
43
- description: "Jump to the given step. Steps beyond the first-incomplete are gated internally.",
44
- invoke: (e, l) => {
45
- e.gotoStep(l.step);
46
- }
47
- },
48
- next: {
49
- safety: "read",
50
- descriptionKey: "ui.agent.stepperCalendar.actions.next",
51
- description: "Advance to the next step when the current step has a valid value.",
52
- invoke: (e) => {
53
- e.next();
54
- }
55
- },
56
- previous: {
57
- safety: "read",
58
- descriptionKey: "ui.agent.stepperCalendar.actions.previous",
59
- description: "Return to the previous step.",
60
- invoke: (e) => {
61
- e.previous();
62
- }
63
- }
64
- },
65
- domHooks: {
66
- root: {
67
- attr: "data-component",
68
- value: "stepper-calendar",
69
- description: "Marks the StepperCalendar root region."
70
- },
71
- instanceId: {
72
- attr: "data-component-id",
73
- sourceProp: "id",
74
- description: "Sourced from the id prop."
75
- }
76
- }
77
- }, Fe = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})$/, I = 4, Ke = M(
78
- "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-md)] ds:text-[var(--foreground)]",
79
- {
80
- variants: {
81
- layout: {
82
- vertical: "ds:flex-col",
83
- horizontal: "ds:lg:flex-row ds:lg:items-start"
84
- },
85
- density: {
86
- comfortable: "ds:gap-[var(--spacing-md)]",
87
- compact: "ds:gap-[var(--spacing-sm)]"
88
- }
89
- },
90
- defaultVariants: {
91
- layout: "vertical",
92
- density: "comfortable"
93
- }
94
- }
95
- ), Ve = M(
96
- [
97
- "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
98
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:bg-[var(--card)]",
99
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
100
- "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
101
- ].join(" "),
102
- {
103
- variants: {
104
- density: {
105
- comfortable: "ds:gap-[var(--spacing-md)]",
106
- compact: "ds:gap-[var(--spacing-sm)]"
107
- }
108
- },
109
- defaultVariants: { density: "comfortable" }
110
- }
111
- ), _e = M(
112
- [
113
- "ds:group/service ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)] ds:text-start",
114
- "ds:rounded-[var(--radius-md)] ds:border ds:border-[var(--border)] ds:bg-[var(--background)]",
115
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
116
- "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
117
- "ds:min-h-[var(--min-target-size)]",
118
- "ds:transition-[background-color,border-color] ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]",
119
- "ds:motion-reduce:transition-none",
120
- "ds:hover:enabled:bg-[var(--muted)]/40",
121
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
122
- "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
123
- "ds:aria-checked:border-[var(--primary)] ds:aria-checked:bg-[var(--primary)]/5",
124
- "ds:disabled:opacity-50 ds:disabled:cursor-not-allowed"
125
- ].join(" ")
126
- ), $e = M(
127
- "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]"
128
- ), J = M(
129
- "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-xs)]"
130
- ), Ge = M(
131
- [
132
- "ds:inline-flex ds:items-center ds:justify-center",
133
- // `min-target-size` (44/48px) governs the rendered size — it always
134
- // exceeds the explicit floor below. Keeping the explicit floor for
135
- // grid layout stability when the cell content is empty (skeletons),
136
- // matching the precedent in `slot-grid`.
137
- "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
138
- "ds:h-10 ds:w-10 ds:rounded-[var(--radius-sm)]",
139
- "ds:text-[length:var(--font-size-sm)] ds:font-[var(--font-weight-medium)]",
140
- "ds:border ds:border-transparent ds:bg-[var(--background)] ds:text-[var(--foreground)]",
141
- "ds:transition-[background-color,border-color,color] ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]",
142
- "ds:motion-reduce:transition-none",
143
- "ds:hover:enabled:bg-[var(--muted)]/40",
144
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
145
- "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
146
- "ds:disabled:opacity-40 ds:disabled:cursor-not-allowed",
147
- "ds:aria-selected:bg-[var(--primary)] ds:aria-selected:text-[var(--primary-foreground)]",
148
- "ds:aria-selected:border-[var(--primary)]",
149
- "ds:data-[outside=true]:text-[var(--muted-foreground)]"
150
- ].join(" ")
151
- ), He = M(
152
- "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:mt-[var(--spacing-md)]"
153
- );
154
- function W(e) {
155
- return Y(e, "yyyy-MM-dd");
156
- }
157
- function Pe(e) {
158
- return e.serviceId ? e.date ? e.time ? 3 : 2 : 1 : 0;
159
- }
160
- const me = ee(
161
- ({ services: e, selectedId: l, onSelect: v, durationLabel: i, groupLabel: b }, u) => {
162
- const k = z([]), S = (() => {
163
- const r = e.findIndex((s) => s.id === l);
164
- return r >= 0 ? r : 0;
165
- })(), f = (r) => {
166
- const s = (r + e.length) % e.length, g = k.current[s];
167
- if (!g) return;
168
- g.focus();
169
- const d = e[s];
170
- d && v(d.id);
171
- }, n = (r, s) => {
172
- const g = typeof document < "u" && document.documentElement.dir === "rtl", d = g ? "ArrowLeft" : "ArrowRight", w = g ? "ArrowRight" : "ArrowLeft";
173
- if (r.key === d || r.key === "ArrowDown") {
174
- r.preventDefault(), f(s + 1);
175
- return;
176
- }
177
- if (r.key === w || r.key === "ArrowUp") {
178
- r.preventDefault(), f(s - 1);
179
- return;
180
- }
181
- if (r.key === "Home") {
182
- r.preventDefault(), f(0);
183
- return;
184
- }
185
- r.key === "End" && (r.preventDefault(), f(e.length - 1));
186
- };
187
- return /* @__PURE__ */ a(
188
- "div",
189
- {
190
- ref: u,
191
- role: "radiogroup",
192
- "aria-label": b,
193
- className: "ds:grid ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2",
194
- children: e.map((r, s) => {
195
- const g = r.id === l;
196
- return /* @__PURE__ */ C(
197
- "button",
198
- {
199
- ref: (w) => {
200
- k.current[s] = w;
201
- },
202
- type: "button",
203
- role: "radio",
204
- "aria-checked": g,
205
- tabIndex: s === S ? 0 : -1,
206
- onClick: () => v(r.id),
207
- onKeyDown: (w) => n(w, s),
208
- className: _e(),
209
- children: [
210
- /* @__PURE__ */ a("span", { className: "type-body-sm ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: r.label }),
211
- r.description ? /* @__PURE__ */ a("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: r.description }) : null,
212
- /* @__PURE__ */ a("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: i(r.durationMin) })
213
- ]
214
- },
215
- r.id
216
- );
217
- })
218
- }
219
- );
220
- }
221
- );
222
- me.displayName = "StepperCalendar.ServiceGrid";
223
- const fe = ee(
224
- ({
225
- availableDates: e,
226
- selectedDate: l,
227
- onSelectDate: v,
228
- loading: i,
229
- locale: b,
230
- weekStartsOn: u,
231
- prevLabel: k,
232
- nextLabel: S,
233
- emptyLabel: f
234
- }, n) => {
235
- const r = N(() => {
236
- if (l) return $(l);
237
- const t = [...e].sort()[0];
238
- return t ? $(t) : /* @__PURE__ */ new Date();
239
- }, [e, l]), [s, g] = Z(r), [d, w] = Z(
240
- l ? $(l) : r
241
- ), G = de(s), j = V(G, { weekStartsOn: u }), c = N(() => {
242
- const t = [];
243
- for (let p = 0; p < 42; p += 1)
244
- t.push(_(j, p));
245
- return t;
246
- }, [j]), H = N(() => {
247
- const t = V(/* @__PURE__ */ new Date(), { weekStartsOn: u }), p = new Intl.DateTimeFormat(b, { weekday: "short" });
248
- return Array.from({ length: 7 }, (A, x) => p.format(_(t, x)));
249
- }, [b, u]), T = N(() => {
250
- try {
251
- return new Intl.DateTimeFormat(b, {
252
- month: "long",
253
- year: "numeric"
254
- }).format(s);
255
- } catch {
256
- return Y(s, "MMMM yyyy");
257
- }
258
- }, [b, s]), B = Q(
259
- (t) => e.has(W(t)),
260
- [e]
261
- ), h = Q(
262
- (t) => {
263
- w(t), le(t, s) || g(de(t));
264
- },
265
- [s]
266
- ), o = (t) => {
267
- const p = {
268
- ArrowLeft: -1,
269
- ArrowRight: 1,
270
- ArrowUp: -7,
271
- ArrowDown: 7
272
- };
273
- if (t.key in p) {
274
- t.preventDefault(), h(_(d, p[t.key]));
275
- return;
276
- }
277
- if (t.key === "Home") {
278
- t.preventDefault(), h(V(d, { weekStartsOn: u }));
279
- return;
280
- }
281
- if (t.key === "End") {
282
- t.preventDefault(), h(_(V(d, { weekStartsOn: u }), 6));
283
- return;
284
- }
285
- if (t.key === "PageUp") {
286
- t.preventDefault(), h(ce(d));
287
- return;
288
- }
289
- if (t.key === "PageDown") {
290
- t.preventDefault(), h(X(d, 1));
291
- return;
292
- }
293
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), B(d) && v(W(d)));
294
- }, y = z(null);
295
- return q(() => {
296
- var t;
297
- (t = y.current) == null || t.focus();
298
- }, [d.getTime()]), i ? /* @__PURE__ */ C(
299
- "div",
300
- {
301
- ref: n,
302
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
303
- children: [
304
- /* @__PURE__ */ a(ie, { variant: "text", size: "md", width: "40%" }),
305
- /* @__PURE__ */ a("div", { className: J(), children: Array.from({ length: 42 }, (t, p) => /* @__PURE__ */ a(
306
- ie,
307
- {
308
- variant: "rounded",
309
- size: "md",
310
- height: "40px"
311
- },
312
- `day-skeleton-${p}`
313
- )) })
314
- ]
315
- }
316
- ) : e.size === 0 ? /* @__PURE__ */ a("div", { ref: n, children: /* @__PURE__ */ a(pe, { variant: "no-results", title: f }) }) : /* @__PURE__ */ C("div", { ref: n, className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
317
- /* @__PURE__ */ C("div", { className: $e(), children: [
318
- /* @__PURE__ */ a(
319
- se,
320
- {
321
- icon: /* @__PURE__ */ a(ze, {}),
322
- "aria-label": k,
323
- size: "sm",
324
- intent: "ghost",
325
- flipIconInRtl: !0,
326
- onClick: () => g(ce(s))
327
- }
328
- ),
329
- /* @__PURE__ */ a(
330
- "span",
331
- {
332
- className: "type-body-sm ds:font-[var(--font-weight-semibold)]",
333
- "aria-live": "polite",
334
- children: T
335
- }
336
- ),
337
- /* @__PURE__ */ a(
338
- se,
339
- {
340
- icon: /* @__PURE__ */ a(je, {}),
341
- "aria-label": S,
342
- size: "sm",
343
- intent: "ghost",
344
- flipIconInRtl: !0,
345
- onClick: () => g(X(s, 1))
346
- }
347
- )
348
- ] }),
349
- /* @__PURE__ */ C(
350
- "div",
351
- {
352
- role: "grid",
353
- "aria-label": T,
354
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
355
- onKeyDown: o,
356
- children: [
357
- /* @__PURE__ */ a("div", { className: J(), role: "row", children: H.map((t) => /* @__PURE__ */ a(
358
- "span",
359
- {
360
- role: "columnheader",
361
- className: "type-meta ds:text-center ds:text-[var(--muted-foreground)]",
362
- children: t
363
- },
364
- t
365
- )) }),
366
- Array.from({ length: 6 }, (t, p) => {
367
- const A = c.slice(p * 7, p * 7 + 7);
368
- return /* @__PURE__ */ a(
369
- "div",
370
- {
371
- role: "row",
372
- className: J(),
373
- children: A.map((x) => {
374
- const D = W(x), P = !le(x, s), L = B(x), E = l === D, F = Be(x, d);
375
- return /* @__PURE__ */ a(
376
- "button",
377
- {
378
- ref: F ? y : void 0,
379
- type: "button",
380
- role: "gridcell",
381
- "aria-selected": E,
382
- "aria-disabled": !L || void 0,
383
- disabled: !L,
384
- "data-outside": P || void 0,
385
- tabIndex: F ? 0 : -1,
386
- onClick: () => L && v(D),
387
- className: Ge(),
388
- children: Y(x, "d")
389
- },
390
- D
391
- );
392
- })
393
- },
394
- `week-${p}`
395
- );
396
- })
397
- ]
398
- }
399
- )
400
- ] });
401
- }
402
- );
403
- fe.displayName = "StepperCalendar.MonthGrid";
404
- function Oe({
405
- date: e,
406
- slots: l,
407
- selectedTime: v,
408
- loading: i,
409
- emptyLabel: b,
410
- onSelect: u
411
- }) {
412
- if (!e) return null;
413
- if (i)
414
- return /* @__PURE__ */ a(oe, { days: [{ date: e, slots: [] }], state: "loading" });
415
- if (l.length === 0)
416
- return /* @__PURE__ */ a(pe, { variant: "no-results", title: b });
417
- const k = l.map((f) => {
418
- const [n, r] = f.split(":"), s = $(e);
419
- return s.setHours(Number(n), Number(r), 0, 0), {
420
- id: `${e}T${f}`,
421
- start: s,
422
- label: f
423
- };
424
- });
425
- return /* @__PURE__ */ a(
426
- oe,
427
- {
428
- days: [{ date: e, slots: k }],
429
- selectedSlotId: v ? `${e}T${v}` : void 0,
430
- onSlotSelect: (f) => {
431
- const n = Fe.exec(f.id);
432
- n && u(n[2]);
433
- }
434
- }
435
- );
436
- }
437
- const Ue = ee(
438
- ({
439
- services: e,
440
- availableDates: l,
441
- availableSlots: v,
442
- value: i,
443
- onChange: b,
444
- onSubmit: u,
445
- detailsFields: k,
446
- loadingDates: S = !1,
447
- loadingSlots: f = !1,
448
- stepStatuses: n,
449
- layout: r = "vertical",
450
- density: s = "comfortable",
451
- "aria-label": g,
452
- id: d,
453
- className: w,
454
- ...G
455
- }, j) => {
456
- var ae;
457
- const { t: c, i18n: H } = Ae(), T = H.language ?? "en", B = N(
458
- () => Ie(T),
459
- [T]
460
- ), h = Pe(i), [o, y] = Z(h);
461
- q(() => {
462
- o > h && y(h);
463
- }, [o, h]);
464
- const t = z(null), p = z(!0);
465
- q(() => {
466
- var m;
467
- if (p.current) {
468
- p.current = !1;
469
- return;
470
- }
471
- (m = t.current) == null || m.focus();
472
- }, [o]);
473
- const A = N(
474
- () => [
475
- {
476
- label: c("navigation.stepperCalendar.steps.service"),
477
- status: n == null ? void 0 : n[0]
478
- },
479
- {
480
- label: c("navigation.stepperCalendar.steps.date"),
481
- status: n == null ? void 0 : n[1]
482
- },
483
- {
484
- label: c("navigation.stepperCalendar.steps.time"),
485
- status: n == null ? void 0 : n[2]
486
- },
487
- {
488
- label: c("navigation.stepperCalendar.steps.details"),
489
- status: n == null ? void 0 : n[3]
490
- }
491
- ],
492
- [n, c]
493
- ), x = g ?? c("navigation.stepperCalendar.label"), D = c("navigation.stepperCalendar.actions.back"), P = c("navigation.stepperCalendar.actions.next"), L = c("navigation.stepperCalendar.actions.submit"), E = c("navigation.stepperCalendar.time.empty"), F = c("navigation.stepperCalendar.date.previousMonth"), ue = c("navigation.stepperCalendar.date.nextMonth"), ge = c("navigation.stepperCalendar.steps.service"), ve = Q(
494
- (m) => c("navigation.stepperCalendar.service.duration", { minutes: m }),
495
- [c]
496
- ), O = o === 0 ? !!i.serviceId : o === 1 ? !!i.date : o === 2 ? !!i.time : !1, be = (m) => {
497
- b({ ...i, serviceId: m }), setTimeout(() => {
498
- y((K) => K === 0 ? 1 : K);
499
- }, 120);
500
- }, he = (m) => {
501
- b({ ...i, date: m, time: void 0 });
502
- }, ye = (m) => {
503
- b({ ...i, time: m });
504
- }, xe = () => y((m) => Math.max(0, m - 1)), we = () => y((m) => Math.min(I - 1, m + 1)), ke = () => u == null ? void 0 : u(i), te = `stepper-calendar-step-${o}-heading`, Ce = N(
505
- () => new Set(l),
506
- [l]
507
- );
508
- let R = null;
509
- o === 0 ? R = /* @__PURE__ */ a(
510
- me,
511
- {
512
- services: e,
513
- selectedId: i.serviceId,
514
- onSelect: be,
515
- durationLabel: ve,
516
- groupLabel: ge
517
- }
518
- ) : o === 1 ? R = /* @__PURE__ */ a(
519
- fe,
520
- {
521
- availableDates: Ce,
522
- selectedDate: i.date,
523
- onSelectDate: he,
524
- loading: S,
525
- locale: T,
526
- weekStartsOn: B,
527
- prevLabel: F,
528
- nextLabel: ue,
529
- emptyLabel: E
530
- }
531
- ) : o === 2 ? R = /* @__PURE__ */ a(
532
- Oe,
533
- {
534
- date: i.date,
535
- slots: i.date ? v[i.date] ?? [] : [],
536
- selectedTime: i.time,
537
- loading: f,
538
- emptyLabel: E,
539
- onSelect: ye
540
- }
541
- ) : R = /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: k });
542
- const Ne = o === I - 1, Me = De(
543
- o,
544
- o,
545
- n == null ? void 0 : n[o]
546
- ), Se = N(
547
- () => ({
548
- getCurrentStep: () => o,
549
- getTotalSteps: () => I,
550
- gotoStep: (m) => {
551
- const K = Math.max(0, Math.min(m, I - 1)), ne = Math.min(K, h);
552
- ne !== o && y(ne);
553
- },
554
- next: () => {
555
- o < I - 1 && O && y(o + 1);
556
- },
557
- previous: () => {
558
- o > 0 && y(o - 1);
559
- }
560
- }),
561
- [o, h, O]
562
- ), re = z(null);
563
- return Te(j, () => re.current, []), Re(Ee, Se, d), /* @__PURE__ */ C(
564
- "div",
565
- {
566
- ref: re,
567
- role: "region",
568
- "aria-label": x,
569
- id: d,
570
- "data-component": "stepper-calendar",
571
- "data-component-id": d,
572
- className: Ke({ layout: r, density: s, className: w }),
573
- ...G,
574
- children: [
575
- /* @__PURE__ */ a(
576
- Le,
577
- {
578
- activeStep: o,
579
- steps: A,
580
- "aria-label": x
581
- }
582
- ),
583
- /* @__PURE__ */ C(
584
- "section",
585
- {
586
- "aria-labelledby": te,
587
- className: Ve({ density: s }),
588
- "data-step": o,
589
- "data-state": Me,
590
- children: [
591
- /* @__PURE__ */ a(
592
- "h2",
593
- {
594
- ref: t,
595
- id: te,
596
- tabIndex: -1,
597
- className: "type-body-sm ds:font-[var(--font-weight-semibold)] ds:focus:outline-none",
598
- children: (ae = A[o]) == null ? void 0 : ae.label
599
- }
600
- ),
601
- R,
602
- /* @__PURE__ */ C("div", { className: He(), children: [
603
- /* @__PURE__ */ a(
604
- U,
605
- {
606
- type: "button",
607
- intent: "ghost",
608
- size: "md",
609
- onClick: xe,
610
- disabled: o === 0,
611
- children: D
612
- }
613
- ),
614
- Ne ? /* @__PURE__ */ a(
615
- U,
616
- {
617
- type: "button",
618
- intent: "primary",
619
- size: "md",
620
- onClick: ke,
621
- children: L
622
- }
623
- ) : /* @__PURE__ */ a(
624
- U,
625
- {
626
- type: "button",
627
- intent: "primary",
628
- size: "md",
629
- onClick: we,
630
- disabled: !O,
631
- children: P
632
- }
633
- )
634
- ] })
635
- ]
636
- }
637
- )
638
- ]
639
- }
640
- );
641
- }
642
- );
643
- Ue.displayName = "StepperCalendar";
644
- export {
645
- Ue as S,
646
- Ee as s
647
- };
648
- //# sourceMappingURL=stepper-calendar-BLOJUE0-.js.map