@alfadocs/ui-kit-debug 0.53.0 → 0.55.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/otp-input-xQ4Ps5VY.js +279 -0
- package/dist/_chunks/otp-input-xQ4Ps5VY.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +13 -1
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/i18n/locales/ar.d.ts +1 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +2 -1
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +1 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +2 -1
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +1 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +2 -1
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +1 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +2 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +1 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +2 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +1 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +2 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +1 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +2 -1
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +1 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +2 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +1 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +2 -1
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +1 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +2 -1
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +1 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +2 -1
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +1 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +2 -1
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +1 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +2 -1
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +1 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +2 -1
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +1 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +2 -1
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +1 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +2 -1
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +1 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +2 -1
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +1 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +2 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/ar.json +2 -1
- package/dist/locales/de.json +2 -1
- package/dist/locales/el.json +2 -1
- package/dist/locales/en.json +2 -1
- package/dist/locales/es.json +2 -1
- package/dist/locales/fr.json +2 -1
- package/dist/locales/hi.json +2 -1
- package/dist/locales/it.json +2 -1
- package/dist/locales/ja.json +2 -1
- package/dist/locales/nl.json +2 -1
- package/dist/locales/pl.json +2 -1
- package/dist/locales/pt.json +2 -1
- package/dist/locales/ro.json +2 -1
- package/dist/locales/ru.json +2 -1
- package/dist/locales/sq.json +2 -1
- package/dist/locales/sv.json +2 -1
- package/dist/locales/tr.json +2 -1
- package/dist/locales/zh.json +2 -1
- package/package.json +1 -1
- package/dist/_chunks/otp-input-Chb9r5vf.js +0 -268
- package/dist/_chunks/otp-input-Chb9r5vf.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ import { F as Ya } from "./_chunks/form-field-BOm9hK35.js";
|
|
|
34
34
|
import { F as Qa, u as ja } from "./_chunks/form-field-context-B3APVHKx.js";
|
|
35
35
|
import { M as Xa, m as Ja, a as Za } from "./_chunks/multi-select-DOLO3K_z.js";
|
|
36
36
|
import { N as ae, u as ee } from "./_chunks/number-input-Dj5L3pXK.js";
|
|
37
|
-
import { O as oe } from "./_chunks/otp-input-
|
|
37
|
+
import { O as oe } from "./_chunks/otp-input-xQ4Ps5VY.js";
|
|
38
38
|
import { P as se, u as ne } from "./_chunks/use-password-requirements-DsgduV1x.js";
|
|
39
39
|
import { P as pe, c as me, p as le, a as de } from "./_chunks/phone-input-DfZbPPvh.js";
|
|
40
40
|
import { R as fe, r as ge } from "./_chunks/recaptcha-widget-BCNHsgqt.js";
|
package/dist/locales/ar.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "مسح الاختيار"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "الرقم {{current}} من {{total}}"
|
|
142
|
+
"digitLabel": "الرقم {{current}} من {{total}}",
|
|
143
|
+
"charLabel": "الحرف {{current}} من {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "الحد الأدنى",
|
package/dist/locales/de.json
CHANGED
|
@@ -128,7 +128,8 @@
|
|
|
128
128
|
"clear": "Auswahl aufheben"
|
|
129
129
|
},
|
|
130
130
|
"otp": {
|
|
131
|
-
"digitLabel": "Ziffer {{current}} von {{total}}"
|
|
131
|
+
"digitLabel": "Ziffer {{current}} von {{total}}",
|
|
132
|
+
"charLabel": "Zeichen {{current}} von {{total}}"
|
|
132
133
|
},
|
|
133
134
|
"slider": {
|
|
134
135
|
"minLabel": "Minimum",
|
package/dist/locales/el.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Εκκαθάριση επιλογής"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Ψηφίο {{current}} από {{total}}"
|
|
142
|
+
"digitLabel": "Ψηφίο {{current}} από {{total}}",
|
|
143
|
+
"charLabel": "Χαρακτήρας {{current}} από {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Ελάχιστο",
|
package/dist/locales/en.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Clear selection"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Digit {{current}} of {{total}}"
|
|
142
|
+
"digitLabel": "Digit {{current}} of {{total}}",
|
|
143
|
+
"charLabel": "Character {{current}} of {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Minimum",
|
package/dist/locales/es.json
CHANGED
|
@@ -128,7 +128,8 @@
|
|
|
128
128
|
"clear": "Borrar selección"
|
|
129
129
|
},
|
|
130
130
|
"otp": {
|
|
131
|
-
"digitLabel": "Dígito {{current}} de {{total}}"
|
|
131
|
+
"digitLabel": "Dígito {{current}} de {{total}}",
|
|
132
|
+
"charLabel": "Carácter {{current}} de {{total}}"
|
|
132
133
|
},
|
|
133
134
|
"slider": {
|
|
134
135
|
"minLabel": "Mínimo",
|
package/dist/locales/fr.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Effacer la sélection"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Chiffre {{current}} sur {{total}}"
|
|
142
|
+
"digitLabel": "Chiffre {{current}} sur {{total}}",
|
|
143
|
+
"charLabel": "Caractère {{current}} sur {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Minimum",
|
package/dist/locales/hi.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "चयन हटाएं"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "{{current}} में से {{total}} का अंक"
|
|
142
|
+
"digitLabel": "{{current}} में से {{total}} का अंक",
|
|
143
|
+
"charLabel": "{{current}} में से {{total}} का वर्ण"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "न्यूनतम",
|
package/dist/locales/it.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Cancella selezione"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Cifra {{current}} di {{total}}"
|
|
142
|
+
"digitLabel": "Cifra {{current}} di {{total}}",
|
|
143
|
+
"charLabel": "Carattere {{current}} di {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Minimo",
|
package/dist/locales/ja.json
CHANGED
package/dist/locales/nl.json
CHANGED
|
@@ -128,7 +128,8 @@
|
|
|
128
128
|
"clear": "Selectie wissen"
|
|
129
129
|
},
|
|
130
130
|
"otp": {
|
|
131
|
-
"digitLabel": "Cijfer {{current}} van {{total}}"
|
|
131
|
+
"digitLabel": "Cijfer {{current}} van {{total}}",
|
|
132
|
+
"charLabel": "Teken {{current}} van {{total}}"
|
|
132
133
|
},
|
|
133
134
|
"slider": {
|
|
134
135
|
"minLabel": "Minimum",
|
package/dist/locales/pl.json
CHANGED
package/dist/locales/pt.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Limpar seleção"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Dígito {{current}} de {{total}}"
|
|
142
|
+
"digitLabel": "Dígito {{current}} de {{total}}",
|
|
143
|
+
"charLabel": "Caractere {{current}} de {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Mínimo",
|
package/dist/locales/ro.json
CHANGED
|
@@ -128,7 +128,8 @@
|
|
|
128
128
|
"clear": "Anulează selecția"
|
|
129
129
|
},
|
|
130
130
|
"otp": {
|
|
131
|
-
"digitLabel": "Cifra {{current}} din {{total}}"
|
|
131
|
+
"digitLabel": "Cifra {{current}} din {{total}}",
|
|
132
|
+
"charLabel": "Caracterul {{current}} din {{total}}"
|
|
132
133
|
},
|
|
133
134
|
"slider": {
|
|
134
135
|
"minLabel": "Minim",
|
package/dist/locales/ru.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Очистить выбор"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Цифра {{current}} из {{total}}"
|
|
142
|
+
"digitLabel": "Цифра {{current}} из {{total}}",
|
|
143
|
+
"charLabel": "Символ {{current}} из {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Минимум",
|
package/dist/locales/sq.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Pastro zgjedhjen"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Shifra {{current}} nga {{total}}"
|
|
142
|
+
"digitLabel": "Shifra {{current}} nga {{total}}",
|
|
143
|
+
"charLabel": "Karakteri {{current}} nga {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Minimumi",
|
package/dist/locales/sv.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Rensa val"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "Siffra {{current}} av {{total}}"
|
|
142
|
+
"digitLabel": "Siffra {{current}} av {{total}}",
|
|
143
|
+
"charLabel": "Tecken {{current}} av {{total}}"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Minimum",
|
package/dist/locales/tr.json
CHANGED
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"clear": "Seçimi temizle"
|
|
140
140
|
},
|
|
141
141
|
"otp": {
|
|
142
|
-
"digitLabel": "{{total}} basamaktan {{current}}. basamak"
|
|
142
|
+
"digitLabel": "{{total}} basamaktan {{current}}. basamak",
|
|
143
|
+
"charLabel": "{{total}} karakterden {{current}}. karakter"
|
|
143
144
|
},
|
|
144
145
|
"slider": {
|
|
145
146
|
"minLabel": "Minimum",
|
package/dist/locales/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfadocs/ui-kit-debug",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe. (debug build — identical runtime to @alfadocs/ui-kit, ships source maps for symbolication).",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { jsxs as ee, jsx as y } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as te, useId as re, useRef as M, useState as se, useEffect as ae, useCallback as N, useMemo as oe, useImperativeHandle as ie } from "react";
|
|
3
|
-
import { c as S } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as ne } from "react-i18next";
|
|
5
|
-
import { u as ce } from "./use-controllable-state-BiY4xTzM.js";
|
|
6
|
-
import { u as ue } from "./use-web-otp-D_utzp6S.js";
|
|
7
|
-
import { u as le } from "./form-field-context-B3APVHKx.js";
|
|
8
|
-
import { u as de } from "./registry-nPAVE19X.js";
|
|
9
|
-
const pe = {
|
|
10
|
-
id: "otp-input",
|
|
11
|
-
capabilities: ["edit_inline", "submit"],
|
|
12
|
-
state: {
|
|
13
|
-
value: {
|
|
14
|
-
type: "string",
|
|
15
|
-
descriptionKey: "ui.agent.otpInput.state.value",
|
|
16
|
-
description: "Current digits entered, packed into a single string.",
|
|
17
|
-
read: (e) => e.getValue()
|
|
18
|
-
},
|
|
19
|
-
isComplete: {
|
|
20
|
-
type: "boolean",
|
|
21
|
-
descriptionKey: "ui.agent.otpInput.state.isComplete",
|
|
22
|
-
description: "Whether all required digits have been entered.",
|
|
23
|
-
read: (e) => e.isComplete()
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
actions: {
|
|
27
|
-
set_value: {
|
|
28
|
-
safety: "write",
|
|
29
|
-
argsType: "{ value: string }",
|
|
30
|
-
descriptionKey: "ui.agent.otpInput.actions.setValue",
|
|
31
|
-
description: "Replace the entered digits.",
|
|
32
|
-
invoke: (e, a) => {
|
|
33
|
-
e.setValue(a.value);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
clear: {
|
|
37
|
-
safety: "destructive",
|
|
38
|
-
descriptionKey: "ui.agent.otpInput.actions.clear",
|
|
39
|
-
description: "Empty all digit cells. Loses any typed value.",
|
|
40
|
-
invoke: (e) => {
|
|
41
|
-
e.clear();
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
focus: {
|
|
45
|
-
safety: "read",
|
|
46
|
-
descriptionKey: "ui.agent.otpInput.actions.focus",
|
|
47
|
-
description: "Move keyboard focus to the active digit cell.",
|
|
48
|
-
invoke: (e) => {
|
|
49
|
-
e.focus();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
domHooks: {
|
|
54
|
-
root: {
|
|
55
|
-
attr: "data-component",
|
|
56
|
-
value: "otp-input",
|
|
57
|
-
description: "Marks the OTPInput wrapper. Completion is observable via state.isComplete; the host onComplete callback fires once when all digits are filled."
|
|
58
|
-
},
|
|
59
|
-
instanceId: {
|
|
60
|
-
attr: "data-component-id",
|
|
61
|
-
sourceProp: "id",
|
|
62
|
-
description: "Sourced from the id prop."
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}, fe = S("ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]"), me = S(
|
|
66
|
-
[
|
|
67
|
-
"ds:w-[var(--min-target-size)] ds:h-[var(--min-target-size)]",
|
|
68
|
-
"ds:rounded-[var(--radius-sm)]",
|
|
69
|
-
"ds:border ds:bg-input ds:text-foreground ds:text-center ds:font-medium ds:text-[length:var(--font-size-lg)]",
|
|
70
|
-
"ds:shadow-[var(--shadow-input)]",
|
|
71
|
-
"ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
72
|
-
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
73
|
-
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
74
|
-
"ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
|
|
75
|
-
].join(" "),
|
|
76
|
-
{
|
|
77
|
-
variants: {
|
|
78
|
-
tone: {
|
|
79
|
-
default: "ds:border-border",
|
|
80
|
-
error: "ds:border-destructive"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
defaultVariants: { tone: "default" }
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
function F(e) {
|
|
87
|
-
return e.replace(/[\u0660-\u0669]/g, (a) => String(a.charCodeAt(0) - 1632)).replace(/[\u06F0-\u06F9]/g, (a) => String(a.charCodeAt(0) - 1776));
|
|
88
|
-
}
|
|
89
|
-
function w(e, a) {
|
|
90
|
-
return F(e).replace(/\D/g, "").slice(0, a);
|
|
91
|
-
}
|
|
92
|
-
function ve(e, a) {
|
|
93
|
-
const m = w(e, a), l = new Array(a).fill("");
|
|
94
|
-
for (let n = 0; n < m.length; n += 1)
|
|
95
|
-
l[n] = m[n];
|
|
96
|
-
return l;
|
|
97
|
-
}
|
|
98
|
-
const be = te(
|
|
99
|
-
({
|
|
100
|
-
length: e = 6,
|
|
101
|
-
value: a,
|
|
102
|
-
defaultValue: m,
|
|
103
|
-
onChange: l,
|
|
104
|
-
onComplete: n,
|
|
105
|
-
disabled: H,
|
|
106
|
-
error: $,
|
|
107
|
-
label: I,
|
|
108
|
-
id: K,
|
|
109
|
-
className: j,
|
|
110
|
-
webOtp: z = !1,
|
|
111
|
-
name: C
|
|
112
|
-
}, W) => {
|
|
113
|
-
const { t: _ } = ne(), v = le(), q = re(), O = I ? q : void 0, [G, P] = ce({
|
|
114
|
-
value: a,
|
|
115
|
-
defaultValue: w(m ?? "", e)
|
|
116
|
-
}), p = w(G ?? "", e), J = ve(p, e), b = v.disabled || !!H, B = v.invalid || !!$, Q = B ? "error" : "default", E = M([]), h = M(p.length === e), d = M(p);
|
|
117
|
-
d.current = p;
|
|
118
|
-
const U = () => {
|
|
119
|
-
const r = p.length;
|
|
120
|
-
return r >= e ? e - 1 : r;
|
|
121
|
-
}, [f, k] = se(U);
|
|
122
|
-
ae(() => {
|
|
123
|
-
f >= e && k(e - 1);
|
|
124
|
-
}, [f, e]);
|
|
125
|
-
const c = N(
|
|
126
|
-
(r) => {
|
|
127
|
-
const t = Math.max(0, Math.min(e - 1, r));
|
|
128
|
-
k(t);
|
|
129
|
-
const s = E.current[t];
|
|
130
|
-
s && (s.focus(), s.select());
|
|
131
|
-
},
|
|
132
|
-
[e]
|
|
133
|
-
), u = N(
|
|
134
|
-
(r) => {
|
|
135
|
-
const t = w(r, e);
|
|
136
|
-
P(t), d.current = t, l == null || l(t), t.length === e ? h.current || (h.current = !0, n == null || n(t)) : h.current = !1;
|
|
137
|
-
},
|
|
138
|
-
[P, e, l, n]
|
|
139
|
-
);
|
|
140
|
-
ue({
|
|
141
|
-
enabled: z && !b,
|
|
142
|
-
onCode: u
|
|
143
|
-
});
|
|
144
|
-
const X = (r) => (t) => {
|
|
145
|
-
const s = t.target.value, o = F(s).replace(/\D/g, ""), i = d.current;
|
|
146
|
-
if (o.length === 0) {
|
|
147
|
-
if (s === "" && r < i.length) {
|
|
148
|
-
const R = i.slice(0, r) + i.slice(r + 1);
|
|
149
|
-
u(R);
|
|
150
|
-
}
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const g = i.slice(0, r), D = i.slice(r + o.length), T = (g + o + D).slice(0, e);
|
|
154
|
-
u(T);
|
|
155
|
-
const A = Math.min(r + o.length, e - 1);
|
|
156
|
-
c(A);
|
|
157
|
-
}, Y = (r) => (t) => {
|
|
158
|
-
const s = d.current;
|
|
159
|
-
if (t.key === "Backspace") {
|
|
160
|
-
if (s[r]) {
|
|
161
|
-
t.preventDefault();
|
|
162
|
-
const o = s.slice(0, r) + s.slice(r + 1);
|
|
163
|
-
u(o);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if (r > 0) {
|
|
167
|
-
t.preventDefault();
|
|
168
|
-
const o = s.slice(0, r - 1) + s.slice(r);
|
|
169
|
-
u(o), c(r - 1);
|
|
170
|
-
}
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
if (t.key === "ArrowLeft") {
|
|
174
|
-
t.preventDefault(), r > 0 && c(r - 1);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (t.key === "ArrowRight") {
|
|
178
|
-
t.preventDefault(), r < e - 1 && c(r + 1);
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (t.key === "Home") {
|
|
182
|
-
t.preventDefault(), c(0);
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
t.key === "End" && (t.preventDefault(), c(e - 1));
|
|
186
|
-
}, Z = (r) => (t) => {
|
|
187
|
-
const o = t.clipboardData.getData("text").replace(/\s+/g, ""), i = F(o);
|
|
188
|
-
if (!/^[0-9]+$/.test(i)) return;
|
|
189
|
-
t.preventDefault();
|
|
190
|
-
const g = d.current, D = g.slice(0, r), T = g.slice(r + i.length), A = (D + i + T).slice(0, e);
|
|
191
|
-
u(A);
|
|
192
|
-
const R = Math.min(r + i.length, e - 1);
|
|
193
|
-
c(R);
|
|
194
|
-
}, x = (r) => (t) => {
|
|
195
|
-
k(r), t.currentTarget.select();
|
|
196
|
-
}, L = v.id, V = oe(
|
|
197
|
-
() => ({
|
|
198
|
-
getValue: () => d.current,
|
|
199
|
-
setValue: (r) => u(r),
|
|
200
|
-
clear: () => u(""),
|
|
201
|
-
focus: () => c(f),
|
|
202
|
-
isComplete: () => d.current.length === e
|
|
203
|
-
}),
|
|
204
|
-
[u, c, f, e]
|
|
205
|
-
);
|
|
206
|
-
return de(pe, V, K), ie(W, () => V, [V]), /* @__PURE__ */ ee("div", { className: fe({ className: j }), children: [
|
|
207
|
-
I ? /* @__PURE__ */ y(
|
|
208
|
-
"label",
|
|
209
|
-
{
|
|
210
|
-
id: O,
|
|
211
|
-
htmlFor: `${L}-0`,
|
|
212
|
-
className: "type-label ds:text-foreground",
|
|
213
|
-
children: I
|
|
214
|
-
}
|
|
215
|
-
) : null,
|
|
216
|
-
/* @__PURE__ */ y(
|
|
217
|
-
"div",
|
|
218
|
-
{
|
|
219
|
-
role: "group",
|
|
220
|
-
dir: "ltr",
|
|
221
|
-
"aria-labelledby": O,
|
|
222
|
-
"aria-invalid": B || void 0,
|
|
223
|
-
"aria-describedby": v.describedBy || void 0,
|
|
224
|
-
"aria-disabled": b || void 0,
|
|
225
|
-
"data-component": "otp-input",
|
|
226
|
-
"data-component-id": K,
|
|
227
|
-
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
228
|
-
children: J.map((r, t) => {
|
|
229
|
-
const s = !b && t === f;
|
|
230
|
-
return /* @__PURE__ */ y(
|
|
231
|
-
"input",
|
|
232
|
-
{
|
|
233
|
-
ref: (o) => {
|
|
234
|
-
E.current[t] = o;
|
|
235
|
-
},
|
|
236
|
-
id: `${L}-${t}`,
|
|
237
|
-
type: "text",
|
|
238
|
-
inputMode: "numeric",
|
|
239
|
-
pattern: "[0-9]*",
|
|
240
|
-
autoComplete: t === 0 ? "one-time-code" : "off",
|
|
241
|
-
maxLength: 1,
|
|
242
|
-
value: r,
|
|
243
|
-
disabled: b,
|
|
244
|
-
tabIndex: s ? 0 : -1,
|
|
245
|
-
"aria-label": _("inputs.otp.digitLabel", {
|
|
246
|
-
current: t + 1,
|
|
247
|
-
total: e
|
|
248
|
-
}),
|
|
249
|
-
onChange: X(t),
|
|
250
|
-
onKeyDown: Y(t),
|
|
251
|
-
onPaste: Z(t),
|
|
252
|
-
onFocus: x(t),
|
|
253
|
-
className: me({ tone: Q })
|
|
254
|
-
},
|
|
255
|
-
t
|
|
256
|
-
);
|
|
257
|
-
})
|
|
258
|
-
}
|
|
259
|
-
),
|
|
260
|
-
C ? /* @__PURE__ */ y("input", { type: "hidden", name: C, value: p, readOnly: !0 }) : null
|
|
261
|
-
] });
|
|
262
|
-
}
|
|
263
|
-
);
|
|
264
|
-
be.displayName = "OTPInput";
|
|
265
|
-
export {
|
|
266
|
-
be as O
|
|
267
|
-
};
|
|
268
|
-
//# sourceMappingURL=otp-input-Chb9r5vf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"otp-input-Chb9r5vf.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 capabilities: ['edit_inline', 'submit'],\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 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 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 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 { useFormField } from '../form-field/form-field-context';\nimport { useAgentRegistration } from '../../agent';\nimport { otpInputAgent } from './otp-input.agent';\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-border',\n error: 'ds:border-destructive',\n },\n },\n defaultVariants: { tone: 'default' },\n },\n);\n\nexport interface OTPInputProps {\n length?: 4 | 6 | 8;\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 /** 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\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\nfunction packValue(value: string, length: number): string {\n return normaliseDigits(value).replace(/\\D/g, '').slice(0, length);\n}\n\nfunction valueToArray(value: string, length: number): string[] {\n const packed = packValue(value, length);\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 = 6,\n value,\n defaultValue,\n onChange,\n onComplete,\n disabled,\n error,\n label,\n id,\n className,\n webOtp = false,\n name,\n },\n ref,\n ) => {\n const { t } = useTranslation();\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),\n });\n const currentValue = packValue(internalValueRaw ?? '', length);\n const digits = valueToArray(currentValue, length);\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);\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, 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 = 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 = normaliseDigits(stripped);\n if (!/^[0-9]+$/.test(norm)) return;\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\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={ctx.describedBy || undefined}\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=\"numeric\"\n pattern=\"[0-9]*\"\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('inputs.otp.digitLabel', {\n current: index + 1,\n total: length,\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","packValue","value","length","valueToArray","packed","arr","i","OTPInput","forwardRef","defaultValue","onChange","onComplete","disabled","error","label","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","agentHandle","useMemo","useAgentRegistration","useImperativeHandle","jsx","digit","isTabbable"],"mappings":";;;;;;;;AASO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe,QAAQ;AAAA,EACtC,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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