@smileid/web-components 1.0.1-beta → 1.4.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.
Files changed (36) hide show
  1. package/components/camera-permission/CameraPermission.js +6 -2
  2. package/components/camera-permission/CameraPermission.stories.js +10 -4
  3. package/components/document/src/DocumentCaptureScreens.js +15 -9
  4. package/components/document/src/DocumentCaptureScreens.stories.js +16 -12
  5. package/components/document/src/document-capture/DocumentCapture.js +295 -217
  6. package/components/document/src/document-capture/DocumentCapture.stories.js +9 -2
  7. package/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +33 -33
  8. package/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +8 -1
  9. package/components/document/src/document-capture-review/DocumentCaptureReview.js +15 -31
  10. package/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +12 -2
  11. package/components/end-user-consent/src/EndUserConsent.js +14 -31
  12. package/components/end-user-consent/src/EndUserConsent.stories.js +8 -2
  13. package/components/navigation/src/Navigation.js +10 -2
  14. package/components/selfie/src/SelfieCaptureScreens.js +36 -10
  15. package/components/selfie/src/SelfieCaptureScreens.stories.js +13 -4
  16. package/components/selfie/src/selfie-capture/SelfieCapture.js +94 -23
  17. package/components/selfie/src/selfie-capture/SelfieCapture.stories.js +14 -1
  18. package/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +50 -44
  19. package/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +8 -1
  20. package/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +3 -4
  21. package/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +8 -1
  22. package/components/signature-pad/package-lock.json +3009 -0
  23. package/components/signature-pad/package.json +6 -6
  24. package/components/signature-pad/src/SignaturePad.js +5 -1
  25. package/components/signature-pad/src/SignaturePad.stories.js +10 -2
  26. package/components/smart-camera-web/src/SmartCameraWeb.js +53 -8
  27. package/components/smart-camera-web/src/SmartCameraWeb.stories.js +22 -9
  28. package/components/totp-consent/src/TotpConsent.js +15 -3
  29. package/cypress/e2e/smart-camera-web-agent-mode.cy.js +144 -0
  30. package/cypress/e2e/smart-camera-web-complete-flow.cy.js +221 -0
  31. package/cypress/e2e/smart-camera-web.cy.js +1 -1
  32. package/cypress/pages/smart-camera-web-agent-mode.html +36 -0
  33. package/cypress/pages/smart-camera-web-complete-flow.html +42 -0
  34. package/domain/camera/src/SmartCamera.js +28 -0
  35. package/package.json +8 -8
  36. package/styles/src/styles.js +14 -3
@@ -5,7 +5,7 @@ import '../navigation/src';
5
5
 
6
6
  function templateString() {
7
7
  return `
8
- ${styles}
8
+ ${styles(this.themeColor)}
9
9
  <style>
10
10
  .camera-permission-screen {
11
11
  padding-block: 2rem;
@@ -32,7 +32,7 @@ function templateString() {
32
32
  }
33
33
  </style>
34
34
  <div class='camera-permission-screen flow center'>
35
- <smileid-navigation ${this.showNavigation ? 'show-navigation' : ''} ${this.hideBack ? 'hide-back' : ''}></smileid-navigation>
35
+ <smileid-navigation theme-color='${this.themeColor}' ${this.showNavigation ? 'show-navigation' : ''} ${this.hideBack ? 'hide-back' : ''}></smileid-navigation>
36
36
  <div class='flow center'>
37
37
  <p class='color-red | center' id='error'>
38
38
  </p>
@@ -127,6 +127,10 @@ class CameraPermission extends HTMLElement {
127
127
  get hideBack() {
128
128
  return this.hasAttribute('hide-back');
129
129
  }
130
+
131
+ get themeColor() {
132
+ return this.getAttribute('theme-color') || '#001096';
133
+ }
130
134
  }
131
135
 
132
136
  if (window.customElements && !window.customElements.get('camera-permission')) {
@@ -1,21 +1,27 @@
1
1
  import './CameraPermission';
2
2
 
3
3
  const meta = {
4
+ args: {
5
+ 'theme-color': '#001096',
6
+ },
7
+ argTypes: {
8
+ 'theme-color': { control: 'color' },
9
+ },
4
10
  component: 'camera-permission',
5
11
  };
6
12
 
7
13
  export default meta;
8
14
 
9
15
  export const CameraPermission = {
10
- render: () => `
11
- <camera-permission>
16
+ render: (args) => `
17
+ <camera-permission theme-color='${args['theme-color']}'>
12
18
  </camera-permission>
13
19
  `,
14
20
  };
15
21
 
16
22
  export const CameraPermissionAtributes = {
17
- render: () => `
18
- <camera-permission show-navigation>
23
+ render: (args) => `
24
+ <camera-permission theme-color='${args['theme-color']}' show-navigation>
19
25
  </camera-permission>
20
26
  `,
21
27
  };
@@ -32,20 +32,22 @@ class DocumentCaptureScreens extends HTMLElement {
32
32
 
33
33
  connectedCallback() {
34
34
  this.innerHTML = `
35
- ${styles}
35
+ ${styles(this.themeColor)}
36
36
  <div>
37
- <document-capture-instructions id='document-capture-instructions-front' ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions ? 'hidden' : ''}></document-capture-instructions>
37
+ <document-capture-instructions theme-color='${this.themeColor}' id='document-capture-instructions-front' ${this.title} ${this.documentCaptureModes} ${this.showNavigation} ${this.hideInstructions ? 'hidden' : ''}></document-capture-instructions>
38
38
  <document-capture id='document-capture-front' side-of-id='Front'
39
39
  ${this.title} ${this.showNavigation} ${this.hideInstructions ? '' : 'hidden'}
40
- ${this.documentCaptureModes} ${this.documentType}
40
+ ${this.documentCaptureModes} ${this.documentType} theme-color='${this.themeColor}'
41
41
  ></document-capture>
42
- <document-capture-instructions id='document-capture-instructions-back' side-of-id='Back' title='Submit Back of ID' ${this.documentCaptureModes} ${this.showNavigation} hidden></document-capture-instructions>
42
+ <document-capture-instructions id='document-capture-instructions-back' side-of-id='Back' title='Submit Back of ID'
43
+ ${this.documentCaptureModes} ${this.showNavigation} theme-color='${this.themeColor}' hidden
44
+ ></document-capture-instructions>
43
45
  <document-capture id='document-capture-back' side-of-id='Back' ${this.title} ${this.showNavigation}
44
- ${this.documentCaptureModes}
46
+ ${this.documentCaptureModes} theme-color='${this.themeColor}'
45
47
  hidden
46
48
  ></document-capture>
47
- <document-capture-review id='front-of-document-capture-review' hidden></document-capture-review>
48
- <document-capture-review id='back-of-document-capture-review' hidden></document-capture-review>
49
+ <document-capture-review id='front-of-document-capture-review' theme-color='${this.themeColor}' hidden></document-capture-review>
50
+ <document-capture-review id='back-of-document-capture-review' theme-color='${this.themeColor}' hidden></document-capture-review>
49
51
  </div>
50
52
  `;
51
53
 
@@ -187,7 +189,7 @@ class DocumentCaptureScreens extends HTMLElement {
187
189
  this.documentInstructionBack.addEventListener(
188
190
  'document-capture-instructions.upload',
189
191
  async (event) => {
190
- this.idReview.setAttribute('data-image', event.detail.image);
192
+ this.backOfIdReview.setAttribute('data-image', event.detail.image);
191
193
  this._data.images.push({
192
194
  image: event.detail.image.split(',')[1],
193
195
  image_type_id: IMAGE_TYPE.ID_CARD_BACK_IMAGE_BASE64,
@@ -196,7 +198,7 @@ class DocumentCaptureScreens extends HTMLElement {
196
198
  },
197
199
  );
198
200
  this.idCaptureBack.addEventListener('document-capture.publish', (event) => {
199
- this.backOfIdReview.setAttribute('data-image', event.detail.image);
201
+ this.backOfIdReview.setAttribute('data-image', event.detail.previewImage);
200
202
  this._data.images.push({
201
203
  image: event.detail.image.split(',')[1],
202
204
  image_type_id: IMAGE_TYPE.ID_CARD_BACK_IMAGE_BASE64,
@@ -292,6 +294,10 @@ class DocumentCaptureScreens extends HTMLElement {
292
294
  : '';
293
295
  }
294
296
 
297
+ get themeColor() {
298
+ return this.getAttribute('theme-color') || '#001096';
299
+ }
300
+
295
301
  handleBackEvents() {
296
302
  this.dispatchEvent(new CustomEvent('document-capture-screens.cancelled'));
297
303
  }
@@ -1,44 +1,48 @@
1
1
  import './index';
2
2
 
3
3
  const meta = {
4
+ args: {
5
+ 'theme-color': '#001096',
6
+ },
7
+ argTypes: {
8
+ 'theme-color': { control: 'color' },
9
+ },
4
10
  component: 'document-capture-screens',
5
11
  };
6
12
 
7
13
  export default meta;
8
14
 
9
15
  export const DocumentCapture = {
10
- render: () => `
11
- <document-capture-screens>
16
+ render: (args) => `
17
+ <document-capture-screens theme-color='${args['theme-color']}'>
12
18
  </document-capture-screens>
13
19
  `,
14
20
  };
15
21
 
16
22
  export const DocumentCaptureHiddenInstructions = {
17
- render: () => `
18
- <document-capture-screens hide-instructions>
23
+ render: (args) => `
24
+ <document-capture-screens hide-instructions theme-color='${args['theme-color']}'>
19
25
  </document-capture-screens>
20
26
  `,
21
27
  };
22
28
 
23
29
  export const DocumentCaptureHideBackOfId = {
24
- render: () => `
25
- <document-capture-screens
26
- hide-back-of-id
27
- >
30
+ render: (args) => `
31
+ <document-capture-screens hide-back-of-id theme-color='${args['theme-color']}'>
28
32
  </document-capture-screens>
29
33
  `,
30
34
  };
31
35
 
32
36
  export const DocumentCaptureAllowAttributes = {
33
- render: () => `
34
- <document-capture-screens document-capture-screens-modes='camera,upload'>
37
+ render: (args) => `
38
+ <document-capture-screens document-capture-screens-modes='camera,upload' theme-color='${args['theme-color']}'>
35
39
  </document-capture-screens>
36
40
  `,
37
41
  };
38
42
 
39
43
  export const DocumentCaptureHideInstructionNBackOfId = {
40
- render: () => `
41
- <document-capture-screens hide-back-of-id hide-instructions>
44
+ render: (args) => `
45
+ <document-capture-screens hide-back-of-id hide-instructions theme-color='${args['theme-color']}'>
42
46
  </document-capture-screens>
43
47
  `,
44
48
  };