@alfadocs/ui-kit-debug 0.17.1 → 0.17.3

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 (202) hide show
  1. package/dist/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
  2. package/dist/_chunks/{accordion-DOmxGEWU.js.map → accordion-CNcodXuO.js.map} +1 -1
  3. package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
  4. package/dist/_chunks/ai-prompt-input-B-w5Rx3V.js.map +1 -0
  5. package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
  6. package/dist/_chunks/alert-DBnawbmf.js.map +1 -0
  7. package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
  8. package/dist/_chunks/{audio-recorder-CRh4uyFL.js.map → audio-recorder-DNkQLW1G.js.map} +1 -1
  9. package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
  10. package/dist/_chunks/autocomplete-BxfabhZ8.js.map +1 -0
  11. package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
  12. package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js.map → balance-cell-renderer-DJB6WDPe.js.map} +1 -1
  13. package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
  14. package/dist/_chunks/chat-input-B3XmFGDw.js.map +1 -0
  15. package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
  16. package/dist/_chunks/checkbox-group-Bwmt1ovQ.js.map +1 -0
  17. package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
  18. package/dist/_chunks/checkbox-mwbrPZDY.js.map +1 -0
  19. package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
  20. package/dist/_chunks/collapsible-hHiyZp0b.js.map +1 -0
  21. package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
  22. package/dist/_chunks/{color-picker-BPfcByHH.js.map → color-picker-Bm-gzpsh.js.map} +1 -1
  23. package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
  24. package/dist/_chunks/combobox-Da9eq00i.js.map +1 -0
  25. package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
  26. package/dist/_chunks/copy-field-BAF4mt9h.js.map +1 -0
  27. package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
  28. package/dist/_chunks/{date-picker-BlhtBhPo.js.map → date-picker-BIoSLRly.js.map} +1 -1
  29. package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
  30. package/dist/_chunks/date-range-picker-9gANFNG9.js.map +1 -0
  31. package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
  32. package/dist/_chunks/date-time-picker-DG7BiGdb.js.map +1 -0
  33. package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
  34. package/dist/_chunks/dialog-DUomPCRS.js.map +1 -0
  35. package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
  36. package/dist/_chunks/dropdown-menu-DZxwF23X.js.map +1 -0
  37. package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
  38. package/dist/_chunks/freemium-paywall-DXc7XlGE.js.map +1 -0
  39. package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
  40. package/dist/_chunks/{leo-sidebar-D3TuyH5_.js.map → leo-sidebar-DIsiTju3.js.map} +1 -1
  41. package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
  42. package/dist/_chunks/list-BdvDctBz.js.map +1 -0
  43. package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
  44. package/dist/_chunks/message-tray-BNAS8al4.js.map +1 -0
  45. package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
  46. package/dist/_chunks/multi-select-CyspR5ZF.js.map +1 -0
  47. package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
  48. package/dist/_chunks/navigation-menu-CyS1fBJ7.js.map +1 -0
  49. package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
  50. package/dist/_chunks/notification-tray-D_69dXFY.js.map +1 -0
  51. package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
  52. package/dist/_chunks/number-input-BZXu6bPY.js.map +1 -0
  53. package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
  54. package/dist/_chunks/otp-input-BDF_iNpa.js.map +1 -0
  55. package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
  56. package/dist/_chunks/pagination-BWaXF7W0.js.map +1 -0
  57. package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
  58. package/dist/_chunks/{patient-shell-BE0CdPOJ.js.map → patient-shell-BOOaWZA9.js.map} +1 -1
  59. package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
  60. package/dist/_chunks/{payment-form-CI77oIx1.js.map → payment-form-BjkuQeqR.js.map} +1 -1
  61. package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
  62. package/dist/_chunks/{pdf-viewer-CnEJvmXC.js.map → pdf-viewer-BG_nsFT5.js.map} +1 -1
  63. package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
  64. package/dist/_chunks/{radio-group-Cz1a4QCA.js.map → radio-group-BHZOxrIK.js.map} +1 -1
  65. package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
  66. package/dist/_chunks/{select-Ca6ibiDL.js.map → select-C92AT_OZ.js.map} +1 -1
  67. package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
  68. package/dist/_chunks/sidebar-BqzlRBvC.js.map +1 -0
  69. package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
  70. package/dist/_chunks/{slider-CkR6CLun.js.map → slider-CfEzeseL.js.map} +1 -1
  71. package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
  72. package/dist/_chunks/{tabs-CRCyPpJo.js.map → tabs-aEQfQV3x.js.map} +1 -1
  73. package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
  74. package/dist/_chunks/{theme-toggle-B3meAb3y.js.map → theme-toggle-BswYl0Yp.js.map} +1 -1
  75. package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
  76. package/dist/_chunks/use-controllable-state-BiY4xTzM.js.map +1 -0
  77. package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
  78. package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js.map +1 -0
  79. package/dist/_chunks/use-debounced-callback-BisrB-Fq.js.map +1 -1
  80. package/dist/_chunks/use-direction-D6rvvG9G.js.map +1 -1
  81. package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
  82. package/dist/_chunks/use-persistent-state-i23OWy6G.js.map +1 -0
  83. package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
  84. package/dist/_chunks/{warning-stack-CeRihME9.js.map → warning-stack-CDH9TudY.js.map} +1 -1
  85. package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
  86. package/dist/_chunks/{workflow-map-D3MvrsZV.js.map → workflow-map-BeKe23uw.js.map} +1 -1
  87. package/dist/agent-catalog.json +1 -1
  88. package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
  89. package/dist/components/_shared/use-debounced-callback.d.ts.map +1 -1
  90. package/dist/components/_shared/use-direction.d.ts +1 -18
  91. package/dist/components/_shared/use-direction.d.ts.map +1 -1
  92. package/dist/components/_shared/use-focus-trap.d.ts +1 -31
  93. package/dist/components/_shared/use-focus-trap.d.ts.map +1 -1
  94. package/dist/components/accordion/index.js +1 -1
  95. package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
  96. package/dist/components/ai-prompt-input/index.js +1 -1
  97. package/dist/components/alert/alert.d.ts.map +1 -1
  98. package/dist/components/alert/index.js +1 -1
  99. package/dist/components/audio-recorder/index.js +1 -1
  100. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  101. package/dist/components/autocomplete/index.js +1 -1
  102. package/dist/components/chat-input/chat-input.d.ts.map +1 -1
  103. package/dist/components/chat-input/index.js +1 -1
  104. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  105. package/dist/components/checkbox/index.js +1 -1
  106. package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -1
  107. package/dist/components/checkbox-group/index.js +1 -1
  108. package/dist/components/collapsible/collapsible.d.ts.map +1 -1
  109. package/dist/components/collapsible/index.js +1 -1
  110. package/dist/components/color-picker/index.js +1 -1
  111. package/dist/components/combobox/combobox.d.ts.map +1 -1
  112. package/dist/components/combobox/index.js +1 -1
  113. package/dist/components/command-palette/command-palette.d.ts +1 -1
  114. package/dist/components/copy-field/index.js +1 -1
  115. package/dist/components/data-table/index.js +1 -1
  116. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  117. package/dist/components/date-picker/index.js +1 -1
  118. package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
  119. package/dist/components/date-range-picker/index.js +1 -1
  120. package/dist/components/date-time-picker/date-time-picker.d.ts.map +1 -1
  121. package/dist/components/date-time-picker/index.js +1 -1
  122. package/dist/components/dialog/dialog.d.ts.map +1 -1
  123. package/dist/components/dialog/index.js +1 -1
  124. package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  125. package/dist/components/dropdown-menu/index.js +1 -1
  126. package/dist/components/freemium-paywall/freemium-paywall.d.ts.map +1 -1
  127. package/dist/components/freemium-paywall/index.js +1 -1
  128. package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
  129. package/dist/components/list/index.js +1 -1
  130. package/dist/components/list/list.d.ts.map +1 -1
  131. package/dist/components/message-tray/index.js +1 -1
  132. package/dist/components/message-tray/message-tray.d.ts.map +1 -1
  133. package/dist/components/multi-select/index.js +1 -1
  134. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  135. package/dist/components/navigation-menu/index.js +1 -1
  136. package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
  137. package/dist/components/notification-tray/index.js +1 -1
  138. package/dist/components/notification-tray/notification-tray.d.ts.map +1 -1
  139. package/dist/components/number-input/index.js +1 -1
  140. package/dist/components/number-input/number-input.d.ts.map +1 -1
  141. package/dist/components/otp-input/index.js +1 -1
  142. package/dist/components/otp-input/otp-input.d.ts.map +1 -1
  143. package/dist/components/pagination/index.js +1 -1
  144. package/dist/components/payment-form/index.js +1 -1
  145. package/dist/components/pdf-viewer/index.js +1 -1
  146. package/dist/components/radio-group/index.js +1 -1
  147. package/dist/components/select/index.js +1 -1
  148. package/dist/components/sidebar/index.js +8 -7
  149. package/dist/components/sidebar/index.js.map +1 -1
  150. package/dist/components/sidebar/sidebar.d.ts +1 -1
  151. package/dist/components/sidebar/sidebar.d.ts.map +1 -1
  152. package/dist/components/slider/index.js +1 -1
  153. package/dist/components/tabs/index.js +1 -1
  154. package/dist/components/theme-toggle/index.js +1 -1
  155. package/dist/components/warning-stack/index.js +1 -1
  156. package/dist/components/workflow/index.js +1 -1
  157. package/dist/hooks/index.d.ts +8 -0
  158. package/dist/hooks/index.d.ts.map +1 -1
  159. package/dist/hooks/index.js +98 -15
  160. package/dist/hooks/index.js.map +1 -1
  161. package/dist/hooks/use-debounced-callback.d.ts +19 -0
  162. package/dist/hooks/use-debounced-callback.d.ts.map +1 -0
  163. package/dist/hooks/use-debounced-value.d.ts +16 -0
  164. package/dist/hooks/use-debounced-value.d.ts.map +1 -0
  165. package/dist/hooks/use-direction.d.ts +19 -0
  166. package/dist/hooks/use-direction.d.ts.map +1 -0
  167. package/dist/hooks/use-focus-trap.d.ts +32 -0
  168. package/dist/hooks/use-focus-trap.d.ts.map +1 -0
  169. package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
  170. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +1 -0
  171. package/dist/hooks/use-persistent-state.d.ts +16 -0
  172. package/dist/hooks/use-persistent-state.d.ts.map +1 -0
  173. package/dist/index.js +493 -492
  174. package/dist/index.js.map +1 -1
  175. package/dist/patterns/leo-assistant/index.js +1 -1
  176. package/dist/patterns/patient-shell/index.js +1 -1
  177. package/dist/tokens.css +1 -1
  178. package/package.json +4 -2
  179. package/dist/_chunks/ai-prompt-input-DEiQwIMn.js.map +0 -1
  180. package/dist/_chunks/alert-pgdXrEO5.js.map +0 -1
  181. package/dist/_chunks/autocomplete-mOg7WLOh.js.map +0 -1
  182. package/dist/_chunks/chat-input-UK-bXU7u.js.map +0 -1
  183. package/dist/_chunks/checkbox-D5EHnB14.js.map +0 -1
  184. package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
  185. package/dist/_chunks/checkbox-group-Qkm3Rg1S.js.map +0 -1
  186. package/dist/_chunks/collapsible-CuxUBoHJ.js.map +0 -1
  187. package/dist/_chunks/combobox-D5tWe0t_.js.map +0 -1
  188. package/dist/_chunks/copy-field-BCHAZ8QV.js.map +0 -1
  189. package/dist/_chunks/date-range-picker-C2hRu_Ke.js.map +0 -1
  190. package/dist/_chunks/date-time-picker-B67mPZmP.js.map +0 -1
  191. package/dist/_chunks/dialog-DRp6Dejy.js.map +0 -1
  192. package/dist/_chunks/dropdown-menu-dyV7gHh_.js.map +0 -1
  193. package/dist/_chunks/freemium-paywall-BTEiVkes.js.map +0 -1
  194. package/dist/_chunks/list-DcjV0m5B.js.map +0 -1
  195. package/dist/_chunks/message-tray-Fsend-du.js.map +0 -1
  196. package/dist/_chunks/multi-select-DooDzQIp.js.map +0 -1
  197. package/dist/_chunks/navigation-menu-DdufF-_4.js.map +0 -1
  198. package/dist/_chunks/notification-tray-C3dYdLAF.js.map +0 -1
  199. package/dist/_chunks/number-input-DH00o0DN.js.map +0 -1
  200. package/dist/_chunks/otp-input-BBXYvLx5.js.map +0 -1
  201. package/dist/_chunks/pagination-F1ei4khE.js.map +0 -1
  202. package/dist/_chunks/sidebar-D8Lq065m.js.map +0 -1
@@ -1,15 +1,16 @@
1
- import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as Be, useId as $e, useRef as T, useCallback as g, useState as h, useLayoutEffect as Oe, useImperativeHandle as je, useMemo as De } from "react";
3
- import { c as _e } from "./index-D2ZczOXr.js";
4
- import { useTranslation as re } from "react-i18next";
5
- import { u as Ae } from "./registry-C9nwlNyL.js";
6
- import { _ as b } from "./index-4xgbg-sn.js";
7
- import { u as Ce } from "./index-CFoBa86t.js";
8
- import { I as ne } from "./icon-button-C4CGcYuz.js";
9
- import { S as Le } from "./select-Ca6ibiDL.js";
10
- import { S as Re } from "./send-CySZIRPJ.js";
11
- import { X as Ue } from "./x-CCcI3eJp.js";
12
- const We = {
1
+ import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as Fe, useId as Be, useRef as H, useCallback as v, useState as _, useLayoutEffect as $e, useImperativeHandle as Ce, useMemo as Oe } from "react";
3
+ import { c as je } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as ee } from "react-i18next";
5
+ import { u as J } from "./use-controllable-state-BiY4xTzM.js";
6
+ import { u as Re } from "./registry-C9nwlNyL.js";
7
+ import { _ as g } from "./index-4xgbg-sn.js";
8
+ import { u as De } from "./index-CFoBa86t.js";
9
+ import { I as te } from "./icon-button-C4CGcYuz.js";
10
+ import { S as _e } from "./select-C92AT_OZ.js";
11
+ import { S as Ae } from "./send-CySZIRPJ.js";
12
+ import { X as Le } from "./x-CCcI3eJp.js";
13
+ const Ue = {
13
14
  id: "ai-prompt-input",
14
15
  capabilities: ["edit_inline", "submit"],
15
16
  state: {
@@ -79,7 +80,7 @@ const We = {
79
80
  description: "Sourced from the id prop; addresses a specific composer instance."
80
81
  }
81
82
  }
82
- }, Ze = _e(
83
+ }, We = je(
83
84
  [
84
85
  "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full",
85
86
  "ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-input",
@@ -98,146 +99,149 @@ const We = {
98
99
  },
99
100
  defaultVariants: { size: "md" }
100
101
  }
101
- ), Qe = Be(
102
+ ), Ze = Fe(
102
103
  ({
103
104
  commands: s = [],
104
105
  models: d,
105
- defaultModelId: E,
106
- modelId: U,
107
- onModelChange: F,
108
- maxSize: x,
109
- accept: ie,
110
- context: B,
111
- onContextDismiss: y,
112
- onSubmit: I,
113
- onAttach: w,
114
- onAttachmentRejected: k,
115
- minRows: $ = 2,
116
- maxRows: W = 8,
117
- value: Z,
118
- defaultValue: Q,
119
- size: oe = "md",
120
- disabled: q,
121
- className: de,
122
- placeholder: le,
123
- onChange: O,
124
- onKeyDown: j,
125
- onCompositionStart: D,
126
- onCompositionEnd: _,
127
- onPaste: A,
128
- id: C,
129
- ...ce
130
- }, pe) => {
131
- var se;
132
- const { t: o } = re(), ue = $e(), N = T(null), S = T(!1), me = T(null), fe = g((e) => {
133
- N.current = e;
134
- }, []), c = Z !== void 0, [ve, f] = h(
135
- String(Q ?? "")
136
- ), i = c ? String(Z) : ve, [u, z] = h([]), [v, P] = h(!1), [ge, M] = h(""), [he, be] = h(
137
- E ?? ((se = d == null ? void 0 : d[0]) == null ? void 0 : se.id) ?? ""
138
- ), X = U !== void 0, L = X ? U : he, Y = g(() => {
139
- const e = N.current;
106
+ defaultModelId: K,
107
+ modelId: se,
108
+ onModelChange: ae,
109
+ maxSize: h,
110
+ accept: re,
111
+ context: T,
112
+ onContextDismiss: b,
113
+ onSubmit: x,
114
+ onAttach: y,
115
+ onAttachmentRejected: I,
116
+ minRows: E = 2,
117
+ maxRows: A = 8,
118
+ value: L,
119
+ defaultValue: ne,
120
+ size: ie = "md",
121
+ disabled: U,
122
+ className: oe,
123
+ placeholder: de,
124
+ onChange: F,
125
+ onKeyDown: B,
126
+ onCompositionStart: $,
127
+ onCompositionEnd: C,
128
+ onPaste: O,
129
+ id: j,
130
+ ...le
131
+ }, ce) => {
132
+ var Y;
133
+ const { t: o } = ee(), pe = Be(), w = H(null), k = H(!1), ue = H(null), me = v((e) => {
134
+ w.current = e;
135
+ }, []), [fe, m] = J({
136
+ value: L === void 0 ? void 0 : String(L),
137
+ defaultValue: String(ne ?? "")
138
+ }), i = fe ?? "", [p, N] = _([]), [f, S] = _(!1), [ve, M] = _(""), [ge, he] = J({
139
+ value: se,
140
+ defaultValue: K ?? ((Y = d == null ? void 0 : d[0]) == null ? void 0 : Y.id) ?? "",
141
+ onChange: ae
142
+ }), R = ge ?? "", W = v(() => {
143
+ const e = w.current;
140
144
  if (!e) return;
141
- const t = window.getComputedStyle(e), n = parseFloat(t.lineHeight) || 24, r = parseFloat(t.paddingTop) || 0, p = parseFloat(t.paddingBottom) || 0, l = parseFloat(t.borderTopWidth) || 0, R = parseFloat(t.borderBottomWidth) || 0, K = r + p + l + R, Ee = n * $ + K, ae = n * W + K;
145
+ const t = window.getComputedStyle(e), n = parseFloat(t.lineHeight) || 24, r = parseFloat(t.paddingTop) || 0, c = parseFloat(t.paddingBottom) || 0, l = parseFloat(t.borderTopWidth) || 0, D = parseFloat(t.borderBottomWidth) || 0, V = r + c + l + D, Te = n * E + V, G = n * A + V;
142
146
  e.style.height = "auto";
143
- const Fe = Math.max(Ee, Math.min(e.scrollHeight, ae));
144
- e.style.height = `${Fe}px`, e.style.overflowY = e.scrollHeight > ae ? "auto" : "hidden";
145
- }, [$, W]);
146
- Oe(() => {
147
- Y();
148
- }, [Y, i]);
149
- const xe = g((e, t) => {
147
+ const Ee = Math.max(Te, Math.min(e.scrollHeight, G));
148
+ e.style.height = `${Ee}px`, e.style.overflowY = e.scrollHeight > G ? "auto" : "hidden";
149
+ }, [E, A]);
150
+ $e(() => {
151
+ W();
152
+ }, [W, i]);
153
+ const be = v((e, t) => {
150
154
  const r = e.slice(0, t).lastIndexOf(`
151
- `) + 1, p = e.slice(r, t);
152
- if (p.startsWith("/")) {
153
- const l = p.slice(1);
155
+ `) + 1, c = e.slice(r, t);
156
+ if (c.startsWith("/")) {
157
+ const l = c.slice(1);
154
158
  if (!/\s/.test(l)) {
155
- P(!0), M(l);
159
+ S(!0), M(l);
156
160
  return;
157
161
  }
158
162
  }
159
- P(!1), M("");
160
- }, []), ye = (e) => {
161
- if (c || f(e.target.value), S.current) return;
162
- O == null || O(e);
163
+ S(!1), M("");
164
+ }, []), xe = (e) => {
165
+ if (m(e.target.value), k.current) return;
166
+ F == null || F(e);
163
167
  const t = e.target.selectionStart ?? e.target.value.length;
164
- xe(e.target.value, t);
168
+ be(e.target.value, t);
169
+ }, ye = (e) => {
170
+ k.current = !0, $ == null || $(e);
165
171
  }, Ie = (e) => {
166
- S.current = !0, D == null || D(e);
167
- }, we = (e) => {
168
- S.current = !1, _ == null || _(e);
169
- }, ke = (e) => e.nativeEvent.isComposing || e.keyCode === 229 || S.current, V = g(() => {
170
- if (!i.trim() && u.length === 0) return;
172
+ k.current = !1, C == null || C(e);
173
+ }, we = (e) => e.nativeEvent.isComposing || e.keyCode === 229 || k.current, P = v(() => {
174
+ if (!i.trim() && p.length === 0) return;
171
175
  let t, n = i;
172
176
  const r = i.match(/^\/(\S+)\s?/);
173
- r && (t = r[1], n = i.slice(r[0].length)), I == null || I({
177
+ r && (t = r[1], n = i.slice(r[0].length)), x == null || x({
174
178
  text: n,
175
179
  command: t,
176
- attachments: u,
177
- modelId: L || void 0
178
- }), c || f(""), z([]);
179
- }, [i, u, I, L, c]), G = T(null);
180
- je(pe, () => G.current, []);
181
- const Ne = De(
180
+ attachments: p,
181
+ modelId: R || void 0
182
+ }), m(""), N([]);
183
+ }, [i, p, x, R, m]), Z = H(null);
184
+ Ce(ce, () => Z.current, []);
185
+ const ke = Oe(
182
186
  () => ({
183
187
  getValue: () => i,
184
- isEmpty: () => !i.trim() && u.length === 0,
188
+ isEmpty: () => !i.trim() && p.length === 0,
185
189
  isSubmitting: () => !1,
186
190
  setValue: (e) => {
187
- c || f(e);
191
+ m(e);
188
192
  },
189
193
  clear: () => {
190
- c || f(""), z([]);
194
+ m(""), N([]);
191
195
  },
192
196
  submit: () => {
193
- V();
197
+ P();
194
198
  },
195
199
  focus: () => {
196
200
  var e;
197
- (e = N.current) == null || e.focus();
201
+ (e = w.current) == null || e.focus();
198
202
  }
199
203
  }),
200
- [i, u, c, V]
204
+ [i, p, m, P]
201
205
  );
202
- Ae(We, Ne, C);
203
- const Se = (e) => {
204
- if (j == null || j(e), !e.defaultPrevented && !ke(e)) {
205
- if (v && e.key === "Escape") {
206
- e.preventDefault(), P(!1);
206
+ Re(Ue, ke, j);
207
+ const Ne = (e) => {
208
+ if (B == null || B(e), !e.defaultPrevented && !we(e)) {
209
+ if (f && e.key === "Escape") {
210
+ e.preventDefault(), S(!1);
207
211
  return;
208
212
  }
209
- e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), V());
213
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), P());
210
214
  }
211
- }, ze = (e) => {
212
- const t = N.current;
215
+ }, Se = (e) => {
216
+ const t = w.current;
213
217
  if (!t) return;
214
- const n = t.selectionStart ?? i.length, p = i.slice(0, n).lastIndexOf(`
218
+ const n = t.selectionStart ?? i.length, c = i.slice(0, n).lastIndexOf(`
215
219
  `) + 1;
216
220
  let l = n;
217
221
  for (; l < i.length && !/\s/.test(i[l]); )
218
222
  l += 1;
219
- const R = i.slice(l), K = i.slice(0, p) + `/${e.id} ` + R;
220
- c || f(K), P(!1), M(""), queueMicrotask(() => t.focus());
221
- }, Pe = (e) => {
222
- if (A == null || A(e), e.defaultPrevented) return;
223
+ const D = i.slice(l), V = i.slice(0, c) + `/${e.id} ` + D;
224
+ m(V), S(!1), M(""), queueMicrotask(() => t.focus());
225
+ }, Me = (e) => {
226
+ if (O == null || O(e), e.defaultPrevented) return;
223
227
  const { clipboardData: t } = e;
224
228
  if (!t) return;
225
229
  const n = [];
226
230
  for (let r = 0; r < t.items.length; r += 1) {
227
- const p = t.items[r];
228
- if (p.kind === "file") {
229
- const l = p.getAsFile();
231
+ const c = t.items[r];
232
+ if (c.kind === "file") {
233
+ const l = c.getAsFile();
230
234
  l && n.push(l);
231
235
  }
232
236
  }
233
- n.length > 0 && (e.preventDefault(), J(n));
234
- }, J = g(
237
+ n.length > 0 && (e.preventDefault(), Q(n));
238
+ }, Q = v(
235
239
  (e) => {
236
240
  var n;
237
241
  const t = [];
238
242
  for (const r of e) {
239
- if (typeof x == "number" && r.size > x) {
240
- k == null || k(
243
+ if (typeof h == "number" && r.size > h) {
244
+ I == null || I(
241
245
  o("chat.attachment.rejected", { reason: "size" })
242
246
  );
243
247
  continue;
@@ -247,41 +251,41 @@ const We = {
247
251
  file: r
248
252
  });
249
253
  }
250
- t.length > 0 && (z((r) => [...r, ...t]), w == null || w(t.map((r) => r.file)));
254
+ t.length > 0 && (N((r) => [...r, ...t]), y == null || y(t.map((r) => r.file)));
251
255
  },
252
- [x, w, k, o]
253
- ), { getRootProps: Me, getInputProps: Ve, isDragActive: He } = Ce({
254
- onDrop: J,
255
- maxSize: x,
256
- accept: ie,
256
+ [h, y, I, o]
257
+ ), { getRootProps: Pe, getInputProps: ze, isDragActive: Ve } = De({
258
+ onDrop: Q,
259
+ maxSize: h,
260
+ accept: re,
257
261
  noClick: !0,
258
262
  noKeyboard: !0
259
- }), Ke = (e) => {
260
- z((t) => t.filter((n) => n.id !== e));
261
- }, H = C ?? ue, ee = `${H}-label`, te = `${H}-slash-list`, Te = (d == null ? void 0 : d.map((e) => ({ value: e.id, label: e.label }))) ?? [];
262
- return /* @__PURE__ */ m(
263
+ }), He = (e) => {
264
+ N((t) => t.filter((n) => n.id !== e));
265
+ }, z = j ?? pe, q = `${z}-label`, X = `${z}-slash-list`, Ke = (d == null ? void 0 : d.map((e) => ({ value: e.id, label: e.label }))) ?? [];
266
+ return /* @__PURE__ */ u(
263
267
  "div",
264
268
  {
265
- ref: G,
266
- ...Me({
269
+ ref: Z,
270
+ ...Pe({
267
271
  className: [
268
- Ze({ size: oe, className: de }),
269
- He ? "ds:outline ds:outline-dashed ds:outline-[color:var(--primary)] ds:outline-offset-2 ds:bg-[color:var(--primary)]/5" : ""
272
+ We({ size: ie, className: oe }),
273
+ Ve ? "ds:outline ds:outline-dashed ds:outline-[color:var(--primary)] ds:outline-offset-2 ds:bg-[color:var(--primary)]/5" : ""
270
274
  ].join(" ")
271
275
  }),
272
276
  "aria-label": o("chat.attachmentZone"),
273
277
  "data-component": "ai-prompt-input",
274
- "data-component-id": C,
278
+ "data-component-id": j,
275
279
  children: [
276
- /* @__PURE__ */ a("input", { "aria-label": o("chat.attachmentZone"), ...Ve() }),
277
- B ? /* @__PURE__ */ a("div", { className: "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)]", children: /* @__PURE__ */ a(
280
+ /* @__PURE__ */ a("input", { "aria-label": o("chat.attachmentZone"), ...ze() }),
281
+ T ? /* @__PURE__ */ a("div", { className: "ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)]", children: /* @__PURE__ */ a(
278
282
  "button",
279
283
  {
280
284
  type: "button",
281
- "aria-label": o("chat.contextActive", { name: B }),
282
- onClick: y,
285
+ "aria-label": o("chat.contextActive", { name: T }),
286
+ onClick: b,
283
287
  onKeyDown: (e) => {
284
- (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), y == null || y());
288
+ (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), b == null || b());
285
289
  },
286
290
  className: [
287
291
  "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
@@ -293,30 +297,29 @@ const We = {
293
297
  "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)]",
294
298
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
295
299
  ].join(" "),
296
- children: o("chat.contextActive", { name: B })
300
+ children: o("chat.contextActive", { name: T })
297
301
  }
298
302
  ) }) : null,
299
- /* @__PURE__ */ a("label", { id: ee, htmlFor: H, className: "ds:sr-only", children: o("chat.prompt") }),
300
- /* @__PURE__ */ m("div", { className: "ds:relative", children: [
303
+ /* @__PURE__ */ a("label", { id: q, htmlFor: z, className: "ds:sr-only", children: o("chat.prompt") }),
304
+ /* @__PURE__ */ u("div", { className: "ds:relative", children: [
301
305
  /* @__PURE__ */ a(
302
306
  "textarea",
303
307
  {
304
- ref: fe,
305
- id: H,
306
- rows: $,
307
- value: c ? i : void 0,
308
- defaultValue: c ? void 0 : Q,
309
- disabled: q,
310
- placeholder: le ?? o("chat.input.placeholder"),
311
- "aria-labelledby": ee,
312
- role: v ? "combobox" : void 0,
313
- "aria-controls": v ? te : void 0,
314
- "aria-expanded": v ? !0 : void 0,
315
- onChange: ye,
316
- onKeyDown: Se,
317
- onPaste: Pe,
318
- onCompositionStart: Ie,
319
- onCompositionEnd: we,
308
+ ref: me,
309
+ id: z,
310
+ rows: E,
311
+ value: i,
312
+ disabled: U,
313
+ placeholder: de ?? o("chat.input.placeholder"),
314
+ "aria-labelledby": q,
315
+ role: f ? "combobox" : void 0,
316
+ "aria-controls": f ? X : void 0,
317
+ "aria-expanded": f ? !0 : void 0,
318
+ onChange: xe,
319
+ onKeyDown: Ne,
320
+ onPaste: Me,
321
+ onCompositionStart: ye,
322
+ onCompositionEnd: Ie,
320
323
  className: [
321
324
  "ds:w-full ds:resize-none ds:bg-transparent ds:outline-none",
322
325
  "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]",
@@ -324,13 +327,13 @@ const We = {
324
327
  "ds:leading-[var(--line-height-base)]",
325
328
  "ds:disabled:opacity-50 ds:disabled:cursor-not-allowed"
326
329
  ].join(" "),
327
- ...ce
330
+ ...le
328
331
  }
329
332
  ),
330
- v ? /* @__PURE__ */ a(
333
+ f ? /* @__PURE__ */ a(
331
334
  "div",
332
335
  {
333
- ref: me,
336
+ ref: ue,
334
337
  className: [
335
338
  "ds:absolute ds:start-[var(--spacing-md)] ds:top-full ds:z-50",
336
339
  "ds:mt-[var(--spacing-xs)]",
@@ -343,23 +346,23 @@ const We = {
343
346
  "ds:origin-top ds:motion-safe:animate-in ds:motion-safe:fade-in-0 ds:motion-safe:zoom-in-95",
344
347
  "ds:duration-[var(--animation-duration)] ds:ease-[var(--ease-out)]"
345
348
  ].join(" "),
346
- id: te,
347
- children: /* @__PURE__ */ m(b, { label: o("chat.slashMenu.label"), loop: !0, children: [
349
+ id: X,
350
+ children: /* @__PURE__ */ u(g, { label: o("chat.slashMenu.label"), loop: !0, children: [
348
351
  /* @__PURE__ */ a(
349
- b.Input,
352
+ g.Input,
350
353
  {
351
- value: ge,
354
+ value: ve,
352
355
  onValueChange: M,
353
356
  className: "ds:sr-only"
354
357
  }
355
358
  ),
356
- /* @__PURE__ */ m(b.List, { className: "ds:max-h-60 ds:overflow-y-auto ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: [
357
- /* @__PURE__ */ a(b.Empty, { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", children: o("chat.slashMenu.empty") }),
358
- s.map((e) => /* @__PURE__ */ m(
359
- b.Item,
359
+ /* @__PURE__ */ u(g.List, { className: "ds:max-h-60 ds:overflow-y-auto ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: [
360
+ /* @__PURE__ */ a(g.Empty, { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]", children: o("chat.slashMenu.empty") }),
361
+ s.map((e) => /* @__PURE__ */ u(
362
+ g.Item,
360
363
  {
361
364
  value: e.id,
362
- onSelect: () => ze(e),
365
+ onSelect: () => Se(e),
363
366
  className: [
364
367
  "ds:flex ds:flex-col ds:gap-[2px]",
365
368
  "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
@@ -369,7 +372,7 @@ const We = {
369
372
  "ds:data-[selected=true]:bg-muted/20"
370
373
  ].join(" "),
371
374
  children: [
372
- /* @__PURE__ */ m("span", { className: "ds:font-medium", children: [
375
+ /* @__PURE__ */ u("span", { className: "ds:font-medium", children: [
373
376
  "/",
374
377
  e.id
375
378
  ] }),
@@ -383,45 +386,45 @@ const We = {
383
386
  }
384
387
  ) : null
385
388
  ] }),
386
- u.length > 0 ? /* @__PURE__ */ a(
389
+ p.length > 0 ? /* @__PURE__ */ a(
387
390
  "div",
388
391
  {
389
392
  role: "group",
390
393
  "aria-label": o("chat.attachmentZone"),
391
394
  className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
392
- children: u.map((e) => /* @__PURE__ */ a(
393
- Xe,
395
+ children: p.map((e) => /* @__PURE__ */ a(
396
+ qe,
394
397
  {
395
398
  file: e.file,
396
- onRemove: () => Ke(e.id)
399
+ onRemove: () => He(e.id)
397
400
  },
398
401
  e.id
399
402
  ))
400
403
  }
401
404
  ) : null,
402
- /* @__PURE__ */ m("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: [
405
+ /* @__PURE__ */ u("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: [
403
406
  d && d.length > 0 ? /* @__PURE__ */ a("div", { className: "ds:me-auto ds:min-w-[140px]", children: /* @__PURE__ */ a(
404
- Le,
407
+ _e,
405
408
  {
406
409
  "aria-label": o("chat.model.select"),
407
- options: Te,
408
- value: L || "",
410
+ options: Ke,
411
+ value: R || "",
409
412
  onValueChange: (e) => {
410
- X || be(e), F == null || F(e);
413
+ he(e);
411
414
  },
412
415
  size: "sm"
413
416
  }
414
417
  ) }) : /* @__PURE__ */ a("div", { className: "ds:me-auto" }),
415
418
  /* @__PURE__ */ a("span", { className: "ds:sr-only", children: o("chat.input.sendHint") }),
416
419
  /* @__PURE__ */ a(
417
- ne,
420
+ te,
418
421
  {
419
- icon: /* @__PURE__ */ a(Re, {}),
422
+ icon: /* @__PURE__ */ a(Ae, {}),
420
423
  "aria-label": o("chat.send"),
421
424
  intent: "primary",
422
425
  size: "sm",
423
- disabled: q || !i.trim() && u.length === 0,
424
- onClick: V,
426
+ disabled: U || !i.trim() && p.length === 0,
427
+ onClick: P,
425
428
  "aria-keyshortcuts": "Meta+Enter Control+Enter"
426
429
  }
427
430
  )
@@ -431,16 +434,16 @@ const We = {
431
434
  );
432
435
  }
433
436
  );
434
- Qe.displayName = "AIPromptInput";
435
- function qe(s) {
437
+ Ze.displayName = "AIPromptInput";
438
+ function Qe(s) {
436
439
  return s < 1024 ? `${s} B` : s < 1024 * 1024 ? `${(s / 1024).toFixed(1)} KB` : `${(s / (1024 * 1024)).toFixed(1)} MB`;
437
440
  }
438
- function Xe({
441
+ function qe({
439
442
  file: s,
440
443
  onRemove: d
441
444
  }) {
442
- const { t: E } = re();
443
- return /* @__PURE__ */ m(
445
+ const { t: K } = ee();
446
+ return /* @__PURE__ */ u(
444
447
  "span",
445
448
  {
446
449
  className: [
@@ -455,12 +458,12 @@ function Xe({
455
458
  ].join(" "),
456
459
  children: [
457
460
  /* @__PURE__ */ a("span", { className: "ds:truncate ds:max-w-[16ch]", children: s.name }),
458
- /* @__PURE__ */ a("span", { className: "ds:text-[color:var(--muted-foreground)] ds:tabular-nums", children: qe(s.size) }),
461
+ /* @__PURE__ */ a("span", { className: "ds:text-[color:var(--muted-foreground)] ds:tabular-nums", children: Qe(s.size) }),
459
462
  /* @__PURE__ */ a(
460
- ne,
463
+ te,
461
464
  {
462
- icon: /* @__PURE__ */ a(Ue, {}),
463
- "aria-label": E("chat.attachment.remove", { name: s.name }),
465
+ icon: /* @__PURE__ */ a(Le, {}),
466
+ "aria-label": K("chat.attachment.remove", { name: s.name }),
464
467
  intent: "ghost",
465
468
  size: "sm",
466
469
  onClick: d
@@ -471,7 +474,7 @@ function Xe({
471
474
  );
472
475
  }
473
476
  export {
474
- Qe as A,
475
- We as a
477
+ Ze as A,
478
+ Ue as a
476
479
  };
477
- //# sourceMappingURL=ai-prompt-input-DEiQwIMn.js.map
480
+ //# sourceMappingURL=ai-prompt-input-B-w5Rx3V.js.map