@alfadocs/ui-kit 1.132.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.
- package/dist/_chunks/{agenda-card-B8hV3dZV.js → agenda-card-B9wgX_Ed.js} +2 -2
- package/dist/_chunks/{agenda-tray-Bu46s3dI.js → agenda-tray-CGcS_qoM.js} +2 -2
- package/dist/_chunks/appointment-card-DG3m9yN-.js +504 -0
- package/dist/_chunks/{appointment-peek-DZa6xyUb.js → appointment-peek-BK0tDs4C.js} +2 -2
- package/dist/_chunks/{appointment-timeline-DQePqpyH.js → appointment-timeline-BiI2riRZ.js} +2 -2
- package/dist/_chunks/appointment-tray-ClJCtYQj.js +200 -0
- package/dist/_chunks/{appointment-workflow-status-DMjuIK90.js → appointment-workflow-status-S-lx81Yz.js} +2 -2
- package/dist/_chunks/ban-CiSCCcOE.js +15 -0
- package/dist/_chunks/{calendar-BIoOeBTT.js → calendar-CyLtLBNP.js} +2 -2
- package/dist/_chunks/calendar-appointment-editor-dialog-BSkIYGlW.js +13773 -0
- package/dist/_chunks/{calendar-event-card-BNEzkjm-.js → calendar-event-card-BJifpYZQ.js} +7 -6
- package/dist/_chunks/{care-plan-card-DKScH9Ss.js → care-plan-card-CjHq6PLo.js} +6 -6
- package/dist/_chunks/{care-plan-entry-card-AG1y3nyW.js → care-plan-entry-card-DY1toF6E.js} +2 -2
- package/dist/_chunks/{care-plan-header-Dx5OMkc9.js → care-plan-header-CeFXUDnL.js} +6 -6
- package/dist/_chunks/check-in-documents-CEVcgcYZ.js +136 -0
- package/dist/_chunks/{clinical-note-card-pPaeWWnu.js → clinical-note-card-D--IwbZa.js} +2 -2
- package/dist/_chunks/document-preview-DLVIrOYV.js +385 -0
- package/dist/_chunks/{entity-card-fpm-KUKc.js → entity-card-p-LANpYt.js} +18 -17
- package/dist/_chunks/{error-page-B0fGNTRB.js → error-page-WLhmWUTq.js} +100 -115
- package/dist/_chunks/finished-terminal-unDnXT4j.js +191 -0
- package/dist/_chunks/house-DGCypGTo.js +21 -0
- package/dist/_chunks/is-safe-url-CEy9CEml.js +8 -0
- package/dist/_chunks/keypad-DBH_keVs.js +152 -0
- package/dist/_chunks/keypad-button-mOaPQRrH.js +114 -0
- package/dist/_chunks/{message-card-BG3_3nN1.js → message-card-Bw_q1qKx.js} +2 -2
- package/dist/_chunks/{message-tray-BjZv0Fsk.js → message-tray-pLGgLmoG.js} +2 -2
- package/dist/_chunks/{note-attachment-MNTIqdSz.js → note-attachment-JTIy9iXN.js} +2 -2
- package/dist/_chunks/{note-timeline-BQeW0VZY.js → note-timeline-BbjHMhkL.js} +2 -2
- package/dist/_chunks/{notes-panel-Cm-_pCRJ.js → notes-panel-BAyPOr8N.js} +2 -2
- package/dist/_chunks/{operator-hero-CnfWckNQ.js → operator-hero-D4wfVu2l.js} +2 -2
- package/dist/_chunks/otp-input-BNOTlxq3.js +342 -0
- package/dist/_chunks/patient-account-settings-BkAtIxJW.js +546 -0
- package/dist/_chunks/patient-card-DTh3QTyS.js +125 -0
- package/dist/_chunks/patient-check-in-resume-xhqjC6gf.js +742 -0
- package/dist/_chunks/patient-sign-in-pin-CDBqV254.js +432 -0
- package/dist/_chunks/patient-sign-in-steps-C2JSqlok.js +199 -0
- package/dist/_chunks/{patient-summary-card-BUcZ-gaL.js → patient-summary-card-Bl2NknPe.js} +2 -2
- package/dist/_chunks/{payment-request-card-Dv4WbRBe.js → payment-request-card-CNW00DCx.js} +6 -6
- package/dist/_chunks/{pdf-viewer-BnBKdx0y.js → pdf-viewer-TRC5jEm5.js} +472 -425
- package/dist/_chunks/pin-entry-BugWQMOS.js +219 -0
- package/dist/_chunks/pin-indicator-Cb-n40UI.js +124 -0
- package/dist/_chunks/portal-details-CTEsm705.js +478 -0
- package/dist/_chunks/portal-documents-D8skew0h.js +902 -0
- package/dist/_chunks/portal-parts-BdR29P7z.js +285 -0
- package/dist/_chunks/{privacy-mask-DJ1gee4c.js → privacy-mask-C19dJFMk.js} +5 -5
- package/dist/_chunks/{product-hub-panel-a8wdVOUt.js → product-hub-panel-K4QbULG7.js} +2 -2
- package/dist/_chunks/{registration-form-CwbhtKcy.js → registration-form-DS3RuKHu.js} +2 -2
- package/dist/_chunks/{reserved.agent-W8mR179D.js → reserved.agent-DOzOBUW7.js} +2 -2
- package/dist/_chunks/session-countdown-DOx1IBUB.js +232 -0
- package/dist/_chunks/{sign-document-CQZVzfpk.js → sign-document-DDZbmYHu.js} +2 -2
- package/dist/_chunks/{signature-field-DjabvRZm.js → signature-field-BjlY_yXH.js} +39 -34
- package/dist/_chunks/{signature-request-4pGq3YBe.js → signature-request-CHsM_iWi.js} +2 -2
- package/dist/_chunks/{signature-status-chip-pIoQjvH8.js → signature-status-chip-DS9hHwIt.js} +66 -69
- package/dist/_chunks/signing-end-screen-an9P8DOT.js +1041 -0
- package/dist/_chunks/sms-code-entry-Dgp4GwlM.js +316 -0
- package/dist/_chunks/step-up-dialog-C2JqJmCA.js +132 -0
- package/dist/_chunks/{task-editor-BL2hHxNz.js → task-editor-g1AGfxhr.js} +38 -38
- package/dist/_chunks/{use-appointment-details-read-_b7FRB1x.js → use-appointment-details-read-Dzc6fEzG.js} +6 -6
- package/dist/_chunks/use-zoom-drilldown-Cr1baU5X.js +221 -0
- package/dist/_chunks/{user-x-DYszNtIg.js → user-x-BJZg4kaP.js} +8 -19
- package/dist/_chunks/{verify-identity-types-CxtrBXsZ.js → verify-identity-types-C6Bam8v6.js} +2 -2
- package/dist/agent-catalog.json +723 -364
- package/dist/agent-i18n/en.json +75 -18
- package/dist/browser-support.js +1 -1
- package/dist/components/_shared/is-safe-url.d.ts +3 -1
- package/dist/components/agenda-card/index.js +2 -2
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts +45 -0
- package/dist/components/appointment-card/appointment-tray.d.ts +11 -0
- package/dist/components/appointment-card/index.js +3 -3
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/appointment-peek/index.js +1 -1
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/calendar-event-card/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/document-preview/document-preview.d.ts +61 -7
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/finished-terminal/finished-terminal.d.ts +63 -6
- package/dist/components/finished-terminal/index.d.ts +1 -1
- package/dist/components/finished-terminal/index.js +1 -1
- package/dist/components/index.d.ts +12 -0
- package/dist/components/keypad/index.d.ts +3 -0
- package/dist/components/keypad/index.js +6 -0
- package/dist/components/keypad/keypad.d.ts +54 -0
- package/dist/components/keypad-button/index.d.ts +3 -0
- package/dist/components/keypad-button/index.js +6 -0
- package/dist/components/keypad-button/keypad-button.d.ts +33 -0
- package/dist/components/message-card/index.js +2 -2
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/note-timeline/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +11 -0
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +7 -0
- package/dist/components/pin-entry/index.d.ts +3 -0
- package/dist/components/pin-entry/index.js +5 -0
- package/dist/components/pin-entry/pin-entry.agent.d.ts +4 -0
- package/dist/components/pin-entry/pin-entry.d.ts +64 -0
- package/dist/components/pin-indicator/index.d.ts +3 -0
- package/dist/components/pin-indicator/index.js +9 -0
- package/dist/components/pin-indicator/pin-indicator.d.ts +34 -0
- package/dist/components/product-hub-tray/index.js +2 -2
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/session-countdown/session-countdown.d.ts +19 -0
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/signature-field/signature-field.d.ts +17 -6
- package/dist/components/signature-status-chip/index.js +1 -1
- package/dist/components/signature-status-chip/signature-status-chip.d.ts +3 -2
- package/dist/components/sms-code-entry/index.d.ts +3 -0
- package/dist/components/sms-code-entry/index.js +5 -0
- package/dist/components/sms-code-entry/sms-code-entry.agent.d.ts +4 -0
- package/dist/components/sms-code-entry/sms-code-entry.d.ts +156 -0
- package/dist/components/step-up-dialog/index.d.ts +3 -0
- package/dist/components/step-up-dialog/index.js +5 -0
- package/dist/components/step-up-dialog/step-up-dialog.d.ts +108 -0
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/workflow-status/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-signing-session.d.ts +7 -2
- package/dist/host-compat.css +10 -1
- package/dist/i18n/locales/ar.d.ts +514 -1
- package/dist/i18n/locales/ar.js +512 -4
- package/dist/i18n/locales/de.d.ts +514 -1
- package/dist/i18n/locales/de.js +520 -5
- package/dist/i18n/locales/el.d.ts +514 -1
- package/dist/i18n/locales/el.js +515 -5
- package/dist/i18n/locales/en.d.ts +516 -1
- package/dist/i18n/locales/en.js +522 -4
- package/dist/i18n/locales/es.d.ts +514 -1
- package/dist/i18n/locales/es.js +513 -5
- package/dist/i18n/locales/fr.d.ts +514 -1
- package/dist/i18n/locales/fr.js +513 -5
- package/dist/i18n/locales/hi.d.ts +514 -1
- package/dist/i18n/locales/hi.js +513 -5
- package/dist/i18n/locales/it.d.ts +514 -1
- package/dist/i18n/locales/it.js +520 -5
- package/dist/i18n/locales/ja.d.ts +514 -1
- package/dist/i18n/locales/ja.js +513 -5
- package/dist/i18n/locales/nl.d.ts +514 -1
- package/dist/i18n/locales/nl.js +520 -5
- package/dist/i18n/locales/pl.d.ts +514 -1
- package/dist/i18n/locales/pl.js +520 -5
- package/dist/i18n/locales/pt.d.ts +514 -1
- package/dist/i18n/locales/pt.js +520 -5
- package/dist/i18n/locales/ro.d.ts +514 -1
- package/dist/i18n/locales/ro.js +520 -5
- package/dist/i18n/locales/ru.d.ts +514 -1
- package/dist/i18n/locales/ru.js +512 -4
- package/dist/i18n/locales/sq.d.ts +514 -1
- package/dist/i18n/locales/sq.js +513 -5
- package/dist/i18n/locales/sv.d.ts +514 -1
- package/dist/i18n/locales/sv.js +513 -5
- package/dist/i18n/locales/tr.d.ts +514 -1
- package/dist/i18n/locales/tr.js +515 -5
- package/dist/i18n/locales/zh.d.ts +514 -1
- package/dist/i18n/locales/zh.js +513 -5
- package/dist/index.js +1271 -1204
- package/dist/locales/ar.json +516 -3
- package/dist/locales/de.json +517 -4
- package/dist/locales/el.json +517 -4
- package/dist/locales/en.json +516 -3
- package/dist/locales/es.json +517 -4
- package/dist/locales/fr.json +517 -4
- package/dist/locales/hi.json +517 -4
- package/dist/locales/it.json +517 -4
- package/dist/locales/ja.json +517 -4
- package/dist/locales/nl.json +517 -4
- package/dist/locales/pl.json +517 -4
- package/dist/locales/pt.json +517 -4
- package/dist/locales/ro.json +517 -4
- package/dist/locales/ru.json +516 -3
- package/dist/locales/sq.json +517 -4
- package/dist/locales/sv.json +517 -4
- package/dist/locales/tr.json +517 -4
- package/dist/locales/zh.json +517 -4
- package/dist/patterns/calendar/calendar.journey.d.ts +4 -0
- package/dist/patterns/calendar/calendar.surface.d.ts +15 -1
- package/dist/patterns/calendar/calendar.types.d.ts +4 -0
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/check-in-documents/check-in-documents.d.ts +61 -0
- package/dist/patterns/check-in-documents/check-in-signable-document.d.ts +32 -0
- package/dist/patterns/check-in-documents/index.d.ts +4 -0
- package/dist/patterns/check-in-documents/index.js +5 -0
- package/dist/patterns/error-page/index.js +1 -1
- package/dist/patterns/patient-account-settings/index.d.ts +4 -0
- package/dist/patterns/patient-account-settings/index.js +5 -0
- package/dist/patterns/patient-account-settings/patient-account-settings-panels.d.ts +36 -0
- package/dist/patterns/patient-account-settings/patient-account-settings.d.ts +94 -0
- package/dist/patterns/patient-account-settings/patient-account-settings.types.d.ts +91 -0
- package/dist/patterns/patient-check-in/index.d.ts +20 -0
- package/dist/patterns/patient-check-in/index.js +13 -0
- package/dist/patterns/patient-check-in/patient-check-in-changed.d.ts +33 -0
- package/dist/patterns/patient-check-in/patient-check-in-connection-notice.d.ts +29 -0
- package/dist/patterns/patient-check-in/patient-check-in-done.d.ts +25 -0
- package/dist/patterns/patient-check-in/patient-check-in-entry.d.ts +29 -0
- package/dist/patterns/patient-check-in/patient-check-in-hub-empty.d.ts +23 -0
- package/dist/patterns/patient-check-in/patient-check-in-hub.d.ts +61 -0
- package/dist/patterns/patient-check-in/patient-check-in-personal-data.d.ts +73 -0
- package/dist/patterns/patient-check-in/patient-check-in-privacy.d.ts +9 -0
- package/dist/patterns/patient-check-in/patient-check-in-resume.d.ts +29 -0
- package/dist/patterns/patient-check-in/patient-check-in-shell.d.ts +60 -0
- package/dist/patterns/patient-check-in/patient-check-in-types.d.ts +92 -0
- package/dist/patterns/patient-portal/index.d.ts +12 -0
- package/dist/patterns/patient-portal/index.js +13 -0
- package/dist/patterns/patient-portal/portal-appointments.d.ts +70 -0
- package/dist/patterns/patient-portal/portal-details.d.ts +148 -0
- package/dist/patterns/patient-portal/portal-documents.d.ts +74 -0
- package/dist/patterns/patient-portal/portal-format.d.ts +14 -0
- package/dist/patterns/patient-portal/portal-home.d.ts +71 -0
- package/dist/patterns/patient-portal/portal-parts.d.ts +107 -0
- package/dist/patterns/patient-portal/portal-shell.d.ts +84 -0
- package/dist/patterns/patient-portal/portal-types.d.ts +157 -0
- package/dist/patterns/patient-sign-in/index.d.ts +7 -0
- package/dist/patterns/patient-sign-in/index.js +15 -0
- package/dist/patterns/patient-sign-in/patient-card.d.ts +74 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-email.d.ts +109 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-pin.d.ts +157 -0
- package/dist/patterns/patient-sign-in/patient-sign-in-steps.d.ts +143 -0
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signing/index.d.ts +25 -0
- package/dist/patterns/signing/index.js +16 -0
- package/dist/patterns/signing/multi-field-signer.d.ts +117 -0
- package/dist/patterns/signing/signing-awaiting-screen.d.ts +25 -0
- package/dist/patterns/signing/signing-chrome.d.ts +30 -0
- package/dist/patterns/signing/signing-document-screen.d.ts +87 -0
- package/dist/patterns/signing/signing-end-screen.d.ts +27 -0
- package/dist/patterns/signing/signing-finished-screen.d.ts +34 -0
- package/dist/patterns/signing/signing-footer.d.ts +56 -0
- package/dist/patterns/signing/signing-handoff-screen.d.ts +37 -0
- package/dist/patterns/signing/signing-message-dialog.d.ts +29 -0
- package/dist/patterns/signing/signing-progress-chip.d.ts +27 -0
- package/dist/patterns/signing/signing-roster.d.ts +44 -0
- package/dist/patterns/signing/signing-staff-id-confirmation.d.ts +49 -0
- package/dist/patterns/verify-identity/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +49 -1
- package/dist/_chunks/appointment-card-OAOur8lH.js +0 -434
- package/dist/_chunks/appointment-tray-DSFqO5Rm.js +0 -193
- package/dist/_chunks/calendar-appointment-editor-dialog-WW6V1SGh.js +0 -13663
- package/dist/_chunks/document-preview-_kQ9QvZV.js +0 -291
- package/dist/_chunks/finished-terminal-FR8uc_Ws.js +0 -122
- package/dist/_chunks/is-safe-url-DkETxeHz.js +0 -7
- package/dist/_chunks/otp-input-gV1446Dw.js +0 -301
- package/dist/_chunks/session-countdown-C4tzbJVc.js +0 -223
- package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js +0 -210
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { jsxs as h, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $e, useId as De, useRef as a, useState as pe, useEffect as w, useMemo as He } from "react";
|
|
3
|
+
import { c as J } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as We, Trans as Ve } from "react-i18next";
|
|
5
|
+
import { u as ze } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { u as Le } from "./use-controllable-state-BiY4xTzM.js";
|
|
7
|
+
import { a as q } from "./format-number-DdzqwMs1.js";
|
|
8
|
+
import { A as y } from "./alert-C4WKViaS.js";
|
|
9
|
+
import { B as fe } from "./button-DohK_Ak_.js";
|
|
10
|
+
import { O as Oe } from "./otp-input-BNOTlxq3.js";
|
|
11
|
+
import { C as Pe } from "./circle-alert-rGDZ73Wh.js";
|
|
12
|
+
const je = {
|
|
13
|
+
id: "sms-code-entry",
|
|
14
|
+
capabilities: [],
|
|
15
|
+
state: {
|
|
16
|
+
filledCount: {
|
|
17
|
+
type: "number",
|
|
18
|
+
descriptionKey: "ui.agent.smsCodeEntry.state.filledCount",
|
|
19
|
+
description: "How many digits are typed. Never the digits themselves.",
|
|
20
|
+
read: (t) => t.getFilledCount()
|
|
21
|
+
},
|
|
22
|
+
length: {
|
|
23
|
+
type: "number",
|
|
24
|
+
descriptionKey: "ui.agent.smsCodeEntry.state.length",
|
|
25
|
+
description: "How many digits the code has.",
|
|
26
|
+
read: (t) => t.getLength()
|
|
27
|
+
},
|
|
28
|
+
isComplete: {
|
|
29
|
+
type: "boolean",
|
|
30
|
+
descriptionKey: "ui.agent.smsCodeEntry.state.isComplete",
|
|
31
|
+
description: "Whether every box is filled, so the person can press the submit button.",
|
|
32
|
+
read: (t) => t.isComplete()
|
|
33
|
+
},
|
|
34
|
+
error: {
|
|
35
|
+
type: "'wrong' | 'expired' | 'locked' | 'send-failed' | 'resend-limit' | null",
|
|
36
|
+
descriptionKey: "ui.agent.smsCodeEntry.state.error",
|
|
37
|
+
description: "What the host reported about the code: wrong, expired, locked, send-failed or resend-limit, or null when it reported nothing.",
|
|
38
|
+
read: (t) => t.getError()
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
actions: {
|
|
42
|
+
clear: {
|
|
43
|
+
safety: "destructive",
|
|
44
|
+
idempotent: !0,
|
|
45
|
+
descriptionKey: "ui.agent.smsCodeEntry.actions.clear",
|
|
46
|
+
description: "Empty the boxes. Loses the digits typed so far.",
|
|
47
|
+
invoke: (t) => {
|
|
48
|
+
t.clear();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
focus: {
|
|
52
|
+
safety: "read",
|
|
53
|
+
idempotent: !0,
|
|
54
|
+
descriptionKey: "ui.agent.smsCodeEntry.actions.focus",
|
|
55
|
+
description: "Move keyboard focus to the code boxes, so the person can type or paste the code. Does nothing while the boxes are disabled.",
|
|
56
|
+
invoke: (t) => {
|
|
57
|
+
t.focus();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
domHooks: {
|
|
62
|
+
root: {
|
|
63
|
+
attr: "data-component",
|
|
64
|
+
value: "sms-code-entry",
|
|
65
|
+
description: 'Marks the SMS code step: the sentence naming the masked mobile, the code boxes (an OTPInput), the notes, "Send a new code" and the submit button.'
|
|
66
|
+
},
|
|
67
|
+
instanceId: {
|
|
68
|
+
attr: "data-component-id",
|
|
69
|
+
sourceProp: "id",
|
|
70
|
+
description: "Sourced from the id prop."
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, Ge = J(
|
|
74
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:break-words"
|
|
75
|
+
), Ue = J(
|
|
76
|
+
"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]"
|
|
77
|
+
), Ye = J("", {
|
|
78
|
+
variants: { empty: { true: "ds:sr-only", false: "" } },
|
|
79
|
+
defaultVariants: { empty: !0 }
|
|
80
|
+
}), he = 6;
|
|
81
|
+
function _e(t) {
|
|
82
|
+
const i = Number.isFinite(t) ? Math.floor(t) : he;
|
|
83
|
+
return Math.min(10, Math.max(3, i));
|
|
84
|
+
}
|
|
85
|
+
function qe(t, i) {
|
|
86
|
+
return t.replace(/[٠-٩]/g, (g) => String(g.charCodeAt(0) - 1632)).replace(/[۰-۹]/g, (g) => String(g.charCodeAt(0) - 1776)).replace(/\D/g, "").slice(0, i);
|
|
87
|
+
}
|
|
88
|
+
function Je(t) {
|
|
89
|
+
return typeof t == "number" && Number.isFinite(t) ? Math.max(0, Math.ceil(t)) : 0;
|
|
90
|
+
}
|
|
91
|
+
function Qe(t) {
|
|
92
|
+
return typeof t == "number" && Number.isFinite(t) && t > 0 ? t : void 0;
|
|
93
|
+
}
|
|
94
|
+
const Xe = $e(
|
|
95
|
+
({
|
|
96
|
+
destination: t,
|
|
97
|
+
body: i,
|
|
98
|
+
length: g = he,
|
|
99
|
+
value: ye,
|
|
100
|
+
defaultValue: ge,
|
|
101
|
+
onValueChange: Ce,
|
|
102
|
+
onSubmit: $,
|
|
103
|
+
submitLabel: k,
|
|
104
|
+
submitting: l = !1,
|
|
105
|
+
error: o = null,
|
|
106
|
+
errorText: M,
|
|
107
|
+
remainingSeconds: ve,
|
|
108
|
+
onResend: B,
|
|
109
|
+
resent: Ee = !1,
|
|
110
|
+
validityMinutes: xe,
|
|
111
|
+
note: D,
|
|
112
|
+
autofillHint: H = !0,
|
|
113
|
+
contactPracticeHint: be = !1,
|
|
114
|
+
disabled: F = !1,
|
|
115
|
+
autoFocus: Q = !1,
|
|
116
|
+
name: Ne,
|
|
117
|
+
id: W,
|
|
118
|
+
className: we,
|
|
119
|
+
privacy: X = !1,
|
|
120
|
+
...d
|
|
121
|
+
}, S) => {
|
|
122
|
+
const { t: s, i18n: V } = We("ui"), z = De(), I = `${z}-body`, Z = `${z}-notes`, ee = `${z}-error`, C = a(null), c = _e(g), te = q(c, V.language), [ke, v] = Le({
|
|
123
|
+
value: ye,
|
|
124
|
+
defaultValue: ge ?? "",
|
|
125
|
+
onChange: Ce
|
|
126
|
+
}), E = qe(ke ?? "", c), ne = E.length === c, [L, O] = pe(0), P = a(!1), se = a(null), oe = a(null), j = a(!1), A = a(!1), u = o === "locked" || o === "send-failed", G = o === "resend-limit", re = o === "wrong" || o === "expired", m = F || l || u, x = M != null && M.trim() ? M : void 0, T = l ? void 0 : o === "wrong" ? x ?? s("smsCodeEntry.wrong") : o === "expired" ? x ?? s("smsCodeEntry.expired") : void 0, ce = o === "locked" ? x ?? s("smsCodeEntry.locked") : o === "send-failed" ? x ?? s("smsCodeEntry.sendFailed") : void 0, ae = Ee && !o, U = Je(ve), Y = U > 0, ie = !!B && !u && !G, p = ie && Y, K = ie && !Y, de = be && (u || !Y), _ = s("smsCodeEntry.resendIn", {
|
|
127
|
+
count: U,
|
|
128
|
+
seconds: q(U, V.language)
|
|
129
|
+
}), R = Qe(xe), le = H || R !== void 0 || !!D, ue = le ? `${I} ${Z}` : I, Me = !X && !!(t != null && t.trim()), Be = !l && (u || !ne), Fe = k != null && k.trim() ? k : s("smsCodeEntry.submit"), b = Ue(), [Se, Ie] = pe(""), me = a(!1);
|
|
130
|
+
w(() => {
|
|
131
|
+
if (p === me.current) return;
|
|
132
|
+
me.current = p;
|
|
133
|
+
const e = p ? _ : K ? s("smsCodeEntry.resendReady") : "";
|
|
134
|
+
Ie(e);
|
|
135
|
+
}, [p, K, _, s]), w(() => {
|
|
136
|
+
var e;
|
|
137
|
+
!P.current || !re || m || (P.current = !1, (e = C.current) == null || e.focus());
|
|
138
|
+
}, [L, re, m]), w(() => {
|
|
139
|
+
var r;
|
|
140
|
+
if (!u || !j.current) return;
|
|
141
|
+
const e = document.activeElement;
|
|
142
|
+
(e === null || e === document.body) && ((r = oe.current) == null || r.focus());
|
|
143
|
+
}, [u]), w(() => {
|
|
144
|
+
var e;
|
|
145
|
+
!A.current || m || (A.current = !1, (e = C.current) == null || e.focus());
|
|
146
|
+
}, [L, m]), w(() => {
|
|
147
|
+
var e;
|
|
148
|
+
Q && ((e = C.current) == null || e.focus());
|
|
149
|
+
}, [Q]);
|
|
150
|
+
const Ae = () => {
|
|
151
|
+
m || !ne || ($ == null || $(E), v(""), O((e) => e + 1), P.current = !0);
|
|
152
|
+
}, Te = () => {
|
|
153
|
+
F || l || (B == null || B(), v(""), A.current = !0, O((e) => e + 1));
|
|
154
|
+
}, f = a({ code: E, length: c, error: o });
|
|
155
|
+
f.current = { code: E, length: c, error: o };
|
|
156
|
+
const Ke = He(
|
|
157
|
+
() => ({
|
|
158
|
+
clear: () => {
|
|
159
|
+
var N;
|
|
160
|
+
const e = document.activeElement;
|
|
161
|
+
e instanceof HTMLInputElement && !!((N = se.current) != null && N.contains(e)) && (A.current = !0), v(""), O((Re) => Re + 1);
|
|
162
|
+
},
|
|
163
|
+
focus: () => {
|
|
164
|
+
var e;
|
|
165
|
+
(e = C.current) == null || e.focus();
|
|
166
|
+
},
|
|
167
|
+
getFilledCount: () => f.current.code.length,
|
|
168
|
+
getLength: () => f.current.length,
|
|
169
|
+
isComplete: () => f.current.code.length === f.current.length,
|
|
170
|
+
getError: () => f.current.error
|
|
171
|
+
}),
|
|
172
|
+
[v]
|
|
173
|
+
);
|
|
174
|
+
return ze(je, Ke, W), /* @__PURE__ */ h(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
...d,
|
|
178
|
+
ref: (e) => {
|
|
179
|
+
se.current = e, typeof S == "function" ? S(e) : S && (S.current = e);
|
|
180
|
+
},
|
|
181
|
+
id: W,
|
|
182
|
+
onFocus: (e) => {
|
|
183
|
+
var r;
|
|
184
|
+
j.current = !0, (r = d.onFocus) == null || r.call(d, e);
|
|
185
|
+
},
|
|
186
|
+
onBlur: (e) => {
|
|
187
|
+
var N;
|
|
188
|
+
const r = e.relatedTarget;
|
|
189
|
+
r instanceof Node && !e.currentTarget.contains(r) && (j.current = !1), (N = d.onBlur) == null || N.call(d, e);
|
|
190
|
+
},
|
|
191
|
+
"data-component": "sms-code-entry",
|
|
192
|
+
"data-component-id": W,
|
|
193
|
+
"data-privacy": X ? "masked" : void 0,
|
|
194
|
+
className: Ge({ className: we }),
|
|
195
|
+
children: [
|
|
196
|
+
i != null ? /* @__PURE__ */ n("div", { id: I, className: "type-body", children: i }) : /* @__PURE__ */ n("p", { id: I, className: "type-body ds:m-0", children: Me ? /* @__PURE__ */ n(
|
|
197
|
+
Ve,
|
|
198
|
+
{
|
|
199
|
+
t: s,
|
|
200
|
+
ns: "ui",
|
|
201
|
+
i18nKey: "smsCodeEntry.body",
|
|
202
|
+
count: c,
|
|
203
|
+
values: { length: te, destination: t },
|
|
204
|
+
components: {
|
|
205
|
+
dest: /* @__PURE__ */ n("bdi", { dir: "ltr", className: "ds:font-semibold" })
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
) : s("smsCodeEntry.bodyYourMobile", {
|
|
209
|
+
count: c,
|
|
210
|
+
length: te
|
|
211
|
+
}) }),
|
|
212
|
+
ce ? /* @__PURE__ */ n(y, { variant: "error", announce: "assertive", children: /* @__PURE__ */ n(y.Description, { children: ce }) }) : null,
|
|
213
|
+
/* @__PURE__ */ h(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
role: "status",
|
|
217
|
+
className: Ye({ empty: !G && !ae }),
|
|
218
|
+
children: [
|
|
219
|
+
G ? /* @__PURE__ */ n(y, { variant: "warning", announce: "off", children: /* @__PURE__ */ n(y.Description, { children: x ?? s("smsCodeEntry.resendLimit") }) }) : null,
|
|
220
|
+
ae ? /* @__PURE__ */ n(y, { variant: "success", announce: "off", children: /* @__PURE__ */ n(y.Description, { children: s("smsCodeEntry.resent") }) }) : null
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ h("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
225
|
+
/* @__PURE__ */ n(
|
|
226
|
+
Oe,
|
|
227
|
+
{
|
|
228
|
+
label: s("smsCodeEntry.label"),
|
|
229
|
+
ref: C,
|
|
230
|
+
length: c,
|
|
231
|
+
groupSize: 3,
|
|
232
|
+
value: E,
|
|
233
|
+
onChange: v,
|
|
234
|
+
disabled: m,
|
|
235
|
+
webOtp: H,
|
|
236
|
+
name: Ne,
|
|
237
|
+
error: !!T,
|
|
238
|
+
"aria-describedby": T ? `${ee} ${ue}` : ue
|
|
239
|
+
},
|
|
240
|
+
L
|
|
241
|
+
),
|
|
242
|
+
T ? /* @__PURE__ */ h(
|
|
243
|
+
"p",
|
|
244
|
+
{
|
|
245
|
+
id: ee,
|
|
246
|
+
role: "alert",
|
|
247
|
+
"data-slot": "error",
|
|
248
|
+
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive",
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ n(
|
|
251
|
+
Pe,
|
|
252
|
+
{
|
|
253
|
+
"aria-hidden": "true",
|
|
254
|
+
className: "ds:size-4 ds:shrink-0"
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
/* @__PURE__ */ n("span", { children: T })
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
) : null
|
|
261
|
+
] }),
|
|
262
|
+
le ? /* @__PURE__ */ h(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
id: Z,
|
|
266
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
267
|
+
children: [
|
|
268
|
+
H ? /* @__PURE__ */ n("p", { className: b, children: s("smsCodeEntry.autofill") }) : null,
|
|
269
|
+
R !== void 0 ? /* @__PURE__ */ n("p", { className: b, children: s("smsCodeEntry.validity", {
|
|
270
|
+
count: R,
|
|
271
|
+
minutes: q(R, V.language)
|
|
272
|
+
}) }) : null,
|
|
273
|
+
D ? /* @__PURE__ */ n("div", { className: b, children: D }) : null
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
) : null,
|
|
277
|
+
p || K || de ? /* @__PURE__ */ h("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
278
|
+
p ? /* @__PURE__ */ n("p", { className: b, children: _ }) : null,
|
|
279
|
+
K ? /* @__PURE__ */ n(
|
|
280
|
+
fe,
|
|
281
|
+
{
|
|
282
|
+
intent: "ghost",
|
|
283
|
+
className: "ds:min-h-[var(--min-target-size)]",
|
|
284
|
+
"data-action": "resend-code",
|
|
285
|
+
disabled: F || l,
|
|
286
|
+
onClick: Te,
|
|
287
|
+
children: s("smsCodeEntry.resend")
|
|
288
|
+
}
|
|
289
|
+
) : null,
|
|
290
|
+
de ? /* @__PURE__ */ n("p", { className: b, children: s("smsCodeEntry.contactPractice") }) : null
|
|
291
|
+
] }) : null,
|
|
292
|
+
/* @__PURE__ */ n("div", { role: "status", className: "ds:sr-only", children: Se }),
|
|
293
|
+
/* @__PURE__ */ n(
|
|
294
|
+
fe,
|
|
295
|
+
{
|
|
296
|
+
intent: "primary",
|
|
297
|
+
ref: oe,
|
|
298
|
+
className: "ds:w-full ds:min-h-[var(--min-target-size)]",
|
|
299
|
+
"data-action": "submit-code",
|
|
300
|
+
loading: l,
|
|
301
|
+
disabled: F,
|
|
302
|
+
"aria-disabled": Be || void 0,
|
|
303
|
+
onClick: Ae,
|
|
304
|
+
children: Fe
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
Xe.displayName = "SmsCodeEntry";
|
|
313
|
+
export {
|
|
314
|
+
Xe as S
|
|
315
|
+
};
|
|
316
|
+
//# sourceMappingURL=sms-code-entry-Dgp4GwlM.js.map
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as _, useRef as $ } from "react";
|
|
3
|
+
import { c as y } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as j } from "react-i18next";
|
|
5
|
+
import { B as L } from "./button-DohK_Ak_.js";
|
|
6
|
+
import { D as o } from "./dialog-CVTxyR0v.js";
|
|
7
|
+
import { S as M } from "./sms-code-entry-Dgp4GwlM.js";
|
|
8
|
+
const b = y(
|
|
9
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:break-words"
|
|
10
|
+
), ee = y(
|
|
11
|
+
"type-body ds:m-0 ds:text-[color:var(--foreground)]"
|
|
12
|
+
), te = _(
|
|
13
|
+
({
|
|
14
|
+
open: D,
|
|
15
|
+
defaultOpen: S,
|
|
16
|
+
onOpenChange: l,
|
|
17
|
+
title: i,
|
|
18
|
+
subject: s,
|
|
19
|
+
noMobile: n = !1,
|
|
20
|
+
noMobileText: x,
|
|
21
|
+
onCancel: d,
|
|
22
|
+
onSubmit: E,
|
|
23
|
+
submitLabel: a,
|
|
24
|
+
submitting: T,
|
|
25
|
+
disabled: F,
|
|
26
|
+
autoFocus: A = !0,
|
|
27
|
+
name: B,
|
|
28
|
+
privacy: p = !1,
|
|
29
|
+
id: f,
|
|
30
|
+
className: C,
|
|
31
|
+
destination: H,
|
|
32
|
+
length: N,
|
|
33
|
+
value: R,
|
|
34
|
+
defaultValue: U,
|
|
35
|
+
onValueChange: k,
|
|
36
|
+
error: w,
|
|
37
|
+
errorText: z,
|
|
38
|
+
remainingSeconds: V,
|
|
39
|
+
onResend: q,
|
|
40
|
+
resent: G,
|
|
41
|
+
validityMinutes: I,
|
|
42
|
+
note: J,
|
|
43
|
+
autofillHint: K,
|
|
44
|
+
contactPracticeHint: O,
|
|
45
|
+
...P
|
|
46
|
+
}, Q) => {
|
|
47
|
+
const { t: c } = j("ui"), m = $(null), W = i != null && i.trim() ? i : c("stepUpDialog.title"), h = s != null && typeof s != "boolean" && !(typeof s == "string" && s.trim() === ""), g = h || n, X = (t) => {
|
|
48
|
+
l == null || l(t), t || d == null || d();
|
|
49
|
+
}, Y = (t) => {
|
|
50
|
+
const r = document.activeElement;
|
|
51
|
+
m.current = r instanceof HTMLElement && r !== document.body ? r : null, !A && (t.preventDefault(), t.target instanceof HTMLElement && t.target.focus({ preventScroll: !0 }));
|
|
52
|
+
}, Z = (t) => {
|
|
53
|
+
if (t.target instanceof HTMLElement && t.target.isConnected)
|
|
54
|
+
return;
|
|
55
|
+
const r = m.current;
|
|
56
|
+
m.current = null;
|
|
57
|
+
const v = document.activeElement;
|
|
58
|
+
v !== null && v !== document.body || r === null || !r.isConnected || (t.preventDefault(), r.focus({ preventScroll: !0 }));
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ e(
|
|
61
|
+
o.Root,
|
|
62
|
+
{
|
|
63
|
+
id: f,
|
|
64
|
+
open: D,
|
|
65
|
+
defaultOpen: S,
|
|
66
|
+
onOpenChange: X,
|
|
67
|
+
children: /* @__PURE__ */ e(
|
|
68
|
+
o.Content,
|
|
69
|
+
{
|
|
70
|
+
...g ? {} : { "aria-describedby": void 0 },
|
|
71
|
+
...P,
|
|
72
|
+
ref: Q,
|
|
73
|
+
size: "sm",
|
|
74
|
+
hideCloseButton: !0,
|
|
75
|
+
className: C,
|
|
76
|
+
"data-privacy": p ? "masked" : void 0,
|
|
77
|
+
onOpenAutoFocus: Y,
|
|
78
|
+
onCloseAutoFocus: Z,
|
|
79
|
+
children: /* @__PURE__ */ u("div", { "data-component": "step-up-dialog", "data-component-id": f, children: [
|
|
80
|
+
/* @__PURE__ */ u(o.Header, { children: [
|
|
81
|
+
/* @__PURE__ */ e(o.Title, { children: W }),
|
|
82
|
+
g ? /* @__PURE__ */ e(o.Description, { asChild: !0, children: /* @__PURE__ */ u("div", { className: b(), children: [
|
|
83
|
+
h ? /* @__PURE__ */ e("div", { children: s }) : null,
|
|
84
|
+
n ? /* @__PURE__ */ e("p", { className: ee(), children: x ?? c("stepUpDialog.noMobile") }) : null
|
|
85
|
+
] }) }) : null
|
|
86
|
+
] }),
|
|
87
|
+
n ? null : /* @__PURE__ */ e(o.Body, { children: /* @__PURE__ */ e(
|
|
88
|
+
M,
|
|
89
|
+
{
|
|
90
|
+
destination: H,
|
|
91
|
+
length: N,
|
|
92
|
+
value: R,
|
|
93
|
+
defaultValue: U,
|
|
94
|
+
onValueChange: k,
|
|
95
|
+
onSubmit: E,
|
|
96
|
+
submitLabel: a != null && a.trim() ? a : c("common.confirm"),
|
|
97
|
+
submitting: T,
|
|
98
|
+
error: w,
|
|
99
|
+
errorText: z,
|
|
100
|
+
remainingSeconds: V,
|
|
101
|
+
onResend: q,
|
|
102
|
+
resent: G,
|
|
103
|
+
validityMinutes: I,
|
|
104
|
+
note: J,
|
|
105
|
+
autofillHint: K,
|
|
106
|
+
contactPracticeHint: O,
|
|
107
|
+
disabled: F,
|
|
108
|
+
name: B,
|
|
109
|
+
privacy: p
|
|
110
|
+
}
|
|
111
|
+
) }),
|
|
112
|
+
/* @__PURE__ */ e(o.Footer, { children: /* @__PURE__ */ e(o.Close, { asChild: !0, children: /* @__PURE__ */ e(
|
|
113
|
+
L,
|
|
114
|
+
{
|
|
115
|
+
intent: n ? "primary" : "outline",
|
|
116
|
+
className: "ds:min-h-[var(--min-target-size)]",
|
|
117
|
+
"data-action": n ? "close" : "cancel",
|
|
118
|
+
children: c(n ? "common.close" : "common.cancel")
|
|
119
|
+
}
|
|
120
|
+
) }) })
|
|
121
|
+
] })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
te.displayName = "StepUpDialog";
|
|
129
|
+
export {
|
|
130
|
+
te as S
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=step-up-dialog-C2JqJmCA.js.map
|