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