@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
@@ -12,7 +12,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
12
12
  // divergence 4 — those fields never crossed the core port); captureState
13
13
  // becomes a `phase: CapturePhase` prop, and the sdk2 `captureState ===
14
14
  // 'complete'` null-check becomes phase-in-{'reviewing','uploading',
15
- // 'complete'} (the CapturePhase values that mean capture is over).
15
+ // 'complete'} (the CapturePhase values that mean capture is over) — as a
16
+ // `display: none`, not an unmount; see PHASES_WITH_NO_CAMERA_FEED below.
16
17
  import { forwardRef } from 'react';
17
18
  import { styled } from 'styled-components';
18
19
  import { useGuideLayout } from '../layout/GuideLayoutContext';
@@ -55,20 +56,39 @@ export const CameraFeedWrapper = styled.div `
55
56
  width: 100%;
56
57
  height: 100%;
57
58
  overflow: hidden;`}
59
+
60
+ /* Last, so it wins over both branches' display. */
61
+ ${(props) => (props.$hidden ? 'display: none;' : '')}
58
62
  `;
59
63
  // sdk2's ScalingCameraFeed hides itself once captureState === 'complete'.
60
64
  // The core port's CapturePhase spreads that one boolean across three
61
65
  // phases — 'reviewing' (post-capture, pre-submit), 'uploading' (submitting),
62
66
  // and 'complete' (submitted) — all of which mean "camera feed no longer
63
67
  // needed".
68
+ //
69
+ // HIDDEN, never unmounted. sdk2 could drop the <video>: its camera store held
70
+ // the stream and re-assigned `srcObject` to whatever element mounted next. In
71
+ // 3.0 the element IS the attachment — `controller.attach(el)` keeps that exact
72
+ // node (controller.ts, `const el = videoEl`) and only a camera acquisition
73
+ // wires a stream into it — so unmounting here orphaned the stream on a
74
+ // detached node. The view attaches once per controller, so nothing re-wired
75
+ // the fresh element React mounted on the way back to capturing: a retake
76
+ // returned to the capture screen with guides, border and a live pipeline over
77
+ // a blank feed. The element outlives every phase; only its visibility changes.
64
78
  const PHASES_WITH_NO_CAMERA_FEED = new Set([
65
79
  'reviewing',
66
80
  'uploading',
67
81
  'complete',
68
82
  ]);
83
+ /**
84
+ * Whether the feed is hidden in this phase. Hiding pauses the element, so the
85
+ * owner of the <video> — the one holding the ref it attached with — has to ask
86
+ * it to play again on the way back; `IdCaptureView` does, keyed on this.
87
+ */
88
+ export function isCameraFeedHidden(phase) {
89
+ return PHASES_WITH_NO_CAMERA_FEED.has(phase);
90
+ }
69
91
  export function ScalingCameraFeed({ videoRef, phase, isRearFacing, cameraFeedMode = 'snapToGuides', className, }) {
70
92
  const { guideRect } = useGuideLayout();
71
- if (PHASES_WITH_NO_CAMERA_FEED.has(phase))
72
- return null;
73
- return (_jsx(CameraFeedWrapper, { "$x": guideRect?.x ?? 0, "$y": guideRect?.y ?? 0, "$w": guideRect?.width ?? 0, "$h": guideRect?.height ?? 0, "$radius": guideRect?.radius, "$mode": cameraFeedMode, children: _jsx(CameraVideoTag, { ref: videoRef, isRearFacing: isRearFacing, className: className }) }));
93
+ return (_jsx(CameraFeedWrapper, { "$x": guideRect?.x ?? 0, "$y": guideRect?.y ?? 0, "$w": guideRect?.width ?? 0, "$h": guideRect?.height ?? 0, "$radius": guideRect?.radius, "$mode": cameraFeedMode, "$hidden": isCameraFeedHidden(phase), children: _jsx(CameraVideoTag, { ref: videoRef, isRearFacing: isRearFacing, className: className }) }));
74
94
  }
@@ -15,9 +15,15 @@ export type BarcodeGuideOverlayProps = {
15
15
  borderRadius?: number;
16
16
  headerText?: string | ReactElement;
17
17
  instructionText?: string | ReactElement;
18
+ /**
19
+ * Stable identifier for `instructionText`, emitted as `data-guidance-code` so
20
+ * a stylesheet can target this specific message. Optional because the
21
+ * component keeps a standalone default for its own text.
22
+ */
23
+ instructionCode?: string;
18
24
  isSuccess?: boolean;
19
25
  successColor?: string;
20
26
  classNames?: BarcodeGuideOverlayClassNames;
21
27
  };
22
- export declare function BarcodeGuideOverlay({ aspectRatio, maskColor, cornerColor, cornerLength, cornerWidth, padding, borderRadius, headerText, instructionText, isSuccess, successColor, classNames, }: BarcodeGuideOverlayProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function BarcodeGuideOverlay({ aspectRatio, maskColor, cornerColor, cornerLength, cornerWidth, padding, borderRadius, headerText, instructionText, instructionCode, isSuccess, successColor, classNames, }: BarcodeGuideOverlayProps): import("react/jsx-runtime").JSX.Element;
23
29
  //# sourceMappingURL=BarcodeGuideOverlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BarcodeGuideOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/barcode/BarcodeGuideOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,OAAO,CAAA;AAQvD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IAClC,eAAe,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IACvC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,6BAA6B,CAAA;CAC3C,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,WAAiC,EACjC,SAAS,EACT,WAAqB,EACrB,YAAiB,EACjB,WAAe,EACf,OAAO,EACP,YAAgB,EAChB,UAA+B,EAC/B,eAAoF,EACpF,SAAiB,EACjB,YAAwB,EACxB,UAAe,GAChB,EAAE,wBAAwB,2CAyJ1B"}
1
+ {"version":3,"file":"BarcodeGuideOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/barcode/BarcodeGuideOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,OAAO,CAAA;AAQvD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IAClC,eAAe,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IACvC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,6BAA6B,CAAA;CAC3C,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,WAAiC,EACjC,SAAS,EACT,WAAqB,EACrB,YAAiB,EACjB,WAAe,EACf,OAAO,EACP,YAAgB,EAChB,UAA+B,EAC/B,eAAoF,EACpF,eAAe,EACf,SAAiB,EACjB,YAAwB,EACxB,UAAe,GAChB,EAAE,wBAAwB,2CA4J1B"}
@@ -5,7 +5,7 @@ import { resetCanvasDimensions, setCanvasDimensions } from '../../utils/canvas';
5
5
  import { isMobile } from '../../utils/isMobile';
6
6
  import useResizeObserver from '../../layout/useResizeObserver';
7
7
  const PDF417_ASPECT_RATIO = 3 / 1;
8
- export function BarcodeGuideOverlay({ aspectRatio = PDF417_ASPECT_RATIO, maskColor, cornerColor = 'white', cornerLength = 40, cornerWidth = 4, padding, borderRadius = 8, headerText = 'SCAN THE BARCODE', instructionText = 'Bring camera closer until the barcode fills the rectangular box.', isSuccess = false, successColor = '#22c55e', classNames = {}, }) {
8
+ export function BarcodeGuideOverlay({ aspectRatio = PDF417_ASPECT_RATIO, maskColor, cornerColor = 'white', cornerLength = 40, cornerWidth = 4, padding, borderRadius = 8, headerText = 'SCAN THE BARCODE', instructionText = 'Bring camera closer until the barcode fills the rectangular box.', instructionCode, isSuccess = false, successColor = '#22c55e', classNames = {}, }) {
9
9
  const canvasRef = useRef(null);
10
10
  const { ref: wrapperRef, width: wrapperWidth = 1, height: wrapperHeight = 1, } = useResizeObserver();
11
11
  const theme = useTheme();
@@ -102,7 +102,7 @@ export function BarcodeGuideOverlay({ aspectRatio = PDF417_ASPECT_RATIO, maskCol
102
102
  wrapperHeight,
103
103
  wrapperWidth,
104
104
  ]);
105
- return (_jsxs(Wrapper, { ref: wrapperRef, className: classNames.wrapper, children: [_jsx(Canvas, { ref: canvasRef, className: classNames.canvas }), _jsxs(TextOverlay, { children: [_jsx(HeaderText, { className: classNames.header, children: headerText }), _jsx(InstructionText, { className: classNames.instruction, children: instructionText })] })] }));
105
+ return (_jsxs(Wrapper, { ref: wrapperRef, className: classNames.wrapper, children: [_jsx(Canvas, { ref: canvasRef, className: classNames.canvas }), _jsxs(TextOverlay, { children: [_jsx(HeaderText, { className: classNames.header, children: headerText }), _jsx(InstructionText, { className: classNames.instruction, "data-guidance-code": instructionCode, children: instructionText })] })] }));
106
106
  }
107
107
  const Wrapper = styled.div `
108
108
  position: absolute;
@@ -0,0 +1,63 @@
1
+ import { type ReactElement } from 'react';
2
+ /**
3
+ * `color` with its alpha dropped, or null when it is fully transparent.
4
+ *
5
+ * The strips have to be OPAQUE. Safari reads their `background-color`, and a
6
+ * translucent one blends with whatever is behind it — the host page, or on a
7
+ * `fullscreen` feed the camera — so the bars would stop matching the surface
8
+ * the strip stands for. The guided surround is translucent in exactly those
9
+ * cases: `fullscreen` mode's default scrim, and any translucent
10
+ * `guideBox.maskColor` a theme supplies. Keeping the RGB keeps the hue the
11
+ * theme asked for.
12
+ *
13
+ * Formats this does not parse — named colours, `var()` — pass through, since a
14
+ * named colour is already opaque and a custom property cannot be read here.
15
+ */
16
+ export declare function opaqueColor(color: string): string | null;
17
+ /**
18
+ * The colour a loading overlay's progress row shows along the viewport's
19
+ * bottom edge: the indicator once the bar is full, and before that the
20
+ * translucent track composited over the overlay background. `color-mix`
21
+ * composites the way the browser does, and still resolves a `var()` colour.
22
+ */
23
+ export declare function progressRowEdgeColor(row: {
24
+ full: boolean;
25
+ indicator: string;
26
+ track: string;
27
+ trackOpacity: number;
28
+ background: string;
29
+ }): string;
30
+ export type BrowserEdgeTintProps = {
31
+ /** The colour of the surface currently touching both viewport edges. */
32
+ color: string;
33
+ /**
34
+ * For a surface whose bottom edge is not one flat colour — a default loading
35
+ * overlay's progress row, part filled while it loads — the colour that edge
36
+ * shows. That strip is drawn fully transparent, because any flat strip over
37
+ * the row shows as a band across it. WebKit skips elements under 0.1
38
+ * opacity, so Safari most likely ignores it and keeps its last bottom
39
+ * colour (not yet confirmed on a device); the page is unobstructed either
40
+ * way.
41
+ */
42
+ hiddenBottomColor?: string;
43
+ };
44
+ /**
45
+ * Pins a thin strip of `color` to the top and bottom of the viewport.
46
+ *
47
+ * Portaled to `document.body` rather than rendered in place: `position: fixed`
48
+ * is only viewport-relative when no ancestor has a `transform` or `filter`, and
49
+ * an SDK cannot promise that about a host's layout. The portal target is
50
+ * resolved in an effect, so a server render emits nothing instead of reaching
51
+ * for a `document` that does not exist.
52
+ *
53
+ * Mounted only while a full-bleed surface is actually on screen. Unmounting is
54
+ * what hands the bars back to the host — hiding the strips with `opacity: 0`
55
+ * would not: Safari skips a nearly transparent strip, finds only the
56
+ * full-viewport surface behind it, and keeps its last colour.
57
+ *
58
+ * Each strip is keyed on its own colour, so a new colour mounts a new strip
59
+ * rather than restyling the old one. Safari remembers a colour per strip
60
+ * element, so a fresh element is what guarantees it takes the new one.
61
+ */
62
+ export declare function BrowserEdgeTint({ color, hiddenBottomColor, }: BrowserEdgeTintProps): ReactElement | null;
63
+ //# sourceMappingURL=BrowserEdgeTint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserEdgeTint.d.ts","sourceRoot":"","sources":["../../../src/components/common/BrowserEdgeTint.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAc9D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwBxD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE;IACxC,IAAI,EAAE,OAAO,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,MAAM,CAGT;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,iBAAiB,GAClB,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,CAyB5C"}
@@ -0,0 +1,111 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Makes the browser's own chrome match a full-screen surface.
3
+ //
4
+ // iOS 26 Safari ignores `<meta name="theme-color">` and tints its top and
5
+ // bottom bars from the page itself: first from the `background-color` of a
6
+ // `position: fixed` or `sticky` element sitting on that edge (within ~4px of
7
+ // the top or ~3px of the bottom, at least 80% of the width, at least 3px tall),
8
+ // and otherwise from the `html`/`body` background.
9
+ //
10
+ // That fallback is the HOST's, and the host has no way to know which of our
11
+ // screens is showing. On the guided POA screen it produced a white toolbar
12
+ // under a near-black camera surface; after capture, the light review screen
13
+ // kept the camera screen's near-black top bar. Two strips pinned to the edges
14
+ // in the current surface's colour give Safari something unambiguous to read,
15
+ // and it re-tints as they appear, change and disappear.
16
+ import { useEffect, useState } from 'react';
17
+ import { createPortal } from 'react-dom';
18
+ import { styled } from 'styled-components';
19
+ /**
20
+ * Over WebKit's 10px "thin border" cutoff (`LocalFrameView::fixedContainerEdges`).
21
+ * At or under it, Safari never reads the strip's `background-color`: it samples
22
+ * the pixels once and keeps that colour for as long as the same element holds
23
+ * the edge. At 6px, ID capture's strips first sampled the white loading overlay
24
+ * and kept the top bar white through the dark camera screen. Still short
25
+ * enough to disappear against a surface painted the same colour.
26
+ */
27
+ const EDGE_STRIP_PX = 12;
28
+ /**
29
+ * `color` with its alpha dropped, or null when it is fully transparent.
30
+ *
31
+ * The strips have to be OPAQUE. Safari reads their `background-color`, and a
32
+ * translucent one blends with whatever is behind it — the host page, or on a
33
+ * `fullscreen` feed the camera — so the bars would stop matching the surface
34
+ * the strip stands for. The guided surround is translucent in exactly those
35
+ * cases: `fullscreen` mode's default scrim, and any translucent
36
+ * `guideBox.maskColor` a theme supplies. Keeping the RGB keeps the hue the
37
+ * theme asked for.
38
+ *
39
+ * Formats this does not parse — named colours, `var()` — pass through, since a
40
+ * named colour is already opaque and a custom property cannot be read here.
41
+ */
42
+ export function opaqueColor(color) {
43
+ const value = color.trim();
44
+ if (value.toLowerCase() === 'transparent')
45
+ return null;
46
+ const hex = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(value);
47
+ if (hex) {
48
+ const digits = hex[1];
49
+ if (digits.length === 4)
50
+ return `#${digits.slice(0, 3)}`;
51
+ if (digits.length === 8)
52
+ return `#${digits.slice(0, 6)}`;
53
+ return value;
54
+ }
55
+ // rgb/rgba/hsl/hsla, in both the comma and the space-and-slash syntax.
56
+ const fn = /^(rgb|hsl)a?\(\s*([^,/\s)]+)[\s,]+([^,/\s)]+)[\s,]+([^,/\s)]+)\s*(?:[,/]\s*([^\s)]+))?\s*\)$/i.exec(value);
57
+ if (fn) {
58
+ const [, space, a, b, c, alpha] = fn;
59
+ if (alpha !== undefined && parseFloat(alpha) === 0)
60
+ return null;
61
+ return `${space.toLowerCase()}(${a}, ${b}, ${c})`;
62
+ }
63
+ return value;
64
+ }
65
+ /**
66
+ * The colour a loading overlay's progress row shows along the viewport's
67
+ * bottom edge: the indicator once the bar is full, and before that the
68
+ * translucent track composited over the overlay background. `color-mix`
69
+ * composites the way the browser does, and still resolves a `var()` colour.
70
+ */
71
+ export function progressRowEdgeColor(row) {
72
+ if (row.full)
73
+ return row.indicator;
74
+ return `color-mix(in srgb, ${row.track} ${row.trackOpacity * 100}%, ${row.background})`;
75
+ }
76
+ /**
77
+ * Pins a thin strip of `color` to the top and bottom of the viewport.
78
+ *
79
+ * Portaled to `document.body` rather than rendered in place: `position: fixed`
80
+ * is only viewport-relative when no ancestor has a `transform` or `filter`, and
81
+ * an SDK cannot promise that about a host's layout. The portal target is
82
+ * resolved in an effect, so a server render emits nothing instead of reaching
83
+ * for a `document` that does not exist.
84
+ *
85
+ * Mounted only while a full-bleed surface is actually on screen. Unmounting is
86
+ * what hands the bars back to the host — hiding the strips with `opacity: 0`
87
+ * would not: Safari skips a nearly transparent strip, finds only the
88
+ * full-viewport surface behind it, and keeps its last colour.
89
+ *
90
+ * Each strip is keyed on its own colour, so a new colour mounts a new strip
91
+ * rather than restyling the old one. Safari remembers a colour per strip
92
+ * element, so a fresh element is what guarantees it takes the new one.
93
+ */
94
+ export function BrowserEdgeTint({ color, hiddenBottomColor, }) {
95
+ const [target, setTarget] = useState(null);
96
+ useEffect(() => setTarget(document.body), []);
97
+ if (!target)
98
+ return null;
99
+ const bottomColor = hiddenBottomColor ?? color;
100
+ return createPortal(_jsxs(_Fragment, { children: [_jsx(EdgeStrip, { "$edge": "top", "$color": color, "aria-hidden": "true", "data-testid": "browser-edge-tint-top" }, `top:${color}`), _jsx(EdgeStrip, { "$edge": "bottom", "$color": bottomColor, "$hidden": hiddenBottomColor !== undefined, "aria-hidden": "true", "data-testid": "browser-edge-tint-bottom" }, `bottom:${bottomColor}`)] }), target);
101
+ }
102
+ const EdgeStrip = styled.div `
103
+ position: fixed;
104
+ left: 0;
105
+ right: 0;
106
+ ${({ $edge }) => $edge}: 0;
107
+ height: ${EDGE_STRIP_PX}px;
108
+ background: ${({ $color }) => $color};
109
+ ${({ $hidden }) => ($hidden ? 'opacity: 0;' : '')}
110
+ pointer-events: none;
111
+ `;
@@ -12,16 +12,25 @@ export type LoaderButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
12
12
  children?: ReactNode;
13
13
  className?: string;
14
14
  disabled?: boolean;
15
+ /** False while the action is in progress: the button is disabled, marked
16
+ * `aria-busy`, and a bar glides along its bottom edge. */
15
17
  finished?: boolean;
16
18
  colors?: LoaderButtonColors;
17
19
  onClick?: () => void;
18
20
  style?: CSSProperties;
19
21
  variant?: LoaderButtonVariant;
20
22
  };
23
+ /**
24
+ * The SDK's action button. `ladda-button` / `ladda-label` are kept as class
25
+ * hooks from when Ladda drew the loading state, since 2.x customer CSS may
26
+ * target them.
27
+ */
21
28
  export declare const LoaderButton: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
22
29
  children?: ReactNode;
23
30
  className?: string;
24
31
  disabled?: boolean;
32
+ /** False while the action is in progress: the button is disabled, marked
33
+ * `aria-busy`, and a bar glides along its bottom edge. */
25
34
  finished?: boolean;
26
35
  colors?: LoaderButtonColors;
27
36
  onClick?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"LoaderButton.d.ts","sourceRoot":"","sources":["../../../src/components/common/LoaderButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,SAAS,EAMV,MAAM,OAAO,CAAA;AAId,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,iBAAiB,GAC3B,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAC9B,CAAA;AAEH,eAAO,MAAM,YAAY;eAVV,SAAS;gBACR,MAAM;eACP,OAAO;eACP,OAAO;aACT,kBAAkB;cACjB,MAAM,IAAI;YACZ,aAAa;cACX,mBAAmB;qDAuEhC,CAAA"}
1
+ {"version":3,"file":"LoaderButton.d.ts","sourceRoot":"","sources":["../../../src/components/common/LoaderButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,SAAS,EAAc,MAAM,OAAO,CAAA;AAGlF,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,iBAAiB,GAC3B,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;8DAC0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,kBAAkB,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAC9B,CAAA;AAEH;;;;GAIG;AACH,eAAO,MAAM,YAAY;eAjBV,SAAS;gBACR,MAAM;eACP,OAAO;IAClB;8DAC0D;eAC/C,OAAO;aACT,kBAAkB;cACjB,MAAM,IAAI;YACZ,aAAa;cACX,mBAAmB;qDAyChC,CAAA"}