@alfadocs/ui-kit 1.133.0 → 1.134.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 (253) hide show
  1. package/dist/_chunks/{agenda-card-B8hV3dZV.js → agenda-card-B9wgX_Ed.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-Bu46s3dI.js → agenda-tray-CGcS_qoM.js} +2 -2
  3. package/dist/_chunks/appointment-card-DG3m9yN-.js +504 -0
  4. package/dist/_chunks/{appointment-peek-DZa6xyUb.js → appointment-peek-BK0tDs4C.js} +2 -2
  5. package/dist/_chunks/{appointment-timeline-DQePqpyH.js → appointment-timeline-BiI2riRZ.js} +2 -2
  6. package/dist/_chunks/appointment-tray-ClJCtYQj.js +200 -0
  7. package/dist/_chunks/{appointment-workflow-status-DMjuIK90.js → appointment-workflow-status-S-lx81Yz.js} +2 -2
  8. package/dist/_chunks/ban-CiSCCcOE.js +15 -0
  9. package/dist/_chunks/{calendar-BIoOeBTT.js → calendar-CyLtLBNP.js} +2 -2
  10. package/dist/_chunks/{calendar-appointment-editor-dialog-BHx6kUhX.js → calendar-appointment-editor-dialog-BSkIYGlW.js} +13 -13
  11. package/dist/_chunks/{calendar-event-card-BNEzkjm-.js → calendar-event-card-BJifpYZQ.js} +7 -6
  12. package/dist/_chunks/{care-plan-card-DKScH9Ss.js → care-plan-card-CjHq6PLo.js} +6 -6
  13. package/dist/_chunks/{care-plan-entry-card-AG1y3nyW.js → care-plan-entry-card-DY1toF6E.js} +2 -2
  14. package/dist/_chunks/{care-plan-header-Dx5OMkc9.js → care-plan-header-CeFXUDnL.js} +6 -6
  15. package/dist/_chunks/check-in-documents-CEVcgcYZ.js +136 -0
  16. package/dist/_chunks/{clinical-note-card-pPaeWWnu.js → clinical-note-card-D--IwbZa.js} +2 -2
  17. package/dist/_chunks/document-preview-DLVIrOYV.js +385 -0
  18. package/dist/_chunks/{entity-card-fpm-KUKc.js → entity-card-p-LANpYt.js} +18 -17
  19. package/dist/_chunks/{error-page-B0fGNTRB.js → error-page-WLhmWUTq.js} +100 -115
  20. package/dist/_chunks/finished-terminal-unDnXT4j.js +191 -0
  21. package/dist/_chunks/house-DGCypGTo.js +21 -0
  22. package/dist/_chunks/is-safe-url-CEy9CEml.js +8 -0
  23. package/dist/_chunks/keypad-DBH_keVs.js +152 -0
  24. package/dist/_chunks/keypad-button-mOaPQRrH.js +114 -0
  25. package/dist/_chunks/{message-card-BG3_3nN1.js → message-card-Bw_q1qKx.js} +2 -2
  26. package/dist/_chunks/{message-tray-BjZv0Fsk.js → message-tray-pLGgLmoG.js} +2 -2
  27. package/dist/_chunks/{note-attachment-MNTIqdSz.js → note-attachment-JTIy9iXN.js} +2 -2
  28. package/dist/_chunks/{note-timeline-BQeW0VZY.js → note-timeline-BbjHMhkL.js} +2 -2
  29. package/dist/_chunks/{notes-panel-Cm-_pCRJ.js → notes-panel-BAyPOr8N.js} +2 -2
  30. package/dist/_chunks/{operator-hero-CnfWckNQ.js → operator-hero-D4wfVu2l.js} +2 -2
  31. package/dist/_chunks/otp-input-BNOTlxq3.js +342 -0
  32. package/dist/_chunks/patient-account-settings-BkAtIxJW.js +546 -0
  33. package/dist/_chunks/patient-card-DTh3QTyS.js +125 -0
  34. package/dist/_chunks/patient-check-in-resume-xhqjC6gf.js +742 -0
  35. package/dist/_chunks/patient-sign-in-pin-CDBqV254.js +432 -0
  36. package/dist/_chunks/patient-sign-in-steps-C2JSqlok.js +199 -0
  37. package/dist/_chunks/{patient-summary-card-BUcZ-gaL.js → patient-summary-card-Bl2NknPe.js} +2 -2
  38. package/dist/_chunks/{payment-request-card-Dv4WbRBe.js → payment-request-card-CNW00DCx.js} +6 -6
  39. package/dist/_chunks/{pdf-viewer-BnBKdx0y.js → pdf-viewer-TRC5jEm5.js} +472 -425
  40. package/dist/_chunks/pin-entry-BugWQMOS.js +219 -0
  41. package/dist/_chunks/pin-indicator-Cb-n40UI.js +124 -0
  42. package/dist/_chunks/portal-details-CTEsm705.js +478 -0
  43. package/dist/_chunks/portal-documents-D8skew0h.js +902 -0
  44. package/dist/_chunks/portal-parts-BdR29P7z.js +285 -0
  45. package/dist/_chunks/{privacy-mask-DJ1gee4c.js → privacy-mask-C19dJFMk.js} +5 -5
  46. package/dist/_chunks/{product-hub-panel-a8wdVOUt.js → product-hub-panel-K4QbULG7.js} +2 -2
  47. package/dist/_chunks/{registration-form-CwbhtKcy.js → registration-form-DS3RuKHu.js} +2 -2
  48. package/dist/_chunks/{reserved.agent-W8mR179D.js → reserved.agent-DOzOBUW7.js} +2 -2
  49. package/dist/_chunks/session-countdown-DOx1IBUB.js +232 -0
  50. package/dist/_chunks/{sign-document-CQZVzfpk.js → sign-document-DDZbmYHu.js} +2 -2
  51. package/dist/_chunks/{signature-field-DjabvRZm.js → signature-field-BjlY_yXH.js} +39 -34
  52. package/dist/_chunks/{signature-request-4pGq3YBe.js → signature-request-CHsM_iWi.js} +2 -2
  53. package/dist/_chunks/{signature-status-chip-pIoQjvH8.js → signature-status-chip-DS9hHwIt.js} +66 -69
  54. package/dist/_chunks/signing-end-screen-an9P8DOT.js +1041 -0
  55. package/dist/_chunks/sms-code-entry-Dgp4GwlM.js +316 -0
  56. package/dist/_chunks/step-up-dialog-C2JqJmCA.js +132 -0
  57. package/dist/_chunks/{task-editor-BL2hHxNz.js → task-editor-g1AGfxhr.js} +38 -38
  58. package/dist/_chunks/{use-appointment-details-read-_b7FRB1x.js → use-appointment-details-read-Dzc6fEzG.js} +6 -6
  59. package/dist/_chunks/use-zoom-drilldown-Cr1baU5X.js +221 -0
  60. package/dist/_chunks/{user-x-DYszNtIg.js → user-x-BJZg4kaP.js} +8 -19
  61. package/dist/_chunks/{verify-identity-types-CxtrBXsZ.js → verify-identity-types-C6Bam8v6.js} +2 -2
  62. package/dist/agent-catalog.json +723 -364
  63. package/dist/agent-i18n/en.json +75 -18
  64. package/dist/browser-support.js +1 -1
  65. package/dist/components/_shared/is-safe-url.d.ts +3 -1
  66. package/dist/components/agenda-card/index.js +2 -2
  67. package/dist/components/agenda-tray/index.js +1 -1
  68. package/dist/components/appointment-card/appointment-card.d.ts +45 -0
  69. package/dist/components/appointment-card/appointment-tray.d.ts +11 -0
  70. package/dist/components/appointment-card/index.js +3 -3
  71. package/dist/components/appointment-details-panel/index.js +1 -1
  72. package/dist/components/appointment-peek/index.js +1 -1
  73. package/dist/components/appointment-timeline/index.js +1 -1
  74. package/dist/components/booking/index.js +1 -1
  75. package/dist/components/calendar/index.js +1 -1
  76. package/dist/components/calendar-event-card/index.js +1 -1
  77. package/dist/components/care-plan-card/index.js +1 -1
  78. package/dist/components/care-plan-entry-card/index.js +1 -1
  79. package/dist/components/care-plan-header/index.js +1 -1
  80. package/dist/components/clinical-note-card/index.js +1 -1
  81. package/dist/components/document-preview/document-preview.d.ts +61 -7
  82. package/dist/components/document-preview/index.js +1 -1
  83. package/dist/components/finished-terminal/finished-terminal.d.ts +63 -6
  84. package/dist/components/finished-terminal/index.d.ts +1 -1
  85. package/dist/components/finished-terminal/index.js +1 -1
  86. package/dist/components/index.d.ts +12 -0
  87. package/dist/components/keypad/index.d.ts +3 -0
  88. package/dist/components/keypad/index.js +6 -0
  89. package/dist/components/keypad/keypad.d.ts +54 -0
  90. package/dist/components/keypad-button/index.d.ts +3 -0
  91. package/dist/components/keypad-button/index.js +6 -0
  92. package/dist/components/keypad-button/keypad-button.d.ts +33 -0
  93. package/dist/components/message-card/index.js +2 -2
  94. package/dist/components/message-tray/index.js +1 -1
  95. package/dist/components/note-timeline/index.js +1 -1
  96. package/dist/components/notes-panel/index.js +1 -1
  97. package/dist/components/operator-hero/index.js +1 -1
  98. package/dist/components/otp-input/index.js +1 -1
  99. package/dist/components/otp-input/otp-input.d.ts +11 -0
  100. package/dist/components/patient-summary-card/index.js +1 -1
  101. package/dist/components/payment-card/index.js +1 -1
  102. package/dist/components/pdf-viewer/index.js +1 -1
  103. package/dist/components/pdf-viewer/pdf-viewer.d.ts +7 -0
  104. package/dist/components/pin-entry/index.d.ts +3 -0
  105. package/dist/components/pin-entry/index.js +5 -0
  106. package/dist/components/pin-entry/pin-entry.agent.d.ts +4 -0
  107. package/dist/components/pin-entry/pin-entry.d.ts +64 -0
  108. package/dist/components/pin-indicator/index.d.ts +3 -0
  109. package/dist/components/pin-indicator/index.js +9 -0
  110. package/dist/components/pin-indicator/pin-indicator.d.ts +34 -0
  111. package/dist/components/product-hub-tray/index.js +2 -2
  112. package/dist/components/session-countdown/index.js +1 -1
  113. package/dist/components/session-countdown/session-countdown.d.ts +19 -0
  114. package/dist/components/sign-document/index.js +1 -1
  115. package/dist/components/signature-field/index.js +1 -1
  116. package/dist/components/signature-field/signature-field.d.ts +17 -6
  117. package/dist/components/signature-status-chip/index.js +1 -1
  118. package/dist/components/signature-status-chip/signature-status-chip.d.ts +3 -2
  119. package/dist/components/sms-code-entry/index.d.ts +3 -0
  120. package/dist/components/sms-code-entry/index.js +5 -0
  121. package/dist/components/sms-code-entry/sms-code-entry.agent.d.ts +4 -0
  122. package/dist/components/sms-code-entry/sms-code-entry.d.ts +156 -0
  123. package/dist/components/step-up-dialog/index.d.ts +3 -0
  124. package/dist/components/step-up-dialog/index.js +5 -0
  125. package/dist/components/step-up-dialog/step-up-dialog.d.ts +108 -0
  126. package/dist/components/task-editor/index.js +1 -1
  127. package/dist/components/workflow-status/index.js +1 -1
  128. package/dist/core.css +1 -1
  129. package/dist/hooks/index.js +1 -1
  130. package/dist/hooks/use-signing-session.d.ts +7 -2
  131. package/dist/host-compat.css +10 -1
  132. package/dist/i18n/locales/ar.d.ts +512 -1
  133. package/dist/i18n/locales/ar.js +509 -3
  134. package/dist/i18n/locales/de.d.ts +512 -1
  135. package/dist/i18n/locales/de.js +517 -4
  136. package/dist/i18n/locales/el.d.ts +512 -1
  137. package/dist/i18n/locales/el.js +512 -4
  138. package/dist/i18n/locales/en.d.ts +514 -1
  139. package/dist/i18n/locales/en.js +520 -4
  140. package/dist/i18n/locales/es.d.ts +512 -1
  141. package/dist/i18n/locales/es.js +510 -4
  142. package/dist/i18n/locales/fr.d.ts +512 -1
  143. package/dist/i18n/locales/fr.js +510 -4
  144. package/dist/i18n/locales/hi.d.ts +512 -1
  145. package/dist/i18n/locales/hi.js +510 -4
  146. package/dist/i18n/locales/it.d.ts +512 -1
  147. package/dist/i18n/locales/it.js +517 -4
  148. package/dist/i18n/locales/ja.d.ts +512 -1
  149. package/dist/i18n/locales/ja.js +510 -4
  150. package/dist/i18n/locales/nl.d.ts +512 -1
  151. package/dist/i18n/locales/nl.js +517 -4
  152. package/dist/i18n/locales/pl.d.ts +512 -1
  153. package/dist/i18n/locales/pl.js +517 -4
  154. package/dist/i18n/locales/pt.d.ts +512 -1
  155. package/dist/i18n/locales/pt.js +517 -4
  156. package/dist/i18n/locales/ro.d.ts +512 -1
  157. package/dist/i18n/locales/ro.js +517 -4
  158. package/dist/i18n/locales/ru.d.ts +512 -1
  159. package/dist/i18n/locales/ru.js +509 -3
  160. package/dist/i18n/locales/sq.d.ts +512 -1
  161. package/dist/i18n/locales/sq.js +510 -4
  162. package/dist/i18n/locales/sv.d.ts +512 -1
  163. package/dist/i18n/locales/sv.js +510 -4
  164. package/dist/i18n/locales/tr.d.ts +512 -1
  165. package/dist/i18n/locales/tr.js +512 -4
  166. package/dist/i18n/locales/zh.d.ts +512 -1
  167. package/dist/i18n/locales/zh.js +510 -4
  168. package/dist/index.js +1271 -1204
  169. package/dist/locales/ar.json +513 -2
  170. package/dist/locales/de.json +514 -3
  171. package/dist/locales/el.json +514 -3
  172. package/dist/locales/en.json +514 -3
  173. package/dist/locales/es.json +514 -3
  174. package/dist/locales/fr.json +514 -3
  175. package/dist/locales/hi.json +514 -3
  176. package/dist/locales/it.json +514 -3
  177. package/dist/locales/ja.json +514 -3
  178. package/dist/locales/nl.json +514 -3
  179. package/dist/locales/pl.json +514 -3
  180. package/dist/locales/pt.json +514 -3
  181. package/dist/locales/ro.json +514 -3
  182. package/dist/locales/ru.json +513 -2
  183. package/dist/locales/sq.json +514 -3
  184. package/dist/locales/sv.json +514 -3
  185. package/dist/locales/tr.json +514 -3
  186. package/dist/locales/zh.json +514 -3
  187. package/dist/patterns/calendar/index.js +1 -1
  188. package/dist/patterns/check-in-documents/check-in-documents.d.ts +61 -0
  189. package/dist/patterns/check-in-documents/check-in-signable-document.d.ts +32 -0
  190. package/dist/patterns/check-in-documents/index.d.ts +4 -0
  191. package/dist/patterns/check-in-documents/index.js +5 -0
  192. package/dist/patterns/error-page/index.js +1 -1
  193. package/dist/patterns/patient-account-settings/index.d.ts +4 -0
  194. package/dist/patterns/patient-account-settings/index.js +5 -0
  195. package/dist/patterns/patient-account-settings/patient-account-settings-panels.d.ts +36 -0
  196. package/dist/patterns/patient-account-settings/patient-account-settings.d.ts +94 -0
  197. package/dist/patterns/patient-account-settings/patient-account-settings.types.d.ts +91 -0
  198. package/dist/patterns/patient-check-in/index.d.ts +20 -0
  199. package/dist/patterns/patient-check-in/index.js +13 -0
  200. package/dist/patterns/patient-check-in/patient-check-in-changed.d.ts +33 -0
  201. package/dist/patterns/patient-check-in/patient-check-in-connection-notice.d.ts +29 -0
  202. package/dist/patterns/patient-check-in/patient-check-in-done.d.ts +25 -0
  203. package/dist/patterns/patient-check-in/patient-check-in-entry.d.ts +29 -0
  204. package/dist/patterns/patient-check-in/patient-check-in-hub-empty.d.ts +23 -0
  205. package/dist/patterns/patient-check-in/patient-check-in-hub.d.ts +61 -0
  206. package/dist/patterns/patient-check-in/patient-check-in-personal-data.d.ts +73 -0
  207. package/dist/patterns/patient-check-in/patient-check-in-privacy.d.ts +9 -0
  208. package/dist/patterns/patient-check-in/patient-check-in-resume.d.ts +29 -0
  209. package/dist/patterns/patient-check-in/patient-check-in-shell.d.ts +60 -0
  210. package/dist/patterns/patient-check-in/patient-check-in-types.d.ts +92 -0
  211. package/dist/patterns/patient-portal/index.d.ts +12 -0
  212. package/dist/patterns/patient-portal/index.js +13 -0
  213. package/dist/patterns/patient-portal/portal-appointments.d.ts +70 -0
  214. package/dist/patterns/patient-portal/portal-details.d.ts +148 -0
  215. package/dist/patterns/patient-portal/portal-documents.d.ts +74 -0
  216. package/dist/patterns/patient-portal/portal-format.d.ts +14 -0
  217. package/dist/patterns/patient-portal/portal-home.d.ts +71 -0
  218. package/dist/patterns/patient-portal/portal-parts.d.ts +107 -0
  219. package/dist/patterns/patient-portal/portal-shell.d.ts +84 -0
  220. package/dist/patterns/patient-portal/portal-types.d.ts +157 -0
  221. package/dist/patterns/patient-sign-in/index.d.ts +7 -0
  222. package/dist/patterns/patient-sign-in/index.js +15 -0
  223. package/dist/patterns/patient-sign-in/patient-card.d.ts +74 -0
  224. package/dist/patterns/patient-sign-in/patient-sign-in-email.d.ts +109 -0
  225. package/dist/patterns/patient-sign-in/patient-sign-in-pin.d.ts +157 -0
  226. package/dist/patterns/patient-sign-in/patient-sign-in-steps.d.ts +143 -0
  227. package/dist/patterns/registration-form/index.js +1 -1
  228. package/dist/patterns/signature-request/index.js +1 -1
  229. package/dist/patterns/signing/index.d.ts +25 -0
  230. package/dist/patterns/signing/index.js +16 -0
  231. package/dist/patterns/signing/multi-field-signer.d.ts +117 -0
  232. package/dist/patterns/signing/signing-awaiting-screen.d.ts +25 -0
  233. package/dist/patterns/signing/signing-chrome.d.ts +30 -0
  234. package/dist/patterns/signing/signing-document-screen.d.ts +87 -0
  235. package/dist/patterns/signing/signing-end-screen.d.ts +27 -0
  236. package/dist/patterns/signing/signing-finished-screen.d.ts +34 -0
  237. package/dist/patterns/signing/signing-footer.d.ts +56 -0
  238. package/dist/patterns/signing/signing-handoff-screen.d.ts +37 -0
  239. package/dist/patterns/signing/signing-message-dialog.d.ts +29 -0
  240. package/dist/patterns/signing/signing-progress-chip.d.ts +27 -0
  241. package/dist/patterns/signing/signing-roster.d.ts +44 -0
  242. package/dist/patterns/signing/signing-staff-id-confirmation.d.ts +49 -0
  243. package/dist/patterns/verify-identity/index.js +1 -1
  244. package/dist/tokens.css +1 -1
  245. package/package.json +49 -1
  246. package/dist/_chunks/appointment-card-OAOur8lH.js +0 -434
  247. package/dist/_chunks/appointment-tray-DSFqO5Rm.js +0 -193
  248. package/dist/_chunks/document-preview-_kQ9QvZV.js +0 -291
  249. package/dist/_chunks/finished-terminal-FR8uc_Ws.js +0 -122
  250. package/dist/_chunks/is-safe-url-DkETxeHz.js +0 -7
  251. package/dist/_chunks/otp-input-gV1446Dw.js +0 -301
  252. package/dist/_chunks/session-countdown-C4tzbJVc.js +0 -223
  253. package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js +0 -210
@@ -1,301 +0,0 @@
1
- import { jsxs as ae, jsx as I } from "react/jsx-runtime";
2
- import { forwardRef as se, useId as ne, useRef as R, useState as oe, useEffect as ie, useCallback as S, useMemo as ce, useImperativeHandle as le } from "react";
3
- import { c as j } from "./index-D2ZczOXr.js";
4
- import { useTranslation as ue } from "react-i18next";
5
- import { u as pe } from "./use-controllable-state-BiY4xTzM.js";
6
- import { u as de } from "./use-web-otp-D_utzp6S.js";
7
- import { u as fe, a as ge } from "./form-field-context-DtiROUJV.js";
8
- import { u as me } from "./registry-DvAUVLHh.js";
9
- const he = {
10
- id: "otp-input",
11
- // Value input — `set_value` replaces the digits. There is no `submit`
12
- // action: completion is host-driven (the consumer's `onComplete` fires
13
- // automatically once every digit is filled) and is observable via the
14
- // `isComplete` state slot, so the old unbacked `submit` capability is
15
- // removed.
16
- capabilities: ["set_value"],
17
- state: {
18
- value: {
19
- type: "string",
20
- descriptionKey: "ui.agent.otpInput.state.value",
21
- description: "Current digits entered, packed into a single string.",
22
- read: (a) => a.getValue()
23
- },
24
- isComplete: {
25
- type: "boolean",
26
- descriptionKey: "ui.agent.otpInput.state.isComplete",
27
- description: "Whether all required digits have been entered.",
28
- read: (a) => a.isComplete()
29
- }
30
- },
31
- actions: {
32
- set_value: {
33
- safety: "write",
34
- argsType: "{ value: string }",
35
- argsSchema: {
36
- type: "object",
37
- properties: {
38
- value: {
39
- type: "string",
40
- description: "The digits to fill, packed into a single string (one char per cell)."
41
- }
42
- },
43
- required: ["value"]
44
- },
45
- idempotent: !0,
46
- examples: [{ args: { value: "123456" } }],
47
- descriptionKey: "ui.agent.otpInput.actions.setValue",
48
- description: "Replace the entered digits.",
49
- invoke: (a, o) => {
50
- a.setValue(o.value);
51
- }
52
- },
53
- clear: {
54
- safety: "destructive",
55
- idempotent: !0,
56
- descriptionKey: "ui.agent.otpInput.actions.clear",
57
- description: "Empty all digit cells. Loses any typed value.",
58
- invoke: (a) => {
59
- a.clear();
60
- }
61
- },
62
- focus: {
63
- safety: "read",
64
- idempotent: !0,
65
- descriptionKey: "ui.agent.otpInput.actions.focus",
66
- description: "Move keyboard focus to the active digit cell.",
67
- invoke: (a) => {
68
- a.focus();
69
- }
70
- }
71
- },
72
- domHooks: {
73
- root: {
74
- attr: "data-component",
75
- value: "otp-input",
76
- description: "Marks the OTPInput wrapper. Completion is observable via state.isComplete; the host onComplete callback fires once when all digits are filled."
77
- },
78
- instanceId: {
79
- attr: "data-component-id",
80
- sourceProp: "id",
81
- description: "Sourced from the id prop."
82
- }
83
- }
84
- }, ve = j("ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]"), be = j(
85
- [
86
- "ds:w-[var(--min-target-size)] ds:h-[var(--min-target-size)]",
87
- "ds:rounded-[var(--radius-sm)]",
88
- "ds:border ds:bg-input ds:text-foreground ds:text-center ds:font-medium ds:text-[length:var(--font-size-lg)]",
89
- "ds:shadow-[var(--shadow-input)]",
90
- "ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
91
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
92
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
93
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
94
- ].join(" "),
95
- {
96
- variants: {
97
- tone: {
98
- default: "ds:border-[color:var(--control-border)]",
99
- error: "ds:border-destructive"
100
- }
101
- },
102
- defaultVariants: { tone: "default" }
103
- }
104
- );
105
- function z(a) {
106
- return a.replace(/[\u0660-\u0669]/g, (o) => String(o.charCodeAt(0) - 1632)).replace(/[\u06F0-\u06F9]/g, (o) => String(o.charCodeAt(0) - 1776));
107
- }
108
- const ye = 3, we = 10;
109
- function Ie(a) {
110
- const o = Number.isFinite(a) ? Math.floor(a) : 6;
111
- return Math.max(ye, Math.min(we, o));
112
- }
113
- function k(a, o, g) {
114
- return (g === "alphanumeric" ? a.replace(/[^A-Za-z0-9]/g, "").toUpperCase() : z(a).replace(/\D/g, "")).slice(0, o);
115
- }
116
- function ke(a, o, g) {
117
- const p = k(a, o, g), d = new Array(o).fill("");
118
- for (let m = 0; m < p.length; m += 1)
119
- d[m] = p[m];
120
- return d;
121
- }
122
- const Ve = se(
123
- ({
124
- length: a = 6,
125
- value: o,
126
- defaultValue: g,
127
- onChange: p,
128
- onComplete: d,
129
- disabled: m,
130
- error: $,
131
- label: V,
132
- "aria-describedby": Z,
133
- id: E,
134
- className: _,
135
- webOtp: U = !1,
136
- name: K,
137
- mode: i = "numeric"
138
- }, q) => {
139
- const { t: x } = ue("ui"), r = Ie(a), v = fe(), G = ne(), B = V ? G : void 0, [W, H] = pe({
140
- value: o,
141
- defaultValue: k(g ?? "", r, i)
142
- }), h = k(W ?? "", r, i), X = ke(h, r, i), y = v.disabled || !!m, O = v.invalid || !!$, J = O ? "error" : "default", P = R([]), D = R(h.length === r), f = R(h);
143
- f.current = h;
144
- const Q = () => {
145
- const e = h.length;
146
- return e >= r ? r - 1 : e;
147
- }, [b, A] = oe(Q);
148
- ie(() => {
149
- b >= r && A(r - 1);
150
- }, [b, r]);
151
- const l = S(
152
- (e, t) => {
153
- const n = Math.max(0, Math.min(r - 1, e));
154
- A(n);
155
- const s = P.current[n];
156
- s && (s.focus(t), s.select());
157
- },
158
- [r]
159
- ), u = S(
160
- (e) => {
161
- const t = k(e, r, i);
162
- H(t), f.current = t, p == null || p(t), t.length === r ? D.current || (D.current = !0, d == null || d(t)) : D.current = !1;
163
- },
164
- [H, r, i, p, d]
165
- );
166
- de({
167
- enabled: U && !y,
168
- onCode: u
169
- });
170
- const Y = (e) => (t) => {
171
- const n = t.target.value, s = i === "alphanumeric" ? n.replace(/[^A-Za-z0-9]/g, "").toUpperCase() : z(n).replace(/\D/g, ""), c = f.current;
172
- if (s.length === 0) {
173
- if (n === "" && e < c.length) {
174
- const N = c.slice(0, e) + c.slice(e + 1);
175
- u(N);
176
- }
177
- return;
178
- }
179
- const w = c.slice(0, e), C = c.slice(e + s.length), F = (w + s + C).slice(0, r);
180
- u(F);
181
- const L = Math.min(e + s.length, r - 1);
182
- l(L);
183
- }, ee = (e) => (t) => {
184
- const n = f.current;
185
- if (t.key === "Backspace") {
186
- if (n[e]) {
187
- t.preventDefault();
188
- const s = n.slice(0, e) + n.slice(e + 1);
189
- u(s);
190
- return;
191
- }
192
- if (e > 0) {
193
- t.preventDefault();
194
- const s = n.slice(0, e - 1) + n.slice(e);
195
- u(s), l(e - 1);
196
- }
197
- return;
198
- }
199
- if (t.key === "ArrowLeft") {
200
- t.preventDefault(), e > 0 && l(e - 1);
201
- return;
202
- }
203
- if (t.key === "ArrowRight") {
204
- t.preventDefault(), e < r - 1 && l(e + 1);
205
- return;
206
- }
207
- if (t.key === "Home") {
208
- t.preventDefault(), l(0);
209
- return;
210
- }
211
- t.key === "End" && (t.preventDefault(), l(r - 1));
212
- }, te = (e) => (t) => {
213
- const s = t.clipboardData.getData("text").replace(/\s+/g, ""), c = i === "alphanumeric" ? s.replace(/[^A-Za-z0-9]/g, "").toUpperCase() : z(s);
214
- if (i === "alphanumeric" ? c.length === 0 : !/^[0-9]+$/.test(c))
215
- return;
216
- t.preventDefault();
217
- const w = f.current, C = w.slice(0, e), F = w.slice(e + c.length), L = (C + c + F).slice(0, r);
218
- u(L);
219
- const N = Math.min(e + c.length, r - 1);
220
- l(N);
221
- }, re = (e) => (t) => {
222
- A(e), t.currentTarget.select();
223
- }, T = v.id;
224
- ge(v, `${T}-0`);
225
- const M = ce(
226
- () => ({
227
- getValue: () => f.current,
228
- setValue: (e) => u(e),
229
- clear: () => u(""),
230
- focus: (e) => l(b, e),
231
- isComplete: () => f.current.length === r
232
- }),
233
- [u, l, b, r]
234
- );
235
- return me(he, M, E), le(q, () => M, [M]), /* @__PURE__ */ ae("div", { className: ve({ className: _ }), children: [
236
- V ? /* @__PURE__ */ I(
237
- "label",
238
- {
239
- id: B,
240
- htmlFor: `${T}-0`,
241
- className: "type-label ds:text-foreground",
242
- children: V
243
- }
244
- ) : null,
245
- /* @__PURE__ */ I(
246
- "div",
247
- {
248
- role: "group",
249
- dir: "ltr",
250
- "aria-labelledby": B,
251
- "aria-invalid": O || void 0,
252
- "aria-describedby": [Z, v.describedBy].filter(Boolean).join(" ") || void 0,
253
- "aria-disabled": y || void 0,
254
- "data-component": "otp-input",
255
- "data-component-id": E,
256
- className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]",
257
- children: X.map((e, t) => {
258
- const n = !y && t === b;
259
- return /* @__PURE__ */ I(
260
- "input",
261
- {
262
- ref: (s) => {
263
- P.current[t] = s;
264
- },
265
- id: `${T}-${t}`,
266
- type: "text",
267
- inputMode: i === "alphanumeric" ? "text" : "numeric",
268
- pattern: i === "alphanumeric" ? "[A-Za-z0-9]*" : "[0-9]*",
269
- autoCapitalize: i === "alphanumeric" ? "characters" : void 0,
270
- autoComplete: t === 0 ? "one-time-code" : "off",
271
- maxLength: 1,
272
- value: e,
273
- disabled: y,
274
- tabIndex: n ? 0 : -1,
275
- "aria-label": x(
276
- i === "alphanumeric" ? "inputs.otp.charLabel" : "inputs.otp.digitLabel",
277
- {
278
- current: t + 1,
279
- total: r
280
- }
281
- ),
282
- onChange: Y(t),
283
- onKeyDown: ee(t),
284
- onPaste: te(t),
285
- onFocus: re(t),
286
- className: be({ tone: J })
287
- },
288
- t
289
- );
290
- })
291
- }
292
- ),
293
- K ? /* @__PURE__ */ I("input", { type: "hidden", name: K, value: h, readOnly: !0 }) : null
294
- ] });
295
- }
296
- );
297
- Ve.displayName = "OTPInput";
298
- export {
299
- Ve as O
300
- };
301
- //# sourceMappingURL=otp-input-gV1446Dw.js.map
@@ -1,223 +0,0 @@
1
- import { jsxs as T, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as H, useEffect as b, useMemo as v, useRef as W, useState as X } from "react";
3
- import { c as Z } from "./index-D2ZczOXr.js";
4
- import { useTranslation as G } from "react-i18next";
5
- import { B as J } from "./button-DohK_Ak_.js";
6
- import { P as Q } from "./progress-D_g_Sl2g.js";
7
- import { L as Y } from "./live-region-C41SO3cA.js";
8
- import { u as E } from "./registry-DvAUVLHh.js";
9
- import { c as k } from "./createLucideIcon-DhHxpK9K.js";
10
- import { T as nn } from "./triangle-alert-CBnO6nq_.js";
11
- /**
12
- * @license lucide-react v1.22.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */
17
- const en = [
18
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
19
- ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
20
- ["path", { d: "m9 9 6 6", key: "z0biqf" }]
21
- ], on = k("circle-x", en);
22
- /**
23
- * @license lucide-react v1.22.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */
28
- const sn = [
29
- ["line", { x1: "10", x2: "14", y1: "2", y2: "2", key: "14vaq8" }],
30
- ["line", { x1: "12", x2: "15", y1: "14", y2: "11", key: "17fdiu" }],
31
- ["circle", { cx: "12", cy: "14", r: "8", key: "1e1u0o" }]
32
- ], rn = k("timer", sn), tn = {
33
- id: "session-countdown",
34
- capabilities: [],
35
- state: {},
36
- actions: {},
37
- domHooks: {
38
- root: {
39
- attr: "data-component",
40
- value: "session-countdown",
41
- description: 'Marks the element as a kit SessionCountdown banner. The root also emits `data-tone="running" | "warning" | "expired"` (derived from the remaining time). The accessible remaining-time announcement is surfaced via the region\'s aria-label and a nested polite live region.'
42
- }
43
- }
44
- }, g = 1e3, h = 60 * g, an = 15 * h, dn = 2 * h, cn = Z(
45
- [
46
- "ds:break-words",
47
- "ds:flex ds:w-full ds:flex-col",
48
- "ds:rounded-[var(--radius-md)]",
49
- "ds:border ds:border-[length:var(--border-width-sm)]"
50
- ].join(" "),
51
- {
52
- variants: {
53
- size: {
54
- sm: "ds:p-[var(--spacing-sm)] ds:gap-[var(--spacing-xs)]",
55
- md: "ds:p-[var(--spacing-md)] ds:gap-[var(--spacing-sm)]",
56
- lg: "ds:p-[var(--spacing-lg)] ds:gap-[var(--spacing-sm)]"
57
- },
58
- // Internal-only — derived from remaining time, never surfaced to Controls.
59
- tone: {
60
- running: [
61
- "ds:border-[color:var(--info)]",
62
- "ds:bg-[color-mix(in_srgb,var(--info)_10%,transparent)]",
63
- "ds:text-[color:var(--info-foreground)]"
64
- ].join(" "),
65
- warning: [
66
- "ds:border-[color:var(--warning)]",
67
- "ds:bg-[color-mix(in_srgb,var(--warning)_10%,transparent)]",
68
- "ds:text-[color:var(--warning-foreground)]"
69
- ].join(" "),
70
- expired: [
71
- "ds:border-[color:var(--error)]",
72
- "ds:bg-[color-mix(in_srgb,var(--error)_10%,transparent)]",
73
- "ds:text-[color:var(--error-foreground)]",
74
- // The tonal Restart button inherits the error tint via the
75
- // established Alert child-selector trick — contrast-validated.
76
- "ds:[&_[data-intent=tonal]]:bg-[color:var(--error-foreground)]",
77
- "ds:[&_[data-intent=tonal]]:text-[color:var(--background)]"
78
- ].join(" ")
79
- }
80
- },
81
- defaultVariants: {
82
- size: "md",
83
- tone: "running"
84
- }
85
- }
86
- ), ln = {
87
- sm: "ds:size-4",
88
- md: "ds:size-5",
89
- lg: "ds:size-6"
90
- };
91
- function un(n, e) {
92
- return n <= 0 ? "expired" : n <= e ? "warning" : "running";
93
- }
94
- function mn(n) {
95
- return n <= 0 ? 0 : n <= 30 * g ? 10 : n <= 60 * g ? 30 : Math.floor(n / h) * 60;
96
- }
97
- function fn(n) {
98
- return n instanceof Date ? n.getTime() : typeof n == "number" ? n : new Date(n).getTime();
99
- }
100
- function gn(n, e, d) {
101
- const [w, s] = X(() => Date.now()), c = n !== void 0;
102
- return b(() => {
103
- if (c || e === void 0 || (s(Date.now()), e - Date.now() <= 0)) return;
104
- const a = window.setInterval(
105
- () => {
106
- const l = Date.now();
107
- s(l), e - l <= 0 && window.clearInterval(a);
108
- },
109
- Math.max(1, d)
110
- );
111
- return () => window.clearInterval(a);
112
- }, [c, e, d]), c ? Math.max(0, n) : e === void 0 ? 0 : Math.max(0, e - w);
113
- }
114
- const wn = H(
115
- ({
116
- remainingMs: n,
117
- expiresAt: e,
118
- totalMs: d = an,
119
- warnAtMs: w = dn,
120
- size: s = "md",
121
- showProgress: c = !1,
122
- onExpire: a,
123
- onRestart: l,
124
- restarting: L = !1,
125
- tickMs: M = 1e3,
126
- locale: D,
127
- label: I,
128
- className: j,
129
- id: x,
130
- ...R
131
- }, z) => {
132
- const { t: o, i18n: A } = G("ui"), y = D ?? A.language ?? "en";
133
- b(() => {
134
- }, [n, e]);
135
- const F = v(
136
- () => n === void 0 && e !== void 0 ? fn(e) : void 0,
137
- [n, e]
138
- ), i = gn(n, F, M), u = un(i, w), r = u === "expired", f = W(!1);
139
- b(() => {
140
- i <= 0 && !f.current && (f.current = !0, a == null || a()), i > 0 && f.current && (f.current = !1);
141
- }, [i, a]);
142
- const p = v(
143
- () => new Intl.NumberFormat(y, { maximumFractionDigits: 0 }),
144
- [y]
145
- ), C = Math.ceil(i / g), _ = Math.floor(C / 60), N = C % 60, B = _ > 0 ? o("sessionCountdown.timeMinutesSeconds", {
146
- minutes: p.format(_),
147
- seconds: p.format(N)
148
- }) : o("sessionCountdown.timeSecondsOnly", {
149
- seconds: p.format(N)
150
- }), m = mn(i), S = v(() => m <= 0 ? o("sessionCountdown.expiredAnnouncement") : m < 60 ? o("sessionCountdown.secondsRemaining", { count: m }) : o("sessionCountdown.minutesRemaining", { count: m / 60 }), [m, o]), O = o("sessionCountdown.expiredAnnouncement"), U = I ?? (r ? void 0 : o("sessionCountdown.ariaLabel", { time: S })), q = cn({
151
- size: s,
152
- tone: u,
153
- className: j
154
- }), K = r ? "alert" : "timer";
155
- E(tn, null, x);
156
- const P = r ? on : u === "warning" ? nn : rn, V = Math.min(d, Math.max(0, d - i)), $ = o(r ? "sessionCountdown.expired" : u === "warning" ? "sessionCountdown.warning" : "sessionCountdown.remainingBanner", { time: B });
157
- return /* @__PURE__ */ T(
158
- "div",
159
- {
160
- ref: z,
161
- id: x,
162
- role: K,
163
- "aria-label": U,
164
- "data-component": "session-countdown",
165
- "data-tone": u,
166
- className: q,
167
- ...R,
168
- children: [
169
- r ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: O }) : null,
170
- /* @__PURE__ */ T("div", { className: "ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-sm)]", children: [
171
- /* @__PURE__ */ t("span", { className: `ds:shrink-0 ${ln[s]}`, children: /* @__PURE__ */ t(P, { "aria-hidden": "true", className: "ds:size-full" }) }),
172
- /* @__PURE__ */ t(
173
- "p",
174
- {
175
- className: [
176
- "ds:min-w-0 ds:flex-1",
177
- s === "lg" ? "type-body" : "type-body-sm"
178
- ].join(" "),
179
- "aria-hidden": "true",
180
- children: $
181
- }
182
- ),
183
- r && l ? /* @__PURE__ */ t(
184
- J,
185
- {
186
- type: "button",
187
- intent: "tonal",
188
- size: s === "lg" ? "lg" : "md",
189
- loading: L,
190
- onClick: l,
191
- className: "ds:shrink-0",
192
- children: o("sessionCountdown.restart")
193
- }
194
- ) : null
195
- ] }),
196
- c && !r ? (
197
- // Elapsed fraction flows through the existing Progress API
198
- // (value/max) — never a hand-rolled inline-width bar. The bar
199
- // is aria-hidden: the timer region already conveys remaining
200
- // time, so a second progressbar would double-announce.
201
- /* @__PURE__ */ t("div", { "aria-hidden": "true", className: "ds:w-full", children: /* @__PURE__ */ t(
202
- Q,
203
- {
204
- value: V,
205
- max: d,
206
- shape: "bar",
207
- size: s,
208
- ariaLabel: o("sessionCountdown.progressLabel")
209
- }
210
- ) })
211
- ) : null,
212
- /* @__PURE__ */ t(Y, { politeness: "polite", atomic: !0, children: r ? "" : S })
213
- ]
214
- }
215
- );
216
- }
217
- );
218
- wn.displayName = "SessionCountdown";
219
- export {
220
- wn as S,
221
- tn as s
222
- };
223
- //# sourceMappingURL=session-countdown-C4tzbJVc.js.map