@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.
Files changed (61) hide show
  1. package/package.json +58 -58
  2. package/src/components/README.md +14 -14
  3. package/src/components/attribution/PoweredBySmileId.js +42 -42
  4. package/src/components/camera-permission/CameraPermission.js +140 -140
  5. package/src/components/camera-permission/CameraPermission.stories.js +27 -27
  6. package/src/components/combobox/src/Combobox.js +589 -589
  7. package/src/components/combobox/src/index.js +1 -1
  8. package/src/components/document/src/DocumentCaptureScreens.js +409 -409
  9. package/src/components/document/src/DocumentCaptureScreens.stories.js +57 -57
  10. package/src/components/document/src/README.md +111 -111
  11. package/src/components/document/src/document-capture/DocumentCapture.js +760 -760
  12. package/src/components/document/src/document-capture/DocumentCapture.stories.js +78 -78
  13. package/src/components/document/src/document-capture/README.md +90 -90
  14. package/src/components/document/src/document-capture/index.js +3 -3
  15. package/src/components/document/src/document-capture-instructions/DocumentCaptureInstructions.js +499 -499
  16. package/src/components/document/src/document-capture-instructions/DocumentCaptureInstructions.stories.js +24 -24
  17. package/src/components/document/src/document-capture-instructions/README.md +56 -56
  18. package/src/components/document/src/document-capture-instructions/index.js +3 -3
  19. package/src/components/document/src/document-capture-review/DocumentCaptureReview.js +362 -362
  20. package/src/components/document/src/document-capture-review/DocumentCaptureReview.stories.js +24 -24
  21. package/src/components/document/src/document-capture-review/README.md +79 -79
  22. package/src/components/document/src/document-capture-review/index.js +3 -3
  23. package/src/components/document/src/index.js +3 -3
  24. package/src/components/end-user-consent/src/EndUserConsent.js +795 -795
  25. package/src/components/end-user-consent/src/EndUserConsent.stories.js +29 -29
  26. package/src/components/end-user-consent/src/index.js +4 -4
  27. package/src/components/navigation/src/Navigation.js +171 -171
  28. package/src/components/navigation/src/Navigation.stories.js +24 -24
  29. package/src/components/navigation/src/index.js +3 -3
  30. package/src/components/selfie/README.md +225 -225
  31. package/src/components/selfie/src/SelfieCaptureScreens.js +282 -282
  32. package/src/components/selfie/src/SelfieCaptureScreens.stories.js +29 -29
  33. package/src/components/selfie/src/index.js +5 -5
  34. package/src/components/selfie/src/selfie-capture/SelfieCapture.js +1041 -1010
  35. package/src/components/selfie/src/selfie-capture/SelfieCapture.stories.js +36 -36
  36. package/src/components/selfie/src/selfie-capture/index.js +3 -3
  37. package/src/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.js +657 -648
  38. package/src/components/selfie/src/selfie-capture-instructions/SelfieCaptureInstructions.stories.js +23 -23
  39. package/src/components/selfie/src/selfie-capture-instructions/index.js +3 -3
  40. package/src/components/selfie/src/selfie-capture-review/SelfieCaptureReview.js +347 -347
  41. package/src/components/selfie/src/selfie-capture-review/SelfieCaptureReview.stories.js +24 -24
  42. package/src/components/selfie/src/selfie-capture-review/index.js +3 -3
  43. package/src/components/signature-pad/package-lock.json +3009 -3009
  44. package/src/components/signature-pad/package.json +30 -30
  45. package/src/components/signature-pad/src/SignaturePad.js +484 -484
  46. package/src/components/signature-pad/src/SignaturePad.stories.js +32 -32
  47. package/src/components/signature-pad/src/index.js +3 -3
  48. package/src/components/smart-camera-web/src/README.md +207 -207
  49. package/src/components/smart-camera-web/src/SmartCameraWeb.js +299 -299
  50. package/src/components/smart-camera-web/src/SmartCameraWeb.stories.js +57 -57
  51. package/src/components/totp-consent/src/TotpConsent.js +949 -949
  52. package/src/components/totp-consent/src/index.js +4 -4
  53. package/src/domain/camera/src/README.md +38 -38
  54. package/src/domain/camera/src/SmartCamera.js +109 -109
  55. package/src/domain/constants/src/Constants.js +27 -27
  56. package/src/domain/file-upload/README.md +35 -35
  57. package/src/domain/file-upload/src/SmartFileUpload.js +65 -65
  58. package/src/index.js +5 -5
  59. package/src/styles/README.md +3 -3
  60. package/src/styles/src/styles.js +359 -359
  61. package/src/styles/src/typography.js +52 -52
@@ -1,282 +1,282 @@
1
- import './selfie-capture';
2
- import './selfie-capture-instructions';
3
- import './selfie-capture-review';
4
- import SmartCamera from '../../../domain/camera/src/SmartCamera';
5
- import styles from '../../../styles/src/styles';
6
- import packageJson from '../../../../package.json';
7
-
8
- const COMPONENTS_VERSION = packageJson.version;
9
-
10
- const smartCameraWeb = document.querySelector('smart-camera-web');
11
-
12
- async function getPermissions(captureScreen, facingMode = 'user') {
13
- try {
14
- const stream = await SmartCamera.getMedia({
15
- audio: false,
16
- video: { facingMode },
17
- });
18
- const devices = await navigator.mediaDevices.enumerateDevices();
19
- const videoDevice = devices.find(
20
- (device) =>
21
- device.kind === 'videoinput' &&
22
- stream.getVideoTracks()[0].getSettings().deviceId === device.deviceId,
23
- );
24
- smartCameraWeb?.dispatchEvent(
25
- new CustomEvent('metadata.camera-name', {
26
- detail: { cameraName: videoDevice?.label },
27
- }),
28
- );
29
- captureScreen.removeAttribute('data-camera-error');
30
- captureScreen.setAttribute('data-camera-ready', true);
31
- } catch (error) {
32
- captureScreen.removeAttribute('data-camera-ready');
33
- captureScreen.setAttribute(
34
- 'data-camera-error',
35
- SmartCamera.handleCameraError(error),
36
- );
37
- }
38
- }
39
-
40
- class SelfieCaptureScreens extends HTMLElement {
41
- constructor() {
42
- super();
43
- this.activeScreen = null;
44
- smartCameraWeb?.dispatchEvent(new CustomEvent('metadata.initialize'));
45
- }
46
-
47
- connectedCallback() {
48
- this.innerHTML = `
49
- ${styles(this.themeColor)}
50
- <div>
51
- <selfie-capture-instructions theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} ${this.hideBack} hidden></selfie-capture-instructions>
52
- <selfie-capture theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} hidden></selfie-capture>
53
- <selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
54
- </div>
55
- `;
56
-
57
- this._data = {
58
- images: [],
59
- meta: {
60
- libraryVersion: COMPONENTS_VERSION,
61
- },
62
- };
63
-
64
- this.selfieInstruction = this.querySelector('selfie-capture-instructions');
65
- this.selfieCapture = this.querySelector('selfie-capture');
66
- this.selfieReview = this.querySelector('selfie-capture-review');
67
-
68
- if (this.hideInstructions && !this.hasAttribute('hidden')) {
69
- getPermissions(this.selfieCapture, this.getAgentMode());
70
- }
71
-
72
- // If the initial screen is selfie-capture, we need to get permissions
73
- if (this.getAttribute('initial-screen') === 'selfie-capture') {
74
- getPermissions(this.selfieCapture, this.getAgentMode()).then(() =>
75
- this.setActiveScreen(this.selfieCapture),
76
- );
77
- } else if (this.hideInstructions) {
78
- this.setActiveScreen(this.selfieCapture);
79
- } else {
80
- this.setActiveScreen(this.selfieInstruction);
81
- }
82
-
83
- this.setUpEventListeners();
84
- }
85
-
86
- getAgentMode() {
87
- return this.inAgentMode ? 'environment' : 'user';
88
- }
89
-
90
- disconnectedCallback() {
91
- SmartCamera.stopMedia();
92
- if (this.activeScreen) {
93
- this.activeScreen.removeAttribute('hidden');
94
- }
95
- this.activeScreen = null;
96
- this.innerHTML = '';
97
- }
98
-
99
- setUpEventListeners() {
100
- this.selfieInstruction.addEventListener(
101
- 'selfie-capture-instructions.capture',
102
- async () => {
103
- await getPermissions(this.selfieCapture, this.getAgentMode()).then(() =>
104
- this.setActiveScreen(this.selfieCapture),
105
- );
106
- smartCameraWeb?.dispatchEvent(
107
- new CustomEvent('metadata.selfie-capture-start'),
108
- );
109
- smartCameraWeb?.dispatchEvent(
110
- new CustomEvent('metadata.selfie-origin', {
111
- detail: {
112
- imageOrigin: {
113
- environment: 'back_camera',
114
- user: 'front_camera',
115
- }[this.getAgentMode()],
116
- },
117
- }),
118
- );
119
- },
120
- );
121
- this.selfieInstruction.addEventListener(
122
- 'selfie-capture-instructions.cancelled',
123
- () => {
124
- this.handleBackEvents();
125
- },
126
- );
127
-
128
- this.selfieCapture.addEventListener('selfie-capture.cancelled', () => {
129
- this.selfieCapture.reset();
130
- SmartCamera.stopMedia();
131
- if (this.hideInstructions) {
132
- this.handleBackEvents();
133
- return;
134
- }
135
-
136
- this.setActiveScreen(this.selfieInstruction);
137
- });
138
-
139
- this.selfieCapture.addEventListener('selfie-capture.publish', (event) => {
140
- smartCameraWeb?.dispatchEvent(
141
- new CustomEvent('metadata.selfie-capture-end'),
142
- );
143
- this.selfieReview.setAttribute('data-image', event.detail.referenceImage);
144
- this._data.images = event.detail.images;
145
- SmartCamera.stopMedia();
146
- this.setActiveScreen(this.selfieReview);
147
- });
148
-
149
- this.selfieReview.addEventListener(
150
- 'selfie-capture-review.rejected',
151
- async () => {
152
- smartCameraWeb?.dispatchEvent(
153
- new CustomEvent('metadata.selfie-capture-retry'),
154
- );
155
- this.selfieReview.removeAttribute('data-image');
156
- this._data.images = [];
157
- if (this.hideInstructions) {
158
- this.setActiveScreen(this.selfieCapture);
159
- await getPermissions(this.selfieCapture, this.getAgentMode());
160
- } else {
161
- this.setActiveScreen(this.selfieInstruction);
162
- }
163
- },
164
- );
165
-
166
- this.selfieReview.addEventListener(
167
- 'selfie-capture-review.accepted',
168
- async () => {
169
- this._publishSelectedImages();
170
- },
171
- );
172
-
173
- [this.selfieInstruction, this.selfieCapture, this.selfieReview].forEach(
174
- (screen) => {
175
- screen.addEventListener(
176
- `${screen.nodeName.toLowerCase()}.close`,
177
- () => {
178
- this.handleCloseEvent();
179
- },
180
- );
181
- },
182
- );
183
- }
184
-
185
- _publishSelectedImages() {
186
- this.dispatchEvent(
187
- new CustomEvent('selfie-capture-screens.publish', { detail: this._data }),
188
- );
189
- }
190
-
191
- get hideInstructions() {
192
- return this.hasAttribute('hide-instructions');
193
- }
194
-
195
- get hideAttribution() {
196
- return this.hasAttribute('hide-attribution') ? 'hide-attribution' : '';
197
- }
198
-
199
- get hideBackOfId() {
200
- return this.hasAttribute('hide-back-of-id');
201
- }
202
-
203
- get showNavigation() {
204
- return this.hasAttribute('show-navigation') ? 'show-navigation' : '';
205
- }
206
-
207
- get inAgentMode() {
208
- return this.getAttribute('allow-agent-mode') === 'true';
209
- }
210
-
211
- get allowAgentMode() {
212
- return this.inAgentMode ? "allow-agent-mode='true'" : '';
213
- }
214
-
215
- get allowAgentModeTests() {
216
- return this.hasAttribute('show-agent-mode-for-tests')
217
- ? 'show-agent-mode-for-tests'
218
- : '';
219
- }
220
-
221
- get hideBack() {
222
- return this.hasAttribute('hide-back-to-host') ||
223
- this.hasAttribute('hide-back')
224
- ? 'hide-back'
225
- : '';
226
- }
227
-
228
- get disableImageTests() {
229
- return this.hasAttribute('disable-image-tests')
230
- ? 'disable-image-tests'
231
- : '';
232
- }
233
-
234
- get themeColor() {
235
- return this.getAttribute('theme-color') || '#001096';
236
- }
237
-
238
- setActiveScreen(screen) {
239
- this.activeScreen?.setAttribute('hidden', '');
240
- screen.removeAttribute('hidden');
241
- this.activeScreen = screen;
242
- }
243
-
244
- handleBackEvents() {
245
- this.dispatchEvent(new CustomEvent('selfie-capture-screens.cancelled'));
246
- }
247
-
248
- handleCloseEvent() {
249
- this.dispatchEvent(new CustomEvent('selfie-capture-screens.close'));
250
- }
251
-
252
- static get observedAttributes() {
253
- return [
254
- 'title',
255
- 'hidden',
256
- 'show-navigation',
257
- 'hide-back-to-host',
258
- 'initial-screen',
259
- ];
260
- }
261
-
262
- attributeChangedCallback(name) {
263
- switch (name) {
264
- case 'title':
265
- case 'hidden':
266
- case 'initial-screen':
267
- this.connectedCallback();
268
- break;
269
- default:
270
- break;
271
- }
272
- }
273
- }
274
-
275
- if (
276
- 'customElements' in window &&
277
- !customElements.get('selfie-capture-screens')
278
- ) {
279
- customElements.define('selfie-capture-screens', SelfieCaptureScreens);
280
- }
281
-
282
- export default SelfieCaptureScreens;
1
+ import './selfie-capture';
2
+ import './selfie-capture-instructions';
3
+ import './selfie-capture-review';
4
+ import SmartCamera from '../../../domain/camera/src/SmartCamera';
5
+ import styles from '../../../styles/src/styles';
6
+ import packageJson from '../../../../package.json';
7
+
8
+ const COMPONENTS_VERSION = packageJson.version;
9
+
10
+ const smartCameraWeb = document.querySelector('smart-camera-web');
11
+
12
+ async function getPermissions(captureScreen, facingMode = 'user') {
13
+ try {
14
+ const stream = await SmartCamera.getMedia({
15
+ audio: false,
16
+ video: { facingMode },
17
+ });
18
+ const devices = await navigator.mediaDevices.enumerateDevices();
19
+ const videoDevice = devices.find(
20
+ (device) =>
21
+ device.kind === 'videoinput' &&
22
+ stream.getVideoTracks()[0].getSettings().deviceId === device.deviceId,
23
+ );
24
+ smartCameraWeb?.dispatchEvent(
25
+ new CustomEvent('metadata.camera-name', {
26
+ detail: { cameraName: videoDevice?.label },
27
+ }),
28
+ );
29
+ captureScreen.removeAttribute('data-camera-error');
30
+ captureScreen.setAttribute('data-camera-ready', true);
31
+ } catch (error) {
32
+ captureScreen.removeAttribute('data-camera-ready');
33
+ captureScreen.setAttribute(
34
+ 'data-camera-error',
35
+ SmartCamera.handleCameraError(error),
36
+ );
37
+ }
38
+ }
39
+
40
+ class SelfieCaptureScreens extends HTMLElement {
41
+ constructor() {
42
+ super();
43
+ this.activeScreen = null;
44
+ smartCameraWeb?.dispatchEvent(new CustomEvent('metadata.initialize'));
45
+ }
46
+
47
+ connectedCallback() {
48
+ this.innerHTML = `
49
+ ${styles(this.themeColor)}
50
+ <div>
51
+ <selfie-capture-instructions theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} ${this.hideBack} hidden></selfie-capture-instructions>
52
+ <selfie-capture theme-color='${this.themeColor}' ${this.showNavigation} ${this.allowAgentMode} ${this.allowAgentModeTests} ${this.hideAttribution} ${this.disableImageTests} hidden></selfie-capture>
53
+ <selfie-capture-review theme-color='${this.themeColor}' ${this.showNavigation} ${this.hideAttribution} hidden></selfie-capture-review>
54
+ </div>
55
+ `;
56
+
57
+ this._data = {
58
+ images: [],
59
+ meta: {
60
+ libraryVersion: COMPONENTS_VERSION,
61
+ },
62
+ };
63
+
64
+ this.selfieInstruction = this.querySelector('selfie-capture-instructions');
65
+ this.selfieCapture = this.querySelector('selfie-capture');
66
+ this.selfieReview = this.querySelector('selfie-capture-review');
67
+
68
+ if (this.hideInstructions && !this.hasAttribute('hidden')) {
69
+ getPermissions(this.selfieCapture, this.getAgentMode());
70
+ }
71
+
72
+ // If the initial screen is selfie-capture, we need to get permissions
73
+ if (this.getAttribute('initial-screen') === 'selfie-capture') {
74
+ getPermissions(this.selfieCapture, this.getAgentMode()).then(() =>
75
+ this.setActiveScreen(this.selfieCapture),
76
+ );
77
+ } else if (this.hideInstructions) {
78
+ this.setActiveScreen(this.selfieCapture);
79
+ } else {
80
+ this.setActiveScreen(this.selfieInstruction);
81
+ }
82
+
83
+ this.setUpEventListeners();
84
+ }
85
+
86
+ getAgentMode() {
87
+ return this.inAgentMode ? 'environment' : 'user';
88
+ }
89
+
90
+ disconnectedCallback() {
91
+ SmartCamera.stopMedia();
92
+ if (this.activeScreen) {
93
+ this.activeScreen.removeAttribute('hidden');
94
+ }
95
+ this.activeScreen = null;
96
+ this.innerHTML = '';
97
+ }
98
+
99
+ setUpEventListeners() {
100
+ this.selfieInstruction.addEventListener(
101
+ 'selfie-capture-instructions.capture',
102
+ async () => {
103
+ await getPermissions(this.selfieCapture, this.getAgentMode()).then(() =>
104
+ this.setActiveScreen(this.selfieCapture),
105
+ );
106
+ smartCameraWeb?.dispatchEvent(
107
+ new CustomEvent('metadata.selfie-capture-start'),
108
+ );
109
+ smartCameraWeb?.dispatchEvent(
110
+ new CustomEvent('metadata.selfie-origin', {
111
+ detail: {
112
+ imageOrigin: {
113
+ environment: 'back_camera',
114
+ user: 'front_camera',
115
+ }[this.getAgentMode()],
116
+ },
117
+ }),
118
+ );
119
+ },
120
+ );
121
+ this.selfieInstruction.addEventListener(
122
+ 'selfie-capture-instructions.cancelled',
123
+ () => {
124
+ this.handleBackEvents();
125
+ },
126
+ );
127
+
128
+ this.selfieCapture.addEventListener('selfie-capture.cancelled', () => {
129
+ this.selfieCapture.reset();
130
+ SmartCamera.stopMedia();
131
+ if (this.hideInstructions) {
132
+ this.handleBackEvents();
133
+ return;
134
+ }
135
+
136
+ this.setActiveScreen(this.selfieInstruction);
137
+ });
138
+
139
+ this.selfieCapture.addEventListener('selfie-capture.publish', (event) => {
140
+ smartCameraWeb?.dispatchEvent(
141
+ new CustomEvent('metadata.selfie-capture-end'),
142
+ );
143
+ this.selfieReview.setAttribute('data-image', event.detail.referenceImage);
144
+ this._data.images = event.detail.images;
145
+ SmartCamera.stopMedia();
146
+ this.setActiveScreen(this.selfieReview);
147
+ });
148
+
149
+ this.selfieReview.addEventListener(
150
+ 'selfie-capture-review.rejected',
151
+ async () => {
152
+ smartCameraWeb?.dispatchEvent(
153
+ new CustomEvent('metadata.selfie-capture-retry'),
154
+ );
155
+ this.selfieReview.removeAttribute('data-image');
156
+ this._data.images = [];
157
+ if (this.hideInstructions) {
158
+ this.setActiveScreen(this.selfieCapture);
159
+ await getPermissions(this.selfieCapture, this.getAgentMode());
160
+ } else {
161
+ this.setActiveScreen(this.selfieInstruction);
162
+ }
163
+ },
164
+ );
165
+
166
+ this.selfieReview.addEventListener(
167
+ 'selfie-capture-review.accepted',
168
+ async () => {
169
+ this._publishSelectedImages();
170
+ },
171
+ );
172
+
173
+ [this.selfieInstruction, this.selfieCapture, this.selfieReview].forEach(
174
+ (screen) => {
175
+ screen.addEventListener(
176
+ `${screen.nodeName.toLowerCase()}.close`,
177
+ () => {
178
+ this.handleCloseEvent();
179
+ },
180
+ );
181
+ },
182
+ );
183
+ }
184
+
185
+ _publishSelectedImages() {
186
+ this.dispatchEvent(
187
+ new CustomEvent('selfie-capture-screens.publish', { detail: this._data }),
188
+ );
189
+ }
190
+
191
+ get hideInstructions() {
192
+ return this.hasAttribute('hide-instructions');
193
+ }
194
+
195
+ get hideAttribution() {
196
+ return this.hasAttribute('hide-attribution') ? 'hide-attribution' : '';
197
+ }
198
+
199
+ get hideBackOfId() {
200
+ return this.hasAttribute('hide-back-of-id');
201
+ }
202
+
203
+ get showNavigation() {
204
+ return this.hasAttribute('show-navigation') ? 'show-navigation' : '';
205
+ }
206
+
207
+ get inAgentMode() {
208
+ return this.getAttribute('allow-agent-mode') === 'true';
209
+ }
210
+
211
+ get allowAgentMode() {
212
+ return this.inAgentMode ? "allow-agent-mode='true'" : '';
213
+ }
214
+
215
+ get allowAgentModeTests() {
216
+ return this.hasAttribute('show-agent-mode-for-tests')
217
+ ? 'show-agent-mode-for-tests'
218
+ : '';
219
+ }
220
+
221
+ get hideBack() {
222
+ return this.hasAttribute('hide-back-to-host') ||
223
+ this.hasAttribute('hide-back')
224
+ ? 'hide-back'
225
+ : '';
226
+ }
227
+
228
+ get disableImageTests() {
229
+ return this.hasAttribute('disable-image-tests')
230
+ ? 'disable-image-tests'
231
+ : '';
232
+ }
233
+
234
+ get themeColor() {
235
+ return this.getAttribute('theme-color') || '#001096';
236
+ }
237
+
238
+ setActiveScreen(screen) {
239
+ this.activeScreen?.setAttribute('hidden', '');
240
+ screen.removeAttribute('hidden');
241
+ this.activeScreen = screen;
242
+ }
243
+
244
+ handleBackEvents() {
245
+ this.dispatchEvent(new CustomEvent('selfie-capture-screens.cancelled'));
246
+ }
247
+
248
+ handleCloseEvent() {
249
+ this.dispatchEvent(new CustomEvent('selfie-capture-screens.close'));
250
+ }
251
+
252
+ static get observedAttributes() {
253
+ return [
254
+ 'title',
255
+ 'hidden',
256
+ 'show-navigation',
257
+ 'hide-back-to-host',
258
+ 'initial-screen',
259
+ ];
260
+ }
261
+
262
+ attributeChangedCallback(name) {
263
+ switch (name) {
264
+ case 'title':
265
+ case 'hidden':
266
+ case 'initial-screen':
267
+ this.connectedCallback();
268
+ break;
269
+ default:
270
+ break;
271
+ }
272
+ }
273
+ }
274
+
275
+ if (
276
+ 'customElements' in window &&
277
+ !customElements.get('selfie-capture-screens')
278
+ ) {
279
+ customElements.define('selfie-capture-screens', SelfieCaptureScreens);
280
+ }
281
+
282
+ export default SelfieCaptureScreens;
@@ -1,29 +1,29 @@
1
- import './SelfieCaptureScreens';
2
-
3
- const meta = {
4
- args: {
5
- 'hide-attribution': false,
6
- 'theme-color': '#001096',
7
- },
8
- argTypes: {
9
- 'hide-attribution': { control: 'boolean' },
10
- 'theme-color': { control: 'color' },
11
- },
12
- component: 'selfie-capture-screens',
13
- };
14
-
15
- export default meta;
16
-
17
- export const SelfieCaptureFlow = {
18
- render: (args) => `
19
- <selfie-capture-screens theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
20
- </selfie-capture-screens>
21
- `,
22
- };
23
-
24
- export const SelfieCaptureFlowHiddenInstructions = {
25
- render: (args) => `
26
- <selfie-capture-screens hide-instructions theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
27
- </selfie-capture-screens>
28
- `,
29
- };
1
+ import './SelfieCaptureScreens';
2
+
3
+ const meta = {
4
+ args: {
5
+ 'hide-attribution': false,
6
+ 'theme-color': '#001096',
7
+ },
8
+ argTypes: {
9
+ 'hide-attribution': { control: 'boolean' },
10
+ 'theme-color': { control: 'color' },
11
+ },
12
+ component: 'selfie-capture-screens',
13
+ };
14
+
15
+ export default meta;
16
+
17
+ export const SelfieCaptureFlow = {
18
+ render: (args) => `
19
+ <selfie-capture-screens theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
20
+ </selfie-capture-screens>
21
+ `,
22
+ };
23
+
24
+ export const SelfieCaptureFlowHiddenInstructions = {
25
+ render: (args) => `
26
+ <selfie-capture-screens hide-instructions theme-color='${args['theme-color']}' ${args['hide-attribution'] ? 'hide-attribution' : ''}>
27
+ </selfie-capture-screens>
28
+ `,
29
+ };
@@ -1,5 +1,5 @@
1
- import SelfieCaptureScreens from './SelfieCaptureScreens';
2
- import SelfieCapture from './selfie-capture/SelfieCapture';
3
-
4
- export default SelfieCaptureScreens;
5
- export { SelfieCapture };
1
+ import SelfieCaptureScreens from './SelfieCaptureScreens';
2
+ import SelfieCapture from './selfie-capture/SelfieCapture';
3
+
4
+ export default SelfieCaptureScreens;
5
+ export { SelfieCapture };