@connectid-tools/idp-selector-react 6.4.1

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 (70) hide show
  1. package/Benefits.css +48 -0
  2. package/Benefits.d.ts +4 -0
  3. package/Benefits.js +20 -0
  4. package/CidButton.css +57 -0
  5. package/CidButton.d.ts +26 -0
  6. package/CidButton.js +133 -0
  7. package/CidButtonHowItWorks.css +25 -0
  8. package/CidButtonHowItWorks.d.ts +2 -0
  9. package/CidButtonHowItWorks.js +20 -0
  10. package/CidButtonInfo.css +33 -0
  11. package/CidButtonInfo.d.ts +2 -0
  12. package/CidButtonInfo.js +8 -0
  13. package/FullProcess.css +150 -0
  14. package/FullProcess.d.ts +4 -0
  15. package/FullProcess.js +35 -0
  16. package/IdpLogoList.css +53 -0
  17. package/IdpLogoList.d.ts +8 -0
  18. package/IdpLogoList.js +13 -0
  19. package/InfoBox.css +49 -0
  20. package/InfoBox.d.ts +9 -0
  21. package/InfoBox.js +12 -0
  22. package/IntroText.css +24 -0
  23. package/IntroText.d.ts +5 -0
  24. package/IntroText.js +14 -0
  25. package/LearnMore.css +27 -0
  26. package/LearnMore.d.ts +2 -0
  27. package/LearnMore.js +20 -0
  28. package/NoIdpError.d.ts +6 -0
  29. package/NoIdpError.js +12 -0
  30. package/Overlay.css +9 -0
  31. package/Overlay.d.ts +6 -0
  32. package/Overlay.js +6 -0
  33. package/ParticipantsLoader.css +50 -0
  34. package/ParticipantsLoader.d.ts +2 -0
  35. package/ParticipantsLoader.js +12 -0
  36. package/Popup.css +457 -0
  37. package/Popup.d.ts +22 -0
  38. package/Popup.js +137 -0
  39. package/Process.css +51 -0
  40. package/Process.d.ts +2 -0
  41. package/Process.js +12 -0
  42. package/README.md +633 -0
  43. package/Skeleton.css +27 -0
  44. package/Skeleton.d.ts +10 -0
  45. package/Skeleton.js +5 -0
  46. package/TabHook.d.ts +2 -0
  47. package/TabHook.js +37 -0
  48. package/ThemeContext.d.ts +2 -0
  49. package/ThemeContext.js +2 -0
  50. package/analytics.d.ts +1 -0
  51. package/analytics.js +88 -0
  52. package/certification.d.ts +8 -0
  53. package/certification.js +103 -0
  54. package/certification.test.d.ts +1 -0
  55. package/certification.test.js +387 -0
  56. package/global.css +11 -0
  57. package/index.d.ts +1 -0
  58. package/index.js +1 -0
  59. package/license +201 -0
  60. package/navigator.d.ts +1 -0
  61. package/navigator.js +1 -0
  62. package/package.json +46 -0
  63. package/types.d.ts +41 -0
  64. package/types.js +1 -0
  65. package/userAgent.d.ts +2 -0
  66. package/userAgent.js +10 -0
  67. package/validator.d.ts +3 -0
  68. package/validator.js +12 -0
  69. package/validator.test.d.ts +1 -0
  70. package/validator.test.js +36 -0
package/Popup.css ADDED
@@ -0,0 +1,457 @@
1
+ @keyframes fade {
2
+ 50% { background: white; }
3
+ }
4
+
5
+ .cid-idp-selector-popup {
6
+ background: white;
7
+ box-shadow: 0 10px 10px -1px rgba(0, 0, 0, 0.2);
8
+ position: fixed;
9
+ top: 0;
10
+ right: 0;
11
+ z-index: 99;
12
+ overflow-y: auto;
13
+ -ms-overflow-style: none;
14
+ scrollbar-width: none;
15
+ padding: 60px 120px;
16
+ box-sizing: border-box;
17
+ height: 100vh;
18
+ }
19
+
20
+ .cid-idp-selector-popup::-webkit-scrollbar {
21
+ display: none;
22
+ }
23
+ .cid-idp-selector-popup-close {
24
+ padding: 12px;
25
+ border-radius: 12px;
26
+ background-color: #F4F4F4;
27
+ color: var(--charcoal);
28
+ font-size: 13px;
29
+ font-family: var(--font);
30
+ display: flex;
31
+ align-items: center;
32
+ cursor: pointer;
33
+ border: none;
34
+ }
35
+ .cid-idp-selector-popup-close:hover {
36
+ background-color: #C9C9C9;
37
+ }
38
+ .cid-idp-selector-popup-close > svg {
39
+ fill: black;
40
+ margin-left: 4px;
41
+ width: 16px;
42
+ height: 16px;
43
+ }
44
+ .cid-idp-selector-popup-logo-container {
45
+ display: flex;
46
+ position: relative;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ margin-bottom: 30px;
50
+ }
51
+ .cid-idp-selector-popup-logos {
52
+ display: flex;
53
+ align-items: center;
54
+ }
55
+ .cid-idp-selector-popup-logo {
56
+ background: var(--charcoal);
57
+ fill: white;
58
+ padding: 8px;
59
+ display: flex;
60
+ align-items: center;
61
+ flex-shrink: 0;
62
+ width: 72px;
63
+ height: 72px;
64
+ box-sizing: border-box;
65
+ border-radius: 12px;
66
+ }
67
+ .cid-idp-selector-popup-logo-dots {
68
+ display: flex;
69
+ margin: 0 8px;
70
+ }
71
+ .cid-idp-selector-popup-logo-dots > div:nth-child(1) {
72
+ background: grey;
73
+ }
74
+ .cid-idp-selector-popup-logo-dots > div:nth-child(2) {
75
+ margin: 0 12px;
76
+ background: darkgrey;
77
+ animation-delay: 0.25s;
78
+ }
79
+ .cid-idp-selector-popup-logo-dots > div:nth-child(3) {
80
+ background: lightgrey;
81
+ animation-delay: 0.5s;
82
+ }
83
+ .cid-idp-selector-popup-logo-dot {
84
+ animation-name: fade;
85
+ animation-duration: 1.5s;
86
+ animation-iteration-count: 3;
87
+ border-radius: 50%;
88
+ width: 8px;
89
+ height: 8px;
90
+ }
91
+ .cid-idp-selector-popup-logo-rp {
92
+ width: 72px;
93
+ height: 72px;
94
+ border-radius: 12px;
95
+ }
96
+ .cid-idp-selector-popup-title {
97
+ font-family: var(--font);
98
+ font-size: 36px;
99
+ color: var(--charcoal);
100
+ font-weight: bold;
101
+ margin: 0;
102
+ margin-bottom: 8px;
103
+ }
104
+ .cid-idp-selector-popup-description {
105
+ font-size: 13px;
106
+ line-height: 16px;
107
+ color: #5C5C5C;
108
+ font-family: var(--font);
109
+ margin: 0;
110
+ margin-bottom: 30px;
111
+ }
112
+ .cid-idp-selector-popup-title-container {
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: space-between;
116
+ }
117
+ .cid-idp-selector-popup-subtitle {
118
+ font-family: var(--font);
119
+ font-size: 24px;
120
+ line-height: 28px;
121
+ color: var(--charcoal);
122
+ font-weight: bold;
123
+ margin: 0;
124
+ }
125
+ .cid-idp-selector-popup-claims-toggle {
126
+ display: none;
127
+ fill: var(--charcoal);
128
+ }
129
+ .cid-idp-selector-popup-claims-toggle--open {
130
+ transform: rotate(180deg);
131
+ }
132
+ .cid-idp-selector-popup-claims {
133
+ display: grid;
134
+ grid-template-columns: repeat(auto-fit, 165px);
135
+ grid-gap: 10px;
136
+ margin-top: 20px;
137
+ margin-bottom: 30px;
138
+ padding-left: 0;
139
+ }
140
+ .cid-idp-selector-popup-claims.cid-idp-selector-popup-claims--visible {
141
+ display: grid;
142
+ }
143
+ .cid-idp-selector-popup-claim {
144
+ font-family: var(--font);
145
+ font-size: 14px;
146
+ color: var(--charcoal);
147
+ display: flex;
148
+ align-items: flex-start;
149
+ text-align: left;
150
+ }
151
+ .cid-idp-selector-popup-claim > svg {
152
+ margin-right: 8px;
153
+ flex-shrink: 0;
154
+ }
155
+ .cid-idp-selector-popup-participants {
156
+ margin-top: 24px;
157
+ display: grid;
158
+ grid-template-columns: 225px 225px;
159
+ grid-gap: 16px;
160
+ max-height: 285px;
161
+ overflow-y: auto;
162
+ padding-left: 0;
163
+ }
164
+ .cid-idp-selector-popup-participants::-webkit-scrollbar {
165
+ display: none;
166
+ }
167
+ .cid-idp-selector-popup-participant {
168
+ display: flex;
169
+ align-items: center;
170
+ border-radius: 12px;
171
+ cursor: pointer;
172
+ box-sizing: border-box;
173
+ padding: 8px 16px;
174
+ border: 1px solid #E9E9E9;
175
+ }
176
+ .cid-idp-selector-popup-participant-greyed-out {
177
+ display: flex;
178
+ align-items: center;
179
+ border-radius: 12px;
180
+ cursor: pointer;
181
+ box-sizing: border-box;
182
+ padding: 8px 16px;
183
+ border: 1px solid #E9E9E9;
184
+ background-color: #F4F4F4;
185
+ cursor: default;
186
+ margin-bottom: 4px;
187
+ }
188
+ .cid-idp-selector-popup-participant-greyed-out-text {
189
+ color: #5C5C5C;
190
+ font-size: 10px;
191
+ }
192
+ .cid-idp-selector-popup-participant-icon {
193
+ width: 32px;
194
+ height: 32px;
195
+ border-radius: 8px;
196
+ }
197
+ .cid-idp-selector-popup-participant-icon-greyed-out {
198
+ width: 32px;
199
+ height: 32px;
200
+ border-radius: 8px;
201
+ opacity: 60%
202
+ }
203
+ .cid-idp-selector-popup-participant-description {
204
+ position: absolute;
205
+ width: 1px;
206
+ height: 1px;
207
+ margin: -1px;
208
+ padding: 0;
209
+ border: 0;
210
+ clip: rect(0 0 0 0);
211
+ overflow: hidden;
212
+ white-space: nowrap;
213
+ }
214
+ .cid-idp-selector-popup-participant:hover {
215
+ border: 1px solid lightgrey;
216
+ }
217
+ .cid-idp-selector-popup-participant-name {
218
+ font-size: 14px;
219
+ font-family: var(--font);
220
+ color: var(--charcoal);
221
+ margin-left: 12px;
222
+ overflow: hidden;
223
+ white-space: nowrap;
224
+ text-overflow: ellipsis;
225
+ width: 90%;
226
+ }
227
+ .cid-idp-selector-popup-participant-name-greyed-out {
228
+ font-size: 14px;
229
+ font-family: var(--font);
230
+ color: var(--charcoal75);
231
+ margin-left: 12px;
232
+ overflow: hidden;
233
+ white-space: nowrap;
234
+ text-overflow: ellipsis;
235
+ width: 90%;
236
+
237
+ }
238
+ .cid-idp-selector-popup-manual {
239
+ font-family: var(--font);
240
+ margin: 0;
241
+ margin-top: 30px;
242
+ text-align: center;
243
+ }
244
+ .cid-idp-selector-popup-manual-title {
245
+ color: #5C5C5C;
246
+ display: block;
247
+ }
248
+ .cid-idp-selector-popup-manual-action {
249
+ color: var(--charcoal);
250
+ font-weight: bold;
251
+ text-decoration: underline;
252
+ cursor: pointer;
253
+ display: block;
254
+ margin-top: 4px;
255
+ }
256
+ .cid-idp-selector-popup-manual-description {
257
+ font-size: 12px;
258
+ color: #5C5C5C;
259
+ display: block;
260
+ margin: 20px auto 0 auto;
261
+ max-width: 300px;
262
+ }
263
+ .cid-idp-selector-popup-info-box-error-wrapper {
264
+ margin-top: 24px;
265
+ }
266
+ .cid-idp-selector-popup-info-box-title {
267
+ font-family: var(--font);
268
+ font-size: 16px;
269
+ font-weight: bold;
270
+ margin: 0;
271
+ margin-bottom: 4px;
272
+ color: var(--charcoal);
273
+ }
274
+ .cid-idp-selector-popup-info-box-text {
275
+ margin: 0;
276
+ font-size: 13px;
277
+ font-family: var(--font);
278
+ color: var(--charcoal);
279
+ line-height: 16px;
280
+ }
281
+ .cid-idp-selector-popup-info-box-link {
282
+ color: var(--charcoal);
283
+ font-size: 13px;
284
+ font-weight: bold;
285
+ width: fit-content;
286
+ text-decoration: none;
287
+ }
288
+ .cid-idp-selector-popup-info-box-wrapper {
289
+ padding-top: 24px;
290
+ max-width: 466px;
291
+ }
292
+
293
+ .cid-idp-selector-popup-info-box-wrapper-warn {
294
+ max-width: 466px;
295
+ }
296
+
297
+ .cid-greyout-participant-name {
298
+ position: absolute;
299
+ display: inline-flex;
300
+ flex-direction: row;
301
+ align-items: center;
302
+ }
303
+
304
+ .cid-idp-selector-button-info-icon-greyed-out {
305
+ margin-right: 2px;
306
+ flex-shrink: 0;
307
+ }
308
+
309
+ @media (prefers-reduced-motion: reduce) {
310
+ .cid-idp-selector-popup-logo-dot {
311
+ animation: none;
312
+ }
313
+ }
314
+
315
+ @media (max-width: 768px) {
316
+ .cid-idp-selector-popup {
317
+ width: 100%;
318
+ padding: 32px;
319
+ }
320
+ .cid-idp-selector-popup-manual {
321
+ text-align: left;
322
+ }
323
+ .cid-idp-selector-popup-manual-description {
324
+ margin: 20px 0;
325
+ }
326
+ .cid-idp-selector-popup-participants {
327
+ grid-template-columns: 190px 190px;
328
+ }
329
+ }
330
+
331
+ @media (max-width: 482px) {
332
+ @keyframes fade {
333
+ 50% { background: #F4F4F4; }
334
+ }
335
+
336
+ .cid-idp-selector-popup-manual {
337
+ text-align: center;
338
+ }
339
+ .cid-idp-selector-popup-manual-title {
340
+ font-size: 14px;
341
+ }
342
+ .cid-idp-selector-popup-manual-action {
343
+ background-color: transparent;
344
+ width: 100%;
345
+ text-align: center;
346
+ padding: 12px;
347
+ box-sizing: border-box;
348
+ border-radius: 12px;
349
+ font-size: 14px;
350
+ font-family: var(--font);
351
+ font-weight: normal;
352
+ text-decoration: none;
353
+ margin-top: 12px;
354
+ border: 1px solid #8C8C8C;
355
+ color: var(--charcoal);
356
+ }
357
+ .cid-idp-selector-popup-manual-description {
358
+ margin: 20px auto 0 auto;
359
+ }
360
+ .cid-idp-selector-popup-participants {
361
+ margin-top: 12px;
362
+ grid-template-columns: 1fr;
363
+ }
364
+ .cid-idp-selector-popup-participant-greyed-out {
365
+ margin-bottom: 8px;
366
+ }
367
+ .cid-idp-selector-popup-participant-name {
368
+ overflow: inherit;
369
+ white-space: normal;
370
+ text-overflow: inherit;
371
+ width: 100%;
372
+ font-size: 16px;
373
+ }
374
+ .cid-greyout-participant-name {
375
+ margin-top: -6px;
376
+ }
377
+ .cid-idp-selector-popup-close {
378
+ position: absolute;
379
+ padding: 8px;
380
+ right: 0;
381
+ }
382
+ .cid-idp-selector-popup-close-label {
383
+ display: none;
384
+ }
385
+ .cid-idp-selector-popup-close > svg {
386
+ margin-left: 0;
387
+ }
388
+ .cid-idp-selector-popup-claims-toggle {
389
+ display: block;
390
+ }
391
+ .cid-idp-selector-popup-logo {
392
+ width: 56px;
393
+ height: 56px;
394
+ }
395
+ .cid-idp-selector-popup-logos {
396
+ justify-content: center;
397
+ }
398
+ .cid-idp-selector-popup-logo-container {
399
+ margin-bottom: 12px;
400
+ justify-content: center;
401
+ }
402
+ .cid-idp-selector-popup-title-description-container {
403
+ text-align: center;
404
+ }
405
+ .cid-idp-selector-popup-logo-dots {
406
+ margin: 0 6px;
407
+ }
408
+ .cid-idp-selector-popup-logo-dots > div:nth-child(2) {
409
+ margin: 0 8px;
410
+ background: darkgrey;
411
+ }
412
+ .cid-idp-selector-popup-logo-dot {
413
+ width: 6px;
414
+ height: 6px;
415
+ }
416
+ .cid-idp-selector-popup-logo-rp {
417
+ width: 56px;
418
+ height: 56px;
419
+ }
420
+ .cid-idp-selector-popup-claims {
421
+ grid-template-columns: repeat(auto-fit, 118px);
422
+ display: none;
423
+ margin-top: 12px;
424
+ margin-bottom: 0;
425
+ }
426
+ .cid-idp-selector-popup-title {
427
+ font-size: 26px;
428
+ }
429
+ .cid-idp-selector-popup-subtitle {
430
+ font-size: 18px;
431
+ }
432
+ .cid-idp-selector-popup {
433
+ background-color: #F4F4F4;
434
+ }
435
+ .cid-idp-selector-popup-provider-wrapper {
436
+ background-color: white;
437
+ padding: 20px;
438
+ border-radius: 12px;
439
+ }
440
+ .cid-idp-selector-popup-claims-button-wrapper {
441
+ padding: 20px;
442
+ background-color: white;
443
+ border-radius: 12px;
444
+ margin-bottom: 20px;
445
+ }
446
+ .cid-idp-selector-popup-claims-button {
447
+ background-color: white;
448
+ border: 0;
449
+ display: flex;
450
+ align-items: center;
451
+ justify-content: space-between;
452
+ width: 100%;
453
+ }
454
+ .cid-idp-selector-popup-info-box-error-wrapper {
455
+ margin-top: 12px;
456
+ }
457
+ }
package/Popup.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import './global.css';
2
+ import './Popup.css';
3
+ import { CertificationStatus, Claim, Participant, RequiredCertification } from './types';
4
+ type PopupProps = {
5
+ onProceed: (authorisationServerId: string, authorisationServerName: string) => void;
6
+ onCancel: () => void;
7
+ onError?: (error: string) => void;
8
+ claims: Claim[];
9
+ requiredClaims?: Claim[];
10
+ showAllParticipants: boolean;
11
+ certificationStatus: CertificationStatus;
12
+ popupTitle: string;
13
+ rpDataSharingDescription: string;
14
+ enableManualVerification: boolean;
15
+ requiredCertifications?: RequiredCertification[];
16
+ rpLogoUrl?: string;
17
+ participants?: Participant[];
18
+ error: boolean;
19
+ isLoading: boolean;
20
+ };
21
+ export declare const Popup: React.FC<PopupProps>;
22
+ export {};
package/Popup.js ADDED
@@ -0,0 +1,137 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import ReactDOM from 'react-dom';
4
+ import { useMediaQuery } from 'react-responsive';
5
+ import { useAnalytics } from './analytics';
6
+ import { filterAuthorisationServers, getManualAuthorisationServer, mapAuthorisationServerToDeviceType, } from './certification';
7
+ import './global.css';
8
+ import { InfoBox } from './InfoBox';
9
+ import { getCurrentUrlOrigin } from './navigator';
10
+ import { NoIdpError } from './NoIdpError';
11
+ import { ParticipantsLoader } from './ParticipantsLoader';
12
+ import './Popup.css';
13
+ import { useOverrideShiftTab, useOverrideTab } from './TabHook';
14
+ import { getDeviceType } from './userAgent';
15
+ export const Popup = ({ onProceed, onCancel, onError, claims, requiredClaims, showAllParticipants, certificationStatus, popupTitle, rpDataSharingDescription, enableManualVerification, requiredCertifications, rpLogoUrl, participants, error, isLoading, }) => {
16
+ const [showClaims, setShowClaims] = useState(false); // mobile only
17
+ const popupRef = useRef(null);
18
+ useAnalytics();
19
+ const isMobile = useMediaQuery({ query: '(max-width: 482px)' });
20
+ const infoboxLinkRef = useRef(null);
21
+ const closeButtonRef = useRef(null);
22
+ useOverrideTab(infoboxLinkRef, closeButtonRef);
23
+ useOverrideShiftTab(closeButtonRef, infoboxLinkRef);
24
+ useEffect(() => {
25
+ var _a;
26
+ (_a = popupRef.current) === null || _a === void 0 ? void 0 : _a.focus();
27
+ }, []);
28
+ const claimsOrder = {
29
+ given_name: 2,
30
+ middle_name: 3,
31
+ family_name: 4,
32
+ birthdate: 5,
33
+ email: 6,
34
+ address: 7,
35
+ phone_number: 8,
36
+ over16: 9,
37
+ over18: 10,
38
+ over21: 11,
39
+ over25: 12,
40
+ over65: 13,
41
+ beneficiary_account_au: 14,
42
+ beneficiary_account_au_payid: 15,
43
+ beneficiary_account_international: 16,
44
+ };
45
+ const claimsDescription = {
46
+ address: 'Residential address',
47
+ birthdate: 'Date of birth',
48
+ email: 'Email address',
49
+ family_name: 'Family name',
50
+ given_name: 'Given name',
51
+ middle_name: 'Middle name',
52
+ phone_number: 'Phone number',
53
+ over16: '16+ verification',
54
+ over18: '18+ verification',
55
+ over21: '21+ verification',
56
+ over25: '25+ verification',
57
+ over65: '65+ verification',
58
+ beneficiary_account_au: 'Bank account details',
59
+ beneficiary_account_au_payid: 'PayID',
60
+ beneficiary_account_international: 'International account',
61
+ };
62
+ const sortClaims = (claims) => {
63
+ const sortedClaims = [...claims];
64
+ return sortedClaims.sort((claim1, claim2) => claimsOrder[claim1] - claimsOrder[claim2]);
65
+ };
66
+ const handleEnterEsc = (event) => {
67
+ if (event.key !== 'Enter' && event.key !== 'Escape')
68
+ return;
69
+ if (event.key === 'Escape') {
70
+ onCancel();
71
+ return;
72
+ }
73
+ const activeElement = document.activeElement;
74
+ if (!activeElement)
75
+ return;
76
+ // Handling 'Enter' key
77
+ const classList = activeElement.classList;
78
+ if (classList.contains('cid-idp-selector-popup-participant') ||
79
+ classList.contains('cid-idp-selector-popup-manual-action')) {
80
+ activeElement.click();
81
+ }
82
+ };
83
+ const handleConnectIdLinkClicked = () => {
84
+ analytics === null || analytics === void 0 ? void 0 : analytics.track('Link to External Page Clicked', {
85
+ source: 'what_is_connectid',
86
+ link_url: 'https://www.connectid.com.au',
87
+ rp_sub_brand: getCurrentUrlOrigin(),
88
+ });
89
+ };
90
+ const renderClaimList = () => {
91
+ return (_jsx("ul", { id: "cid-idp-selector-popup-claims", className: `cid-idp-selector-popup-claims ${showClaims ? 'cid-idp-selector-popup-claims--visible' : ''}`, "data-testid": "claims", children: sortClaims(claims).map((claim) => (_jsxs("li", { className: "cid-idp-selector-popup-claim", "data-testid": `claim-${claim}`, children: [_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16Z", fill: "#BEEDD2" }), _jsx("path", { d: "M4.81445 8.14121L6.95437 10.2811L11.472 5.76465", stroke: "#262626", strokeWidth: "1.7", strokeLinecap: "round" })] }), claimsDescription[claim]] }, claim))) }));
92
+ };
93
+ const renderClaimsTitle = () => {
94
+ return (_jsxs(_Fragment, { children: [_jsx("h3", { className: "cid-idp-selector-popup-subtitle", children: "Details requested" }), _jsx("svg", { className: `cid-idp-selector-popup-claims-toggle ${showClaims ? 'cid-idp-selector-popup-claims-toggle--open' : ''}`, xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 24 24", children: _jsx("path", { d: "M0 7.33l2.829-2.83 9.175 9.339 9.167-9.339 2.829 2.83-11.996 12.17z" }) })] }));
95
+ };
96
+ const renderClaims = () => {
97
+ if (!claims)
98
+ return null;
99
+ if (isMobile) {
100
+ return (_jsxs("div", { className: "cid-idp-selector-popup-claims-button-wrapper", children: [_jsx("button", { className: "cid-idp-selector-popup-claims-button", onClick: () => setShowClaims(!showClaims), "aria-expanded": showClaims, "aria-controls": "cid-idp-selector-popup-claims", "data-testid": "claims-button", children: renderClaimsTitle() }), renderClaimList()] }));
101
+ }
102
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "cid-idp-selector-popup-title-container", children: renderClaimsTitle() }), renderClaimList()] }));
103
+ };
104
+ const participantTile = (AuthorisationServerId, CustomerFriendlyName, CustomerFriendlyLogoUri, deviceType) => {
105
+ if (deviceType === 'desktop') {
106
+ return (_jsxs("div", { children: [_jsx("span", { id: `participant-greyed-out-description-${CustomerFriendlyName}`, className: "cid-idp-selector-popup-participant-description", "aria-hidden": "true", children: "available on mobile only" }), _jsxs("li", { "data-testid": "participant-greyed-out", className: "cid-idp-selector-popup-participant-greyed-out", "aria-disabled": "true", "aria-describedby": `participant-greyed-out-description-${CustomerFriendlyName}`, tabIndex: 0, children: [_jsx("img", { className: "cid-idp-selector-popup-participant-icon-greyed-out", src: CustomerFriendlyLogoUri, alt: `${CustomerFriendlyName} logo` }), _jsx("div", { className: "cid-idp-selector-popup-participant-name-greyed-out", title: CustomerFriendlyName, "data-testid": "participant-name", children: CustomerFriendlyName })] }, AuthorisationServerId), _jsxs("div", { className: "cid-greyout-participant-name", children: [_jsxs("svg", { className: "cid-idp-selector-button-info-icon-greyed-out", width: "8", height: "8", viewBox: "0 0 13 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M6.53509 12.3572C9.59207 12.3572 12.0702 9.81483 12.0702 6.67859C12.0702 3.54239 9.59207 1 6.53509 1C3.47814 1 1 3.54239 1 6.67859C1 9.81483 3.47814 12.3572 6.53509 12.3572Z", stroke: "#262626", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M5.25781 9.29883H7.81247", stroke: "#262626", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M6.53515 4.49472C6.7703 4.49472 6.96093 4.29915 6.96093 4.05791C6.96093 3.81666 6.7703 3.62109 6.53515 3.62109C6.3 3.62109 6.10938 3.81666 6.10938 4.05791C6.10938 4.29915 6.3 4.49472 6.53515 4.49472Z", fill: "#262626", stroke: "#262626", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M6.53515 9.29989V6.24219H5.68359", stroke: "#262626", strokeLinecap: "round", strokeLinejoin: "round" })] }), _jsx("div", { "data-testid": "cid-greyout-participant-name-mobile-only", className: "cid-idp-selector-popup-participant-greyed-out-text", "aria-describedby": `participant-greyed-out-description-${CustomerFriendlyName}`, children: "Available on mobile only" })] })] }));
107
+ }
108
+ else {
109
+ return (_jsxs("li", { "data-testid": "participant", className: "cid-idp-selector-popup-participant", tabIndex: 0, onClick: () => onProceed(AuthorisationServerId, CustomerFriendlyName), children: [_jsx("img", { className: "cid-idp-selector-popup-participant-icon", src: CustomerFriendlyLogoUri, alt: `${CustomerFriendlyName} logo` }), _jsx("div", { className: "cid-idp-selector-popup-participant-name", title: CustomerFriendlyName, "data-testid": "participant-name", children: CustomerFriendlyName })] }, AuthorisationServerId));
110
+ }
111
+ };
112
+ const renderAuthorisationServers = () => {
113
+ if (isLoading) {
114
+ return (_jsxs("div", { className: "cid-idp-selector-popup-provider-wrapper", children: [_jsx("h3", { className: "cid-idp-selector-popup-subtitle", children: "Choose a provider" }), _jsx(ParticipantsLoader, {})] }));
115
+ }
116
+ if (error) {
117
+ if (onError) {
118
+ onError('Unable to load participants');
119
+ }
120
+ return (_jsx("div", { className: "cid-idp-selector-popup-info-box-wrapper-warn", children: _jsx(NoIdpError, { dataTestId: "participant-error", hasManualIdp: false }) }));
121
+ }
122
+ const authorisationServers = participants
123
+ .map((participant) => participant.AuthorisationServers)
124
+ .flat()
125
+ .sort((authServer1, authServer2) => authServer1.CustomerFriendlyName.localeCompare(authServer2.CustomerFriendlyName));
126
+ const manualAuthorisationServer = getManualAuthorisationServer(authorisationServers, showAllParticipants);
127
+ const authorisationServersWithoutManual = authorisationServers.filter(({ AuthorisationServerId }) => AuthorisationServerId !== (manualAuthorisationServer === null || manualAuthorisationServer === void 0 ? void 0 : manualAuthorisationServer.AuthorisationServerId));
128
+ const filterByClaims = requiredClaims || claims;
129
+ const filteredAuthorisationServers = filterAuthorisationServers(authorisationServersWithoutManual, showAllParticipants, certificationStatus, filterByClaims, requiredCertifications);
130
+ const filteredAuthServerByDevice = mapAuthorisationServerToDeviceType(filteredAuthorisationServers, getDeviceType());
131
+ const hasManualIdp = enableManualVerification && !!manualAuthorisationServer;
132
+ return (_jsxs(_Fragment, { children: [filteredAuthorisationServers.length > 0 ? (_jsxs("div", { className: "cid-idp-selector-popup-provider-wrapper", children: [_jsx("h3", { className: "cid-idp-selector-popup-subtitle", children: "Choose a provider" }), _jsx("ul", { className: "cid-idp-selector-popup-participants", "data-testid": "participants", children: Array.from(filteredAuthServerByDevice.entries()).map(([authServer, device]) => {
133
+ return (_jsx("div", { children: participantTile(authServer.AuthorisationServerId, authServer.CustomerFriendlyName, authServer.CustomerFriendlyLogoUri, device) }, authServer.AuthorisationServerId));
134
+ }) })] })) : (_jsx("div", { className: "cid-idp-selector-popup-info-box-error-wrapper", "data-testid": "popup-error-info-box", children: _jsx(NoIdpError, { hasManualIdp: hasManualIdp }) })), enableManualVerification && manualAuthorisationServer && (_jsx(_Fragment, { children: _jsxs("p", { className: "cid-idp-selector-popup-manual", children: [_jsx("span", { className: "cid-idp-selector-popup-manual-title", children: "Can't see a provider that works for you?" }), _jsx("span", { className: "cid-idp-selector-popup-manual-action", tabIndex: 0, onClick: () => onProceed(manualAuthorisationServer.AuthorisationServerId, manualAuthorisationServer.CustomerFriendlyName), "data-testid": "manual-verification-action", role: "link", children: "Confirm your identity with a document" }), _jsx("span", { className: "cid-idp-selector-popup-manual-description", children: "ConnectID does not collect, hold or store your personal information at any time." })] }) }))] }));
135
+ };
136
+ return ReactDOM.createPortal(_jsxs("div", { className: "cid-idp-selector-popup", tabIndex: 0, ref: popupRef, onKeyDown: handleEnterEsc, children: [_jsxs("div", { className: "cid-idp-selector-popup-logo-container", children: [_jsxs("div", { className: "cid-idp-selector-popup-logos", children: [_jsxs("svg", { role: "img", focusable: "false", className: "cid-idp-selector-popup-logo", viewBox: "0 0 132.37 157.84", "data-testid": "cid-logo", children: [_jsx("title", { children: "ConnectID logo" }), _jsx("path", { d: "M102.22,91.65c0,19.9-16.13,36.03-36.03,36.03s-36.03-16.13-36.03-36.03,16.13-36.03,36.03-36.03c9.95,0,18.96,4.03,25.48,10.55l40.71-40.71c-6.52-6.52-10.55-15.52-10.55-25.46h-30.14c0,13.45,4.02,25.95,10.92,36.39-10.45-6.9-22.96-10.93-36.42-10.93C29.63,25.47,0,55.1,0,91.65s29.63,66.19,66.19,66.19,66.19-29.63,66.19-66.19h-30.16Z" })] }), rpLogoUrl && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "cid-idp-selector-popup-logo-dots", children: [_jsx("div", { className: "cid-idp-selector-popup-logo-dot" }), _jsx("div", { className: "cid-idp-selector-popup-logo-dot" }), _jsx("div", { className: "cid-idp-selector-popup-logo-dot" })] }), _jsx("img", { className: "cid-idp-selector-popup-logo-rp", src: rpLogoUrl, alt: "RP logo", "data-testid": "rp-logo" })] }))] }), _jsxs("button", { "aria-label": "Close popup", "data-testid": "popup-close", className: "cid-idp-selector-popup-close", onClick: onCancel, tabIndex: 0, ref: closeButtonRef, children: [_jsx("span", { className: "cid-idp-selector-popup-close-label", children: "Close" }), _jsx("svg", { clipRule: "evenodd", fillRule: "evenodd", strokeLinejoin: "round", strokeMiterlimit: "2", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "m12 10.93 5.719-5.72c.146-.146.339-.219.531-.219.404 0 .75.324.75.749 0 .193-.073.385-.219.532l-5.72 5.719 5.719 5.719c.147.147.22.339.22.531 0 .427-.349.75-.75.75-.192 0-.385-.073-.531-.219l-5.719-5.719-5.719 5.719c-.146.146-.339.219-.531.219-.401 0-.75-.323-.75-.75 0-.192.073-.384.22-.531l5.719-5.719-5.72-5.719c-.146-.147-.219-.339-.219-.532 0-.425.346-.749.75-.749.192 0 .385.073.531.219z" }) })] })] }), _jsxs("div", { className: "cid-idp-selector-popup-title-description-container", children: [_jsx("h2", { className: "cid-idp-selector-popup-title", children: popupTitle }), _jsx("p", { className: "cid-idp-selector-popup-description", children: rpDataSharingDescription })] }), renderClaims(), renderAuthorisationServers(), _jsx("div", { className: "cid-idp-selector-popup-info-box-wrapper", children: _jsxs(InfoBox, { children: [_jsx("h4", { className: "cid-idp-selector-popup-info-box-title", children: "What is ConnectID?" }), _jsxs("p", { className: "cid-idp-selector-popup-info-box-text", "data-testid": "whats-cid-text", children: ["ConnectID is an Australian-owned digital identity solution which allows you to securely prove who you are. ConnectID does not see or store your personal data. Visit", ' ', _jsx("a", { className: "cid-idp-selector-popup-info-box-link", href: "https://www.connectid.com.au", onClick: handleConnectIdLinkClicked, target: "_blank", tabIndex: 0, "data-testid": "info-box-link", ref: infoboxLinkRef, children: "connectid.com.au" }), ' ', "to find out more."] })] }) })] }), document.querySelector('body'));
137
+ };
package/Process.css ADDED
@@ -0,0 +1,51 @@
1
+ .cid-idp-selector-process {
2
+ display: grid;
3
+ grid-template-columns: 6px 1fr;
4
+ column-gap: 8px;
5
+ margin-top: -12px;
6
+ margin-bottom: 9px;
7
+ }
8
+ .cid-idp-selector-process-dot {
9
+ width: 7px;
10
+ height: 7px;
11
+ background-color: var(--charcoal);
12
+ }
13
+ .cid-idp-selector-process-dot--grey {
14
+ background-color: var(--charcoal50);
15
+ }
16
+ .cid-idp-selector-process-line {
17
+ width: 1px;
18
+ height: calc(100% / 2 - 3.5px);
19
+ background-color: var(--charcoal);
20
+ margin-left: 3px;
21
+ }
22
+ .cid-idp-selector-process-line--grey {
23
+ background-color: var(--charcoal50);
24
+ }
25
+ .cid-idp-selector-process-filler {
26
+ height: calc(100% / 2 - 3.5px);
27
+ background-color: transparent;
28
+ }
29
+ .cid-idp-selector-process-step {
30
+ font-size: 16px;
31
+ color: var(--charcoal);
32
+ padding: 8px 0;
33
+ line-height: 130%;
34
+ }
35
+ .cid-idp-selector-process-step--light {
36
+ color: white;
37
+ }
38
+ .cid-idp-selector-process-line-last {
39
+ width: 1px;
40
+ height: 13.5px;
41
+ background-color: var(--charcoal);
42
+ margin-left: 3px;
43
+ }
44
+ .cid-idp-selector-process-line-last--grey {
45
+ background-color: var(--charcoal50);
46
+ }
47
+ @media (max-width: 744px) {
48
+ .cid-idp-selector-process-step {
49
+ font-size: 14px;
50
+ }
51
+ }
package/Process.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import './Process.css';
2
+ export declare const Process: () => import("react/jsx-runtime").JSX.Element;
package/Process.js ADDED
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
3
+ import './Process.css';
4
+ import { ThemeContext } from './ThemeContext';
5
+ export const Process = () => {
6
+ const theme = useContext(ThemeContext);
7
+ const dotClasses = `cid-idp-selector-process-dot ${theme === 'light' ? 'cid-idp-selector-process-dot--grey' : ''}`;
8
+ const lineClasses = `cid-idp-selector-process-line ${theme === 'light' ? 'cid-idp-selector-process-line--grey' : ''}`;
9
+ const lastLineClass = `cid-idp-selector-process-line-last ${theme === 'light' ? 'cid-idp-selector-process-line-last--grey' : ''}`;
10
+ const stepClasses = `cid-idp-selector-process-step ${theme === 'light' ? 'cid-idp-selector-process-step--light' : ''}`;
11
+ return (_jsxs("div", { className: "cid-idp-selector-process", "data-testid": "process", children: [_jsxs("div", { children: [_jsx("div", { className: "cid-idp-selector-process-filler" }), _jsx("div", { className: dotClasses, "data-testid": "process-dot" }), _jsx("div", { className: lineClasses, "data-testid": "process-line" })] }), _jsx("div", { className: stepClasses, "data-testid": "process-step", children: "Select your bank" }), _jsxs("div", { children: [_jsx("div", { className: lineClasses }), _jsx("div", { className: dotClasses }), _jsx("div", { className: lineClasses })] }), _jsx("div", { className: stepClasses, children: "Log in to your account" }), _jsxs("div", { children: [_jsx("div", { className: lastLineClass }), _jsx("div", { className: dotClasses }), _jsx("div", { className: "cid-idp-selector-process-filler" })] }), _jsx("div", { className: stepClasses, children: "Review your details and provide consent" })] }));
12
+ };