@sekyro/react 0.1.0-rc.5 → 0.1.0-rc.6

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 (46) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/LICENSE +25 -16
  3. package/README.md +36 -4
  4. package/dist/chunk-3MBJZSJL.js +2 -0
  5. package/dist/chunk-4INDRENU.js +2 -0
  6. package/dist/chunk-4RUZQW5T.js +2 -0
  7. package/dist/chunk-63NUMQST.js +2 -0
  8. package/dist/chunk-65JA6YKG.js +2 -0
  9. package/dist/chunk-ADMDZLPM.js +2 -0
  10. package/dist/chunk-AMOZXMUP.js +2 -0
  11. package/dist/chunk-BENNJ4GV.js +2 -0
  12. package/dist/chunk-BJJZ4MO5.js +2 -0
  13. package/dist/chunk-BRA6F56P.js +2 -0
  14. package/dist/chunk-JAUZKPQO.js +2 -0
  15. package/dist/chunk-P2LX7BBE.js +2 -0
  16. package/dist/chunk-Q232JYNO.js +2 -0
  17. package/dist/chunk-YUNPD6ZB.js +2 -0
  18. package/dist/document-capture-view-SKFDM4AQ.js +2 -0
  19. package/dist/eid-view-WIK6KUTY.js +2 -0
  20. package/dist/email-otp-view-TYSBCGUY.js +2 -0
  21. package/dist/flow-views-PCBR5GYS.js +2 -0
  22. package/dist/fonts/Cairo-OFL.txt +93 -0
  23. package/dist/fonts/Geist-OFL.txt +93 -0
  24. package/dist/fonts/Inter-OFL.txt +93 -0
  25. package/dist/fonts/SekyroCairo-Bold.woff2 +0 -0
  26. package/dist/fonts/SekyroCairo-Regular.woff2 +0 -0
  27. package/dist/fonts/SekyroCairo-SemiBold.woff2 +0 -0
  28. package/dist/fonts/SekyroGeist-Bold.woff2 +0 -0
  29. package/dist/fonts/SekyroGeist-SemiBold.woff2 +0 -0
  30. package/dist/fonts/SekyroInter-Medium.woff2 +0 -0
  31. package/dist/fonts/SekyroInter-Regular.woff2 +0 -0
  32. package/dist/fonts/SekyroInter-SemiBold.woff2 +0 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.cts +5 -437
  35. package/dist/index.d.ts +5 -437
  36. package/dist/index.js +1 -1
  37. package/dist/portrait-capture-view-HYOEOAF4.js +2 -0
  38. package/dist/theme-BpOuzcWh.d.cts +456 -0
  39. package/dist/theme-BpOuzcWh.d.ts +456 -0
  40. package/dist/verification/index.cjs +2 -0
  41. package/dist/verification/index.d.cts +524 -0
  42. package/dist/verification/index.d.ts +524 -0
  43. package/dist/verification/index.js +2 -0
  44. package/dist/verification.css +560 -0
  45. package/package.json +20 -6
  46. package/sbom.cdx.json +5 -5
package/dist/index.d.cts CHANGED
@@ -1,445 +1,13 @@
1
- import * as react from 'react';
2
- import { ReactNode, RefObject } from 'react';
3
- import { CaptureErrorKind, GateHint, ReasonCode, CameraPermissionState, CameraFacing, Verification, CaptureError, CapturedArtifacts, VerificationResult, CaptureState, HostedBranding } from '@sekyro/web';
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
- * Remaining-attempts line per CLDR plural category (`Intl.PluralRules`),
38
- * `{count}` = the locale-formatted number. `one`/`other` are required; the
39
- * other categories fall back to `other` where the locale never selects them.
40
- */
41
- "capture.attemptsRemaining.one": string;
42
- "capture.attemptsRemaining.other": string;
43
- "capture.attemptsRemaining.zero"?: string;
44
- "capture.attemptsRemaining.two"?: string;
45
- "capture.attemptsRemaining.few"?: string;
46
- "capture.attemptsRemaining.many"?: string;
47
- "common.retry": string;
48
- "fcv2.err.permission": string;
49
- "fcv2.err.notfound": string;
50
- "fcv2.err.inuse": string;
51
- "fcv2.err.insecure": string;
52
- "fcv2.err.unsupported": string;
53
- "fcv2.err.generic": string;
54
- "fcv3.no_face": string;
55
- "fcv3.come_closer": string;
56
- "fcv3.move_back": string;
57
- "fcv3.center_face": string;
58
- "fcv3.straighten": string;
59
- "fcv3.more_light": string;
60
- "fcv3.too_bright": string;
61
- "fcv3.hold_still": string;
62
- "fcv3.steady_camera": string;
63
- "reasons.no_face": string;
64
- "reasons.media_unreadable": string;
65
- "reasons.clip_too_short": string;
66
- "reasons.spoof_detected": string;
67
- "reasons.review_band": string;
68
- "reasons.nni_not_found": string;
69
- "reasons.nni_invalid": string;
70
- "reasons.registry_unavailable": string;
71
- "reasons.result_from_cache": string;
72
- "reasons.no_face_source": string;
73
- "reasons.no_face_reference": string;
74
- "reasons.low_quality_reference": string;
75
- "reasons.below_threshold": string;
76
- "reasons.side_missing": string;
77
- "reasons.mrz_checksum_failed": string;
78
- "reasons.unreadable": string;
79
- "reasons.expired_document": string;
80
- "reasons.authenticity_review": string;
81
- "reasons.registry_mismatch": string;
82
- "reasons.document_nni_mismatch": string;
83
- "reasons.otp_mismatch": string;
84
- "reasons.otp_expired": string;
85
- "reasons.otp_send_failed": string;
86
- "reasons.uncalibrated_capture_channel": string;
87
- "reasons.location_not_allowed": string;
88
- "reasons.anonymizer_blocked": string;
89
- "reasons.nationality_not_allowed": string;
90
- "reasons.document_type_not_accepted": string;
91
- "reasons.underage": string;
92
- "reasons.age_unverifiable": string;
93
- "reasons.name_mismatch": string;
94
- "reasons.birth_date_mismatch": string;
95
- "reasons.nationality_mismatch": string;
96
- "reasons.document_number_mismatch": string;
97
- "reasons.liveness_inconclusive": string;
98
- "reasons.match_inconclusive": string;
99
- "reasons.document_authenticity": string;
100
- "reasons.mobile_required": string;
101
- "reasons.capture_tampered": string;
102
- "reasons.device_velocity_exceeded": string;
103
- /** `device_cooldown` without a usable `retryAfter`. */
104
- "reasons.device_cooldown": string;
105
- /** `device_cooldown`, `{time}` = a relative time ("in 5 minutes"). */
106
- "cooldown.retryIn": string;
107
- /** `device_cooldown`, `{time}` = a clock time (with the date when not today). */
108
- "cooldown.retryAt": string;
109
- /** The model service is busy and the SDK retries by itself. */
110
- "capture.busy": string;
111
- "errors.inference_unavailable": string;
112
- "method.title": string;
113
- "method.description": string;
114
- "method.national_number": string;
115
- "method.document_photo": string;
116
- "errors.method_required": string;
117
- "errors.attestation_invalid": string;
118
- "errors.network_error": string;
119
- "errors.session_expired": string;
120
- "errors.nni_unbound": string;
121
- "capture.tips.title": string;
122
- "capture.tips.light": string;
123
- "capture.tips.uncover": string;
124
- "capture.tips.eyeLevel": string;
125
- "capture.tips.straight": string;
126
- /** Spoken by the pre-capture "Listen" button (voice key `capture.tips.summary`); says what the built-in tips say. */
127
- "capture.tips.summary": string;
128
- "capture.tips.listen": string;
129
- /** The Listen button's label while the summary plays. */
130
- "capture.tips.stop": string;
131
- "capture.permission.granted": string;
132
- "capture.permission.prompt": string;
133
- "capture.permission.denied": string;
134
- "capture.permission.unknown": string;
135
- "capture.cameraLabel": string;
136
- "capture.facing.user": string;
137
- "capture.facing.environment": string;
138
- "capture.voiceGuidance": string;
139
- "capture.preparing.hint": string;
140
- "capture.ready": string;
141
- "fcv2.err.models": string;
142
- }
143
- /** Every string key the component renders. */
144
- type StringKey = keyof Strings;
145
- declare const en: Strings;
1
+ import { S as Strings, a as SekyroLocale } from './theme-BpOuzcWh.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-BpOuzcWh.cjs';
3
+ import 'react';
4
+ import '@sekyro/web';
146
5
 
147
6
  declare const ar: Strings;
148
7
 
149
8
  declare const fr: Strings;
150
9
 
151
- /** Locales with a built-in dictionary. */
152
- type SekyroLocale = "ar" | "fr" | "en";
153
-
154
- /** Gate hint code → the guidance line's string key. */
155
- declare function hintStringKey(hint: GateHint): StringKey;
156
- /** Camera / engine failure kind → its copy key. */
157
- declare function captureErrorStringKey(kind: CaptureErrorKind): StringKey;
158
- /**
159
- * Result reason → copy key. SDK-side failure reasons map onto the existing
160
- * error copy (`no_recorder` is the browser's missing recorder = unsupported;
161
- * `attestation` / `network` reuse the hosted error copy); backend reasons use
162
- * `reasons.*`. Returns `null` for a reason without built-in copy.
163
- */
164
- declare function reasonStringKey(reason: ReasonCode): StringKey | null;
165
- /**
166
- * When a device in cooldown may verify again (`device_cooldown` +
167
- * `retryAfter`), as the copy key and its `{time}`: within the hour a relative
168
- * time ("in 5 minutes", minutes rounded up) for `cooldown.retryIn`; later a
169
- * clock time — with the date when it is not today — for `cooldown.retryAt`.
170
- * `null` when `retryAfter` is missing, invalid or already past (use
171
- * `reasons.device_cooldown`). Locale digits and wording come from `Intl`.
172
- */
173
- declare function retryAfterTime(locale: SekyroLocale, retryAfter: string | undefined, now?: Date): {
174
- key: "cooldown.retryIn" | "cooldown.retryAt";
175
- time: string;
176
- } | null;
177
- /**
178
- * The remaining-attempts line for `count`, pluralized with the locale's CLDR
179
- * rules (`Intl.PluralRules`) and the locale's digits (`Intl.NumberFormat`) —
180
- * the same rendering an ICU `{count, plural, …}` message produces.
181
- */
182
- declare function attemptsRemainingText(dictionary: Strings, locale: SekyroLocale, count: number): string;
183
-
184
- /**
185
- * Keys that can be spoken: the engine's `fcv3.*` gate hints, plus
186
- * `capture.tips.summary` — the pre-capture "Listen to the instructions" summary
187
- * (played only on an explicit tap, never during capture).
188
- */
189
- 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" | "capture.tips.summary";
190
- /** Every {@link VoiceKey}, in a stable order (e.g. to build a clip map). */
191
- declare const VOICE_KEYS: readonly VoiceKey[];
192
-
193
- /** Resolve a voice clip URL; `null`/`undefined` = no clip (speech fallback applies). */
194
- type VoiceClipResolver = (key: VoiceKey, locale: SekyroLocale) => string | null | undefined;
195
- /**
196
- * Clip URLs per locale and key — e.g. the map a backend hands the SDK in the
197
- * session view. A new object identity is the change signal.
198
- */
199
- type VoiceClipMap = {
200
- readonly [L in SekyroLocale]?: {
201
- readonly [K in VoiceKey]?: string | null | undefined;
202
- } | undefined;
203
- };
204
- /** `voice.clips`: a resolver function or a `{ [locale]: { [voiceKey]: url } }` map. */
205
- type VoiceClipSource = VoiceClipResolver | VoiceClipMap;
206
-
207
- /** Voice-guidance options of `<LivenessCapture voice>`. */
208
- interface VoiceOptions {
209
- /** Initial state when the viewer has no stored preference. Default `true`. */
210
- defaultEnabled?: boolean;
211
- /**
212
- * Clip source; replaces the default. Either a resolver `(key, locale) → url | null`
213
- * or a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by your backend;
214
- * pass a new object to change it). A key without a URL — or a resolver that
215
- * throws — means "no clip" (speech fallback applies).
216
- *
217
- * Default: in verification mode, the Sekyro AI clip set delivered with the
218
- * session (`https://assets.sekyro.ai` — allow it in your CSP `media-src`);
219
- * in capture-only mode, none (device voice only).
220
- */
221
- clips?: VoiceClipSource;
222
- /** Locales where the device voice (speechSynthesis) may speak when no clip plays. Default `true` (all). */
223
- speechFallback?: boolean | readonly SekyroLocale[];
224
- /** localStorage key of the viewer's preference; `null` = do not persist. Default `"sekyro.voiceGuidance"`. */
225
- storageKey?: string | null;
226
- }
227
- /** The shared voice state the intro switch, the stage chip and the slots read. */
228
- interface VoiceControl {
229
- /** Something can speak for this locale (a resolvable clip, or a usable device voice). `false` on the server and with `voice={false}`. */
230
- readonly supported: boolean;
231
- /** The viewer's choice (persisted under `storageKey`). */
232
- readonly enabled: boolean;
233
- /** Turn voice on / off; call it from a click (turning on unlocks audio on iOS). */
234
- setEnabled(next: boolean): void;
235
- /** Flip `enabled` (same gesture rule as `setEnabled`). */
236
- toggle(): void;
237
- }
238
-
239
- /**
240
- * Display debounce before the no-face copy replaces another hint: detector
241
- * blips flash "we can't see your face" while the face is clearly visible, so
242
- * switching TO no-face must persist this long first. Any other hint renders
243
- * immediately and cancels a pending no-face. Chrome only — never gate input.
244
- */
245
- declare const NO_FACE_DEBOUNCE_MS = 800;
246
- /** A host message shown above the pre-capture screen (`notice` prop). */
247
- interface LivenessNotice {
248
- /** `info` is a polite status; `warning` / `danger` are announced as alerts. */
249
- tone: "info" | "warning" | "danger";
250
- text: ReactNode;
251
- }
252
- /** What `slots.intro` gets besides `start`: the state the built-in screen renders from. */
253
- interface IntroContext {
254
- /**
255
- * Detector preload gate: Start should wait for `ready`; `failed` offers `retryAssets`.
256
- * Also `loading` while `autoStart="when-permitted"` waits for the first camera-permission answer.
257
- */
258
- assets: "loading" | "ready" | "failed";
259
- retryAssets: () => void;
260
- permission: CameraPermissionState;
261
- /** The camera `start` opens (and the in-stage switch flips). */
262
- facing: CameraFacing;
263
- setFacing: (facing: CameraFacing) => void;
264
- /** A front/back choice makes sense on this device. */
265
- canChooseFacing: boolean;
266
- voice: VoiceControl;
267
- }
268
- /** Render slots — partners inject their own chrome around and inside the stage. */
269
- interface LivenessCaptureSlots {
270
- /** Above the stage (title, step indicator). */
271
- header?: ReactNode;
272
- /** Below everything (security note, help link). */
273
- footer?: ReactNode;
274
- /**
275
- * Replaces the built-in pre-capture screen while the capture is idle.
276
- * `start` begins the attempt with `context.facing` and unlocks audio — call
277
- * it from the click handler (iOS needs the user gesture). `context` carries
278
- * the preload gate, permission, facing and voice state the built-in screen
279
- * renders from.
280
- */
281
- intro?: (start: () => void, context: IntroContext) => ReactNode;
282
- /**
283
- * Rendered inside the stage box above the ring (measurement overlays,
284
- * watermarks); receives the ref of the component-owned `<video>`.
285
- */
286
- stageOverlay?: (videoRef: RefObject<HTMLVideoElement | null>) => ReactNode;
287
- /**
288
- * Replaces the built-in voice chip in the stage's start corner; receives the
289
- * current hint code, the on-screen text, the string key behind it and the
290
- * shared voice state. The component keeps speaking the guidance itself —
291
- * pass `voice={false}` if this slot plays its own audio (a development build
292
- * warns when this slot is set and `voice` is left undefined).
293
- */
294
- voicePrompt?: (hint: GateHint | null, text: string, key: StringKey | null, voice: VoiceControl) => ReactNode;
295
- /** Replaces the default camera-error notice. `retry` starts a fresh attempt. */
296
- errorPanel?: (error: CaptureError, retry: () => void) => ReactNode;
297
- }
298
- /** Props of {@link LivenessCapture}. */
299
- interface LivenessCaptureProps {
300
- /** From `createVerification()`. Absent → capture-only mode. */
301
- verification?: Verification;
302
- /** Built-in dictionary to use (`ar` | `fr` | `en`). */
303
- locale: SekyroLocale;
304
- /** Text direction; defaults to `rtl` for `ar`, `ltr` otherwise. */
305
- dir?: "ltr" | "rtl";
306
- /** Copy overrides merged on top of the built-in dictionary for `locale`. */
307
- strings?: Partial<Strings>;
308
- /** Render slots around / inside the stage. */
309
- slots?: LivenessCaptureSlots;
310
- /**
311
- * Start the camera instead of showing the pre-capture screen — at most once
312
- * per mount, once the detector preload is ready. `true` arms it (a host may
313
- * flip it later, once its own preconditions are met); `"when-permitted"`
314
- * arms it only while the camera permission is already `granted`. While armed
315
- * but not ready the screen shows its loader (or the retry on failure).
316
- *
317
- * An auto-start has no user gesture, so iOS keeps audio locked until the
318
- * person's first activating touch (`touchend`), click or key press (not
319
- * Escape) anywhere inside the component; the voice unlocks then (clips that
320
- * were due before stay silent).
321
- */
322
- autoStart?: boolean | "when-permitted";
323
- /** Host message above the pre-capture screen (or `slots.intro`); hidden once capture starts. */
324
- notice?: ReactNode | LivenessNotice;
325
- /**
326
- * Disable the built-in Start (e.g. a busy cooldown); pair with `startLabel`.
327
- * Gates only the pre-capture Start — not the error Retry, "record again" or
328
- * the retake button (gate those flows yourself, e.g. via `slots.errorPanel`).
329
- */
330
- startDisabled?: boolean;
331
- /** Built-in Start label; default `capture.start`. */
332
- startLabel?: ReactNode;
333
- /**
334
- * Tips on the pre-capture screen; default {@link DEFAULT_TIPS}; `false` hides the card.
335
- * The "Listen to the instructions" button (spoken `capture.tips.summary`)
336
- * shows with the built-in tips only — or with any tips when `voice.clips`
337
- * supplies a `capture.tips.summary` clip for the locale.
338
- */
339
- tips?: false | ReadonlyArray<BuiltInTipId | IntroTip>;
340
- /** Camera the attempt opens with; default `"user"` (front). */
341
- defaultFacing?: CameraFacing;
342
- /**
343
- * Voice guidance (on by default). Clips: `voice.clips` when given; else, in
344
- * verification mode, the Sekyro AI clip set delivered with the session (served
345
- * from `https://assets.sekyro.ai` — allow it in your CSP `media-src`); else
346
- * none. The device voice covers any key without a clip.
347
- * `false` = no speech, no voice switch, no stage chip, no "Listen" button.
348
- */
349
- voice?: false | VoiceOptions;
350
- /** Telemetry: once per change of the displayed, spoken-able (`fcv3.*`) guidance key. */
351
- onGuidance?: (key: StringKey) => void;
352
- /** Fires BEFORE any upload, with the engine's artifacts. */
353
- onCaptured?: (artifacts: CapturedArtifacts) => void;
354
- /** Verification mode only: the verdict for this session / capture. */
355
- onResult?: (result: VerificationResult) => void;
356
- /** Camera / engine failure. */
357
- onError?: (error: CaptureError) => void;
358
- /** Every capture-state transition (`starting` … `done`), for host chrome. */
359
- onStateChange?: (state: CaptureState) => void;
360
- /** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
361
- assetBaseUrl?: string;
362
- /** Extra class on the root element. */
363
- className?: string;
364
- }
365
- /**
366
- * Liveness capture UI over `@sekyro/web`: the mirrored camera stage with the
367
- * circular guide / progress ring / guidance line, the Start intro, the frozen
368
- * still + "checking" state, and the retry / error surfaces. Wrap in
369
- * {@link SekyroThemeProvider} (or set the `--sekyro-*` variables yourself) and
370
- * import `@sekyro/react/styles.css` once.
371
- */
372
- declare function LivenessCapture({ verification, locale, dir, strings, slots, autoStart, notice, startDisabled, startLabel, tips, defaultFacing, voice: voiceOption, onGuidance, onCaptured, onResult, onError, onStateChange, assetBaseUrl, className, }: LivenessCaptureProps): react.JSX.Element;
373
-
374
- /** Color tokens. Every value is any valid CSS `<color>`. */
375
- interface SekyroThemeColors {
376
- /** Primary action surface (buttons, filled ring ticks). */
377
- brand: string;
378
- /** Text on `brand`. */
379
- brandFg: string;
380
- /** Primary text; also the capture-stage scrim. */
381
- fg: string;
382
- /** Secondary text (hints, notes) — never essential instructions. */
383
- fgMuted: string;
384
- /** Page background behind the component. */
385
- bg: string;
386
- /** Card / panel surface the component sits on; also the text on the scrim. */
387
- surface: string;
388
- /** Focus ring. */
389
- ring: string;
390
- /** Error accents (notice border / tint). */
391
- danger: string;
392
- /** Gate-locked ring + success accents. */
393
- success: string;
394
- /** Draining-ring and retry-notice accents. */
395
- warning: string;
396
- }
397
- /** Theme shape accepted by {@link SekyroThemeProvider}. Partial: unset tokens keep the defaults. */
398
- interface SekyroTheme {
399
- /** Color tokens to override. */
400
- colors?: Partial<SekyroThemeColors>;
401
- /** Corner radius of panels and buttons (CSS length). */
402
- radius?: string;
403
- /** Font stack for all component text. */
404
- fontFamily?: string;
405
- }
406
- /**
407
- * Default theme. Every text pairing passes WCAG AAA (7:1) — fg/surface,
408
- * fg/bg, fgMuted/surface, brandFg/brand, surface/fg (the on-scrim guidance) —
409
- * and every UI accent passes 3:1 on surface (see test/contrast.test.ts).
410
- */
411
- declare const DEFAULT_THEME: Required<SekyroTheme> & {
412
- colors: SekyroThemeColors;
413
- };
414
- /** The CSS custom properties a theme resolves to (defaults filled in). */
415
- declare function themeToCssVars(theme?: SekyroTheme): Record<string, string>;
416
- /**
417
- * Map the session's org / app branding (`HostedSessionView.branding`, set in
418
- * the Sekyro dashboard) onto a {@link SekyroTheme}. Each colour maps to the
419
- * theme key of the same name and the focus ring follows `brand`. Values that
420
- * are not `#rrggbb` are ignored. Combine with your own theme through
421
- * {@link mergeThemes} — pass yours LAST so it wins:
422
- * `mergeThemes(brandingToTheme(view.branding), myTheme)`.
423
- */
424
- declare function brandingToTheme(branding: HostedBranding | undefined): SekyroTheme;
425
- /** Merge themes left to right: a later theme wins per token (colours merge per key). */
426
- declare function mergeThemes(...themes: (SekyroTheme | undefined)[]): SekyroTheme;
427
- /** Props of {@link SekyroThemeProvider}. */
428
- interface SekyroThemeProviderProps {
429
- /** Partial theme; unset tokens keep the {@link DEFAULT_THEME} values. */
430
- theme?: SekyroTheme;
431
- /** The subtree that reads the tokens. */
432
- children: ReactNode;
433
- /** Extra class on the wrapper (layout hooks for the host). */
434
- className?: string;
435
- }
436
- /**
437
- * Writes the theme's CSS variables on a wrapper `<div class="sekyro-root">`.
438
- * Nest inside your own layout; import `@sekyro/react/styles.css` once.
439
- */
440
- declare function SekyroThemeProvider({ theme, children, className }: SekyroThemeProviderProps): react.JSX.Element;
441
-
442
10
  /** The complete dictionary for `locale` with `overrides` merged on top. */
443
11
  declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
444
12
 
445
- export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, brandingToTheme, captureErrorStringKey, en, fr, hintStringKey, mergeThemes, reasonStringKey, resolveStrings, retryAfterTime, themeToCssVars };
13
+ export { SekyroLocale, Strings, ar, fr, resolveStrings };