@sekyro/react 0.1.0-rc.1 → 0.1.0-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/LICENSE +25 -16
  3. package/README.md +151 -14
  4. package/dist/chunk-2KED7D2Q.js +2 -0
  5. package/dist/chunk-5XYKAT3V.js +2 -0
  6. package/dist/chunk-63LPCEVJ.js +2 -0
  7. package/dist/chunk-746GPDBD.js +2 -0
  8. package/dist/chunk-D5WF4UNP.js +2 -0
  9. package/dist/chunk-ECWKDUB5.js +2 -0
  10. package/dist/chunk-EZ5TVL6P.js +2 -0
  11. package/dist/chunk-H2KIOYQU.js +2 -0
  12. package/dist/chunk-JNAKE3DW.js +2 -0
  13. package/dist/chunk-MXPLBQHW.js +2 -0
  14. package/dist/chunk-PCNVEJSW.js +2 -0
  15. package/dist/chunk-PYAJMHZH.js +2 -0
  16. package/dist/chunk-VRDPGOXM.js +2 -0
  17. package/dist/chunk-YY76AMUA.js +2 -0
  18. package/dist/chunk-ZCAZDOMD.js +2 -0
  19. package/dist/document-capture-view-E2USDGQJ.js +2 -0
  20. package/dist/eid-view-74CN2XAY.js +2 -0
  21. package/dist/email-otp-view-DE624TXY.js +2 -0
  22. package/dist/flow-views-CO5TQYTP.js +2 -0
  23. package/dist/fonts/Cairo-OFL.txt +93 -0
  24. package/dist/fonts/Geist-OFL.txt +93 -0
  25. package/dist/fonts/Inter-OFL.txt +93 -0
  26. package/dist/fonts/SekyroCairo-Bold.woff2 +0 -0
  27. package/dist/fonts/SekyroCairo-Regular.woff2 +0 -0
  28. package/dist/fonts/SekyroCairo-SemiBold.woff2 +0 -0
  29. package/dist/fonts/SekyroGeist-Bold.woff2 +0 -0
  30. package/dist/fonts/SekyroGeist-SemiBold.woff2 +0 -0
  31. package/dist/fonts/SekyroInter-Medium.woff2 +0 -0
  32. package/dist/fonts/SekyroInter-Regular.woff2 +0 -0
  33. package/dist/fonts/SekyroInter-SemiBold.woff2 +0 -0
  34. package/dist/index.cjs +2 -901
  35. package/dist/index.d.cts +7 -233
  36. package/dist/index.d.ts +7 -233
  37. package/dist/index.js +2 -880
  38. package/dist/overlay-de-UWA5CZLC.js +2 -0
  39. package/dist/overlay-es-VCSJQ4KN.js +2 -0
  40. package/dist/overlay-pt-NQMWHKF5.js +2 -0
  41. package/dist/portrait-capture-view-Y5W776HP.js +2 -0
  42. package/dist/styles.css +287 -12
  43. package/dist/theme-DqD8Nyoq.d.cts +496 -0
  44. package/dist/theme-DqD8Nyoq.d.ts +496 -0
  45. package/dist/verification/index.cjs +2 -0
  46. package/dist/verification/index.d.cts +573 -0
  47. package/dist/verification/index.d.ts +573 -0
  48. package/dist/verification/index.js +2 -0
  49. package/dist/verification.css +586 -0
  50. package/package.json +27 -13
  51. package/sbom.cdx.json +153 -0
  52. package/dist/index.cjs.map +0 -1
  53. package/dist/index.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,242 +1,16 @@
1
- import * as react from 'react';
2
- import { ReactNode, RefObject } from 'react';
3
- import { CaptureErrorKind, GateHint, ReasonCode, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState } from '@sekyro/web';
4
-
5
- /**
6
- * Every string the component renders, keyed like the hosted message catalog
7
- * (`capture.*`, `fcv2.err.*`, `fcv3.*`, `reasons.*`, `errors.*`, `common.*`).
8
- * The built-in ar/fr/en dictionaries are complete; `strings` overrides are
9
- * `Partial<Strings>`.
10
- */
11
- interface Strings {
12
- "capture.start": string;
13
- "capture.recordAgain": string;
14
- "capture.switchCamera": string;
15
- "capture.preparing.title": string;
16
- "capture.checking": string;
17
- "capture.checkingHint": string;
18
- "capture.securityNote": string;
19
- "capture.cameraOff": string;
20
- "capture.previewAlt": string;
21
- "capture.retryCoaching.title": string;
22
- "capture.retryCoaching.light": string;
23
- "capture.retryCoaching.eyeLevel": string;
24
- "capture.retryCoaching.head": string;
25
- /**
26
- * Remaining-attempts line per CLDR plural category (`Intl.PluralRules`),
27
- * `{count}` = the locale-formatted number. `one`/`other` are required; the
28
- * other categories fall back to `other` where the locale never selects them.
29
- */
30
- "capture.attemptsRemaining.one": string;
31
- "capture.attemptsRemaining.other": string;
32
- "capture.attemptsRemaining.zero"?: string;
33
- "capture.attemptsRemaining.two"?: string;
34
- "capture.attemptsRemaining.few"?: string;
35
- "capture.attemptsRemaining.many"?: string;
36
- "common.retry": string;
37
- "fcv2.err.permission": string;
38
- "fcv2.err.notfound": string;
39
- "fcv2.err.inuse": string;
40
- "fcv2.err.insecure": string;
41
- "fcv2.err.unsupported": string;
42
- "fcv2.err.generic": string;
43
- "fcv3.no_face": string;
44
- "fcv3.come_closer": string;
45
- "fcv3.move_back": string;
46
- "fcv3.center_face": string;
47
- "fcv3.straighten": string;
48
- "fcv3.more_light": string;
49
- "fcv3.too_bright": string;
50
- "fcv3.hold_still": string;
51
- "fcv3.steady_camera": string;
52
- "reasons.no_face": string;
53
- "reasons.media_unreadable": string;
54
- "reasons.clip_too_short": string;
55
- "reasons.spoof_detected": string;
56
- "reasons.review_band": string;
57
- "reasons.nni_not_found": string;
58
- "reasons.nni_invalid": string;
59
- "reasons.registry_unavailable": string;
60
- "reasons.result_from_cache": string;
61
- "reasons.no_face_source": string;
62
- "reasons.no_face_reference": string;
63
- "reasons.low_quality_reference": string;
64
- "reasons.below_threshold": string;
65
- "reasons.side_missing": string;
66
- "reasons.mrz_checksum_failed": string;
67
- "reasons.unreadable": string;
68
- "reasons.expired_document": string;
69
- "reasons.authenticity_review": string;
70
- "reasons.registry_mismatch": string;
71
- "reasons.otp_mismatch": string;
72
- "reasons.otp_expired": string;
73
- "reasons.otp_send_failed": string;
74
- "reasons.uncalibrated_capture_channel": string;
75
- "errors.attestation_invalid": string;
76
- "errors.network_error": string;
77
- "errors.session_expired": string;
78
- "errors.nni_unbound": string;
79
- }
80
- /** Every string key the component renders. */
81
- type StringKey = keyof Strings;
82
- declare const en: Strings;
1
+ import { S as Strings, a as SekyroLocale } from './theme-DqD8Nyoq.cjs';
2
+ export { B as BuiltInTipId, D as DEFAULT_THEME, b as DEFAULT_TIPS, I as IntroContext, c as IntroTip, L as LivenessCapture, d as LivenessCaptureProps, e as LivenessCaptureSlots, f as LivenessNotice, N as NO_FACE_DEBOUNCE_MS, g as SekyroTheme, h as SekyroThemeColors, i as SekyroThemeProvider, j as SekyroThemeProviderProps, k as StringKey, V as VOICE_KEYS, l as VoiceClipMap, m as VoiceClipResolver, n as VoiceClipSource, o as VoiceControl, p as VoiceKey, q as VoiceOptions, r as attemptsRemainingText, s as brandingToTheme, t as captureErrorStringKey, u as en, v as hintStringKey, w as mergeThemes, x as reasonStringKey, y as retryAfterTime, z as themeToCssVars } from './theme-DqD8Nyoq.cjs';
3
+ import '@sekyro/web';
4
+ import 'react';
83
5
 
84
6
  declare const ar: Strings;
85
7
 
86
8
  declare const fr: Strings;
87
9
 
88
- /** Locales with a built-in dictionary. */
89
- type SekyroLocale = "ar" | "fr" | "en";
90
-
91
- /** Gate hint code → the guidance line's string key. */
92
- declare function hintStringKey(hint: GateHint): StringKey;
93
- /** Camera / engine failure kind → its copy key. */
94
- declare function captureErrorStringKey(kind: CaptureErrorKind): StringKey;
95
- /**
96
- * Result reason → copy key. SDK-side failure reasons map onto the existing
97
- * error copy (`no_recorder` is the browser's missing recorder = unsupported;
98
- * `attestation` / `network` reuse the hosted error copy); backend reasons use
99
- * `reasons.*`. Returns `null` for a reason without built-in copy.
100
- */
101
- declare function reasonStringKey(reason: ReasonCode): StringKey | null;
102
- /**
103
- * The remaining-attempts line for `count`, pluralized with the locale's CLDR
104
- * rules (`Intl.PluralRules`) and the locale's digits (`Intl.NumberFormat`) —
105
- * the same rendering an ICU `{count, plural, …}` message produces.
106
- */
107
- declare function attemptsRemainingText(dictionary: Strings, locale: SekyroLocale, count: number): string;
108
-
109
10
  /**
110
- * Display debounce before the no-face copy replaces another hint: detector
111
- * blips flash "we can't see your face" while the face is clearly visible, so
112
- * switching TO no-face must persist this long first. Any other hint renders
113
- * immediately and cancels a pending no-face. Chrome only — never gate input.
11
+ * The complete dictionary for `locale` with `overrides` merged on top. es/pt/de: English with the locale's loaded
12
+ * overlay (English alone until `loadSekyroLocale` resolved).
114
13
  */
115
- declare const NO_FACE_DEBOUNCE_MS = 800;
116
- /** Render slots — partners inject their own chrome around and inside the stage. */
117
- interface LivenessCaptureSlots {
118
- /** Above the stage (title, step indicator). */
119
- header?: ReactNode;
120
- /** Below everything (security note, help link). */
121
- footer?: ReactNode;
122
- /**
123
- * Replaces the built-in intro (security note + Start button) while the
124
- * capture is idle; `start` begins the attempt. Hosts render their own
125
- * permission rows, loaders or settings here.
126
- */
127
- intro?: (start: () => void) => ReactNode;
128
- /**
129
- * Rendered inside the stage box above the ring (measurement overlays,
130
- * watermarks); receives the ref of the component-owned `<video>`.
131
- */
132
- stageOverlay?: (videoRef: RefObject<HTMLVideoElement | null>) => ReactNode;
133
- /**
134
- * Rendered in the stage's start corner next to the guidance line; receives
135
- * the current hint code, the on-screen text and the string key behind it
136
- * (audio / TTS controls go here — the key selects a voice clip).
137
- */
138
- voicePrompt?: (hint: GateHint | null, text: string, key: StringKey | null) => ReactNode;
139
- /** Replaces the default camera-error notice. `retry` starts a fresh attempt. */
140
- errorPanel?: (error: CaptureError, retry: () => void) => ReactNode;
141
- }
142
- /** Props of {@link LivenessCapture}. */
143
- interface LivenessCaptureProps {
144
- /** From `createVerification()`. Absent → capture-only mode. */
145
- verification?: Verification;
146
- /** Built-in dictionary to use (`ar` | `fr` | `en`). */
147
- locale: SekyroLocale;
148
- /** Text direction; defaults to `rtl` for `ar`, `ltr` otherwise. */
149
- dir?: "ltr" | "rtl";
150
- /** Copy overrides merged on top of the built-in dictionary for `locale`. */
151
- strings?: Partial<Strings>;
152
- /** Render slots around / inside the stage. */
153
- slots?: LivenessCaptureSlots;
154
- /**
155
- * Start the camera instead of showing the intro — at most once per mount,
156
- * the first time it is `true` while the capture is idle (a host flips it
157
- * once its own preconditions, e.g. a granted permission, are met).
158
- */
159
- autoStart?: boolean;
160
- /** Fires BEFORE any upload, with the engine's artifacts. */
161
- onCaptured?: (artifacts: CapturedArtifacts) => void;
162
- /** Verification mode only: the verdict for this session / capture. */
163
- onResult?: (result: VerificationResult) => void;
164
- /** Camera / engine failure. */
165
- onError?: (error: CaptureError) => void;
166
- /** Every capture-state transition (`starting` … `done`), for host chrome. */
167
- onStateChange?: (state: CaptureState) => void;
168
- /** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
169
- assetBaseUrl?: string;
170
- /** Extra class on the root element. */
171
- className?: string;
172
- }
173
- /**
174
- * Liveness capture UI over `@sekyro/web`: the mirrored camera stage with the
175
- * circular guide / progress ring / guidance line, the Start intro, the frozen
176
- * still + "checking" state, and the retry / error surfaces. Wrap in
177
- * {@link SekyroThemeProvider} (or set the `--sekyro-*` variables yourself) and
178
- * import `@sekyro/react/styles.css` once.
179
- */
180
- declare function LivenessCapture({ verification, locale, dir, strings, slots, autoStart, onCaptured, onResult, onError, onStateChange, assetBaseUrl, className, }: LivenessCaptureProps): react.JSX.Element;
181
-
182
- /** Color tokens. Every value is any valid CSS `<color>`. */
183
- interface SekyroThemeColors {
184
- /** Primary action surface (buttons, filled ring ticks). */
185
- brand: string;
186
- /** Text on `brand`. */
187
- brandFg: string;
188
- /** Primary text; also the capture-stage scrim. */
189
- fg: string;
190
- /** Secondary text (hints, notes) — never essential instructions. */
191
- fgMuted: string;
192
- /** Page background behind the component. */
193
- bg: string;
194
- /** Card / panel surface the component sits on; also the text on the scrim. */
195
- surface: string;
196
- /** Focus ring. */
197
- ring: string;
198
- /** Error accents (notice border / tint). */
199
- danger: string;
200
- /** Gate-locked ring + success accents. */
201
- success: string;
202
- /** Draining-ring and retry-notice accents. */
203
- warning: string;
204
- }
205
- /** Theme shape accepted by {@link SekyroThemeProvider}. Partial: unset tokens keep the defaults. */
206
- interface SekyroTheme {
207
- /** Color tokens to override. */
208
- colors?: Partial<SekyroThemeColors>;
209
- /** Corner radius of panels and buttons (CSS length). */
210
- radius?: string;
211
- /** Font stack for all component text. */
212
- fontFamily?: string;
213
- }
214
- /**
215
- * Default theme. Every text pairing passes WCAG AAA (7:1) — fg/surface,
216
- * fg/bg, fgMuted/surface, brandFg/brand, surface/fg (the on-scrim guidance) —
217
- * and every UI accent passes 3:1 on surface (see test/contrast.test.ts).
218
- */
219
- declare const DEFAULT_THEME: Required<SekyroTheme> & {
220
- colors: SekyroThemeColors;
221
- };
222
- /** The CSS custom properties a theme resolves to (defaults filled in). */
223
- declare function themeToCssVars(theme?: SekyroTheme): Record<string, string>;
224
- /** Props of {@link SekyroThemeProvider}. */
225
- interface SekyroThemeProviderProps {
226
- /** Partial theme; unset tokens keep the {@link DEFAULT_THEME} values. */
227
- theme?: SekyroTheme;
228
- /** The subtree that reads the tokens. */
229
- children: ReactNode;
230
- /** Extra class on the wrapper (layout hooks for the host). */
231
- className?: string;
232
- }
233
- /**
234
- * Writes the theme's CSS variables on a wrapper `<div class="sekyro-root">`.
235
- * Nest inside your own layout; import `@sekyro/react/styles.css` once.
236
- */
237
- declare function SekyroThemeProvider({ theme, children, className }: SekyroThemeProviderProps): react.JSX.Element;
238
-
239
- /** The complete dictionary for `locale` with `overrides` merged on top. */
240
14
  declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
241
15
 
242
- export { DEFAULT_THEME, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, ar, attemptsRemainingText, captureErrorStringKey, en, fr, hintStringKey, reasonStringKey, resolveStrings, themeToCssVars };
16
+ export { SekyroLocale, Strings, ar, fr, resolveStrings };
package/dist/index.d.ts CHANGED
@@ -1,242 +1,16 @@
1
- import * as react from 'react';
2
- import { ReactNode, RefObject } from 'react';
3
- import { CaptureErrorKind, GateHint, ReasonCode, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState } from '@sekyro/web';
4
-
5
- /**
6
- * Every string the component renders, keyed like the hosted message catalog
7
- * (`capture.*`, `fcv2.err.*`, `fcv3.*`, `reasons.*`, `errors.*`, `common.*`).
8
- * The built-in ar/fr/en dictionaries are complete; `strings` overrides are
9
- * `Partial<Strings>`.
10
- */
11
- interface Strings {
12
- "capture.start": string;
13
- "capture.recordAgain": string;
14
- "capture.switchCamera": string;
15
- "capture.preparing.title": string;
16
- "capture.checking": string;
17
- "capture.checkingHint": string;
18
- "capture.securityNote": string;
19
- "capture.cameraOff": string;
20
- "capture.previewAlt": string;
21
- "capture.retryCoaching.title": string;
22
- "capture.retryCoaching.light": string;
23
- "capture.retryCoaching.eyeLevel": string;
24
- "capture.retryCoaching.head": string;
25
- /**
26
- * Remaining-attempts line per CLDR plural category (`Intl.PluralRules`),
27
- * `{count}` = the locale-formatted number. `one`/`other` are required; the
28
- * other categories fall back to `other` where the locale never selects them.
29
- */
30
- "capture.attemptsRemaining.one": string;
31
- "capture.attemptsRemaining.other": string;
32
- "capture.attemptsRemaining.zero"?: string;
33
- "capture.attemptsRemaining.two"?: string;
34
- "capture.attemptsRemaining.few"?: string;
35
- "capture.attemptsRemaining.many"?: string;
36
- "common.retry": string;
37
- "fcv2.err.permission": string;
38
- "fcv2.err.notfound": string;
39
- "fcv2.err.inuse": string;
40
- "fcv2.err.insecure": string;
41
- "fcv2.err.unsupported": string;
42
- "fcv2.err.generic": string;
43
- "fcv3.no_face": string;
44
- "fcv3.come_closer": string;
45
- "fcv3.move_back": string;
46
- "fcv3.center_face": string;
47
- "fcv3.straighten": string;
48
- "fcv3.more_light": string;
49
- "fcv3.too_bright": string;
50
- "fcv3.hold_still": string;
51
- "fcv3.steady_camera": string;
52
- "reasons.no_face": string;
53
- "reasons.media_unreadable": string;
54
- "reasons.clip_too_short": string;
55
- "reasons.spoof_detected": string;
56
- "reasons.review_band": string;
57
- "reasons.nni_not_found": string;
58
- "reasons.nni_invalid": string;
59
- "reasons.registry_unavailable": string;
60
- "reasons.result_from_cache": string;
61
- "reasons.no_face_source": string;
62
- "reasons.no_face_reference": string;
63
- "reasons.low_quality_reference": string;
64
- "reasons.below_threshold": string;
65
- "reasons.side_missing": string;
66
- "reasons.mrz_checksum_failed": string;
67
- "reasons.unreadable": string;
68
- "reasons.expired_document": string;
69
- "reasons.authenticity_review": string;
70
- "reasons.registry_mismatch": string;
71
- "reasons.otp_mismatch": string;
72
- "reasons.otp_expired": string;
73
- "reasons.otp_send_failed": string;
74
- "reasons.uncalibrated_capture_channel": string;
75
- "errors.attestation_invalid": string;
76
- "errors.network_error": string;
77
- "errors.session_expired": string;
78
- "errors.nni_unbound": string;
79
- }
80
- /** Every string key the component renders. */
81
- type StringKey = keyof Strings;
82
- declare const en: Strings;
1
+ import { S as Strings, a as SekyroLocale } from './theme-DqD8Nyoq.js';
2
+ export { B as BuiltInTipId, D as DEFAULT_THEME, b as DEFAULT_TIPS, I as IntroContext, c as IntroTip, L as LivenessCapture, d as LivenessCaptureProps, e as LivenessCaptureSlots, f as LivenessNotice, N as NO_FACE_DEBOUNCE_MS, g as SekyroTheme, h as SekyroThemeColors, i as SekyroThemeProvider, j as SekyroThemeProviderProps, k as StringKey, V as VOICE_KEYS, l as VoiceClipMap, m as VoiceClipResolver, n as VoiceClipSource, o as VoiceControl, p as VoiceKey, q as VoiceOptions, r as attemptsRemainingText, s as brandingToTheme, t as captureErrorStringKey, u as en, v as hintStringKey, w as mergeThemes, x as reasonStringKey, y as retryAfterTime, z as themeToCssVars } from './theme-DqD8Nyoq.js';
3
+ import '@sekyro/web';
4
+ import 'react';
83
5
 
84
6
  declare const ar: Strings;
85
7
 
86
8
  declare const fr: Strings;
87
9
 
88
- /** Locales with a built-in dictionary. */
89
- type SekyroLocale = "ar" | "fr" | "en";
90
-
91
- /** Gate hint code → the guidance line's string key. */
92
- declare function hintStringKey(hint: GateHint): StringKey;
93
- /** Camera / engine failure kind → its copy key. */
94
- declare function captureErrorStringKey(kind: CaptureErrorKind): StringKey;
95
- /**
96
- * Result reason → copy key. SDK-side failure reasons map onto the existing
97
- * error copy (`no_recorder` is the browser's missing recorder = unsupported;
98
- * `attestation` / `network` reuse the hosted error copy); backend reasons use
99
- * `reasons.*`. Returns `null` for a reason without built-in copy.
100
- */
101
- declare function reasonStringKey(reason: ReasonCode): StringKey | null;
102
- /**
103
- * The remaining-attempts line for `count`, pluralized with the locale's CLDR
104
- * rules (`Intl.PluralRules`) and the locale's digits (`Intl.NumberFormat`) —
105
- * the same rendering an ICU `{count, plural, …}` message produces.
106
- */
107
- declare function attemptsRemainingText(dictionary: Strings, locale: SekyroLocale, count: number): string;
108
-
109
10
  /**
110
- * Display debounce before the no-face copy replaces another hint: detector
111
- * blips flash "we can't see your face" while the face is clearly visible, so
112
- * switching TO no-face must persist this long first. Any other hint renders
113
- * immediately and cancels a pending no-face. Chrome only — never gate input.
11
+ * The complete dictionary for `locale` with `overrides` merged on top. es/pt/de: English with the locale's loaded
12
+ * overlay (English alone until `loadSekyroLocale` resolved).
114
13
  */
115
- declare const NO_FACE_DEBOUNCE_MS = 800;
116
- /** Render slots — partners inject their own chrome around and inside the stage. */
117
- interface LivenessCaptureSlots {
118
- /** Above the stage (title, step indicator). */
119
- header?: ReactNode;
120
- /** Below everything (security note, help link). */
121
- footer?: ReactNode;
122
- /**
123
- * Replaces the built-in intro (security note + Start button) while the
124
- * capture is idle; `start` begins the attempt. Hosts render their own
125
- * permission rows, loaders or settings here.
126
- */
127
- intro?: (start: () => void) => ReactNode;
128
- /**
129
- * Rendered inside the stage box above the ring (measurement overlays,
130
- * watermarks); receives the ref of the component-owned `<video>`.
131
- */
132
- stageOverlay?: (videoRef: RefObject<HTMLVideoElement | null>) => ReactNode;
133
- /**
134
- * Rendered in the stage's start corner next to the guidance line; receives
135
- * the current hint code, the on-screen text and the string key behind it
136
- * (audio / TTS controls go here — the key selects a voice clip).
137
- */
138
- voicePrompt?: (hint: GateHint | null, text: string, key: StringKey | null) => ReactNode;
139
- /** Replaces the default camera-error notice. `retry` starts a fresh attempt. */
140
- errorPanel?: (error: CaptureError, retry: () => void) => ReactNode;
141
- }
142
- /** Props of {@link LivenessCapture}. */
143
- interface LivenessCaptureProps {
144
- /** From `createVerification()`. Absent → capture-only mode. */
145
- verification?: Verification;
146
- /** Built-in dictionary to use (`ar` | `fr` | `en`). */
147
- locale: SekyroLocale;
148
- /** Text direction; defaults to `rtl` for `ar`, `ltr` otherwise. */
149
- dir?: "ltr" | "rtl";
150
- /** Copy overrides merged on top of the built-in dictionary for `locale`. */
151
- strings?: Partial<Strings>;
152
- /** Render slots around / inside the stage. */
153
- slots?: LivenessCaptureSlots;
154
- /**
155
- * Start the camera instead of showing the intro — at most once per mount,
156
- * the first time it is `true` while the capture is idle (a host flips it
157
- * once its own preconditions, e.g. a granted permission, are met).
158
- */
159
- autoStart?: boolean;
160
- /** Fires BEFORE any upload, with the engine's artifacts. */
161
- onCaptured?: (artifacts: CapturedArtifacts) => void;
162
- /** Verification mode only: the verdict for this session / capture. */
163
- onResult?: (result: VerificationResult) => void;
164
- /** Camera / engine failure. */
165
- onError?: (error: CaptureError) => void;
166
- /** Every capture-state transition (`starting` … `done`), for host chrome. */
167
- onStateChange?: (state: CaptureState) => void;
168
- /** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
169
- assetBaseUrl?: string;
170
- /** Extra class on the root element. */
171
- className?: string;
172
- }
173
- /**
174
- * Liveness capture UI over `@sekyro/web`: the mirrored camera stage with the
175
- * circular guide / progress ring / guidance line, the Start intro, the frozen
176
- * still + "checking" state, and the retry / error surfaces. Wrap in
177
- * {@link SekyroThemeProvider} (or set the `--sekyro-*` variables yourself) and
178
- * import `@sekyro/react/styles.css` once.
179
- */
180
- declare function LivenessCapture({ verification, locale, dir, strings, slots, autoStart, onCaptured, onResult, onError, onStateChange, assetBaseUrl, className, }: LivenessCaptureProps): react.JSX.Element;
181
-
182
- /** Color tokens. Every value is any valid CSS `<color>`. */
183
- interface SekyroThemeColors {
184
- /** Primary action surface (buttons, filled ring ticks). */
185
- brand: string;
186
- /** Text on `brand`. */
187
- brandFg: string;
188
- /** Primary text; also the capture-stage scrim. */
189
- fg: string;
190
- /** Secondary text (hints, notes) — never essential instructions. */
191
- fgMuted: string;
192
- /** Page background behind the component. */
193
- bg: string;
194
- /** Card / panel surface the component sits on; also the text on the scrim. */
195
- surface: string;
196
- /** Focus ring. */
197
- ring: string;
198
- /** Error accents (notice border / tint). */
199
- danger: string;
200
- /** Gate-locked ring + success accents. */
201
- success: string;
202
- /** Draining-ring and retry-notice accents. */
203
- warning: string;
204
- }
205
- /** Theme shape accepted by {@link SekyroThemeProvider}. Partial: unset tokens keep the defaults. */
206
- interface SekyroTheme {
207
- /** Color tokens to override. */
208
- colors?: Partial<SekyroThemeColors>;
209
- /** Corner radius of panels and buttons (CSS length). */
210
- radius?: string;
211
- /** Font stack for all component text. */
212
- fontFamily?: string;
213
- }
214
- /**
215
- * Default theme. Every text pairing passes WCAG AAA (7:1) — fg/surface,
216
- * fg/bg, fgMuted/surface, brandFg/brand, surface/fg (the on-scrim guidance) —
217
- * and every UI accent passes 3:1 on surface (see test/contrast.test.ts).
218
- */
219
- declare const DEFAULT_THEME: Required<SekyroTheme> & {
220
- colors: SekyroThemeColors;
221
- };
222
- /** The CSS custom properties a theme resolves to (defaults filled in). */
223
- declare function themeToCssVars(theme?: SekyroTheme): Record<string, string>;
224
- /** Props of {@link SekyroThemeProvider}. */
225
- interface SekyroThemeProviderProps {
226
- /** Partial theme; unset tokens keep the {@link DEFAULT_THEME} values. */
227
- theme?: SekyroTheme;
228
- /** The subtree that reads the tokens. */
229
- children: ReactNode;
230
- /** Extra class on the wrapper (layout hooks for the host). */
231
- className?: string;
232
- }
233
- /**
234
- * Writes the theme's CSS variables on a wrapper `<div class="sekyro-root">`.
235
- * Nest inside your own layout; import `@sekyro/react/styles.css` once.
236
- */
237
- declare function SekyroThemeProvider({ theme, children, className }: SekyroThemeProviderProps): react.JSX.Element;
238
-
239
- /** The complete dictionary for `locale` with `overrides` merged on top. */
240
14
  declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
241
15
 
242
- export { DEFAULT_THEME, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, ar, attemptsRemainingText, captureErrorStringKey, en, fr, hintStringKey, reasonStringKey, resolveStrings, themeToCssVars };
16
+ export { SekyroLocale, Strings, ar, fr, resolveStrings };