@alfadocs/ui-kit 0.46.0 → 0.48.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 (200) hide show
  1. package/dist/_chunks/{agenda-card-CFyWSX7Z.js → agenda-card-BaSfVfrL.js} +25 -29
  2. package/dist/_chunks/{agenda-tray-Dyj9ChHC.js → agenda-tray-DQayYmQ0.js} +50 -67
  3. package/dist/_chunks/ai-consent-banner-DO5ingMq.js +169 -0
  4. package/dist/_chunks/ai-tools-rail-CxYG04cw.js +280 -0
  5. package/dist/_chunks/alia-sidebar-DlvyXgVC.js +1126 -0
  6. package/dist/_chunks/anamnesis-card-CmkBVAln.js +156 -0
  7. package/dist/_chunks/appointment-tray-BwDHhWWC.js +419 -0
  8. package/dist/_chunks/{audio-recorder-C1rhKhSN.js → audio-recorder-DC-v9YFW.js} +81 -91
  9. package/dist/_chunks/{bmi-calculator-CQqXTVNL.js → bmi-calculator-DdylQzT6.js} +2 -2
  10. package/dist/_chunks/{booking-DlDVuWMd.js → booking-WV2GSru5.js} +291 -303
  11. package/dist/_chunks/{calculator-dialog-D-nfvteH.js → calculator-dialog-CFk4I91b.js} +2 -2
  12. package/dist/_chunks/calendar-days-C4BmpCZg.js +23 -0
  13. package/dist/_chunks/{calendar-YHFknAGv.js → calendar-oYWOCrnf.js} +195 -210
  14. package/dist/_chunks/care-plan-card-QmNpGggC.js +252 -0
  15. package/dist/_chunks/care-plan-entry-card-Cnra7vUc.js +318 -0
  16. package/dist/_chunks/{chat-input-CQe7nR_v.js → chat-input-CFwc7JxL.js} +2 -1
  17. package/dist/_chunks/{chat-message-ASgGtj-L.js → chat-message-Dm8U2RY1.js} +81 -74
  18. package/dist/_chunks/clinical-note-card-BYo437dU.js +333 -0
  19. package/dist/_chunks/code-block-HoddNOKJ.js +106 -0
  20. package/dist/_chunks/{contact-profile-card-DHyuAPXM.js → contact-profile-card-DvvVfAA2.js} +102 -115
  21. package/dist/_chunks/{cycle-calculator-KxA8dqDf.js → cycle-calculator-DYvGm_m1.js} +2 -2
  22. package/dist/_chunks/{dialog-BTpZV6It.js → dialog-DMGnSelc.js} +55 -55
  23. package/dist/_chunks/download-CDF1sbL9.js +16 -0
  24. package/dist/_chunks/{due-date-calculator-mFxpHLml.js → due-date-calculator-BXd3ANj7.js} +2 -2
  25. package/dist/_chunks/{editable-currency-cell-renderer-BEBUQl9P.js → editable-currency-cell-renderer-CLil9B29.js} +283 -293
  26. package/dist/_chunks/entity-card-COhmqHly.js +69 -0
  27. package/dist/_chunks/{gestational-age-calculator-gWI_uRA1.js → gestational-age-calculator-Crj6FgZw.js} +2 -2
  28. package/dist/_chunks/{insert-result-C5ABnzDl.js → insert-result-DNdi_JYW.js} +140 -168
  29. package/dist/_chunks/is-safe-url-DkETxeHz.js +7 -0
  30. package/dist/_chunks/languages-DsVf_WzT.js +19 -0
  31. package/dist/_chunks/layers-pzGcbLPj.js +34 -0
  32. package/dist/_chunks/{message-card-DSPw5ghw.js → message-card-Dvl1TgaN.js} +15 -19
  33. package/dist/_chunks/{message-tray-hSQff9u4.js → message-tray-Dl6GQaaV.js} +2 -2
  34. package/dist/_chunks/mic-B4Gog3Gi.js +16 -0
  35. package/dist/_chunks/operator-hero-CM8949Hd.js +198 -0
  36. package/dist/_chunks/patient-summary-card-BnTqxcTr.js +443 -0
  37. package/dist/_chunks/payment-request-card-B_lyobd0.js +478 -0
  38. package/dist/_chunks/{pdf-viewer-CWEXTlwq.js → pdf-viewer-G8SU6Azw.js} +3 -3
  39. package/dist/_chunks/pencil-CfQX-0Qc.js +21 -0
  40. package/dist/_chunks/periodontal-chart-card-BYs9hax1.js +455 -0
  41. package/dist/_chunks/phone-Bi5yUm4I.js +20 -0
  42. package/dist/_chunks/{practice-results-DDi-kvaD.js → practice-results-BFL_mcDW.js} +3 -2
  43. package/dist/_chunks/{pregnancy-weight-gain-BtEHaSqy.js → pregnancy-weight-gain-C7dK89jE.js} +2 -2
  44. package/dist/_chunks/scan-line-lGioFwLC.js +18 -0
  45. package/dist/_chunks/shield-check-BjCGH_Sr.js +21 -0
  46. package/dist/_chunks/{sign-document-BCyLpFHJ.js → sign-document-DPI2pY9V.js} +2 -2
  47. package/dist/_chunks/{streaming-text-GH07yIYh.js → streaming-text-CfhDqtIT.js} +49 -45
  48. package/dist/_chunks/{transaction-chip-B8ujzowA.js → transaction-chip-BZCa6XDn.js} +8 -6
  49. package/dist/_chunks/{unit-converter-u3CwNDpP.js → unit-converter-jWp3Z85y.js} +2 -2
  50. package/dist/_chunks/user-cog-BS_qc8nA.js +24 -0
  51. package/dist/_chunks/video-BAeICxCT.js +21 -0
  52. package/dist/_chunks/{workflow-map-BFNpzTiw.js → workflow-map-ZXw-zsZ8.js} +186 -219
  53. package/dist/agent-catalog.json +324 -1
  54. package/dist/components/_shared/code-block.d.ts +39 -0
  55. package/dist/components/_shared/entity-card/entity-card.d.ts +40 -0
  56. package/dist/components/_shared/entity-card/index.d.ts +3 -0
  57. package/dist/components/_shared/index.d.ts +2 -0
  58. package/dist/components/_shared/is-safe-url.d.ts +13 -0
  59. package/dist/components/agenda-card/agenda-card.d.ts +1 -2
  60. package/dist/components/agenda-card/index.d.ts +2 -1
  61. package/dist/components/agenda-card/index.js +6 -5
  62. package/dist/components/agenda-tray/index.js +1 -1
  63. package/dist/components/ai-consent-banner/ai-consent-banner.agent.d.ts +4 -0
  64. package/dist/components/ai-consent-banner/ai-consent-banner.d.ts +45 -0
  65. package/dist/components/ai-consent-banner/index.d.ts +4 -0
  66. package/dist/components/ai-consent-banner/index.js +6 -0
  67. package/dist/components/ai-tools-rail/ai-tools-rail.agent.d.ts +4 -0
  68. package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +60 -0
  69. package/dist/components/ai-tools-rail/index.d.ts +4 -0
  70. package/dist/components/ai-tools-rail/index.js +6 -0
  71. package/dist/components/anamnesis-card/anamnesis-card.d.ts +68 -0
  72. package/dist/components/anamnesis-card/index.d.ts +3 -0
  73. package/dist/components/anamnesis-card/index.js +5 -0
  74. package/dist/components/appointment-card/appointment-card.agent.d.ts +3 -0
  75. package/dist/components/appointment-card/appointment-card.d.ts +93 -0
  76. package/dist/components/appointment-card/appointment-tray.agent.d.ts +4 -0
  77. package/dist/components/appointment-card/appointment-tray.d.ts +48 -0
  78. package/dist/components/appointment-card/index.d.ts +8 -0
  79. package/dist/components/appointment-card/index.js +10 -0
  80. package/dist/components/audio-recorder/index.js +1 -1
  81. package/dist/components/badge/badge.d.ts +1 -1
  82. package/dist/components/bmi-calculator/index.js +1 -1
  83. package/dist/components/booking/index.js +1 -1
  84. package/dist/components/calculator-dialog/index.js +1 -1
  85. package/dist/components/calendar/index.js +1 -1
  86. package/dist/components/card/card.d.ts +1 -1
  87. package/dist/components/care-plan-card/care-plan-card.agent.d.ts +4 -0
  88. package/dist/components/care-plan-card/care-plan-card.d.ts +102 -0
  89. package/dist/components/care-plan-card/index.d.ts +4 -0
  90. package/dist/components/care-plan-card/index.js +6 -0
  91. package/dist/components/care-plan-entry-card/care-plan-entry-card.agent.d.ts +4 -0
  92. package/dist/components/care-plan-entry-card/care-plan-entry-card.d.ts +110 -0
  93. package/dist/components/care-plan-entry-card/index.d.ts +4 -0
  94. package/dist/components/care-plan-entry-card/index.js +6 -0
  95. package/dist/components/chat-input/index.js +1 -1
  96. package/dist/components/chat-message/chat-message.d.ts +13 -0
  97. package/dist/components/chat-message/index.js +1 -1
  98. package/dist/components/clinical-note-card/clinical-note-card.agent.d.ts +4 -0
  99. package/dist/components/clinical-note-card/clinical-note-card.d.ts +98 -0
  100. package/dist/components/clinical-note-card/index.d.ts +4 -0
  101. package/dist/components/clinical-note-card/index.js +6 -0
  102. package/dist/components/contact-profile-card/index.js +1 -1
  103. package/dist/components/cycle-calculator/index.js +1 -1
  104. package/dist/components/data-table/index.js +1 -1
  105. package/dist/components/dialog/dialog.d.ts +7 -0
  106. package/dist/components/dialog/index.js +1 -1
  107. package/dist/components/due-date-calculator/index.js +1 -1
  108. package/dist/components/gestational-age-calculator/index.js +1 -1
  109. package/dist/components/index.d.ts +10 -0
  110. package/dist/components/message-card/index.js +5 -4
  111. package/dist/components/message-card/message-card.d.ts +1 -2
  112. package/dist/components/message-tray/index.js +1 -1
  113. package/dist/components/operator-hero/index.js +1 -1
  114. package/dist/components/operator-hero/operator-hero.d.ts +9 -0
  115. package/dist/components/patient-summary-card/index.d.ts +4 -0
  116. package/dist/components/patient-summary-card/index.js +6 -0
  117. package/dist/components/patient-summary-card/patient-summary-card.agent.d.ts +4 -0
  118. package/dist/components/patient-summary-card/patient-summary-card.d.ts +120 -0
  119. package/dist/components/payment-card/index.d.ts +7 -0
  120. package/dist/components/payment-card/index.js +8 -0
  121. package/dist/components/payment-card/payment-card.agent.d.ts +4 -0
  122. package/dist/components/payment-card/payment-card.d.ts +71 -0
  123. package/dist/components/payment-card/payment-request-card.agent.d.ts +4 -0
  124. package/dist/components/payment-card/payment-request-card.d.ts +43 -0
  125. package/dist/components/pdf-viewer/index.js +1 -1
  126. package/dist/components/periodontal-chart-card/index.d.ts +4 -0
  127. package/dist/components/periodontal-chart-card/index.js +7 -0
  128. package/dist/components/periodontal-chart-card/periodontal-chart-card.agent.d.ts +4 -0
  129. package/dist/components/periodontal-chart-card/periodontal-chart-card.d.ts +74 -0
  130. package/dist/components/practice-results/index.js +1 -1
  131. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  132. package/dist/components/public-header/public-header.d.ts +1 -1
  133. package/dist/components/sign-document/index.js +1 -1
  134. package/dist/components/stat/stat.d.ts +1 -1
  135. package/dist/components/streaming-text/index.js +1 -1
  136. package/dist/components/transaction-chip/index.js +1 -1
  137. package/dist/components/unit-converter/index.js +1 -1
  138. package/dist/components/workflow/index.js +1 -1
  139. package/dist/i18n/locales/ar.d.ts +366 -0
  140. package/dist/i18n/locales/ar.js +367 -1
  141. package/dist/i18n/locales/de.d.ts +366 -0
  142. package/dist/i18n/locales/de.js +367 -1
  143. package/dist/i18n/locales/el.d.ts +366 -0
  144. package/dist/i18n/locales/el.js +367 -1
  145. package/dist/i18n/locales/en.d.ts +366 -0
  146. package/dist/i18n/locales/en.js +367 -1
  147. package/dist/i18n/locales/es.d.ts +366 -0
  148. package/dist/i18n/locales/es.js +367 -1
  149. package/dist/i18n/locales/fr.d.ts +366 -0
  150. package/dist/i18n/locales/fr.js +367 -1
  151. package/dist/i18n/locales/hi.d.ts +366 -0
  152. package/dist/i18n/locales/hi.js +367 -1
  153. package/dist/i18n/locales/it.d.ts +366 -0
  154. package/dist/i18n/locales/it.js +367 -1
  155. package/dist/i18n/locales/ja.d.ts +366 -0
  156. package/dist/i18n/locales/ja.js +367 -1
  157. package/dist/i18n/locales/nl.d.ts +366 -0
  158. package/dist/i18n/locales/nl.js +367 -1
  159. package/dist/i18n/locales/pl.d.ts +366 -0
  160. package/dist/i18n/locales/pl.js +367 -1
  161. package/dist/i18n/locales/pt.d.ts +366 -0
  162. package/dist/i18n/locales/pt.js +367 -1
  163. package/dist/i18n/locales/ro.d.ts +366 -0
  164. package/dist/i18n/locales/ro.js +367 -1
  165. package/dist/i18n/locales/ru.d.ts +366 -0
  166. package/dist/i18n/locales/ru.js +367 -1
  167. package/dist/i18n/locales/sq.d.ts +366 -0
  168. package/dist/i18n/locales/sq.js +367 -1
  169. package/dist/i18n/locales/sv.d.ts +366 -0
  170. package/dist/i18n/locales/sv.js +367 -1
  171. package/dist/i18n/locales/tr.d.ts +366 -0
  172. package/dist/i18n/locales/tr.js +367 -1
  173. package/dist/i18n/locales/zh.d.ts +366 -0
  174. package/dist/i18n/locales/zh.js +367 -1
  175. package/dist/index.js +527 -491
  176. package/dist/locales/ar.json +367 -1
  177. package/dist/locales/de.json +367 -1
  178. package/dist/locales/el.json +367 -1
  179. package/dist/locales/en.json +367 -1
  180. package/dist/locales/es.json +367 -1
  181. package/dist/locales/fr.json +367 -1
  182. package/dist/locales/hi.json +367 -1
  183. package/dist/locales/it.json +367 -1
  184. package/dist/locales/ja.json +367 -1
  185. package/dist/locales/nl.json +367 -1
  186. package/dist/locales/pl.json +367 -1
  187. package/dist/locales/pt.json +367 -1
  188. package/dist/locales/ro.json +367 -1
  189. package/dist/locales/ru.json +367 -1
  190. package/dist/locales/sq.json +367 -1
  191. package/dist/locales/sv.json +367 -1
  192. package/dist/locales/tr.json +367 -1
  193. package/dist/locales/zh.json +367 -1
  194. package/dist/patterns/alia-assistant/alia-types.d.ts +76 -0
  195. package/dist/patterns/alia-assistant/index.js +1 -1
  196. package/dist/tokens.css +1 -1
  197. package/package.json +42 -1
  198. package/dist/_chunks/alia-sidebar-Be8FhKYd.js +0 -837
  199. package/dist/_chunks/operator-hero-7LiiP7zi.js +0 -171
  200. package/dist/_chunks/shield-check-C73ma9Cs.js +0 -36
@@ -0,0 +1,156 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as M, useId as C, useMemo as R } from "react";
3
+ import { c as q } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as z } from "react-i18next";
5
+ import { B as n } from "./badge-zsf5i5bH.js";
6
+ import { C as N } from "./card-DPmk26CL.js";
7
+ import { A as G, b as O, c as Q, a as S } from "./accordion-9lJSMMsZ.js";
8
+ import { D as t } from "./description-list-BEbK2g93.js";
9
+ import { T as w } from "./timestamp-BV2lC-wV.js";
10
+ import { T as y } from "./triangle-alert-CBPUIzQo.js";
11
+ const H = q("ds:w-full ds:text-[color:var(--foreground)]", {
12
+ variants: {
13
+ // Matches the kit's other `surface` props. `'elevated'` (default)
14
+ // wraps in `<Card variant="elevated">`; `'flat'` drops the chrome
15
+ // for use inside an existing Card / Sheet.
16
+ surface: {
17
+ flat: "",
18
+ elevated: ""
19
+ }
20
+ },
21
+ defaultVariants: { surface: "elevated" }
22
+ }), J = M(
23
+ ({
24
+ dateIso: V,
25
+ createdAtIso: u,
26
+ formName: T,
27
+ highlightedAnswerCount: o = 0,
28
+ status: s,
29
+ answers: d,
30
+ surface: p = "elevated",
31
+ "aria-label": A,
32
+ id: f,
33
+ className: D,
34
+ ...F
35
+ }, I) => {
36
+ const { t: a } = z(), h = C(), L = C(), v = T ?? a("anamnesisCard.defaultFormName", { defaultValue: "Medical history" }), B = A ?? v, i = o > 0, c = (s == null ? void 0 : s.expired) === !0, m = (s == null ? void 0 : s.corrupted) === !0, g = (d == null ? void 0 : d.length) ?? 0, x = R(() => !i && !c && !m ? null : /* @__PURE__ */ r(
37
+ "div",
38
+ {
39
+ role: "list",
40
+ "aria-label": a("anamnesisCard.statusGroupLabel", {
41
+ defaultValue: "Questionnaire status"
42
+ }),
43
+ className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]",
44
+ children: [
45
+ i ? /* @__PURE__ */ e(
46
+ n,
47
+ {
48
+ variant: "error",
49
+ withDot: !0,
50
+ leading: /* @__PURE__ */ e(y, { "aria-hidden": "true" }),
51
+ role: "listitem",
52
+ children: a("anamnesisCard.status.highlighted", {
53
+ count: o,
54
+ defaultValue: "{{count}} flagged answers"
55
+ })
56
+ }
57
+ ) : null,
58
+ c ? /* @__PURE__ */ e(n, { variant: "warning", withDot: !0, role: "listitem", children: a("anamnesisCard.status.expired", { defaultValue: "Expired" }) }) : null,
59
+ m ? /* @__PURE__ */ e(n, { variant: "error", withDot: !0, role: "listitem", children: a("anamnesisCard.status.corrupted", {
60
+ defaultValue: "Corrupted"
61
+ }) }) : null
62
+ ]
63
+ }
64
+ ), [i, c, m, o, a]), j = /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
65
+ /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-wrap ds:items-start ds:gap-[var(--spacing-sm)]", children: [
66
+ /* @__PURE__ */ e(
67
+ "h3",
68
+ {
69
+ id: h,
70
+ className: "type-title-card ds:m-0 ds:text-[color:var(--foreground)]",
71
+ children: v
72
+ }
73
+ ),
74
+ x ? /* @__PURE__ */ e("div", { className: "ds:ms-auto ds:flex ds:shrink-0 ds:items-center", children: x }) : null
75
+ ] }),
76
+ /* @__PURE__ */ r("p", { className: "type-body-sm ds:m-0 ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
77
+ /* @__PURE__ */ r("span", { children: [
78
+ a("anamnesisCard.compiledOn", { defaultValue: "Compiled" }),
79
+ " ",
80
+ /* @__PURE__ */ e(w, { value: V, format: "absolute", shape: "bare" })
81
+ ] }),
82
+ u ? /* @__PURE__ */ r("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
83
+ /* @__PURE__ */ e("span", { "aria-hidden": "true", children: "·" }),
84
+ /* @__PURE__ */ r("span", { children: [
85
+ a("anamnesisCard.submitted", { defaultValue: "Submitted" }),
86
+ " ",
87
+ /* @__PURE__ */ e(
88
+ w,
89
+ {
90
+ value: u,
91
+ format: "relative",
92
+ shape: "bare"
93
+ }
94
+ )
95
+ ] })
96
+ ] }) : null
97
+ ] })
98
+ ] }), k = g > 0 ? /* @__PURE__ */ e(t, { layout: "stacked", density: "compact", divider: "between", children: d.map((l, E) => /* @__PURE__ */ r(
99
+ t.Row,
100
+ {
101
+ className: l.highlight ? "ds:border ds:border-[color:var(--destructive)] ds:rounded-[var(--radius-sm)] ds:p-[var(--spacing-sm)]" : void 0,
102
+ children: [
103
+ /* @__PURE__ */ e(t.Term, { children: /* @__PURE__ */ r("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
104
+ /* @__PURE__ */ e("span", { children: l.question }),
105
+ l.highlight ? /* @__PURE__ */ e(
106
+ n,
107
+ {
108
+ variant: "error",
109
+ size: "sm",
110
+ withDot: !0,
111
+ leading: /* @__PURE__ */ e(y, { "aria-hidden": "true" }),
112
+ "aria-label": a("anamnesisCard.answerFlagLabel", {
113
+ defaultValue: "Flagged answer"
114
+ })
115
+ }
116
+ ) : null
117
+ ] }) }),
118
+ /* @__PURE__ */ e(t.Detail, { children: l.answer })
119
+ ]
120
+ },
121
+ E
122
+ )) }) : /* @__PURE__ */ e("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: a("anamnesisCard.empty", {
123
+ defaultValue: "No answers were recorded."
124
+ }) }), b = /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
125
+ j,
126
+ /* @__PURE__ */ e(G, { type: "single", collapsible: !0, variant: "separated", children: /* @__PURE__ */ r(O, { value: L, children: [
127
+ /* @__PURE__ */ e(Q, { children: a("anamnesisCard.interviewToggle", {
128
+ count: g,
129
+ defaultValue: "Interview ({{count}} answers)"
130
+ }) }),
131
+ /* @__PURE__ */ e(S, { children: k })
132
+ ] }) })
133
+ ] });
134
+ return /* @__PURE__ */ e(
135
+ "div",
136
+ {
137
+ ref: I,
138
+ role: "region",
139
+ "aria-label": B,
140
+ "aria-labelledby": h,
141
+ "data-component": "anamnesis-card",
142
+ "data-component-id": f,
143
+ "data-has-flags": i || void 0,
144
+ id: f,
145
+ className: H({ surface: p, className: D }),
146
+ ...F,
147
+ children: p === "elevated" ? /* @__PURE__ */ e(N, { variant: "elevated", children: /* @__PURE__ */ e(N.Body, { children: b }) }) : b
148
+ }
149
+ );
150
+ }
151
+ );
152
+ J.displayName = "AnamnesisCard";
153
+ export {
154
+ J as A
155
+ };
156
+ //# sourceMappingURL=anamnesis-card-CmkBVAln.js.map
@@ -0,0 +1,419 @@
1
+ import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
+ import { forwardRef as $, useRef as K, useImperativeHandle as Y, useMemo as J } from "react";
3
+ import { c as H } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as G } from "react-i18next";
5
+ import { I as Q } from "./icon-button-CKEOrN37.js";
6
+ import { S as X } from "./skeleton-CZbwyJAA.js";
7
+ import { E as Z } from "./empty-state-BLy7tigq.js";
8
+ import { A as U } from "./avatar-BNQNhoyL.js";
9
+ import { B as P } from "./badge-zsf5i5bH.js";
10
+ import { T as ee } from "./tag-CdA0s_VV.js";
11
+ import { T as ae } from "./timestamp-BV2lC-wV.js";
12
+ import { T as se } from "./transaction-chip-BZCa6XDn.js";
13
+ import { i as re } from "./is-safe-url-DkETxeHz.js";
14
+ import { V as te } from "./video-BAeICxCT.js";
15
+ import { M as ne } from "./map-pin-B8STOPMJ.js";
16
+ import { c as q, a as oe } from "./entity-card-COhmqHly.js";
17
+ import { S as ie } from "./star-vav0SJ9e.js";
18
+ import { G as de } from "./globe-BkEFMNSg.js";
19
+ import { C as le } from "./chevron-right-BrpYejk0.js";
20
+ import { u as ce } from "./registry-nPAVE19X.js";
21
+ import { C as pe } from "./calendar-days-C4BmpCZg.js";
22
+ import { P as me } from "./plus-CYKNmfuA.js";
23
+ const ue = {
24
+ "var(--color-violet-500)": "ds:bg-[var(--color-violet-500)]",
25
+ "var(--color-purple-500)": "ds:bg-[var(--color-purple-500)]",
26
+ "var(--color-magenta-500)": "ds:bg-[var(--color-magenta-500)]",
27
+ "var(--color-blue-500)": "ds:bg-[var(--color-blue-500)]",
28
+ "var(--color-green-500)": "ds:bg-[var(--color-green-500)]",
29
+ "var(--color-red-500)": "ds:bg-[var(--color-red-500)]",
30
+ "var(--color-yellow-500)": "ds:bg-[var(--color-yellow-500)]",
31
+ "var(--color-indigo-500)": "ds:bg-[var(--color-indigo-500)]",
32
+ "var(--color-orange-500)": "ds:bg-[var(--color-orange-500)]",
33
+ "var(--color-fuchsia-500)": "ds:bg-[var(--color-fuchsia-500)]",
34
+ "var(--color-grey-700)": "ds:bg-[var(--color-grey-700)]"
35
+ };
36
+ function fe(e) {
37
+ return ue[q(e)] ?? "ds:bg-[var(--color-grey-700)]";
38
+ }
39
+ const ge = H(
40
+ [
41
+ "ds:relative ds:flex ds:items-start ds:gap-[var(--spacing-sm)]",
42
+ "ds:rounded-[var(--radius-md)]",
43
+ "ds:text-start ds:group",
44
+ "ds:bg-[var(--card)] ds:text-[color:var(--card-foreground)]",
45
+ "ds:transition-colors ds:duration-[var(--animation-duration)]",
46
+ "ds:motion-reduce:transition-none",
47
+ "ds:forced-colors:border ds:forced-colors:border-[CanvasText]"
48
+ ].join(" "),
49
+ {
50
+ variants: {
51
+ size: {
52
+ sm: "ds:p-[var(--spacing-sm)]",
53
+ md: "ds:p-[var(--spacing-md)]"
54
+ },
55
+ interactive: {
56
+ true: "ds:hover:bg-[color:var(--muted)]/40 ds:cursor-pointer",
57
+ false: ""
58
+ }
59
+ },
60
+ defaultVariants: {
61
+ size: "sm",
62
+ interactive: !1
63
+ }
64
+ }
65
+ ), B = [
66
+ "ds:focus-visible:outline-none",
67
+ "ds:after:content-[''] ds:after:absolute ds:after:inset-0 ds:after:rounded-[var(--radius-md)]",
68
+ "ds:after:pointer-events-auto",
69
+ "ds:focus-visible:after:outline-[length:var(--focus-ring-width)]",
70
+ "ds:focus-visible:after:outline-solid",
71
+ "ds:focus-visible:after:outline-[color:var(--ring)]",
72
+ "ds:focus-visible:after:outline-offset-[length:var(--focus-ring-offset)]",
73
+ "ds:forced-colors:focus-visible:after:outline-[CanvasText]"
74
+ ].join(" "), ve = {
75
+ inPractice: ne,
76
+ telehealth: te
77
+ }, F = $(
78
+ ({
79
+ item: e,
80
+ size: i = "sm",
81
+ locale: b,
82
+ currency: x = "EUR",
83
+ onActivate: o,
84
+ className: I,
85
+ ...R
86
+ }, l) => {
87
+ var h, w, t, y, z, V, E, j, L, A, M, _, D;
88
+ const { t: r } = G(), m = !!o, N = !!e.url && re(e.url), v = ((h = e.patient) == null ? void 0 : h.name) ?? r("appointmentCard.noPatient"), c = (w = e.operator) == null ? void 0 : w.name, C = r(`appointmentCard.state.${e.state}`), k = i === "md" ? "md" : "sm", S = ve[e.type], p = r("appointmentCard.itemLabel", {
89
+ patient: v,
90
+ state: C
91
+ }), u = /* @__PURE__ */ a("span", { className: "ds:min-w-0 ds:truncate type-title-item ds:text-[color:var(--foreground)]", children: v });
92
+ let f;
93
+ m && N ? f = /* @__PURE__ */ a(
94
+ "a",
95
+ {
96
+ href: e.url,
97
+ "aria-label": p,
98
+ className: B + " ds:contents",
99
+ onClick: (n) => {
100
+ n.defaultPrevented || n.metaKey || n.ctrlKey || n.shiftKey || o == null || o(e);
101
+ },
102
+ children: u
103
+ }
104
+ ) : m ? f = /* @__PURE__ */ a(
105
+ "button",
106
+ {
107
+ type: "button",
108
+ "aria-label": p,
109
+ className: B + " ds:contents ds:bg-transparent ds:border-0 ds:p-0 ds:text-start",
110
+ onClick: () => o == null ? void 0 : o(e),
111
+ children: u
112
+ }
113
+ ) : f = u;
114
+ const T = (e.treatments ?? []).map((n, O) => {
115
+ const W = n.elements && n.elements.length > 0 ? r("appointmentCard.treatmentWithElements", {
116
+ care: n.careName,
117
+ elements: n.elements.join(", ")
118
+ }) : n.careName;
119
+ return /* @__PURE__ */ a(
120
+ ee,
121
+ {
122
+ label: W,
123
+ variant: "neutral",
124
+ fill: "outline",
125
+ size: "sm",
126
+ maxInlineSize: "12rem"
127
+ },
128
+ `${n.careName}-${O}`
129
+ );
130
+ }), d = (t = e.bookingReason) == null ? void 0 : t.advanceAmountCents, g = typeof d == "number" && d > 0;
131
+ return /* @__PURE__ */ s(
132
+ "div",
133
+ {
134
+ ref: l,
135
+ role: "listitem",
136
+ "data-component": "appointment-card",
137
+ "data-component-id": e.id,
138
+ "data-state": e.state,
139
+ "data-type": e.type,
140
+ className: ge({ size: i, interactive: m, className: I }),
141
+ ...R,
142
+ children: [
143
+ /* @__PURE__ */ s("span", { className: "ds:flex ds:w-16 ds:shrink-0 ds:flex-col ds:items-start ds:gap-[var(--spacing-2xs)]", children: [
144
+ /* @__PURE__ */ s("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
145
+ /* @__PURE__ */ a(S, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }),
146
+ /* @__PURE__ */ a("span", { className: "ds:sr-only", children: r(`appointmentCard.type.${e.type}`) }),
147
+ /* @__PURE__ */ a(
148
+ ae,
149
+ {
150
+ value: e.startIso,
151
+ format: "absolute",
152
+ shape: "bare",
153
+ locale: b,
154
+ absoluteFormat: { hour: "numeric", minute: "2-digit" },
155
+ className: "type-body-sm ds:font-medium ds:text-[color:var(--foreground)] ds:tabular-nums"
156
+ }
157
+ )
158
+ ] }),
159
+ /* @__PURE__ */ a("span", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: r("appointmentCard.duration", { count: e.durationMin }) })
160
+ ] }),
161
+ c ? /* @__PURE__ */ s("span", { className: "ds:relative ds:shrink-0", children: [
162
+ /* @__PURE__ */ a(
163
+ U,
164
+ {
165
+ name: c,
166
+ color: q((y = e.operator) == null ? void 0 : y.colorId),
167
+ size: k,
168
+ "aria-hidden": "true",
169
+ role: "presentation",
170
+ "aria-label": void 0
171
+ }
172
+ ),
173
+ /* @__PURE__ */ a(
174
+ "span",
175
+ {
176
+ "aria-hidden": "true",
177
+ className: "ds:absolute ds:bottom-0 ds:end-0 ds:size-2.5 ds:rounded-[var(--radius-full)] ds:border ds:border-[color:var(--card)] " + fe((z = e.operator) == null ? void 0 : z.colorId)
178
+ }
179
+ )
180
+ ] }) : null,
181
+ /* @__PURE__ */ s("div", { className: "ds:flex-1 ds:min-w-0 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
182
+ /* @__PURE__ */ s("div", { className: "ds:flex ds:items-start ds:gap-[var(--spacing-sm)]", children: [
183
+ /* @__PURE__ */ s("div", { className: "ds:flex-1 ds:min-w-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
184
+ (V = e.patient) != null && V.avatarUrl ? /* @__PURE__ */ a(
185
+ U,
186
+ {
187
+ name: v,
188
+ src: e.patient.avatarUrl,
189
+ size: k,
190
+ className: "ds:shrink-0",
191
+ "aria-hidden": "true",
192
+ role: "presentation",
193
+ "aria-label": void 0
194
+ }
195
+ ) : null,
196
+ f
197
+ ] }),
198
+ /* @__PURE__ */ a(
199
+ P,
200
+ {
201
+ variant: oe(e.state),
202
+ size: "sm",
203
+ withDot: !0,
204
+ className: "ds:shrink-0",
205
+ children: C
206
+ }
207
+ )
208
+ ] }),
209
+ c || e.chair || (E = e.bookingReason) != null && E.specialty || e.firstVisit === "yes" ? /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-sm)] ds:gap-y-[var(--spacing-2xs)] type-eyebrow ds:text-[color:var(--muted-foreground)]", children: [
210
+ c ? /* @__PURE__ */ a("span", { children: c }) : null,
211
+ e.chair ? /* @__PURE__ */ a("span", { children: r("appointmentCard.chair", { chair: e.chair }) }) : null,
212
+ (j = e.bookingReason) != null && j.specialty ? /* @__PURE__ */ a("span", { children: e.bookingReason.specialty }) : null,
213
+ e.firstVisit === "yes" ? /* @__PURE__ */ s("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
214
+ /* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-3 ds:shrink-0" }),
215
+ r("appointmentCard.firstVisit")
216
+ ] }) : null
217
+ ] }) : null,
218
+ (L = e.bookingReason) != null && L.description ? /* @__PURE__ */ a("span", { className: "type-body-sm ds:text-[color:var(--foreground)] ds:truncate", children: e.bookingReason.description }) : null,
219
+ T.length > 0 ? /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: T }) : null,
220
+ (A = e.flags) != null && A.bookedOnline || (M = e.flags) != null && M.highlightedAnamnesis || g ? /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
221
+ (_ = e.flags) != null && _.bookedOnline ? /* @__PURE__ */ a(P, { variant: "info", size: "sm", leading: /* @__PURE__ */ a(de, {}), children: r("appointmentCard.flag.bookedOnline") }) : null,
222
+ (D = e.flags) != null && D.highlightedAnamnesis ? /* @__PURE__ */ a(P, { variant: "warning", size: "sm", withDot: !0, children: r("appointmentCard.flag.highlightedAnamnesis") }) : null,
223
+ g ? /* @__PURE__ */ a(
224
+ se,
225
+ {
226
+ state: "to-invoice",
227
+ amount: d / 100,
228
+ currency: x,
229
+ locale: b,
230
+ size: "sm",
231
+ showLabel: !0
232
+ }
233
+ ) : null
234
+ ] }) : null
235
+ ] }),
236
+ m ? /* @__PURE__ */ a(
237
+ le,
238
+ {
239
+ "aria-hidden": "true",
240
+ className: "ds:size-4 ds:shrink-0 ds:self-center ds:text-[color:var(--muted-foreground)] ds:opacity-0 ds:transition-opacity ds:motion-reduce:transition-none ds:group-hover:opacity-100 ds:group-focus-within:opacity-100 ds:rtl:rotate-180"
241
+ }
242
+ ) : null
243
+ ]
244
+ }
245
+ );
246
+ }
247
+ );
248
+ F.displayName = "AppointmentCard";
249
+ const $e = {
250
+ id: "appointment-card",
251
+ capabilities: ["pick"],
252
+ state: {},
253
+ actions: {},
254
+ domHooks: {
255
+ root: {
256
+ attr: "data-component",
257
+ value: "appointment-card",
258
+ description: "Marks the element as a kit AppointmentCard. The root also emits data-component-id sourced from item.id, data-state with the appointment lifecycle, and data-type with the delivery channel."
259
+ },
260
+ instanceId: {
261
+ attr: "data-component-id",
262
+ sourceProp: "item.id",
263
+ description: "Sourced from item.id — the stable appointment identifier."
264
+ }
265
+ }
266
+ }, he = {
267
+ id: "appointment-tray",
268
+ capabilities: ["select_single"],
269
+ state: {
270
+ items: {
271
+ type: "Array<{ id: string; state: string }>",
272
+ descriptionKey: "ui.agent.appointmentTray.state.items",
273
+ description: "Currently-displayed appointments. Ids + lifecycle state only — never patient identity.",
274
+ read: (e) => e.getItems()
275
+ }
276
+ },
277
+ actions: {
278
+ select_item: {
279
+ safety: "read",
280
+ argsType: "{ id: string }",
281
+ descriptionKey: "ui.agent.appointmentTray.actions.selectItem",
282
+ description: "Activate the appointment with the given id.",
283
+ invoke: (e, i) => {
284
+ e.selectItem(i.id);
285
+ }
286
+ }
287
+ },
288
+ domHooks: {
289
+ root: {
290
+ attr: "data-component",
291
+ value: "appointment-tray",
292
+ description: "Marks the AppointmentTray wrapper."
293
+ },
294
+ instanceId: {
295
+ attr: "data-component-id",
296
+ sourceProp: "id",
297
+ description: "Sourced from the id prop. Required to address a specific tray from the agent."
298
+ },
299
+ item: {
300
+ attr: "data-appointment-id",
301
+ description: "Stable appointment id emitted on each rendered AppointmentCard inside the tray."
302
+ }
303
+ }
304
+ }, ye = H(
305
+ [
306
+ "ds:flex ds:flex-col",
307
+ "ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)]",
308
+ "ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2",
309
+ "ds:bg-[color:var(--card)] ds:text-[color:var(--card-foreground)]",
310
+ "ds:overflow-hidden"
311
+ ].join(" "),
312
+ {
313
+ variants: {
314
+ size: {
315
+ sm: "",
316
+ md: ""
317
+ }
318
+ },
319
+ defaultVariants: {
320
+ size: "sm"
321
+ }
322
+ }
323
+ ), be = $(
324
+ ({
325
+ id: e,
326
+ items: i,
327
+ title: b,
328
+ caption: x,
329
+ size: o = "sm",
330
+ locale: I,
331
+ currency: R,
332
+ onOpenAppointment: l,
333
+ onAddAppointment: r,
334
+ addLabel: m,
335
+ loading: N = !1,
336
+ emptyTitle: v,
337
+ emptyDescription: c,
338
+ className: C,
339
+ ...k
340
+ }, S) => {
341
+ const { t: p } = G(), u = b ?? p("appointmentTray.title"), f = m ?? p("appointmentTray.add"), T = !N && i.length === 0;
342
+ let d;
343
+ N ? d = /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]", children: [0, 1, 2].map((t) => /* @__PURE__ */ a(X, { variant: "rectangular", height: "3.5rem" }, t)) }) : T ? d = /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ a(
344
+ Z,
345
+ {
346
+ variant: "first-use",
347
+ size: "sm",
348
+ title: v ?? p("appointmentTray.empty.title"),
349
+ description: c ?? p("appointmentTray.empty.description")
350
+ }
351
+ ) }) : d = /* @__PURE__ */ a("ul", { className: "ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-2xs)] ds:p-[var(--spacing-2xs)]", children: i.map((t) => /* @__PURE__ */ a(
352
+ F,
353
+ {
354
+ item: t,
355
+ size: o,
356
+ locale: I,
357
+ currency: R,
358
+ onActivate: l,
359
+ "data-appointment-id": t.id
360
+ },
361
+ t.id
362
+ )) });
363
+ const g = K(i);
364
+ g.current = i;
365
+ const h = K(null);
366
+ Y(S, () => h.current, []);
367
+ const w = J(
368
+ () => ({
369
+ getItems: () => g.current.map((t) => ({ id: t.id, state: t.state })),
370
+ selectItem: (t) => {
371
+ const y = g.current.find((z) => z.id === t);
372
+ y && (l == null || l(y));
373
+ }
374
+ }),
375
+ [l]
376
+ );
377
+ return ce(he, w, e), /* @__PURE__ */ s(
378
+ "section",
379
+ {
380
+ ref: h,
381
+ "aria-label": u,
382
+ "data-component": "appointment-tray",
383
+ "data-component-id": e,
384
+ className: ye({ size: o, className: C }),
385
+ ...k,
386
+ children: [
387
+ /* @__PURE__ */ s("header", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]", children: [
388
+ /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:min-w-0", children: [
389
+ /* @__PURE__ */ s("h3", { className: "ds:m-0 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-title-card", children: [
390
+ /* @__PURE__ */ a(pe, { "aria-hidden": "true", className: "ds:size-4" }),
391
+ u
392
+ ] }),
393
+ x ? /* @__PURE__ */ a("span", { className: "type-eyebrow ds:text-[color:var(--muted-foreground)]", children: x }) : null
394
+ ] }),
395
+ r ? /* @__PURE__ */ a(
396
+ Q,
397
+ {
398
+ icon: /* @__PURE__ */ a(me, {}),
399
+ intent: "outline",
400
+ size: "sm",
401
+ "aria-label": f,
402
+ onClick: r
403
+ }
404
+ ) : null
405
+ ] }),
406
+ d
407
+ ]
408
+ }
409
+ );
410
+ }
411
+ );
412
+ be.displayName = "AppointmentTray";
413
+ export {
414
+ F as A,
415
+ be as a,
416
+ $e as b,
417
+ he as c
418
+ };
419
+ //# sourceMappingURL=appointment-tray-BwDHhWWC.js.map