@idmission/websdk-ui 0.2.0-rc.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/README.md +168 -56
  2. package/dist/DocumentCaptureView.d.ts +44 -5
  3. package/dist/DocumentCaptureView.d.ts.map +1 -1
  4. package/dist/DocumentCaptureView.js +517 -30
  5. package/dist/FaceLivenessView.d.ts +3 -3
  6. package/dist/FaceLivenessView.d.ts.map +1 -1
  7. package/dist/FaceLivenessView.js +82 -40
  8. package/dist/IdCaptureView.d.ts +33 -20
  9. package/dist/IdCaptureView.d.ts.map +1 -1
  10. package/dist/IdCaptureView.js +196 -33
  11. package/dist/SelfieCaptureView.d.ts +19 -2
  12. package/dist/SelfieCaptureView.d.ts.map +1 -1
  13. package/dist/SelfieCaptureView.js +17 -5
  14. package/dist/SignatureCaptureView.d.ts +23 -2
  15. package/dist/SignatureCaptureView.d.ts.map +1 -1
  16. package/dist/SignatureCaptureView.js +138 -22
  17. package/dist/VideoIdCaptureView.d.ts +15 -3
  18. package/dist/VideoIdCaptureView.d.ts.map +1 -1
  19. package/dist/VideoIdCaptureView.js +35 -8
  20. package/dist/bindings/useDocumentCapture.d.ts.map +1 -1
  21. package/dist/bindings/useDocumentCapture.js +2 -1
  22. package/dist/bindings/useIdCapture.d.ts.map +1 -1
  23. package/dist/bindings/useIdCapture.js +2 -1
  24. package/dist/bindings/useSelfieCapture.d.ts.map +1 -1
  25. package/dist/bindings/useSelfieCapture.js +2 -1
  26. package/dist/bindings/useSignatureCapture.d.ts.map +1 -1
  27. package/dist/bindings/useSignatureCapture.js +2 -1
  28. package/dist/bindings/useVideoIdCapture.d.ts.map +1 -1
  29. package/dist/bindings/useVideoIdCapture.js +2 -1
  30. package/dist/components/CameraFeed.d.ts +11 -3
  31. package/dist/components/CameraFeed.d.ts.map +1 -1
  32. package/dist/components/CameraFeed.js +24 -4
  33. package/dist/components/barcode/BarcodeGuideOverlay.d.ts +7 -1
  34. package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -1
  35. package/dist/components/barcode/BarcodeGuideOverlay.js +2 -2
  36. package/dist/components/common/BrowserEdgeTint.d.ts +63 -0
  37. package/dist/components/common/BrowserEdgeTint.d.ts.map +1 -0
  38. package/dist/components/common/BrowserEdgeTint.js +111 -0
  39. package/dist/components/common/LoaderButton.d.ts +9 -0
  40. package/dist/components/common/LoaderButton.d.ts.map +1 -1
  41. package/dist/components/common/LoaderButton.js +44 -321
  42. package/dist/components/common/ScreenReaderStatus.d.ts +8 -0
  43. package/dist/components/common/ScreenReaderStatus.d.ts.map +1 -0
  44. package/dist/components/common/ScreenReaderStatus.js +18 -0
  45. package/dist/components/common/overlay.d.ts +6 -0
  46. package/dist/components/common/overlay.d.ts.map +1 -1
  47. package/dist/components/common/overlay.js +7 -1
  48. package/dist/components/debug/debug.d.ts +10 -4
  49. package/dist/components/debug/debug.d.ts.map +1 -1
  50. package/dist/components/debug/debug.js +5 -1
  51. package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts +29 -0
  52. package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts.map +1 -0
  53. package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.js +273 -0
  54. package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts +56 -0
  55. package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts.map +1 -0
  56. package/dist/components/document/DocumentCaptureAutoCaptureGuidance.js +128 -0
  57. package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +31 -1
  58. package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -1
  59. package/dist/components/document/DocumentCaptureGuideOverlay.js +121 -2
  60. package/dist/components/document/DocumentCaptureReviewScreen.d.ts +44 -0
  61. package/dist/components/document/DocumentCaptureReviewScreen.d.ts.map +1 -0
  62. package/dist/components/document/DocumentCaptureReviewScreen.js +40 -0
  63. package/dist/components/document/types.d.ts +25 -0
  64. package/dist/components/document/types.d.ts.map +1 -1
  65. package/dist/components/document/types.js +18 -1
  66. package/dist/components/error/CameraAccessDeniedOverlay.d.ts +8 -1
  67. package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -1
  68. package/dist/components/error/useCameraAccessDeniedReport.d.ts +12 -0
  69. package/dist/components/error/useCameraAccessDeniedReport.d.ts.map +1 -0
  70. package/dist/components/error/useCameraAccessDeniedReport.js +31 -0
  71. package/dist/components/face_liveness/FaceLivenessFailure.d.ts +4 -1
  72. package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -1
  73. package/dist/components/face_liveness/FaceLivenessFailure.js +4 -2
  74. package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +4 -1
  75. package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -1
  76. package/dist/components/face_liveness/FaceLivenessSuccess.js +6 -2
  77. package/dist/components/guides/IdCaptureFitGuide.d.ts +2 -0
  78. package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -1
  79. package/dist/components/guides/IdCaptureFitGuide.js +4 -1
  80. package/dist/components/guides/IdCaptureGuideOverlay.d.ts +2 -0
  81. package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -1
  82. package/dist/components/guides/IdCaptureGuideOverlay.js +3 -1
  83. package/dist/components/guides/IdCaptureGuides.d.ts +14 -0
  84. package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
  85. package/dist/components/guides/IdCaptureGuides.js +23 -9
  86. package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -1
  87. package/dist/components/guides/IdCaptureGuidesCommon.js +12 -7
  88. package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +9 -0
  89. package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -1
  90. package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +26 -4
  91. package/dist/components/loading/RingIntroScreen.d.ts.map +1 -1
  92. package/dist/components/loading/RingIntroScreen.js +4 -34
  93. package/dist/components/review/ReviewScreen.d.ts +10 -1
  94. package/dist/components/review/ReviewScreen.d.ts.map +1 -1
  95. package/dist/components/review/ReviewScreen.js +8 -8
  96. package/dist/components/review/SignatureCaptureDiagnostics.d.ts +54 -0
  97. package/dist/components/review/SignatureCaptureDiagnostics.d.ts.map +1 -0
  98. package/dist/components/review/SignatureCaptureDiagnostics.js +144 -0
  99. package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +9 -2
  100. package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -1
  101. package/dist/components/selfie/FaceCaptureGuideOverlay.js +10 -4
  102. package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +8 -1
  103. package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -1
  104. package/dist/components/selfie/SelfieCaptureAnimatedMask.js +55 -21
  105. package/dist/components/selfie/SelfieCaptureSurface.d.ts +19 -3
  106. package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -1
  107. package/dist/components/selfie/SelfieCaptureSurface.js +78 -14
  108. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +9 -0
  109. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -1
  110. package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +26 -4
  111. package/dist/components/videoId/VideoIdCaptureGuides.d.ts +4 -1
  112. package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -1
  113. package/dist/components/videoId/VideoIdCaptureGuides.js +2 -2
  114. package/dist/flows/AuthStateContext.d.ts.map +1 -1
  115. package/dist/flows/AuthStateContext.js +2 -1
  116. package/dist/flows/CaptureProgress.d.ts +14 -0
  117. package/dist/flows/CaptureProgress.d.ts.map +1 -0
  118. package/dist/flows/CaptureProgress.js +51 -0
  119. package/dist/flows/CompositeWizard.d.ts +5 -0
  120. package/dist/flows/CompositeWizard.d.ts.map +1 -1
  121. package/dist/flows/CompositeWizard.js +6 -1
  122. package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +1 -1
  123. package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -1
  124. package/dist/flows/CustomerBiometricsEnrollmentFlow.js +6 -3
  125. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +1 -1
  126. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -1
  127. package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +5 -2
  128. package/dist/flows/DocumentCaptureFlow.d.ts +2 -2
  129. package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
  130. package/dist/flows/DocumentCaptureFlow.js +6 -6
  131. package/dist/flows/FaceValidationFlow.d.ts +2 -2
  132. package/dist/flows/FaceValidationFlow.d.ts.map +1 -1
  133. package/dist/flows/FaceValidationFlow.js +2 -2
  134. package/dist/flows/FlowChassis.d.ts +3 -1
  135. package/dist/flows/FlowChassis.d.ts.map +1 -1
  136. package/dist/flows/FlowChassis.js +23 -4
  137. package/dist/flows/IdAndFaceValidationFlow.d.ts +1 -1
  138. package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -1
  139. package/dist/flows/IdAndFaceValidationFlow.js +5 -2
  140. package/dist/flows/IdValidationFlow.d.ts +1 -1
  141. package/dist/flows/IdValidationFlow.d.ts.map +1 -1
  142. package/dist/flows/IdValidationFlow.js +18 -4
  143. package/dist/flows/SignatureKYCFlow.d.ts +18 -3
  144. package/dist/flows/SignatureKYCFlow.d.ts.map +1 -1
  145. package/dist/flows/SignatureKYCFlow.js +94 -11
  146. package/dist/flows/SubmissionProvider.d.ts.map +1 -1
  147. package/dist/flows/SubmissionProvider.js +10 -5
  148. package/dist/flows/VideoIdValidationFlow.d.ts +1 -1
  149. package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -1
  150. package/dist/flows/VideoIdValidationFlow.js +6 -3
  151. package/dist/flows/additionalDocuments.d.ts.map +1 -1
  152. package/dist/flows/additionalDocuments.js +3 -6
  153. package/dist/flows/approval.d.ts +2 -0
  154. package/dist/flows/approval.d.ts.map +1 -0
  155. package/dist/flows/approval.js +1 -0
  156. package/dist/flows/artifacts.d.ts +1 -1
  157. package/dist/flows/artifacts.d.ts.map +1 -1
  158. package/dist/flows/artifacts.js +29 -9
  159. package/dist/flows/autoCaptureMountGuard.d.ts +22 -0
  160. package/dist/flows/autoCaptureMountGuard.d.ts.map +1 -0
  161. package/dist/flows/autoCaptureMountGuard.js +61 -0
  162. package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +1 -1
  163. package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -1
  164. package/dist/flows/customerMatch/CustomerMatchFlow.js +5 -6
  165. package/dist/flows/ringScreens.d.ts +1 -3
  166. package/dist/flows/ringScreens.d.ts.map +1 -1
  167. package/dist/flows/ringScreens.js +19 -5
  168. package/dist/flows/types.d.ts +17 -3
  169. package/dist/flows/types.d.ts.map +1 -1
  170. package/dist/guidance/selfieStrings.d.ts +9 -1
  171. package/dist/guidance/selfieStrings.d.ts.map +1 -1
  172. package/dist/guidance/selfieStrings.js +67 -24
  173. package/dist/guidance/strings.d.ts +34 -1
  174. package/dist/guidance/strings.d.ts.map +1 -1
  175. package/dist/guidance/strings.js +39 -0
  176. package/dist/i18n/index.d.ts +28 -1177
  177. package/dist/i18n/index.d.ts.map +1 -1
  178. package/dist/i18n/index.js +58 -22
  179. package/dist/i18n/locales/threeOh.d.ts +4 -0
  180. package/dist/i18n/locales/threeOh.d.ts.map +1 -0
  181. package/dist/i18n/locales/threeOh.js +159 -0
  182. package/dist/index.d.ts +12 -6
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +4 -0
  185. package/dist/testing/autoCaptureFrames.d.ts +23 -0
  186. package/dist/testing/autoCaptureFrames.d.ts.map +1 -0
  187. package/dist/testing/autoCaptureFrames.js +193 -0
  188. package/dist/testing/buildSelfieState.d.ts.map +1 -1
  189. package/dist/testing/buildSelfieState.js +5 -0
  190. package/dist/testing/classNamesLeaves.js +1 -1
  191. package/dist/testing/fakeDocumentController.d.ts +7 -1
  192. package/dist/testing/fakeDocumentController.d.ts.map +1 -1
  193. package/dist/testing/fakeDocumentController.js +10 -2
  194. package/dist/testing/fakeSelfieController.d.ts.map +1 -1
  195. package/dist/testing/fakeSelfieController.js +7 -0
  196. package/dist/testing/index.d.ts +1 -0
  197. package/dist/testing/index.d.ts.map +1 -1
  198. package/dist/testing/index.js +1 -0
  199. package/dist/theme/index.d.ts +10 -0
  200. package/dist/theme/index.d.ts.map +1 -1
  201. package/dist/useDocumentUpload.d.ts +63 -0
  202. package/dist/useDocumentUpload.d.ts.map +1 -0
  203. package/dist/useDocumentUpload.js +45 -0
  204. package/dist/useIdmissionClient.d.ts +29 -0
  205. package/dist/useIdmissionClient.d.ts.map +1 -0
  206. package/dist/useIdmissionClient.js +44 -0
  207. package/dist/utils/canvas.d.ts.map +1 -1
  208. package/dist/utils/canvas.js +41 -0
  209. package/dist/version.d.ts +1 -1
  210. package/dist/version.d.ts.map +1 -1
  211. package/dist/version.js +1 -1
  212. package/package.json +9 -7
@@ -35,7 +35,7 @@ import { computeGuideRect } from './guideRect';
35
35
  * deliberately a little larger than the hole rather than pixel-matched to it.
36
36
  */
37
37
  const FEED_BLEED_PX = 2;
38
- export function DocumentCaptureGuideOverlay({ aspectRatio, borderRadius = 25, borderColor, borderWidth, maskColor, padding, classNames = {}, }) {
38
+ export function DocumentCaptureGuideOverlay({ aspectRatio, borderRadius = 25, borderColor, borderWidth, cornerBrackets = false, cornerLength, maskColor, padding, classNames = {}, }) {
39
39
  const { ref: wrapperRef, width: wrapperWidth = 0, height: wrapperHeight = 0, } = useResizeObserver();
40
40
  const canvasRef = useRef(null);
41
41
  const { setGuideRect } = useGuideLayout();
@@ -115,17 +115,33 @@ export function DocumentCaptureGuideOverlay({ aspectRatio, borderRadius = 25, bo
115
115
  ctx.roundRect(rect.x, rect.y, rect.width, rect.height, borderRadius);
116
116
  ctx.lineWidth = resolvedBorderWidth;
117
117
  ctx.strokeStyle = borderColor ?? 'white';
118
- ctx.stroke();
118
+ // Brackets replace the continuous border rather than joining it — stroking
119
+ // both leaves a full rectangle with four thicker corners.
120
+ if (!cornerBrackets)
121
+ ctx.stroke();
119
122
  // Punch the guide box out of the mask. The fill colour is irrelevant under
120
123
  // 'destination-out'; only its alpha matters.
121
124
  ctx.fillStyle = 'rgba(0,0,0,1)';
122
125
  ctx.globalCompositeOperation = 'destination-out';
123
126
  ctx.fill();
124
127
  ctx.globalCompositeOperation = 'source-over';
128
+ // AFTER the punch: 'destination-out' would erase the brackets along with
129
+ // the hole, and they are meant to sit on top of the live feed.
130
+ if (cornerBrackets) {
131
+ drawCornerBrackets(ctx, rect, {
132
+ radius: borderRadius,
133
+ length: cornerLength ??
134
+ cornerArmLength(rect.width, rect.height, borderRadius),
135
+ lineWidth: resolvedBorderWidth,
136
+ color: borderColor ?? 'white',
137
+ });
138
+ }
125
139
  }, [
126
140
  aspectRatio,
127
141
  borderColor,
128
142
  borderRadius,
143
+ cornerBrackets,
144
+ cornerLength,
129
145
  maskColor,
130
146
  resolvedBorderWidth,
131
147
  resolvedPadding,
@@ -138,8 +154,111 @@ export function DocumentCaptureGuideOverlay({ aspectRatio, borderRadius = 25, bo
138
154
  useEffect(() => () => setGuideRect(null), [setGuideRect]);
139
155
  return (_jsx(CanvasWrapper, { ref: wrapperRef, className: classNames.container, "$maskColor": maskColor, children: _jsx(Canvas, { ref: canvasRef }) }));
140
156
  }
157
+ /**
158
+ * Four L-shaped brackets tracing the guide box's corners.
159
+ *
160
+ * `arcTo` reuses the same corner radius as the punched hole, so a bracket sits
161
+ * exactly on the edge of the cut-out instead of near it. Arms are clamped so
162
+ * they can never meet in the middle of a short side and quietly become a
163
+ * continuous border.
164
+ */
165
+ /**
166
+ * TOTAL corner run — arc included — as a fraction of the guide box's short
167
+ * side.
168
+ *
169
+ * "Total" is the correction that matters. The accepted design drew each
170
+ * bracket as a 26px box on a 192px-wide guide (~13%) with the corner radius
171
+ * INSIDE that 26px. Adding the arm on top of the radius instead made the
172
+ * visible run `radius + arm` — 64px where the design had 26 — which reads as a
173
+ * heavy rounded rectangle with four gaps rather than as four corner marks.
174
+ */
175
+ const CORNER_ARM_RATIO = 0.12;
176
+ const CORNER_ARM_MIN = 20;
177
+ const CORNER_ARM_MAX = 96;
178
+ /**
179
+ * Shortest straight arm worth drawing.
180
+ *
181
+ * Applied BEFORE the quarter-side ceiling, so a box small enough for the floor
182
+ * and the ceiling to disagree still cannot grow arms that meet in the middle.
183
+ */
184
+ const CORNER_ARM_FLOOR = 8;
185
+ /**
186
+ * Bracket arm length for a guide box of this size.
187
+ *
188
+ * Exported because it is the rule that already regressed once: a fixed 34px
189
+ * arm read as a frame on a phone-sized guide and as a stray mark on a
190
+ * desktop-sized one, and nothing in a diff would have shown that.
191
+ */
192
+ export function cornerArmLength(width, height, radius = 0) {
193
+ const short = Math.min(width, height);
194
+ if (short <= 0)
195
+ return 0;
196
+ const total = Math.max(CORNER_ARM_MIN, Math.min(CORNER_ARM_MAX, short * CORNER_ARM_RATIO));
197
+ // The straight arm is what is LEFT of the run once the corner arc has taken
198
+ // its share, so the total mark stays the size the design specified whatever
199
+ // the radius is.
200
+ //
201
+ // Floored, because on a small box the radius can eat the whole run: at the
202
+ // default radius of 25 anything with a short side under ~208px yields a
203
+ // NEGATIVE remainder, and each bracket collapses to a bare quarter-arc with
204
+ // no arms — the outline silently stops reading as four corners. Below that
205
+ // size the design's total mark is unachievable anyway, so a visible bracket
206
+ // beats an exactly-sized invisible one.
207
+ const arm = Math.max(CORNER_ARM_FLOOR, total - radius);
208
+ // The quarter-side ceiling lives HERE, not only at the draw call, so this
209
+ // function is the whole truth about arm length. On a very small box the
210
+ // floor alone would let two opposing arms meet and silently turn four
211
+ // brackets back into the continuous border they replaced.
212
+ return Math.min(arm, short / 4);
213
+ }
214
+ function drawCornerBrackets(ctx, rect, opts) {
215
+ const radius = Math.min(opts.radius, rect.width / 2, rect.height / 2);
216
+ const maxArm = Math.min(rect.width, rect.height) / 4;
217
+ const arm = Math.max(0, Math.min(opts.length, maxArm));
218
+ if (arm <= 0)
219
+ return;
220
+ const { x, y, width, height } = rect;
221
+ const right = x + width;
222
+ const bottom = y + height;
223
+ ctx.save();
224
+ ctx.strokeStyle = opts.color;
225
+ ctx.lineWidth = opts.lineWidth;
226
+ ctx.lineCap = 'round';
227
+ ctx.lineJoin = 'round';
228
+ const corners = [
229
+ // [startX, startY, cornerX, cornerY, endX, endY]
230
+ [x, y + radius + arm, x, y, x + radius + arm, y],
231
+ [right - radius - arm, y, right, y, right, y + radius + arm],
232
+ [right, bottom - radius - arm, right, bottom, right - radius - arm, bottom],
233
+ [x + radius + arm, bottom, x, bottom, x, bottom - radius - arm],
234
+ ];
235
+ for (const [sx, sy, cx, cy, ex, ey] of corners) {
236
+ ctx.beginPath();
237
+ ctx.moveTo(sx, sy);
238
+ ctx.arcTo(cx, cy, ex, ey, radius);
239
+ ctx.lineTo(ex, ey);
240
+ ctx.stroke();
241
+ }
242
+ ctx.restore();
243
+ }
141
244
  const CanvasWrapper = styled.div `
142
245
  flex-grow: 1;
246
+ /* REQUIRED, not tidying. setCanvasDimensions puts an explicit pixel height on
247
+ the child canvas, and a flex item's default min-height of auto floors it at
248
+ its content — so this wrapper can grow but can never shrink back.
249
+
250
+ It bit on exactly one transition: while auto-capture is guiding, the header
251
+ is absolutely positioned and out of flow, so the wrapper is measured at the
252
+ FULL surface height and the canvas is pinned there. Accepting the manual
253
+ fallback swaps in the in-flow heading bar, the column then needs this item
254
+ to give back that height, an auto min-height refuses, and the surface
255
+ overflows by the header's height — carrying the footer, and the Capture
256
+ button the applicant just asked for, below the fold with nothing to
257
+ scroll.
258
+
259
+ No backticks in this comment: it lives inside a styled-components template
260
+ literal, where one would end the template. */
261
+ min-height: 0;
143
262
  background-clip: padding-box;
144
263
  box-shadow: inset 0 0 0 2px ${(props) => props.$maskColor};
145
264
  `;
@@ -0,0 +1,44 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { DocumentUploadState } from '@idmission/websdk-core/documentCapture';
3
+ export type DocumentCaptureReviewScreenClassNames = {
4
+ /** Class name for the full-screen review container. */
5
+ reviewContainer?: string;
6
+ /** Class name for the review card. */
7
+ reviewCard?: string;
8
+ /** Class name for the review heading. */
9
+ reviewHeading?: string;
10
+ /** 2.x: the captured-page image. */
11
+ previewImage?: string;
12
+ /** 2.x: the button row. */
13
+ buttonsRow?: string;
14
+ /** 2.x: the discard-and-recapture button. */
15
+ retryCaptureBtn?: string;
16
+ /** 2.x: the upload button before an upload starts. */
17
+ uploadBtn?: string;
18
+ /** 2.x: the upload button once one has started. */
19
+ uploadProgressBtn?: string;
20
+ };
21
+ export type DocumentCaptureReviewScreenProps = {
22
+ /** Object URL of the accepted frame. */
23
+ contentUrl: string;
24
+ headingText: string | ReactElement | undefined;
25
+ retryText: string | ReactElement | undefined;
26
+ uploadText: string | ReactElement | undefined;
27
+ uploadingText: string | ReactElement | undefined;
28
+ retryUploadText: string | ReactElement | undefined;
29
+ successText: string | ReactElement | undefined;
30
+ uploadState: DocumentUploadState;
31
+ onRetry: () => void;
32
+ onUpload: () => void;
33
+ classNames?: DocumentCaptureReviewScreenClassNames;
34
+ /**
35
+ * Accessible name for the captured page.
36
+ *
37
+ * Required, and deliberately has no default: a default here would be an
38
+ * English literal shipped to every locale, and this component has no access
39
+ * to the verbiage bag to translate one.
40
+ */
41
+ alt: string;
42
+ };
43
+ export declare function DocumentCaptureReviewScreen({ contentUrl, headingText, retryText, uploadText, uploadingText, retryUploadText, successText, uploadState, onRetry, onUpload, classNames, alt, }: DocumentCaptureReviewScreenProps): ReactElement;
44
+ //# sourceMappingURL=DocumentCaptureReviewScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentCaptureReviewScreen.d.ts","sourceRoot":"","sources":["../../../src/components/document/DocumentCaptureReviewScreen.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAA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Ae,EACf,WAAW,EACX,WAAW,EACX,OAAO,EACP,QAAQ,EACR,UAAe,EACf,GAAG,GACJ,EAAE,gCAAgC,GAAG,YAAY,CA8DjD"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { styled } from 'styled-components';
3
+ import { ButtonsColumn, GrayOverlayContainer, OverlayInner, WideBorderButton, WideButton, } from '../common/overlay';
4
+ import { FlexCard } from '../common/Card';
5
+ export function DocumentCaptureReviewScreen({ contentUrl, headingText, retryText, uploadText, uploadingText, retryUploadText, successText, uploadState, onRetry, onUpload, classNames = {}, alt, }) {
6
+ const started = uploadState !== 'not_started';
7
+ const uploading = uploadState === 'in_progress';
8
+ const succeeded = uploadState === 'succeeded';
9
+ return (_jsx(GrayOverlayContainer, { className: classNames.reviewContainer, "data-testid": "document-capture-review", children: _jsx(OverlayInner, { children: _jsxs(FlexCard, { className: classNames.reviewCard, children: [_jsx(ReviewHeading, { className: classNames.reviewHeading, children: headingText }), _jsx(ImageWrap, { children: _jsx(PreviewImage, { className: classNames.previewImage, src: contentUrl, alt: alt }) }), _jsxs(ButtonsColumn, { className: classNames.buttonsRow, children: [_jsx(WideButton, { className: started ? classNames.uploadProgressBtn : classNames.uploadBtn, variant: uploadState === 'failed' ? 'negative' : 'positive', onClick: onUpload, disabled: uploading || succeeded, finished: !uploading, children: succeeded
10
+ ? successText
11
+ : uploadState === 'failed'
12
+ ? retryUploadText
13
+ : uploading
14
+ ? uploadingText
15
+ : uploadText }), !succeeded && (_jsx(WideBorderButton, { className: classNames.retryCaptureBtn, variant: "warning", onClick: onRetry, disabled: uploading, finished: true, children: retryText }))] })] }) }) }));
16
+ }
17
+ const ReviewHeading = styled.h2 `
18
+ margin: 0 0 16px;
19
+ font-size: 18px;
20
+ font-weight: 650;
21
+ text-align: center;
22
+ `;
23
+ // `min-height: 0` is what actually lets this shrink inside the flex card —
24
+ // without it the default `min-height: auto` floors the wrapper at the image's
25
+ // intrinsic height and the buttons get pushed off the bottom of a phone.
26
+ const ImageWrap = styled.div `
27
+ flex: 1;
28
+ min-height: 0;
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ margin-bottom: 18px;
33
+ `;
34
+ const PreviewImage = styled.img `
35
+ max-width: 100%;
36
+ max-height: 100%;
37
+ object-fit: contain;
38
+ border-radius: 4px;
39
+ border: 1px solid #e2e2e8;
40
+ `;
@@ -13,4 +13,29 @@ export type DocumentCapturePrompt = DocumentCaptureInput & {
13
13
  onUploaded?: (document: CapturedDocument) => void;
14
14
  };
15
15
  export type { CapturedDocument } from '@idmission/websdk-core/documentCapture';
16
+ /**
17
+ * `DocumentCaptureInput` with every field required to be PRESENT, though still
18
+ * allowed to be `undefined`.
19
+ *
20
+ * The intersection is doing real work: `Required<T>` (and any `-?` mapped type)
21
+ * strips `undefined` from the value as well as removing the optional marker,
22
+ * which no optional field can then satisfy. `Record<keyof T, unknown>` demands
23
+ * the key and nothing about the value, and `DocumentCaptureInput` types it.
24
+ */
25
+ type EveryCoreInputField = DocumentCaptureInput & Record<keyof DocumentCaptureInput, unknown>;
26
+ /**
27
+ * Strip the React half off a caller's document, keeping every core field.
28
+ *
29
+ * The allowlist destructure this replaces —
30
+ * `({ title, aspectRatio, processAsPOA, content }) => ({ ... })` — silently
31
+ * dropped anything added to `DocumentCaptureInput` afterwards: the result stayed
32
+ * assignable, so nothing anywhere errored, and a per-document field could reach
33
+ * the flow and never reach the engine (#340). `autoCapture` was the field that
34
+ * would have hit it first.
35
+ *
36
+ * The `EveryCoreInputField` return annotation is the fix: omit a field and this
37
+ * function stops compiling; add one core does not declare and the object
38
+ * literal trips excess-property checking.
39
+ */
40
+ export declare function toDocumentCaptureInput(document: DocumentCapturePrompt): EveryCoreInputField;
16
41
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/document/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,qBAAqB,GAC9B,mBAAmB,CAGrB"}
@@ -1 +1,18 @@
1
- export {};
1
+ /**
2
+ * Strip the React half off a caller's document, keeping every core field.
3
+ *
4
+ * The allowlist destructure this replaces —
5
+ * `({ title, aspectRatio, processAsPOA, content }) => ({ ... })` — silently
6
+ * dropped anything added to `DocumentCaptureInput` afterwards: the result stayed
7
+ * assignable, so nothing anywhere errored, and a per-document field could reach
8
+ * the flow and never reach the engine (#340). `autoCapture` was the field that
9
+ * would have hit it first.
10
+ *
11
+ * The `EveryCoreInputField` return annotation is the fix: omit a field and this
12
+ * function stops compiling; add one core does not declare and the object
13
+ * literal trips excess-property checking.
14
+ */
15
+ export function toDocumentCaptureInput(document) {
16
+ const { title, aspectRatio, processAsPOA, autoCapture, content } = document;
17
+ return { title, aspectRatio, processAsPOA, autoCapture, content };
18
+ }
@@ -1,5 +1,12 @@
1
1
  import { type LoaderButtonColors } from '../common/LoaderButton';
2
2
  import { type CustomerSuppliedVerbiage } from '../../i18n';
3
+ /**
4
+ * Why the camera could not be used: `permissionDenied` when the user or the
5
+ * browser refused the permission, `unavailable` when it could not be started
6
+ * (in use by another app, blocked by the OS, or no usable camera). Passed to
7
+ * `onCameraAccessDenied` so a host can word its own screen to match.
8
+ */
9
+ export type CameraAccessDeniedReason = 'permissionDenied' | 'unavailable';
3
10
  export type CameraAccessDeniedOverlayAssets = {
4
11
  imageUrl?: string;
5
12
  };
@@ -36,7 +43,7 @@ export type CameraAccessDeniedOverlayProps = {
36
43
  * already-resolved value would silently drop component-typed verbiage,
37
44
  * since `evaluateVerbiage` reads a ReactElement as a locale map.
38
45
  */
39
- variant?: 'permissionDenied' | 'unavailable';
46
+ variant?: CameraAccessDeniedReason;
40
47
  };
41
48
  export declare const CameraAccessDeniedOverlay: ({ onRetry, assets, classNames, colors, verbiage: rawVerbiage, variant, }: CameraAccessDeniedOverlayProps) => import("react/jsx-runtime").JSX.Element;
42
49
  //# sourceMappingURL=CameraAccessDeniedOverlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CameraAccessDeniedOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/error/CameraAccessDeniedOverlay.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,KAAK,wBAAwB,EAAmB,MAAM,YAAY,CAAA;AAE3E,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,mCAAmC,GAAG;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC9C,WAAW,CAAC,EAAE,wBAAwB,CAAA;IACtC,eAAe,CAAC,EAAE,wBAAwB,CAAA;IAC1C,YAAY,CAAC,EAAE,wBAAwB,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,+BAA+B,CAAA;IACxC,UAAU,CAAC,EAAE,mCAAmC,CAAA;IAChD,MAAM,CAAC,EAAE,+BAA+B,CAAA;IACxC,QAAQ,CAAC,EAAE,iCAAiC,CAAA;IAC5C;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,kBAAkB,GAAG,aAAa,CAAA;CAC7C,CAAA;AAED,eAAO,M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AAO,CAAC,EAAE,wBAAwB,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,0EAOvC,8BAA8B,4CAkDhC,CAAA"}
@@ -0,0 +1,12 @@
1
+ import type { CameraAccessDeniedReason } from './CameraAccessDeniedOverlay';
2
+ /**
3
+ * Calls `onCameraAccessDenied` once per camera failure a controller reports:
4
+ * when its error code becomes one, changes to the other, or a different
5
+ * controller reports one. Not per render, and not again when StrictMode
6
+ * replays effects, since the latch only moves when what it saw changes. A
7
+ * failure seen with no handler bound is not latched, so a handler bound later
8
+ * still hears about it; one already reported stays latched while the handler
9
+ * is briefly unbound.
10
+ */
11
+ export declare function useCameraAccessDeniedReport(controller: object, errorCode: string | undefined, onCameraAccessDenied: ((reason: CameraAccessDeniedReason) => void) | undefined): void;
12
+ //# sourceMappingURL=useCameraAccessDeniedReport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCameraAccessDeniedReport.d.ts","sourceRoot":"","sources":["../../../src/components/error/useCameraAccessDeniedReport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAQ3E;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC,GAAG,SAAS,GAC7E,IAAI,CAYN"}
@@ -0,0 +1,31 @@
1
+ import { useEffect, useRef } from 'react';
2
+ function reasonFor(code) {
3
+ if (code === 'CAMERA_PERMISSION_DENIED')
4
+ return 'permissionDenied';
5
+ if (code === 'CAMERA_UNAVAILABLE')
6
+ return 'unavailable';
7
+ return undefined;
8
+ }
9
+ /**
10
+ * Calls `onCameraAccessDenied` once per camera failure a controller reports:
11
+ * when its error code becomes one, changes to the other, or a different
12
+ * controller reports one. Not per render, and not again when StrictMode
13
+ * replays effects, since the latch only moves when what it saw changes. A
14
+ * failure seen with no handler bound is not latched, so a handler bound later
15
+ * still hears about it; one already reported stays latched while the handler
16
+ * is briefly unbound.
17
+ */
18
+ export function useCameraAccessDeniedReport(controller, errorCode, onCameraAccessDenied) {
19
+ const reason = reasonFor(errorCode);
20
+ const reportedRef = useRef(undefined);
21
+ useEffect(() => {
22
+ const reported = reportedRef.current;
23
+ const alreadyReported = reported?.controller === controller && reported.reason === reason;
24
+ reportedRef.current = {
25
+ controller,
26
+ reason: onCameraAccessDenied || alreadyReported ? reason : undefined,
27
+ };
28
+ if (reason && onCameraAccessDenied && !alreadyReported)
29
+ onCameraAccessDenied(reason);
30
+ }, [controller, reason, onCameraAccessDenied]);
31
+ }
@@ -20,16 +20,19 @@ export type FaceLivenessFailureColors = {
20
20
  export type FaceLivenessFailureVerbiage = {
21
21
  headingText?: CustomerSuppliedVerbiage;
22
22
  retryBtnText?: CustomerSuppliedVerbiage;
23
+ retryingBtnText?: CustomerSuppliedVerbiage;
23
24
  exitBtnText?: CustomerSuppliedVerbiage;
24
25
  };
25
26
  export type FaceLivenessFailureProps = {
26
27
  canRetry?: boolean;
27
28
  onRetryClick?: () => void;
29
+ /** Shows Retry loading, and saying so, while the camera comes back. */
30
+ retrying?: boolean;
28
31
  onExitClick?: () => void;
29
32
  assets?: FaceLivenessFailureAssets;
30
33
  classNames?: FaceLivenessFailureClassNames;
31
34
  colors?: FaceLivenessFailureColors;
32
35
  verbiage?: FaceLivenessFailureVerbiage;
33
36
  };
34
- export declare const FaceLivenessFailure: ({ canRetry, onRetryClick, onExitClick, assets, classNames, colors, verbiage: rawVerbiage, }: FaceLivenessFailureProps) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const FaceLivenessFailure: ({ canRetry, onRetryClick, retrying, onExitClick, assets, classNames, colors, verbiage: rawVerbiage, }: FaceLivenessFailureProps) => import("react/jsx-runtime").JSX.Element;
35
38
  //# sourceMappingURL=FaceLivenessFailure.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FaceLivenessFailure.d.ts","sourceRoot":"","sources":["../../../src/components/face_liveness/FaceLivenessFailure.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,KAAK,wBAAwB,EAAmB,MAAM,YAAY,CAAA;AAE3E,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,CAAC,EAAE,wBAAwB,CAAA;IACtC,YAAY,CAAC,EAAE,wBAAwB,CAAA;IACvC,WAAW,CAAC,EAAE,wBAAwB,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,UAAU,CAAC,EAAE,6BAA6B,CAAA;IAC1C,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,QAAQ,CAAC,EAAE,2BAA2B,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,6FAQjC,wBAAwB,4CA8C1B,CAAA"}
1
+ {"version":3,"file":"FaceLivenessFailure.d.ts","sourceRoot":"","sources":["../../../src/components/face_liveness/FaceLivenessFailure.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,EAAE,KAAK,wBAAwB,EAAmB,MAAM,YAAY,CAAA;AAE3E,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,CAAC,EAAE,wBAAwB,CAAA;IACtC,YAAY,CAAC,EAAE,wBAAwB,CAAA;IACvC,eAAe,CAAC,EAAE,wBAAwB,CAAA;IAC1C,WAAW,CAAC,EAAE,wBAAwB,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,UAAU,CAAC,EAAE,6BAA6B,CAAA;IAC1C,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,QAAQ,CAAC,EAAE,2BAA2B,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,uGASjC,wBAAwB,4CAoD1B,CAAA"}
@@ -12,15 +12,17 @@ import { styled } from 'styled-components';
12
12
  import { ButtonsColumn, GrayOverlayContainer, OverlayImageContainer, OverlayInner, WideBorderButton, WideButton, } from '../common/overlay';
13
13
  import { DEFAULT_CDN_URL } from '../../utils/cdn';
14
14
  import { Card } from '../common/Card';
15
+ import { ScreenReaderStatus } from '../common/ScreenReaderStatus';
15
16
  import { useTranslations } from '../../i18n';
16
- export const FaceLivenessFailure = ({ canRetry = true, onRetryClick, onExitClick, assets = {}, classNames = {}, colors = {}, verbiage: rawVerbiage = {}, }) => {
17
+ export const FaceLivenessFailure = ({ canRetry = true, onRetryClick, retrying = false, onExitClick, assets = {}, classNames = {}, colors = {}, verbiage: rawVerbiage = {}, }) => {
17
18
  const imageUrl = assets.imageUrl ?? `${DEFAULT_CDN_URL}/Face_Not_Detected.svg`;
18
19
  const verbiage = useTranslations(rawVerbiage, {
19
20
  headingText: 'Live face not detected, please try again',
20
21
  retryBtnText: 'Retry',
22
+ retryingBtnText: 'Starting camera...',
21
23
  exitBtnText: 'Exit',
22
24
  });
23
- return (_jsx(GrayOverlayContainer, { className: classNames.container, children: _jsx(OverlayInner, { className: classNames.inner, children: _jsxs(Card, { children: [_jsx(ImageContainer, { className: classNames.imageContainer, children: _jsx("img", { alt: verbiage.headingText, src: imageUrl, className: classNames.image }) }), _jsx(Heading, { className: classNames.heading, children: verbiage.headingText }), _jsxs(ButtonsColumn, { className: classNames.buttonsRow, children: [canRetry && (_jsx(WideButton, { variant: "secondary", className: classNames.retryBtn, onClick: onRetryClick, colors: colors.retryBtn, finished: true, children: verbiage.retryBtnText })), _jsx(WideBorderButton, { variant: "secondary", className: classNames.exitBtn, onClick: onExitClick, colors: colors.exitBtn, finished: true, children: verbiage.exitBtnText })] })] }) }) }));
25
+ return (_jsx(GrayOverlayContainer, { className: classNames.container, children: _jsx(OverlayInner, { className: classNames.inner, children: _jsxs(Card, { children: [_jsx(ImageContainer, { className: classNames.imageContainer, children: _jsx("img", { alt: verbiage.headingText, src: imageUrl, className: classNames.image }) }), _jsx(Heading, { className: classNames.heading, children: verbiage.headingText }), _jsxs(ButtonsColumn, { className: classNames.buttonsRow, children: [_jsx(ScreenReaderStatus, { children: retrying ? verbiage.retryingBtnText : null }), canRetry && (_jsx(WideButton, { variant: "secondary", className: classNames.retryBtn, onClick: onRetryClick, colors: colors.retryBtn, finished: !retrying, children: retrying ? verbiage.retryingBtnText : verbiage.retryBtnText })), _jsx(WideBorderButton, { variant: "secondary", className: classNames.exitBtn, onClick: onExitClick, colors: colors.exitBtn, finished: true, children: verbiage.exitBtnText })] })] }) }) }));
24
26
  };
25
27
  const ImageContainer = styled(OverlayImageContainer) `
26
28
  max-height: calc(100vh - 185px);
@@ -17,15 +17,18 @@ export type FaceLivenessSuccessColors = {
17
17
  export type FaceLivenessSuccessVerbiage = {
18
18
  headingText?: CustomerSuppliedVerbiage;
19
19
  retryBtnText?: CustomerSuppliedVerbiage;
20
+ retryingBtnText?: CustomerSuppliedVerbiage;
20
21
  doneBtnText?: CustomerSuppliedVerbiage;
21
22
  };
22
23
  export type FaceLivenessSuccessProps = {
23
24
  imageUrl: string;
24
25
  onDoneClick?: () => void;
25
26
  onRetryClick?: () => void;
27
+ /** Shows Retry loading, and saying so, while the camera comes back. */
28
+ retrying?: boolean;
26
29
  classNames?: FaceLivenessSuccessClassNames;
27
30
  colors?: FaceLivenessSuccessColors;
28
31
  verbiage?: FaceLivenessSuccessVerbiage;
29
32
  };
30
- export declare const FaceLivenessSuccess: ({ imageUrl, onDoneClick, onRetryClick, classNames, colors, verbiage: rawVerbiage, }: FaceLivenessSuccessProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const FaceLivenessSuccess: ({ imageUrl, onDoneClick, onRetryClick, retrying, classNames, colors, verbiage: rawVerbiage, }: FaceLivenessSuccessProps) => import("react/jsx-runtime").JSX.Element;
31
34
  //# sourceMappingURL=FaceLivenessSuccess.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FaceLivenessSuccess.d.ts","sourceRoot":"","sources":["../../../src/components/face_liveness/FaceLivenessSuccess.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,KAAK,wBAAwB,EAAmB,MAAM,YAAY,CAAA;AAE3E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,CAAC,EAAE,wBAAwB,CAAA;IACtC,YAAY,CAAC,EAAE,wBAAwB,CAAA;IACvC,WAAW,CAAC,EAAE,wBAAwB,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,UAAU,CAAC,EAAE,6BAA6B,CAAA;IAC1C,MAAM,C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CAAC,EAAE,6BAA6B,CAAA;IAC1C,MAAM,CAAC,EAAE,yBAAyB,CAAA;IAClC,QAAQ,CAAC,EAAE,2BAA2B,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,+FAQjC,wBAAwB,4CA+D1B,CAAA"}
@@ -15,11 +15,13 @@ import { useCallback, useRef } from 'react';
15
15
  import { styled } from 'styled-components';
16
16
  import { ButtonsColumn, GrayOverlayContainer, OverlayInner, WideBorderButton, WideButton, } from '../common/overlay';
17
17
  import { FlexCard } from '../common/Card';
18
+ import { ScreenReaderStatus } from '../common/ScreenReaderStatus';
18
19
  import { useTranslations } from '../../i18n';
19
- export const FaceLivenessSuccess = ({ imageUrl, onDoneClick, onRetryClick, classNames = {}, colors = {}, verbiage: rawVerbiage = {}, }) => {
20
+ export const FaceLivenessSuccess = ({ imageUrl, onDoneClick, onRetryClick, retrying = false, classNames = {}, colors = {}, verbiage: rawVerbiage = {}, }) => {
20
21
  const verbiage = useTranslations(rawVerbiage, {
21
22
  headingText: 'Face liveness has been verified!',
22
23
  retryBtnText: 'Retry',
24
+ retryingBtnText: 'Starting camera...',
23
25
  doneBtnText: 'Done',
24
26
  });
25
27
  const imageContainerRef = useRef(null);
@@ -30,7 +32,9 @@ export const FaceLivenessSuccess = ({ imageUrl, onDoneClick, onRetryClick, class
30
32
  const imageHeight = e.currentTarget.getBoundingClientRect().height;
31
33
  imageContainerRef.current?.scroll(0, (imageHeight - containerHeight) / 2);
32
34
  }, []);
33
- return (_jsx(GrayOverlayContainer, { className: classNames.container, children: _jsx(OverlayInner, { className: classNames.inner, children: _jsxs(FlexCard, { children: [_jsx(ImageContainer, { className: classNames.imageContainer, ref: imageContainerRef, children: _jsx("img", { alt: verbiage.headingText, src: imageUrl, className: classNames.image, onLoad: onImageLoaded }) }), _jsx(Heading, { className: classNames.heading, children: verbiage.headingText }), _jsxs(ButtonsColumn, { className: classNames.buttonsRow, children: [_jsx(WideButton, { variant: "positive", onClick: onDoneClick, colors: colors.doneBtn, className: classNames.doneBtn, finished: true, children: verbiage.doneBtnText }), _jsx(WideBorderButton, { variant: "secondary", onClick: onRetryClick, colors: colors.retryBtn, className: classNames.retryBtn, finished: true, children: verbiage.retryBtnText })] })] }) }) }));
35
+ return (_jsx(GrayOverlayContainer, { className: classNames.container, children: _jsx(OverlayInner, { className: classNames.inner, children: _jsxs(FlexCard, { children: [_jsx(ImageContainer, { className: classNames.imageContainer, ref: imageContainerRef, children: _jsx("img", { alt: verbiage.headingText, src: imageUrl, className: classNames.image, onLoad: onImageLoaded }) }), _jsx(Heading, { className: classNames.heading, children: verbiage.headingText }), _jsxs(ButtonsColumn, { className: classNames.buttonsRow, children: [_jsx(ScreenReaderStatus, { children: retrying ? verbiage.retryingBtnText : null }), _jsx(WideButton, { variant: "positive", onClick: onDoneClick, colors: colors.doneBtn, className: classNames.doneBtn, finished: true,
36
+ // Done would race the retry the user already started.
37
+ disabled: retrying, children: verbiage.doneBtnText }), _jsx(WideBorderButton, { variant: "secondary", onClick: onRetryClick, colors: colors.retryBtn, className: classNames.retryBtn, finished: !retrying, children: retrying ? verbiage.retryingBtnText : verbiage.retryBtnText })] })] }) }) }));
34
38
  };
35
39
  const ImageContainer = styled.div `
36
40
  position: relative;
@@ -60,4 +60,6 @@ export type IdCaptureFitGuideProps = {
60
60
  classNames?: IdCaptureFitGuideClassNames;
61
61
  };
62
62
  export declare const IdCaptureFitGuide: ({ aspectRatio, maskColor, borderRadius, borderColor, borderWidth, padding, maxWidth, maxHeight, imageVisible, isMirrored, isBackToFront, portraitGuidesOnMobile, instruction, requestedAction, status, progress, guideBoxDisabled, guideBoxFollowsMask, cameraFeedMode, images, classNames, }: IdCaptureFitGuideProps) => import("react/jsx-runtime").JSX.Element;
63
+ /** The mask colour when neither the prop nor the theme sets one. */
64
+ export declare const FIT_GUIDE_MASK_DEFAULT = "#708090";
63
65
  //# sourceMappingURL=IdCaptureFitGuide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":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C,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,cAAc,GAAG,YAAY,CAAA;IAC9C,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,UAAU,CAAC,EAAE,2BAA2B,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,+RAsB/B,sBAAsB,4CA6QxB,CAAA;AA6CD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,YAAY,CAAA"}
@@ -56,7 +56,8 @@ export const IdCaptureFitGuide = ({ aspectRatio, maskColor, borderRadius = 33, b
56
56
  aspectRatio = imageAspectRatio;
57
57
  }
58
58
  if (maskColor === undefined) {
59
- maskColor = theme.idCapture?.guideOverlay?.backgroundColor ?? '#708090';
59
+ maskColor =
60
+ theme.idCapture?.guideOverlay?.backgroundColor ?? FIT_GUIDE_MASK_DEFAULT;
60
61
  }
61
62
  const progressBarIndicatorColor = theme.idCapture?.guideBox?.progressBarIndicatorColor ?? '#287ec6';
62
63
  const progressBarWidth = theme.idCapture?.guideBox?.progressBarWidth ?? borderWidth;
@@ -213,3 +214,5 @@ const CaptureAreaProgress = styled.div `
213
214
  const GuideBoxLayer = styled(CaptureAreaProgress) `
214
215
  z-index: 1000;
215
216
  `;
217
+ /** The mask colour when neither the prop nor the theme sets one. */
218
+ export const FIT_GUIDE_MASK_DEFAULT = '#708090';
@@ -97,4 +97,6 @@ export declare const GuideCenterInner: import("styled-components/dist/types").IS
97
97
  }, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$isLandscape"> & {
98
98
  $isLandscape?: boolean;
99
99
  }, never>>> & string;
100
+ /** The mask colour when neither the prop nor the theme sets one. */
101
+ export declare const OVERLAY_GUIDE_MASK_DEFAULT = "rgba(0, 0, 0, 0.5)";
100
102
  //# sourceMappingURL=IdCaptureGuideOverlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IdCaptureGuideOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/guides/IdCaptureGuideOverlay.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAA6B,MAAM,OAAO,CAAA;AAG/D,OAAO,EAGL,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAgB,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAErE,OAAO,EAGL,oBAAoB,EAErB,MAAM,iBAAiB,CAAA;AAGxB,MAAM,MAAM,+BAA+B,GAAG;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,sBAAsB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,CAAC,EAAE,+BAA+B,CAAA;IAC5C,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,OAA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M;kBACJ,OAAO;oBAUtB,CAAA;AAED,eAAO,MAAM,iBAAiB;kBACd,MAAM;mBACL,MAAM;eACV,MAAM;;kBAFH,MAAM;mBACL,MAAM;eACV,MAAM;oBAalB,CAAA;AAED,eAAO,MAAM,SAAS,2VAIrB,CAAA;AAED,eAAO,MAAM,gBAAgB;mBACZ,OAAO;;mBAAP,OAAO;oBAWvB,CAAA;AAED,oEAAoE;AACpE,eAAO,MAAM,0BAA0B,uBAAuB,CAAA"}
@@ -87,7 +87,7 @@ export const GuideRegion = styled.div `
87
87
  z-index: 1000;
88
88
  background: ${(props) => props.$maskColor ??
89
89
  props.theme?.idCapture?.guideOverlay?.backgroundColor ??
90
- 'rgba(0, 0, 0, 0.5)'};
90
+ OVERLAY_GUIDE_MASK_DEFAULT};
91
91
  color: ${(props) => props.theme?.idCapture?.guideOverlay?.textColor ?? 'white'};
92
92
  text-align: center;
93
93
  ${(props) => (props.$minWidth ? `min-width: ${props.$minWidth}px;` : ``)}
@@ -135,3 +135,5 @@ export const GuideCenterInner = styled.div `
135
135
  align-items: center;
136
136
  justify-content: center;
137
137
  `;
138
+ /** The mask colour when neither the prop nor the theme sets one. */
139
+ export const OVERLAY_GUIDE_MASK_DEFAULT = 'rgba(0, 0, 0, 0.5)';
@@ -18,6 +18,20 @@ export type IdCaptureGuidesClassNames = IdCaptureFitGuideClassNames & IdCaptureG
18
18
  export type IdCaptureGuideType = 'fit' | 'overlay';
19
19
  export type IdCaptureGuidesVerbiage = {
20
20
  barcodeHeaderText?: CustomerSuppliedVerbiage;
21
+ /** The scan instruction above the guide. Defaults to the requested
22
+ * document's "Scan the front of ID" / "Scan the back of ID" / "Scan the ID
23
+ * page of passport". */
24
+ instructionText?: CustomerSuppliedVerbiage;
25
+ /** Replaces the instruction while a capture is running. Defaults to "Capturing...". */
26
+ capturingText?: CustomerSuppliedVerbiage;
27
+ /** Replaces the instruction when a capture fails. Defaults to "Capture failed!". */
28
+ captureFailedText?: CustomerSuppliedVerbiage;
29
+ /** Barcode recapture, barcode not yet close enough. Defaults to "Please
30
+ * move the barcode closer to the camera". */
31
+ guidanceBarcodeRecaptureText?: CustomerSuppliedVerbiage;
32
+ /** Barcode recapture, barcode close enough. Defaults to "Barcode capture in
33
+ * progress, please hold still". */
34
+ guidanceBarcodeRecaptureInProgressText?: CustomerSuppliedVerbiage;
21
35
  };
22
36
  export type IdCaptureGuidesProps = {
23
37
  state: IdCaptureControllerState;
@@ -1 +1 @@
1
- {"version":3,"file":"IdCaptureGuides.d.ts","sourceRoot":"","sources":["../../../src/components/guides/IdCaptureGuides.tsx"],"names":[],"mappings":"AA0EA,OAAO,EAAmB,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAEjG,OAAO,EAAmB,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC3E,OAAO,EAEL,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAA+B,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,gCAAgC,CAAA;AAGvC;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,GACjE,+BAA+B,GAC/B,6BAA6B,CAAA;AAE/B,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,SAAS,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,iBAAiB,CAAC,EAAE,wBAAwB,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,wBAAwB,CAAA;IAC/B,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,kBAAkB,CAAA;IAC9B;kEAC8D;IAC9D,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,8FA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