@smileid/web-components 2.0.1 → 2.0.2
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.
- package/package.json +58 -58
- package/src/components/README.md +14 -14
- package/src/components/attribution/PoweredBySmileId.js +42 -42
- package/src/components/camera-permission/CameraPermission.js +140 -140
- package/src/components/camera-permission/CameraPermission.stories.js +27 -27
- package/src/components/combobox/src/Combobox.js +589 -589
- package/src/components/combobox/src/index.js +1 -1
- package/src/components/document/src/DocumentCaptureScreens.js +409 -409
- package/src/components/document/src/DocumentCaptureScreens.stories.js +57 -57
- package/src/components/document/src/README.md +111 -111
- package/src/components/document/src/document-capture/DocumentCapture.js +760 -760
- package/src/components/document/src/document-capture/DocumentCapture.stories.js +78 -78
- package/src/components/document/src/document-capture/README.md +90 -90
- package/src/components/document/src/document-capture/index.js +3 -3
- package/src/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +499 -499
- package/src/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +24 -24
- package/src/components/document/src/document-capture-instructions/README.md +56 -56
- package/src/components/document/src/document-capture-instructions/index.js +3 -3
- package/src/components/document/src/document-capture-review/DocumentCaptureReview.js +362 -362
- package/src/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +24 -24
- package/src/components/document/src/document-capture-review/README.md +79 -79
- package/src/components/document/src/document-capture-review/index.js +3 -3
- package/src/components/document/src/index.js +3 -3
- package/src/components/end-user-consent/src/EndUserConsent.js +795 -795
- package/src/components/end-user-consent/src/EndUserConsent.stories.js +29 -29
- package/src/components/end-user-consent/src/index.js +4 -4
- package/src/components/navigation/src/Navigation.js +171 -171
- package/src/components/navigation/src/Navigation.stories.js +24 -24
- package/src/components/navigation/src/index.js +3 -3
- package/src/components/selfie/README.md +225 -225
- package/src/components/selfie/src/SelfieCaptureScreens.js +282 -282
- package/src/components/selfie/src/SelfieCaptureScreens.stories.js +29 -29
- package/src/components/selfie/src/index.js +5 -5
- package/src/components/selfie/src/selfie-capture/SelfieCapture.js +1041 -1010
- package/src/components/selfie/src/selfie-capture/SelfieCapture.stories.js +36 -36
- package/src/components/selfie/src/selfie-capture/index.js +3 -3
- package/src/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +657 -648
- package/src/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +23 -23
- package/src/components/selfie/src/selfie-capture-instructions/index.js +3 -3
- package/src/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +347 -347
- package/src/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +24 -24
- package/src/components/selfie/src/selfie-capture-review/index.js +3 -3
- package/src/components/signature-pad/package-lock.json +3009 -3009
- package/src/components/signature-pad/package.json +30 -30
- package/src/components/signature-pad/src/SignaturePad.js +484 -484
- package/src/components/signature-pad/src/SignaturePad.stories.js +32 -32
- package/src/components/signature-pad/src/index.js +3 -3
- package/src/components/smart-camera-web/src/README.md +207 -207
- package/src/components/smart-camera-web/src/SmartCameraWeb.js +299 -299
- package/src/components/smart-camera-web/src/SmartCameraWeb.stories.js +57 -57
- package/src/components/totp-consent/src/TotpConsent.js +949 -949
- package/src/components/totp-consent/src/index.js +4 -4
- package/src/domain/camera/src/README.md +38 -38
- package/src/domain/camera/src/SmartCamera.js +109 -109
- package/src/domain/constants/src/Constants.js +27 -27
- package/src/domain/file-upload/README.md +35 -35
- package/src/domain/file-upload/src/SmartFileUpload.js +65 -65
- package/src/index.js +5 -5
- package/src/styles/README.md +3 -3
- package/src/styles/src/styles.js +359 -359
- package/src/styles/src/typography.js +52 -52
|
@@ -1,362 +1,362 @@
|
|
|
1
|
-
import styles from '../../../../styles/src/styles';
|
|
2
|
-
import '../../../navigation/src';
|
|
3
|
-
|
|
4
|
-
function templateString() {
|
|
5
|
-
return `
|
|
6
|
-
<style>
|
|
7
|
-
.retake-photo.button[data-variant~="ghost"] {
|
|
8
|
-
color: #FF5805;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@media (max-width: 600px) {
|
|
13
|
-
.id-camera-screen {
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100vh;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.section {
|
|
19
|
-
width: 100%;
|
|
20
|
-
height: 100vh;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.id-image-container {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: 1.75rem;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.id-image {
|
|
33
|
-
width: 100%;
|
|
34
|
-
text-align: center;
|
|
35
|
-
position: relative;
|
|
36
|
-
background: white;
|
|
37
|
-
}
|
|
38
|
-
img {
|
|
39
|
-
height: 100%;
|
|
40
|
-
min-height: 100px;
|
|
41
|
-
width: 98%;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.action-buttons {
|
|
45
|
-
width: 80%;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.icon-btn {
|
|
50
|
-
appearance: none;
|
|
51
|
-
background: none;
|
|
52
|
-
border: none;
|
|
53
|
-
color: hsl(0deg 0% 94%);
|
|
54
|
-
cursor: pointer;
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
justify-content: center;
|
|
58
|
-
padding: 4px 8px;
|
|
59
|
-
}
|
|
60
|
-
.justify-right {
|
|
61
|
-
justify-content: end !important;
|
|
62
|
-
}
|
|
63
|
-
.nav {
|
|
64
|
-
display: flex;
|
|
65
|
-
justify-content: space-between;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.back-wrapper {
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.back-button-text {
|
|
74
|
-
font-size: 11px;
|
|
75
|
-
line-height: 11px;
|
|
76
|
-
color: rgb(21, 31, 114);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.tips,
|
|
82
|
-
.powered-by {
|
|
83
|
-
align-items: center;
|
|
84
|
-
border-radius: 0.25rem;
|
|
85
|
-
color: #4e6577;
|
|
86
|
-
display: flex;
|
|
87
|
-
justify-content: center;
|
|
88
|
-
letter-spacing: 0.075em;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.powered-by {
|
|
92
|
-
box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
|
|
93
|
-
display: inline-flex;
|
|
94
|
-
font-size: 0.5rem;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.tips {
|
|
98
|
-
margin-left: auto;
|
|
99
|
-
margin-right: auto;
|
|
100
|
-
max-width: 17rem;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.tips > * + *,
|
|
104
|
-
.powered-by > * + * {
|
|
105
|
-
display: inline-block;
|
|
106
|
-
margin-left: 0.5em;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.powered-by .company {
|
|
110
|
-
color: #18406d;
|
|
111
|
-
font-weight: 700;
|
|
112
|
-
letter-spacing: 0.15rem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.logo-mark {
|
|
116
|
-
background-color: #004071;
|
|
117
|
-
display: inline-block;
|
|
118
|
-
padding: 0.25em 0.5em;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.logo-mark svg {
|
|
122
|
-
height: auto;
|
|
123
|
-
justify-self: center;
|
|
124
|
-
width: 0.75em;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
#document-capture-review-screen {
|
|
128
|
-
block-size: 45rem;
|
|
129
|
-
padding-block: 2rem;
|
|
130
|
-
display: flex;
|
|
131
|
-
flex-direction: column;
|
|
132
|
-
max-block-size: 100%;
|
|
133
|
-
max-inline-size: 40ch;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
#document-capture-review-screen .id-image-container.landscape {
|
|
137
|
-
height: auto;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
#document-capture-review-screen header p {
|
|
141
|
-
margin-block: 0 !important;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.description {
|
|
145
|
-
color: var(--neutral-off-black, #2D2B2A);
|
|
146
|
-
text-align: center;
|
|
147
|
-
|
|
148
|
-
/* p */
|
|
149
|
-
font-family: DM Sans;
|
|
150
|
-
font-size: 0.875rem;
|
|
151
|
-
font-style: normal;
|
|
152
|
-
font-weight: 400;
|
|
153
|
-
line-height: 18px;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.padding-bottom-2 {
|
|
157
|
-
padding-bottom: 2rem;
|
|
158
|
-
}
|
|
159
|
-
img {
|
|
160
|
-
border-width: 0.25rem;
|
|
161
|
-
border-color: #9394ab;
|
|
162
|
-
border-style: solid;
|
|
163
|
-
border-radius: 0.25rem;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.instructions-wrapper {
|
|
167
|
-
display: inline-flex;
|
|
168
|
-
flex-direction: column;
|
|
169
|
-
align-items: flex-start;
|
|
170
|
-
gap: 2rem;
|
|
171
|
-
margin-block-start: 2rem;
|
|
172
|
-
margin-block-end: 4rem;
|
|
173
|
-
}
|
|
174
|
-
.instructions {
|
|
175
|
-
display: flex;
|
|
176
|
-
align-items: center;
|
|
177
|
-
text-align: initial;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.instructions svg {
|
|
181
|
-
flex-shrink: 0;
|
|
182
|
-
margin-inline-end: 2rem;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.instructions p {
|
|
186
|
-
margin-block: 0;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.instruction-body {
|
|
190
|
-
font-size: 0.75rem;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
h1 {
|
|
194
|
-
color: var(--web-digital-blue, #001096);
|
|
195
|
-
text-align: center;
|
|
196
|
-
|
|
197
|
-
/* h1 */
|
|
198
|
-
font-size: 1.5rem;
|
|
199
|
-
font-style: normal;
|
|
200
|
-
font-weight: 700;
|
|
201
|
-
line-height: 36px; /* 150% */
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.p2 {
|
|
205
|
-
font-size: 1rem;
|
|
206
|
-
font-style: normal;
|
|
207
|
-
font-weight: 500;
|
|
208
|
-
line-height: 1rem;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.instruction-header {
|
|
212
|
-
color: var(--web-digital-blue, #001096);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.h2 {
|
|
216
|
-
font-size: 1rem;
|
|
217
|
-
font-style: normal;
|
|
218
|
-
font-weight: 700;
|
|
219
|
-
line-height: 1.5rem;
|
|
220
|
-
}
|
|
221
|
-
</style>
|
|
222
|
-
${styles(this.themeColor)}
|
|
223
|
-
<div id='document-capture-review-screen' class='flow center'>
|
|
224
|
-
<smileid-navigation ${this.showNavigation ? 'show-navigation' : ''} hide-back></smileid-navigation>
|
|
225
|
-
<h1 class="header-title title-color">
|
|
226
|
-
Is the document clear and readable?
|
|
227
|
-
</h1>
|
|
228
|
-
<p class="description">Make sure all corners of the document
|
|
229
|
-
are visible and there is no glare</p>
|
|
230
|
-
<div class='section | flow'>
|
|
231
|
-
<div class='id-image-container'>
|
|
232
|
-
<div class='id-image'>
|
|
233
|
-
<div class='video-overlay'></div>
|
|
234
|
-
${this.imageSrc ? `<img alt='your ID card' id='document-capture-review-image' src='${this.imageSrc}' />` : ''}
|
|
235
|
-
</div>
|
|
236
|
-
<div class='flow action-buttons'>
|
|
237
|
-
<button data-variant='solid full-width' class='button' type='button' id='select-id-image'>
|
|
238
|
-
Yes, my ID is readable
|
|
239
|
-
</button>
|
|
240
|
-
<button data-variant='ghost full-width' class='button retake-photo' type='button' id='re-capture-id-image'>
|
|
241
|
-
No, retake photo
|
|
242
|
-
</button>
|
|
243
|
-
</div>
|
|
244
|
-
</div>
|
|
245
|
-
|
|
246
|
-
${
|
|
247
|
-
this.hideAttribution
|
|
248
|
-
? ''
|
|
249
|
-
: `
|
|
250
|
-
<powered-by-smile-id></powered-by-smile-id>
|
|
251
|
-
`
|
|
252
|
-
}
|
|
253
|
-
</div>
|
|
254
|
-
</div>
|
|
255
|
-
`;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
class IdReview extends HTMLElement {
|
|
259
|
-
constructor() {
|
|
260
|
-
super();
|
|
261
|
-
this.templateString = templateString.bind(this);
|
|
262
|
-
this.render = () => this.templateString();
|
|
263
|
-
|
|
264
|
-
this.attachShadow({ mode: 'open' });
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
connectedCallback() {
|
|
268
|
-
const template = document.createElement('template');
|
|
269
|
-
template.innerHTML = this.render();
|
|
270
|
-
this.shadowRoot.innerHTML = '';
|
|
271
|
-
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
272
|
-
this.setUpEventListeners();
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
static get observedAttributes() {
|
|
276
|
-
return ['hide-back-to-host', 'show-navigation', 'data-image'];
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
get hideBack() {
|
|
280
|
-
return this.hasAttribute('hide-back-to-host');
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
get showNavigation() {
|
|
284
|
-
return this.hasAttribute('show-navigation');
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
get themeColor() {
|
|
288
|
-
return this.getAttribute('theme-color') || '#001096';
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
get hideAttribution() {
|
|
292
|
-
return this.hasAttribute('hide-attribution');
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
get imageSrc() {
|
|
296
|
-
return this.getAttribute('data-image');
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
get title() {
|
|
300
|
-
return this.getAttribute('title') || 'Submit Front of ID';
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
handleBackEvents() {
|
|
304
|
-
this.dispatchEvent(new CustomEvent('document-capture-review.cancelled'));
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
handleCloseEvents() {
|
|
308
|
-
this.dispatchEvent(new CustomEvent('document-capture-review.close'));
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
attributeChangedCallback(name) {
|
|
312
|
-
switch (name) {
|
|
313
|
-
case 'data-image':
|
|
314
|
-
case 'hide-back-to-host':
|
|
315
|
-
case 'show-navigation':
|
|
316
|
-
this.shadowRoot.innerHTML = this.render();
|
|
317
|
-
this.setUpEventListeners();
|
|
318
|
-
break;
|
|
319
|
-
default:
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
setUpEventListeners() {
|
|
325
|
-
this.selectIDImage = this.shadowRoot.querySelector('#select-id-image');
|
|
326
|
-
this.reCaptureIDImage = this.shadowRoot.querySelector(
|
|
327
|
-
'#re-capture-id-image',
|
|
328
|
-
);
|
|
329
|
-
this.navigation = this.shadowRoot.querySelector('smileid-navigation');
|
|
330
|
-
this.navigation.addEventListener('navigation.back', () => {
|
|
331
|
-
this.handleBackEvents();
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
this.navigation.addEventListener('navigation.close', () => {
|
|
335
|
-
this.handleCloseEvents();
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
this.selectIDImage.addEventListener('click', () => {
|
|
339
|
-
this.dispatchEvent(
|
|
340
|
-
new CustomEvent('document-capture-review.accepted', {
|
|
341
|
-
detail: {},
|
|
342
|
-
}),
|
|
343
|
-
);
|
|
344
|
-
});
|
|
345
|
-
this.reCaptureIDImage.addEventListener('click', () => {
|
|
346
|
-
this.dispatchEvent(
|
|
347
|
-
new CustomEvent('document-capture-review.rejected', {
|
|
348
|
-
detail: {},
|
|
349
|
-
}),
|
|
350
|
-
);
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (
|
|
356
|
-
'customElements' in window &&
|
|
357
|
-
!customElements.get('document-capture-review')
|
|
358
|
-
) {
|
|
359
|
-
window.customElements.define('document-capture-review', IdReview);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export default IdReview;
|
|
1
|
+
import styles from '../../../../styles/src/styles';
|
|
2
|
+
import '../../../navigation/src';
|
|
3
|
+
|
|
4
|
+
function templateString() {
|
|
5
|
+
return `
|
|
6
|
+
<style>
|
|
7
|
+
.retake-photo.button[data-variant~="ghost"] {
|
|
8
|
+
color: #FF5805;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@media (max-width: 600px) {
|
|
13
|
+
.id-camera-screen {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.section {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100vh;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.id-image-container {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 1.75rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.id-image {
|
|
33
|
+
width: 100%;
|
|
34
|
+
text-align: center;
|
|
35
|
+
position: relative;
|
|
36
|
+
background: white;
|
|
37
|
+
}
|
|
38
|
+
img {
|
|
39
|
+
height: 100%;
|
|
40
|
+
min-height: 100px;
|
|
41
|
+
width: 98%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.action-buttons {
|
|
45
|
+
width: 80%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
.icon-btn {
|
|
50
|
+
appearance: none;
|
|
51
|
+
background: none;
|
|
52
|
+
border: none;
|
|
53
|
+
color: hsl(0deg 0% 94%);
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
padding: 4px 8px;
|
|
59
|
+
}
|
|
60
|
+
.justify-right {
|
|
61
|
+
justify-content: end !important;
|
|
62
|
+
}
|
|
63
|
+
.nav {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.back-wrapper {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.back-button-text {
|
|
74
|
+
font-size: 11px;
|
|
75
|
+
line-height: 11px;
|
|
76
|
+
color: rgb(21, 31, 114);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
.tips,
|
|
82
|
+
.powered-by {
|
|
83
|
+
align-items: center;
|
|
84
|
+
border-radius: 0.25rem;
|
|
85
|
+
color: #4e6577;
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
letter-spacing: 0.075em;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.powered-by {
|
|
92
|
+
box-shadow: 0px 2.57415px 2.57415px rgba(0, 0, 0, 0.06);
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
font-size: 0.5rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.tips {
|
|
98
|
+
margin-left: auto;
|
|
99
|
+
margin-right: auto;
|
|
100
|
+
max-width: 17rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.tips > * + *,
|
|
104
|
+
.powered-by > * + * {
|
|
105
|
+
display: inline-block;
|
|
106
|
+
margin-left: 0.5em;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.powered-by .company {
|
|
110
|
+
color: #18406d;
|
|
111
|
+
font-weight: 700;
|
|
112
|
+
letter-spacing: 0.15rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.logo-mark {
|
|
116
|
+
background-color: #004071;
|
|
117
|
+
display: inline-block;
|
|
118
|
+
padding: 0.25em 0.5em;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.logo-mark svg {
|
|
122
|
+
height: auto;
|
|
123
|
+
justify-self: center;
|
|
124
|
+
width: 0.75em;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#document-capture-review-screen {
|
|
128
|
+
block-size: 45rem;
|
|
129
|
+
padding-block: 2rem;
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
max-block-size: 100%;
|
|
133
|
+
max-inline-size: 40ch;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
#document-capture-review-screen .id-image-container.landscape {
|
|
137
|
+
height: auto;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#document-capture-review-screen header p {
|
|
141
|
+
margin-block: 0 !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.description {
|
|
145
|
+
color: var(--neutral-off-black, #2D2B2A);
|
|
146
|
+
text-align: center;
|
|
147
|
+
|
|
148
|
+
/* p */
|
|
149
|
+
font-family: DM Sans;
|
|
150
|
+
font-size: 0.875rem;
|
|
151
|
+
font-style: normal;
|
|
152
|
+
font-weight: 400;
|
|
153
|
+
line-height: 18px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.padding-bottom-2 {
|
|
157
|
+
padding-bottom: 2rem;
|
|
158
|
+
}
|
|
159
|
+
img {
|
|
160
|
+
border-width: 0.25rem;
|
|
161
|
+
border-color: #9394ab;
|
|
162
|
+
border-style: solid;
|
|
163
|
+
border-radius: 0.25rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.instructions-wrapper {
|
|
167
|
+
display: inline-flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
align-items: flex-start;
|
|
170
|
+
gap: 2rem;
|
|
171
|
+
margin-block-start: 2rem;
|
|
172
|
+
margin-block-end: 4rem;
|
|
173
|
+
}
|
|
174
|
+
.instructions {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
text-align: initial;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.instructions svg {
|
|
181
|
+
flex-shrink: 0;
|
|
182
|
+
margin-inline-end: 2rem;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.instructions p {
|
|
186
|
+
margin-block: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.instruction-body {
|
|
190
|
+
font-size: 0.75rem;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
h1 {
|
|
194
|
+
color: var(--web-digital-blue, #001096);
|
|
195
|
+
text-align: center;
|
|
196
|
+
|
|
197
|
+
/* h1 */
|
|
198
|
+
font-size: 1.5rem;
|
|
199
|
+
font-style: normal;
|
|
200
|
+
font-weight: 700;
|
|
201
|
+
line-height: 36px; /* 150% */
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.p2 {
|
|
205
|
+
font-size: 1rem;
|
|
206
|
+
font-style: normal;
|
|
207
|
+
font-weight: 500;
|
|
208
|
+
line-height: 1rem;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.instruction-header {
|
|
212
|
+
color: var(--web-digital-blue, #001096);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.h2 {
|
|
216
|
+
font-size: 1rem;
|
|
217
|
+
font-style: normal;
|
|
218
|
+
font-weight: 700;
|
|
219
|
+
line-height: 1.5rem;
|
|
220
|
+
}
|
|
221
|
+
</style>
|
|
222
|
+
${styles(this.themeColor)}
|
|
223
|
+
<div id='document-capture-review-screen' class='flow center'>
|
|
224
|
+
<smileid-navigation ${this.showNavigation ? 'show-navigation' : ''} hide-back></smileid-navigation>
|
|
225
|
+
<h1 class="header-title title-color">
|
|
226
|
+
Is the document clear and readable?
|
|
227
|
+
</h1>
|
|
228
|
+
<p class="description">Make sure all corners of the document
|
|
229
|
+
are visible and there is no glare</p>
|
|
230
|
+
<div class='section | flow'>
|
|
231
|
+
<div class='id-image-container'>
|
|
232
|
+
<div class='id-image'>
|
|
233
|
+
<div class='video-overlay'></div>
|
|
234
|
+
${this.imageSrc ? `<img alt='your ID card' id='document-capture-review-image' src='${this.imageSrc}' />` : ''}
|
|
235
|
+
</div>
|
|
236
|
+
<div class='flow action-buttons'>
|
|
237
|
+
<button data-variant='solid full-width' class='button' type='button' id='select-id-image'>
|
|
238
|
+
Yes, my ID is readable
|
|
239
|
+
</button>
|
|
240
|
+
<button data-variant='ghost full-width' class='button retake-photo' type='button' id='re-capture-id-image'>
|
|
241
|
+
No, retake photo
|
|
242
|
+
</button>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
${
|
|
247
|
+
this.hideAttribution
|
|
248
|
+
? ''
|
|
249
|
+
: `
|
|
250
|
+
<powered-by-smile-id></powered-by-smile-id>
|
|
251
|
+
`
|
|
252
|
+
}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
`;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
class IdReview extends HTMLElement {
|
|
259
|
+
constructor() {
|
|
260
|
+
super();
|
|
261
|
+
this.templateString = templateString.bind(this);
|
|
262
|
+
this.render = () => this.templateString();
|
|
263
|
+
|
|
264
|
+
this.attachShadow({ mode: 'open' });
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
connectedCallback() {
|
|
268
|
+
const template = document.createElement('template');
|
|
269
|
+
template.innerHTML = this.render();
|
|
270
|
+
this.shadowRoot.innerHTML = '';
|
|
271
|
+
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
272
|
+
this.setUpEventListeners();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
static get observedAttributes() {
|
|
276
|
+
return ['hide-back-to-host', 'show-navigation', 'data-image'];
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
get hideBack() {
|
|
280
|
+
return this.hasAttribute('hide-back-to-host');
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
get showNavigation() {
|
|
284
|
+
return this.hasAttribute('show-navigation');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
get themeColor() {
|
|
288
|
+
return this.getAttribute('theme-color') || '#001096';
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
get hideAttribution() {
|
|
292
|
+
return this.hasAttribute('hide-attribution');
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
get imageSrc() {
|
|
296
|
+
return this.getAttribute('data-image');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
get title() {
|
|
300
|
+
return this.getAttribute('title') || 'Submit Front of ID';
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
handleBackEvents() {
|
|
304
|
+
this.dispatchEvent(new CustomEvent('document-capture-review.cancelled'));
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
handleCloseEvents() {
|
|
308
|
+
this.dispatchEvent(new CustomEvent('document-capture-review.close'));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
attributeChangedCallback(name) {
|
|
312
|
+
switch (name) {
|
|
313
|
+
case 'data-image':
|
|
314
|
+
case 'hide-back-to-host':
|
|
315
|
+
case 'show-navigation':
|
|
316
|
+
this.shadowRoot.innerHTML = this.render();
|
|
317
|
+
this.setUpEventListeners();
|
|
318
|
+
break;
|
|
319
|
+
default:
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
setUpEventListeners() {
|
|
325
|
+
this.selectIDImage = this.shadowRoot.querySelector('#select-id-image');
|
|
326
|
+
this.reCaptureIDImage = this.shadowRoot.querySelector(
|
|
327
|
+
'#re-capture-id-image',
|
|
328
|
+
);
|
|
329
|
+
this.navigation = this.shadowRoot.querySelector('smileid-navigation');
|
|
330
|
+
this.navigation.addEventListener('navigation.back', () => {
|
|
331
|
+
this.handleBackEvents();
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
this.navigation.addEventListener('navigation.close', () => {
|
|
335
|
+
this.handleCloseEvents();
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
this.selectIDImage.addEventListener('click', () => {
|
|
339
|
+
this.dispatchEvent(
|
|
340
|
+
new CustomEvent('document-capture-review.accepted', {
|
|
341
|
+
detail: {},
|
|
342
|
+
}),
|
|
343
|
+
);
|
|
344
|
+
});
|
|
345
|
+
this.reCaptureIDImage.addEventListener('click', () => {
|
|
346
|
+
this.dispatchEvent(
|
|
347
|
+
new CustomEvent('document-capture-review.rejected', {
|
|
348
|
+
detail: {},
|
|
349
|
+
}),
|
|
350
|
+
);
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (
|
|
356
|
+
'customElements' in window &&
|
|
357
|
+
!customElements.get('document-capture-review')
|
|
358
|
+
) {
|
|
359
|
+
window.customElements.define('document-capture-review', IdReview);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export default IdReview;
|