@alfadocs/ui-kit 1.137.0 → 1.139.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 (244) hide show
  1. package/dist/_chunks/{address-fields-DvSWdeR0.js → address-fields-Bh9JZJHZ.js} +4 -4
  2. package/dist/_chunks/{ai-prompt-input-CVNeusoW.js → ai-prompt-input-B2QFwuJ1.js} +2 -2
  3. package/dist/_chunks/{anamnesis-summary-rows-Dr2V1Rtf.js → anamnesis-summary-rows-BgfBnjp0.js} +4 -4
  4. package/dist/_chunks/{appointment-card-BT1cMZIX.js → appointment-card-CaxFXtSn.js} +196 -184
  5. package/dist/_chunks/{appointment-timeline-Dy4YQJ17.js → appointment-timeline-BEwgbYyG.js} +113 -110
  6. package/dist/_chunks/{appointment-tray-B3gSHL1j.js → appointment-tray-DPpeR9JT.js} +8 -8
  7. package/dist/_chunks/{audio-recorder-BOF5YYoC.js → audio-recorder-6dUq8I38.js} +2 -2
  8. package/dist/_chunks/autocomplete-HZNW7_Pa.js +642 -0
  9. package/dist/_chunks/{balance-badge-cell-BSB02Bwo.js → balance-badge-cell-CRrIv2hy.js} +4 -4
  10. package/dist/_chunks/{bill-line-table-By-YL2ms.js → bill-line-table-DCqxhode.js} +3 -3
  11. package/dist/_chunks/{bishop-score-DWGESRP9.js → bishop-score-M7Fi-ykx.js} +2 -2
  12. package/dist/_chunks/{calendar-appointment-editor-dialog-D0n_bVsT.js → calendar-appointment-editor-dialog-GdnaPIOV.js} +537 -536
  13. package/dist/_chunks/{calendar-editor-discard-host-1UfmMOEb.js → calendar-editor-discard-host-BcMEgVEq.js} +3 -3
  14. package/dist/_chunks/{calendar-waiting-list-panel-Ckd6tSeu.js → calendar-waiting-list-panel-CkZBAv_E.js} +4 -4
  15. package/dist/_chunks/{calendar-workspace.model-DrOoxY1b.js → calendar-workspace.model-B8yPwuBv.js} +2 -2
  16. package/dist/_chunks/{calendar.sheets-Datc0-IT.js → calendar.sheets-B0jP2Yt0.js} +113 -112
  17. package/dist/_chunks/{calls-panel-BIfatK90.js → calls-panel-CtxJAzkJ.js} +2 -2
  18. package/dist/_chunks/{city-input-DXipzTfZ.js → city-input-DARVDJhH.js} +2 -2
  19. package/dist/_chunks/{combobox-BBCVQS-S.js → combobox-BYl6mY4c.js} +12 -13
  20. package/dist/_chunks/{communications-panel-SQ-55e3V.js → communications-panel-DBWM9II9.js} +2 -2
  21. package/dist/_chunks/{country-select-C2GdvRtS.js → country-select-BPISkYVU.js} +3 -3
  22. package/dist/_chunks/{data-grid-CxKz8flO.js → data-grid-bQ6iFm10.js} +15 -7
  23. package/dist/_chunks/{data-table-_tgj0C_T.js → data-table-CnLfOwxg.js} +2 -2
  24. package/dist/_chunks/{default-tabs-oDWQzbN7.js → default-tabs-Dm_vk6hd.js} +3 -3
  25. package/dist/_chunks/{document-preview-CirR3C_m.js → document-preview-FTCHXYhk.js} +2 -2
  26. package/dist/_chunks/{face-scheme-D_Y1StPl.js → face-scheme-Bxt7ZnJn.js} +2 -2
  27. package/dist/_chunks/{file-manager-CEi4z2i0.js → file-manager-Bsccb8Jj.js} +2 -2
  28. package/dist/_chunks/{forgot-password-form-YvI9vX-G.js → forgot-password-form-B4ufmBFn.js} +5 -4
  29. package/dist/_chunks/{gestational-age-calculator-CHbpC4vL.js → gestational-age-calculator-DXSPWG8u.js} +2 -2
  30. package/dist/_chunks/{heatmap-_546qI2V.js → heatmap-CFPaEKD_.js} +2 -2
  31. package/dist/_chunks/{invoice-upload-list-CQI9MUl6.js → invoice-upload-list-Dz3CXHPP.js} +3 -3
  32. package/dist/_chunks/{kit-extensions-BNBf4m8O.js → kit-extensions-BB_ksnVl.js} +3 -3
  33. package/dist/_chunks/{link-cell-renderer-Xx5T8u5Q.js → link-cell-renderer-CSA0KKPe.js} +5 -5
  34. package/dist/_chunks/{login-dev-card-Dz3ezx1o.js → login-dev-card-oRh9h7N2.js} +18 -17
  35. package/dist/_chunks/medication-I6QvOq6k.js +21 -0
  36. package/dist/_chunks/medication-line-CHdlh-F7.js +222 -0
  37. package/dist/_chunks/medication-search-DoEDakoM.js +380 -0
  38. package/dist/_chunks/{multi-select-Df3R8lv_.js → multi-select-DeMiHm8T.js} +4 -5
  39. package/dist/_chunks/{muscle-scheme-D_rSyGDj.js → muscle-scheme-BB2eBfww.js} +2 -2
  40. package/dist/_chunks/normalize-diacritics-DhJjQ3Bp.js +7 -0
  41. package/dist/_chunks/{notes-panel-DsEKNtsw.js → notes-panel-CnmQqhwq.js} +2 -2
  42. package/dist/_chunks/{optical-prescription-DaSbsh4p.js → optical-prescription-C4jpDFOE.js} +2 -2
  43. package/dist/_chunks/{option-row-Dc7BrbK8.js → option-row-DpCnuUqo.js} +25 -12
  44. package/dist/_chunks/{patient-account-settings-COybehKx.js → patient-account-settings-DfEPHmCh.js} +3 -3
  45. package/dist/_chunks/{patient-check-in-resume-DZnyYDKH.js → patient-check-in-resume-TWs8CPQr.js} +5 -5
  46. package/dist/_chunks/{patient-details-Dv7EiTCo.js → patient-details-DQTxSWY4.js} +2 -2
  47. package/dist/_chunks/{patient-field-row-DuHWGlLz.js → patient-field-row-CXuWQeQJ.js} +6 -6
  48. package/dist/_chunks/patient-picker-CQNsqYn2.js +163 -0
  49. package/dist/_chunks/{patient-search-DBvLFArV.js → patient-search-aTFd7p9s.js} +2 -2
  50. package/dist/_chunks/{patient-summary-card-D-cDzOim.js → patient-summary-card-j5u7c5Us.js} +2 -2
  51. package/dist/_chunks/{phone-input-BL8Sj6OG.js → phone-input-DRKcJUi4.js} +2 -2
  52. package/dist/_chunks/{portal-details-DdzvroYP.js → portal-details-VfeOI4PB.js} +3 -3
  53. package/dist/_chunks/{portal-documents-CNmoYWFc.js → portal-documents-hGHlwmbv.js} +3 -3
  54. package/dist/_chunks/{portal-parts-Br8wuala.js → portal-parts-C99CreYO.js} +2 -2
  55. package/dist/_chunks/{pregnancy-dating-lJbzai73.js → pregnancy-dating-C-3NLI6K.js} +2 -2
  56. package/dist/_chunks/prescription-history-748qDVwZ.js +1544 -0
  57. package/dist/_chunks/print-sheet-CSeqkM3_.js +318 -0
  58. package/dist/_chunks/{province-select-CTM8A9SM.js → province-select-D-iY9bQG.js} +3 -3
  59. package/dist/_chunks/{registration-form-CuLiTA52.js → registration-form-Cs9o6e5q.js} +7 -6
  60. package/dist/_chunks/{reserved.agent-CabZHFJC.js → reserved.agent-L2ElYPuj.js} +7 -7
  61. package/dist/_chunks/{reset-password-form-D_TePSM1.js → reset-password-form-DwtSNhnA.js} +18 -17
  62. package/dist/_chunks/{rich-text-editor-C48omVjq.js → rich-text-editor-DFsH5RAj.js} +2 -2
  63. package/dist/_chunks/save-Dn8uje3f.js +22 -0
  64. package/dist/_chunks/{search-bar-CQ9_V3EJ.js → search-bar-k1mS5yZl.js} +2 -2
  65. package/dist/_chunks/{select-CIXKyUMw.js → select-Bm8s3q-X.js} +16 -17
  66. package/dist/_chunks/{send-registration-link-form-BjkXr0TD.js → send-registration-link-form-C1vw6H1M.js} +6 -5
  67. package/dist/_chunks/{signature-request-vJDSHZld.js → signature-request-D3sLLOM6.js} +2 -2
  68. package/dist/_chunks/sync-tray-BhnkgXKK.js +567 -0
  69. package/dist/_chunks/{tabs-Czkmw5ou.js → tabs-BXr5XeGq.js} +2 -2
  70. package/dist/_chunks/{task-editor-wKbFbGqW.js → task-editor-DDVDPKJf.js} +26 -25
  71. package/dist/_chunks/{tasks-panel-DbtJS4QI.js → tasks-panel-BHXaPNOZ.js} +2 -2
  72. package/dist/_chunks/{toolbar-DjG-cpD_.js → toolbar-Dz_hAUIZ.js} +2 -2
  73. package/dist/_chunks/{unit-converter-CUAUTu2B.js → unit-converter-CBy7S4Tl.js} +2 -2
  74. package/dist/_chunks/{use-appointment-details-read-jGkJalX8.js → use-appointment-details-read-CBSpX4DI.js} +2 -2
  75. package/dist/_chunks/use-error-summary-CecJZo6w.js +32 -0
  76. package/dist/_chunks/use-registration-submit-CVukOAQk.js +84 -0
  77. package/dist/_chunks/{variables-menu-DQl8H4Gh.js → variables-menu-C4NcClKi.js} +2 -2
  78. package/dist/_chunks/{voice-control-panel-Cp4vs1iy.js → voice-control-panel-Dc_NFH2R.js} +2 -2
  79. package/dist/agent-catalog.json +456 -2
  80. package/dist/agent-i18n/en.json +53 -0
  81. package/dist/appointment-editor-panel/index.js +2 -2
  82. package/dist/booking-tools-data/index.js +1 -1
  83. package/dist/browser-support.js +1 -1
  84. package/dist/calendar-action-buttons/index.js +1 -1
  85. package/dist/components/_shared/medication.d.ts +28 -0
  86. package/dist/components/_shared/normalize-diacritics.d.ts +5 -0
  87. package/dist/components/_shared/patient-picker.d.ts +7 -0
  88. package/dist/components/address-fields/index.js +1 -1
  89. package/dist/components/ai-prompt-input/index.js +1 -1
  90. package/dist/components/appointment-card/appointment-card.d.ts +5 -2
  91. package/dist/components/appointment-card/index.js +2 -2
  92. package/dist/components/appointment-details-panel/index.js +1 -1
  93. package/dist/components/appointment-timeline/appointment-timeline.d.ts +6 -0
  94. package/dist/components/appointment-timeline/index.js +1 -1
  95. package/dist/components/audio-recorder/index.js +1 -1
  96. package/dist/components/autocomplete/autocomplete.d.ts +50 -0
  97. package/dist/components/autocomplete/index.d.ts +1 -1
  98. package/dist/components/autocomplete/index.js +1 -1
  99. package/dist/components/bill-line-table/index.js +1 -1
  100. package/dist/components/bill-table/index.js +1 -1
  101. package/dist/components/bishop-score/index.js +1 -1
  102. package/dist/components/booking/index.js +1 -1
  103. package/dist/components/calls-panel/index.js +1 -1
  104. package/dist/components/city-input/index.js +1 -1
  105. package/dist/components/combobox/index.js +1 -1
  106. package/dist/components/communications-panel/index.js +1 -1
  107. package/dist/components/country-select/index.js +1 -1
  108. package/dist/components/data-grid/index.js +2 -2
  109. package/dist/components/data-table/index.js +2 -2
  110. package/dist/components/document-preview/index.js +1 -1
  111. package/dist/components/face-scheme/index.js +1 -1
  112. package/dist/components/file-manager/index.js +1 -1
  113. package/dist/components/gestational-age-calculator/index.js +1 -1
  114. package/dist/components/heatmap/index.js +1 -1
  115. package/dist/components/index.d.ts +5 -0
  116. package/dist/components/invoice-upload-list/index.js +1 -1
  117. package/dist/components/medication-line/index.d.ts +6 -0
  118. package/dist/components/medication-line/index.js +7 -0
  119. package/dist/components/medication-line/medication-line.agent.d.ts +14 -0
  120. package/dist/components/medication-line/medication-line.d.ts +40 -0
  121. package/dist/components/medication-search/index.d.ts +6 -0
  122. package/dist/components/medication-search/index.js +10 -0
  123. package/dist/components/medication-search/medication-search.agent.d.ts +15 -0
  124. package/dist/components/medication-search/medication-search.d.ts +49 -0
  125. package/dist/components/multi-select/index.js +1 -1
  126. package/dist/components/muscle-scheme/index.js +1 -1
  127. package/dist/components/notes-panel/index.js +1 -1
  128. package/dist/components/optical-prescription/index.js +1 -1
  129. package/dist/components/patient-details/index.js +1 -1
  130. package/dist/components/patient-search/index.js +1 -1
  131. package/dist/components/patient-summary-card/index.js +1 -1
  132. package/dist/components/patient-table/index.js +1 -1
  133. package/dist/components/phone-input/index.js +1 -1
  134. package/dist/components/pregnancy-dating/index.js +1 -1
  135. package/dist/components/print-sheet/index.d.ts +5 -0
  136. package/dist/components/print-sheet/index.js +6 -0
  137. package/dist/components/print-sheet/print-isolation.d.ts +17 -0
  138. package/dist/components/print-sheet/print-sheet.agent.d.ts +19 -0
  139. package/dist/components/print-sheet/print-sheet.d.ts +54 -0
  140. package/dist/components/province-select/index.js +1 -1
  141. package/dist/components/rich-text-editor/index.js +2 -2
  142. package/dist/components/search-bar/index.js +1 -1
  143. package/dist/components/select/index.js +1 -1
  144. package/dist/components/skeleton-scheme/index.js +1 -1
  145. package/dist/components/sync-tray/index.d.ts +4 -0
  146. package/dist/components/sync-tray/index.js +7 -0
  147. package/dist/components/sync-tray/sync-tray.agent.d.ts +15 -0
  148. package/dist/components/sync-tray/sync-tray.d.ts +77 -0
  149. package/dist/components/tabs/index.js +1 -1
  150. package/dist/components/task-editor/index.js +1 -1
  151. package/dist/components/tasks-panel/index.js +1 -1
  152. package/dist/components/unit-converter/index.js +1 -1
  153. package/dist/components/variables-menu/index.js +1 -1
  154. package/dist/components/voice-control-panel/index.js +1 -1
  155. package/dist/core.css +1 -1
  156. package/dist/find-free-slots-panel/index.js +1 -1
  157. package/dist/host-compat.css +13 -1
  158. package/dist/host-legacy.css +16 -0
  159. package/dist/i18n/locales/ar.d.ts +134 -1
  160. package/dist/i18n/locales/ar.js +134 -1
  161. package/dist/i18n/locales/de.d.ts +134 -1
  162. package/dist/i18n/locales/de.js +134 -1
  163. package/dist/i18n/locales/el.d.ts +134 -1
  164. package/dist/i18n/locales/el.js +134 -1
  165. package/dist/i18n/locales/en.d.ts +134 -1
  166. package/dist/i18n/locales/en.js +134 -1
  167. package/dist/i18n/locales/es.d.ts +134 -1
  168. package/dist/i18n/locales/es.js +134 -1
  169. package/dist/i18n/locales/fr.d.ts +134 -1
  170. package/dist/i18n/locales/fr.js +134 -1
  171. package/dist/i18n/locales/hi.d.ts +134 -1
  172. package/dist/i18n/locales/hi.js +134 -1
  173. package/dist/i18n/locales/it.d.ts +134 -1
  174. package/dist/i18n/locales/it.js +134 -1
  175. package/dist/i18n/locales/ja.d.ts +134 -1
  176. package/dist/i18n/locales/ja.js +134 -1
  177. package/dist/i18n/locales/nl.d.ts +134 -1
  178. package/dist/i18n/locales/nl.js +134 -1
  179. package/dist/i18n/locales/pl.d.ts +134 -1
  180. package/dist/i18n/locales/pl.js +134 -1
  181. package/dist/i18n/locales/pt.d.ts +134 -1
  182. package/dist/i18n/locales/pt.js +134 -1
  183. package/dist/i18n/locales/ro.d.ts +134 -1
  184. package/dist/i18n/locales/ro.js +134 -1
  185. package/dist/i18n/locales/ru.d.ts +134 -1
  186. package/dist/i18n/locales/ru.js +134 -1
  187. package/dist/i18n/locales/sq.d.ts +134 -1
  188. package/dist/i18n/locales/sq.js +134 -1
  189. package/dist/i18n/locales/sv.d.ts +134 -1
  190. package/dist/i18n/locales/sv.js +134 -1
  191. package/dist/i18n/locales/tr.d.ts +134 -1
  192. package/dist/i18n/locales/tr.js +134 -1
  193. package/dist/i18n/locales/zh.d.ts +134 -1
  194. package/dist/i18n/locales/zh.js +134 -1
  195. package/dist/index.js +1004 -976
  196. package/dist/locales/ar.json +134 -1
  197. package/dist/locales/de.json +134 -1
  198. package/dist/locales/el.json +134 -1
  199. package/dist/locales/en.json +134 -1
  200. package/dist/locales/es.json +134 -1
  201. package/dist/locales/fr.json +134 -1
  202. package/dist/locales/hi.json +134 -1
  203. package/dist/locales/it.json +134 -1
  204. package/dist/locales/ja.json +134 -1
  205. package/dist/locales/nl.json +134 -1
  206. package/dist/locales/pl.json +134 -1
  207. package/dist/locales/pt.json +134 -1
  208. package/dist/locales/ro.json +134 -1
  209. package/dist/locales/ru.json +134 -1
  210. package/dist/locales/sq.json +134 -1
  211. package/dist/locales/sv.json +134 -1
  212. package/dist/locales/tr.json +134 -1
  213. package/dist/locales/zh.json +134 -1
  214. package/dist/online-bookings-panel/index.js +2 -2
  215. package/dist/patterns/anamnesis/index.js +1 -1
  216. package/dist/patterns/calendar/index.js +4 -4
  217. package/dist/patterns/forgot-password-form/index.js +1 -1
  218. package/dist/patterns/login-form/index.js +1 -1
  219. package/dist/patterns/patient-account-settings/index.js +1 -1
  220. package/dist/patterns/patient-check-in/index.js +1 -1
  221. package/dist/patterns/patient-portal/index.js +2 -2
  222. package/dist/patterns/prescription/index.d.ts +11 -0
  223. package/dist/patterns/prescription/index.js +13 -0
  224. package/dist/patterns/prescription/prescription-composer-errors.d.ts +6 -0
  225. package/dist/patterns/prescription/prescription-composer-item.d.ts +34 -0
  226. package/dist/patterns/prescription/prescription-composer.d.ts +89 -0
  227. package/dist/patterns/prescription/prescription-history.d.ts +48 -0
  228. package/dist/patterns/prescription/prescription-patient-block.d.ts +13 -0
  229. package/dist/patterns/prescription/prescription-sheet.d.ts +52 -0
  230. package/dist/patterns/prescription/prescription-status-badge.d.ts +5 -0
  231. package/dist/patterns/prescription/prescription-types.d.ts +97 -0
  232. package/dist/patterns/prescription/prescription-validation.d.ts +40 -0
  233. package/dist/patterns/registration-form/index.js +1 -1
  234. package/dist/patterns/reset-password-form/index.js +1 -1
  235. package/dist/patterns/send-registration-link-form/index.js +1 -1
  236. package/dist/patterns/signature-request/index.js +1 -1
  237. package/dist/tokens.css +1 -1
  238. package/dist/waiting-list-panel/index.js +2 -2
  239. package/package.json +21 -1
  240. package/dist/_chunks/autocomplete-D10ydpgi.js +0 -562
  241. package/dist/_chunks/group-options-BvKhQ3xb.js +0 -16
  242. package/dist/_chunks/normalize-diacritics-BNGbFNlJ.js +0 -7
  243. package/dist/_chunks/patient-picker-BZJuOgMw.js +0 -173
  244. package/dist/_chunks/use-registration-submit-CLGHxwoT.js +0 -112
@@ -1,173 +0,0 @@
1
- import { c as w } from "./createLucideIcon-DhHxpK9K.js";
2
- import { jsx as r, jsxs as M } from "react/jsx-runtime";
3
- import { useState as h, useRef as S, useEffect as D } from "react";
4
- import { useTranslation as E } from "react-i18next";
5
- import { C as Q } from "./combobox-BBCVQS-S.js";
6
- import { B as q } from "./button-DohK_Ak_.js";
7
- import { n as I } from "./normalize-diacritics-BNGbFNlJ.js";
8
- /**
9
- * @license lucide-react v1.22.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */
14
- const O = [
15
- [
16
- "path",
17
- {
18
- d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
19
- key: "1c8476"
20
- }
21
- ],
22
- ["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
23
- ["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
24
- ], Z = w("save", O);
25
- function T({
26
- action: e,
27
- typedRef: s
28
- }) {
29
- return /* @__PURE__ */ r(
30
- q,
31
- {
32
- type: "button",
33
- size: "sm",
34
- intent: "outline",
35
- className: "ds:self-start",
36
- loading: e.loading,
37
- "data-action": "create-patient",
38
- onClick: () => e.onCreate(s.current),
39
- children: e.label
40
- }
41
- );
42
- }
43
- function $({
44
- patients: e = [],
45
- searchPatients: s,
46
- ...a
47
- }) {
48
- return s ? /* @__PURE__ */ r(F, { ...a, searchPatients: s }) : /* @__PURE__ */ r(v, { ...a, patients: e });
49
- }
50
- function v({
51
- value: e,
52
- onValueChange: s,
53
- patients: a,
54
- selectedLabel: p,
55
- placeholder: C,
56
- size: y,
57
- disabled: i,
58
- createAction: d
59
- }) {
60
- const c = S(""), g = /* @__PURE__ */ r(
61
- Q,
62
- {
63
- value: e,
64
- onValueChange: s,
65
- onQueryChange: (n) => {
66
- c.current = n;
67
- },
68
- options: [
69
- ...e && !a.some((n) => n.id === e) ? [{ value: e, label: p ?? "" }] : [],
70
- ...a.map((n) => ({ value: n.id, label: n.name }))
71
- ],
72
- placeholder: C,
73
- size: y,
74
- disabled: i,
75
- clearable: !0
76
- }
77
- );
78
- return d ? /* @__PURE__ */ M("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
79
- g,
80
- e || i ? null : /* @__PURE__ */ r(T, { action: d, typedRef: c })
81
- ] }) : g;
82
- }
83
- function F({
84
- value: e,
85
- onValueChange: s,
86
- selectedLabel: a,
87
- placeholder: p,
88
- size: C,
89
- disabled: y,
90
- searchPatients: i,
91
- createAction: d
92
- }) {
93
- const { t: c } = E("ui"), [g, n] = h(""), [V, j] = h(0), [b, H] = h(), [m, x] = h(), N = S(null), P = S(""), l = g.trim();
94
- D(() => {
95
- if (!l) return;
96
- const t = new AbortController(), o = { query: l, source: i };
97
- x({ ...o, status: "loading", patients: [] });
98
- const k = setTimeout(() => {
99
- Promise.resolve().then(() => i(l, { signal: t.signal })).then(
100
- (_) => {
101
- t.signal.aborted || x({ ...o, status: "ready", patients: _ });
102
- },
103
- () => {
104
- t.signal.aborted || x({ ...o, status: "error", patients: [] });
105
- }
106
- );
107
- }, 250);
108
- return () => {
109
- clearTimeout(k), t.abort();
110
- };
111
- }, [l, i, V]);
112
- const R = (m == null ? void 0 : m.query) === l && m.source === i, u = l ? R ? m.status : "loading" : "idle", f = R && u === "ready" ? m.patients : [], z = u === "loading" ? c("inputs.search.loading") : u === "error" ? c("emptyState.error.description") : u === "idle" ? p : f.length === 0 ? c("inputs.combobox.empty") : "", L = !!d && !e && !y, B = f.map((t) => ({
113
- value: t.id,
114
- label: t.name
115
- }));
116
- return e && !f.some((t) => t.id === e) && B.push({
117
- value: e,
118
- label: (b == null ? void 0 : b.id) === e ? b.name : a ?? ""
119
- }), /* @__PURE__ */ M(
120
- "div",
121
- {
122
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
123
- "data-component": "patient-picker",
124
- "data-status": u,
125
- children: [
126
- /* @__PURE__ */ r(
127
- Q,
128
- {
129
- ref: N,
130
- options: B,
131
- value: e,
132
- onValueChange: (t) => {
133
- H(
134
- (o) => f.find((k) => k.id === t) ?? ((o == null ? void 0 : o.id) === t ? o : void 0)
135
- ), s(t);
136
- },
137
- onQueryChange: (t) => {
138
- P.current = t, n(t);
139
- },
140
- onOpenChange: (t) => {
141
- !t && u !== "error" && n("");
142
- },
143
- filter: (t) => !l || f.some((o) => I(o.id) === t) ? 1 : 0,
144
- size: C,
145
- disabled: y,
146
- placeholder: p,
147
- emptyMessage: z || void 0,
148
- clearable: !0
149
- }
150
- ),
151
- /* @__PURE__ */ r("p", { role: "status", className: "type-body-sm ds:text-muted-foreground", children: z }),
152
- L && d ? /* @__PURE__ */ r(T, { action: d, typedRef: P }) : null,
153
- u === "error" ? /* @__PURE__ */ r(
154
- q,
155
- {
156
- size: "sm",
157
- intent: "ghost",
158
- onClick: () => {
159
- var t;
160
- j((o) => o + 1), (t = N.current) == null || t.focus();
161
- },
162
- children: c("emptyState.error.cta")
163
- }
164
- ) : null
165
- ]
166
- }
167
- );
168
- }
169
- export {
170
- $ as P,
171
- Z as S
172
- };
173
- //# sourceMappingURL=patient-picker-BZJuOgMw.js.map
@@ -1,112 +0,0 @@
1
- import { useState as d, useRef as i, useEffect as S } from "react";
2
- function N(r, e, c = !1) {
3
- const [n, E] = d(
4
- () => c ? {} : null
5
- ), [g, T] = d(null), [s, v] = d([]);
6
- if (n !== g)
7
- T(n), v(r.filter((t) => !!e(t)));
8
- else {
9
- const t = s.filter((l) => !!e(l));
10
- t.length !== s.length && v(t);
11
- }
12
- const h = i(null), o = i(null);
13
- return S(() => {
14
- var t, l;
15
- !n || o.current === n || (o.current = n, s.length > 0 ? (t = h.current) == null || t.focus() : (l = n.fallback) == null || l.call(n));
16
- }, [n, s]), {
17
- listed: s,
18
- lists: (t) => s.includes(t),
19
- // A new object each time, so a second refused submit moves focus again.
20
- open: (t) => E({ fallback: t }),
21
- ref: h
22
- };
23
- }
24
- function H(r, e) {
25
- const [c, n] = d(void 0);
26
- return r && e && c !== r && n(r), !r && c !== void 0 && n(void 0), r && (e || c === r) ? "off" : void 0;
27
- }
28
- const x = 8e3, B = (r) => JSON.stringify(
29
- Object.entries(r ?? {}).filter(([, e]) => !!e).sort(([e], [c]) => e < c ? -1 : e > c ? 1 : 0)
30
- );
31
- function O(r) {
32
- const e = i(r);
33
- e.current = r;
34
- const [c, n] = d(!1), [E, g] = d(!1), [T, s] = d(!1), v = r.submitting || c || E, h = i(null), o = i(!1), t = i(void 0), l = i(!1), m = i(!1), A = i(void 0), P = () => {
35
- o.current = !1, clearTimeout(t.current), g(!1);
36
- };
37
- S(() => () => clearTimeout(t.current), []);
38
- const R = (u) => {
39
- e.current.native ? n(!0) : (l.current = !0, m.current = !1, A.current = e.current.errors), e.current.deliver(u);
40
- }, C = (u) => {
41
- if (v) {
42
- u.preventDefault();
43
- return;
44
- }
45
- s(!1);
46
- const f = e.current.firstProblem();
47
- if (f !== void 0) {
48
- u.preventDefault(), e.current.onRefused(f);
49
- return;
50
- }
51
- if (e.current.captcha) {
52
- u.preventDefault();
53
- const a = h.current;
54
- if (!a) {
55
- s(!0);
56
- return;
57
- }
58
- o.current = !1, a.reset(), o.current = !0, g(!0), clearTimeout(t.current), t.current = setTimeout(
59
- () => g(!1),
60
- x
61
- ), a.execute();
62
- return;
63
- }
64
- if (e.current.native) {
65
- n(!0);
66
- return;
67
- }
68
- u.preventDefault(), R();
69
- }, F = (u) => {
70
- if (!o.current) return;
71
- if (P(), !u) {
72
- s(!0);
73
- return;
74
- }
75
- const f = e.current.firstProblem();
76
- if (f !== void 0) {
77
- e.current.onRefused(f);
78
- return;
79
- }
80
- R(u);
81
- }, D = () => {
82
- o.current && (P(), s(!0));
83
- }, p = r.errors, b = B(p), w = i(null);
84
- return S(() => {
85
- var a;
86
- if (w.current === null) {
87
- w.current = b;
88
- return;
89
- }
90
- const u = b !== w.current;
91
- w.current = b, l.current && r.submitting && (m.current = !0);
92
- const f = l.current && m.current && !r.submitting && p !== A.current;
93
- !u && !f || (l.current = !1, m.current = !1, o.current = !1, clearTimeout(t.current), g(!1), (a = h.current) == null || a.reset(), e.current.onAnswer(p ?? {}));
94
- }, [p, b, r.submitting]), S(() => {
95
- const u = (f) => {
96
- var a, y;
97
- f.persisted && (n(!1), (y = (a = e.current).onRestore) == null || y.call(a));
98
- };
99
- return window.addEventListener("pageshow", u), () => window.removeEventListener("pageshow", u);
100
- }, []), {
101
- busy: v,
102
- captchaFailed: T,
103
- handleSubmit: C,
104
- captcha: { ref: h, onChange: F, onError: D }
105
- };
106
- }
107
- export {
108
- H as a,
109
- O as b,
110
- N as u
111
- };
112
- //# sourceMappingURL=use-registration-submit-CLGHxwoT.js.map