@sekyro/react 0.1.0-rc.4 → 0.1.0-rc.41

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 (61) hide show
  1. package/CHANGELOG.md +636 -0
  2. package/LICENSE +25 -16
  3. package/README.md +179 -37
  4. package/dist/chunk-2KED7D2Q.js +2 -0
  5. package/dist/chunk-2SVN4T5I.js +2 -0
  6. package/dist/chunk-55NNQK5P.js +2 -0
  7. package/dist/chunk-5JJT6XTG.js +2 -0
  8. package/dist/chunk-7MMT5M4E.js +2 -0
  9. package/dist/chunk-A7C3KQ7K.js +2 -0
  10. package/dist/chunk-B26PUCMP.js +2 -0
  11. package/dist/chunk-FE6AS435.js +2 -0
  12. package/dist/chunk-GUTF3SPK.js +2 -0
  13. package/dist/chunk-HJDSATKF.js +2 -0
  14. package/dist/chunk-MDXA7C7O.js +2 -0
  15. package/dist/chunk-NZKIRHZR.js +2 -0
  16. package/dist/chunk-OLU5EOHP.js +2 -0
  17. package/dist/chunk-P7QMLT56.js +2 -0
  18. package/dist/chunk-Q7TAM5DA.js +2 -0
  19. package/dist/chunk-SRQXICOI.js +2 -0
  20. package/dist/chunk-TLYACCNO.js +2 -0
  21. package/dist/chunk-V3BQZTXH.js +2 -0
  22. package/dist/chunk-WIHBHY2K.js +2 -0
  23. package/dist/chunk-ZARKJW2C.js +2 -0
  24. package/dist/document-capture-view-ZQONDCSM.js +2 -0
  25. package/dist/eid-view-FEJHQBSB.js +2 -0
  26. package/dist/email-otp-view-4EY5CKR5.js +2 -0
  27. package/dist/flow-views-JC2DWBW3.js +2 -0
  28. package/dist/fonts/Cairo-OFL.txt +93 -0
  29. package/dist/fonts/Geist-OFL.txt +93 -0
  30. package/dist/fonts/Inter-OFL.txt +93 -0
  31. package/dist/fonts/SekyroCairo-Bold.woff2 +0 -0
  32. package/dist/fonts/SekyroCairo-Regular.woff2 +0 -0
  33. package/dist/fonts/SekyroCairo-SemiBold.woff2 +0 -0
  34. package/dist/fonts/SekyroGeist-Bold.woff2 +0 -0
  35. package/dist/fonts/SekyroGeist-SemiBold.woff2 +0 -0
  36. package/dist/fonts/SekyroInter-Medium.woff2 +0 -0
  37. package/dist/fonts/SekyroInter-Regular.woff2 +0 -0
  38. package/dist/fonts/SekyroInter-SemiBold.woff2 +0 -0
  39. package/dist/form-view-GPITA6X5.js +2 -0
  40. package/dist/index.cjs +1 -2
  41. package/dist/index.d.cts +7 -382
  42. package/dist/index.d.ts +7 -382
  43. package/dist/index.js +1 -2
  44. package/dist/overlay-de-7NCDPEIN.js +2 -0
  45. package/dist/overlay-es-6MGCPCFO.js +2 -0
  46. package/dist/overlay-pt-VTK6XJDH.js +2 -0
  47. package/dist/portrait-capture-view-Q6XYTGE7.js +2 -0
  48. package/dist/portrait-review-view-KZVKR6XN.js +2 -0
  49. package/dist/proof-of-address-view-YYZTILHQ.js +2 -0
  50. package/dist/styles.css +35 -11
  51. package/dist/theme-BhxSZSbp.d.cts +548 -0
  52. package/dist/theme-BhxSZSbp.d.ts +548 -0
  53. package/dist/verification/index.cjs +2 -0
  54. package/dist/verification/index.d.cts +895 -0
  55. package/dist/verification/index.d.ts +895 -0
  56. package/dist/verification/index.js +2 -0
  57. package/dist/verification.css +868 -0
  58. package/package.json +26 -13
  59. package/sbom.cdx.json +153 -0
  60. package/dist/index.cjs.map +0 -1
  61. package/dist/index.js.map +0 -1
@@ -0,0 +1,548 @@
1
+ import { CaptureErrorKind, GateHint, ReasonCode, RetakeHint, CameraPermissionState, CaptureMode, CameraFacing, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState, HostedBranding } from '@sekyro/web';
2
+ import * as react from 'react';
3
+ import { ReactNode, RefObject } from 'react';
4
+
5
+ /** A built-in tip (copy `capture.tips.<id>`, built-in icon). */
6
+ type BuiltInTipId = "light" | "uncover" | "eyeLevel" | "straight";
7
+ /** A host-provided tip. `id` is the React key; `icon` is decorative (rendered aria-hidden). */
8
+ interface IntroTip {
9
+ id: string;
10
+ text: ReactNode;
11
+ icon?: ReactNode;
12
+ }
13
+ /** The tips shown when the host passes none. */
14
+ declare const DEFAULT_TIPS: readonly BuiltInTipId[];
15
+
16
+ /**
17
+ * Every string the component renders, keyed like the hosted message catalog
18
+ * (`capture.*`, `fcv2.err.*`, `fcv3.*`, `reasons.*`, `errors.*`, `common.*`).
19
+ * The built-in ar/fr/en dictionaries are complete; `strings` overrides are
20
+ * `Partial<Strings>`.
21
+ */
22
+ interface Strings {
23
+ "capture.start": string;
24
+ "capture.recordAgain": string;
25
+ "capture.switchCamera": string;
26
+ "capture.preparing.title": string;
27
+ "capture.checking": string;
28
+ "capture.checkingHint": string;
29
+ "capture.securityNote": string;
30
+ "capture.cameraOff": string;
31
+ "capture.previewAlt": string;
32
+ "capture.retryCoaching.title": string;
33
+ "capture.retryCoaching.light": string;
34
+ "capture.retryCoaching.eyeLevel": string;
35
+ "capture.retryCoaching.head": string;
36
+ /**
37
+ * A retake whose reason is not about the face or the light (2026-11-08), an inconclusive read or a lighting hint the
38
+ * banner already gives (KI-343): this title, then tips without the light one (`retryCoachingOf` in captured-panel.tsx).
39
+ */
40
+ "capture.retryTips.title": string;
41
+ /** `multiple_faces`: one person in the frame. */
42
+ "capture.retryOneFace.alone": string;
43
+ "capture.retryOneFace.screens": string;
44
+ /** `capture_back_camera` (self capture on the back camera): which camera is the front one. */
45
+ "capture.retryFrontCamera.screenSide": string;
46
+ /** `capture_front_camera` (assisted capture on the front camera): which camera is the back one, and where to hold it. */
47
+ "capture.retryBackCamera.backSide": string;
48
+ "capture.retryBackCamera.circle": string;
49
+ /** `capture_not_upright`: how to hold the phone, and for how long. */
50
+ "capture.retryUpright.vertical": string;
51
+ "capture.retryUpright.untilEnd": string;
52
+ /** `media_unreadable` / `clip_too_short`: let the recording finish and reach us. */
53
+ "capture.retryRecording.cameraOn": string;
54
+ "capture.retryRecording.stay": string;
55
+ "capture.retryRecording.network": string;
56
+ /** `device_integrity_failed`: what makes a device check fail, said plainly. */
57
+ "capture.retryDevice.screenRecording": string;
58
+ "capture.retryDevice.phone": string;
59
+ /**
60
+ * Remaining-attempts line per CLDR plural category (`Intl.PluralRules`),
61
+ * `{count}` = the locale-formatted number. `one`/`other` are required; the
62
+ * other categories fall back to `other` where the locale never selects them.
63
+ */
64
+ "capture.attemptsRemaining.one": string;
65
+ "capture.attemptsRemaining.other": string;
66
+ "capture.attemptsRemaining.zero"?: string;
67
+ "capture.attemptsRemaining.two"?: string;
68
+ "capture.attemptsRemaining.few"?: string;
69
+ "capture.attemptsRemaining.many"?: string;
70
+ "common.retry": string;
71
+ "fcv2.err.permission": string;
72
+ "fcv2.err.notfound": string;
73
+ "fcv2.err.inuse": string;
74
+ "fcv2.err.insecure": string;
75
+ "fcv2.err.unsupported": string;
76
+ "fcv2.err.generic": string;
77
+ "fcv3.no_face": string;
78
+ "fcv3.come_closer": string;
79
+ "fcv3.move_back": string;
80
+ "fcv3.center_face": string;
81
+ "fcv3.straighten": string;
82
+ "fcv3.more_light": string;
83
+ "fcv3.too_bright": string;
84
+ "fcv3.hold_still": string;
85
+ "fcv3.steady_camera": string;
86
+ /** The phone shows a landscape frame (hint `upright`): the gate waits until it is held upright. */
87
+ "fcv3.hold_upright": string;
88
+ /** A second person of meaningful size is in the frame (hint `one_face`): the gate waits until one face remains. */
89
+ "fcv3.one_face": string;
90
+ "reasons.no_face": string;
91
+ "reasons.media_unreadable": string;
92
+ "reasons.clip_too_short": string;
93
+ "reasons.spoof_detected": string;
94
+ "reasons.review_band": string;
95
+ "reasons.nni_not_found": string;
96
+ "reasons.nni_invalid": string;
97
+ "reasons.registry_unavailable": string;
98
+ "reasons.no_face_source": string;
99
+ "reasons.no_face_reference": string;
100
+ "reasons.low_quality_reference": string;
101
+ "reasons.below_threshold": string;
102
+ "reasons.side_missing": string;
103
+ "reasons.mrz_checksum_failed": string;
104
+ "reasons.unreadable": string;
105
+ "reasons.expired_document": string;
106
+ "reasons.authenticity_review": string;
107
+ "reasons.registry_mismatch": string;
108
+ "reasons.document_nni_mismatch": string;
109
+ "reasons.id_number_invalid": string;
110
+ "reasons.registry_record_not_found": string;
111
+ "reasons.document_id_number_mismatch": string;
112
+ "reasons.otp_mismatch": string;
113
+ "reasons.otp_expired": string;
114
+ "reasons.otp_send_failed": string;
115
+ "reasons.uncalibrated_capture_channel": string;
116
+ "reasons.capture_back_camera": string;
117
+ "reasons.capture_not_upright": string;
118
+ "reasons.capture_front_camera": string;
119
+ /** The service saw a second person in the liveness clip: a free retake. */
120
+ "reasons.multiple_faces": string;
121
+ "reasons.location_not_allowed": string;
122
+ "reasons.anonymizer_blocked": string;
123
+ "reasons.nationality_not_allowed": string;
124
+ "reasons.document_type_not_accepted": string;
125
+ "reasons.underage": string;
126
+ "reasons.age_unverifiable": string;
127
+ "reasons.nationality_unreadable": string;
128
+ "reasons.name_mismatch": string;
129
+ "reasons.birth_date_mismatch": string;
130
+ "reasons.nationality_mismatch": string;
131
+ "reasons.document_number_mismatch": string;
132
+ "reasons.liveness_inconclusive": string;
133
+ "reasons.match_inconclusive": string;
134
+ "hints.appearance": string;
135
+ "hints.motion": string;
136
+ "hints.lighting": string;
137
+ "hints.framing": string;
138
+ "reasons.subject_revoked": string;
139
+ "reasons.probe_not_from_liveness": string;
140
+ "reasons.document_authenticity": string;
141
+ "reasons.mobile_required": string;
142
+ "reasons.capture_tampered": string;
143
+ "reasons.device_velocity_exceeded": string;
144
+ /** `device_cooldown` without a usable `retryAfter`. */
145
+ "reasons.device_cooldown": string;
146
+ /** `device_cooldown`, `{time}` = a relative time ("in 5 minutes"). */
147
+ "cooldown.retryIn": string;
148
+ /** `device_cooldown`, `{time}` = a clock time (with the date when not today). */
149
+ "cooldown.retryAt": string;
150
+ /** The model service is busy and the SDK retries by itself. */
151
+ "capture.busy": string;
152
+ "errors.inference_unavailable": string;
153
+ "method.title": string;
154
+ "method.description": string;
155
+ /** Returning-user session (profile v2 step 5): the intro title + one line. */
156
+ "returning.title": string;
157
+ "returning.description": string;
158
+ "method.national_number": string;
159
+ "method.document_photo": string;
160
+ "errors.method_required": string;
161
+ "errors.attestation_invalid": string;
162
+ "errors.device_clock": string;
163
+ "errors.network_error": string;
164
+ "errors.session_expired": string;
165
+ "errors.nni_unbound": string;
166
+ "errors.id_number_unbound": string;
167
+ "capture.tips.title": string;
168
+ "capture.tips.light": string;
169
+ "capture.tips.uncover": string;
170
+ "capture.tips.eyeLevel": string;
171
+ "capture.tips.straight": string;
172
+ /** Spoken by the pre-capture "Listen" button (voice key `capture.tips.summary`); says what the built-in tips say. */
173
+ "capture.tips.summary": string;
174
+ "capture.tips.listen": string;
175
+ /** The Listen button's label while the summary plays. */
176
+ "capture.tips.stop": string;
177
+ "capture.permission.granted": string;
178
+ "capture.permission.prompt": string;
179
+ "capture.permission.denied": string;
180
+ "capture.permission.unknown": string;
181
+ "capture.cameraLabel": string;
182
+ "capture.facing.user": string;
183
+ "capture.facing.environment": string;
184
+ /** Assisted capture (an agent films the person): the pre-capture title and lead, and the line under the stage. */
185
+ "capture.assisted.title": string;
186
+ "capture.assisted.lead": string;
187
+ "capture.assisted.stage": string;
188
+ /** Capture mode `choice` (design 2026-11-04 §4.5): who films, asked once before the first camera step. */
189
+ "capture.modeSwitch.toAssisted": string;
190
+ "capture.modeSwitch.toSelf": string;
191
+ "capture.modeSwitch.toAssistedLabel": string;
192
+ "capture.modeSwitch.toSelfLabel": string;
193
+ "capture.modeSwitch.restarted": string;
194
+ /** Liveness v7 §4.4 (self capture): the instruction for as long as the screen ramp paints a colour or a dark gap. */
195
+ "capture.lookAtColours": string;
196
+ "capture.voiceGuidance": string;
197
+ "capture.preparing.hint": string;
198
+ "capture.ready": string;
199
+ "fcv2.err.models": string;
200
+ "fcv2.err.backcamera": string;
201
+ }
202
+ /** Every string key the component renders. */
203
+ type StringKey = keyof Strings;
204
+ declare const en: Strings;
205
+
206
+ /**
207
+ * The end-user locales (spec 2026-10-29 §9), every screen translated in each. ar/fr/en are built in; es/pt/de load
208
+ * lazily (`loadSekyroLocale`) as complete overlays over English.
209
+ */
210
+ type SekyroLocale = "ar" | "fr" | "en" | "es" | "pt" | "de";
211
+
212
+ /** Gate hint code → the guidance line's string key. */
213
+ declare function hintStringKey(hint: GateHint): StringKey;
214
+ /**
215
+ * Backend retake hint (liveness v7 §5.2) → its coaching line. Preferred over
216
+ * `reasons.<reason>` on a `retry` verdict that carries one; an unknown value
217
+ * from a newer API falls back to the reason's copy (`null`).
218
+ */
219
+ declare function retakeHintStringKey(hint: RetakeHint | (string & {})): StringKey | null;
220
+ /** Camera / engine failure kind → its copy key. */
221
+ declare function captureErrorStringKey(kind: CaptureErrorKind): StringKey;
222
+ /**
223
+ * Result reason → copy key. SDK-side failure reasons map onto the existing
224
+ * error copy (`no_recorder` is the browser's missing recorder = unsupported;
225
+ * `attestation` / `network` reuse the hosted error copy, whatever the result's
226
+ * `attestationError`: a blocked security check frame and a refused token read the
227
+ * same to the person); backend reasons use
228
+ * `reasons.*`. Returns `null` for a reason without built-in copy.
229
+ */
230
+ declare function reasonStringKey(reason: ReasonCode): StringKey | null;
231
+ /**
232
+ * When a device in cooldown may verify again (`device_cooldown` +
233
+ * `retryAfter`), as the copy key and its `{time}`: within the hour a relative
234
+ * time ("in 5 minutes", minutes rounded up) for `cooldown.retryIn`; later a
235
+ * clock time — with the date when it is not today — for `cooldown.retryAt`.
236
+ * `null` when `retryAfter` is missing, invalid or already past (use
237
+ * `reasons.device_cooldown`). Locale digits and wording come from `Intl`.
238
+ */
239
+ declare function retryAfterTime(locale: SekyroLocale, retryAfter: string | undefined, now?: Date): {
240
+ key: "cooldown.retryIn" | "cooldown.retryAt";
241
+ time: string;
242
+ } | null;
243
+ /**
244
+ * The remaining-attempts line for `count`, pluralized with the locale's CLDR
245
+ * rules (`Intl.PluralRules`) and the locale's digits (`Intl.NumberFormat`) —
246
+ * the same rendering an ICU `{count, plural, …}` message produces.
247
+ */
248
+ declare function attemptsRemainingText(dictionary: Strings, locale: SekyroLocale, count: number): string;
249
+
250
+ /**
251
+ * Keys that can be spoken: the engine's `fcv3.*` gate hints,
252
+ * `capture.tips.summary` — the pre-capture "Listen to the instructions" summary
253
+ * (played only on an explicit tap, never during capture) — and
254
+ * `capture.lookAtColours`, the line shown during the colour flash.
255
+ */
256
+ type VoiceKey = "fcv3.no_face" | "fcv3.come_closer" | "fcv3.move_back" | "fcv3.center_face" | "fcv3.straighten" | "fcv3.more_light" | "fcv3.too_bright" | "fcv3.hold_still" | "fcv3.steady_camera" | "fcv3.hold_upright" | "fcv3.one_face" | "capture.tips.summary" | "capture.lookAtColours";
257
+ /** Every {@link VoiceKey}, in a stable order (e.g. to build a clip map). */
258
+ declare const VOICE_KEYS: readonly VoiceKey[];
259
+
260
+ /** Resolve a voice clip URL; `null`/`undefined` = no clip (speech fallback applies). */
261
+ type VoiceClipResolver = (key: VoiceKey, locale: SekyroLocale) => string | null | undefined;
262
+ /**
263
+ * Clip URLs per locale and key — e.g. the map a backend hands the SDK in the
264
+ * session view. A new object identity is the change signal.
265
+ */
266
+ type VoiceClipMap = {
267
+ readonly [L in SekyroLocale]?: {
268
+ readonly [K in VoiceKey]?: string | null | undefined;
269
+ } | undefined;
270
+ };
271
+ /** `voice.clips`: a resolver function or a `{ [locale]: { [voiceKey]: url } }` map. */
272
+ type VoiceClipSource = VoiceClipResolver | VoiceClipMap;
273
+
274
+ /** Voice-guidance options of `<LivenessCapture voice>`. */
275
+ interface VoiceOptions {
276
+ /** Initial state when the viewer has no stored preference. Default `true`. */
277
+ defaultEnabled?: boolean;
278
+ /**
279
+ * Clip source; replaces the default. Either a resolver `(key, locale) → url | null`
280
+ * or a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by your backend;
281
+ * pass a new object to change it). A key without a URL — or a resolver that
282
+ * throws — means "no clip" (speech fallback applies).
283
+ *
284
+ * Default: in verification mode, the Sekyro AI clip set delivered with the
285
+ * session (`https://assets.sekyro.ai` — allow it in your CSP `media-src`);
286
+ * in capture-only mode, none (device voice only).
287
+ */
288
+ clips?: VoiceClipSource;
289
+ /** Locales where the device voice (speechSynthesis) may speak when no clip plays. Default `true` (all). */
290
+ speechFallback?: boolean | readonly SekyroLocale[];
291
+ /** localStorage key of the viewer's preference; `null` = do not persist. Default `"sekyro.voiceGuidance"`. */
292
+ storageKey?: string | null;
293
+ }
294
+ /** The shared voice state the intro switch, the stage chip and the slots read. */
295
+ interface VoiceControl {
296
+ /** Something can speak for this locale (a resolvable clip, or a usable device voice). `false` on the server and with `voice={false}`. */
297
+ readonly supported: boolean;
298
+ /** The viewer's choice (persisted under `storageKey`). */
299
+ readonly enabled: boolean;
300
+ /** Turn voice on / off; call it from a click (turning on unlocks audio on iOS). */
301
+ setEnabled(next: boolean): void;
302
+ /** Flip `enabled` (same gesture rule as `setEnabled`). */
303
+ toggle(): void;
304
+ }
305
+
306
+ /**
307
+ * Display debounce before the no-face copy replaces another hint: detector
308
+ * blips flash "we can't see your face" while the face is clearly visible, so
309
+ * switching TO no-face must persist this long first. Any other hint renders
310
+ * immediately and cancels a pending no-face. Chrome only — never gate input.
311
+ */
312
+ declare const NO_FACE_DEBOUNCE_MS = 800;
313
+ /** A host message shown above the pre-capture screen (`notice` prop). */
314
+ interface LivenessNotice {
315
+ /** `info` is a polite status; `warning` / `danger` are announced as alerts. */
316
+ tone: "info" | "warning" | "danger";
317
+ text: ReactNode;
318
+ }
319
+ /** What `slots.intro` gets besides `start`: the state the built-in screen renders from. */
320
+ interface IntroContext {
321
+ /**
322
+ * Detector preload gate: Start should wait for `ready`; `failed` offers `retryAssets`.
323
+ * Also `loading` while `autoStart="when-permitted"` waits for the first camera-permission answer, and until the
324
+ * camera `start` opens is known (the capture mode and, in an assisted capture, whether the device has a front/back
325
+ * choice).
326
+ */
327
+ assets: "loading" | "ready" | "failed";
328
+ retryAssets: () => void;
329
+ permission: CameraPermissionState;
330
+ /**
331
+ * The permission probe answered at least once (`permission` is no longer the initial `unknown` placeholder): a
332
+ * `denied` here is the browser's answer, not a guess (spec 2026-10-29 §3.4, the no-camera notice).
333
+ */
334
+ permissionSettled: boolean;
335
+ /**
336
+ * Who films the face, set by the session's flow: `self` (the person, front camera) or `assisted` (an agent films
337
+ * the person with the back camera). Always `self` without a `verification`.
338
+ */
339
+ captureMode: CaptureMode;
340
+ /** The camera `start` opens, set by the capture mode: `"user"` (front) in a self capture, `"environment"` (back) in an assisted one. */
341
+ facing: CameraFacing;
342
+ voice: VoiceControl;
343
+ }
344
+ /** Render slots — partners inject their own chrome around and inside the stage. */
345
+ interface LivenessCaptureSlots {
346
+ /** Above the stage (title, step indicator). */
347
+ header?: ReactNode;
348
+ /** Below everything (security note, help link). */
349
+ footer?: ReactNode;
350
+ /**
351
+ * Replaces the built-in pre-capture screen while the capture is idle.
352
+ * `start` begins the attempt with `context.facing` and unlocks audio — call
353
+ * it from the click handler (iOS needs the user gesture). `context` carries
354
+ * the preload gate, permission, facing and voice state the built-in screen
355
+ * renders from.
356
+ */
357
+ intro?: (start: () => void, context: IntroContext) => ReactNode;
358
+ /**
359
+ * Rendered inside the stage box above the ring (measurement overlays,
360
+ * watermarks); receives the ref of the component-owned `<video>`.
361
+ */
362
+ stageOverlay?: (videoRef: RefObject<HTMLVideoElement | null>) => ReactNode;
363
+ /**
364
+ * Replaces the built-in voice chip in the stage's start corner; receives the
365
+ * current hint code, the on-screen text, the string key behind it and the
366
+ * shared voice state. The component keeps speaking the guidance itself —
367
+ * pass `voice={false}` if this slot plays its own audio (a development build
368
+ * warns when this slot is set and `voice` is left undefined).
369
+ */
370
+ voicePrompt?: (hint: GateHint | null, text: string, key: StringKey | null, voice: VoiceControl) => ReactNode;
371
+ /** Replaces the default camera-error notice. `retry` starts a fresh attempt. */
372
+ errorPanel?: (error: CaptureError, retry: () => void) => ReactNode;
373
+ }
374
+ /** Props of {@link LivenessCapture}. */
375
+ interface LivenessCaptureProps {
376
+ /** From `createVerification()`. Absent → capture-only mode. */
377
+ verification?: Verification;
378
+ /** Built-in dictionary to use (`ar` | `fr` | `en`). */
379
+ locale: SekyroLocale;
380
+ /** Text direction; defaults to `rtl` for `ar`, `ltr` otherwise. */
381
+ dir?: "ltr" | "rtl";
382
+ /** Copy overrides merged on top of the built-in dictionary for `locale`. */
383
+ strings?: Partial<Strings>;
384
+ /** Render slots around / inside the stage. */
385
+ slots?: LivenessCaptureSlots;
386
+ /**
387
+ * Start the camera instead of showing the pre-capture screen — at most once
388
+ * per mount, once the detector preload is ready. `true` arms it (a host may
389
+ * flip it later, once its own preconditions are met); `"when-permitted"`
390
+ * arms it only while the camera permission is already `granted`. While armed
391
+ * but not ready the screen shows its loader (or the retry on failure).
392
+ *
393
+ * An auto-start has no user gesture, so iOS keeps audio locked until the
394
+ * person's first activating touch (`touchend`), click or key press (not
395
+ * Escape) anywhere inside the component; the voice unlocks then (clips that
396
+ * were due before stay silent).
397
+ */
398
+ autoStart?: boolean | "when-permitted";
399
+ /** Host message above the pre-capture screen (or `slots.intro`); hidden once capture starts. */
400
+ notice?: ReactNode | LivenessNotice;
401
+ /**
402
+ * Disable the built-in Start (e.g. a busy cooldown); pair with `startLabel`.
403
+ * Gates only the pre-capture Start — not the error Retry, "record again" or
404
+ * the retake button (gate those flows yourself, e.g. via `slots.errorPanel`).
405
+ */
406
+ startDisabled?: boolean;
407
+ /** Built-in Start label; default `capture.start`. */
408
+ startLabel?: ReactNode;
409
+ /**
410
+ * Tips on the pre-capture screen; default {@link DEFAULT_TIPS}; `false` hides the card.
411
+ * The "Listen to the instructions" button (spoken `capture.tips.summary`)
412
+ * shows with the built-in tips only — or with any tips when `voice.clips`
413
+ * supplies a `capture.tips.summary` clip for the locale.
414
+ */
415
+ tips?: false | ReadonlyArray<BuiltInTipId | IntroTip>;
416
+ /**
417
+ * The spoken summary of custom `tips` (no recorded clip): the "Listen to the
418
+ * instructions" button reads it with the device voice. Flow model 2026-10-23:
419
+ * the ICAO tips variant (`capture.tipsIcao.summary`).
420
+ */
421
+ tipsSummary?: string;
422
+ /**
423
+ * Host coaching that replaces the guidance line while the camera runs (e.g.
424
+ * the ICAO coaching of a one-capture live photo); `null` / absent = the
425
+ * built-in guidance. Shown, not spoken.
426
+ */
427
+ coach?: string | null;
428
+ /**
429
+ * Voice guidance (on by default). Clips: `voice.clips` when given; else, in
430
+ * verification mode, the Sekyro AI clip set delivered with the session (served
431
+ * from `https://assets.sekyro.ai` — allow it in your CSP `media-src`); else
432
+ * none. The device voice covers any key without a clip.
433
+ * `false` = no speech, no voice switch, no stage chip, no "Listen" button.
434
+ */
435
+ voice?: false | VoiceOptions;
436
+ /** Telemetry: once per change of the displayed, spoken-able (`fcv3.*`) guidance key. */
437
+ onGuidance?: (key: StringKey) => void;
438
+ /** Fires BEFORE any upload, with the engine's artifacts. */
439
+ onCaptured?: (artifacts: CapturedArtifacts) => void;
440
+ /** Verification mode only: the verdict for this session / capture. */
441
+ onResult?: (result: VerificationResult) => void;
442
+ /** Camera / engine failure. */
443
+ onError?: (error: CaptureError) => void;
444
+ /** Every capture-state transition (`starting` … `done`), for host chrome. */
445
+ onStateChange?: (state: CaptureState) => void;
446
+ /** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
447
+ assetBaseUrl?: string;
448
+ /** Extra class on the root element. */
449
+ className?: string;
450
+ }
451
+ /**
452
+ * Liveness capture UI over `@sekyro/web`: the mirrored camera stage with the
453
+ * circular guide / progress ring / guidance line, the Start intro, the frozen
454
+ * still + "checking" state, and the retry / error surfaces. Wrap in
455
+ * {@link SekyroThemeProvider} (or set the `--sekyro-*` variables yourself) and
456
+ * import `@sekyro/react/styles.css` once.
457
+ */
458
+ declare function LivenessCapture({ verification, locale, dir, strings, slots, autoStart, notice, startDisabled, startLabel, tips, tipsSummary, coach, voice: voiceOption, onGuidance, onCaptured, onResult, onError, onStateChange, assetBaseUrl, className, }: LivenessCaptureProps): react.JSX.Element;
459
+
460
+ /** Color tokens. Every value is any valid CSS `<color>`. */
461
+ interface SekyroThemeColors {
462
+ /** Primary action surface (buttons, filled ring ticks). */
463
+ brand: string;
464
+ /** Text on `brand`. */
465
+ brandFg: string;
466
+ /** Primary text; also the capture-stage scrim. */
467
+ fg: string;
468
+ /** Secondary text (hints, notes) — never essential instructions. */
469
+ fgMuted: string;
470
+ /** Page background behind the component. */
471
+ bg: string;
472
+ /** Card / panel surface the component sits on; also the text on the scrim. */
473
+ surface: string;
474
+ /** Focus ring. */
475
+ ring: string;
476
+ /**
477
+ * Error accents (notice border / tint).
478
+ *
479
+ * @deprecated Status colours are standard since 0.1.0-rc.13; this key is ignored in a theme you pass and will be
480
+ * removed in 1.0. {@link DEFAULT_THEME} still lists the Sekyro value.
481
+ */
482
+ danger: string;
483
+ /**
484
+ * Gate-locked ring + success accents.
485
+ *
486
+ * @deprecated Status colours are standard since 0.1.0-rc.13; this key is ignored in a theme you pass and will be
487
+ * removed in 1.0. {@link DEFAULT_THEME} still lists the Sekyro value.
488
+ */
489
+ success: string;
490
+ /**
491
+ * Draining-ring and retry-notice accents.
492
+ *
493
+ * @deprecated Status colours are standard since 0.1.0-rc.13; this key is ignored in a theme you pass and will be
494
+ * removed in 1.0. {@link DEFAULT_THEME} still lists the Sekyro value.
495
+ */
496
+ warning: string;
497
+ }
498
+ /** Theme shape accepted by {@link SekyroThemeProvider}. Partial: unset tokens keep the defaults. */
499
+ interface SekyroTheme {
500
+ /** Color tokens to override. */
501
+ colors?: Partial<SekyroThemeColors>;
502
+ /** Corner radius of panels and buttons (CSS length). */
503
+ radius?: string;
504
+ /** Font stack for all component text. */
505
+ fontFamily?: string;
506
+ }
507
+ /**
508
+ * Default theme: the Sekyro AI brand (light), the same colours, font and 16px control radius as
509
+ * `<SekyroVerification>` and the native SDKs. Every text pairing passes WCAG AAA (7:1) — fg/surface,
510
+ * fg/bg, fgMuted/surface, brandFg/brand, surface/fg (the on-scrim guidance) — and every UI accent
511
+ * passes 3:1 on surface (see test/contrast.test.ts).
512
+ */
513
+ declare const DEFAULT_THEME: Required<SekyroTheme> & {
514
+ colors: SekyroThemeColors;
515
+ };
516
+ /** The CSS custom properties a theme resolves to (defaults filled in). */
517
+ declare function themeToCssVars(theme?: SekyroTheme): Record<string, string>;
518
+ /**
519
+ * Map the session's org / app branding (`HostedSessionView.branding`, set in
520
+ * the Sekyro dashboard) onto a {@link SekyroTheme}. Each colour maps to the
521
+ * theme key of the same name and the focus ring follows `brand`. Status
522
+ * colours are standard: `danger`, `success` and `warning` from an older
523
+ * server are ignored. Values that
524
+ * are not `#rrggbb` are ignored. Combine with your own theme through
525
+ * {@link mergeThemes} — pass yours LAST so it wins:
526
+ * `mergeThemes(brandingToTheme(view.branding), myTheme)`.
527
+ */
528
+ declare function brandingToTheme(branding: HostedBranding | undefined): SekyroTheme;
529
+ /** Merge themes left to right: a later theme wins per token (colours merge per key). */
530
+ declare function mergeThemes(...themes: (SekyroTheme | undefined)[]): SekyroTheme;
531
+ /** Props of {@link SekyroThemeProvider}. */
532
+ interface SekyroThemeProviderProps {
533
+ /** Partial theme; unset tokens keep the {@link DEFAULT_THEME} values. */
534
+ theme?: SekyroTheme;
535
+ /** The subtree that reads the tokens. */
536
+ children: ReactNode;
537
+ /** Extra class on the wrapper (layout hooks for the host). */
538
+ className?: string;
539
+ }
540
+ /**
541
+ * Writes the theme's CSS variables on a wrapper `<div class="sekyro-root">`.
542
+ * Nest inside your own layout; import `@sekyro/react/styles.css` once.
543
+ * Status colours are standard: `danger`, `success` and `warning` in `theme`
544
+ * are ignored.
545
+ */
546
+ declare function SekyroThemeProvider({ theme, children, className }: SekyroThemeProviderProps): react.JSX.Element;
547
+
548
+ export { retakeHintStringKey as A, type BuiltInTipId as B, DEFAULT_THEME as D, type IntroContext as I, LivenessCapture as L, NO_FACE_DEBOUNCE_MS as N, type Strings as S, VOICE_KEYS as V, type SekyroLocale as a, DEFAULT_TIPS as b, type IntroTip as c, type LivenessCaptureProps as d, type LivenessCaptureSlots as e, type LivenessNotice as f, type SekyroTheme as g, type SekyroThemeColors as h, SekyroThemeProvider as i, type SekyroThemeProviderProps as j, type StringKey as k, type VoiceClipMap as l, type VoiceClipResolver as m, type VoiceClipSource as n, type VoiceControl as o, type VoiceKey as p, type VoiceOptions as q, attemptsRemainingText as r, brandingToTheme as s, captureErrorStringKey as t, en as u, hintStringKey as v, mergeThemes as w, reasonStringKey as x, retryAfterTime as y, themeToCssVars as z };