@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/Benefits.css ADDED
@@ -0,0 +1,48 @@
1
+ .cid-idp-selector-benefits {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 16px;
5
+ margin: 0;
6
+ padding: 0;
7
+ margin-bottom: 20px;
8
+ list-style: none;
9
+ }
10
+ .cid-idp-selector-benefits--box {
11
+ padding: 22px 14px;
12
+ border-radius: 16px;
13
+ border: 1px solid var(--charcoal);
14
+ background-color: white;
15
+ }
16
+ .cid-idp-selector-benefits--box.cid-idp-selector-benefits--light {
17
+ border: 1px solid white;
18
+ background-color: transparent;
19
+ }
20
+ .cid-idp-selector-benefit {
21
+ display: flex;
22
+ align-items: flex-start;
23
+ font-size: 16px;
24
+ line-height: 20px;
25
+ color: var(--charcoal);
26
+ }
27
+ .cid-idp-selector-benefit.cid-idp-selector-benefit--light {
28
+ color: white;
29
+ }
30
+ .cid-idp-selector-benefit-icon {
31
+ margin-right: 8px;
32
+ top: 2.5px;
33
+ position: relative;
34
+ flex-shrink: 0;
35
+ }
36
+ .cid-idp-selector-benefit-icon path {
37
+ fill: var(--charcoal);
38
+ }
39
+ .cid-idp-selector-benefit.cid-idp-selector-benefit--light .cid-idp-selector-benefit-icon path {
40
+ fill: white;
41
+ }
42
+
43
+ @media (max-width: 744px) {
44
+ .cid-idp-selector-benefit {
45
+ font-size: 14px;
46
+ line-height: 18px;
47
+ }
48
+ }
package/Benefits.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import './Benefits.css';
2
+ export declare const Benefits: React.FC<{
3
+ full: boolean;
4
+ }>;
package/Benefits.js ADDED
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useContext } from 'react';
3
+ import './Benefits.css';
4
+ import { ThemeContext } from './ThemeContext';
5
+ export const Benefits = ({ full }) => {
6
+ const theme = useContext(ThemeContext);
7
+ const defaultBenefits = [
8
+ "Reduce the data you share online by only sharing what's required",
9
+ 'ConnectID does not see or store your personal information',
10
+ ];
11
+ const fullBenefits = [
12
+ 'No banking information is shared',
13
+ 'No document uploads',
14
+ 'Details are only shared with your review and consent',
15
+ 'Accredited by the Australian government as an identity exchange',
16
+ ];
17
+ const listItemClasses = `cid-idp-selector-benefit ${theme === 'light' ? 'cid-idp-selector-benefit--light' : ''}`;
18
+ const benefits = full ? fullBenefits : defaultBenefits;
19
+ return (_jsx("ul", { className: `cid-idp-selector-benefits ${full ? 'cid-idp-selector-benefits--box' : ''} ${theme === 'light' ? 'cid-idp-selector-benefits--light' : ''}`, "data-testid": "benefits", children: benefits.map((benefit) => (_jsxs("li", { className: listItemClasses, "data-testid": "benefit-item", children: [_jsx("svg", { className: "cid-idp-selector-benefit-icon", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.28025 8.71975L14.25 1.75L15.3105 2.8105L7.28025 10.8407L3 6.5605L4.0605 5.5L7.28025 8.71975Z" }) }), benefit] }))) }));
20
+ };
package/CidButton.css ADDED
@@ -0,0 +1,57 @@
1
+ .cid-idp-selector-button {
2
+ min-width: 311px;
3
+ border-radius: 12px;
4
+ padding: 13px 26px;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ cursor: pointer;
9
+ font-family: var(--font);
10
+ font-size: 14px;
11
+ font-weight: 500;
12
+ line-height: 16px;
13
+ border: 1px solid #262626;
14
+ background-color: #262626;
15
+ color: white;
16
+ }
17
+ /* so we do not break current cid buttons */
18
+ .cid-idp-selector-button--type {
19
+ width: 100%;
20
+ }
21
+ .cid-idp-selector-button--large {
22
+ padding: 15px 26px;
23
+ font-size: 16px;
24
+ }
25
+ .cid-idp-selector-button--dark {
26
+ border: 1px solid #262626;
27
+ background-color: #262626;
28
+ color: white;
29
+ }
30
+ .cid-idp-selector-button--light {
31
+ border: 1px solid white;
32
+ background-color: white;
33
+ color: #262626;
34
+ }
35
+ .cid-idp-selector-button-icon {
36
+ margin-right: 8px;
37
+ width: 20px;
38
+ height: 20px;
39
+ flex-shrink: 0;
40
+ }
41
+ .cid-idp-selector-button--large .cid-idp-selector-button-icon {
42
+ width: 24px;
43
+ height: 24px;
44
+ }
45
+ .cid-idp-selector-button--dark .cid-idp-selector-button-icon {
46
+ fill: white;
47
+ }
48
+ .cid-idp-selector-button--light .cid-idp-selector-button-icon {
49
+ fill: #262626;
50
+ }
51
+
52
+ @media (max-width: 488px) {
53
+ .cid-idp-selector-button {
54
+ width: 100%;
55
+ min-width: auto;
56
+ }
57
+ }
package/CidButton.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import './CidButton.css';
2
+ import './global.css';
3
+ import { CertificationStatus, CidButtonLabel, CidButtonSize, CidButtonTheme, CidButtonType, Claim, IntroTextType, LogoMode, RequiredCertification } from './types';
4
+ type CidButtonProps = {
5
+ onProceed: (authorisationServerId: string) => void;
6
+ claims: Claim[];
7
+ requiredClaims?: Claim[];
8
+ rpLogoUrl?: string;
9
+ requiredCertifications?: RequiredCertification[];
10
+ label?: CidButtonLabel;
11
+ size?: CidButtonSize;
12
+ type?: CidButtonType;
13
+ introTextType?: IntroTextType;
14
+ fullProcessCollapsible?: boolean;
15
+ participantsUri?: string;
16
+ certificationStatus?: CertificationStatus;
17
+ rpDataSharingDescription?: string;
18
+ enableManualVerification?: boolean;
19
+ showAllParticipants?: boolean;
20
+ theme?: CidButtonTheme;
21
+ logoLockupStyle?: LogoMode;
22
+ showInfoContent?: boolean;
23
+ onError?: (error: string) => void;
24
+ };
25
+ export declare const CidButton: React.FC<CidButtonProps>;
26
+ export {};
package/CidButton.js ADDED
@@ -0,0 +1,133 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { useEffect, useState } from 'react';
12
+ import useSWR from 'swr';
13
+ import { Benefits } from './Benefits';
14
+ import './CidButton.css';
15
+ import { CidButtonHowItWorks } from './CidButtonHowItWorks';
16
+ import { CidButtonInfo } from './CidButtonInfo';
17
+ import { FullProcess } from './FullProcess';
18
+ import { IdpLogoList } from './IdpLogoList';
19
+ import { IntroText } from './IntroText';
20
+ import { LearnMore } from './LearnMore';
21
+ import { Overlay } from './Overlay';
22
+ import { Popup } from './Popup';
23
+ import { Process } from './Process';
24
+ import { ThemeContext } from './ThemeContext';
25
+ import { useAnalytics } from './analytics';
26
+ import './global.css';
27
+ import { getCurrentUrlOrigin } from './navigator';
28
+ import { isIntroTextTypeValid, isRequiredClaimsValid } from './validator';
29
+ export const CidButton = ({ onProceed, claims, requiredClaims, rpLogoUrl, requiredCertifications, label = 'Verify', size = 'regular', type, introTextType, fullProcessCollapsible = false, participantsUri = 'https://data.directory.connectid.com.au/participants', certificationStatus = 'Active', rpDataSharingDescription = 'Your details will be shared with the current website.', enableManualVerification = false, showAllParticipants = false, theme = 'dark', logoLockupStyle = 'light', showInfoContent = false, onError = () => { }, }) => {
30
+ const { data: participants, error, isLoading, } = useSWR(participantsUri, () => __awaiter(void 0, void 0, void 0, function* () {
31
+ const response = yield fetch(participantsUri);
32
+ if (!response.ok)
33
+ throw new Error(response.statusText);
34
+ return response.json();
35
+ }));
36
+ useAnalytics();
37
+ const [showPopup, setShowPopup] = useState(false);
38
+ const analyticsData = {
39
+ claims,
40
+ rpLogoUrl,
41
+ requiredCertifications,
42
+ buttonLabel: label,
43
+ buttonSize: size,
44
+ type: type,
45
+ participantsUri,
46
+ certificationStatus,
47
+ rpDataSharingDescription,
48
+ enableManualVerification,
49
+ showAllParticipants,
50
+ theme,
51
+ logoLockupStyle,
52
+ showInfoContent,
53
+ rp_sub_brand: getCurrentUrlOrigin(),
54
+ };
55
+ const typeConfigMap = {
56
+ tiny: {
57
+ hasIntro: true,
58
+ hasBenefits: false,
59
+ hasProcess: false,
60
+ hasInfo: true,
61
+ hasHowItWorks: true,
62
+ hasLearnMore: false,
63
+ },
64
+ 'medium benefits': {
65
+ hasIntro: true,
66
+ hasBenefits: true,
67
+ hasProcess: false,
68
+ hasInfo: true,
69
+ hasHowItWorks: true,
70
+ hasLearnMore: false,
71
+ },
72
+ 'medium process': {
73
+ hasIntro: true,
74
+ hasBenefits: false,
75
+ hasProcess: true,
76
+ hasInfo: true,
77
+ hasHowItWorks: false,
78
+ hasLearnMore: true,
79
+ },
80
+ 'full benefits': {
81
+ hasIntro: true,
82
+ hasBenefits: true,
83
+ hasProcess: false,
84
+ hasInfo: false,
85
+ hasHowItWorks: true,
86
+ hasLearnMore: false,
87
+ },
88
+ 'full process': {
89
+ hasIntro: true,
90
+ hasBenefits: false,
91
+ hasProcess: true,
92
+ hasInfo: true,
93
+ hasHowItWorks: false,
94
+ hasLearnMore: true,
95
+ },
96
+ };
97
+ useEffect(() => {
98
+ analytics === null || analytics === void 0 ? void 0 : analytics.track('ConnectID Button Displayed', analyticsData);
99
+ }, []);
100
+ const handleOnProceed = (authorisationServerId, authorisationServerName) => {
101
+ analytics === null || analytics === void 0 ? void 0 : analytics.track('IDP Selected', Object.assign(Object.assign({}, analyticsData), { authorisationServerId, idp_name: authorisationServerName }));
102
+ setShowPopup(false);
103
+ onProceed(authorisationServerId);
104
+ };
105
+ const handleButtonClick = () => {
106
+ setShowPopup(true);
107
+ analytics === null || analytics === void 0 ? void 0 : analytics.track('ConnectID Button Clicked', analyticsData);
108
+ };
109
+ const handleClosePopup = () => {
110
+ setShowPopup(false);
111
+ analytics === null || analytics === void 0 ? void 0 : analytics.track('IDP Selector Popup Close Button Clicked', analyticsData);
112
+ };
113
+ if (!isRequiredClaimsValid(claims, requiredClaims)) {
114
+ const errorMessage = `requiredClaims needs to be a subset of claims. claims: ${claims.join(', ')}; requiredClaims: ${requiredClaims === null || requiredClaims === void 0 ? void 0 : requiredClaims.join(', ')}.`;
115
+ console.log(errorMessage);
116
+ onError(errorMessage);
117
+ return null;
118
+ }
119
+ if (!isIntroTextTypeValid(type, introTextType)) {
120
+ const errorMessage = 'introTextType is required when type is defined.';
121
+ console.log(errorMessage);
122
+ onError(errorMessage);
123
+ return null;
124
+ }
125
+ const ctaText = `${label} with ConnectID`;
126
+ const connectIdButtonTypeConfig = type ? typeConfigMap[type] : undefined;
127
+ return (_jsxs(ThemeContext.Provider, { value: theme, children: [showPopup && (_jsxs(_Fragment, { children: [_jsx(Overlay, { onClick: handleClosePopup }), _jsx(Popup, { onProceed: handleOnProceed, onCancel: handleClosePopup, onError: onError, certificationStatus: certificationStatus, popupTitle: ctaText, requiredCertifications: requiredCertifications, rpLogoUrl: rpLogoUrl, rpDataSharingDescription: rpDataSharingDescription, claims: claims, requiredClaims: requiredClaims, enableManualVerification: enableManualVerification, showAllParticipants: showAllParticipants, participants: participants, error: error, isLoading: isLoading })] })), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasIntro) && introTextType && _jsx(IntroText, { type: introTextType }), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasBenefits) && _jsx(Benefits, { full: type === 'full benefits' }), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasProcess) &&
128
+ (type === 'full process' ? _jsx(FullProcess, { collapsible: fullProcessCollapsible }) : _jsx(Process, {})), _jsxs("button", { className: `
129
+ cid-idp-selector-button cid-idp-selector-button--${theme}
130
+ ${size === 'large' ? 'cid-idp-selector-button--large' : ''}
131
+ ${type || showInfoContent ? 'cid-idp-selector-button--type' : ''}
132
+ `, onClick: handleButtonClick, type: "button", "data-testid": "cid-idp-selector-button", children: [_jsx("svg", { className: "cid-idp-selector-button-icon", viewBox: "0 0 132.37 157.84", children: _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" }) }), ctaText] }), showInfoContent && (_jsxs("div", { className: "cid-show-info-content", "data-testid": "cid-show-info-content", children: [!error && _jsx(IdpLogoList, { loading: isLoading, logoLockupStyle: logoLockupStyle }), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasInfo) && _jsx(CidButtonInfo, {}), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasHowItWorks) && _jsx(CidButtonHowItWorks, {}), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasLearnMore) && _jsx(LearnMore, {})] }))] }));
133
+ };
@@ -0,0 +1,25 @@
1
+ .cid-idp-selector-how-it-works {
2
+ color: var(--charcoal);
3
+ display: flex;
4
+ justify-content: center;
5
+ width: fit-content;
6
+ margin: 0 auto;
7
+ font-size: 14px;
8
+ margin-top: 10px;
9
+ }
10
+
11
+ .cid-idp-selector-how-it-works--light {
12
+ color: white;
13
+ }
14
+
15
+ @media (max-width: 744px) {
16
+ .cid-idp-selector-how-it-works {
17
+ font-size: 13px;
18
+ }
19
+ }
20
+
21
+ @media (max-width: 375px) {
22
+ .cid-idp-selector-how-it-works {
23
+ font-size: 12px;
24
+ }
25
+ }
@@ -0,0 +1,2 @@
1
+ import './CidButtonHowItWorks.css';
2
+ export declare const CidButtonHowItWorks: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAnalytics } from './analytics';
3
+ import { getCurrentUrlOrigin } from './navigator';
4
+ import './CidButtonHowItWorks.css';
5
+ import { ThemeContext } from './ThemeContext';
6
+ import { useContext } from 'react';
7
+ export const CidButtonHowItWorks = () => {
8
+ useAnalytics();
9
+ const theme = useContext(ThemeContext);
10
+ const handleClick = () => {
11
+ if (!analytics)
12
+ return;
13
+ analytics.track('Link to External Page Clicked', {
14
+ source: 'how_does_it_work',
15
+ link_url: 'https://connectid.com.au/#use-cases',
16
+ rp_sub_brand: getCurrentUrlOrigin(),
17
+ });
18
+ };
19
+ return (_jsx("a", { href: "https://connectid.com.au/#use-cases", onClick: handleClick, target: "_blank", tabIndex: 0, className: `cid-idp-selector-how-it-works ${theme === 'light' ? 'cid-idp-selector-how-it-works--light' : ''}`, "data-testid": "how-it-works", children: "How does it work?" }));
20
+ };
@@ -0,0 +1,33 @@
1
+ .cid-idp-selector-button-info {
2
+ color: var(--charcoal);
3
+ font-size: 14px;
4
+ align-items: flex-start;
5
+ justify-content: center;
6
+ text-align: center;
7
+ display: flex;
8
+ line-height: 130%;
9
+ }
10
+ .cid-idp-selector-button-info--light {
11
+ color: white;
12
+ }
13
+ .cid-idp-selector-button-info-icon {
14
+ flex-shrink: 0;
15
+ transform: translateY(2px);
16
+ margin-right: 4px;
17
+ }
18
+ .cid-idp-selector-button-info--light .cid-idp-selector-button-info-icon path {
19
+ stroke: white;
20
+ }
21
+
22
+ @media (max-width: 744px) {
23
+ .cid-idp-selector-button-info {
24
+ font-size: 13px;
25
+ }
26
+ }
27
+
28
+ @media (max-width: 375px) {
29
+ .cid-idp-selector-button-info {
30
+ font-size: 12px;
31
+ line-height: 120%;
32
+ }
33
+ }
@@ -0,0 +1,2 @@
1
+ import './CidButtonInfo.css';
2
+ export declare const CidButtonInfo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import './CidButtonInfo.css';
3
+ import { ThemeContext } from './ThemeContext';
4
+ import { useContext } from 'react';
5
+ export const CidButtonInfo = () => {
6
+ const theme = useContext(ThemeContext);
7
+ return (_jsxs("div", { className: `cid-idp-selector-button-info ${theme === 'light' ? 'cid-idp-selector-button-info--light' : ''}`, "data-testid": "button-info", children: [_jsxs("svg", { className: "cid-idp-selector-button-info-icon", width: "13", height: "13", 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" })] }), "No banking or financial information is shared"] }));
8
+ };
@@ -0,0 +1,150 @@
1
+ .cid-idp-selector-full-process {
2
+ padding: 14px 20px;
3
+ border-radius: 14px;
4
+ background-color: white;
5
+ border: 1px solid var(--charcoal);
6
+ margin-bottom: 20px;
7
+ }
8
+ .cid-idp-selector-full-process.open {
9
+ border: 1px solid var(--charcoal);
10
+ }
11
+ .cid-idp-selector-full-process.close {
12
+ border: 1px solid var(--charcoal50);
13
+ }
14
+
15
+ .cid-idp-selector-full-process.open.light {
16
+ border: 1px solid var(--charcoal10);
17
+ }
18
+ .cid-idp-selector-full-process.close.light {
19
+ border: 1px solid var(--charcoal50);
20
+ }
21
+
22
+ .cid-idp-selector-full-process--light {
23
+ border: 1px solid var(--charcoal50);
24
+ background-color: transparent;
25
+ }
26
+ .cid-idp-selector-full-process-title {
27
+ font-size: 20px;
28
+ color: var(--charcoal);
29
+ margin-bottom: 0;
30
+ display: flex;
31
+ align-items: center;
32
+ justify-content: space-between;
33
+ }
34
+ .cid-idp-selector-full-process--open .cid-idp-selector-full-process-title {
35
+ margin-bottom: 20px;
36
+ }
37
+ .cid-idp-selector-full-process-toggle {
38
+ cursor: pointer;
39
+ }
40
+ .cid-idp-selector-full-process-toggle path {
41
+ fill: var(--charcoal);
42
+ }
43
+ .cid-idp-selector-full-process--light .cid-idp-selector-full-process-toggle path {
44
+ fill: white;
45
+ }
46
+ .cid-idp-selector-full-process--open .cid-idp-selector-full-process-toggle {
47
+ transform: rotate(180deg);
48
+ }
49
+ .cid-idp-selector-full-process--light .cid-idp-selector-full-process-title {
50
+ color: white;
51
+ }
52
+ .cid-idp-selector-full-process-step {
53
+ display: flex;
54
+ align-items: center;
55
+ }
56
+ .cid-idp-selector-full-process-dot {
57
+ width: 11px;
58
+ height: 11px;
59
+ background-color: var(--mint);
60
+ border-radius: 50%;
61
+ border: 1px solid var(--charcoal);
62
+ }
63
+ .cid-idp-selector-full-process-dot-wrapper {
64
+ width: 17px;
65
+ height: 17px;
66
+ background-color: white;
67
+ border-radius: 50%;
68
+ border: 1px solid var(--charcoal);
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ flex-shrink: 0;
73
+ }
74
+ .cid-idp-selector-full-process-line {
75
+ width: 100%;
76
+ height: 1px;
77
+ background-color: var(--charcoal);
78
+ }
79
+ .cid-idp-selector-full-process--light .cid-idp-selector-full-process-line {
80
+ background-color: white;
81
+ }
82
+ .cid-idp-selector-full-process-grid {
83
+ display: none;
84
+ grid-template-columns: 1fr 1fr 132px;
85
+ grid-row-gap: 8px;
86
+ }
87
+ .cid-idp-selector-full-process--open .cid-idp-selector-full-process-grid {
88
+ display: grid;
89
+ }
90
+ .cid-idp-selector-full-process-subtitle {
91
+ max-width: 132px;
92
+ font-size: 14px;
93
+ color: var(--charcoal);
94
+ display: none;
95
+ line-height: 130%;
96
+ margin-right: 26px;
97
+ }
98
+ .cid-idp-selector-full-process--light .cid-idp-selector-full-process-subtitle {
99
+ color: white;
100
+ }
101
+ .cid-idp-selector-full-process-subtitle.cid-idp-selector-full-process-subtitle--wide {
102
+ display: block;
103
+ }
104
+
105
+ @media (max-width: 1280px) {
106
+ .cid-idp-selector-full-process-grid {
107
+ grid-template-columns: 1fr 1fr;
108
+ }
109
+ .cid-idp-selector-full-process-subtitle.cid-idp-selector-full-process-subtitle--wide {
110
+ display: none;
111
+ }
112
+ .cid-idp-selector-full-process-subtitle {
113
+ display: block;
114
+ }
115
+ .cid-idp-selector-full-process-line {
116
+ width: 1px;
117
+ height: 26px;
118
+ background-color: var(--charcoal);
119
+ }
120
+ .cid-idp-selector-full-process-grid {
121
+ grid-template-columns: 19px 1fr;
122
+ column-gap: 8px;
123
+ grid-row-gap: 0;
124
+ }
125
+ .cid-idp-selector-full-process-step {
126
+ flex-direction: column;
127
+ }
128
+ .cid-idp-selector-full-process-subtitle {
129
+ max-width: 100%;
130
+ margin: 0;
131
+ }
132
+ }
133
+
134
+ @media (max-width: 430px) {
135
+ .cid-idp-selector-full-process-title {
136
+ font-size: 18px;
137
+ }
138
+ }
139
+
140
+ @media (max-width: 375px) {
141
+ .cid-idp-selector-full-process-title {
142
+ font-size: 16px;
143
+ }
144
+ }
145
+
146
+ @media(max-width: 320px) {
147
+ .cid-idp-selector-full-process-line {
148
+ height: 35px;
149
+ }
150
+ }
@@ -0,0 +1,4 @@
1
+ import './FullProcess.css';
2
+ export declare const FullProcess: React.FC<{
3
+ collapsible?: boolean;
4
+ }>;
package/FullProcess.js ADDED
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useContext, useState } from 'react';
3
+ import { ThemeContext } from './ThemeContext';
4
+ import './FullProcess.css';
5
+ // on a wide screen the layout is like this
6
+ // .----------.----------.
7
+ // text text text
8
+ //
9
+ // however, when the screen is not wide, the layout is like this
10
+ // . text
11
+ // |
12
+ // |
13
+ // . text
14
+ // |
15
+ // |
16
+ // . text
17
+ export const FullProcess = ({ collapsible = false }) => {
18
+ const theme = useContext(ThemeContext);
19
+ const shouldOpen = collapsible ? false : true;
20
+ const [open, setOpen] = useState(shouldOpen);
21
+ const handleToggle = () => {
22
+ if (!collapsible)
23
+ return;
24
+ setOpen(!open);
25
+ };
26
+ const colorChanged = () => {
27
+ if (collapsible === false) {
28
+ return true;
29
+ }
30
+ if (open === true) {
31
+ return true;
32
+ }
33
+ };
34
+ return (_jsxs("div", { className: `cid-idp-selector-full-process ${theme === 'light' ? 'cid-idp-selector-full-process--light' : ''} ${open ? 'cid-idp-selector-full-process--open' : ''} ${colorChanged() ? 'open' : 'close'} ${theme === 'light' ? 'light' : ''}`, "data-testid": "full-process", children: [_jsxs("div", { className: "cid-idp-selector-full-process-title", children: ["How it works", collapsible && (_jsx("svg", { className: "cid-idp-selector-full-process-toggle", width: "17", height: "17", viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", onClick: handleToggle, "data-testid": "full-process-toggle", children: _jsx("path", { d: "M13.1684 5.3125L13.8125 5.9998L8.5 11.6875L3.1875 5.9998L3.82832 5.3125L8.5 10.3096L13.1684 5.3125Z" }) }))] }), _jsxs("div", { className: "cid-idp-selector-full-process-grid", "data-testid": "full-process-grid", children: [_jsxs("div", { className: "cid-idp-selector-full-process-step", children: [_jsx("div", { className: "cid-idp-selector-full-process-dot-wrapper", children: _jsx("div", { className: "cid-idp-selector-full-process-dot" }) }), _jsx("div", { className: "cid-idp-selector-full-process-line" })] }), _jsx("div", { className: "cid-idp-selector-full-process-subtitle", children: "Select your trusted organisation" }), _jsxs("div", { className: "cid-idp-selector-full-process-step", children: [_jsx("div", { className: "cid-idp-selector-full-process-dot-wrapper", children: _jsx("div", { className: "cid-idp-selector-full-process-dot" }) }), _jsx("div", { className: "cid-idp-selector-full-process-line" })] }), _jsx("div", { className: "cid-idp-selector-full-process-subtitle", children: "Log in to your existing account" }), _jsx("div", { className: "cid-idp-selector-full-process-step", children: _jsx("div", { className: "cid-idp-selector-full-process-dot-wrapper", children: _jsx("div", { className: "cid-idp-selector-full-process-dot" }) }) }), _jsx("div", { className: "cid-idp-selector-full-process-subtitle", children: "Review your details and provide consent" }), _jsx("div", { className: "cid-idp-selector-full-process-subtitle cid-idp-selector-full-process-subtitle--wide", children: "Select your trusted organisation" }), _jsx("div", { className: "cid-idp-selector-full-process-subtitle cid-idp-selector-full-process-subtitle--wide", children: "Log in to your existing account" }), _jsx("div", { className: "cid-idp-selector-full-process-subtitle cid-idp-selector-full-process-subtitle--wide", children: "Review your details and provide consent" })] })] }));
35
+ };
@@ -0,0 +1,53 @@
1
+ .cid-idp-selector-idp-logo-list-wrapper {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ flex-wrap: wrap;
6
+ gap: 8px;
7
+ margin-top: 6px;
8
+ margin-bottom: 12px;
9
+ }
10
+ .cid-idp-selector-idp-logo-list-title {
11
+ font-size: 12px;
12
+ color: var(--charcoal75);
13
+ }
14
+ .cid-idp-selector-idp-logo-list-title.cid-idp-selector-idp-logo-list-title--light {
15
+ color: white;
16
+ }
17
+ .cid-idp-selector-idp-logo-list {
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ gap: 8px;
21
+ }
22
+ .cid-idp-selector-idp-logo-list-logo {
23
+ width: 24px;
24
+ height: 24px;
25
+ border-radius: 2px;
26
+ }
27
+ .cid-idp-selector-idp-logo-list-skeleton-wrapper {
28
+ margin-top: 20px;
29
+ display: flex;
30
+ justify-content: center;
31
+ }
32
+ .cid-logo-lockup {
33
+ width: 264px;
34
+ height: 53.18px;
35
+ }
36
+ @media (max-width: 1440px) {
37
+ .cid-logo-lockup {
38
+ width: 234px;
39
+ height: 47px;
40
+ }
41
+ }
42
+ @media (max-width: 430px) {
43
+ .cid-logo-lockup {
44
+ width: 233.78px;
45
+ height: 45px;
46
+ }
47
+ }
48
+ @media (max-width: 375px) {
49
+ .cid-logo-lockup {
50
+ width: 213px;
51
+ height: 41px;
52
+ }
53
+ }
@@ -0,0 +1,8 @@
1
+ import './IdpLogoList.css';
2
+ import { LogoMode } from './types';
3
+ type IdpLogoListProps = {
4
+ loading: boolean;
5
+ logoLockupStyle?: LogoMode;
6
+ };
7
+ export declare const IdpLogoList: React.FC<IdpLogoListProps>;
8
+ export {};
package/IdpLogoList.js ADDED
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import './IdpLogoList.css';
3
+ import { Skeleton } from './Skeleton';
4
+ const logoLockupUrl = {
5
+ dark: 'https://cdn.connectid.com.au/images/idp-selector/logo-lockup/logo-lockup-dark.svg',
6
+ light: 'https://cdn.connectid.com.au/images/idp-selector/logo-lockup/logo-lockup-light.svg',
7
+ };
8
+ export const IdpLogoList = ({ loading, logoLockupStyle }) => {
9
+ if (loading) {
10
+ return (_jsx("div", { className: "cid-idp-selector-idp-logo-list-skeleton-wrapper", children: _jsx(Skeleton, { height: "24px", width: "120px", dataTestId: "idp-logo-list-loading" }) }));
11
+ }
12
+ return (_jsx("div", { className: "cid-idp-selector-idp-logo-list-wrapper", "data-testid": "idp-logo-list-wrapper", children: logoLockupStyle === 'dark' ? (_jsx("img", { "data-testid": "logo-lockup-dark", className: "cid-logo-lockup", src: logoLockupUrl.dark })) : (_jsx("img", { "data-testid": "logo-lockup-light", className: "cid-logo-lockup", src: logoLockupUrl.light })) }));
13
+ };