@alfadocs/ui-kit 1.3.13 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/_chunks/agenda-card.agent-Cb5tuEh3.js +28 -0
  2. package/dist/_chunks/{alia-sidebar-DzNz1gDf.js → alia-sidebar-DSBZMick.js} +3 -3
  3. package/dist/_chunks/{anamnesis-i18n-CfC0qYzy.js → anamnesis-i18n-DZcrt8dP.js} +2141 -2069
  4. package/dist/_chunks/{antenatal-schedule-timeline-BMMpi2lb.js → antenatal-schedule-timeline-u8TsS2QJ.js} +27 -26
  5. package/dist/_chunks/{appointment-timeline-B630OT_J.js → appointment-timeline-Bqf1sTU5.js} +2 -2
  6. package/dist/_chunks/{ar-THMLfSoN.js → ar-BR1FGFP2.js} +14 -14
  7. package/dist/_chunks/{bmi-calculator-CM0-G2mg.js → bmi-calculator-CpyY13MV.js} +2 -2
  8. package/dist/_chunks/{booking-DjNbd7C1.js → booking-BjsA7j1-.js} +699 -688
  9. package/dist/_chunks/calculator-dialog-12d3Sxaz.js +48 -0
  10. package/dist/_chunks/{care-plan-card-1G_f4I5s.js → care-plan-card-BvQy366X.js} +3 -3
  11. package/dist/_chunks/{care-plan-entry-card-DmBsffHS.js → care-plan-entry-card-apk_5B3O.js} +2 -2
  12. package/dist/_chunks/{chat-container-HlFnoEIl.js → chat-container-CYYego1W.js} +105 -81
  13. package/dist/_chunks/cycle-calculator-B7fyH-h4.js +425 -0
  14. package/dist/_chunks/{date-picker-ZHejTVAJ.js → date-picker-Bp64zk2p.js} +19 -19
  15. package/dist/_chunks/date-picker-variants-pKAJfnWr.js +2089 -0
  16. package/dist/_chunks/{date-range-picker-pEG3Ln3i.js → date-range-picker-CDrZ8Zh0.js} +27 -27
  17. package/dist/_chunks/{date-time-picker-695QvBGj.js → date-time-picker-DafkGDGO.js} +10 -10
  18. package/dist/_chunks/{de-DmZ-8rTN.js → de-3iM4rGqo.js} +7 -7
  19. package/dist/_chunks/{document-preview-D3gg4MXB.js → document-preview-DOrsqiN1.js} +2 -2
  20. package/dist/_chunks/due-date-calculator-CnkbbAej.js +571 -0
  21. package/dist/_chunks/{editor-overlay-DE3esyio.js → editor-overlay-B1tr2i7B.js} +22 -21
  22. package/dist/_chunks/{el-Bela9mxs.js → el-C96rGJvU.js} +2 -2
  23. package/dist/_chunks/{es-BNncHKex.js → es-Cxiqjx8r.js} +12 -12
  24. package/dist/_chunks/fetal-weight-avlj-l-S.js +223 -0
  25. package/dist/_chunks/format-4HNwNGrN.js +1315 -0
  26. package/dist/_chunks/{fr-CH8ADfhN.js → fr-Bhr6SYKj.js} +21 -21
  27. package/dist/_chunks/{freemium-paywall-C_Ue6wxU.js → freemium-paywall-DRDdWuOg.js} +3 -3
  28. package/dist/_chunks/gestational-age-calculator-BljY_DVJ.js +488 -0
  29. package/dist/_chunks/hcg-doubling-Cv_vH61p.js +312 -0
  30. package/dist/_chunks/header-settings-Cn5fPXCE.js +335 -0
  31. package/dist/_chunks/{hi-Bppfxp8l.js → hi-BxXX26d_.js} +12 -12
  32. package/dist/_chunks/isSameWeek-B73MagWB.js +13 -0
  33. package/dist/_chunks/{it-B4ySaRyK.js → it-Xmjomvyj.js} +24 -24
  34. package/dist/_chunks/{ja-CGF6Io9P.js → ja-mfZvt1ZV.js} +16 -16
  35. package/dist/_chunks/{link-cell-renderer-C5XLwVXQ.js → link-cell-renderer-CJ_gk7gl.js} +3 -3
  36. package/dist/_chunks/{locale-picker-BfBUdT1m.js → locale-picker-D9Kv2zrK.js} +153 -132
  37. package/dist/_chunks/map-view-2yZCQW2l.js +445 -0
  38. package/dist/_chunks/{marketplace-app-shell-DwcFMxzp.js → marketplace-app-shell-BLRvg-M0.js} +49 -40
  39. package/dist/_chunks/{nl-DuShqwuV.js → nl-DDs-KEnD.js} +15 -15
  40. package/dist/_chunks/{notes-panel-DPsgB4Mv.js → notes-panel-CiFN3sLW.js} +2 -2
  41. package/dist/_chunks/{number-input-DrozbZAU.js → number-input-DOe5VYei.js} +64 -64
  42. package/dist/_chunks/{optical-prescription-BDHJr8Zz.js → optical-prescription-CRemE8fL.js} +2 -2
  43. package/dist/_chunks/{parse-DvA97ro9.js → parse-JqixfsU0.js} +43 -43
  44. package/dist/_chunks/parseISO-fOGpHKXm.js +120 -0
  45. package/dist/_chunks/{patient-details-DqjjwPmt.js → patient-details-CpunD0qx.js} +3 -3
  46. package/dist/_chunks/{patient-table-BmIDrLIS.js → patient-table-2eWx-Rrk.js} +2 -2
  47. package/dist/_chunks/{payment-form-h-BZ8onk.js → payment-form-Ds1I9KqB.js} +308 -231
  48. package/dist/_chunks/{pdf-viewer-Ddx-T053.js → pdf-viewer-DUIsV9s5.js} +429 -369
  49. package/dist/_chunks/{pl-CKQwX9Fk.js → pl-BYYMnEWP.js} +18 -18
  50. package/dist/_chunks/{practice-results-B-HPc13W.js → practice-results-SjCniMd2.js} +2 -2
  51. package/dist/_chunks/pregnancy-dating-BmpHScZ0.js +770 -0
  52. package/dist/_chunks/pregnancy-weight-gain-B5KSJzdc.js +553 -0
  53. package/dist/_chunks/progress-CK8otcQ-.js +343 -0
  54. package/dist/_chunks/{pt-_njpXyOZ.js → pt-BSPnVrQ7.js} +20 -20
  55. package/dist/_chunks/{radiograph-panel.agent-BQZ64Riy.js → radiograph-panel.agent-CtFtNMzk.js} +3 -3
  56. package/dist/_chunks/{rich-text-editor-CfeXPPWs.js → rich-text-editor-BedTpWzL.js} +2 -2
  57. package/dist/_chunks/{ro-3X6_4FcN.js → ro-BbiylGmG.js} +14 -14
  58. package/dist/_chunks/{ru-bAcgmnS-.js → ru-BX_qsV67.js} +14 -14
  59. package/dist/_chunks/{session-countdown-Bc70VXN1.js → session-countdown-BL-Psg8u.js} +2 -2
  60. package/dist/_chunks/{sign-document-CW_ByDUh.js → sign-document-jF4fZDJ5.js} +2 -2
  61. package/dist/_chunks/slot-grid-DNiUcXy2.js +640 -0
  62. package/dist/_chunks/{sparkline-BTY4B5tv.js → sparkline-BmGcEyZO.js} +209 -164
  63. package/dist/_chunks/{sq-jYFqr4Ga.js → sq-i9UOk4P7.js} +10 -10
  64. package/dist/_chunks/subDays-CAUv47M1.js +8 -0
  65. package/dist/_chunks/{sv-BSGEJ-8B.js → sv-CpTdtmDQ.js} +8 -8
  66. package/dist/_chunks/{tab-bar-Axhk6xzx.js → tab-bar-BYESZINM.js} +83 -77
  67. package/dist/_chunks/task-card.agent-CF2N_uu4.js +29 -0
  68. package/dist/_chunks/{tr-CTpgUtw6.js → tr-DXG2QN1K.js} +17 -17
  69. package/dist/_chunks/{unit-converter-COgkN7YP.js → unit-converter-CHPDuV7W.js} +2 -2
  70. package/dist/_chunks/{warning-stack-BtjmJChC.js → warning-stack-B7t_8jRE.js} +42 -37
  71. package/dist/_chunks/{zh-CN-BgM0Io2O.js → zh-CN-vPkPEK6H.js} +18 -18
  72. package/dist/agent-catalog.json +6426 -3382
  73. package/dist/agent-i18n/en.json +234 -15
  74. package/dist/components/agenda-card/index.js +1 -1
  75. package/dist/components/appointment-timeline/index.js +1 -1
  76. package/dist/components/bmi-calculator/index.js +1 -1
  77. package/dist/components/booking/index.js +1 -1
  78. package/dist/components/calculator-dialog/index.js +1 -1
  79. package/dist/components/care-plan-card/index.js +1 -1
  80. package/dist/components/care-plan-entry-card/index.js +1 -1
  81. package/dist/components/chat-container/chat-container.d.ts +14 -0
  82. package/dist/components/chat-container/index.js +1 -1
  83. package/dist/components/cycle-calculator/cycle-calculator.agent.d.ts +4 -0
  84. package/dist/components/cycle-calculator/cycle-calculator.d.ts +42 -0
  85. package/dist/components/cycle-calculator/index.d.ts +1 -1
  86. package/dist/components/cycle-calculator/index.js +1 -1
  87. package/dist/components/data-table/index.js +1 -1
  88. package/dist/components/date-picker/index.js +1 -1
  89. package/dist/components/date-range-picker/index.js +1 -1
  90. package/dist/components/date-time-picker/index.js +1 -1
  91. package/dist/components/document-preview/index.js +1 -1
  92. package/dist/components/due-date-calculator/due-date-calculator.agent.d.ts +4 -0
  93. package/dist/components/due-date-calculator/due-date-calculator.d.ts +61 -1
  94. package/dist/components/due-date-calculator/index.d.ts +1 -1
  95. package/dist/components/due-date-calculator/index.js +2 -2
  96. package/dist/components/editor-overlay/editor-overlay.d.ts +7 -1
  97. package/dist/components/editor-overlay/index.js +1 -1
  98. package/dist/components/fetal-weight/fetal-weight.agent.d.ts +4 -0
  99. package/dist/components/fetal-weight/fetal-weight.d.ts +26 -0
  100. package/dist/components/fetal-weight/index.d.ts +1 -1
  101. package/dist/components/fetal-weight/index.js +1 -1
  102. package/dist/components/freemium-paywall/index.js +1 -1
  103. package/dist/components/gestational-age-calculator/gestational-age-calculator.agent.d.ts +4 -0
  104. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +44 -2
  105. package/dist/components/gestational-age-calculator/index.d.ts +1 -1
  106. package/dist/components/gestational-age-calculator/index.js +1 -1
  107. package/dist/components/hcg-doubling/hcg-doubling.agent.d.ts +4 -0
  108. package/dist/components/hcg-doubling/hcg-doubling.d.ts +30 -0
  109. package/dist/components/hcg-doubling/index.d.ts +1 -1
  110. package/dist/components/hcg-doubling/index.js +1 -1
  111. package/dist/components/header-settings/header-settings.d.ts +13 -1
  112. package/dist/components/header-settings/index.js +1 -1
  113. package/dist/components/locale-picker/index.js +1 -1
  114. package/dist/components/locale-picker/locale-picker.d.ts +9 -0
  115. package/dist/components/map-view/index.js +1 -1
  116. package/dist/components/map-view/map-view.d.ts +22 -0
  117. package/dist/components/notes-panel/index.js +1 -1
  118. package/dist/components/number-input/index.js +1 -1
  119. package/dist/components/number-input/number-input.d.ts +2 -1
  120. package/dist/components/optical-prescription/index.js +1 -1
  121. package/dist/components/patient-details/index.js +1 -1
  122. package/dist/components/patient-table/index.js +1 -1
  123. package/dist/components/payment-form/index.d.ts +1 -1
  124. package/dist/components/payment-form/index.js +1 -1
  125. package/dist/components/payment-form/payment-form.d.ts +32 -1
  126. package/dist/components/pdf-viewer/index.js +1 -1
  127. package/dist/components/pdf-viewer/pdf-viewer.d.ts +13 -0
  128. package/dist/components/practice-results/index.js +1 -1
  129. package/dist/components/pregnancy-dating/index.d.ts +1 -1
  130. package/dist/components/pregnancy-dating/index.js +1 -1
  131. package/dist/components/pregnancy-dating/pregnancy-dating.agent.d.ts +4 -0
  132. package/dist/components/pregnancy-dating/pregnancy-dating.d.ts +65 -1
  133. package/dist/components/pregnancy-weight-gain/index.d.ts +2 -1
  134. package/dist/components/pregnancy-weight-gain/index.js +6 -5
  135. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.agent.d.ts +4 -0
  136. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +35 -0
  137. package/dist/components/progress/index.js +1 -1
  138. package/dist/components/progress/progress.d.ts +13 -0
  139. package/dist/components/radiograph-panel/index.js +1 -1
  140. package/dist/components/rich-text-editor/index.js +1 -1
  141. package/dist/components/session-countdown/index.js +1 -1
  142. package/dist/components/sign-document/index.js +1 -1
  143. package/dist/components/slot-grid/index.d.ts +2 -1
  144. package/dist/components/slot-grid/index.js +5 -4
  145. package/dist/components/slot-grid/slot-grid.agent.d.ts +4 -0
  146. package/dist/components/slot-grid/slot-grid.d.ts +34 -0
  147. package/dist/components/sparkline/index.js +1 -1
  148. package/dist/components/sparkline/sparkline.d.ts +10 -0
  149. package/dist/components/tab-bar/index.js +1 -1
  150. package/dist/components/tab-bar/tab-bar.d.ts +13 -0
  151. package/dist/components/task-card/index.js +1 -1
  152. package/dist/components/unit-converter/index.js +1 -1
  153. package/dist/components/warning-stack/index.js +1 -1
  154. package/dist/index.js +630 -627
  155. package/dist/patterns/alia-assistant/index.js +1 -1
  156. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +27 -8
  157. package/dist/patterns/anamnesis/anamnesis-format.d.ts +11 -3
  158. package/dist/patterns/anamnesis/anamnesis-highlight.d.ts +6 -0
  159. package/dist/patterns/anamnesis/anamnesis-questionnaire.d.ts +23 -9
  160. package/dist/patterns/anamnesis/anamnesis-types.d.ts +7 -0
  161. package/dist/patterns/anamnesis/anamnesis.d.ts +16 -7
  162. package/dist/patterns/anamnesis/index.d.ts +3 -2
  163. package/dist/patterns/anamnesis/index.js +7 -6
  164. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  165. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +6 -0
  166. package/dist/tokens.css +1 -1
  167. package/package.json +1 -1
  168. package/dist/_chunks/agenda-card.agent-mTCrkKSZ.js +0 -27
  169. package/dist/_chunks/calculator-dialog-DuXMQSdm.js +0 -40
  170. package/dist/_chunks/cycle-calculator-BwqYVPB4.js +0 -252
  171. package/dist/_chunks/date-picker-variants-eL6HjWvw.js +0 -3363
  172. package/dist/_chunks/due-date-calculator-CwfsFd3T.js +0 -256
  173. package/dist/_chunks/fetal-weight-ePlLjJPc.js +0 -122
  174. package/dist/_chunks/gestational-age-calculator-DdgbH69Z.js +0 -311
  175. package/dist/_chunks/hcg-doubling-BBqD2wI2.js +0 -170
  176. package/dist/_chunks/header-settings--pjYOe6g.js +0 -284
  177. package/dist/_chunks/isSameDay-DUEiAT0G.js +0 -39
  178. package/dist/_chunks/isSameWeek-CK4HS9lH.js +0 -14
  179. package/dist/_chunks/map-view-CsaHfoo6.js +0 -378
  180. package/dist/_chunks/pregnancy-dating-DzYTlBkT.js +0 -421
  181. package/dist/_chunks/pregnancy-weight-gain-O6J0sUIi.js +0 -322
  182. package/dist/_chunks/progress-DA413-zn.js +0 -299
  183. package/dist/_chunks/slot-grid-CQSULZjd.js +0 -502
  184. package/dist/_chunks/subDays-BcNi04uf.js +0 -8
  185. package/dist/_chunks/task-card.agent-Bt14CzUd.js +0 -25
@@ -0,0 +1,48 @@
1
+ import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
3
+ import { D as r } from "./dialog-UbKJCi1X.js";
4
+ const u = p(
5
+ ({
6
+ trigger: i,
7
+ title: t,
8
+ description: o,
9
+ children: n,
10
+ size: c = "lg",
11
+ open: d,
12
+ defaultOpen: m,
13
+ onOpenChange: s,
14
+ id: e,
15
+ className: g
16
+ }, h) => /* @__PURE__ */ a(
17
+ r,
18
+ {
19
+ open: d,
20
+ defaultOpen: m,
21
+ onOpenChange: s,
22
+ id: e,
23
+ children: [
24
+ /* @__PURE__ */ l(r.Trigger, { asChild: !0, children: i }),
25
+ /* @__PURE__ */ a(r.Content, { ref: h, size: c, children: [
26
+ /* @__PURE__ */ a(r.Header, { children: [
27
+ /* @__PURE__ */ l(r.Title, { children: t }),
28
+ o ? /* @__PURE__ */ l(r.Description, { children: o }) : null
29
+ ] }),
30
+ /* @__PURE__ */ l(
31
+ "div",
32
+ {
33
+ "data-component": "calculator-dialog",
34
+ "data-component-id": e,
35
+ className: g,
36
+ children: n
37
+ }
38
+ )
39
+ ] })
40
+ ]
41
+ }
42
+ )
43
+ );
44
+ u.displayName = "CalculatorDialog";
45
+ export {
46
+ u as C
47
+ };
48
+ //# sourceMappingURL=calculator-dialog-12d3Sxaz.js.map
@@ -3,11 +3,11 @@ import { forwardRef as H, useId as P } from "react";
3
3
  import { useTranslation as M } from "react-i18next";
4
4
  import { B as N } from "./badge-DCOqV9mI.js";
5
5
  import { L as F } from "./link-CPb_pZPr.js";
6
- import { P as A } from "./progress-DA413-zn.js";
6
+ import { P as A } from "./progress-CK8otcQ-.js";
7
7
  import { T as C } from "./timestamp-BV2lC-wV.js";
8
8
  import { T as L } from "./transaction-chip-DJCstquX.js";
9
9
  import { A as O, b as G, c as Y, a as $ } from "./accordion-C11v9ouP.js";
10
- import { C as q } from "./care-plan-entry-card-DmBsffHS.js";
10
+ import { C as q } from "./care-plan-entry-card-apk_5B3O.js";
11
11
  import { u as J } from "./registry-DvAUVLHh.js";
12
12
  import { C as Q, e as W } from "./entity-card-9_62gY7l.js";
13
13
  import { i as X } from "./is-safe-url-DkETxeHz.js";
@@ -253,4 +253,4 @@ export {
253
253
  de as C,
254
254
  Z as c
255
255
  };
256
- //# sourceMappingURL=care-plan-card-1G_f4I5s.js.map
256
+ //# sourceMappingURL=care-plan-card-BvQy366X.js.map
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import { forwardRef as _, useId as v } from "react";
3
3
  import { useTranslation as R } from "react-i18next";
4
4
  import { B as c } from "./badge-DCOqV9mI.js";
5
- import { P as O } from "./progress-DA413-zn.js";
5
+ import { P as O } from "./progress-CK8otcQ-.js";
6
6
  import { T as q } from "./tag-3wgkwwDB.js";
7
7
  import { T as b } from "./timestamp-BV2lC-wV.js";
8
8
  import { T as G } from "./transaction-chip-DJCstquX.js";
@@ -319,4 +319,4 @@ export {
319
319
  le as C,
320
320
  re as c
321
321
  };
322
- //# sourceMappingURL=care-plan-entry-card-DmBsffHS.js.map
322
+ //# sourceMappingURL=care-plan-entry-card-apk_5B3O.js.map
@@ -1,19 +1,37 @@
1
- import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as B, useRef as p, useState as C, useCallback as H, useImperativeHandle as L, useMemo as S, useEffect as j } from "react";
3
- import { c as w } from "./index-D2ZczOXr.js";
1
+ import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as V, useRef as i, useState as M, useCallback as H, useImperativeHandle as L, useMemo as S, useEffect as j } from "react";
3
+ import { c as k } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as E } from "react-i18next";
5
- import { u as M } from "./registry-DvAUVLHh.js";
5
+ import { u as K } from "./registry-DvAUVLHh.js";
6
6
  import { u as O } from "./index-CJE9uQmb.js";
7
- import { F as A } from "./floating-action-button-pojvb9gG.js";
8
- import { u as F } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
- import { u as K } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
10
- import { C as P } from "./chevron-down-DWE7GSq9.js";
11
- const $ = {
7
+ import { F } from "./floating-action-button-pojvb9gG.js";
8
+ import { u as P } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
+ import { u as $ } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
10
+ import { C as D } from "./chevron-down-DWE7GSq9.js";
11
+ const U = {
12
12
  id: "chat-container",
13
13
  // Scrolling the log viewport is pure ephemeral view state — `scroll`,
14
14
  // not `navigate` (nothing routes; the conversation stays in place).
15
15
  capabilities: ["scroll"],
16
- state: {},
16
+ // A9 / §7 is the live constraint here: the message log is PHI-bearing
17
+ // on the Alia surfaces, so the slots stay at scroll position and a
18
+ // count. `ChatContainerHandle.getScrollViewport()` is deliberately NOT
19
+ // surfaced — it returns a live DOM node whose subtree is the whole
20
+ // transcript.
21
+ state: {
22
+ isAtBottom: {
23
+ type: "boolean",
24
+ descriptionKey: "ui.agent.chatContainer.state.isAtBottom",
25
+ description: "True when the viewport is pinned to the newest message. The read-back for `scroll_to_bottom` — the direct confirmation that the latest turn is on screen.",
26
+ read: (t) => t.isAtBottom()
27
+ },
28
+ messageCount: {
29
+ type: "number",
30
+ descriptionKey: "ui.agent.chatContainer.state.messageCount",
31
+ description: "Number of messages currently rendered in the log. Count only — never message content.",
32
+ read: (t) => t.getMessageCount()
33
+ }
34
+ },
17
35
  actions: {
18
36
  scroll_to_bottom: {
19
37
  safety: "read",
@@ -29,9 +47,9 @@ const $ = {
29
47
  },
30
48
  idempotent: !0,
31
49
  descriptionKey: "ui.agent.chatContainer.actions.scrollToBottom",
32
- description: "Scroll the conversation viewport to the latest message.",
33
- invoke: (o, r) => {
34
- o.scrollToBottom(r);
50
+ description: "Scroll the conversation viewport to the latest message. Read the `isAtBottom` slot afterwards to confirm the viewport settled there.",
51
+ invoke: (t, d) => {
52
+ t.scrollToBottom(d);
35
53
  }
36
54
  }
37
55
  },
@@ -43,7 +61,7 @@ const $ = {
43
61
  description: "Sourced from the id prop."
44
62
  }
45
63
  }
46
- }, D = w(
64
+ }, X = k(
47
65
  "ds:relative ds:flex ds:w-full ds:flex-col ds:overflow-hidden ds:bg-background",
48
66
  {
49
67
  variants: {
@@ -54,7 +72,7 @@ const $ = {
54
72
  },
55
73
  defaultVariants: { density: "default" }
56
74
  }
57
- ), U = w(
75
+ ), Y = k(
58
76
  [
59
77
  "ds:flex-1 ds:min-h-0 ds:overflow-y-auto ds:overflow-x-hidden",
60
78
  "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
@@ -74,114 +92,120 @@ const $ = {
74
92
  "ds:[.theme-accessible_&]:[mask-image:none]",
75
93
  "ds:forced-colors:[mask-image:none]"
76
94
  ].join(" ")
77
- ), X = 100, Y = 48, Z = B(
95
+ ), Z = 100, q = 48, G = V(
78
96
  ({
79
- messages: o,
80
- composer: r,
81
- density: y = "default",
82
- className: k,
83
- id: u,
84
- onAutoScrollChange: i,
85
- showScrollToLatest: I = !1,
86
- ...N
87
- }, T) => {
88
- const { t: f } = E(), a = p(null), v = p(null), [c, _] = C(!0), h = F(), n = H(
97
+ messages: t,
98
+ composer: d,
99
+ density: C = "default",
100
+ className: T,
101
+ id: p,
102
+ onAutoScrollChange: c,
103
+ showScrollToLatest: N = !1,
104
+ ..._
105
+ }, B) => {
106
+ const { t: f } = E(), n = i(null), h = i(null), [a, I] = M(!0), g = P(), r = H(
89
107
  (e) => {
90
- const s = a.current;
108
+ const s = n.current;
91
109
  if (!s) return;
92
- const d = ((e == null ? void 0 : e.smooth) ?? !0) && !h;
110
+ const l = ((e == null ? void 0 : e.smooth) ?? !0) && !g;
93
111
  s.scrollTo({
94
112
  top: s.scrollHeight,
95
- behavior: d ? "smooth" : "auto"
113
+ behavior: l ? "smooth" : "auto"
96
114
  });
97
115
  },
98
- [h]
99
- ), g = p(null);
100
- L(T, () => g.current, []);
116
+ [g]
117
+ ), v = i(null);
118
+ L(B, () => v.current, []);
119
+ const b = i(a);
120
+ b.current = a;
121
+ const x = i(t.length);
122
+ x.current = t.length;
101
123
  const R = S(
102
124
  () => ({
103
- scrollToBottom: n,
104
- getScrollViewport: () => a.current
125
+ scrollToBottom: r,
126
+ getScrollViewport: () => n.current,
127
+ isAtBottom: () => b.current,
128
+ getMessageCount: () => x.current
105
129
  }),
106
- [n]
130
+ [r]
107
131
  );
108
- M($, R, u), j(() => {
109
- const e = a.current, s = v.current;
132
+ K(U, R, p), j(() => {
133
+ const e = n.current, s = h.current;
110
134
  if (!e || !s) return;
111
- const d = new IntersectionObserver(
112
- (V) => {
113
- const x = V[0];
114
- _(x.isIntersecting), i == null || i(x.isIntersecting);
135
+ const l = new IntersectionObserver(
136
+ (z) => {
137
+ const w = z[0];
138
+ I(w.isIntersecting), c == null || c(w.isIntersecting);
115
139
  },
116
140
  {
117
141
  root: e,
118
142
  // Fire when the sentinel is within BOTTOM_SLACK_PX of being visible.
119
- rootMargin: `0px 0px ${Y}px 0px`,
143
+ rootMargin: `0px 0px ${q}px 0px`,
120
144
  threshold: 0
121
145
  }
122
146
  );
123
- return d.observe(s), () => d.disconnect();
124
- }, [i]);
125
- const z = o.length;
126
- K(() => {
127
- c && n({ smooth: !1 });
128
- }, [z, c, n]);
129
- const b = o.length > X, l = O({
130
- count: b ? o.length : 0,
131
- getScrollElement: () => a.current,
147
+ return l.observe(s), () => l.disconnect();
148
+ }, [c]);
149
+ const A = t.length;
150
+ $(() => {
151
+ a && r({ smooth: !1 });
152
+ }, [A, a, r]);
153
+ const y = t.length > Z, m = O({
154
+ count: y ? t.length : 0,
155
+ getScrollElement: () => n.current,
132
156
  estimateSize: () => 80,
133
157
  overscan: 6,
134
158
  getItemKey: (e) => {
135
159
  var s;
136
- return ((s = o[e]) == null ? void 0 : s.id) ?? e;
160
+ return ((s = t[e]) == null ? void 0 : s.id) ?? e;
137
161
  }
138
162
  });
139
- return /* @__PURE__ */ m(
163
+ return /* @__PURE__ */ u(
140
164
  "div",
141
165
  {
142
- ref: g,
143
- className: D({ density: y, className: k }),
166
+ ref: v,
167
+ className: X({ density: C, className: T }),
144
168
  "data-component": "chat-container",
145
- "data-component-id": u,
146
- ...N,
169
+ "data-component-id": p,
170
+ ..._,
147
171
  children: [
148
- /* @__PURE__ */ m("div", { className: "ds:relative ds:flex-1 ds:min-h-0 ds:flex ds:flex-col", children: [
149
- /* @__PURE__ */ m(
172
+ /* @__PURE__ */ u("div", { className: "ds:relative ds:flex-1 ds:min-h-0 ds:flex ds:flex-col", children: [
173
+ /* @__PURE__ */ u(
150
174
  "div",
151
175
  {
152
- ref: a,
176
+ ref: n,
153
177
  role: "log",
154
178
  "aria-live": "polite",
155
179
  "aria-relevant": "additions",
156
180
  "aria-label": f("chat.container"),
157
181
  tabIndex: 0,
158
- className: U(),
182
+ className: Y(),
159
183
  children: [
160
- b ? /* @__PURE__ */ t(
184
+ y ? /* @__PURE__ */ o(
161
185
  "ol",
162
186
  {
163
187
  className: "ds:relative ds:list-none ds:ps-0 ds:m-0",
164
- style: { blockSize: `${l.getTotalSize()}px` },
165
- children: l.getVirtualItems().map((e) => {
166
- const s = o[e.index];
167
- return s ? /* @__PURE__ */ t(
188
+ style: { blockSize: `${m.getTotalSize()}px` },
189
+ children: m.getVirtualItems().map((e) => {
190
+ const s = t[e.index];
191
+ return s ? /* @__PURE__ */ o(
168
192
  "li",
169
193
  {
170
194
  "data-index": e.index,
171
- ref: l.measureElement,
195
+ ref: m.measureElement,
172
196
  className: "ds:absolute ds:start-0 ds:end-0 ds:top-0 ds:w-full",
173
197
  style: { transform: `translateY(${e.start}px)` },
174
- children: /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: s.node })
198
+ children: /* @__PURE__ */ o("div", { className: "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: s.node })
175
199
  },
176
200
  s.id
177
201
  ) : null;
178
202
  })
179
203
  }
180
- ) : /* @__PURE__ */ t("ol", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:list-none ds:ps-0 ds:m-0", children: o.map((e) => /* @__PURE__ */ t("li", { children: e.node }, e.id)) }),
181
- /* @__PURE__ */ t(
204
+ ) : /* @__PURE__ */ o("ol", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:list-none ds:ps-0 ds:m-0", children: t.map((e) => /* @__PURE__ */ o("li", { children: e.node }, e.id)) }),
205
+ /* @__PURE__ */ o(
182
206
  "div",
183
207
  {
184
- ref: v,
208
+ ref: h,
185
209
  "aria-hidden": "true",
186
210
  className: "ds:h-1 ds:w-full"
187
211
  }
@@ -189,7 +213,7 @@ const $ = {
189
213
  ]
190
214
  }
191
215
  ),
192
- I && !c ? /* @__PURE__ */ t(
216
+ N && !a ? /* @__PURE__ */ o(
193
217
  "div",
194
218
  {
195
219
  className: [
@@ -208,29 +232,29 @@ const $ = {
208
232
  "ds:motion-safe:animate-in ds:motion-safe:fade-in-0 ds:motion-safe:zoom-in-95",
209
233
  "ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]"
210
234
  ].join(" "),
211
- children: /* @__PURE__ */ t("div", { className: "ds:pointer-events-auto", children: /* @__PURE__ */ t(
212
- A,
235
+ children: /* @__PURE__ */ o("div", { className: "ds:pointer-events-auto", children: /* @__PURE__ */ o(
236
+ F,
213
237
  {
214
- icon: /* @__PURE__ */ t(P, {}),
238
+ icon: /* @__PURE__ */ o(D, {}),
215
239
  "aria-label": f("chat.scrollToLatest"),
216
240
  size: "sm",
217
241
  variant: "secondary",
218
242
  position: "static",
219
- onClick: () => n({ smooth: !0 })
243
+ onClick: () => r({ smooth: !0 })
220
244
  }
221
245
  ) })
222
246
  }
223
247
  ) : null
224
248
  ] }),
225
- r ? /* @__PURE__ */ t("div", { className: "ds:shrink-0 ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)] ds:bg-background", children: r }) : null
249
+ d ? /* @__PURE__ */ o("div", { className: "ds:shrink-0 ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)] ds:bg-background", children: d }) : null
226
250
  ]
227
251
  }
228
252
  );
229
253
  }
230
254
  );
231
- Z.displayName = "ChatContainer";
255
+ G.displayName = "ChatContainer";
232
256
  export {
233
- Z as C,
234
- $ as c
257
+ G as C,
258
+ U as c
235
259
  };
236
- //# sourceMappingURL=chat-container-HlFnoEIl.js.map
260
+ //# sourceMappingURL=chat-container-CYYego1W.js.map