@alfadocs/ui-kit-debug 0.33.1 → 0.33.3

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.
@@ -0,0 +1,33 @@
1
+ import { useRef as f, useEffect as l } from "react";
2
+ function p({
3
+ onCode: i,
4
+ onError: o,
5
+ enabled: c = !0
6
+ }) {
7
+ const s = f(i), e = f(o);
8
+ s.current = i, e.current = o, l(() => {
9
+ if (!c || typeof window > "u" || !("OTPCredential" in window)) return;
10
+ const u = new AbortController(), a = {
11
+ otp: { transport: ["sms"] },
12
+ signal: u.signal
13
+ };
14
+ let r = !1;
15
+ return navigator.credentials.get(a).then((t) => {
16
+ if (r) return;
17
+ const n = t;
18
+ n != null && n.code && s.current(n.code);
19
+ }).catch((t) => {
20
+ var n;
21
+ r || t instanceof DOMException && t.name === "AbortError" || (n = e.current) == null || n.call(
22
+ e,
23
+ t instanceof Error ? t : new Error(String(t))
24
+ );
25
+ }), () => {
26
+ r = !0, u.abort();
27
+ };
28
+ }, [c]);
29
+ }
30
+ export {
31
+ p as u
32
+ };
33
+ //# sourceMappingURL=use-web-otp-D_utzp6S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-web-otp-D_utzp6S.js","sources":["../../src/hooks/use-web-otp.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n/**\n * WebOTP API — `navigator.credentials.get({ otp: { transport: ['sms'] } })` —\n * implemented behind a React-friendly wrapper.\n *\n * Browser support is essentially **Chrome on Android** (plus Edge / Samsung\n * Internet, both Chromium-derived). Firefox declined to implement; Safari\n * never shipped it — Apple devices use the `autocomplete=\"one-time-code\"`\n * QuickType heuristic instead, which is independent of this hook.\n *\n * The hook is safe to call unconditionally — when the API is unavailable it\n * silently no-ops, when present it listens for one SMS-bound credential and\n * invokes `onCode` exactly once. Aborting is automatic on unmount, on\n * `enabled` flipping to `false`, or after one successful match. Repeated\n * `AbortError`s thrown by the spec on aborted promises are intentionally\n * swallowed — they're the spec-defined cleanup path, not a real error.\n *\n * Prerequisites the hook can't enforce (consumer / backend coordination):\n * - Page served over HTTPS.\n * - SMS body ends with `@<origin> #<code>` on its last line — without it\n * Chrome silently refuses to surface the message to the page.\n *\n * Reference implementation: HTP-3968 (booking-website App.js#_initWebOTP +\n * signature-website confirm_code.html.twig). This hook absorbs both.\n */\n\ninterface OtpCredential extends Credential {\n code: string;\n}\n\ninterface OtpCredentialRequestOptions extends CredentialRequestOptions {\n otp: { transport: 'sms'[] };\n}\n\nexport interface UseWebOtpOptions {\n /**\n * Invoked once with the full code when the browser surfaces a matching\n * SMS. Setting state from inside `onCode` is safe — the hook will not\n * fire again for the same lifecycle (it auto-aborts after success).\n */\n onCode: (code: string) => void;\n /**\n * Optional error sink. `AbortError` (the normal cleanup path) is NEVER\n * forwarded — only real failures (permission denied, malformed SMS, etc.).\n * When omitted the hook silently swallows everything so a consumer that\n * doesn't care about telemetry can call the hook bare.\n */\n onError?: (error: Error) => void;\n /**\n * Gate the listener. When `false` the hook is a no-op; flipping back to\n * `true` reinstalls the listener. Default `true`.\n */\n enabled?: boolean;\n}\n\nexport function useWebOtp({\n onCode,\n onError,\n enabled = true,\n}: UseWebOtpOptions): void {\n // Stable refs so the listener effect doesn't tear down + re-arm every\n // render when the consumer passes inline callbacks.\n const onCodeRef = useRef(onCode);\n const onErrorRef = useRef(onError);\n onCodeRef.current = onCode;\n onErrorRef.current = onError;\n\n useEffect(() => {\n if (!enabled) return;\n if (typeof window === 'undefined') return;\n if (!('OTPCredential' in window)) return;\n\n const controller = new AbortController();\n\n const options: OtpCredentialRequestOptions = {\n otp: { transport: ['sms'] },\n signal: controller.signal,\n };\n\n let cancelled = false;\n\n navigator.credentials\n .get(options as CredentialRequestOptions)\n .then((credential) => {\n if (cancelled) return;\n const otp = credential as OtpCredential | null;\n if (otp?.code) onCodeRef.current(otp.code);\n })\n .catch((error: unknown) => {\n if (cancelled) return;\n // AbortError is the spec-defined cleanup path. Don't surface it.\n if (error instanceof DOMException && error.name === 'AbortError') {\n return;\n }\n onErrorRef.current?.(\n error instanceof Error ? error : new Error(String(error)),\n );\n });\n\n return () => {\n cancelled = true;\n controller.abort();\n };\n }, [enabled]);\n}\n"],"names":["useWebOtp","onCode","onError","enabled","onCodeRef","useRef","onErrorRef","useEffect","controller","options","cancelled","credential","otp","error","_a"],"mappings":";AAwDO,SAASA,EAAU;AAAA,EACxB,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC,IAAU;AACZ,GAA2B;AAGzB,QAAMC,IAAYC,EAAOJ,CAAM,GACzBK,IAAaD,EAAOH,CAAO;AACjC,EAAAE,EAAU,UAAUH,GACpBK,EAAW,UAAUJ,GAErBK,EAAU,MAAM;AAGd,QAFI,CAACJ,KACD,OAAO,SAAW,OAClB,EAAE,mBAAmB,QAAS;AAElC,UAAMK,IAAa,IAAI,gBAAA,GAEjBC,IAAuC;AAAA,MAC3C,KAAK,EAAE,WAAW,CAAC,KAAK,EAAA;AAAA,MACxB,QAAQD,EAAW;AAAA,IAAA;AAGrB,QAAIE,IAAY;AAEhB,qBAAU,YACP,IAAID,CAAmC,EACvC,KAAK,CAACE,MAAe;AACpB,UAAID,EAAW;AACf,YAAME,IAAMD;AACZ,MAAIC,KAAA,QAAAA,EAAK,QAAMR,EAAU,QAAQQ,EAAI,IAAI;AAAA,IAC3C,CAAC,EACA,MAAM,CAACC,MAAmB;;AACzB,MAAIH,KAEAG,aAAiB,gBAAgBA,EAAM,SAAS,iBAGpDC,IAAAR,EAAW,YAAX,QAAAQ,EAAA;AAAA,QAAAR;AAAA,QACEO,aAAiB,QAAQA,IAAQ,IAAI,MAAM,OAAOA,CAAK,CAAC;AAAA;AAAA,IAE5D,CAAC,GAEI,MAAM;AACX,MAAAH,IAAY,IACZF,EAAW,MAAA;AAAA,IACb;AAAA,EACF,GAAG,CAACL,CAAO,CAAC;AACd;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.33.1",
3
+ "packageVersion": "0.33.3",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -1,4 +1,4 @@
1
- import { M as o } from "../../_chunks/map-view-knHSNLoe.js";
1
+ import { M as o } from "../../_chunks/map-view-ZgbhfRqy.js";
2
2
  export {
3
3
  o as MapView
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"map-view.d.ts","sourceRoot":"","sources":["../../../src/components/map-view/map-view.tsx"],"names":[],"mappings":"AAgBA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAsBlE,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IACxB,mEAAmE;IACnE,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,qCAAqC;IACrC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,gEAAgE;IAChE,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,YACf,SACE,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,EAC/C,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,2DAA2D;IAC3D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,MAAM,EAAE,SAAS,CAAC;IAClB,0EAA0E;IAC1E,IAAI,C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,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,QAAA,MAAM,eAAe;;;8EA0BpB,CAAC;AAqJF,eAAO,MAAM,OAAO,wGAqRnB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { O as r } from "../../_chunks/otp-input-BEg_sn8A.js";
1
+ import { O as r } from "../../_chunks/otp-input-CDTWT5EK.js";
2
2
  export {
3
3
  r as OTPInput
4
4
  };
@@ -18,6 +18,22 @@ export interface OTPInputProps {
18
18
  /** Stable id, used to address this instance from the agent runtime. */
19
19
  id?: string;
20
20
  className?: string;
21
+ /**
22
+ * Opt into Chrome-Android's WebOTP API for one-tap SMS autofill. When
23
+ * the browser surfaces a matching SMS-bound credential, the kit spreads
24
+ * the code across every digit box and fires `onComplete` automatically.
25
+ *
26
+ * Falls back silently to manual entry on Firefox / desktop / iOS — those
27
+ * platforms either don't ship the API at all or rely on the
28
+ * `autocomplete="one-time-code"` QuickType heuristic the kit already
29
+ * applies to the first input.
30
+ *
31
+ * Prerequisites the prop can't enforce: page must be HTTPS, and the SMS
32
+ * body must end with `@<origin> #<code>` on its last line (Chrome's
33
+ * spec — without it the browser refuses to surface the message).
34
+ * Default `false` so the listener stays opt-in.
35
+ */
36
+ webOtp?: boolean;
21
37
  }
22
38
  export declare const OTPInput: import("react").ForwardRefExoticComponent<OTPInputProps & import("react").RefAttributes<HTMLDivElement>>;
23
39
  //# sourceMappingURL=otp-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"otp-input.d.ts","sourceRoot":"","sources":["../../../src/components/otp-input/otp-input.tsx"],"names":[],"mappings":"AAoBA,mDAAmD;AACnD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,MAAM,OAAO,CAAC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AAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAqBD,eAAO,MAAM,QAAQ,0GAoPpB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { P as t, p as a } from "../../_chunks/practice-results-Dwm5tzLV.js";
1
+ import { P as t, p as a } from "../../_chunks/practice-results-YD4dvqje.js";
2
2
  export {
3
3
  t as PracticeResults,
4
4
  a as practiceResultsAgent
@@ -16,4 +16,5 @@ export { useFocusTrap, type UseFocusTrapOptions } from './use-focus-trap';
16
16
  export { useDirection, useDocumentDirection, type Direction, } from './use-direction';
17
17
  export { usePersistentState } from './use-persistent-state';
18
18
  export { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';
19
+ export { useWebOtp, type UseWebOtpOptions } from './use-web-otp';
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,cA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Ac,CAAC;AAC/D,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,KAAK,2BAA2B,GACjC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,GAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,oBAAoB,EACpB,KAAK,iBAAiB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,27 +1,28 @@
1
1
  import { u as v } from "../_chunks/use-prefers-reduced-motion-BMwIQRjB.js";
2
2
  import { u as D } from "../_chunks/use-media-query-CcAx5SMM.js";
3
3
  import { u as _ } from "../_chunks/use-scroll-to-first-error-4Za-u5Nw.js";
4
- import { u as g } from "../_chunks/use-count-up-BLLetaZ8.js";
5
- import { u as w } from "../_chunks/use-locale-BkCIHujH.js";
6
- import { A as O, T as R, a as H, r as M, t as Y, u as q } from "../_chunks/use-theme-C2dHKUAN.js";
4
+ import { u as O } from "../_chunks/use-count-up-BLLetaZ8.js";
5
+ import { u as k } from "../_chunks/use-locale-BkCIHujH.js";
6
+ import { A as K, T as R, a as H, r as M, t as Y, u as q } from "../_chunks/use-theme-C2dHKUAN.js";
7
7
  import { u as G } from "../_chunks/use-controllable-state-BiY4xTzM.js";
8
8
  import { u as U } from "../_chunks/use-copy-to-clipboard-Cyfc_dlv.js";
9
9
  import { u as j } from "../_chunks/use-debounced-callback-BisrB-Fq.js";
10
10
  import { useState as x, useRef as b, useEffect as E } from "react";
11
- import { u as z, a as J } from "../_chunks/use-direction-Dp8h70PP.js";
12
- import { u as W } from "../_chunks/use-persistent-state-i23OWy6G.js";
11
+ import { u as W, a as z } from "../_chunks/use-direction-Dp8h70PP.js";
12
+ import { u as N } from "../_chunks/use-persistent-state-i23OWy6G.js";
13
13
  import { u as Z } from "../_chunks/use-isomorphic-layout-effect-BGfaCOP1.js";
14
+ import { u as ee } from "../_chunks/use-web-otp-D_utzp6S.js";
14
15
  function S(e, o) {
15
- const [t, c] = x(e), n = b(null);
16
+ const [t, c] = x(e), u = b(null);
16
17
  return E(() => {
17
18
  if (o <= 0) {
18
- n.current !== null && (clearTimeout(n.current), n.current = null), c(e);
19
+ u.current !== null && (clearTimeout(u.current), u.current = null), c(e);
19
20
  return;
20
21
  }
21
22
  const s = setTimeout(() => {
22
- c(e), n.current = null;
23
+ c(e), u.current = null;
23
24
  }, o);
24
- return n.current = s, () => clearTimeout(s);
25
+ return u.current = s, () => clearTimeout(s);
25
26
  }, [e, o]), t;
26
27
  }
27
28
  const T = [
@@ -49,57 +50,58 @@ function p(e) {
49
50
  });
50
51
  }
51
52
  function C(e, o = {}) {
52
- const { enabled: t = !0, autoFocus: c = !0, restoreFocus: n = !0 } = o, s = b(null);
53
+ const { enabled: t = !0, autoFocus: c = !0, restoreFocus: u = !0 } = o, s = b(null);
53
54
  E(() => {
54
55
  if (!t) return;
55
56
  const a = e.current;
56
57
  if (!a) return;
57
58
  if (s.current = typeof document < "u" && document.activeElement instanceof HTMLElement ? document.activeElement : null, c) {
58
- const u = p(a)[0] ?? (a.tabIndex >= -1 ? a : null);
59
- u == null || u.focus();
59
+ const n = p(a)[0] ?? (a.tabIndex >= -1 ? a : null);
60
+ n == null || n.focus();
60
61
  }
61
62
  function f(r) {
62
63
  if (r.key !== "Tab") return;
63
- const u = e.current;
64
- if (!u) return;
65
- const i = p(u);
64
+ const n = e.current;
65
+ if (!n) return;
66
+ const i = p(n);
66
67
  if (i.length === 0) {
67
68
  r.preventDefault();
68
69
  return;
69
70
  }
70
71
  const d = i[0], m = i[i.length - 1], l = document.activeElement;
71
- r.shiftKey ? (l === d || !u.contains(l)) && (r.preventDefault(), m.focus()) : (l === m || !u.contains(l)) && (r.preventDefault(), d.focus());
72
+ r.shiftKey ? (l === d || !n.contains(l)) && (r.preventDefault(), m.focus()) : (l === m || !n.contains(l)) && (r.preventDefault(), d.focus());
72
73
  }
73
74
  return a.addEventListener("keydown", f), () => {
74
- if (a.removeEventListener("keydown", f), n && s.current) {
75
+ if (a.removeEventListener("keydown", f), u && s.current) {
75
76
  const r = s.current;
76
77
  requestAnimationFrame(() => {
77
78
  r.isConnected && r.focus();
78
79
  });
79
80
  }
80
81
  };
81
- }, [t, c, n, e]);
82
+ }, [t, c, u, e]);
82
83
  }
83
84
  export {
84
- O as ACCESSIBILITY_STORAGE_KEY,
85
+ K as ACCESSIBILITY_STORAGE_KEY,
85
86
  R as THEME_CLASS,
86
87
  H as THEME_STORAGE_KEY,
87
88
  M as resolveTheme,
88
89
  Y as themeClassList,
89
90
  G as useControllableState,
90
91
  U as useCopyToClipboard,
91
- g as useCountUp,
92
+ O as useCountUp,
92
93
  j as useDebouncedCallback,
93
94
  S as useDebouncedValue,
94
- z as useDirection,
95
- J as useDocumentDirection,
95
+ W as useDirection,
96
+ z as useDocumentDirection,
96
97
  C as useFocusTrap,
97
98
  Z as useIsomorphicLayoutEffect,
98
- w as useLocale,
99
+ k as useLocale,
99
100
  D as useMediaQuery,
100
- W as usePersistentState,
101
+ N as usePersistentState,
101
102
  v as usePrefersReducedMotion,
102
103
  _ as useScrollToFirstError,
103
- q as useTheme
104
+ q as useTheme,
105
+ ee as useWebOtp
104
106
  };
105
107
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/hooks/use-debounced-value.ts","../../src/hooks/use-focus-trap.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\n/**\n * Returns a value that lags `input` by `delayMs`. Each new `input`\n * resets the timer; the returned value updates once `input` has been\n * stable for `delayMs` ms.\n *\n * Companion to `useDebouncedCallback` — use this when you want the\n * debounced *value* (to drive a derived effect, query, or render),\n * and use the callback hook when you want the debounced *action*.\n *\n * @example\n * const [query, setQuery] = useState('');\n * const debouncedQuery = useDebouncedValue(query, 250);\n * useEffect(() => { void search(debouncedQuery); }, [debouncedQuery]);\n */\nexport function useDebouncedValue<T>(input: T, delayMs: number): T {\n const [value, setValue] = useState<T>(input);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (delayMs <= 0) {\n // Flush any pending timer so a stale queued value can't land\n // after the synchronous update below.\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n setValue(input);\n return;\n }\n const timer = setTimeout(() => {\n setValue(input);\n timerRef.current = null;\n }, delayMs);\n timerRef.current = timer;\n return () => clearTimeout(timer);\n }, [input, delayMs]);\n\n return value;\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Focus trap */\n/* */\n/* Lightweight focus-trap hook for components that compose a Radix */\n/* primitive without the overlay primitive (Dialog, AlertDialog, Sheet) */\n/* — those handle focus trapping for free via `@radix-ui/react-dialog`. */\n/* */\n/* This hook is intentionally NOT a Radix `<FocusScope>` re-export — it */\n/* is a hook so it composes inside `forwardRef` components without */\n/* nesting another wrapper element. If you need the full Radix */\n/* contract (return-focus management, loop, asChild), use */\n/* `@radix-ui/react-focus-scope` directly. */\n/* -------------------------------------------------------------------- */\n\nexport interface UseFocusTrapOptions {\n /** When `false` the trap is inert. Defaults to `true`. */\n enabled?: boolean;\n /**\n * When `true`, focus initial autofocus into the first focusable\n * descendant on mount / enable. @default true\n */\n autoFocus?: boolean;\n /**\n * When `true`, restores focus to the previously-focused element on\n * unmount / disable. @default true\n */\n restoreFocus?: boolean;\n}\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n 'audio[controls]',\n 'video[controls]',\n].join(',');\n\nfunction getFocusable(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((el) => {\n if (el.hidden) return false;\n // `inert` and `aria-hidden=\"true\"` block focus on the element AND\n // all its descendants — walk the chain to catch either ancestor.\n let node: HTMLElement | null = el;\n while (node) {\n if (node.hasAttribute('inert')) return false;\n if (node.getAttribute('aria-hidden') === 'true') return false;\n node = node.parentElement;\n }\n return true;\n });\n}\n\n/**\n * Constrain Tab navigation to descendants of `containerRef`. Wraps Tab\n * forward from the last focusable to the first, and Shift+Tab back from\n * the first to the last. Optionally autofocuses on enable and restores\n * focus on disable.\n *\n * Use this for inline modal patterns or focus zones that don't ship\n * with their own Radix overlay. Don't stack it inside Dialog / Sheet —\n * Radix already traps focus in those.\n *\n * @example\n * const ref = useRef<HTMLDivElement>(null);\n * useFocusTrap(ref, { enabled: open });\n * return <div ref={ref}>…</div>;\n */\nexport function useFocusTrap<T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n options: UseFocusTrapOptions = {},\n): void {\n const { enabled = true, autoFocus = true, restoreFocus = true } = options;\n const previouslyFocused = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!enabled) return;\n const container = containerRef.current;\n if (!container) return;\n\n previouslyFocused.current =\n typeof document !== 'undefined' &&\n document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n\n if (autoFocus) {\n const focusable = getFocusable(container);\n // Container itself is the fallback focus target — needs `tabIndex`\n // to receive focus, but `-1` is fine.\n const target =\n focusable[0] ?? (container.tabIndex >= -1 ? container : null);\n target?.focus();\n }\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Tab') return;\n const root = containerRef.current;\n if (!root) return;\n const focusable = getFocusable(root);\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement;\n\n if (event.shiftKey) {\n if (active === first || !root.contains(active)) {\n event.preventDefault();\n last.focus();\n }\n } else {\n if (active === last || !root.contains(active)) {\n event.preventDefault();\n first.focus();\n }\n }\n }\n\n container.addEventListener('keydown', onKeyDown);\n\n return () => {\n container.removeEventListener('keydown', onKeyDown);\n if (restoreFocus && previouslyFocused.current) {\n // rAF lets parent unmounts settle before refocus — a microtask\n // fires too early and can throw on a detached node.\n const target = previouslyFocused.current;\n requestAnimationFrame(() => {\n if (target.isConnected) target.focus();\n });\n }\n };\n }, [enabled, autoFocus, restoreFocus, containerRef]);\n}\n"],"names":["useDebouncedValue","input","delayMs","value","setValue","useState","timerRef","useRef","useEffect","timer","FOCUSABLE_SELECTOR","getFocusable","container","el","node","useFocusTrap","containerRef","options","enabled","autoFocus","restoreFocus","previouslyFocused","target","onKeyDown","event","root","focusable","first","last","active"],"mappings":";;;;;;;;;;;;;AAgBO,SAASA,EAAqBC,GAAUC,GAAoB;AACjE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAYJ,CAAK,GACrCK,IAAWC,EAA6C,IAAI;AAElE,SAAAC,EAAU,MAAM;AACd,QAAIN,KAAW,GAAG;AAGhB,MAAII,EAAS,YAAY,SACvB,aAAaA,EAAS,OAAO,GAC7BA,EAAS,UAAU,OAErBF,EAASH,CAAK;AACd;AAAA,IACF;AACA,UAAMQ,IAAQ,WAAW,MAAM;AAC7B,MAA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Yf,EAAac,CAAI;AACnC,UAAIC,EAAU,WAAW,GAAG;AAC1B,QAAAF,EAAM,eAAA;AACN;AAAA,MACF;AACA,YAAMG,IAAQD,EAAU,CAAC,GACnBE,IAAOF,EAAUA,EAAU,SAAS,CAAC,GACrCG,IAAS,SAAS;AAExB,MAAIL,EAAM,YACJK,MAAWF,KAAS,CAACF,EAAK,SAASI,CAAM,OAC3CL,EAAM,eAAA,GACNI,EAAK,MAAA,MAGHC,MAAWD,KAAQ,CAACH,EAAK,SAASI,CAAM,OAC1CL,EAAM,eAAA,GACNG,EAAM,MAAA;AAAA,IAGZ;AAEA,WAAAf,EAAU,iBAAiB,WAAWW,CAAS,GAExC,MAAM;AAEX,UADAX,EAAU,oBAAoB,WAAWW,CAAS,GAC9CH,KAAgBC,EAAkB,SAAS;AAG7C,cAAMC,IAASD,EAAkB;AACjC,8BAAsB,MAAM;AAC1B,UAAIC,EAAO,eAAaA,EAAO,MAAA;AAAA,QACjC,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,GAAG,CAACJ,GAASC,GAAWC,GAAcJ,CAAY,CAAC;AACrD;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/hooks/use-debounced-value.ts","../../src/hooks/use-focus-trap.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\n/**\n * Returns a value that lags `input` by `delayMs`. Each new `input`\n * resets the timer; the returned value updates once `input` has been\n * stable for `delayMs` ms.\n *\n * Companion to `useDebouncedCallback` — use this when you want the\n * debounced *value* (to drive a derived effect, query, or render),\n * and use the callback hook when you want the debounced *action*.\n *\n * @example\n * const [query, setQuery] = useState('');\n * const debouncedQuery = useDebouncedValue(query, 250);\n * useEffect(() => { void search(debouncedQuery); }, [debouncedQuery]);\n */\nexport function useDebouncedValue<T>(input: T, delayMs: number): T {\n const [value, setValue] = useState<T>(input);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(() => {\n if (delayMs <= 0) {\n // Flush any pending timer so a stale queued value can't land\n // after the synchronous update below.\n if (timerRef.current !== null) {\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }\n setValue(input);\n return;\n }\n const timer = setTimeout(() => {\n setValue(input);\n timerRef.current = null;\n }, delayMs);\n timerRef.current = timer;\n return () => clearTimeout(timer);\n }, [input, delayMs]);\n\n return value;\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/* -------------------------------------------------------------------- */\n/* Focus trap */\n/* */\n/* Lightweight focus-trap hook for components that compose a Radix */\n/* primitive without the overlay primitive (Dialog, AlertDialog, Sheet) */\n/* — those handle focus trapping for free via `@radix-ui/react-dialog`. */\n/* */\n/* This hook is intentionally NOT a Radix `<FocusScope>` re-export — it */\n/* is a hook so it composes inside `forwardRef` components without */\n/* nesting another wrapper element. If you need the full Radix */\n/* contract (return-focus management, loop, asChild), use */\n/* `@radix-ui/react-focus-scope` directly. */\n/* -------------------------------------------------------------------- */\n\nexport interface UseFocusTrapOptions {\n /** When `false` the trap is inert. Defaults to `true`. */\n enabled?: boolean;\n /**\n * When `true`, focus initial autofocus into the first focusable\n * descendant on mount / enable. @default true\n */\n autoFocus?: boolean;\n /**\n * When `true`, restores focus to the previously-focused element on\n * unmount / disable. @default true\n */\n restoreFocus?: boolean;\n}\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n 'audio[controls]',\n 'video[controls]',\n].join(',');\n\nfunction getFocusable(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((el) => {\n if (el.hidden) return false;\n // `inert` and `aria-hidden=\"true\"` block focus on the element AND\n // all its descendants — walk the chain to catch either ancestor.\n let node: HTMLElement | null = el;\n while (node) {\n if (node.hasAttribute('inert')) return false;\n if (node.getAttribute('aria-hidden') === 'true') return false;\n node = node.parentElement;\n }\n return true;\n });\n}\n\n/**\n * Constrain Tab navigation to descendants of `containerRef`. Wraps Tab\n * forward from the last focusable to the first, and Shift+Tab back from\n * the first to the last. Optionally autofocuses on enable and restores\n * focus on disable.\n *\n * Use this for inline modal patterns or focus zones that don't ship\n * with their own Radix overlay. Don't stack it inside Dialog / Sheet —\n * Radix already traps focus in those.\n *\n * @example\n * const ref = useRef<HTMLDivElement>(null);\n * useFocusTrap(ref, { enabled: open });\n * return <div ref={ref}>…</div>;\n */\nexport function useFocusTrap<T extends HTMLElement>(\n containerRef: RefObject<T | null>,\n options: UseFocusTrapOptions = {},\n): void {\n const { enabled = true, autoFocus = true, restoreFocus = true } = options;\n const previouslyFocused = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!enabled) return;\n const container = containerRef.current;\n if (!container) return;\n\n previouslyFocused.current =\n typeof document !== 'undefined' &&\n document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n\n if (autoFocus) {\n const focusable = getFocusable(container);\n // Container itself is the fallback focus target — needs `tabIndex`\n // to receive focus, but `-1` is fine.\n const target =\n focusable[0] ?? (container.tabIndex >= -1 ? container : null);\n target?.focus();\n }\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Tab') return;\n const root = containerRef.current;\n if (!root) return;\n const focusable = getFocusable(root);\n if (focusable.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement;\n\n if (event.shiftKey) {\n if (active === first || !root.contains(active)) {\n event.preventDefault();\n last.focus();\n }\n } else {\n if (active === last || !root.contains(active)) {\n event.preventDefault();\n first.focus();\n }\n }\n }\n\n container.addEventListener('keydown', onKeyDown);\n\n return () => {\n container.removeEventListener('keydown', onKeyDown);\n if (restoreFocus && previouslyFocused.current) {\n // rAF lets parent unmounts settle before refocus — a microtask\n // fires too early and can throw on a detached node.\n const target = previouslyFocused.current;\n requestAnimationFrame(() => {\n if (target.isConnected) target.focus();\n });\n }\n };\n }, [enabled, autoFocus, restoreFocus, containerRef]);\n}\n"],"names":["useDebouncedValue","input","delayMs","value","setValue","useState","timerRef","useRef","useEffect","timer","FOCUSABLE_SELECTOR","getFocusable","container","el","node","useFocusTrap","containerRef","options","enabled","autoFocus","restoreFocus","previouslyFocused","target","onKeyDown","event","root","focusable","first","last","active"],"mappings":";;;;;;;;;;;;;;AAgBO,SAASA,EAAqBC,GAAUC,GAAoB;AACjE,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAYJ,CAAK,GACrCK,IAAWC,EAA6C,IAAI;AAElE,SAAAC,EAAU,MAAM;AACd,QAAIN,KAAW,GAAG;AAGhB,MAAII,EAAS,YAAY,SACvB,aAAaA,EAAS,OAAO,GAC7BA,EAAS,UAAU,OAErBF,EAASH,CAAK;AACd;AAAA,IACF;AACA,UAAMQ,IAAQ,WAAW,MAAM;AAC7B,MAAAL,EAASH,CAAK,GACdK,EAAS,UAAU;AAAA,IACrB,GAAGJ,CAAO;AACV,WAAAI,EAAS,UAAUG,GACZ,MAAM,aAAaA,CAAK;AAAA,EACjC,GAAG,CAACR,GAAOC,CAAO,CAAC,GAEZC;AACT;ACTA,MAAMO,IAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAEV,SAASC,EAAaC,GAAuC;AAC3D,SAAO,MAAM;AAAA,IACXA,EAAU,iBAA8BF,CAAkB;AAAA,EAAA,EAC1D,OAAO,CAACG,MAAO;AACf,QAAIA,EAAG,OAAQ,QAAO;AAGtB,QAAIC,IAA2BD;AAC/B,WAAOC,KAAM;AAEX,UADIA,EAAK,aAAa,OAAO,KACzBA,EAAK,aAAa,aAAa,MAAM,OAAQ,QAAO;AACxD,MAAAA,IAAOA,EAAK;AAAA,IACd;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAiBO,SAASC,EACd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WC,GAAcJ,CAAY,CAAC;AACrD;"}
@@ -0,0 +1,22 @@
1
+ export interface UseWebOtpOptions {
2
+ /**
3
+ * Invoked once with the full code when the browser surfaces a matching
4
+ * SMS. Setting state from inside `onCode` is safe — the hook will not
5
+ * fire again for the same lifecycle (it auto-aborts after success).
6
+ */
7
+ onCode: (code: string) => void;
8
+ /**
9
+ * Optional error sink. `AbortError` (the normal cleanup path) is NEVER
10
+ * forwarded — only real failures (permission denied, malformed SMS, etc.).
11
+ * When omitted the hook silently swallows everything so a consumer that
12
+ * doesn't care about telemetry can call the hook bare.
13
+ */
14
+ onError?: (error: Error) => void;
15
+ /**
16
+ * Gate the listener. When `false` the hook is a no-op; flipping back to
17
+ * `true` reinstalls the listener. Default `true`.
18
+ */
19
+ enabled?: boolean;
20
+ }
21
+ export declare function useWebOtp({ onCode, onError, enabled, }: UseWebOtpOptions): void;
22
+ //# sourceMappingURL=use-web-otp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-web-otp.d.ts","sourceRoot":"","sources":["../../src/hooks/use-web-otp.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,EACxB,MAAM,EACN,OAAO,EACP,OAAc,GACf,EAAE,gBAAgB,GAAG,IAAI,CA6CzB"}
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { F as ba } from "./_chunks/form-field-BOm9hK35.js";
27
27
  import { F as Ra, u as Ia } from "./_chunks/form-field-context-B3APVHKx.js";
28
28
  import { M as Fa, m as Ea, a as La } from "./_chunks/multi-select-DOLO3K_z.js";
29
29
  import { N as ka, u as Oa } from "./_chunks/number-input-Dj5L3pXK.js";
30
- import { O as ya } from "./_chunks/otp-input-BEg_sn8A.js";
30
+ import { O as ya } from "./_chunks/otp-input-CDTWT5EK.js";
31
31
  import { P as Ma, u as Da } from "./_chunks/use-password-requirements-DsgduV1x.js";
32
32
  import { P as Va, c as va, p as Ha, a as Wa } from "./_chunks/phone-input-DfZbPPvh.js";
33
33
  import { R as Ua, r as Ka } from "./_chunks/recaptcha-widget-CFYyLSEX.js";
@@ -56,7 +56,7 @@ import { K as Lr, k as Nr } from "./_chunks/kbd-Cglkd7CY.js";
56
56
  import { K as Or, a as _r } from "./_chunks/key-value-pair-CkQIb9EG.js";
57
57
  import { L as Br, l as Mr } from "./_chunks/list-BOwqwy03.js";
58
58
  import { L as wr } from "./_chunks/logo-_Z-jLq80.js";
59
- import { M as vr } from "./_chunks/map-view-knHSNLoe.js";
59
+ import { M as vr } from "./_chunks/map-view-ZgbhfRqy.js";
60
60
  import { R as Wr } from "./_chunks/rating-BRD7O74e.js";
61
61
  import { S as Ur } from "./_chunks/skeleton-CZbwyJAA.js";
62
62
  import { S as Yr, s as jr, u as zr } from "./_chunks/sparkline-DEROcSl0.js";
@@ -131,7 +131,7 @@ import { C as Mn, c as Dn, r as wn } from "./_chunks/calendar-YHFknAGv.js";
131
131
  import { O as vn, o as Hn } from "./_chunks/operator-hero-7LiiP7zi.js";
132
132
  import { P as Gn, p as Un } from "./_chunks/patient-search-CBq62kmL.js";
133
133
  import { C as Yn, a as jn, b as zn, c as qn } from "./_chunks/contact-profile-card-Ce-LIDU8.js";
134
- import { P as Jn, p as Xn } from "./_chunks/practice-results-Dwm5tzLV.js";
134
+ import { P as Jn, p as Xn } from "./_chunks/practice-results-YD4dvqje.js";
135
135
  import { P as $n, f as ap, p as ep, a as rp, s as op, b as tp, c as sp } from "./_chunks/payment-form-D5rgnZu7.js";
136
136
  import { P as np, p as pp } from "./_chunks/pdf-viewer-DvtEHcEP.js";
137
137
  import { R as lp, r as fp } from "./_chunks/reviews-panel-Dow8Dzoa.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit-debug",
3
- "version": "0.33.1",
3
+ "version": "0.33.3",
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 +0,0 @@
1
- {"version":3,"file":"otp-input-BEg_sn8A.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 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 { 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\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<HTMLDivElement, 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 },\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 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\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 ref={ref}\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 </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","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","handleChange","event","raw","norm","current","newValue","before","after","focusTarget","handleKeyDown","handlePaste","stripped","handleFocus","baseId","agentHandle","useMemo","useAgentRegistration","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,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,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACD,MAAW;A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