@alfadocs/ui-kit 0.25.1 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) 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-BYuc_8HV.js +2250 -0
  10. package/dist/_chunks/{calendar-zy0tUUVG.js → calendar-WWNx448i.js} +114 -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-DYbp--s-.js} +3 -3
  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-CkMb1TZS.js} +24 -24
  27. package/dist/_chunks/heart-pulse-CvuyFKHB.js +21 -0
  28. package/dist/_chunks/icon-button-BRHSSFmZ.js +70 -0
  29. package/dist/_chunks/{isSameDay-ecuM8PBB.js → isSameDay-DHG8Xade.js} +4 -4
  30. package/dist/_chunks/{key-value-pair-DBuOCtIc.js → key-value-pair-CqeKiP__.js} +2 -2
  31. package/dist/_chunks/{link-DmM5IevO.js → link-DrD_cRUg.js} +50 -45
  32. package/dist/_chunks/{locale-picker-BxEUUPW7.js → locale-picker-BHxbTNmR.js} +297 -208
  33. package/dist/_chunks/{map-view-CcwycFQX.js → map-view-DyB8tr6c.js} +9 -9
  34. package/dist/_chunks/{matrix-rain-CRPMXcVx.js → matrix-rain-sDOUUwZp.js} +35 -35
  35. package/dist/_chunks/{message-card-i61k1TGc.js → message-card-DjRtA8GG.js} +3 -3
  36. package/dist/_chunks/{message-tray-DrV7G-wR.js → message-tray-DfsAMncP.js} +3 -3
  37. package/dist/_chunks/monitor-D-SFdbrU.js +16 -0
  38. package/dist/_chunks/{notification-card-ejOw5g6g.js → notification-card-B_847w5g.js} +3 -3
  39. package/dist/_chunks/{notification-tray-D_69dXFY.js → notification-tray-6f7smmT1.js} +22 -19
  40. package/dist/_chunks/parseISO-Dk4xa7q6.js +120 -0
  41. package/dist/_chunks/patient-search-BhlxYAI3.js +1102 -0
  42. package/dist/_chunks/patient-shell-CAXYzbRw.js +173 -0
  43. package/dist/_chunks/{payment-form-F7uh0Rqr.js → payment-form-Ds3rxvad.js} +2 -2
  44. package/dist/_chunks/{pdf-viewer-CuYaVR1I.js → pdf-viewer-CIuaocnq.js} +2 -2
  45. package/dist/_chunks/{popover--derJ_wq.js → popover-D0slaBB9.js} +17 -13
  46. package/dist/_chunks/{privacy-lock-BKsI6ReN.js → privacy-lock-BI4vi9Ud.js} +2 -2
  47. package/dist/_chunks/public-footer.agent-CA29gxHJ.js +516 -0
  48. package/dist/_chunks/{public-header.agent-BQ3r6Hgq.js → public-header.agent-5U3S9QiC.js} +49 -41
  49. package/dist/_chunks/react-day-picker-D3yzgvDB.js +3127 -0
  50. package/dist/_chunks/{recaptcha-widget-Kp1XntuE.js → recaptcha-widget-BtBNb6tB.js} +2 -2
  51. package/dist/_chunks/reviews-panel-CFttsfuC.js +513 -0
  52. package/dist/_chunks/{search-bar-DORSAzNt.js → search-bar-BRMW1-WG.js} +2 -2
  53. package/dist/_chunks/{search-input-BtEJAJHa.js → search-input-CIA6pPfn.js} +2 -2
  54. package/dist/_chunks/{sheet-BT0izeoI.js → sheet-D8M8hf8B.js} +2 -2
  55. package/dist/_chunks/{sign-in-with-alfadocs-button-4zZC-I6y.js → sign-in-with-alfadocs-button-BI0fVonM.js} +2 -2
  56. package/dist/_chunks/slot-grid-B2zprPcv.js +387 -0
  57. package/dist/_chunks/sparkles-CuYXqQLg.js +23 -0
  58. package/dist/_chunks/{spinner-DirtWZNG.js → spinner-CCByyvcb.js} +2 -2
  59. package/dist/_chunks/stepper-accordion-BfS6lUB9.js +257 -0
  60. package/dist/_chunks/stepper-accordion.agent-C4quJ-MD.js +71 -0
  61. package/dist/_chunks/stethoscope-DT5qCW8Y.js +18 -0
  62. package/dist/_chunks/{sun-Eweh5fvi.js → sun-BuXE0xUS.js} +3 -15
  63. package/dist/_chunks/{task-tray-B3A2fRGR.js → task-tray-Bcmrrs8m.js} +3 -3
  64. package/dist/_chunks/{theme-toggle-FrotC2VI.js → theme-toggle-nPzb378f.js} +37 -36
  65. package/dist/_chunks/{timeline-jmd7lfDf.js → timeline-CR7HjZCK.js} +3 -3
  66. package/dist/_chunks/{toast.agent-32WNQ-_x.js → toast.agent-CTF6nIj5.js} +2 -2
  67. package/dist/_chunks/{transcript-panel-DUrjx5sa.js → transcript-panel-QUQ9XJmf.js} +2 -2
  68. package/dist/_chunks/{use-password-requirements-C9vKBSVn.js → use-password-requirements-E0sSfx5X.js} +38 -53
  69. package/dist/_chunks/use-theme-C2dHKUAN.js +145 -0
  70. package/dist/_chunks/{workflow-map-BR6txfFX.js → workflow-map-BKsKdYvZ.js} +5 -5
  71. package/dist/agent-catalog.json +151 -51
  72. package/dist/components/agenda-card/index.js +1 -1
  73. package/dist/components/agenda-tray/index.js +1 -1
  74. package/dist/components/ai-prompt-input/index.js +1 -1
  75. package/dist/components/audio-recorder/index.js +1 -1
  76. package/dist/components/autocomplete/index.js +1 -1
  77. package/dist/components/avatar/index.js +1 -1
  78. package/dist/components/benefit-card/index.js +1 -1
  79. package/dist/components/booking/booking-types.d.ts +145 -0
  80. package/dist/components/booking/booking.agent.d.ts +4 -0
  81. package/dist/components/booking/booking.d.ts +6 -0
  82. package/dist/components/booking/cascade.d.ts +96 -0
  83. package/dist/components/booking/details-form.d.ts +32 -0
  84. package/dist/components/booking/index.d.ts +5 -0
  85. package/dist/components/booking/index.js +8 -0
  86. package/dist/components/button/index.js +1 -1
  87. package/dist/components/calendar/index.js +1 -1
  88. package/dist/components/card/index.js +1 -1
  89. package/dist/components/carousel/index.js +1 -1
  90. package/dist/components/chat-input/index.js +1 -1
  91. package/dist/components/chat-message/index.js +1 -1
  92. package/dist/components/checkbox/checkbox.d.ts +6 -2
  93. package/dist/components/command-palette/index.js +1 -1
  94. package/dist/components/contact-card/index.js +1 -1
  95. package/dist/components/data-table/index.js +1 -1
  96. package/dist/components/date-picker/index.js +1 -1
  97. package/dist/components/date-range-picker/index.js +1 -1
  98. package/dist/components/date-time-picker/index.js +1 -1
  99. package/dist/components/description-list/index.js +1 -1
  100. package/dist/components/dialog/index.js +1 -1
  101. package/dist/components/empty-state/index.js +1 -1
  102. package/dist/components/freemium-paywall/index.js +1 -1
  103. package/dist/components/header/index.js +1 -1
  104. package/dist/components/header-settings/index.js +16 -15
  105. package/dist/components/icon-button/index.js +1 -1
  106. package/dist/components/index.d.ts +4 -1
  107. package/dist/components/key-value-pair/index.js +1 -1
  108. package/dist/components/link/index.js +1 -1
  109. package/dist/components/link/link.d.ts +7 -0
  110. package/dist/components/locale-picker/index.js +1 -1
  111. package/dist/components/map-view/index.js +1 -1
  112. package/dist/components/matrix-rain/index.js +1 -1
  113. package/dist/components/message-card/index.js +1 -1
  114. package/dist/components/message-tray/index.js +1 -1
  115. package/dist/components/notification-card/index.js +1 -1
  116. package/dist/components/notification-tray/index.js +1 -1
  117. package/dist/components/password-input/index.js +1 -1
  118. package/dist/components/patient-search/index.d.ts +4 -0
  119. package/dist/components/patient-search/index.js +6 -0
  120. package/dist/components/patient-search/patient-search.agent.d.ts +4 -0
  121. package/dist/components/patient-search/patient-search.d.ts +103 -0
  122. package/dist/components/payment-form/index.js +1 -1
  123. package/dist/components/pdf-viewer/index.js +1 -1
  124. package/dist/components/popover/index.js +1 -1
  125. package/dist/components/privacy-lock/index.js +1 -1
  126. package/dist/components/public-footer/index.d.ts +6 -0
  127. package/dist/components/public-footer/index.js +10 -0
  128. package/dist/components/public-footer/legal-urls.d.ts +18 -0
  129. package/dist/components/public-footer/public-footer.agent.d.ts +4 -0
  130. package/dist/components/public-footer/public-footer.d.ts +51 -0
  131. package/dist/components/public-footer/socials.d.ts +9 -0
  132. package/dist/components/public-header/index.js +1 -1
  133. package/dist/components/recaptcha-widget/index.js +1 -1
  134. package/dist/components/reviews-panel/index.d.ts +4 -0
  135. package/dist/components/reviews-panel/index.js +6 -0
  136. package/dist/components/reviews-panel/reviews-panel.agent.d.ts +4 -0
  137. package/dist/components/reviews-panel/reviews-panel.d.ts +76 -0
  138. package/dist/components/search-bar/index.js +1 -1
  139. package/dist/components/search-input/index.js +1 -1
  140. package/dist/components/sheet/index.js +1 -1
  141. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  142. package/dist/components/slot-grid/index.js +1 -1
  143. package/dist/components/spinner/index.js +1 -1
  144. package/dist/components/stepper-accordion/index.js +4 -3
  145. package/dist/components/task-tray/index.js +1 -1
  146. package/dist/components/theme-toggle/index.js +1 -1
  147. package/dist/components/timeline/index.js +1 -1
  148. package/dist/components/toast/index.js +1 -1
  149. package/dist/components/transcript-panel/index.js +1 -1
  150. package/dist/components/workflow/index.js +1 -1
  151. package/dist/hooks/index.js +1 -1
  152. package/dist/i18n/config.js +4923 -49
  153. package/dist/i18n/locales/ar.d.ts +272 -0
  154. package/dist/i18n/locales/de.d.ts +272 -0
  155. package/dist/i18n/locales/el.d.ts +272 -0
  156. package/dist/i18n/locales/es.d.ts +272 -0
  157. package/dist/i18n/locales/fr.d.ts +272 -0
  158. package/dist/i18n/locales/hi.d.ts +272 -0
  159. package/dist/i18n/locales/ja.d.ts +272 -0
  160. package/dist/i18n/locales/nl.d.ts +272 -0
  161. package/dist/i18n/locales/pl.d.ts +272 -0
  162. package/dist/i18n/locales/pt.d.ts +272 -0
  163. package/dist/i18n/locales/ro.d.ts +272 -0
  164. package/dist/i18n/locales/ru.d.ts +272 -0
  165. package/dist/i18n/locales/sq.d.ts +272 -0
  166. package/dist/i18n/locales/sv.d.ts +272 -0
  167. package/dist/i18n/locales/tr.d.ts +272 -0
  168. package/dist/i18n/locales/zh.d.ts +272 -0
  169. package/dist/i18n/resources.d.ts +544 -0
  170. package/dist/index.js +364 -348
  171. package/dist/locales/ar.json +273 -1
  172. package/dist/locales/de.json +273 -1
  173. package/dist/locales/el.json +273 -1
  174. package/dist/locales/en.json +273 -1
  175. package/dist/locales/es.json +273 -1
  176. package/dist/locales/fr.json +273 -1
  177. package/dist/locales/hi.json +273 -1
  178. package/dist/locales/it.json +273 -1
  179. package/dist/locales/ja.json +273 -1
  180. package/dist/locales/nl.json +273 -1
  181. package/dist/locales/pl.json +273 -1
  182. package/dist/locales/pt.json +273 -1
  183. package/dist/locales/ro.json +273 -1
  184. package/dist/locales/ru.json +273 -1
  185. package/dist/locales/sq.json +273 -1
  186. package/dist/locales/sv.json +273 -1
  187. package/dist/locales/tr.json +273 -1
  188. package/dist/locales/zh.json +273 -1
  189. package/dist/patterns/alia-assistant/index.js +1 -1
  190. package/dist/patterns/patient-shell/index.js +1 -1
  191. package/dist/tokens.css +1 -1
  192. package/package.json +17 -1
  193. package/dist/_chunks/icon-button-C4CGcYuz.js +0 -54
  194. package/dist/_chunks/isSameMonth-5wNF2f4I.js +0 -1307
  195. package/dist/_chunks/patient-shell-B164drIa.js +0 -173
  196. package/dist/_chunks/react-day-picker-C5F3-TTX.js +0 -1827
  197. package/dist/_chunks/slot-grid-CgpYgBkW.js +0 -502
  198. package/dist/_chunks/stepper-C-sIpRRU.js +0 -7
  199. package/dist/_chunks/stepper-accordion.agent-ckKYZCIP.js +0 -322
  200. package/dist/_chunks/stepper-calendar-BLOJUE0-.js +0 -648
  201. package/dist/_chunks/use-theme-B1cwAXJR.js +0 -145
  202. package/dist/components/stepper-calendar/index.d.ts +0 -4
  203. package/dist/components/stepper-calendar/index.js +0 -6
  204. package/dist/components/stepper-calendar/stepper-calendar.agent.d.ts +0 -4
  205. package/dist/components/stepper-calendar/stepper-calendar.d.ts +0 -62
@@ -1,502 +0,0 @@
1
- import { jsx as i, jsxs as C } from "react/jsx-runtime";
2
- import { forwardRef as pe, useId as ve, useState as he, useCallback as S } from "react";
3
- import { c as b } from "./index-D2ZczOXr.js";
4
- import { useTranslation as be } from "react-i18next";
5
- import { B as Y } from "./button-DD_0Xdmr.js";
6
- import { I as A } from "./icon-button-C4CGcYuz.js";
7
- import { E as xe } from "./empty-state-3CLJIXSj.js";
8
- import { S as B } from "./skeleton-CZbwyJAA.js";
9
- import { t as W, c as De, m as K, a as Z, i as ye } from "./isSameDay-ecuM8PBB.js";
10
- function Ne(t, e) {
11
- const s = () => De(e == null ? void 0 : e.in, NaN), r = Te(t);
12
- let d;
13
- if (r.date) {
14
- const o = Ie(r.date, 2);
15
- d = ze(o.restDateString, o.year);
16
- }
17
- if (!d || isNaN(+d)) return s();
18
- const l = +d;
19
- let u = 0, f;
20
- if (r.time && (u = Le(r.time), isNaN(u)))
21
- return s();
22
- if (r.timezone) {
23
- if (f = Se(r.timezone), isNaN(f)) return s();
24
- } else {
25
- const o = new Date(l + u), x = W(0, e == null ? void 0 : e.in);
26
- return x.setFullYear(
27
- o.getUTCFullYear(),
28
- o.getUTCMonth(),
29
- o.getUTCDate()
30
- ), x.setHours(
31
- o.getUTCHours(),
32
- o.getUTCMinutes(),
33
- o.getUTCSeconds(),
34
- o.getUTCMilliseconds()
35
- ), x;
36
- }
37
- return W(l + u + f, e == null ? void 0 : e.in);
38
- }
39
- const k = {
40
- dateTimeDelimiter: /[T ]/,
41
- timeZoneDelimiter: /[Z ]/i,
42
- timezone: /([Z+-].*)$/
43
- }, we = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Ce = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, ke = /^([+-])(\d{2})(?::?(\d{2}))?$/;
44
- function Te(t) {
45
- const e = {}, s = t.split(k.dateTimeDelimiter);
46
- let a;
47
- if (s.length > 2)
48
- return e;
49
- if (/:/.test(s[0]) ? a = s[0] : (e.date = s[0], a = s[1], k.timeZoneDelimiter.test(e.date) && (e.date = t.split(k.timeZoneDelimiter)[0], a = t.substr(
50
- e.date.length,
51
- t.length
52
- ))), a) {
53
- const r = k.timezone.exec(a);
54
- r ? (e.time = a.replace(r[1], ""), e.timezone = r[1]) : e.time = a;
55
- }
56
- return e;
57
- }
58
- function Ie(t, e) {
59
- const s = new RegExp(
60
- "^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
61
- ), a = t.match(s);
62
- if (!a) return { year: NaN, restDateString: "" };
63
- const r = a[1] ? parseInt(a[1]) : null, d = a[2] ? parseInt(a[2]) : null;
64
- return {
65
- year: d === null ? r : d * 100,
66
- restDateString: t.slice((a[1] || a[2]).length)
67
- };
68
- }
69
- function ze(t, e) {
70
- if (e === null) return /* @__PURE__ */ new Date(NaN);
71
- const s = t.match(we);
72
- if (!s) return /* @__PURE__ */ new Date(NaN);
73
- const a = !!s[4], r = D(s[1]), d = D(s[2]) - 1, l = D(s[3]), u = D(s[4]), f = D(s[5]) - 1;
74
- if (a)
75
- return je(e, u, f) ? $e(e, u, f) : /* @__PURE__ */ new Date(NaN);
76
- {
77
- const o = /* @__PURE__ */ new Date(0);
78
- return !Ge(e, d, l) || !Ve(e, r) ? /* @__PURE__ */ new Date(NaN) : (o.setUTCFullYear(e, d, Math.max(r, l)), o);
79
- }
80
- }
81
- function D(t) {
82
- return t ? parseInt(t) : 1;
83
- }
84
- function Le(t) {
85
- const e = t.match(Ce);
86
- if (!e) return NaN;
87
- const s = $(e[1]), a = $(e[2]), r = $(e[3]);
88
- return Ee(s, a, r) ? s * K + a * Z + r * 1e3 : NaN;
89
- }
90
- function $(t) {
91
- return t && parseFloat(t.replace(",", ".")) || 0;
92
- }
93
- function Se(t) {
94
- if (t === "Z") return 0;
95
- const e = t.match(ke);
96
- if (!e) return 0;
97
- const s = e[1] === "+" ? -1 : 1, a = parseInt(e[2]), r = e[3] && parseInt(e[3]) || 0;
98
- return Fe(a, r) ? s * (a * K + r * Z) : NaN;
99
- }
100
- function $e(t, e, s) {
101
- const a = /* @__PURE__ */ new Date(0);
102
- a.setUTCFullYear(t, 0, 4);
103
- const r = a.getUTCDay() || 7, d = (e - 1) * 7 + s + 1 - r;
104
- return a.setUTCDate(a.getUTCDate() + d), a;
105
- }
106
- const Ue = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
107
- function J(t) {
108
- return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
109
- }
110
- function Ge(t, e, s) {
111
- return e >= 0 && e <= 11 && s >= 1 && s <= (Ue[e] || (J(t) ? 29 : 28));
112
- }
113
- function Ve(t, e) {
114
- return e >= 1 && e <= (J(t) ? 366 : 365);
115
- }
116
- function je(t, e, s) {
117
- return e >= 1 && e <= 53 && s >= 0 && s <= 6;
118
- }
119
- function Ee(t, e, s) {
120
- return t === 24 ? e === 0 && s === 0 : s >= 0 && s < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
121
- }
122
- function Fe(t, e) {
123
- return e >= 0 && e <= 59;
124
- }
125
- const Re = b(
126
- [
127
- "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
128
- "ds:text-[var(--foreground)]",
129
- "ds:w-full"
130
- ].join(" "),
131
- {
132
- variants: {
133
- size: {
134
- sm: "ds:text-[length:var(--font-size-sm)]",
135
- md: "ds:text-[length:var(--font-size-base)]",
136
- lg: "ds:text-[length:var(--font-size-lg)]"
137
- }
138
- },
139
- defaultVariants: { size: "md" }
140
- }
141
- ), Me = b(
142
- "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full"
143
- ), Oe = 12, Ye = b(
144
- "ds:grid ds:gap-[var(--spacing-sm)] ds:w-full ds:auto-rows-min ds:items-start",
145
- {
146
- variants: {
147
- cols: {
148
- 1: "ds:grid-cols-1",
149
- 2: "ds:grid-cols-2",
150
- 3: "ds:grid-cols-3",
151
- 4: "ds:grid-cols-4",
152
- 5: "ds:grid-cols-5",
153
- 6: "ds:grid-cols-6",
154
- 7: "ds:grid-cols-7",
155
- 8: "ds:grid-cols-8",
156
- 9: "ds:grid-cols-9",
157
- 10: "ds:grid-cols-10",
158
- 11: "ds:grid-cols-11",
159
- 12: "ds:grid-cols-12"
160
- }
161
- },
162
- defaultVariants: { cols: 1 }
163
- }
164
- );
165
- function Ae(t) {
166
- return Math.max(1, Math.min(t, Oe));
167
- }
168
- const H = b(
169
- [
170
- "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
171
- "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
172
- "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
173
- "ds:rounded-[var(--radius-md)]",
174
- "ds:bg-[var(--card)]",
175
- "ds:border ds:border-[var(--border)]",
176
- "ds:min-w-0"
177
- ].join(" ")
178
- ), Be = b(
179
- [
180
- "ds:font-[var(--font-weight-semibold)]",
181
- "ds:text-[var(--foreground)]",
182
- "ds:text-start",
183
- "ds:truncate"
184
- ].join(" "),
185
- {
186
- variants: {
187
- size: {
188
- sm: "ds:text-[length:var(--font-size-xs)]",
189
- md: "ds:text-[length:var(--font-size-sm)]",
190
- lg: "ds:text-[length:var(--font-size-base)]"
191
- }
192
- },
193
- defaultVariants: { size: "md" }
194
- }
195
- ), _ = b(
196
- "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full ds:m-0 ds:p-0 ds:list-none"
197
- ), We = b(
198
- [
199
- "ds:inline-flex ds:items-center ds:justify-center",
200
- "ds:w-full",
201
- "ds:rounded-[var(--radius-sm)]",
202
- "ds:font-[var(--font-weight-medium)]",
203
- "ds:border ds:border-[var(--border)]",
204
- "ds:bg-[var(--background)]",
205
- "ds:text-[var(--foreground)]",
206
- "ds:transition-colors",
207
- "ds:focus-visible:outline-[var(--focus-ring-width)]",
208
- "ds:focus-visible:outline-solid",
209
- "ds:focus-visible:outline-[var(--ring)]",
210
- "ds:focus-visible:outline-offset-[var(--focus-ring-offset)]",
211
- "ds:min-h-[var(--min-target-size)]",
212
- "ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
213
- "ds:aria-disabled:opacity-50 ds:aria-disabled:cursor-not-allowed",
214
- "ds:hover:bg-[var(--muted)] ds:hover:text-[var(--foreground)]",
215
- "ds:aria-pressed:bg-[var(--primary)] ds:aria-pressed:text-[var(--primary-foreground)]",
216
- "ds:aria-pressed:border-[var(--primary)]"
217
- ].join(" "),
218
- {
219
- variants: {
220
- size: {
221
- sm: "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:text-[length:var(--font-size-xs)] ds:h-8",
222
- md: "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-sm)] ds:h-10",
223
- lg: "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:text-[length:var(--font-size-base)] ds:h-12"
224
- }
225
- },
226
- defaultVariants: { size: "md" }
227
- }
228
- );
229
- function h(t) {
230
- return t instanceof Date ? t : Ne(t);
231
- }
232
- function nt(t, e) {
233
- return ye(h(t), h(e));
234
- }
235
- function it(t) {
236
- for (const e of t) {
237
- const s = e.slots.find((a) => a.available !== !1);
238
- if (s) return { day: e, slot: s };
239
- }
240
- }
241
- function X(t, e, s) {
242
- try {
243
- return new Intl.DateTimeFormat(e, {
244
- weekday: "short",
245
- month: "short",
246
- day: "numeric",
247
- timeZone: s
248
- }).format(t);
249
- } catch {
250
- return new Intl.DateTimeFormat("en", {
251
- weekday: "short",
252
- month: "short",
253
- day: "numeric"
254
- }).format(t);
255
- }
256
- }
257
- function q(t, e, s) {
258
- if (t.label !== void 0) return t.label;
259
- const a = h(t.start);
260
- try {
261
- const r = new Intl.DateTimeFormat(e, {
262
- hour: "numeric",
263
- minute: "2-digit",
264
- timeZone: s
265
- });
266
- if (t.end) {
267
- const d = h(t.end);
268
- if (typeof r.formatRange == "function")
269
- try {
270
- return r.formatRange(a, d);
271
- } catch {
272
- }
273
- return `${r.format(a)} – ${r.format(d)}`;
274
- }
275
- return r.format(a);
276
- } catch {
277
- return a.toISOString();
278
- }
279
- }
280
- function He(t, e, s, a, r) {
281
- if (t.ariaLabel !== void 0) return t.ariaLabel;
282
- const d = q(t, s, a), l = e.label !== void 0 ? e.label : X(h(e.date), s, a);
283
- return r({ time: d, day: l });
284
- }
285
- function _e() {
286
- return /* @__PURE__ */ i(
287
- "svg",
288
- {
289
- "aria-hidden": "true",
290
- viewBox: "0 0 24 24",
291
- fill: "none",
292
- stroke: "currentColor",
293
- strokeWidth: "2",
294
- strokeLinecap: "round",
295
- strokeLinejoin: "round",
296
- className: "ds:size-4",
297
- children: /* @__PURE__ */ i("path", { d: "M15 18l-6-6 6-6" })
298
- }
299
- );
300
- }
301
- function Ke() {
302
- return /* @__PURE__ */ i(
303
- "svg",
304
- {
305
- "aria-hidden": "true",
306
- viewBox: "0 0 24 24",
307
- fill: "none",
308
- stroke: "currentColor",
309
- strokeWidth: "2",
310
- strokeLinecap: "round",
311
- strokeLinejoin: "round",
312
- className: "ds:size-4",
313
- children: /* @__PURE__ */ i("path", { d: "M9 6l6 6-6 6" })
314
- }
315
- );
316
- }
317
- const Ze = pe(
318
- ({
319
- days: t,
320
- state: e = "default",
321
- size: s = "md",
322
- selectedSlotId: a,
323
- maxInitialSlotsPerDay: r = 6,
324
- locale: d,
325
- timeZone: l,
326
- hasPrevious: u = !1,
327
- hasNext: f = !1,
328
- showNextAvailable: o = !1,
329
- ariaLabel: x,
330
- onSlotSelect: y,
331
- onPreviousDays: Q,
332
- onNextDays: P,
333
- onShowMore: N,
334
- onJumpToNextAvailable: ee,
335
- className: te,
336
- ...se
337
- }, ae) => {
338
- const { t: m, i18n: re } = be(), T = d ?? re.language ?? "en", ne = ve(), [ie, de] = he({}), U = e === "loading", G = e === "disabled", v = U || G, oe = e === "empty" || t.length === 0 || t.every((n) => n.slots.length === 0), le = x ?? m("slotGrid.ariaLabel"), I = S(
339
- (n, c) => {
340
- v || n.available !== !1 && (y == null || y(n, c));
341
- },
342
- [v, y]
343
- ), ce = S(
344
- (n, c) => {
345
- de((g) => ({ ...g, [c]: !0 })), N == null || N(n);
346
- },
347
- [N]
348
- ), ue = S(
349
- (n, c, g) => {
350
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), I(c, g));
351
- },
352
- [I]
353
- ), V = Ae(t.length || 1), j = Ye({ cols: V });
354
- let w;
355
- return U ? w = /* @__PURE__ */ i(
356
- "div",
357
- {
358
- className: j,
359
- "data-state": "loading",
360
- role: "status",
361
- "aria-live": "polite",
362
- "aria-label": m("common.loading"),
363
- children: Array.from({ length: V }, (n, c) => /* @__PURE__ */ C("div", { className: H(), children: [
364
- /* @__PURE__ */ i(B, { variant: "text", size: s, width: "60%" }),
365
- /* @__PURE__ */ i("div", { className: _(), children: Array.from(
366
- { length: Math.min(r, 4) },
367
- (g, z) => /* @__PURE__ */ i(
368
- B,
369
- {
370
- variant: "rounded",
371
- size: s,
372
- height: "40px"
373
- },
374
- `loading-slot-${c}-${z}`
375
- )
376
- ) })
377
- ] }, `loading-col-${c}`))
378
- }
379
- ) : oe ? w = /* @__PURE__ */ i("div", { "data-state": "empty", children: /* @__PURE__ */ i(xe, { variant: "no-results", title: m("slotGrid.noSlots") }) }) : w = /* @__PURE__ */ i(
380
- "div",
381
- {
382
- className: j,
383
- "data-state": G ? "disabled" : "default",
384
- children: t.map((n, c) => {
385
- const g = `${h(n.date).toISOString()}-${c}`, z = n.label ?? X(h(n.date), T, l), E = `${ne}-day-${c}-header`, F = ie[g] ?? !1 ? n.slots : n.slots.slice(0, r), R = n.slots.length - F.length, M = n.slots.length === 0;
386
- return (
387
- // Use a plain <div role="group"> rather than <section> — a
388
- // <section> with aria-labelledby is a landmark, and nesting many
389
- // landmarks inside the outer slot-grid landmark fails axe's
390
- // landmark-unique rule.
391
- /* @__PURE__ */ C(
392
- "div",
393
- {
394
- role: "group",
395
- className: H(),
396
- "aria-labelledby": E,
397
- "data-empty": M || void 0,
398
- children: [
399
- /* @__PURE__ */ i("h3", { id: E, className: Be({ size: s }), children: z }),
400
- M ? /* @__PURE__ */ i("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: m("slotGrid.noSlots") }) : null,
401
- /* @__PURE__ */ i("ul", { className: _(), children: F.map((p) => {
402
- const me = He(
403
- p,
404
- n,
405
- T,
406
- l,
407
- ({ time: L, day: ge }) => m("slotGrid.slotLabel", { time: L, day: ge })
408
- ), fe = a === p.id, O = p.available === !1 || v;
409
- return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
410
- "button",
411
- {
412
- type: "button",
413
- className: We({ size: s }),
414
- "aria-label": me,
415
- "aria-pressed": fe,
416
- disabled: O,
417
- "aria-disabled": O || void 0,
418
- "data-slot-id": p.id,
419
- onClick: () => I(p, n),
420
- onKeyDown: (L) => ue(L, p, n),
421
- children: q(p, T, l)
422
- }
423
- ) }, p.id);
424
- }) }),
425
- R > 0 ? /* @__PURE__ */ i(
426
- Y,
427
- {
428
- intent: "ghost",
429
- size: s === "lg" ? "md" : "sm",
430
- onClick: () => ce(n, g),
431
- disabled: v,
432
- children: m("slotGrid.showMore", { count: R })
433
- }
434
- ) : null
435
- ]
436
- },
437
- g
438
- )
439
- );
440
- })
441
- }
442
- ), /* @__PURE__ */ C(
443
- "div",
444
- {
445
- ref: ae,
446
- role: "region",
447
- "aria-label": le,
448
- className: Re({ size: s, className: te }),
449
- "data-component": "slot-grid",
450
- "data-state": e,
451
- ...se,
452
- children: [
453
- /* @__PURE__ */ C("div", { className: Me(), children: [
454
- /* @__PURE__ */ i(
455
- A,
456
- {
457
- icon: /* @__PURE__ */ i(_e, {}),
458
- "aria-label": m("slotGrid.previousDays"),
459
- size: s === "lg" ? "md" : "sm",
460
- intent: "ghost",
461
- flipIconInRtl: !0,
462
- disabled: !u || v,
463
- onClick: Q
464
- }
465
- ),
466
- o ? /* @__PURE__ */ i(
467
- Y,
468
- {
469
- intent: "secondary",
470
- size: s === "lg" ? "md" : "sm",
471
- disabled: v,
472
- onClick: ee,
473
- children: m("slotGrid.nextAvailable")
474
- }
475
- ) : /* @__PURE__ */ i("span", { "aria-hidden": "true" }),
476
- /* @__PURE__ */ i(
477
- A,
478
- {
479
- icon: /* @__PURE__ */ i(Ke, {}),
480
- "aria-label": m("slotGrid.nextDays"),
481
- size: s === "lg" ? "md" : "sm",
482
- intent: "ghost",
483
- flipIconInRtl: !0,
484
- disabled: !f || v,
485
- onClick: P
486
- }
487
- )
488
- ] }),
489
- w
490
- ]
491
- }
492
- );
493
- }
494
- );
495
- Ze.displayName = "SlotGrid";
496
- export {
497
- Ze as S,
498
- it as f,
499
- nt as i,
500
- Ne as p
501
- };
502
- //# sourceMappingURL=slot-grid-CgpYgBkW.js.map
@@ -1,7 +0,0 @@
1
- function o(r, e, t) {
2
- return t === "error" ? "error" : r === e ? "current" : t === "completed" || r < e ? "completed" : "upcoming";
3
- }
4
- export {
5
- o as s
6
- };
7
- //# sourceMappingURL=stepper-C-sIpRRU.js.map