@alfadocs/ui-kit 1.90.0 → 1.90.2

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 (97) hide show
  1. package/dist/_chunks/address-autocomplete-DR4Xn23Z.js +519 -0
  2. package/dist/_chunks/{address-fields-CfnXK8RT.js → address-fields-qxQkGwPf.js} +5 -5
  3. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js → ai-permission-notice-VNh3W57L.js} +2 -2
  4. package/dist/_chunks/{anamnesis-summary-rows-DUMERHK3.js → anamnesis-summary-rows-EKPfVCmh.js} +662 -654
  5. package/dist/_chunks/autocomplete-BXMcNoa3.js +562 -0
  6. package/dist/_chunks/{balance-badge-cell-C9-hyfxy.js → balance-badge-cell-D9VhFp0L.js} +3 -3
  7. package/dist/_chunks/{booking-C0FoW8Yx.js → booking-CcE_oviI.js} +1896 -1859
  8. package/dist/_chunks/browser-D5CD3WOj.js +565 -0
  9. package/dist/_chunks/{calendar-appointment-editor-dialog-D8Wkbm8_.js → calendar-appointment-editor-dialog-CiAGAX2t.js} +7 -7
  10. package/dist/_chunks/{checkbox-BjDv-r3o.js → checkbox-a7Sh-dXb.js} +32 -31
  11. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js → checkbox-group-eGdv9fZc.js} +2 -2
  12. package/dist/_chunks/{city-input-CJVGswxp.js → city-input-CA59CjnV.js} +2 -2
  13. package/dist/_chunks/{combobox-CDPm_n0p.js → combobox-D-gpgEDy.js} +314 -294
  14. package/dist/_chunks/{country-select-DQ8q7ypA.js → country-select-BfmX9y5i.js} +2 -2
  15. package/dist/_chunks/{data-table-D7EGpqOn.js → data-table-CqQgoNsU.js} +553 -552
  16. package/dist/_chunks/{face-scheme-BgJGFDTa.js → face-scheme-BKSE98bo.js} +2 -2
  17. package/dist/_chunks/{file-manager-DQbWBTfk.js → file-manager-BnI1ZWZu.js} +2 -2
  18. package/dist/_chunks/{header-settings-BVhjndtV.js → header-settings-BeA2fnol.js} +24 -23
  19. package/dist/_chunks/{heatmap-BJB6V9yJ.js → heatmap-fCxwNz2o.js} +2 -2
  20. package/dist/_chunks/index-CpVcVNBu.js +2326 -0
  21. package/dist/_chunks/{index.es-Bpb8_NrX.js → index.es-Beo-XicE.js} +2 -2
  22. package/dist/_chunks/jspdf.es.min-BW7y6yhl.js +9674 -0
  23. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js → link-cell-renderer-CnCgudvq.js} +3 -3
  24. package/dist/_chunks/{login-dev-card-DYwbL5sD.js → login-dev-card-BZBR58mu.js} +2 -2
  25. package/dist/_chunks/{map-view-Bvi06RVh.js → map-view-UrNgxBy3.js} +260 -237
  26. package/dist/_chunks/{index.modern-BeRXQVdc.js → maps-core-gate-DkNqGkm3.js} +360 -319
  27. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js → marketplace-app-shell-CmZx0Oam.js} +2 -2
  28. package/dist/_chunks/{notes-panel-CZO1qsD-.js → notes-panel-Dywo6R55.js} +2 -2
  29. package/dist/_chunks/{patient-details-D0P5eog5.js → patient-details-BUr7Oemx.js} +2 -2
  30. package/dist/_chunks/{patient-field-row-R73dZJY6.js → patient-field-row-bJk8Q_qr.js} +5 -5
  31. package/dist/_chunks/patient-search-Ca9j5cWb.js +1306 -0
  32. package/dist/_chunks/{patient-summary-card-6U74-ivO.js → patient-summary-card-CCQZ8X37.js} +2 -2
  33. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js → periodontal-diagnosis-DD3hrg9X.js} +2 -2
  34. package/dist/_chunks/{permission-matrix-BoQjENGV.js → permission-matrix-BJ6sg3Zp.js} +3 -3
  35. package/dist/_chunks/{practice-results-B61krlwu.js → practice-results-DQuOfqej.js} +2 -2
  36. package/dist/_chunks/{province-select-CPdTwEob.js → province-select-D64whw0m.js} +2 -2
  37. package/dist/_chunks/{registration-form-DmP3YUfp.js → registration-form-CRm6DaB9.js} +2 -2
  38. package/dist/_chunks/{reviews-panel-UzQQLb-z.js → reviews-panel-B7InBORU.js} +42 -41
  39. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js → rich-text-editor-BfEu57dk.js} +3 -3
  40. package/dist/_chunks/{slot-grid-Bb13H9Rl.js → slot-grid-DrwynKeN.js} +91 -89
  41. package/dist/_chunks/{task-editor-BOETWbjU.js → task-editor-CI1SKUNc.js} +2 -2
  42. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js → use-appointment-details-read-BytPq3Ux.js} +2 -2
  43. package/dist/_chunks/{voice-control-panel-BziKE-KK.js → voice-control-panel-BP0otrID.js} +2 -2
  44. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js → workflow-webhook-action-B_nBJ_ht.js} +2 -2
  45. package/dist/agent-catalog.json +2 -2
  46. package/dist/agent-i18n/en.json +1 -1
  47. package/dist/components/_shared/maps-core-gate.d.ts +18 -0
  48. package/dist/components/address-autocomplete/index.js +1 -1
  49. package/dist/components/address-fields/index.js +1 -1
  50. package/dist/components/ai-permission-notice/index.js +1 -1
  51. package/dist/components/appointment-details-panel/index.js +1 -1
  52. package/dist/components/autocomplete/index.js +1 -1
  53. package/dist/components/booking/index.js +1 -1
  54. package/dist/components/checkbox/index.js +1 -1
  55. package/dist/components/checkbox-group/index.js +1 -1
  56. package/dist/components/city-input/index.js +1 -1
  57. package/dist/components/combobox/index.js +1 -1
  58. package/dist/components/country-select/index.js +1 -1
  59. package/dist/components/data-table/index.js +2 -2
  60. package/dist/components/data-table/xlsx-export.d.ts +13 -0
  61. package/dist/components/face-scheme/index.js +1 -1
  62. package/dist/components/file-manager/index.js +1 -1
  63. package/dist/components/header-settings/header-settings.d.ts +2 -1
  64. package/dist/components/header-settings/index.js +1 -1
  65. package/dist/components/heatmap/index.js +1 -1
  66. package/dist/components/map-view/index.js +1 -1
  67. package/dist/components/notes-panel/index.js +1 -1
  68. package/dist/components/patient-details/index.js +1 -1
  69. package/dist/components/patient-search/index.js +1 -1
  70. package/dist/components/patient-summary-card/index.js +1 -1
  71. package/dist/components/patient-table/index.js +1 -1
  72. package/dist/components/periodontal-diagnosis/index.js +1 -1
  73. package/dist/components/permission-matrix/index.js +1 -1
  74. package/dist/components/practice-results/index.js +1 -1
  75. package/dist/components/province-select/index.js +1 -1
  76. package/dist/components/reviews-panel/index.js +1 -1
  77. package/dist/components/rich-text-editor/index.js +1 -1
  78. package/dist/components/slot-grid/index.js +1 -1
  79. package/dist/components/task-editor/index.js +1 -1
  80. package/dist/components/voice-control-panel/index.js +1 -1
  81. package/dist/host-compat.css +1 -10
  82. package/dist/index.js +37 -37
  83. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +1 -1
  84. package/dist/patterns/anamnesis/anamnesis-export.d.ts +3 -1
  85. package/dist/patterns/anamnesis/index.js +1 -1
  86. package/dist/patterns/calendar/index.js +1 -1
  87. package/dist/patterns/login-form/index.js +1 -1
  88. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  89. package/dist/patterns/registration-form/index.js +1 -1
  90. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  91. package/dist/tokens.css +1 -1
  92. package/package.json +4 -8
  93. package/dist/_chunks/address-autocomplete-bPR2mNBt.js +0 -498
  94. package/dist/_chunks/autocomplete-CnB1mHGc.js +0 -539
  95. package/dist/_chunks/exceljs.min-D2MHbJsF.js +0 -23046
  96. package/dist/_chunks/jspdf.es.min-Cal6Nuw_.js +0 -10007
  97. package/dist/_chunks/patient-search-CCOUZABE.js +0 -1196
@@ -1,539 +0,0 @@
1
- import { jsx as s, jsxs as N } from "react/jsx-runtime";
2
- import { forwardRef as tt, useId as st, useState as $, useRef as p, useCallback as D, useEffect as I, useMemo as X } from "react";
3
- import { _ as g } from "./index-4xgbg-sn.js";
4
- import * as F from "@radix-ui/react-popover";
5
- import { c as T } from "./index-D2ZczOXr.js";
6
- import { useTranslation as nt } from "react-i18next";
7
- import { S as fe } from "./spinner-CoflYlEx.js";
8
- import { u as at, b as ot } from "./form-field-context-DtiROUJV.js";
9
- import { u as rt } from "./use-controllable-state-BiY4xTzM.js";
10
- import { u as it } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
11
- import { g as lt } from "./group-options-BvKhQ3xb.js";
12
- import { b as dt } from "./menu-row-BAr8bx1I.js";
13
- import { I as ut, a as J, b as Y, c as ct } from "./input-surface-iBmxVBfr.js";
14
- import { u as pt } from "./registry-DvAUVLHh.js";
15
- import { u as mt } from "./use-debounced-callback-BisrB-Fq.js";
16
- const ft = {
17
- id: "autocomplete",
18
- capabilities: ["select_single", "filter", "open", "close"],
19
- state: {
20
- value: {
21
- type: "string | null",
22
- descriptionKey: "ui.agent.autocomplete.state.value",
23
- description: "Currently-selected option value, or null when nothing is committed.",
24
- read: (n) => n.getValue()
25
- },
26
- query: {
27
- type: "string",
28
- descriptionKey: "ui.agent.autocomplete.state.query",
29
- description: "Current free-text query in the input.",
30
- read: (n) => n.getQuery()
31
- },
32
- isOpen: {
33
- type: "boolean",
34
- descriptionKey: "ui.agent.autocomplete.state.isOpen",
35
- description: "True when the suggestion list is visible.",
36
- read: (n) => n.getIsOpen()
37
- }
38
- },
39
- actions: {
40
- set_value: {
41
- safety: "write",
42
- argsType: "{ value: string | null }",
43
- argsSchema: {
44
- type: "object",
45
- properties: { value: { type: ["string", "null"] } },
46
- required: ["value"]
47
- },
48
- idempotent: !0,
49
- descriptionKey: "ui.agent.autocomplete.actions.setValue",
50
- description: "Set the committed value programmatically.",
51
- invoke: (n, d) => {
52
- n.setValue(d.value);
53
- }
54
- },
55
- apply_filter: {
56
- safety: "read",
57
- argsType: "{ query: string }",
58
- argsSchema: {
59
- type: "object",
60
- properties: { query: { type: "string" } },
61
- required: ["query"]
62
- },
63
- idempotent: !0,
64
- descriptionKey: "ui.agent.autocomplete.actions.applyFilter",
65
- description: "Set the input query, which filters the suggestion list.",
66
- invoke: (n, d) => {
67
- n.setQuery(d.query);
68
- }
69
- },
70
- clear: {
71
- safety: "destructive",
72
- idempotent: !0,
73
- descriptionKey: "ui.agent.autocomplete.actions.clear",
74
- description: "Clear the committed value and the query. Discards the typed input.",
75
- invoke: (n) => {
76
- n.clear();
77
- }
78
- },
79
- open: {
80
- safety: "read",
81
- idempotent: !0,
82
- descriptionKey: "ui.agent.autocomplete.actions.open",
83
- description: "Open the suggestion list.",
84
- invoke: (n) => {
85
- n.open();
86
- }
87
- },
88
- close: {
89
- safety: "read",
90
- idempotent: !0,
91
- descriptionKey: "ui.agent.autocomplete.actions.close",
92
- description: "Close the suggestion list.",
93
- invoke: (n) => {
94
- n.close();
95
- }
96
- }
97
- },
98
- domHooks: {
99
- root: { attr: "data-component", value: "autocomplete" },
100
- instanceId: {
101
- attr: "data-component-id",
102
- sourceProp: "id",
103
- description: "Sourced from the id prop."
104
- },
105
- item: {
106
- attr: "data-option-id",
107
- description: "Each suggestion emits its value as data-option-id."
108
- }
109
- }
110
- }, gt = T(
111
- ["ds:flex ds:w-full ds:items-center", ct].join(" "),
112
- {
113
- variants: {
114
- size: {
115
- sm: `${J.sm} ${Y.sm}`,
116
- md: `${J.md} ${Y.md}`,
117
- lg: `${J.lg} ${Y.lg}`
118
- },
119
- tone: ut
120
- },
121
- defaultVariants: { size: "md", tone: "default" }
122
- }
123
- ), ht = T(
124
- [
125
- "ds:flex-1 ds:min-w-0 ds:bg-transparent ds:text-foreground",
126
- "ds:placeholder:text-muted-foreground",
127
- "ds:outline-none ds:focus:outline-none ds:focus-visible:outline-none",
128
- "ds:disabled:cursor-not-allowed",
129
- "ds:read-only:cursor-default"
130
- ].join(" "),
131
- {
132
- variants: {
133
- hasStart: { true: "ds:ps-2", false: "ds:ps-3" },
134
- hasEnd: { true: "ds:pe-2", false: "ds:pe-3" }
135
- },
136
- defaultVariants: { hasStart: !1, hasEnd: !1 }
137
- }
138
- ), vt = T(
139
- [
140
- "ds:z-[var(--z-dropdown)] ds:overflow-hidden",
141
- "ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-background",
142
- "ds:shadow-[var(--shadow-md)]",
143
- "ds:w-[var(--radix-popover-trigger-width)]",
144
- "ds:animate-in ds:fade-in ds:zoom-in-95",
145
- "ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out",
146
- "ds:data-[state=closed]:zoom-out-95",
147
- "ds:motion-reduce:animate-none"
148
- ].join(" ")
149
- ), ge = T(
150
- [
151
- "ds:relative ds:flex ds:items-center ds:gap-[var(--spacing-sm)]",
152
- "ds:ps-3 ds:pe-3 ds:py-2 ds:text-[length:var(--font-size-sm)] ds:text-foreground",
153
- "ds:rounded-[var(--radius-sm)] ds:select-none ds:cursor-pointer",
154
- "ds:data-[disabled=true]:pointer-events-none ds:data-[disabled=true]:opacity-50",
155
- // cmdk moves the selection on pointer move, so hover needs no tint.
156
- dt.selected
157
- ].join(" ")
158
- ), he = [
159
- "ds:[&_[cmdk-group-heading]]:ps-3",
160
- "ds:[&_[cmdk-group-heading]]:pe-3",
161
- "ds:[&_[cmdk-group-heading]]:py-1.5",
162
- "ds:[&_[cmdk-group-heading]]:type-eyebrow",
163
- "ds:[&_[cmdk-group-heading]]:text-muted-foreground"
164
- ].join(" "), Z = "ds:inline-flex ds:items-center ds:shrink-0 ds:text-muted-foreground ds:[&_svg]:size-4";
165
- function ee(n, d, B) {
166
- return `${n}-${d}-${B}`;
167
- }
168
- function ve(n, d) {
169
- return `${n}:${d}`;
170
- }
171
- const bt = tt(
172
- function({
173
- loadOptions: d,
174
- debounceMs: B = 250,
175
- value: be,
176
- defaultValue: ye,
177
- onChange: we,
178
- onSelect: u,
179
- recents: y,
180
- onRecentSelect: M,
181
- snapOnBlur: Ce = !1,
182
- size: xe = "md",
183
- tone: ke = "default",
184
- startAdornment: q,
185
- endAdornment: K,
186
- placeholder: P,
187
- disabled: Ne,
188
- readOnly: w,
189
- required: Re,
190
- name: Ve,
191
- id: j,
192
- className: Ie,
193
- "aria-label": z,
194
- "aria-invalid": Ee,
195
- "aria-describedby": _e,
196
- autoComplete: U
197
- }, R) {
198
- const { t: h, i18n: Ae } = nt("ui"), c = at(), $e = st(), v = j ?? c.id ?? $e, te = `${v}-listbox`, De = `${v}-live`, b = !!(c.disabled || Ne), Fe = !!(c.required || Re), se = c.invalid || !!Ee, Te = se ? "error" : ke ?? "default", Be = c.describedBy || _e || void 0, [Me, ne] = rt({
199
- value: be,
200
- defaultValue: ye ?? "",
201
- onChange: we
202
- }), r = Me ?? "", [i, l] = $(!1), [C, ae] = $([]), [V, H] = $(!1), [m, qe] = $(""), E = p(!1), L = p(null), O = p(r), oe = p(/* @__PURE__ */ new Map()), re = p(/* @__PURE__ */ new Map()), x = p(null), G = p(null);
203
- ot(c, x);
204
- const S = U && U !== "off" ? U : void 0;
205
- it(() => {
206
- var e;
207
- S && ((e = x.current) == null || e.setAttribute("autocomplete", S));
208
- });
209
- const Ke = D(
210
- (e) => {
211
- x.current = e, typeof R == "function" ? R(e) : R && (R.current = e);
212
- },
213
- [R]
214
- ), ie = Ae.language;
215
- I(() => {
216
- const e = /* @__PURE__ */ new Map();
217
- for (const t of C) e.set(t.value, t);
218
- oe.current = e;
219
- }, [C]), I(() => {
220
- const e = /* @__PURE__ */ new Map();
221
- if (y) for (const t of y) e.set(t.value, t);
222
- re.current = e;
223
- }, [y]);
224
- const Pe = D(
225
- (e) => {
226
- var o;
227
- if (b || w || E.current) return;
228
- (o = L.current) == null || o.abort();
229
- const t = new AbortController();
230
- L.current = t, O.current = e, H(!0), d(e, { signal: t.signal, locale: ie }).then((a) => {
231
- t.signal.aborted || O.current === e && (ae(a), H(!1));
232
- }).catch((a) => {
233
- t.signal.aborted || a && typeof a == "object" && "name" in a && a.name === "AbortError" || O.current === e && (ae([]), H(!1));
234
- });
235
- },
236
- [b, w, d, ie]
237
- ), k = mt(Pe, B);
238
- I(() => () => {
239
- var e;
240
- k.cancel(), (e = L.current) == null || e.abort();
241
- }, [k]);
242
- const f = D(
243
- (e) => {
244
- ne(e);
245
- },
246
- [ne]
247
- ), le = D(
248
- (e) => {
249
- const [t, o] = e.split(":");
250
- if (!o || t !== "recent" && t !== "option") return null;
251
- const me = (t === "recent" ? re.current : oe.current).get(o);
252
- return me ? { kind: t, option: me } : null;
253
- },
254
- []
255
- ), je = (e) => {
256
- f(e), !(b || w) && (S && document.activeElement !== x.current || (i || l(!0), !E.current && k(e)));
257
- }, ze = (e) => {
258
- E.current = !0;
259
- }, Ue = (e) => {
260
- E.current = !1;
261
- const t = e.currentTarget.value;
262
- k(t);
263
- }, He = (e) => {
264
- b || w || (l(!0), r && k(r));
265
- }, Le = (e) => {
266
- const t = e.relatedTarget;
267
- if (!(t && G.current && G.current.contains(t))) {
268
- if (Ce && m) {
269
- const o = le(m);
270
- o && (f(o.option.label), u == null || u(o.option));
271
- }
272
- l(!1);
273
- }
274
- }, Oe = (e) => {
275
- if (!e.nativeEvent.isComposing) {
276
- if (e.key === "Escape") {
277
- i && (e.preventDefault(), e.stopPropagation(), l(!1));
278
- return;
279
- }
280
- if (e.key === "ArrowDown" && !i) {
281
- e.preventDefault(), l(!0), r && k(r);
282
- return;
283
- }
284
- if (e.key === "Tab" && i && m) {
285
- const t = le(m);
286
- t && (f(t.option.label), u == null || u(t.option), l(!1));
287
- }
288
- }
289
- }, de = (e, t) => {
290
- var o;
291
- f(t.label), e === "recent" ? M == null || M(t) : u == null || u(t), l(!1), (o = x.current) == null || o.focus();
292
- }, Q = (e) => {
293
- e.preventDefault();
294
- }, _ = !!(y && y.length > 0) && r.length === 0, Ge = X(
295
- () => lt(C),
296
- [C]
297
- ), Se = !!q, Qe = !!K || V, We = gt({
298
- size: xe,
299
- tone: Te,
300
- className: Ie
301
- }), Xe = X(() => {
302
- if (!m) return;
303
- const [e, t] = m.split(":");
304
- if (!(!t || e !== "recent" && e !== "option"))
305
- return ee(v, e, t);
306
- }, [m, v]), A = C.length > 0, ue = !_ && !A && !V && r.length > 0, ce = V && !A, Je = _ || A || ue || ce, W = p(r);
307
- I(() => {
308
- W.current = r;
309
- }, [r]);
310
- const pe = p(i);
311
- I(() => {
312
- pe.current = i;
313
- }, [i]);
314
- const Ye = X(
315
- () => ({
316
- getValue: () => W.current || null,
317
- getQuery: () => W.current,
318
- getIsOpen: () => pe.current,
319
- setValue: (e) => {
320
- f(e ?? "");
321
- },
322
- setQuery: (e) => {
323
- f(e);
324
- },
325
- clear: () => {
326
- f("");
327
- },
328
- open: () => {
329
- l(!0);
330
- },
331
- close: () => {
332
- l(!1);
333
- }
334
- }),
335
- [f]
336
- );
337
- pt(ft, Ye, j);
338
- const Ze = C.length, et = V ? h("common.loading", "Loading…") : i && r.length > 0 ? h("inputs.autocomplete.results", {
339
- count: Ze,
340
- defaultValue: "{{count}} results"
341
- }) : "";
342
- return /* @__PURE__ */ s(
343
- g,
344
- {
345
- shouldFilter: !1,
346
- value: m,
347
- onValueChange: qe,
348
- label: z ?? (c.label || P),
349
- className: "ds:w-full",
350
- children: /* @__PURE__ */ N(
351
- F.Root,
352
- {
353
- open: i && !b && !w && Je,
354
- children: [
355
- /* @__PURE__ */ s(F.Anchor, { asChild: !0, children: /* @__PURE__ */ N(
356
- "div",
357
- {
358
- className: We,
359
- "data-component": "autocomplete",
360
- "data-component-id": j,
361
- "data-disabled": b || void 0,
362
- children: [
363
- q ? /* @__PURE__ */ s("span", { "aria-hidden": "true", className: `${Z} ds:ps-3`, children: q }) : null,
364
- /* @__PURE__ */ s(
365
- g.Input,
366
- {
367
- ref: Ke,
368
- id: v,
369
- name: Ve,
370
- placeholder: P,
371
- value: r,
372
- onValueChange: je,
373
- onFocus: He,
374
- onBlur: Le,
375
- onKeyDown: Oe,
376
- onCompositionStart: ze,
377
- onCompositionEnd: Ue,
378
- disabled: b,
379
- readOnly: w,
380
- required: Fe,
381
- role: "combobox",
382
- "aria-autocomplete": "both",
383
- "aria-expanded": i,
384
- "aria-controls": i ? te : void 0,
385
- "aria-activedescendant": Xe,
386
- "aria-describedby": Be,
387
- "aria-invalid": se || void 0,
388
- "aria-label": z ?? (c.label || h("inputs.autocomplete.ariaLabel")),
389
- autoComplete: "off",
390
- className: ht({ hasStart: Se, hasEnd: Qe })
391
- }
392
- ),
393
- V ? /* @__PURE__ */ s("span", { className: `${Z} ds:pe-3`, "aria-hidden": "true", children: /* @__PURE__ */ s(fe, { variant: "pulse", size: "sm" }) }) : K ? /* @__PURE__ */ s("span", { "aria-hidden": "true", className: `${Z} ds:pe-3`, children: K }) : null,
394
- /* @__PURE__ */ s(
395
- "span",
396
- {
397
- id: De,
398
- role: "status",
399
- "aria-live": "polite",
400
- "aria-atomic": "true",
401
- className: "ds:sr-only",
402
- children: et
403
- }
404
- )
405
- ]
406
- }
407
- ) }),
408
- /* @__PURE__ */ s(F.Portal, { forceMount: !0, children: /* @__PURE__ */ s(
409
- F.Content,
410
- {
411
- ref: G,
412
- forceMount: !0,
413
- hidden: !i,
414
- side: "bottom",
415
- align: "start",
416
- sideOffset: 4,
417
- onOpenAutoFocus: (e) => e.preventDefault(),
418
- onCloseAutoFocus: (e) => e.preventDefault(),
419
- onPointerDownOutside: (e) => {
420
- var o;
421
- const t = e.target;
422
- if (t && ((o = x.current) != null && o.contains(t))) {
423
- e.preventDefault();
424
- return;
425
- }
426
- l(!1);
427
- },
428
- onEscapeKeyDown: () => l(!1),
429
- onMouseDown: Q,
430
- className: vt(),
431
- children: /* @__PURE__ */ N(
432
- g.List,
433
- {
434
- id: te,
435
- label: z ?? (c.label || P || h("inputs.autocomplete.ariaLabel")),
436
- className: "ds:max-h-[min(24rem,var(--radix-popover-content-available-height))] ds:overflow-auto ds:p-1",
437
- children: [
438
- _ ? /* @__PURE__ */ s(
439
- g.Group,
440
- {
441
- heading: h("inputs.autocomplete.recent", "Recent"),
442
- className: he,
443
- children: (y ?? []).map((e) => /* @__PURE__ */ N(
444
- g.Item,
445
- {
446
- id: ee(v, "recent", e.value),
447
- "data-option-id": e.value,
448
- value: ve("recent", e.value),
449
- disabled: e.disabled,
450
- onSelect: () => de("recent", e),
451
- onMouseDown: Q,
452
- className: ge(),
453
- children: [
454
- e.startAdornment ? /* @__PURE__ */ s(
455
- "span",
456
- {
457
- "aria-hidden": "true",
458
- className: "ds:inline-flex ds:items-center ds:shrink-0",
459
- children: e.startAdornment
460
- }
461
- ) : null,
462
- /* @__PURE__ */ s("span", { className: "ds:flex-1 ds:truncate", children: e.label }),
463
- e.endContent ? (
464
- // Deliberately NOT aria-hidden — unlike
465
- // `startAdornment`, this slot carries meaning
466
- // and must reach the option's accessible name.
467
- /* @__PURE__ */ s("span", { className: "ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0", children: e.endContent })
468
- ) : null
469
- ]
470
- },
471
- `recent-${e.value}`
472
- ))
473
- }
474
- ) : null,
475
- ue ? /* @__PURE__ */ s("div", { className: "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", children: h("inputs.autocomplete.noResults", "No results") }) : null,
476
- ce ? /* @__PURE__ */ N("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground", children: [
477
- /* @__PURE__ */ s(fe, { variant: "pulse", size: "sm" }),
478
- /* @__PURE__ */ s("span", { children: h("common.loading", "Loading…") })
479
- ] }) : null,
480
- !_ && A ? Ge.map((e, t) => {
481
- const o = e.items.map((a) => /* @__PURE__ */ N(
482
- g.Item,
483
- {
484
- id: ee(v, "option", a.value),
485
- "data-option-id": a.value,
486
- value: ve("option", a.value),
487
- disabled: a.disabled,
488
- onSelect: () => de("option", a),
489
- onMouseDown: Q,
490
- className: ge(),
491
- children: [
492
- a.startAdornment ? /* @__PURE__ */ s(
493
- "span",
494
- {
495
- "aria-hidden": "true",
496
- className: "ds:inline-flex ds:items-center ds:shrink-0",
497
- children: a.startAdornment
498
- }
499
- ) : null,
500
- /* @__PURE__ */ s("span", { className: "ds:flex-1 ds:truncate", children: a.label }),
501
- a.endContent ? (
502
- // Deliberately NOT aria-hidden — unlike
503
- // `startAdornment`, this slot carries meaning
504
- // and must reach the option's accessible name.
505
- /* @__PURE__ */ s("span", { className: "ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0", children: a.endContent })
506
- ) : null
507
- ]
508
- },
509
- `option-${a.value}`
510
- ));
511
- return e.group ? /* @__PURE__ */ s(
512
- g.Group,
513
- {
514
- heading: e.group,
515
- className: he,
516
- children: o
517
- },
518
- `group-${e.group}`
519
- ) : /* @__PURE__ */ s(g.Group, { children: o }, `group-${t}`);
520
- }) : null
521
- ]
522
- }
523
- )
524
- }
525
- ) })
526
- ]
527
- }
528
- )
529
- }
530
- );
531
- }
532
- ), yt = bt;
533
- yt.displayName = "Autocomplete";
534
- export {
535
- yt as A,
536
- ft as a,
537
- gt as b
538
- };
539
- //# sourceMappingURL=autocomplete-CnB1mHGc.js.map