@alfadocs/ui-kit 1.134.0 → 1.136.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/{ai-prompt-input-JIPbrTF3.js → ai-prompt-input-CVNeusoW.js} +2 -2
  2. package/dist/_chunks/ai-summary-panel-BhCo2vZF.js +1045 -0
  3. package/dist/_chunks/{alia-sidebar-CK1zw_Bc.js → alia-sidebar-CVBlKur9.js} +4 -4
  4. package/dist/_chunks/{anamnesis-summary-rows-CCNmkq55.js → anamnesis-summary-rows-Dr2V1Rtf.js} +3 -3
  5. package/dist/_chunks/{appointment-card-DG3m9yN-.js → appointment-card-BT1cMZIX.js} +2 -2
  6. package/dist/_chunks/{appointment-peek-BK0tDs4C.js → appointment-peek-BP_ACFz5.js} +2 -2
  7. package/dist/_chunks/{appointment-timeline-BiI2riRZ.js → appointment-timeline-Dy4YQJ17.js} +2 -2
  8. package/dist/_chunks/{appointment-tray-ClJCtYQj.js → appointment-tray-B3gSHL1j.js} +2 -2
  9. package/dist/_chunks/{audio-recorder-CsnM_WDy.js → audio-recorder-BOF5YYoC.js} +2 -2
  10. package/dist/_chunks/{balance-badge-cell-DTiMdnCZ.js → balance-badge-cell-BSB02Bwo.js} +4 -4
  11. package/dist/_chunks/{bill-line-table-DHKb_O7c.js → bill-line-table-By-YL2ms.js} +2 -2
  12. package/dist/_chunks/{bishop-score-CKztphVz.js → bishop-score-DWGESRP9.js} +2 -2
  13. package/dist/_chunks/{calendar-appointment-editor-dialog-BSkIYGlW.js → calendar-appointment-editor-dialog-CB4cQOtc.js} +10 -10
  14. package/dist/_chunks/call-status-chip-pajxN5eZ.js +180 -0
  15. package/dist/_chunks/calls-panel-BIfatK90.js +1094 -0
  16. package/dist/_chunks/{chat-container-B83b4hut.js → chat-container-CoOT7dzB.js} +37 -36
  17. package/dist/_chunks/{chat-input-DwQ4_WXK.js → chat-input-BmvnuZqj.js} +112 -106
  18. package/dist/_chunks/{chat-message-CfIyXrxA.js → chat-message-B4TMeZ2m.js} +35 -30
  19. package/dist/_chunks/circle-x-W8Enq3i4.js +16 -0
  20. package/dist/_chunks/communications-panel-SQ-55e3V.js +1079 -0
  21. package/dist/_chunks/{data-grid-B2oaI7Lt.js → data-grid-CxKz8flO.js} +2 -2
  22. package/dist/_chunks/{data-table-FTV3uRjX.js → data-table-_tgj0C_T.js} +2 -2
  23. package/dist/_chunks/{default-tabs-DbebYO04.js → default-tabs-oDWQzbN7.js} +3 -3
  24. package/dist/_chunks/{document-preview-DLVIrOYV.js → document-preview-DWlejd8A.js} +2 -2
  25. package/dist/_chunks/entity-summary-CPUHzyil.js +297 -0
  26. package/dist/_chunks/{file-manager-Bzr5NK1t.js → file-manager-CEi4z2i0.js} +2 -2
  27. package/dist/_chunks/{gestational-age-calculator-mB6brTlp.js → gestational-age-calculator-CHbpC4vL.js} +2 -2
  28. package/dist/_chunks/get-error-message-DbFUzuja.js +7 -0
  29. package/dist/_chunks/handled-rejection-C-6Dq0As.js +9 -0
  30. package/dist/_chunks/{heatmap-C5gJin_F.js → heatmap-_546qI2V.js} +2 -2
  31. package/dist/_chunks/{invoice-upload-list-B5aMffTy.js → invoice-upload-list-CQI9MUl6.js} +3 -3
  32. package/dist/_chunks/{kit-extensions-DUaIYyMD.js → kit-extensions-BNBf4m8O.js} +3 -3
  33. package/dist/_chunks/{link-cell-renderer-D3JLPURZ.js → link-cell-renderer-Xx5T8u5Q.js} +3 -3
  34. package/dist/_chunks/megaphone-CzeTT9B3.js +22 -0
  35. package/dist/_chunks/{muscle-scheme-BGJD62op.js → muscle-scheme-D_rSyGDj.js} +2 -2
  36. package/dist/_chunks/{notes-panel-BAyPOr8N.js → notes-panel-BvjAo4RQ.js} +5 -4
  37. package/dist/_chunks/{optical-prescription-Da_r8pMr.js → optical-prescription-DaSbsh4p.js} +2 -2
  38. package/dist/_chunks/{patient-account-settings-BkAtIxJW.js → patient-account-settings-Bmfeclpd.js} +3 -3
  39. package/dist/_chunks/{patient-card-DTh3QTyS.js → patient-card-Cpr8iD19.js} +4 -4
  40. package/dist/_chunks/{patient-check-in-resume-xhqjC6gf.js → patient-check-in-resume-CYZ-SvsF.js} +41 -41
  41. package/dist/_chunks/{patient-details-DBtEITfE.js → patient-details-9eh9cNy7.js} +2 -2
  42. package/dist/_chunks/{patient-field-row-a5d4QijH.js → patient-field-row-B782eT0C.js} +2 -2
  43. package/dist/_chunks/{patient-sign-in-pin-CDBqV254.js → patient-sign-in-pin-DmMBwWet.js} +2 -2
  44. package/dist/_chunks/{patient-sign-in-steps-C2JSqlok.js → patient-sign-in-steps-BKcxNkdY.js} +37 -59
  45. package/dist/_chunks/{patient-summary-card-Bl2NknPe.js → patient-summary-card-K9zaMl1O.js} +2 -2
  46. package/dist/_chunks/phone-off-DQSTLz4l.js +28 -0
  47. package/dist/_chunks/{portal-details-CTEsm705.js → portal-details-DCIiGkHA.js} +2 -2
  48. package/dist/_chunks/{portal-documents-D8skew0h.js → portal-documents-DVKj6Sco.js} +4 -4
  49. package/dist/_chunks/{portal-parts-BdR29P7z.js → portal-parts-Br8wuala.js} +2 -2
  50. package/dist/_chunks/{pregnancy-dating-BNI32qNw.js → pregnancy-dating-lJbzai73.js} +2 -2
  51. package/dist/_chunks/{registration-form-DS3RuKHu.js → registration-form-CuLiTA52.js} +2 -2
  52. package/dist/_chunks/{reserved.agent-DOzOBUW7.js → reserved.agent-CabZHFJC.js} +2 -2
  53. package/dist/_chunks/{select-uESzXTX6.js → select-CIXKyUMw.js} +172 -149
  54. package/dist/_chunks/{session-countdown-DOx1IBUB.js → session-countdown-StcyUU5O.js} +56 -66
  55. package/dist/_chunks/{signature-request-CHsM_iWi.js → signature-request-vJDSHZld.js} +2 -2
  56. package/dist/_chunks/signing-end-screen-BdhbkPKO.js +1355 -0
  57. package/dist/_chunks/{tabs-CRIDBLP7.js → tabs-Czkmw5ou.js} +2 -2
  58. package/dist/_chunks/{task-editor-g1AGfxhr.js → task-editor-BfXSn6U1.js} +4 -3
  59. package/dist/_chunks/{tasks-panel-BE3zaayj.js → tasks-panel-DbtJS4QI.js} +156 -172
  60. package/dist/_chunks/{toolbar-CfdoJzMV.js → toolbar-DjG-cpD_.js} +2 -2
  61. package/dist/_chunks/{unit-converter-YKlHyUC2.js → unit-converter-CUAUTu2B.js} +2 -2
  62. package/dist/_chunks/{use-appointment-details-read-Dzc6fEzG.js → use-appointment-details-read-7J0j1FP7.js} +111 -110
  63. package/dist/_chunks/{voice-control-panel-Be_c0CQ0.js → voice-control-panel-Cp4vs1iy.js} +2 -2
  64. package/dist/_chunks/{workflow-status-D1WgGVTP.js → workflow-status-CO0mxXs2.js} +3 -2
  65. package/dist/agent-catalog.json +528 -2
  66. package/dist/agent-i18n/en.json +51 -1
  67. package/dist/browser-support.js +1 -1
  68. package/dist/components/_shared/sms-segments.d.ts +43 -0
  69. package/dist/components/ai-prompt-input/index.js +1 -1
  70. package/dist/components/ai-summary-panel/ai-summary-panel.agent.d.ts +4 -0
  71. package/dist/components/ai-summary-panel/ai-summary-panel.d.ts +134 -0
  72. package/dist/components/ai-summary-panel/index.d.ts +4 -0
  73. package/dist/components/ai-summary-panel/index.js +6 -0
  74. package/dist/components/ai-summary-panel/summary-markdown.d.ts +15 -0
  75. package/dist/components/appointment-card/index.js +2 -2
  76. package/dist/components/appointment-details-panel/index.js +1 -1
  77. package/dist/components/appointment-peek/index.js +1 -1
  78. package/dist/components/appointment-timeline/index.js +1 -1
  79. package/dist/components/audio-recorder/index.js +1 -1
  80. package/dist/components/bill-line-table/index.js +1 -1
  81. package/dist/components/bill-table/index.js +1 -1
  82. package/dist/components/bishop-score/index.js +1 -1
  83. package/dist/components/booking/index.js +1 -1
  84. package/dist/components/call-status-chip/call-status-chip.d.ts +30 -0
  85. package/dist/components/call-status-chip/index.d.ts +3 -0
  86. package/dist/components/call-status-chip/index.js +5 -0
  87. package/dist/components/calls-panel/calls-panel.agent.d.ts +4 -0
  88. package/dist/components/calls-panel/calls-panel.d.ts +153 -0
  89. package/dist/components/calls-panel/index.d.ts +4 -0
  90. package/dist/components/calls-panel/index.js +6 -0
  91. package/dist/components/chat-container/chat-container.d.ts +7 -0
  92. package/dist/components/chat-container/index.js +1 -1
  93. package/dist/components/chat-input/chat-input.d.ts +20 -0
  94. package/dist/components/chat-input/index.js +1 -1
  95. package/dist/components/chat-message/index.js +1 -1
  96. package/dist/components/communications-panel/communications-panel.agent.d.ts +4 -0
  97. package/dist/components/communications-panel/communications-panel.d.ts +148 -0
  98. package/dist/components/communications-panel/index.d.ts +6 -0
  99. package/dist/components/communications-panel/index.js +7 -0
  100. package/dist/components/data-grid/index.js +2 -2
  101. package/dist/components/data-table/index.js +2 -2
  102. package/dist/components/document-preview/index.js +1 -1
  103. package/dist/components/entity-summary/entity-summary.d.ts +37 -1
  104. package/dist/components/entity-summary/index.js +1 -1
  105. package/dist/components/file-manager/index.js +1 -1
  106. package/dist/components/gestational-age-calculator/index.js +1 -1
  107. package/dist/components/heatmap/index.js +1 -1
  108. package/dist/components/index.d.ts +4 -0
  109. package/dist/components/invoice-upload-list/index.js +1 -1
  110. package/dist/components/muscle-scheme/index.js +1 -1
  111. package/dist/components/notes-panel/index.js +1 -1
  112. package/dist/components/optical-prescription/index.js +1 -1
  113. package/dist/components/patient-details/index.js +1 -1
  114. package/dist/components/patient-summary-card/index.js +1 -1
  115. package/dist/components/patient-table/index.js +1 -1
  116. package/dist/components/pregnancy-dating/index.js +1 -1
  117. package/dist/components/rich-text-editor/index.js +1 -1
  118. package/dist/components/select/index.js +1 -1
  119. package/dist/components/select/select.d.ts +8 -0
  120. package/dist/components/session-countdown/index.js +1 -1
  121. package/dist/components/skeleton-scheme/index.js +1 -1
  122. package/dist/components/tabs/index.js +1 -1
  123. package/dist/components/task-editor/index.js +1 -1
  124. package/dist/components/tasks-panel/index.js +1 -1
  125. package/dist/components/unit-converter/index.js +1 -1
  126. package/dist/components/voice-control-panel/index.js +1 -1
  127. package/dist/components/workflow-status/index.js +1 -1
  128. package/dist/core.css +1 -1
  129. package/dist/host-compat.css +13 -4
  130. package/dist/i18n/locales/ar.d.ts +162 -0
  131. package/dist/i18n/locales/ar.js +163 -0
  132. package/dist/i18n/locales/de.d.ts +162 -0
  133. package/dist/i18n/locales/de.js +163 -0
  134. package/dist/i18n/locales/el.d.ts +162 -0
  135. package/dist/i18n/locales/el.js +163 -0
  136. package/dist/i18n/locales/en.d.ts +162 -0
  137. package/dist/i18n/locales/en.js +163 -0
  138. package/dist/i18n/locales/es.d.ts +162 -0
  139. package/dist/i18n/locales/es.js +163 -0
  140. package/dist/i18n/locales/fr.d.ts +162 -0
  141. package/dist/i18n/locales/fr.js +163 -0
  142. package/dist/i18n/locales/hi.d.ts +162 -0
  143. package/dist/i18n/locales/hi.js +163 -0
  144. package/dist/i18n/locales/it.d.ts +162 -0
  145. package/dist/i18n/locales/it.js +163 -0
  146. package/dist/i18n/locales/ja.d.ts +162 -0
  147. package/dist/i18n/locales/ja.js +163 -0
  148. package/dist/i18n/locales/nl.d.ts +162 -0
  149. package/dist/i18n/locales/nl.js +163 -0
  150. package/dist/i18n/locales/pl.d.ts +162 -0
  151. package/dist/i18n/locales/pl.js +163 -0
  152. package/dist/i18n/locales/pt.d.ts +162 -0
  153. package/dist/i18n/locales/pt.js +163 -0
  154. package/dist/i18n/locales/ro.d.ts +162 -0
  155. package/dist/i18n/locales/ro.js +163 -0
  156. package/dist/i18n/locales/ru.d.ts +162 -0
  157. package/dist/i18n/locales/ru.js +163 -0
  158. package/dist/i18n/locales/sq.d.ts +162 -0
  159. package/dist/i18n/locales/sq.js +163 -0
  160. package/dist/i18n/locales/sv.d.ts +162 -0
  161. package/dist/i18n/locales/sv.js +163 -0
  162. package/dist/i18n/locales/tr.d.ts +162 -0
  163. package/dist/i18n/locales/tr.js +163 -0
  164. package/dist/i18n/locales/zh.d.ts +162 -0
  165. package/dist/i18n/locales/zh.js +163 -0
  166. package/dist/index.js +905 -893
  167. package/dist/locales/ar.json +162 -0
  168. package/dist/locales/de.json +162 -0
  169. package/dist/locales/el.json +162 -0
  170. package/dist/locales/en.json +162 -0
  171. package/dist/locales/es.json +162 -0
  172. package/dist/locales/fr.json +162 -0
  173. package/dist/locales/hi.json +162 -0
  174. package/dist/locales/it.json +162 -0
  175. package/dist/locales/ja.json +162 -0
  176. package/dist/locales/nl.json +162 -0
  177. package/dist/locales/pl.json +162 -0
  178. package/dist/locales/pt.json +162 -0
  179. package/dist/locales/ro.json +162 -0
  180. package/dist/locales/ru.json +162 -0
  181. package/dist/locales/sq.json +162 -0
  182. package/dist/locales/sv.json +162 -0
  183. package/dist/locales/tr.json +162 -0
  184. package/dist/locales/zh.json +162 -0
  185. package/dist/patterns/alia-assistant/index.js +1 -1
  186. package/dist/patterns/anamnesis/index.js +1 -1
  187. package/dist/patterns/calendar/calendar.journey.d.ts +7 -0
  188. package/dist/patterns/calendar/index.js +1 -1
  189. package/dist/patterns/patient-account-settings/index.js +1 -1
  190. package/dist/patterns/patient-check-in/index.js +1 -1
  191. package/dist/patterns/patient-portal/index.js +2 -2
  192. package/dist/patterns/patient-sign-in/index.js +2 -2
  193. package/dist/patterns/registration-form/index.js +1 -1
  194. package/dist/patterns/signature-request/index.js +1 -1
  195. package/dist/patterns/signing/index.d.ts +1 -0
  196. package/dist/patterns/signing/index.js +1 -1
  197. package/dist/patterns/signing/multi-field-signer.d.ts +22 -1
  198. package/dist/patterns/signing/signing-checkbox-pill.d.ts +66 -0
  199. package/dist/patterns/signing/signing-checkbox-sheet.d.ts +16 -0
  200. package/dist/patterns/signing/signing-document-screen.d.ts +18 -1
  201. package/dist/tokens.css +1 -1
  202. package/package.json +17 -1
  203. package/dist/_chunks/entity-summary-KHM0PnSI.js +0 -265
  204. package/dist/_chunks/handled-rejection-6gqCf5vt.js +0 -13
  205. package/dist/_chunks/signing-end-screen-an9P8DOT.js +0 -1041
@@ -1,14 +1,14 @@
1
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";
2
+ import { forwardRef as M, useRef as i, useState as H, useCallback as L, useImperativeHandle as S, useMemo as j, useEffect as E } from "react";
3
3
  import { c as C } from "./index-D2ZczOXr.js";
4
- import { useTranslation as E } from "react-i18next";
5
- import { u as K } from "./registry-DvAUVLHh.js";
6
- import { u as O } from "./index-Bze5jCG_.js";
7
- import { F } from "./floating-action-button-BesoUmO_.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 = {
4
+ import { useTranslation as K } from "react-i18next";
5
+ import { u as O } from "./registry-DvAUVLHh.js";
6
+ import { u as F } from "./index-Bze5jCG_.js";
7
+ import { F as P } from "./floating-action-button-BesoUmO_.js";
8
+ import { u as $ } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
+ import { u as D } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
10
+ import { C as U } from "./chevron-down-DWE7GSq9.js";
11
+ const X = {
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).
@@ -61,7 +61,7 @@ const U = {
61
61
  description: "Sourced from the id prop."
62
62
  }
63
63
  }
64
- }, X = C(
64
+ }, Y = C(
65
65
  "ds:relative ds:flex ds:w-full ds:flex-col ds:overflow-hidden ds:bg-background",
66
66
  {
67
67
  variants: {
@@ -72,7 +72,7 @@ const U = {
72
72
  },
73
73
  defaultVariants: { density: "default" }
74
74
  }
75
- ), Y = C(
75
+ ), Z = C(
76
76
  [
77
77
  "ds:flex-1 ds:min-h-0 ds:overflow-y-auto ds:overflow-x-hidden",
78
78
  "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
@@ -91,7 +91,7 @@ const U = {
91
91
  "ds:motion-reduce:[mask-image:none]",
92
92
  "ds:forced-colors:[mask-image:none]"
93
93
  ].join(" ")
94
- ), Z = 100, q = 48, G = V(
94
+ ), q = 100, G = 48, J = M(
95
95
  ({
96
96
  messages: t,
97
97
  composer: d,
@@ -100,9 +100,10 @@ const U = {
100
100
  id: p,
101
101
  onAutoScrollChange: c,
102
102
  showScrollToLatest: N = !1,
103
- ...B
104
- }, I) => {
105
- const { t: f } = E("ui"), n = i(null), h = i(null), [a, R] = M(!0), v = P(), r = H(
103
+ logLabel: B,
104
+ ...I
105
+ }, R) => {
106
+ const { t: f } = K("ui"), n = i(null), h = i(null), [a, _] = H(!0), v = $(), r = L(
106
107
  (e) => {
107
108
  const s = n.current;
108
109
  if (!s) return;
@@ -114,12 +115,12 @@ const U = {
114
115
  },
115
116
  [v]
116
117
  ), g = i(null);
117
- L(I, () => g.current, []);
118
+ S(R, () => g.current, []);
118
119
  const b = i(a);
119
120
  b.current = a;
120
121
  const x = i(t.length);
121
122
  x.current = t.length;
122
- const _ = S(
123
+ const A = j(
123
124
  () => ({
124
125
  scrollToBottom: r,
125
126
  getScrollViewport: () => n.current,
@@ -128,28 +129,28 @@ const U = {
128
129
  }),
129
130
  [r]
130
131
  );
131
- K(U, _, p), j(() => {
132
+ O(X, A, p), E(() => {
132
133
  const e = n.current, s = h.current;
133
134
  if (!e || !s) return;
134
135
  const l = new IntersectionObserver(
135
- (z) => {
136
- const w = z[0];
137
- R(w.isIntersecting), c == null || c(w.isIntersecting);
136
+ (V) => {
137
+ const w = V[0];
138
+ _(w.isIntersecting), c == null || c(w.isIntersecting);
138
139
  },
139
140
  {
140
141
  root: e,
141
142
  // Fire when the sentinel is within BOTTOM_SLACK_PX of being visible.
142
- rootMargin: `0px 0px ${q}px 0px`,
143
+ rootMargin: `0px 0px ${G}px 0px`,
143
144
  threshold: 0
144
145
  }
145
146
  );
146
147
  return l.observe(s), () => l.disconnect();
147
148
  }, [c]);
148
- const A = t.length;
149
- $(() => {
149
+ const z = t.length;
150
+ D(() => {
150
151
  a && r({ smooth: !1 });
151
- }, [A, a, r]);
152
- const y = t.length > Z, m = O({
152
+ }, [z, a, r]);
153
+ const y = t.length > q, m = F({
153
154
  count: y ? t.length : 0,
154
155
  getScrollElement: () => n.current,
155
156
  estimateSize: () => 80,
@@ -163,10 +164,10 @@ const U = {
163
164
  "div",
164
165
  {
165
166
  ref: g,
166
- className: X({ density: T, className: k }),
167
+ className: Y({ density: T, className: k }),
167
168
  "data-component": "chat-container",
168
169
  "data-component-id": p,
169
- ...B,
170
+ ...I,
170
171
  children: [
171
172
  /* @__PURE__ */ u("div", { className: "ds:relative ds:flex-1 ds:min-h-0 ds:flex ds:flex-col", children: [
172
173
  /* @__PURE__ */ u(
@@ -176,9 +177,9 @@ const U = {
176
177
  role: "log",
177
178
  "aria-live": "polite",
178
179
  "aria-relevant": "additions",
179
- "aria-label": f("chat.container"),
180
+ "aria-label": B ?? f("chat.container"),
180
181
  tabIndex: 0,
181
- className: Y(),
182
+ className: Z(),
182
183
  children: [
183
184
  y ? /* @__PURE__ */ o(
184
185
  "ol",
@@ -232,9 +233,9 @@ const U = {
232
233
  "ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]"
233
234
  ].join(" "),
234
235
  children: /* @__PURE__ */ o("div", { className: "ds:pointer-events-auto", children: /* @__PURE__ */ o(
235
- F,
236
+ P,
236
237
  {
237
- icon: /* @__PURE__ */ o(D, {}),
238
+ icon: /* @__PURE__ */ o(U, {}),
238
239
  "aria-label": f("chat.scrollToLatest"),
239
240
  size: "sm",
240
241
  variant: "secondary",
@@ -251,9 +252,9 @@ const U = {
251
252
  );
252
253
  }
253
254
  );
254
- G.displayName = "ChatContainer";
255
+ J.displayName = "ChatContainer";
255
256
  export {
256
- G as C,
257
- U as c
257
+ J as C,
258
+ X as c
258
259
  };
259
- //# sourceMappingURL=chat-container-B83b4hut.js.map
260
+ //# sourceMappingURL=chat-container-CoOT7dzB.js.map
@@ -1,21 +1,21 @@
1
- import { jsxs as v, jsx as o, Fragment as ge } from "react/jsx-runtime";
2
- import { forwardRef as ve, useId as ye, useRef as w, useCallback as W, useImperativeHandle as be, useMemo as xe } from "react";
3
- import { c as Ie } from "./index-D2ZczOXr.js";
4
- import { useTranslation as ke } from "react-i18next";
5
- import { I as q } from "./icon-button-S8_weU3g.js";
6
- import { u as we } from "./use-controllable-state-BiY4xTzM.js";
7
- import { u as Ce } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
8
- import { u as Ne } from "./registry-DvAUVLHh.js";
9
- import { c as Ve } from "./createLucideIcon-DhHxpK9K.js";
10
- import { C as je } from "./circle-alert-rGDZ73Wh.js";
11
- import { S as ze } from "./send-C5kDJ-Mz.js";
1
+ import { jsxs as v, jsx as o, Fragment as we } from "react/jsx-runtime";
2
+ import { forwardRef as ke, useId as Ce, useRef as C, useCallback as G, useImperativeHandle as Ne, useMemo as Ve } from "react";
3
+ import { c as je } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as ze } from "react-i18next";
5
+ import { I as U } from "./icon-button-S8_weU3g.js";
6
+ import { u as He } from "./use-controllable-state-BiY4xTzM.js";
7
+ import { u as Te } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
8
+ import { u as Ee } from "./registry-DvAUVLHh.js";
9
+ import { c as Me } from "./createLucideIcon-DhHxpK9K.js";
10
+ import { C as Fe } from "./circle-alert-rGDZ73Wh.js";
11
+ import { S as Ke } from "./send-C5kDJ-Mz.js";
12
12
  /**
13
13
  * @license lucide-react v1.22.0 - ISC
14
14
  *
15
15
  * This source code is licensed under the ISC license.
16
16
  * See the LICENSE file in the root directory of this source tree.
17
17
  */
18
- const He = [
18
+ const Re = [
19
19
  [
20
20
  "path",
21
21
  {
@@ -23,7 +23,7 @@ const He = [
23
23
  key: "1miecu"
24
24
  }
25
25
  ]
26
- ], Se = Ve("paperclip", He), Te = {
26
+ ], Se = Me("paperclip", Re), Be = {
27
27
  id: "chat-input",
28
28
  capabilities: ["edit_inline", "submit"],
29
29
  state: {
@@ -77,7 +77,7 @@ const He = [
77
77
  // the message to a backend / model — an external side effect.
78
78
  openWorld: !0,
79
79
  descriptionKey: "ui.agent.chatInput.actions.submit",
80
- description: "Submit the current composer state via onSubmit.",
80
+ description: "Submit the current composer state via onSubmit. An empty composer is submitted only when allowEmptySubmit is set; otherwise nothing is sent.",
81
81
  invoke: (t) => {
82
82
  t.submit();
83
83
  }
@@ -103,15 +103,15 @@ const He = [
103
103
  description: "Sourced from the id prop."
104
104
  }
105
105
  }
106
- }, Ee = Ie(
106
+ }, Pe = je(
107
107
  [
108
108
  "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full",
109
- // Uses the kit's shared input-chrome tokens — `--input` for fill,
110
- // `--shadow-input` for the halo. The 1px edge is `--control-border`
109
+ // A raised composer: the card surface and `--shadow-card`, the same
110
+ // elevation as the ChatMessage bubbles above it. The 1px edge is `--control-border`
111
111
  // (3:1 in every theme), so the field reads by its edge alone and the
112
112
  // focus-within override and forced-colors fallback still paint over it.
113
113
  "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--control-border)]",
114
- "ds:bg-input ds:shadow-[var(--shadow-input)]",
114
+ "ds:bg-[var(--card)] ds:shadow-[var(--shadow-card)]",
115
115
  "ds:focus-within:border-[color:var(--primary)]",
116
116
  // The focus ring goes round the whole box, as PhoneInput's does: on the
117
117
  // textarea it drew a second outline across the box's own edge. The 1px
@@ -134,7 +134,7 @@ const He = [
134
134
  defaultVariants: { size: "md" }
135
135
  }
136
136
  );
137
- function Me(t, a) {
137
+ function _e(t, a) {
138
138
  if (typeof Intl < "u" && typeof Intl.Segmenter == "function")
139
139
  try {
140
140
  const l = new Intl.Segmenter(a, { granularity: "grapheme" });
@@ -145,7 +145,7 @@ function Me(t, a) {
145
145
  }
146
146
  return Array.from(t).length;
147
147
  }
148
- function Fe(t, a, l) {
148
+ function $e(t, a, l) {
149
149
  if (typeof Intl < "u" && typeof Intl.Segmenter == "function")
150
150
  try {
151
151
  const y = new Intl.Segmenter(l, { granularity: "grapheme" }), i = [];
@@ -158,7 +158,7 @@ function Fe(t, a, l) {
158
158
  const r = Array.from(t);
159
159
  return r.length <= a ? t : r.slice(0, a).join("");
160
160
  }
161
- const Ke = ve(
161
+ const We = ke(
162
162
  ({
163
163
  size: t = "md",
164
164
  value: a,
@@ -169,116 +169,122 @@ const Ke = ve(
169
169
  maxRows: d = 8,
170
170
  onSubmit: u,
171
171
  onAttach: b,
172
- accept: A,
172
+ accept: Y,
173
173
  disabled: x,
174
- toolbar: G,
175
- label: T,
176
- placeholder: U,
177
- className: Y,
178
- onChange: C,
179
- onKeyDown: N,
180
- onCompositionStart: V,
181
- onCompositionEnd: j,
182
- id: z,
183
- ...J
184
- }, L) => {
185
- const { t: c, i18n: E } = ke("ui"), O = ye(), p = w(!1), M = w(null), I = w(null), Q = W((e) => {
186
- I.current = e;
187
- }, []), [X, m] = we({
174
+ submitDisabled: M = !1,
175
+ toolbar: J,
176
+ label: F,
177
+ hideLabel: L = !1,
178
+ sendLabel: O,
179
+ sendIcon: Q,
180
+ allowEmptySubmit: K = !1,
181
+ submitShortcut: I = !0,
182
+ placeholder: X,
183
+ className: Z,
184
+ onChange: N,
185
+ onKeyDown: V,
186
+ onCompositionStart: j,
187
+ onCompositionEnd: z,
188
+ id: H,
189
+ ...D
190
+ }, ee) => {
191
+ const { t: c, i18n: R } = ze("ui"), te = Ce(), p = C(!1), S = C(null), w = C(null), se = G((e) => {
192
+ w.current = e;
193
+ }, []), [re, f] = He({
188
194
  value: a === void 0 ? void 0 : String(a),
189
195
  defaultValue: String(l ?? "")
190
- }), n = X ?? "", H = Me(n, E.language), f = typeof r == "number" && r > 0, Z = f ? Math.max(0, r - H) : 0, D = f && H > r * 0.9, h = f && H >= r, F = W(() => {
191
- const e = I.current;
196
+ }), n = re ?? "", T = _e(n, R.language), m = typeof r == "number" && r > 0, ae = m ? Math.max(0, r - T) : 0, ne = m && T > r * 0.9, h = m && T >= r, B = G(() => {
197
+ const e = w.current;
192
198
  if (!e) return;
193
- const s = window.getComputedStyle(e), k = parseFloat(s.lineHeight) || 24, de = parseFloat(s.paddingTop) || 0, ue = parseFloat(s.paddingBottom) || 0, pe = parseFloat(s.borderTopWidth) || 0, me = parseFloat(s.borderBottomWidth) || 0, _ = de + ue + pe + me, fe = k * i + _, $ = k * d + _;
199
+ const s = window.getComputedStyle(e), k = parseFloat(s.lineHeight) || 24, ge = parseFloat(s.paddingTop) || 0, ve = parseFloat(s.paddingBottom) || 0, ye = parseFloat(s.borderTopWidth) || 0, be = parseFloat(s.borderBottomWidth) || 0, A = ge + ve + ye + be, xe = k * i + A, q = k * d + A;
194
200
  e.style.height = "auto";
195
- const he = Math.max(fe, Math.min(e.scrollHeight, $));
196
- e.style.height = `${he}px`, e.style.overflowY = e.scrollHeight > $ ? "auto" : "hidden";
201
+ const Ie = Math.max(xe, Math.min(e.scrollHeight, q));
202
+ e.style.height = `${Ie}px`, e.style.overflowY = e.scrollHeight > q ? "auto" : "hidden";
197
203
  }, [i, d]);
198
- Ce(() => {
199
- F();
200
- }, [F, n]);
201
- const ee = (e) => {
204
+ Te(() => {
205
+ B();
206
+ }, [B, n]);
207
+ const oe = (e) => {
202
208
  let s = e.target.value;
203
- f && !p.current && (s = Fe(s, r, E.language)), m(s), !p.current && (C == null || C(e));
204
- }, te = (e) => {
205
- p.current = !0, V == null || V(e);
206
- }, se = (e) => {
207
- p.current = !1, j == null || j(e);
208
- }, re = (e) => e.nativeEvent.isComposing || e.keyCode === 229 || p.current, S = () => {
209
+ m && !p.current && (s = $e(s, r, R.language)), f(s), !p.current && (N == null || N(e));
210
+ }, ie = (e) => {
211
+ p.current = !0, j == null || j(e);
212
+ }, ce = (e) => {
213
+ p.current = !1, z == null || z(e);
214
+ }, le = (e) => e.nativeEvent.isComposing || e.keyCode === 229 || p.current, E = () => {
209
215
  var s;
210
- !n.trim() || x || h || (u == null || u(n), m(""), (s = I.current) == null || s.focus());
211
- }, K = w(null);
212
- be(L, () => K.current, []);
213
- const ae = xe(
216
+ !n.trim() && !K || x || M || h || (u == null || u(n), f(""), (s = w.current) == null || s.focus());
217
+ }, P = C(null);
218
+ Ne(ee, () => P.current, []);
219
+ const de = Ve(
214
220
  () => ({
215
221
  getValue: () => n,
216
222
  isEmpty: () => !n.trim(),
217
223
  setValue: (e) => {
218
- m(e);
224
+ f(e);
219
225
  },
220
226
  clear: () => {
221
- m("");
227
+ f("");
222
228
  },
223
229
  submit: () => {
224
- S();
230
+ E();
225
231
  },
226
232
  focus: () => {
227
233
  var e;
228
- (e = I.current) == null || e.focus();
234
+ (e = w.current) == null || e.focus();
229
235
  }
230
236
  }),
231
237
  // `submit` is a local closure that always sees the latest currentValue
232
238
  // via React's render cycle — depend on currentValue so the handle
233
239
  // picks up new values across renders.
234
240
  // eslint-disable-next-line react-hooks/exhaustive-deps
235
- [n, m]
241
+ [n, f]
236
242
  );
237
- Ne(Te, ae, z);
238
- const ne = (e) => {
239
- if (N == null || N(e), !e.defaultPrevented && !re(e) && e.key === "Enter") {
240
- const s = e.metaKey || e.ctrlKey, k = y && !e.shiftKey;
241
- (s || k) && (e.preventDefault(), S());
243
+ Ee(Be, de, H);
244
+ const ue = (e) => {
245
+ if (V == null || V(e), !e.defaultPrevented && !le(e) && e.key === "Enter") {
246
+ const s = I && (e.metaKey || e.ctrlKey), k = y && !e.shiftKey;
247
+ (s || k) && (e.preventDefault(), E());
242
248
  }
243
- }, oe = () => {
249
+ }, pe = () => {
244
250
  var e;
245
- (e = M.current) == null || e.click();
246
- }, ie = (e) => {
251
+ (e = S.current) == null || e.click();
252
+ }, fe = (e) => {
247
253
  e.target.files && e.target.files.length > 0 && (b == null || b(e.target.files)), e.target.value = "";
248
- }, g = z ?? O, R = `${g}-label`, B = f ? `${g}-counter` : void 0, P = `${g}-hint`, ce = U ?? c("chat.input.placeholder"), le = T ?? c("chat.prompt");
254
+ }, g = H ?? te, _ = `${g}-label`, $ = m ? `${g}-counter` : void 0, W = `${g}-hint`, me = X ?? c("chat.input.placeholder"), he = F ?? c("chat.prompt");
249
255
  return /* @__PURE__ */ v(
250
256
  "div",
251
257
  {
252
- ref: K,
258
+ ref: P,
253
259
  "data-component": "chat-input",
254
- "data-component-id": z,
255
- className: Ee({ size: t, className: Y }),
260
+ "data-component-id": H,
261
+ className: Pe({ size: t, className: Z }),
256
262
  children: [
257
263
  /* @__PURE__ */ o(
258
264
  "label",
259
265
  {
260
- id: R,
266
+ id: _,
261
267
  htmlFor: g,
262
- className: T ? "type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]" : "ds:sr-only",
263
- children: le
268
+ className: F && !L ? "type-label ds:ps-[var(--spacing-sm)] ds:pt-[var(--spacing-sm)]" : "ds:sr-only",
269
+ children: he
264
270
  }
265
271
  ),
266
272
  /* @__PURE__ */ o(
267
273
  "textarea",
268
274
  {
269
- ref: Q,
275
+ ref: se,
270
276
  id: g,
271
277
  value: n,
272
278
  disabled: x,
273
279
  rows: i,
274
- placeholder: ce,
275
- "aria-labelledby": R,
276
- "aria-describedby": [B, P].filter(Boolean).join(" ") || void 0,
280
+ placeholder: me,
281
+ "aria-labelledby": _,
282
+ "aria-describedby": [$, I ? W : void 0].filter(Boolean).join(" ") || void 0,
277
283
  "aria-invalid": h || void 0,
278
- onChange: ee,
279
- onKeyDown: ne,
280
- onCompositionStart: te,
281
- onCompositionEnd: se,
284
+ onChange: oe,
285
+ onKeyDown: ue,
286
+ onCompositionStart: ie,
287
+ onCompositionEnd: ce,
282
288
  className: [
283
289
  "ds:w-full ds:resize-none ds:bg-transparent",
284
290
  "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]",
@@ -288,42 +294,42 @@ const Ke = ve(
288
294
  // The box draws the focus ring (see rootVariants).
289
295
  "ds:outline-none"
290
296
  ].join(" "),
291
- ...J
297
+ ...D
292
298
  }
293
299
  ),
294
300
  /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: [
295
- b ? /* @__PURE__ */ v(ge, { children: [
301
+ b ? /* @__PURE__ */ v(we, { children: [
296
302
  /* @__PURE__ */ o(
297
303
  "input",
298
304
  {
299
- ref: M,
305
+ ref: S,
300
306
  type: "file",
301
307
  className: "ds:sr-only",
302
308
  multiple: !0,
303
- accept: A,
304
- onChange: ie,
309
+ accept: Y,
310
+ onChange: fe,
305
311
  "aria-label": c("chat.input.attach"),
306
312
  tabIndex: -1
307
313
  }
308
314
  ),
309
315
  /* @__PURE__ */ o(
310
- q,
316
+ U,
311
317
  {
312
318
  icon: /* @__PURE__ */ o(Se, {}),
313
319
  "aria-label": c("chat.input.attach"),
314
320
  intent: "ghost",
315
321
  size: "sm",
316
- onClick: oe,
322
+ onClick: pe,
317
323
  disabled: x
318
324
  }
319
325
  )
320
326
  ] }) : null,
321
- G,
327
+ J,
322
328
  /* @__PURE__ */ v("div", { className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
323
- D ? /* @__PURE__ */ v(
329
+ ne ? /* @__PURE__ */ v(
324
330
  "span",
325
331
  {
326
- id: B,
332
+ id: $,
327
333
  "aria-live": "polite",
328
334
  className: [
329
335
  "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
@@ -334,23 +340,23 @@ const Ke = ve(
334
340
  h ? (
335
341
  // Icon pairs with --destructive colour so the at-limit
336
342
  // state is not conveyed by hue alone (WCAG 1.4.1).
337
- /* @__PURE__ */ o(je, { "aria-hidden": "true", className: "ds:size-3.5" })
343
+ /* @__PURE__ */ o(Fe, { "aria-hidden": "true", className: "ds:size-3.5" })
338
344
  ) : null,
339
- c("chat.input.remaining", { count: Z })
345
+ c("chat.input.remaining", { count: ae })
340
346
  ]
341
347
  }
342
348
  ) : null,
343
- /* @__PURE__ */ o("span", { id: P, className: "ds:sr-only", children: c("chat.input.sendHint") }),
349
+ I ? /* @__PURE__ */ o("span", { id: W, className: "ds:sr-only", children: c("chat.input.sendHint") }) : null,
344
350
  /* @__PURE__ */ o(
345
- q,
351
+ U,
346
352
  {
347
- icon: /* @__PURE__ */ o(ze, {}),
348
- "aria-label": c("chat.send"),
353
+ icon: Q ?? /* @__PURE__ */ o(Ke, {}),
354
+ "aria-label": O ?? c("chat.send"),
349
355
  intent: "primary",
350
356
  size: "sm",
351
- disabled: x || !n.trim() || h,
352
- onClick: S,
353
- "aria-keyshortcuts": "Meta+Enter Control+Enter"
357
+ disabled: x || M || !n.trim() && !K || h,
358
+ onClick: E,
359
+ "aria-keyshortcuts": I ? "Meta+Enter Control+Enter" : void 0
354
360
  }
355
361
  )
356
362
  ] })
@@ -360,10 +366,10 @@ const Ke = ve(
360
366
  );
361
367
  }
362
368
  );
363
- Ke.displayName = "ChatInput";
369
+ We.displayName = "ChatInput";
364
370
  export {
365
- Ke as C,
371
+ We as C,
366
372
  Se as P,
367
- Te as c
373
+ Be as c
368
374
  };
369
- //# sourceMappingURL=chat-input-DwQ4_WXK.js.map
375
+ //# sourceMappingURL=chat-input-BmvnuZqj.js.map