@alfadocs/ui-kit-debug 1.76.0 → 1.77.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/{balance-badge-cell-B49xgL6H.js → balance-badge-cell-Dzd-Z_5W.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-B49xgL6H.js.map → balance-badge-cell-Dzd-Z_5W.js.map} +1 -1
- package/dist/_chunks/booking-Cz_QjIJe.js +4051 -0
- package/dist/_chunks/booking-Cz_QjIJe.js.map +1 -0
- package/dist/_chunks/{breadcrumb-Boan-5n8.js → breadcrumb-Bn29NCnf.js} +8 -8
- package/dist/_chunks/breadcrumb-Bn29NCnf.js.map +1 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-B4My4eiB.js → calendar-appointment-editor-dialog-cvUpUjj-.js} +4 -4
- package/dist/_chunks/{calendar-appointment-editor-dialog-B4My4eiB.js.map → calendar-appointment-editor-dialog-cvUpUjj-.js.map} +1 -1
- package/dist/_chunks/{control-room-rail-CKZ2nemY.js → control-room-rail-DcJpHbp4.js} +2 -2
- package/dist/_chunks/{control-room-rail-CKZ2nemY.js.map → control-room-rail-DcJpHbp4.js.map} +1 -1
- package/dist/_chunks/{data-table-DTKGWUQm.js → data-table-BlONA1rP.js} +2 -2
- package/dist/_chunks/{data-table-DTKGWUQm.js.map → data-table-BlONA1rP.js.map} +1 -1
- package/dist/_chunks/{file-manager-Ct5QpZZI.js → file-manager-C9iJjDZt.js} +3 -3
- package/dist/_chunks/{file-manager-Ct5QpZZI.js.map → file-manager-C9iJjDZt.js.map} +1 -1
- package/dist/_chunks/{header-settings-Coh1r41O.js → header-settings-BYpVmLip.js} +2 -2
- package/dist/_chunks/{header-settings-Coh1r41O.js.map → header-settings-BYpVmLip.js.map} +1 -1
- package/dist/_chunks/{heatmap-Ba9cgfSY.js → heatmap-C2Rg-SV_.js} +2 -2
- package/dist/_chunks/{heatmap-Ba9cgfSY.js.map → heatmap-C2Rg-SV_.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-Ck5NVJcO.js → marketplace-app-shell-mS7Q2-81.js} +3 -3
- package/dist/_chunks/{marketplace-app-shell-Ck5NVJcO.js.map → marketplace-app-shell-mS7Q2-81.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CxjMovCh.js → notes-panel-CZO1qsD-.js} +2 -2
- package/dist/_chunks/{notes-panel-CxjMovCh.js.map → notes-panel-CZO1qsD-.js.map} +1 -1
- package/dist/_chunks/{otp-input-CGMu30_e.js → otp-input-BgEZi0py.js} +54 -53
- package/dist/_chunks/otp-input-BgEZi0py.js.map +1 -0
- package/dist/_chunks/{practice-results-C5SJTgcd.js → practice-results-By2BZFCz.js} +732 -709
- package/dist/_chunks/practice-results-By2BZFCz.js.map +1 -0
- package/dist/_chunks/{recaptcha-widget-CsvwlYTE.js → recaptcha-widget-iglUBIF3.js} +2 -2
- package/dist/_chunks/{recaptcha-widget-CsvwlYTE.js.map → recaptcha-widget-iglUBIF3.js.map} +1 -1
- package/dist/_chunks/{registration-form-DeK2QiJu.js → registration-form-xORq2s4p.js} +3 -3
- package/dist/_chunks/{registration-form-DeK2QiJu.js.map → registration-form-xORq2s4p.js.map} +1 -1
- package/dist/_chunks/signature-request-DjY-X62H.js +2448 -0
- package/dist/_chunks/signature-request-DjY-X62H.js.map +1 -0
- package/dist/_chunks/{tasks-panel-Cmr0oMvc.js → tasks-panel-BkjtgjQ8.js} +2 -2
- package/dist/_chunks/{tasks-panel-Cmr0oMvc.js.map → tasks-panel-BkjtgjQ8.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-DTrUzIBG.js → theme-toggle-DKpzb0-M.js} +2 -2
- package/dist/_chunks/{theme-toggle-DTrUzIBG.js.map → theme-toggle-DKpzb0-M.js.map} +1 -1
- package/dist/_chunks/{tool-rail-C_9lm0TC.js → tool-rail-Kup1b7xI.js} +2 -2
- package/dist/_chunks/{tool-rail-C_9lm0TC.js.map → tool-rail-Kup1b7xI.js.map} +1 -1
- package/dist/_chunks/use-theme-CYGyzFgZ.js +196 -0
- package/dist/_chunks/use-theme-CYGyzFgZ.js.map +1 -0
- package/dist/agent-catalog.json +46 -10
- package/dist/agent-i18n/en.json +5 -4
- package/dist/components/booking/booking-types.d.ts +22 -1
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.agent.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/code-step.d.ts +6 -0
- package/dist/components/booking/code-step.d.ts.map +1 -0
- package/dist/components/booking/index.d.ts +1 -1
- package/dist/components/booking/index.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/step-focus.d.ts +9 -0
- package/dist/components/booking/step-focus.d.ts.map +1 -0
- package/dist/components/booking/use-booking-payment.d.ts +6 -3
- package/dist/components/booking/use-booking-payment.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -0
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts +1 -1
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/recaptcha-widget/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +88 -86
- package/dist/hooks/use-theme.d.ts +9 -0
- package/dist/hooks/use-theme.d.ts.map +1 -1
- package/dist/host-compat.css +4 -1
- package/dist/i18n/locales/ar.d.ts +29 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +30 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +29 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +30 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +29 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +30 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +29 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +30 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +29 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +30 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +29 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +30 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +29 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +30 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +29 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +30 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +29 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +30 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +29 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +30 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +29 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +30 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +29 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +30 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +29 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +30 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +29 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +30 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +29 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +30 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +29 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +30 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +29 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +30 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +29 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +30 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1209 -1207
- package/dist/locales/ar.json +30 -1
- package/dist/locales/de.json +30 -1
- package/dist/locales/el.json +30 -1
- package/dist/locales/en.json +30 -1
- package/dist/locales/es.json +30 -1
- package/dist/locales/fr.json +30 -1
- package/dist/locales/hi.json +30 -1
- package/dist/locales/it.json +30 -1
- package/dist/locales/ja.json +30 -1
- package/dist/locales/nl.json +30 -1
- package/dist/locales/pl.json +30 -1
- package/dist/locales/pt.json +30 -1
- package/dist/locales/ro.json +30 -1
- package/dist/locales/ru.json +30 -1
- package/dist/locales/sq.json +30 -1
- package/dist/locales/sv.json +30 -1
- package/dist/locales/tr.json +30 -1
- package/dist/locales/zh.json +30 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/channel-meta.d.ts +8 -2
- package/dist/patterns/signature-request/channel-meta.d.ts.map +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/patterns/signature-request/minor-patient.d.ts +41 -0
- package/dist/patterns/signature-request/minor-patient.d.ts.map +1 -0
- package/dist/patterns/signature-request/required-documents.d.ts +4 -3
- package/dist/patterns/signature-request/required-documents.d.ts.map +1 -1
- package/dist/patterns/signature-request/signature-request.d.ts +62 -12
- package/dist/patterns/signature-request/signature-request.d.ts.map +1 -1
- package/dist/theme-boot.js +26 -0
- package/dist/tokens.css +1 -1
- package/package.json +4 -2
- package/dist/_chunks/booking-D2r19Lia.js +0 -3901
- package/dist/_chunks/booking-D2r19Lia.js.map +0 -1
- package/dist/_chunks/breadcrumb-Boan-5n8.js.map +0 -1
- package/dist/_chunks/otp-input-CGMu30_e.js.map +0 -1
- package/dist/_chunks/practice-results-C5SJTgcd.js.map +0 -1
- package/dist/_chunks/signature-request-ldmXj2X6.js +0 -2221
- package/dist/_chunks/signature-request-ldmXj2X6.js.map +0 -1
- package/dist/_chunks/use-theme-CAuo6EYT.js +0 -159
- package/dist/_chunks/use-theme-CAuo6EYT.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
const
|
|
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
10
|
id: "otp-input",
|
|
11
11
|
// Value input — `set_value` replaces the digits. There is no `submit`
|
|
12
12
|
// action: completion is host-driven (the consumer's `onComplete` fires
|
|
@@ -81,7 +81,7 @@ const me = {
|
|
|
81
81
|
description: "Sourced from the id prop."
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
},
|
|
84
|
+
}, ve = j("ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]"), be = j(
|
|
85
85
|
[
|
|
86
86
|
"ds:w-[var(--min-target-size)] ds:h-[var(--min-target-size)]",
|
|
87
87
|
"ds:rounded-[var(--radius-sm)]",
|
|
@@ -105,21 +105,21 @@ const me = {
|
|
|
105
105
|
function z(a) {
|
|
106
106
|
return a.replace(/[\u0660-\u0669]/g, (n) => String(n.charCodeAt(0) - 1632)).replace(/[\u06F0-\u06F9]/g, (n) => String(n.charCodeAt(0) - 1776));
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
108
|
+
const ye = 3, we = 10;
|
|
109
|
+
function Ie(a) {
|
|
110
110
|
const n = Number.isFinite(a) ? Math.floor(a) : 6;
|
|
111
|
-
return Math.max(
|
|
111
|
+
return Math.max(ye, Math.min(we, n));
|
|
112
112
|
}
|
|
113
113
|
function k(a, n, g) {
|
|
114
114
|
return (g === "alphanumeric" ? a.replace(/[^A-Za-z0-9]/g, "").toUpperCase() : z(a).replace(/\D/g, "")).slice(0, n);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function ke(a, n, g) {
|
|
117
117
|
const p = k(a, n, g), d = new Array(n).fill("");
|
|
118
118
|
for (let m = 0; m < p.length; m += 1)
|
|
119
119
|
d[m] = p[m];
|
|
120
120
|
return d;
|
|
121
121
|
}
|
|
122
|
-
const
|
|
122
|
+
const Ve = se(
|
|
123
123
|
({
|
|
124
124
|
length: a = 6,
|
|
125
125
|
value: n,
|
|
@@ -127,46 +127,47 @@ const ke = ae(
|
|
|
127
127
|
onChange: p,
|
|
128
128
|
onComplete: d,
|
|
129
129
|
disabled: m,
|
|
130
|
-
error:
|
|
130
|
+
error: $,
|
|
131
131
|
label: V,
|
|
132
|
+
"aria-describedby": Z,
|
|
132
133
|
id: E,
|
|
133
|
-
className:
|
|
134
|
-
webOtp:
|
|
134
|
+
className: _,
|
|
135
|
+
webOtp: U = !1,
|
|
135
136
|
name: K,
|
|
136
137
|
mode: i = "numeric"
|
|
137
|
-
},
|
|
138
|
-
const { t:
|
|
138
|
+
}, q) => {
|
|
139
|
+
const { t: x } = ue("ui"), r = Ie(a), v = fe(), G = ne(), B = V ? G : void 0, [W, H] = pe({
|
|
139
140
|
value: n,
|
|
140
141
|
defaultValue: k(g ?? "", r, i)
|
|
141
|
-
}), h = k(
|
|
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);
|
|
142
143
|
f.current = h;
|
|
143
|
-
const
|
|
144
|
+
const Q = () => {
|
|
144
145
|
const t = h.length;
|
|
145
146
|
return t >= r ? r - 1 : t;
|
|
146
|
-
}, [b, A] =
|
|
147
|
-
|
|
147
|
+
}, [b, A] = oe(Q);
|
|
148
|
+
ie(() => {
|
|
148
149
|
b >= r && A(r - 1);
|
|
149
150
|
}, [b, r]);
|
|
150
|
-
const l =
|
|
151
|
+
const l = S(
|
|
151
152
|
(t) => {
|
|
152
153
|
const e = Math.max(0, Math.min(r - 1, t));
|
|
153
154
|
A(e);
|
|
154
|
-
const s =
|
|
155
|
+
const s = P.current[e];
|
|
155
156
|
s && (s.focus(), s.select());
|
|
156
157
|
},
|
|
157
158
|
[r]
|
|
158
|
-
), u =
|
|
159
|
+
), u = S(
|
|
159
160
|
(t) => {
|
|
160
161
|
const e = k(t, r, i);
|
|
161
|
-
|
|
162
|
+
H(e), f.current = e, p == null || p(e), e.length === r ? D.current || (D.current = !0, d == null || d(e)) : D.current = !1;
|
|
162
163
|
},
|
|
163
|
-
[
|
|
164
|
+
[H, r, i, p, d]
|
|
164
165
|
);
|
|
165
|
-
|
|
166
|
-
enabled:
|
|
166
|
+
de({
|
|
167
|
+
enabled: U && !y,
|
|
167
168
|
onCode: u
|
|
168
169
|
});
|
|
169
|
-
const
|
|
170
|
+
const Y = (t) => (e) => {
|
|
170
171
|
const s = e.target.value, o = i === "alphanumeric" ? s.replace(/[^A-Za-z0-9]/g, "").toUpperCase() : z(s).replace(/\D/g, ""), c = f.current;
|
|
171
172
|
if (o.length === 0) {
|
|
172
173
|
if (s === "" && t < c.length) {
|
|
@@ -179,7 +180,7 @@ const ke = ae(
|
|
|
179
180
|
u(F);
|
|
180
181
|
const L = Math.min(t + o.length, r - 1);
|
|
181
182
|
l(L);
|
|
182
|
-
},
|
|
183
|
+
}, ee = (t) => (e) => {
|
|
183
184
|
const s = f.current;
|
|
184
185
|
if (e.key === "Backspace") {
|
|
185
186
|
if (s[t]) {
|
|
@@ -208,7 +209,7 @@ const ke = ae(
|
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
211
|
e.key === "End" && (e.preventDefault(), l(r - 1));
|
|
211
|
-
},
|
|
212
|
+
}, te = (t) => (e) => {
|
|
212
213
|
const o = e.clipboardData.getData("text").replace(/\s+/g, ""), c = i === "alphanumeric" ? o.replace(/[^A-Za-z0-9]/g, "").toUpperCase() : z(o);
|
|
213
214
|
if (i === "alphanumeric" ? c.length === 0 : !/^[0-9]+$/.test(c))
|
|
214
215
|
return;
|
|
@@ -217,11 +218,11 @@ const ke = ae(
|
|
|
217
218
|
u(L);
|
|
218
219
|
const N = Math.min(t + c.length, r - 1);
|
|
219
220
|
l(N);
|
|
220
|
-
},
|
|
221
|
+
}, re = (t) => (e) => {
|
|
221
222
|
A(t), e.currentTarget.select();
|
|
222
223
|
}, T = v.id;
|
|
223
|
-
|
|
224
|
-
const M =
|
|
224
|
+
ge(v, `${T}-0`);
|
|
225
|
+
const M = ce(
|
|
225
226
|
() => ({
|
|
226
227
|
getValue: () => f.current,
|
|
227
228
|
setValue: (t) => u(t),
|
|
@@ -231,11 +232,11 @@ const ke = ae(
|
|
|
231
232
|
}),
|
|
232
233
|
[u, l, b, r]
|
|
233
234
|
);
|
|
234
|
-
return
|
|
235
|
+
return me(he, M, E), le(q, () => M, [M]), /* @__PURE__ */ ae("div", { className: ve({ className: _ }), children: [
|
|
235
236
|
V ? /* @__PURE__ */ I(
|
|
236
237
|
"label",
|
|
237
238
|
{
|
|
238
|
-
id:
|
|
239
|
+
id: B,
|
|
239
240
|
htmlFor: `${T}-0`,
|
|
240
241
|
className: "type-label ds:text-foreground",
|
|
241
242
|
children: V
|
|
@@ -246,20 +247,20 @@ const ke = ae(
|
|
|
246
247
|
{
|
|
247
248
|
role: "group",
|
|
248
249
|
dir: "ltr",
|
|
249
|
-
"aria-labelledby":
|
|
250
|
-
"aria-invalid":
|
|
251
|
-
"aria-describedby": v.describedBy || void 0,
|
|
250
|
+
"aria-labelledby": B,
|
|
251
|
+
"aria-invalid": O || void 0,
|
|
252
|
+
"aria-describedby": [Z, v.describedBy].filter(Boolean).join(" ") || void 0,
|
|
252
253
|
"aria-disabled": y || void 0,
|
|
253
254
|
"data-component": "otp-input",
|
|
254
255
|
"data-component-id": E,
|
|
255
256
|
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
256
|
-
children:
|
|
257
|
+
children: X.map((t, e) => {
|
|
257
258
|
const s = !y && e === b;
|
|
258
259
|
return /* @__PURE__ */ I(
|
|
259
260
|
"input",
|
|
260
261
|
{
|
|
261
262
|
ref: (o) => {
|
|
262
|
-
|
|
263
|
+
P.current[e] = o;
|
|
263
264
|
},
|
|
264
265
|
id: `${T}-${e}`,
|
|
265
266
|
type: "text",
|
|
@@ -271,18 +272,18 @@ const ke = ae(
|
|
|
271
272
|
value: t,
|
|
272
273
|
disabled: y,
|
|
273
274
|
tabIndex: s ? 0 : -1,
|
|
274
|
-
"aria-label":
|
|
275
|
+
"aria-label": x(
|
|
275
276
|
i === "alphanumeric" ? "inputs.otp.charLabel" : "inputs.otp.digitLabel",
|
|
276
277
|
{
|
|
277
278
|
current: e + 1,
|
|
278
279
|
total: r
|
|
279
280
|
}
|
|
280
281
|
),
|
|
281
|
-
onChange:
|
|
282
|
-
onKeyDown:
|
|
283
|
-
onPaste:
|
|
284
|
-
onFocus:
|
|
285
|
-
className:
|
|
282
|
+
onChange: Y(e),
|
|
283
|
+
onKeyDown: ee(e),
|
|
284
|
+
onPaste: te(e),
|
|
285
|
+
onFocus: re(e),
|
|
286
|
+
className: be({ tone: J })
|
|
286
287
|
},
|
|
287
288
|
e
|
|
288
289
|
);
|
|
@@ -293,8 +294,8 @@ const ke = ae(
|
|
|
293
294
|
] });
|
|
294
295
|
}
|
|
295
296
|
);
|
|
296
|
-
|
|
297
|
+
Ve.displayName = "OTPInput";
|
|
297
298
|
export {
|
|
298
|
-
|
|
299
|
+
Ve as O
|
|
299
300
|
};
|
|
300
|
-
//# sourceMappingURL=otp-input-
|
|
301
|
+
//# sourceMappingURL=otp-input-BgEZi0py.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp-input-BgEZi0py.js","sources":["../../src/components/otp-input/otp-input.agent.ts","../../src/components/otp-input/otp-input.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — OTPInput. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { OTPInputHandle } from './otp-input';\n\nexport const otpInputAgent: AgentAdapter<OTPInputHandle> = {\n id: 'otp-input',\n // Value input — `set_value` replaces the digits. There is no `submit`\n // action: completion is host-driven (the consumer's `onComplete` fires\n // automatically once every digit is filled) and is observable via the\n // `isComplete` state slot, so the old unbacked `submit` capability is\n // removed.\n capabilities: ['set_value'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.otpInput.state.value',\n description: 'Current digits entered, packed into a single string.',\n read: (handle) => handle.getValue(),\n },\n isComplete: {\n type: 'boolean',\n descriptionKey: 'ui.agent.otpInput.state.isComplete',\n description: 'Whether all required digits have been entered.',\n read: (handle) => handle.isComplete(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description:\n 'The digits to fill, packed into a single string (one char per cell).',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n examples: [{ args: { value: '123456' } }],\n descriptionKey: 'ui.agent.otpInput.actions.setValue',\n description: 'Replace the entered digits.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.otpInput.actions.clear',\n description: 'Empty all digit cells. Loses any typed value.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n focus: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.otpInput.actions.focus',\n description: 'Move keyboard focus to the active digit cell.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'otp-input',\n description:\n 'Marks the OTPInput wrapper. Completion is observable via state.isComplete; the host onComplete callback fires once when all digits are filled.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type ClipboardEvent,\n type FocusEvent,\n type KeyboardEvent,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useWebOtp } from '../../hooks/use-web-otp';\nimport {\n useFormField,\n useFormFieldControlId,\n} from '../form-field/form-field-context';\nimport { useAgentRegistration } from '../../agent';\nimport { otpInputAgent } from './otp-input.agent';\n\nexport type OTPMode = 'numeric' | 'alphanumeric';\n\n/** Agent-readiness curated handle for OTPInput. */\nexport interface OTPInputHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n focus: () => void;\n isComplete: () => boolean;\n}\n\nconst wrapperVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]');\n\nconst boxVariants = cva(\n [\n 'ds:w-[var(--min-target-size)] ds:h-[var(--min-target-size)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:border ds:bg-input ds:text-foreground ds:text-center ds:font-medium ds:text-[length:var(--font-size-lg)]',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n tone: {\n default: 'ds:border-[color:var(--control-border)]',\n error: 'ds:border-destructive',\n },\n },\n defaultVariants: { tone: 'default' },\n },\n);\n\nexport interface OTPInputProps {\n /**\n * Number of boxes. Default 6. Any integer in [3, 10] is honoured;\n * out-of-range values are clamped (with a DEV warning).\n */\n length?: number;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n onComplete?: (code: string) => void;\n disabled?: boolean;\n error?: boolean;\n label?: string;\n 'aria-describedby'?: string;\n /** Stable id, used to address this instance from the agent runtime. */\n id?: string;\n className?: string;\n /**\n * Opt into Chrome-Android's WebOTP API for one-tap SMS autofill. When\n * the browser surfaces a matching SMS-bound credential, the kit spreads\n * the code across every digit box and fires `onComplete` automatically.\n *\n * Falls back silently to manual entry on Firefox / desktop / iOS — those\n * platforms either don't ship the API at all or rely on the\n * `autocomplete=\"one-time-code\"` QuickType heuristic the kit already\n * applies to the first input.\n *\n * Prerequisites the prop can't enforce: page must be HTTPS, and the SMS\n * body must end with `@<origin> #<code>` on its last line (Chrome's\n * spec — without it the browser refuses to surface the message).\n * Default `false` so the listener stays opt-in.\n */\n webOtp?: boolean;\n /**\n * When set, renders a hidden `<input name={name}>` kept in sync with the\n * packed code so consumers can POST the OTP declaratively, e.g.\n * `sms_code_form[code]`. Default off — no behaviour change.\n */\n name?: string;\n /**\n * Character set. `numeric` (default) accepts digits only (with Arabic-Indic\n * digit folding) — byte-identical to prior behaviour. `alphanumeric` accepts\n * `[A-Za-z0-9]`, uppercases the value, and switches the boxes to text input\n * (for SMS codes that mix letters and digits).\n */\n mode?: OTPMode;\n}\n\nfunction normaliseDigits(str: string): string {\n return str\n .replace(/[\\u0660-\\u0669]/g, (c) => String(c.charCodeAt(0) - 0x0660))\n .replace(/[\\u06F0-\\u06F9]/g, (c) => String(c.charCodeAt(0) - 0x06f0));\n}\n\nconst MIN_LENGTH = 3;\nconst MAX_LENGTH = 10;\n\n/** Clamp an arbitrary length into a sane range; DEV-warn if it had to. */\nfunction resolveLength(length: number): number {\n // Fall back to the default for non-finite input (e.g. `length={parseInt(x)}`\n // yielding NaN) so the component never reaches `new Array(NaN)`.\n const n = Number.isFinite(length) ? Math.floor(length) : 6;\n const clamped = Math.max(MIN_LENGTH, Math.min(MAX_LENGTH, n));\n if (import.meta.env.DEV && clamped !== length) {\n console.warn(\n `[OTPInput] length ${length} is out of range [${MIN_LENGTH}, ${MAX_LENGTH}] \\u2014 clamped to ${clamped}.`,\n );\n }\n return clamped;\n}\n\n/**\n * Filter + normalise a string to the mode's charset, then clamp to length.\n * - `numeric`: Arabic-Indic digits folded to ASCII, then digits only.\n * - `alphanumeric`: `[A-Za-z0-9]` only, uppercased (codes are uppercase and the\n * server compares case-insensitively \\u2014 uppercasing keeps the display and the\n * posted value consistent).\n */\nfunction packValue(value: string, length: number, mode: OTPMode): string {\n const filtered =\n mode === 'alphanumeric'\n ? value.replace(/[^A-Za-z0-9]/g, '').toUpperCase()\n : normaliseDigits(value).replace(/\\D/g, '');\n return filtered.slice(0, length);\n}\n\nfunction valueToArray(value: string, length: number, mode: OTPMode): string[] {\n const packed = packValue(value, length, mode);\n const arr = new Array<string>(length).fill('');\n for (let i = 0; i < packed.length; i += 1) {\n arr[i] = packed[i];\n }\n return arr;\n}\n\nexport const OTPInput = forwardRef<OTPInputHandle, OTPInputProps>(\n (\n {\n length: lengthProp = 6,\n value,\n defaultValue,\n onChange,\n onComplete,\n disabled,\n error,\n label,\n 'aria-describedby': describedBy,\n id,\n className,\n webOtp = false,\n name,\n mode = 'numeric',\n },\n ref,\n ) => {\n const { t } = useTranslation('ui');\n const length = resolveLength(lengthProp);\n const ctx = useFormField();\n const generatedLabelId = useId();\n const labelId = label ? generatedLabelId : undefined;\n\n const [internalValueRaw, setInternalValue] = useControllableState<string>({\n value,\n defaultValue: packValue(defaultValue ?? '', length, mode),\n });\n const currentValue = packValue(internalValueRaw ?? '', length, mode);\n const digits = valueToArray(currentValue, length, mode);\n\n const effectiveDisabled = ctx.disabled || Boolean(disabled);\n const effectiveError = ctx.invalid || Boolean(error);\n const effectiveTone = effectiveError ? 'error' : 'default';\n\n const inputsRef = useRef<Array<HTMLInputElement | null>>([]);\n const completedRef = useRef(currentValue.length === length);\n const valueRef = useRef(currentValue);\n valueRef.current = currentValue;\n\n const computeInitialIndex = () => {\n const firstEmpty = currentValue.length;\n if (firstEmpty >= length) return length - 1;\n return firstEmpty;\n };\n const [activeIndex, setActiveIndex] = useState<number>(computeInitialIndex);\n\n useEffect(() => {\n if (activeIndex >= length) setActiveIndex(length - 1);\n }, [activeIndex, length]);\n\n const focusBox = useCallback(\n (index: number) => {\n const clamped = Math.max(0, Math.min(length - 1, index));\n setActiveIndex(clamped);\n const node = inputsRef.current[clamped];\n if (node) {\n node.focus();\n node.select();\n }\n },\n [length],\n );\n\n const commit = useCallback(\n (next: string) => {\n const packed = packValue(next, length, mode);\n setInternalValue(packed);\n valueRef.current = packed;\n onChange?.(packed);\n if (packed.length === length) {\n if (!completedRef.current) {\n completedRef.current = true;\n onComplete?.(packed);\n }\n } else {\n completedRef.current = false;\n }\n },\n [setInternalValue, length, mode, onChange, onComplete],\n );\n\n // WebOTP one-tap autofill. The hook silently no-ops when the API is\n // unavailable (Firefox / Safari / desktop Chromium) — `commit()` is\n // the same path manual entry takes, so `onChange` + `onComplete` fire\n // identically whether the digits arrived via SMS, paste, or typing.\n useWebOtp({\n enabled: webOtp && !effectiveDisabled,\n onCode: commit,\n });\n\n const handleChange =\n (index: number) => (event: ChangeEvent<HTMLInputElement>) => {\n const raw = event.target.value;\n const norm =\n mode === 'alphanumeric'\n ? raw.replace(/[^A-Za-z0-9]/g, '').toUpperCase()\n : normaliseDigits(raw).replace(/\\D/g, '');\n const current = valueRef.current;\n\n if (norm.length === 0) {\n if (raw === '' && index < current.length) {\n const newValue = current.slice(0, index) + current.slice(index + 1);\n commit(newValue);\n }\n return;\n }\n\n const before = current.slice(0, index);\n const after = current.slice(index + norm.length);\n const newValue = (before + norm + after).slice(0, length);\n commit(newValue);\n\n const focusTarget = Math.min(index + norm.length, length - 1);\n focusBox(focusTarget);\n };\n\n const handleKeyDown =\n (index: number) => (event: KeyboardEvent<HTMLInputElement>) => {\n const current = valueRef.current;\n if (event.key === 'Backspace') {\n if (current[index]) {\n event.preventDefault();\n const newValue = current.slice(0, index) + current.slice(index + 1);\n commit(newValue);\n return;\n }\n if (index > 0) {\n event.preventDefault();\n const newValue = current.slice(0, index - 1) + current.slice(index);\n commit(newValue);\n focusBox(index - 1);\n }\n return;\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (index > 0) focusBox(index - 1);\n return;\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (index < length - 1) focusBox(index + 1);\n return;\n }\n if (event.key === 'Home') {\n event.preventDefault();\n focusBox(0);\n return;\n }\n if (event.key === 'End') {\n event.preventDefault();\n focusBox(length - 1);\n }\n };\n\n const handlePaste =\n (index: number) => (event: ClipboardEvent<HTMLInputElement>) => {\n const text = event.clipboardData.getData('text');\n const stripped = text.replace(/\\s+/g, '');\n const norm =\n mode === 'alphanumeric'\n ? stripped.replace(/[^A-Za-z0-9]/g, '').toUpperCase()\n : normaliseDigits(stripped);\n // numeric: reject the whole paste unless it is all digits (byte-identical\n // to prior behaviour); alphanumeric: accept the stripped [A-Za-z0-9].\n if (\n mode === 'alphanumeric' ? norm.length === 0 : !/^[0-9]+$/.test(norm)\n ) {\n return;\n }\n event.preventDefault();\n const current = valueRef.current;\n const before = current.slice(0, index);\n const after = current.slice(index + norm.length);\n const newValue = (before + norm + after).slice(0, length);\n commit(newValue);\n const focusTarget = Math.min(index + norm.length, length - 1);\n focusBox(focusTarget);\n };\n\n const handleFocus =\n (index: number) => (event: FocusEvent<HTMLInputElement>) => {\n setActiveIndex(index);\n event.currentTarget.select();\n };\n\n const baseId = ctx.id;\n /* No element carries the field's own id: its label points at the\n first box. */\n useFormFieldControlId(ctx, `${baseId}-0`);\n\n const agentHandle = useMemo<OTPInputHandle>(\n () => ({\n getValue: () => valueRef.current,\n setValue: (next) => commit(next),\n clear: () => commit(''),\n focus: () => focusBox(activeIndex),\n isComplete: () => valueRef.current.length === length,\n }),\n [commit, focusBox, activeIndex, length],\n );\n useAgentRegistration(otpInputAgent, agentHandle, id);\n // Expose the same imperative handle to React refs so consumers can\n // focus / read / clear the field (e.g. focus the boxes on a step change).\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n\n return (\n <div className={wrapperVariants({ className })}>\n {label ? (\n <label\n id={labelId}\n htmlFor={`${baseId}-0`}\n className=\"type-label ds:text-foreground\"\n >\n {label}\n </label>\n ) : null}\n {/* eslint-disable-next-line jsx-a11y/role-supports-aria-props -- aria-invalid is a global ARIA state; conveys group-level validation */}\n <div\n role=\"group\"\n dir=\"ltr\"\n aria-labelledby={labelId}\n aria-invalid={effectiveError || undefined}\n aria-describedby={\n [describedBy, ctx.describedBy].filter(Boolean).join(' ') ||\n undefined\n }\n aria-disabled={effectiveDisabled || undefined}\n data-component=\"otp-input\"\n data-component-id={id}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n {digits.map((digit, index) => {\n const isTabbable = !effectiveDisabled && index === activeIndex;\n return (\n <input\n key={index}\n ref={(node) => {\n inputsRef.current[index] = node;\n }}\n id={`${baseId}-${index}`}\n type=\"text\"\n inputMode={mode === 'alphanumeric' ? 'text' : 'numeric'}\n pattern={mode === 'alphanumeric' ? '[A-Za-z0-9]*' : '[0-9]*'}\n autoCapitalize={\n mode === 'alphanumeric' ? 'characters' : undefined\n }\n autoComplete={index === 0 ? 'one-time-code' : 'off'}\n maxLength={1}\n value={digit}\n disabled={effectiveDisabled}\n tabIndex={isTabbable ? 0 : -1}\n aria-label={t(\n mode === 'alphanumeric'\n ? 'inputs.otp.charLabel'\n : 'inputs.otp.digitLabel',\n {\n current: index + 1,\n total: length,\n },\n )}\n onChange={handleChange(index)}\n onKeyDown={handleKeyDown(index)}\n onPaste={handlePaste(index)}\n onFocus={handleFocus(index)}\n className={boxVariants({ tone: effectiveTone })}\n />\n );\n })}\n </div>\n {name ? (\n <input type=\"hidden\" name={name} value={currentValue} readOnly />\n ) : null}\n </div>\n );\n },\n);\n\nOTPInput.displayName = 'OTPInput';\n"],"names":["otpInputAgent","handle","args","wrapperVariants","cva","boxVariants","normaliseDigits","str","c","MIN_LENGTH","MAX_LENGTH","resolveLength","length","packValue","value","mode","valueToArray","packed","arr","i","OTPInput","forwardRef","lengthProp","defaultValue","onChange","onComplete","disabled","error","label","describedBy","id","className","webOtp","name","ref","t","useTranslation","ctx","useFormField","generatedLabelId","useId","labelId","internalValueRaw","setInternalValue","useControllableState","currentValue","digits","effectiveDisabled","effectiveError","effectiveTone","inputsRef","useRef","completedRef","valueRef","computeInitialIndex","firstEmpty","activeIndex","setActiveIndex","useState","useEffect","focusBox","useCallback","index","clamped","node","commit","next","useWebOtp","handleChange","event","raw","norm","current","newValue","before","after","focusTarget","handleKeyDown","handlePaste","stripped","handleFocus","baseId","useFormFieldControlId","agentHandle","useMemo","useAgentRegistration","useImperativeHandle","jsx","digit","isTabbable"],"mappings":";;;;;;;;AASO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,WAAA;AAAA,IAAW;AAAA,EACtC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM;AAAA,YACN,aACE;AAAA,UAAA;AAAA,QACJ;AAAA,QAEF,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,SAAA,GAAY;AAAA,MACxC,gBAAgB;AAAA,MAChB,aAAa;AAA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