@alfadocs/ui-kit 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 (100) hide show
  1. package/dist/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
  2. package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
  3. package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
  4. package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
  5. package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
  6. package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
  7. package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
  8. package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
  9. package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
  10. package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
  11. package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
  12. package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
  13. package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
  14. package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
  15. package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
  16. package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
  17. package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
  18. package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
  19. package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
  20. package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
  21. package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
  22. package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
  23. package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
  24. package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
  25. package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
  26. package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
  27. package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
  28. package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
  29. package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
  30. package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
  31. package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
  32. package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
  33. package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
  34. package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
  35. package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
  36. package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
  37. package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
  38. package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
  39. package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
  40. package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
  41. package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
  42. package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
  43. package/dist/agent-catalog.json +1 -1
  44. package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
  45. package/dist/components/_shared/use-direction.d.ts +1 -18
  46. package/dist/components/_shared/use-focus-trap.d.ts +1 -31
  47. package/dist/components/accordion/index.js +1 -1
  48. package/dist/components/ai-prompt-input/index.js +1 -1
  49. package/dist/components/alert/index.js +1 -1
  50. package/dist/components/audio-recorder/index.js +1 -1
  51. package/dist/components/autocomplete/index.js +1 -1
  52. package/dist/components/chat-input/index.js +1 -1
  53. package/dist/components/checkbox/index.js +1 -1
  54. package/dist/components/checkbox-group/index.js +1 -1
  55. package/dist/components/collapsible/index.js +1 -1
  56. package/dist/components/color-picker/index.js +1 -1
  57. package/dist/components/combobox/index.js +1 -1
  58. package/dist/components/command-palette/command-palette.d.ts +1 -1
  59. package/dist/components/copy-field/index.js +1 -1
  60. package/dist/components/data-table/index.js +1 -1
  61. package/dist/components/date-picker/index.js +1 -1
  62. package/dist/components/date-range-picker/index.js +1 -1
  63. package/dist/components/date-time-picker/index.js +1 -1
  64. package/dist/components/dialog/index.js +1 -1
  65. package/dist/components/dropdown-menu/index.js +1 -1
  66. package/dist/components/freemium-paywall/index.js +1 -1
  67. package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
  68. package/dist/components/list/index.js +1 -1
  69. package/dist/components/message-tray/index.js +1 -1
  70. package/dist/components/multi-select/index.js +1 -1
  71. package/dist/components/navigation-menu/index.js +1 -1
  72. package/dist/components/notification-tray/index.js +1 -1
  73. package/dist/components/number-input/index.js +1 -1
  74. package/dist/components/otp-input/index.js +1 -1
  75. package/dist/components/pagination/index.js +1 -1
  76. package/dist/components/payment-form/index.js +1 -1
  77. package/dist/components/pdf-viewer/index.js +1 -1
  78. package/dist/components/radio-group/index.js +1 -1
  79. package/dist/components/select/index.js +1 -1
  80. package/dist/components/sidebar/index.js +8 -7
  81. package/dist/components/sidebar/sidebar.d.ts +1 -1
  82. package/dist/components/slider/index.js +1 -1
  83. package/dist/components/tabs/index.js +1 -1
  84. package/dist/components/theme-toggle/index.js +1 -1
  85. package/dist/components/warning-stack/index.js +1 -1
  86. package/dist/components/workflow/index.js +1 -1
  87. package/dist/hooks/index.d.ts +8 -0
  88. package/dist/hooks/index.js +98 -15
  89. package/dist/hooks/use-debounced-callback.d.ts +19 -0
  90. package/dist/hooks/use-debounced-value.d.ts +16 -0
  91. package/dist/hooks/use-direction.d.ts +19 -0
  92. package/dist/hooks/use-focus-trap.d.ts +32 -0
  93. package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
  94. package/dist/hooks/use-persistent-state.d.ts +16 -0
  95. package/dist/index.js +493 -492
  96. package/dist/patterns/leo-assistant/index.js +1 -1
  97. package/dist/patterns/patient-shell/index.js +1 -1
  98. package/dist/tokens.css +1 -1
  99. package/package.json +4 -2
  100. package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
@@ -1,35 +1,36 @@
1
- import { jsx as o, jsxs as I } from "react/jsx-runtime";
2
- import { forwardRef as $e, useContext as ke, useState as G, useMemo as M, useRef as v, useLayoutEffect as Oe, useEffect as E, useCallback as Ve } from "react";
3
- import * as F from "@radix-ui/react-popover";
4
- import { R as qe, _ as u, P as Be } from "./index-4xgbg-sn.js";
5
- import { c as D } from "./index-D2ZczOXr.js";
6
- import { useTranslation as Ue } from "react-i18next";
7
- import { u as He, F as Ge } from "./form-field-context-B3APVHKx.js";
8
- import { c as Me } from "./compose-refs-C0k0tdqF.js";
9
- import { n as L } from "./normalize-diacritics-BNGbFNlJ.js";
10
- import { g as Le } from "./group-options-BvKhQ3xb.js";
11
- import { I as Qe, a as Q, d as K, c as Ke } from "./input-surface-xyERuLU_.js";
12
- import { u as Xe } from "./registry-C9nwlNyL.js";
13
- import { X as We } from "./x-CCcI3eJp.js";
14
- import { C as Je } from "./check-DPdL_Sm7.js";
15
- const Ye = {
1
+ import { jsx as o, jsxs as N } from "react/jsx-runtime";
2
+ import { forwardRef as je, useContext as Ae, useMemo as U, useState as oe, useRef as g, useLayoutEffect as Te, useEffect as I, useCallback as $e } from "react";
3
+ import * as _ from "@radix-ui/react-popover";
4
+ import { R as ke, _ as c, P as Oe } from "./index-4xgbg-sn.js";
5
+ import { c as E } from "./index-D2ZczOXr.js";
6
+ import { useTranslation as qe } from "react-i18next";
7
+ import { u as Be, F as Ue } from "./form-field-context-B3APVHKx.js";
8
+ import { c as He } from "./compose-refs-C0k0tdqF.js";
9
+ import { n as H } from "./normalize-diacritics-BNGbFNlJ.js";
10
+ import { g as Ge } from "./group-options-BvKhQ3xb.js";
11
+ import { u as Me } from "./use-controllable-state-BiY4xTzM.js";
12
+ import { I as Le, a as G, d as M, c as Qe } from "./input-surface-xyERuLU_.js";
13
+ import { u as Ke } from "./registry-C9nwlNyL.js";
14
+ import { X as Xe } from "./x-CCcI3eJp.js";
15
+ import { C as We } from "./check-DPdL_Sm7.js";
16
+ const Je = {
16
17
  id: "combobox",
17
18
  capabilities: ["select_single", "pick", "filter", "open", "close"],
18
19
  state: {
19
20
  value: {
20
21
  type: "string | null",
21
22
  description: "Currently-selected option value, or null when nothing is selected.",
22
- read: (s) => s.getValue()
23
+ read: (t) => t.getValue()
23
24
  },
24
25
  query: {
25
26
  type: "string",
26
27
  description: "Current filter query in the combobox input.",
27
- read: (s) => s.getQuery()
28
+ read: (t) => t.getQuery()
28
29
  },
29
30
  isOpen: {
30
31
  type: "boolean",
31
32
  description: "True when the option list is visible.",
32
- read: (s) => s.getIsOpen()
33
+ read: (t) => t.getIsOpen()
33
34
  }
34
35
  },
35
36
  actions: {
@@ -37,37 +38,37 @@ const Ye = {
37
38
  safety: "read",
38
39
  argsType: "{ value: string | null }",
39
40
  description: "Set the selected value programmatically.",
40
- invoke: (s, r) => {
41
- s.setValue(r.value);
41
+ invoke: (t, r) => {
42
+ t.setValue(r.value);
42
43
  }
43
44
  },
44
45
  apply_filter: {
45
46
  safety: "read",
46
47
  argsType: "{ query: string }",
47
48
  description: "Set the filter query for the option list.",
48
- invoke: (s, r) => {
49
- s.setQuery(r.query);
49
+ invoke: (t, r) => {
50
+ t.setQuery(r.query);
50
51
  }
51
52
  },
52
53
  clear_selection: {
53
54
  safety: "read",
54
55
  description: "Clear the current selection.",
55
- invoke: (s) => {
56
- s.clear();
56
+ invoke: (t) => {
57
+ t.clear();
57
58
  }
58
59
  },
59
60
  open: {
60
61
  safety: "read",
61
62
  description: "Open the option list.",
62
- invoke: (s) => {
63
- s.open();
63
+ invoke: (t) => {
64
+ t.open();
64
65
  }
65
66
  },
66
67
  close: {
67
68
  safety: "read",
68
69
  description: "Close the option list.",
69
- invoke: (s) => {
70
- s.close();
70
+ invoke: (t) => {
71
+ t.close();
71
72
  }
72
73
  }
73
74
  },
@@ -83,7 +84,7 @@ const Ye = {
83
84
  description: "Each option emits its value as data-option-id."
84
85
  }
85
86
  }
86
- }, Ze = D(
87
+ }, Ye = E(
87
88
  [
88
89
  "ds:peer ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground",
89
90
  "ds:outline-none ds:border-0",
@@ -101,26 +102,26 @@ const Ye = {
101
102
  size: "md"
102
103
  }
103
104
  }
104
- ), et = D(
105
+ ), Ze = E(
105
106
  [
106
107
  "ds:group ds:relative ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:w-full",
107
- Ke
108
+ Qe
108
109
  ].join(" "),
109
110
  {
110
111
  variants: {
111
112
  size: {
112
- sm: `${Q.sm} ${K.sm}`,
113
- md: `${Q.md} ${K.md}`,
114
- lg: `${Q.lg} ${K.lg}`
113
+ sm: `${G.sm} ${M.sm}`,
114
+ md: `${G.md} ${M.md}`,
115
+ lg: `${G.lg} ${M.lg}`
115
116
  },
116
- tone: Qe
117
+ tone: Le
117
118
  },
118
119
  defaultVariants: {
119
120
  size: "md",
120
121
  tone: "default"
121
122
  }
122
123
  }
123
- ), tt = D(
124
+ ), et = E(
124
125
  [
125
126
  "ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-[var(--radix-popover-trigger-width)]",
126
127
  "ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground",
@@ -132,7 +133,7 @@ const Ye = {
132
133
  "ds:data-[side=top]:slide-in-from-bottom-2",
133
134
  "ds:motion-reduce:animate-none"
134
135
  ].join(" ")
135
- ), ae = D(
136
+ ), ne = E(
136
137
  [
137
138
  "ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]",
138
139
  "ds:rounded-[var(--radius-sm)]",
@@ -154,35 +155,35 @@ const Ye = {
154
155
  size: "md"
155
156
  }
156
157
  }
157
- ), st = [
158
+ ), tt = [
158
159
  "ds:ps-3 ds:pe-3 ds:py-1.5",
159
160
  "type-eyebrow ds:text-muted-foreground"
160
- ].join(" "), ot = "ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]", nt = "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", rt = {
161
+ ].join(" "), st = "ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]", ot = "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", nt = {
161
162
  sm: "ds:size-3.5",
162
163
  md: "ds:size-4",
163
164
  lg: "ds:size-5"
164
165
  };
165
- function at({
166
- search: s,
166
+ function rt({
167
+ search: t,
167
168
  label: r,
168
- iconClass: y,
169
- size: P,
170
- onSelect: j
169
+ iconClass: F,
170
+ size: V,
171
+ onSelect: D
171
172
  }) {
172
- return Be((A) => A.filtered.count) > 0 ? null : /* @__PURE__ */ I(
173
- u.Item,
173
+ return Oe((P) => P.filtered.count) > 0 ? null : /* @__PURE__ */ N(
174
+ c.Item,
174
175
  {
175
- value: `__combobox-create__${s}`,
176
+ value: `__combobox-create__${t}`,
176
177
  keywords: [],
177
178
  forceMount: !0,
178
- onSelect: () => j(s),
179
- className: ae({ size: P }),
179
+ onSelect: () => D(t),
180
+ className: ne({ size: V }),
180
181
  children: [
181
182
  /* @__PURE__ */ o(
182
183
  "span",
183
184
  {
184
185
  "aria-hidden": "true",
185
- className: `ds:inline-flex ds:items-center ds:justify-center ${y}`
186
+ className: `ds:inline-flex ds:items-center ds:justify-center ${F}`
186
187
  }
187
188
  ),
188
189
  /* @__PURE__ */ o("span", { className: "ds:flex-1 ds:truncate", children: r })
@@ -190,169 +191,171 @@ function at({
190
191
  }
191
192
  );
192
193
  }
193
- const ie = $e(
194
+ const re = je(
194
195
  function({
195
196
  options: r,
196
- value: y,
197
- defaultValue: P,
198
- onValueChange: j,
199
- placeholder: X,
200
- clearable: A = !1,
201
- disabled: de,
202
- readOnly: le,
203
- required: ce,
204
- name: ue,
205
- id: T,
206
- size: x = "md",
207
- tone: me = "default",
208
- filter: $,
209
- allowCreate: fe = !1,
210
- onCreate: k,
211
- open: W,
212
- onOpenChange: m,
213
- emptyMessage: pe,
214
- className: be,
215
- "aria-label": J
216
- }, he) {
217
- const { t: C } = Ue(), h = He(), N = ke(Ge) !== null, [ge, O] = G(
218
- y ?? P ?? ""
219
- ), z = y !== void 0, f = z ? y : ge, V = M(
220
- () => r.find((e) => e.value === f),
221
- [r, f]
222
- ), S = (V == null ? void 0 : V.label) ?? "", [p, i] = G(S), [ve, Y] = G(!1), R = W !== void 0, d = R ? W : ve, w = v(!1), _ = v(null), Z = v(null);
223
- Oe(() => {
197
+ value: F,
198
+ defaultValue: V,
199
+ onValueChange: D,
200
+ placeholder: L,
201
+ clearable: P = !1,
202
+ disabled: ae,
203
+ readOnly: ie,
204
+ required: de,
205
+ name: le,
206
+ id: j,
207
+ size: v = "md",
208
+ tone: ce = "default",
209
+ filter: A,
210
+ allowCreate: ue = !1,
211
+ onCreate: T,
212
+ open: Q,
213
+ onOpenChange: u,
214
+ emptyMessage: me,
215
+ className: fe,
216
+ "aria-label": K
217
+ }, pe) {
218
+ const { t: x } = qe(), b = Be(), y = Ae(Ue) !== null, [be, z] = Me({
219
+ value: F,
220
+ defaultValue: V ?? "",
221
+ onChange: D
222
+ }), m = be ?? "", $ = U(
223
+ () => r.find((e) => e.value === m),
224
+ [r, m]
225
+ ), C = ($ == null ? void 0 : $.label) ?? "", [f, i] = oe(C), [he, X] = oe(!1), S = Q !== void 0, d = S ? Q : he, R = g(!1), w = g(null), W = g(null);
226
+ Te(() => {
224
227
  var e;
225
- (e = _.current) == null || e.setAttribute("aria-expanded", String(d));
226
- }), E(() => {
227
- d || i(S);
228
- }, [S, d]);
229
- const ye = T ?? (N ? h.id : void 0), q = (N ? h.disabled : !1) || !!de, g = !!le, xe = (N ? h.required : !1) || !!ce, ee = N ? h.invalid : !1, Ce = ee ? "error" : me, Ne = N && h.describedBy ? h.describedBy : void 0, te = X ?? C("inputs.combobox.placeholder", "Search…"), ze = M(
230
- () => (e, t, n) => {
231
- if (w.current) return 1;
232
- const b = L(e), a = L(t), H = n == null ? void 0 : n.map(L);
233
- return $ ? $(b, a) : qe(
234
- b,
228
+ (e = w.current) == null || e.setAttribute("aria-expanded", String(d));
229
+ }), I(() => {
230
+ d || i(C);
231
+ }, [C, d]);
232
+ const ge = j ?? (y ? b.id : void 0), k = (y ? b.disabled : !1) || !!ae, h = !!ie, ve = (y ? b.required : !1) || !!de, J = y ? b.invalid : !1, xe = J ? "error" : ce, ye = y && b.describedBy ? b.describedBy : void 0, Y = L ?? x("inputs.combobox.placeholder", "Search…"), Ce = U(
233
+ () => (e, s, n) => {
234
+ if (R.current) return 1;
235
+ const p = H(e), a = H(s), B = n == null ? void 0 : n.map(H);
236
+ return A ? A(p, a) : ke(
237
+ p,
235
238
  a,
236
- H
239
+ B
237
240
  );
238
241
  },
239
- [$]
240
- ), l = j, se = (e) => {
241
- z || O(e), l == null || l(e);
242
- }, c = (e) => {
243
- R || Y(e), m == null || m(e);
242
+ [A]
243
+ ), Z = (e) => {
244
+ z(e);
245
+ }, l = (e) => {
246
+ S || X(e), u == null || u(e);
247
+ }, Ne = (e) => {
248
+ const s = r.find((n) => n.value === e);
249
+ Z(e), i((s == null ? void 0 : s.label) ?? ""), l(!1);
250
+ }, ze = (e) => {
251
+ T == null || T(e), l(!1);
244
252
  }, Se = (e) => {
245
- const t = r.find((n) => n.value === e);
246
- se(e), i((t == null ? void 0 : t.label) ?? ""), c(!1);
247
- }, Ie = (e) => {
248
- k == null || k(e), c(!1);
249
- }, Re = (e) => {
250
- g || (i(e), !d && e.length > 0 && !w.current && c(!0));
253
+ h || (i(e), !d && e.length > 0 && !R.current && l(!0));
254
+ }, Re = () => {
255
+ !k && !h && l(!0);
251
256
  }, we = () => {
252
- !q && !g && c(!0);
253
- }, _e = () => {
254
- w.current = !0;
255
- }, Ee = () => {
256
- var t;
257
- if (w.current = !1, g) return;
258
- const e = ((t = _.current) == null ? void 0 : t.value) ?? "";
259
- i(e), e.length > 0 && c(!0);
257
+ R.current = !0;
258
+ }, Ie = () => {
259
+ var s;
260
+ if (R.current = !1, h) return;
261
+ const e = ((s = w.current) == null ? void 0 : s.value) ?? "";
262
+ i(e), e.length > 0 && l(!0);
263
+ }, _e = (e) => {
264
+ e.nativeEvent.isComposing || e.key === "Escape" && d && (e.preventDefault(), l(!1), i(C));
265
+ }, Ee = (e) => {
266
+ var s;
267
+ e.preventDefault(), e.stopPropagation(), Z(""), i(""), l(!0), (s = w.current) == null || s.focus();
260
268
  }, Fe = (e) => {
261
- e.nativeEvent.isComposing || e.key === "Escape" && d && (e.preventDefault(), c(!1), i(S));
262
- }, De = (e) => {
263
- var t;
264
- e.preventDefault(), e.stopPropagation(), se(""), i(""), c(!0), (t = _.current) == null || t.focus();
265
- }, Pe = (e) => {
266
- g && e || (c(e), e || i(S));
267
- }, oe = v(f);
268
- E(() => {
269
- oe.current = f;
269
+ h && e || (l(e), e || i(C));
270
+ }, ee = g(m);
271
+ I(() => {
272
+ ee.current = m;
273
+ }, [m]);
274
+ const te = g(f);
275
+ I(() => {
276
+ te.current = f;
270
277
  }, [f]);
271
- const ne = v(p);
272
- E(() => {
273
- ne.current = p;
274
- }, [p]);
275
- const re = v(d);
276
- E(() => {
277
- re.current = d;
278
+ const se = g(d);
279
+ I(() => {
280
+ se.current = d;
278
281
  }, [d]);
279
- const B = Ve(
282
+ const O = $e(
280
283
  (e) => {
281
- R || Y(e), m == null || m(e);
284
+ S || X(e), u == null || u(e);
282
285
  },
283
- [R, m]
284
- ), je = M(
286
+ [S, u]
287
+ ), Ve = U(
285
288
  () => ({
286
- getValue: () => oe.current || null,
287
- getQuery: () => ne.current,
288
- getIsOpen: () => re.current,
289
+ getValue: () => ee.current || null,
290
+ getQuery: () => te.current,
291
+ getIsOpen: () => se.current,
289
292
  setValue: (e) => {
290
- const t = e ?? "";
291
- z || O(t), l == null || l(t);
292
- const n = r.find((b) => b.value === t);
293
+ const s = e ?? "";
294
+ z(s);
295
+ const n = r.find((p) => p.value === s);
293
296
  i((n == null ? void 0 : n.label) ?? "");
294
297
  },
295
298
  setQuery: (e) => {
296
299
  i(e);
297
300
  },
298
301
  clear: () => {
299
- z || O(""), l == null || l(""), i("");
302
+ z(""), i("");
300
303
  },
301
- open: () => B(!0),
302
- close: () => B(!1)
304
+ open: () => O(!0),
305
+ close: () => O(!1)
303
306
  }),
304
- [l, z, r, B]
307
+ [z, r, O]
305
308
  );
306
- Xe(Ye, je, T);
307
- const Ae = A && !!f && !q && !g, Te = Le(r), U = rt[x];
308
- return /* @__PURE__ */ o(F.Root, { open: d, onOpenChange: Pe, children: /* @__PURE__ */ I(
309
- u,
309
+ Ke(Je, Ve, j);
310
+ const De = P && !!m && !k && !h, Pe = Ge(r), q = nt[v];
311
+ return /* @__PURE__ */ o(_.Root, { open: d, onOpenChange: Fe, children: /* @__PURE__ */ N(
312
+ c,
310
313
  {
311
- filter: ze,
314
+ filter: Ce,
312
315
  shouldFilter: !0,
313
316
  loop: !0,
314
- label: J ?? te,
317
+ label: K ?? Y,
315
318
  className: "ds:w-full",
316
319
  children: [
317
- /* @__PURE__ */ o(F.Anchor, { asChild: !0, children: /* @__PURE__ */ I(
320
+ /* @__PURE__ */ o(_.Anchor, { asChild: !0, children: /* @__PURE__ */ N(
318
321
  "div",
319
322
  {
320
- ref: Z,
321
- className: et({
322
- size: x,
323
- tone: Ce,
324
- className: be
323
+ ref: W,
324
+ className: Ze({
325
+ size: v,
326
+ tone: xe,
327
+ className: fe
325
328
  }),
326
329
  "data-component": "combobox",
327
- "data-component-id": T,
330
+ "data-component-id": j,
328
331
  children: [
329
332
  /* @__PURE__ */ o(
330
- u.Input,
333
+ c.Input,
331
334
  {
332
- ref: Me(he, _),
333
- value: p,
334
- onValueChange: Re,
335
- id: ye,
336
- name: ue,
337
- placeholder: te,
338
- disabled: q,
339
- readOnly: g,
340
- required: xe,
341
- "aria-describedby": Ne,
342
- "aria-invalid": ee || void 0,
343
- onFocus: we,
344
- onKeyDown: Fe,
345
- onCompositionStart: _e,
346
- onCompositionEnd: Ee,
347
- className: Ze({ size: x })
335
+ ref: He(pe, w),
336
+ value: f,
337
+ onValueChange: Se,
338
+ id: ge,
339
+ name: le,
340
+ placeholder: Y,
341
+ disabled: k,
342
+ readOnly: h,
343
+ required: ve,
344
+ "aria-describedby": ye,
345
+ "aria-invalid": J || void 0,
346
+ onFocus: Re,
347
+ onKeyDown: _e,
348
+ onCompositionStart: we,
349
+ onCompositionEnd: Ie,
350
+ className: Ye({ size: v })
348
351
  }
349
352
  ),
350
- Ae ? /* @__PURE__ */ o(
353
+ De ? /* @__PURE__ */ o(
351
354
  "button",
352
355
  {
353
356
  type: "button",
354
- "aria-label": C("inputs.combobox.clear", "Clear selection"),
355
- onClick: De,
357
+ "aria-label": x("inputs.combobox.clear", "Clear selection"),
358
+ onClick: Ee,
356
359
  onPointerDown: (e) => e.stopPropagation(),
357
360
  className: [
358
361
  "ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]",
@@ -362,48 +365,48 @@ const ie = $e(
362
365
  "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
363
366
  "ds:size-4"
364
367
  ].join(" "),
365
- children: /* @__PURE__ */ o(We, { "aria-hidden": "true", className: "ds:size-3.5" })
368
+ children: /* @__PURE__ */ o(Xe, { "aria-hidden": "true", className: "ds:size-3.5" })
366
369
  }
367
370
  ) : null
368
371
  ]
369
372
  }
370
373
  ) }),
371
- /* @__PURE__ */ o(F.Portal, { forceMount: !0, children: /* @__PURE__ */ o(
372
- F.Content,
374
+ /* @__PURE__ */ o(_.Portal, { forceMount: !0, children: /* @__PURE__ */ o(
375
+ _.Content,
373
376
  {
374
377
  forceMount: !0,
375
378
  hidden: !d,
376
- "aria-label": J ?? C("inputs.combobox.popupLabel", "Options"),
379
+ "aria-label": K ?? x("inputs.combobox.popupLabel", "Options"),
377
380
  onOpenAutoFocus: (e) => e.preventDefault(),
378
381
  onCloseAutoFocus: (e) => e.preventDefault(),
379
382
  onInteractOutside: (e) => {
380
383
  var n;
381
- const t = e.target;
382
- t && ((n = Z.current) != null && n.contains(t)) && e.preventDefault();
384
+ const s = e.target;
385
+ s && ((n = W.current) != null && n.contains(s)) && e.preventDefault();
383
386
  },
384
387
  sideOffset: 4,
385
388
  align: "start",
386
- className: tt(),
387
- children: /* @__PURE__ */ I(u.List, { className: ot, children: [
388
- /* @__PURE__ */ o(u.Empty, { className: nt, children: pe ?? C("inputs.combobox.empty", "No results found") }),
389
- Te.map(({ group: e, items: t }, n) => {
390
- const b = t.map((a) => {
391
- const H = a.value === f;
392
- return /* @__PURE__ */ I(
393
- u.Item,
389
+ className: et(),
390
+ children: /* @__PURE__ */ N(c.List, { className: st, children: [
391
+ /* @__PURE__ */ o(c.Empty, { className: ot, children: me ?? x("inputs.combobox.empty", "No results found") }),
392
+ Pe.map(({ group: e, items: s }, n) => {
393
+ const p = s.map((a) => {
394
+ const B = a.value === m;
395
+ return /* @__PURE__ */ N(
396
+ c.Item,
394
397
  {
395
398
  value: a.value,
396
399
  keywords: [a.label],
397
400
  disabled: a.disabled,
398
- onSelect: Se,
399
- className: ae({ size: x }),
401
+ onSelect: Ne,
402
+ className: ne({ size: v }),
400
403
  children: [
401
404
  /* @__PURE__ */ o(
402
405
  "span",
403
406
  {
404
407
  "aria-hidden": "true",
405
- className: `ds:inline-flex ds:items-center ds:justify-center ${U}`,
406
- children: H ? /* @__PURE__ */ o(Je, { className: U }) : null
408
+ className: `ds:inline-flex ds:items-center ds:justify-center ${q}`,
409
+ children: B ? /* @__PURE__ */ o(We, { className: q }) : null
407
410
  }
408
411
  ),
409
412
  /* @__PURE__ */ o("span", { className: "ds:flex-1 ds:truncate", children: a.label }),
@@ -414,24 +417,24 @@ const ie = $e(
414
417
  );
415
418
  });
416
419
  return e ? /* @__PURE__ */ o(
417
- u.Group,
420
+ c.Group,
418
421
  {
419
- heading: /* @__PURE__ */ o("span", { className: st, children: e }),
420
- children: b
422
+ heading: /* @__PURE__ */ o("span", { className: tt, children: e }),
423
+ children: p
421
424
  },
422
425
  `group-${e}`
423
- ) : /* @__PURE__ */ o(u.Group, { children: b }, `group-${n}`);
426
+ ) : /* @__PURE__ */ o(c.Group, { children: p }, `group-${n}`);
424
427
  }),
425
- fe && p.length > 0 ? /* @__PURE__ */ o(
426
- at,
428
+ ue && f.length > 0 ? /* @__PURE__ */ o(
429
+ rt,
427
430
  {
428
- search: p,
429
- label: C("inputs.combobox.create", 'Create "{{value}}"', {
430
- value: p
431
+ search: f,
432
+ label: x("inputs.combobox.create", 'Create "{{value}}"', {
433
+ value: f
431
434
  }),
432
- iconClass: U,
433
- size: x,
434
- onSelect: Ie
435
+ iconClass: q,
436
+ size: v,
437
+ onSelect: ze
435
438
  }
436
439
  ) : null
437
440
  ] })
@@ -442,14 +445,14 @@ const ie = $e(
442
445
  ) });
443
446
  }
444
447
  );
445
- ie.displayName = "Combobox";
446
- const xt = ie;
448
+ re.displayName = "Combobox";
449
+ const yt = re;
447
450
  export {
448
- xt as C,
449
- tt as a,
450
- Ze as b,
451
- Ye as c,
452
- ae as d,
453
- et as e
451
+ yt as C,
452
+ et as a,
453
+ Ye as b,
454
+ Je as c,
455
+ ne as d,
456
+ Ze as e
454
457
  };
455
- //# sourceMappingURL=combobox-D5tWe0t_.js.map
458
+ //# sourceMappingURL=combobox-Da9eq00i.js.map