@alfadocs/ui-kit 1.90.1 → 1.91.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) 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/{agenda-card-BDuvreCe.js → agenda-card-BhY342MA.js} +2 -2
  4. package/dist/_chunks/{agenda-tray-D-jvptdo.js → agenda-tray-BmxBGEci.js} +2 -2
  5. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js → ai-permission-notice-VNh3W57L.js} +2 -2
  6. package/dist/_chunks/{alia-sidebar-CsTRAxC8.js → alia-sidebar-ovRX_oti.js} +3 -3
  7. package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js → anamnesis-summary-rows-EKPfVCmh.js} +2 -2
  8. package/dist/_chunks/{appointment-card-5JMWi9_f.js → appointment-card-Bstc1p7a.js} +2 -2
  9. package/dist/_chunks/{appointment-peek-39BwVMUf.js → appointment-peek-C0kKqnFk.js} +2 -2
  10. package/dist/_chunks/{appointment-timeline-1-Za2miy.js → appointment-timeline-rbt9AwHO.js} +2 -2
  11. package/dist/_chunks/{appointment-tray-Dwc8MSIQ.js → appointment-tray-6zd8RLIL.js} +2 -2
  12. package/dist/_chunks/autocomplete-BXMcNoa3.js +562 -0
  13. package/dist/_chunks/{avatar-BPiPL7ND.js → avatar-a6042Ox2.js} +52 -52
  14. package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js → balance-badge-cell-BtJvre1-.js} +3 -3
  15. package/dist/_chunks/booking-opt_h7Uc.js +4590 -0
  16. package/dist/_chunks/{calendar-ClB-jWH1.js → calendar-CmiMS4FJ.js} +2 -2
  17. package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js → calendar-appointment-editor-dialog-sJKLoVJ2.js} +11 -11
  18. package/dist/_chunks/{care-plan-card-BYCPNDvA.js → care-plan-card-DD9rEWYN.js} +2 -2
  19. package/dist/_chunks/{care-plan-header-BzsAg6oY.js → care-plan-header-CXUJQt8Q.js} +2 -2
  20. package/dist/_chunks/{chat-message-CmFJdEre.js → chat-message-LRO_6Ee3.js} +2 -2
  21. package/dist/_chunks/{checkbox-BjDv-r3o.js → checkbox-a7Sh-dXb.js} +32 -31
  22. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js → checkbox-group-eGdv9fZc.js} +2 -2
  23. package/dist/_chunks/{city-input-CJVGswxp.js → city-input-CA59CjnV.js} +2 -2
  24. package/dist/_chunks/{clinical-note-card-Caidqcwa.js → clinical-note-card-Cut2lNmu.js} +3 -3
  25. package/dist/_chunks/{combobox-CDPm_n0p.js → combobox-D-gpgEDy.js} +314 -294
  26. package/dist/_chunks/{contact-card-Czu60UvU.js → contact-card-ClvEDM9e.js} +2 -2
  27. package/dist/_chunks/{contact-profile-card-Da1vmJQI.js → contact-profile-card-CX45mZA3.js} +106 -95
  28. package/dist/_chunks/{country-select-DQ8q7ypA.js → country-select-BfmX9y5i.js} +2 -2
  29. package/dist/_chunks/{data-table-B_IcS0Ke.js → data-table-CqQgoNsU.js} +2 -2
  30. package/dist/_chunks/{dependent-selector-C4kOgO8b.js → dependent-selector-CyNi7M_f.js} +2 -2
  31. package/dist/_chunks/{entity-summary-BLxzSSXK.js → entity-summary-B_bOloqP.js} +3 -3
  32. package/dist/_chunks/error-page-B0fGNTRB.js +419 -0
  33. package/dist/_chunks/{face-scheme-BgJGFDTa.js → face-scheme-BKSE98bo.js} +2 -2
  34. package/dist/_chunks/{file-manager-C9YOT-Dn.js → file-manager-BnI1ZWZu.js} +2 -2
  35. package/dist/_chunks/{header-settings-BVhjndtV.js → header-settings-BeA2fnol.js} +24 -23
  36. package/dist/_chunks/{heatmap-HTz3Jvzy.js → heatmap-fCxwNz2o.js} +2 -2
  37. package/dist/_chunks/{languages-CZqBaPwI.js → languages-CGLX6Qpe.js} +3 -15
  38. package/dist/_chunks/link-DtCfnLnF.js +332 -0
  39. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js → link-cell-renderer-BS3V4LA6.js} +4 -4
  40. package/dist/_chunks/{login-dev-card-DYwbL5sD.js → login-dev-card-BZBR58mu.js} +2 -2
  41. package/dist/_chunks/{map-view-Bvi06RVh.js → map-view-UrNgxBy3.js} +260 -237
  42. package/dist/_chunks/{index.modern-BeRXQVdc.js → maps-core-gate-DkNqGkm3.js} +360 -319
  43. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js → marketplace-app-shell-CJQtx3sv.js} +3 -3
  44. package/dist/_chunks/{message-card-CvCnCssc.js → message-card-B6SduXJv.js} +2 -2
  45. package/dist/_chunks/{message-tray-IJYvy6Cf.js → message-tray-Cllf-v0G.js} +2 -2
  46. package/dist/_chunks/{nav-grid-Oc4aCPrg.js → nav-grid-D2xVcHTO.js} +2 -2
  47. package/dist/_chunks/{note-attachment-DIlIQ7JF.js → note-attachment-cnj2JRrg.js} +2 -2
  48. package/dist/_chunks/{note-timeline-KzL52MmB.js → note-timeline-BrjHBQfx.js} +2 -2
  49. package/dist/_chunks/{notes-panel-CZO1qsD-.js → notes-panel-ib7I3aNf.js} +3 -3
  50. package/dist/_chunks/{operator-hero-6aAIQaFZ.js → operator-hero-C_5B-8Qp.js} +43 -41
  51. package/dist/_chunks/{patient-details-D0P5eog5.js → patient-details-BjcUpD9S.js} +3 -3
  52. package/dist/_chunks/{patient-field-row-R73dZJY6.js → patient-field-row-B0tdiaWi.js} +6 -6
  53. package/dist/_chunks/patient-search-Ca9j5cWb.js +1306 -0
  54. package/dist/_chunks/{patient-summary-card-6U74-ivO.js → patient-summary-card-Cvv6_Ugk.js} +4 -4
  55. package/dist/_chunks/{payment-request-card-MndSlVoK.js → payment-request-card-BfGauFY0.js} +2 -2
  56. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js → periodontal-diagnosis-DD3hrg9X.js} +2 -2
  57. package/dist/_chunks/{permission-matrix-BoQjENGV.js → permission-matrix-BJ6sg3Zp.js} +3 -3
  58. package/dist/_chunks/{practice-profile-hero-qfrsFQI_.js → practice-profile-hero-ClzE-4CB.js} +76 -73
  59. package/dist/_chunks/{practice-results-B61krlwu.js → practice-results-CQ_KvEXK.js} +517 -514
  60. package/dist/_chunks/{product-hub-panel-Blag8t8f.js → product-hub-panel-bHi7lkVD.js} +2 -2
  61. package/dist/_chunks/{province-select-CPdTwEob.js → province-select-D64whw0m.js} +2 -2
  62. package/dist/_chunks/public-footer-IoRWoAMz.js +596 -0
  63. package/dist/_chunks/{registration-form-DmP3YUfp.js → registration-form-CRm6DaB9.js} +2 -2
  64. package/dist/_chunks/{reviews-panel-UzQQLb-z.js → reviews-panel-B7InBORU.js} +42 -41
  65. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js → rich-text-editor-BfEu57dk.js} +3 -3
  66. package/dist/_chunks/{signature-request-DjY-X62H.js → signature-request-DvhyrRpn.js} +3 -3
  67. package/dist/_chunks/{signed-out-frame-G-3ATOdu.js → signed-out-frame-CgRXOUzi.js} +2 -2
  68. package/dist/_chunks/{slot-grid-Bb13H9Rl.js → slot-grid-B-IAFX3C.js} +183 -170
  69. package/dist/_chunks/{task-editor-BOETWbjU.js → task-editor-CI1SKUNc.js} +2 -2
  70. package/dist/_chunks/{timeline-wUuTDFY_.js → timeline-BcYHdP56.js} +2 -2
  71. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js → use-appointment-details-read-D8vDg0sg.js} +5 -5
  72. package/dist/_chunks/{voice-control-panel-BziKE-KK.js → voice-control-panel-BP0otrID.js} +2 -2
  73. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js → workflow-webhook-action-B_nBJ_ht.js} +2 -2
  74. package/dist/agent-catalog.json +3 -3
  75. package/dist/agent-i18n/en.json +1 -1
  76. package/dist/components/_shared/maps-core-gate.d.ts +18 -0
  77. package/dist/components/_shared/social-brand-icons.d.ts +29 -0
  78. package/dist/components/address-autocomplete/index.js +1 -1
  79. package/dist/components/address-fields/index.js +1 -1
  80. package/dist/components/agenda-card/index.js +1 -1
  81. package/dist/components/agenda-tray/index.js +1 -1
  82. package/dist/components/ai-permission-notice/index.js +1 -1
  83. package/dist/components/appointment-card/index.js +2 -2
  84. package/dist/components/appointment-details-panel/index.js +1 -1
  85. package/dist/components/appointment-peek/index.js +1 -1
  86. package/dist/components/appointment-timeline/index.js +1 -1
  87. package/dist/components/autocomplete/index.js +1 -1
  88. package/dist/components/avatar/avatar.d.ts +14 -0
  89. package/dist/components/avatar/index.js +1 -1
  90. package/dist/components/booking/booking-types.d.ts +26 -0
  91. package/dist/components/booking/index.js +1 -1
  92. package/dist/components/booking/slot-load-state.d.ts +11 -0
  93. package/dist/components/calendar/index.js +1 -1
  94. package/dist/components/care-plan-card/index.js +1 -1
  95. package/dist/components/care-plan-header/index.js +1 -1
  96. package/dist/components/chat-message/index.js +1 -1
  97. package/dist/components/checkbox/index.js +1 -1
  98. package/dist/components/checkbox-group/index.js +1 -1
  99. package/dist/components/city-input/index.js +1 -1
  100. package/dist/components/clinical-note-card/index.js +1 -1
  101. package/dist/components/combobox/index.js +1 -1
  102. package/dist/components/contact-card/index.js +1 -1
  103. package/dist/components/contact-profile-card/index.js +1 -1
  104. package/dist/components/country-select/index.js +1 -1
  105. package/dist/components/data-table/index.js +2 -2
  106. package/dist/components/dependent-selector/index.js +1 -1
  107. package/dist/components/entity-summary/index.js +1 -1
  108. package/dist/components/face-scheme/index.js +1 -1
  109. package/dist/components/file-manager/index.js +1 -1
  110. package/dist/components/header-settings/header-settings.d.ts +2 -1
  111. package/dist/components/header-settings/index.js +1 -1
  112. package/dist/components/heatmap/index.js +1 -1
  113. package/dist/components/link/index.js +1 -1
  114. package/dist/components/link/link.d.ts +10 -1
  115. package/dist/components/link/social-url.d.ts +71 -0
  116. package/dist/components/map-view/index.js +1 -1
  117. package/dist/components/message-card/index.js +1 -1
  118. package/dist/components/message-tray/index.js +1 -1
  119. package/dist/components/nav-grid/index.js +1 -1
  120. package/dist/components/note-timeline/index.js +1 -1
  121. package/dist/components/notes-panel/index.js +1 -1
  122. package/dist/components/operator-hero/index.js +1 -1
  123. package/dist/components/operator-hero/operator-hero.d.ts +6 -0
  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-summary-card/index.js +1 -1
  127. package/dist/components/patient-table/index.js +1 -1
  128. package/dist/components/payment-card/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-profile-hero/index.js +1 -1
  132. package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +6 -0
  133. package/dist/components/practice-results/index.js +1 -1
  134. package/dist/components/practice-results/practice-results.d.ts +8 -2
  135. package/dist/components/product-hub-tray/index.js +1 -1
  136. package/dist/components/province-select/index.js +1 -1
  137. package/dist/components/public-footer/index.js +1 -1
  138. package/dist/components/public-footer/public-footer.d.ts +13 -1
  139. package/dist/components/public-footer/socials.d.ts +6 -5
  140. package/dist/components/reviews-panel/index.js +1 -1
  141. package/dist/components/rich-text-editor/index.js +1 -1
  142. package/dist/components/slot-grid/index.js +1 -1
  143. package/dist/components/slot-grid/slot-grid.d.ts +2 -0
  144. package/dist/components/task-editor/index.js +1 -1
  145. package/dist/components/timeline/index.js +1 -1
  146. package/dist/components/voice-control-panel/index.js +1 -1
  147. package/dist/host-compat.css +1 -10
  148. package/dist/i18n/config.js +224 -96
  149. package/dist/i18n/locales/ar.d.ts +3 -0
  150. package/dist/i18n/locales/ar.js +4 -1
  151. package/dist/i18n/locales/de.d.ts +3 -0
  152. package/dist/i18n/locales/de.js +4 -1
  153. package/dist/i18n/locales/el.d.ts +3 -0
  154. package/dist/i18n/locales/el.js +4 -1
  155. package/dist/i18n/locales/en.d.ts +3 -0
  156. package/dist/i18n/locales/en.js +3 -0
  157. package/dist/i18n/locales/es.d.ts +3 -0
  158. package/dist/i18n/locales/es.js +4 -1
  159. package/dist/i18n/locales/fr.d.ts +3 -0
  160. package/dist/i18n/locales/fr.js +4 -1
  161. package/dist/i18n/locales/hi.d.ts +3 -0
  162. package/dist/i18n/locales/hi.js +4 -1
  163. package/dist/i18n/locales/it.d.ts +3 -0
  164. package/dist/i18n/locales/it.js +4 -1
  165. package/dist/i18n/locales/ja.d.ts +3 -0
  166. package/dist/i18n/locales/ja.js +4 -1
  167. package/dist/i18n/locales/nl.d.ts +3 -0
  168. package/dist/i18n/locales/nl.js +4 -1
  169. package/dist/i18n/locales/pl.d.ts +3 -0
  170. package/dist/i18n/locales/pl.js +4 -1
  171. package/dist/i18n/locales/pt.d.ts +3 -0
  172. package/dist/i18n/locales/pt.js +4 -1
  173. package/dist/i18n/locales/ro.d.ts +3 -0
  174. package/dist/i18n/locales/ro.js +4 -1
  175. package/dist/i18n/locales/ru.d.ts +3 -0
  176. package/dist/i18n/locales/ru.js +4 -1
  177. package/dist/i18n/locales/sq.d.ts +3 -0
  178. package/dist/i18n/locales/sq.js +4 -1
  179. package/dist/i18n/locales/sv.d.ts +3 -0
  180. package/dist/i18n/locales/sv.js +4 -1
  181. package/dist/i18n/locales/tr.d.ts +3 -0
  182. package/dist/i18n/locales/tr.js +4 -1
  183. package/dist/i18n/locales/zh.d.ts +3 -0
  184. package/dist/i18n/locales/zh.js +4 -1
  185. package/dist/index.js +68 -68
  186. package/dist/locales/ar.json +4 -1
  187. package/dist/locales/de.json +4 -1
  188. package/dist/locales/el.json +4 -1
  189. package/dist/locales/en.json +3 -0
  190. package/dist/locales/es.json +4 -1
  191. package/dist/locales/fr.json +4 -1
  192. package/dist/locales/hi.json +4 -1
  193. package/dist/locales/it.json +4 -1
  194. package/dist/locales/ja.json +4 -1
  195. package/dist/locales/nl.json +4 -1
  196. package/dist/locales/pl.json +4 -1
  197. package/dist/locales/pt.json +4 -1
  198. package/dist/locales/ro.json +4 -1
  199. package/dist/locales/ru.json +4 -1
  200. package/dist/locales/sq.json +4 -1
  201. package/dist/locales/sv.json +4 -1
  202. package/dist/locales/tr.json +4 -1
  203. package/dist/locales/zh.json +4 -1
  204. package/dist/patterns/alia-assistant/index.js +1 -1
  205. package/dist/patterns/anamnesis/index.js +1 -1
  206. package/dist/patterns/calendar/index.js +1 -1
  207. package/dist/patterns/error-page/error-page-english.d.ts +71 -0
  208. package/dist/patterns/error-page/index.js +1 -1
  209. package/dist/patterns/login-form/index.js +1 -1
  210. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  211. package/dist/patterns/registration-form/index.js +1 -1
  212. package/dist/patterns/signature-request/index.js +1 -1
  213. package/dist/patterns/signed-out-frame/index.js +1 -1
  214. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  215. package/dist/tokens.css +1 -1
  216. package/package.json +1 -1
  217. package/dist/_chunks/address-autocomplete-bPR2mNBt.js +0 -498
  218. package/dist/_chunks/autocomplete-CnB1mHGc.js +0 -539
  219. package/dist/_chunks/booking-C0FoW8Yx.js +0 -4336
  220. package/dist/_chunks/error-page-Bhai-spN.js +0 -344
  221. package/dist/_chunks/link-N5_YpLtm.js +0 -138
  222. package/dist/_chunks/patient-search-CCOUZABE.js +0 -1196
  223. package/dist/_chunks/public-footer-CXOrdAaS.js +0 -568
@@ -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