@connectid-tools/idp-selector-react 6.10.0-alpha.9 → 6.11.0-alpha.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.
- package/Benefits.d.ts +2 -2
- package/Benefits.js +14 -14
- package/CidButton.css +5 -0
- package/CidButton.d.ts +3 -3
- package/CidButton.js +68 -59
- package/CidButtonHowItWorks.js +9 -9
- package/CidButtonInfo.js +4 -4
- package/FullProcess.js +4 -4
- package/IdpLogoList.css +7 -37
- package/IdpLogoList.d.ts +2 -2
- package/IdpLogoList.js +8 -12
- package/IntroText.d.ts +2 -2
- package/IntroText.js +11 -11
- package/LearnMore.js +9 -9
- package/NoIdpError.js +3 -3
- package/Popup.d.ts +3 -3
- package/Popup.js +54 -44
- package/Process.css +5 -2
- package/Process.js +8 -8
- package/README.md +36 -1
- package/ThemeContext.d.ts +1 -1
- package/analytics.d.ts +1 -1
- package/certification.d.ts +1 -1
- package/certification.js +15 -15
- package/certification.test.js +225 -225
- package/compatibility.d.ts +1 -1
- package/compatibility.test.js +25 -25
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +5 -4
- package/userAgent.d.ts +1 -1
- package/validator.d.ts +1 -1
- package/validator.test.js +20 -20
package/Benefits.d.ts
CHANGED
package/Benefits.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext } from
|
|
3
|
-
import
|
|
4
|
-
import { ThemeContext } from
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import "./Benefits.css";
|
|
4
|
+
import { ThemeContext } from "./ThemeContext.js";
|
|
5
5
|
export const Benefits = ({ full, introTextType }) => {
|
|
6
6
|
const theme = useContext(ThemeContext);
|
|
7
7
|
const defaultBenefits = [
|
|
8
8
|
"Reduce the data you share online by only sharing what's required",
|
|
9
|
-
|
|
9
|
+
"ConnectID does not see or store your personal information",
|
|
10
10
|
];
|
|
11
11
|
const fullBenefits = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
16
|
];
|
|
17
17
|
const fullBenefitsBankDetails = [
|
|
18
18
|
"ConnectID doesn't see or store your information",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
"No document uploads",
|
|
20
|
+
"Details are only shared with your review and consent",
|
|
21
|
+
"Accredited by the Australian government as an identity exchange",
|
|
22
22
|
];
|
|
23
|
-
const bankDetailsIntroTextTypes = [
|
|
23
|
+
const bankDetailsIntroTextTypes = ["bank-details-plus-personal-info", "bank-details-only"];
|
|
24
24
|
const adjustedFullBenefits = bankDetailsIntroTextTypes.includes(introTextType) ? fullBenefitsBankDetails : fullBenefits;
|
|
25
|
-
const listItemClasses = `cid-idp-selector-benefit ${theme ===
|
|
25
|
+
const listItemClasses = `cid-idp-selector-benefit ${theme === "light" ? "cid-idp-selector-benefit--light" : ""}`;
|
|
26
26
|
const benefits = full ? adjustedFullBenefits : defaultBenefits;
|
|
27
|
-
return (_jsx("ul", { className: `cid-idp-selector-benefits ${full ?
|
|
27
|
+
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] }, benefit))) }));
|
|
28
28
|
};
|
package/CidButton.css
CHANGED
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
background-color: #262626;
|
|
15
15
|
color: white;
|
|
16
16
|
}
|
|
17
|
+
.cid-idp-selector-button:focus-visible {
|
|
18
|
+
outline: 3px solid #1a73e8;
|
|
19
|
+
box-shadow: 0 0 0 6px white;
|
|
20
|
+
outline-offset: 0.2rem;
|
|
21
|
+
}
|
|
17
22
|
/* so we do not break current cid buttons */
|
|
18
23
|
.cid-idp-selector-button--type {
|
|
19
24
|
width: 100%;
|
package/CidButton.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Browser, CertificationStatus, CidButtonLabel, CidButtonSize, CidButtonTheme, CidButtonType, Claim, CompatibilityWarnings, IntroTextType, LogoMode, RequiredCertification } from
|
|
1
|
+
import "./CidButton.css";
|
|
2
|
+
import "./global.css";
|
|
3
|
+
import { Browser, CertificationStatus, CidButtonLabel, CidButtonSize, CidButtonTheme, CidButtonType, Claim, CompatibilityWarnings, IntroTextType, LogoMode, RequiredCertification } from "./types.js";
|
|
4
4
|
type CidButtonProps = {
|
|
5
5
|
onProceed: (authorisationServerId: string, compatibilityWarnings: CompatibilityWarnings) => void;
|
|
6
6
|
claims: Claim[];
|
package/CidButton.js
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try {
|
|
5
|
-
|
|
4
|
+
function fulfilled(value) { try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
}
|
|
7
|
+
catch (e) {
|
|
8
|
+
reject(e);
|
|
9
|
+
} }
|
|
10
|
+
function rejected(value) { try {
|
|
11
|
+
step(generator["throw"](value));
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
} }
|
|
6
16
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
17
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
18
|
});
|
|
9
19
|
};
|
|
10
20
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { useEffect, useState } from
|
|
12
|
-
import useSWR from
|
|
13
|
-
import { Benefits } from
|
|
14
|
-
import
|
|
15
|
-
import { CidButtonHowItWorks } from
|
|
16
|
-
import { CidButtonInfo } from
|
|
17
|
-
import { FullProcess } from
|
|
18
|
-
import { IdpLogoList } from
|
|
19
|
-
import { IntroText } from
|
|
20
|
-
import { LearnMore } from
|
|
21
|
-
import { Overlay } from
|
|
22
|
-
import { Popup } from
|
|
23
|
-
import { Process } from
|
|
24
|
-
import { ThemeContext } from
|
|
25
|
-
import { initialiseAnalytics } from
|
|
26
|
-
import
|
|
27
|
-
import { getCurrentUrlOrigin } from
|
|
28
|
-
import { isIntroTextTypeValid, isRequiredClaimsValid } from
|
|
29
|
-
import detectIncognito from
|
|
30
|
-
import { getBrowserName, getDeviceType, isAndroid, isIos } from
|
|
31
|
-
import { hasCertification } from
|
|
32
|
-
import { getCompatibility } from
|
|
33
|
-
export const CidButton = ({ onProceed, claims, requiredClaims, rpLogoUrl, requiredCertifications, label =
|
|
21
|
+
import { useEffect, useState } from "react";
|
|
22
|
+
import useSWR from "swr";
|
|
23
|
+
import { Benefits } from "./Benefits.js";
|
|
24
|
+
import "./CidButton.css";
|
|
25
|
+
import { CidButtonHowItWorks } from "./CidButtonHowItWorks.js";
|
|
26
|
+
import { CidButtonInfo } from "./CidButtonInfo.js";
|
|
27
|
+
import { FullProcess } from "./FullProcess.js";
|
|
28
|
+
import { IdpLogoList } from "./IdpLogoList.js";
|
|
29
|
+
import { IntroText } from "./IntroText.js";
|
|
30
|
+
import { LearnMore } from "./LearnMore.js";
|
|
31
|
+
import { Overlay } from "./Overlay.js";
|
|
32
|
+
import { Popup } from "./Popup.js";
|
|
33
|
+
import { Process } from "./Process.js";
|
|
34
|
+
import { ThemeContext } from "./ThemeContext.js";
|
|
35
|
+
import { initialiseAnalytics } from "./analytics.js";
|
|
36
|
+
import "./global.css";
|
|
37
|
+
import { getCurrentUrlOrigin } from "./navigator.js";
|
|
38
|
+
import { isIntroTextTypeValid, isRequiredClaimsValid } from "./validator.js";
|
|
39
|
+
import detectIncognito from "./incognito.js";
|
|
40
|
+
import { getBrowserName, getDeviceType, isAndroid, isIos } from "./userAgent.js";
|
|
41
|
+
import { hasCertification } from "./certification.js";
|
|
42
|
+
import { getCompatibility } from "./compatibility.js";
|
|
43
|
+
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 = () => { }, showCompatibilityWarnings = false, supportIncognito = false, disableAnalytics = false, forceMobile = false, // only for testing purposes
|
|
34
44
|
forceIos = false, // only for testing purposes
|
|
35
45
|
forceAndroid = false, // only for testing purposes
|
|
36
46
|
forceIncognito = false, // only for testing purposes
|
|
@@ -44,6 +54,7 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
44
54
|
}));
|
|
45
55
|
const [showPopup, setShowPopup] = useState(false);
|
|
46
56
|
const [isIncognito, setIsIncognito] = useState();
|
|
57
|
+
const [authorisationServersThatDisplayedCompatibilityPopup, setAuthorisationServersThatDisplayedCompatibilityPopup] = useState([]);
|
|
47
58
|
const analyticsData = {
|
|
48
59
|
claims,
|
|
49
60
|
rpLogoUrl,
|
|
@@ -70,7 +81,7 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
70
81
|
hasHowItWorks: true,
|
|
71
82
|
hasLearnMore: false,
|
|
72
83
|
},
|
|
73
|
-
|
|
84
|
+
"medium benefits": {
|
|
74
85
|
hasIntro: true,
|
|
75
86
|
hasBenefits: true,
|
|
76
87
|
hasProcess: false,
|
|
@@ -78,7 +89,7 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
78
89
|
hasHowItWorks: true,
|
|
79
90
|
hasLearnMore: false,
|
|
80
91
|
},
|
|
81
|
-
|
|
92
|
+
"medium process": {
|
|
82
93
|
hasIntro: true,
|
|
83
94
|
hasBenefits: false,
|
|
84
95
|
hasProcess: true,
|
|
@@ -86,7 +97,7 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
86
97
|
hasHowItWorks: false,
|
|
87
98
|
hasLearnMore: true,
|
|
88
99
|
},
|
|
89
|
-
|
|
100
|
+
"full benefits": {
|
|
90
101
|
hasIntro: true,
|
|
91
102
|
hasBenefits: true,
|
|
92
103
|
hasProcess: false,
|
|
@@ -94,7 +105,7 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
94
105
|
hasHowItWorks: true,
|
|
95
106
|
hasLearnMore: false,
|
|
96
107
|
},
|
|
97
|
-
|
|
108
|
+
"full process": {
|
|
98
109
|
hasIntro: true,
|
|
99
110
|
hasBenefits: false,
|
|
100
111
|
hasProcess: true,
|
|
@@ -116,8 +127,8 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
116
127
|
incognito = undefined;
|
|
117
128
|
}
|
|
118
129
|
initialiseAnalytics((analytics) => {
|
|
119
|
-
if (typeof analytics !==
|
|
120
|
-
analytics.track(
|
|
130
|
+
if (typeof analytics !== "undefined") {
|
|
131
|
+
analytics.track("ConnectID Button Displayed", Object.assign(Object.assign({}, analyticsData), { incognito }));
|
|
121
132
|
}
|
|
122
133
|
});
|
|
123
134
|
});
|
|
@@ -125,19 +136,19 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
125
136
|
return;
|
|
126
137
|
track();
|
|
127
138
|
}, []);
|
|
128
|
-
const
|
|
129
|
-
if (compatibilityWarnings.mobileOs ===
|
|
130
|
-
return '
|
|
139
|
+
const getCompatibilityPopupText = (compatibilityWarnings) => {
|
|
140
|
+
if (compatibilityWarnings.mobileOs === "android" && compatibilityWarnings.browser === "samsung") {
|
|
141
|
+
return "We couldn't open your identity provider's app. Samsung Internet doesn't support this step. To continue verifying your identity, please switch to a different browser.";
|
|
131
142
|
}
|
|
132
|
-
return
|
|
143
|
+
return "Looks like you're in incognito mode.\nWe can't complete verification using this identity provider while private browsing is on. To continue, please open a regular browser window and try again.";
|
|
133
144
|
};
|
|
134
145
|
const handleOnProceed = (authorisationServerId, authorisationServerName, authorisationServerCertifications) => {
|
|
135
|
-
if (typeof analytics !==
|
|
136
|
-
analytics.track(
|
|
146
|
+
if (typeof analytics !== "undefined") {
|
|
147
|
+
analytics.track("IDP Selected", Object.assign(Object.assign({}, analyticsData), { authorisationServerId, idp_name: authorisationServerName, incognito: isIncognito }));
|
|
137
148
|
}
|
|
138
149
|
setShowPopup(false);
|
|
139
|
-
const isMobile = forceMobile || getDeviceType() ===
|
|
140
|
-
const idpHasAppCertification = hasCertification(authorisationServerCertifications,
|
|
150
|
+
const isMobile = forceMobile || getDeviceType() === "mobile";
|
|
151
|
+
const idpHasAppCertification = hasCertification(authorisationServerCertifications, "Channel", "app");
|
|
141
152
|
const compatibility = getCompatibility({
|
|
142
153
|
supportIncognito,
|
|
143
154
|
idpHasAppCertification,
|
|
@@ -147,50 +158,48 @@ forceBrowser = undefined, // only for testing purposes
|
|
|
147
158
|
isIos: forceIos || isIos(),
|
|
148
159
|
browser: forceBrowser || getBrowserName(),
|
|
149
160
|
});
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
setShowPopup(true);
|
|
157
|
-
}
|
|
161
|
+
const authorisationServerHasNotDisplayedCompatibilityPopup = authorisationServersThatDisplayedCompatibilityPopup.find(authServerId => authServerId === authorisationServerId) === undefined;
|
|
162
|
+
if (showCompatibilityWarnings && compatibility.mightFail && authorisationServerHasNotDisplayedCompatibilityPopup) {
|
|
163
|
+
const popupText = getCompatibilityPopupText(compatibility);
|
|
164
|
+
alert(popupText);
|
|
165
|
+
setShowPopup(true);
|
|
166
|
+
setAuthorisationServersThatDisplayedCompatibilityPopup([...authorisationServersThatDisplayedCompatibilityPopup, authorisationServerId]);
|
|
158
167
|
return;
|
|
159
168
|
}
|
|
160
169
|
onProceed(authorisationServerId, compatibility);
|
|
161
170
|
};
|
|
162
171
|
const handleButtonClick = () => {
|
|
163
172
|
setShowPopup(true);
|
|
164
|
-
if (typeof analytics !==
|
|
165
|
-
analytics.track(
|
|
173
|
+
if (typeof analytics !== "undefined") {
|
|
174
|
+
analytics.track("ConnectID Button Clicked", Object.assign(Object.assign({}, analyticsData), { incognito: isIncognito }));
|
|
166
175
|
}
|
|
167
176
|
};
|
|
168
177
|
const handleClosePopup = () => {
|
|
169
178
|
setShowPopup(false);
|
|
170
|
-
if (typeof analytics !==
|
|
171
|
-
analytics.track(
|
|
179
|
+
if (typeof analytics !== "undefined") {
|
|
180
|
+
analytics.track("IDP Selector Popup Close Button Clicked", Object.assign(Object.assign({}, analyticsData), { incognito: isIncognito }));
|
|
172
181
|
}
|
|
173
182
|
};
|
|
174
183
|
if (!isRequiredClaimsValid(claims, requiredClaims)) {
|
|
175
|
-
const errorMessage = `requiredClaims needs to be a subset of claims. claims: ${claims.join(
|
|
184
|
+
const errorMessage = `requiredClaims needs to be a subset of claims. claims: ${claims.join(", ")}; requiredClaims: ${requiredClaims === null || requiredClaims === void 0 ? void 0 : requiredClaims.join(", ")}.`;
|
|
176
185
|
console.log(errorMessage);
|
|
177
186
|
onError(errorMessage);
|
|
178
187
|
return null;
|
|
179
188
|
}
|
|
180
189
|
if (!isIntroTextTypeValid(type, introTextType)) {
|
|
181
|
-
const errorMessage =
|
|
190
|
+
const errorMessage = "introTextType is required when type is defined.";
|
|
182
191
|
console.log(errorMessage);
|
|
183
192
|
onError(errorMessage);
|
|
184
193
|
return null;
|
|
185
194
|
}
|
|
186
195
|
const ctaText = `${label} with ConnectID`;
|
|
187
196
|
const connectIdButtonTypeConfig = type ? typeConfigMap[type] : undefined;
|
|
188
|
-
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 ===
|
|
189
|
-
(type ===
|
|
197
|
+
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", introTextType: introTextType || "verify-trust" })), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasProcess) &&
|
|
198
|
+
(type === "full process" ? _jsx(FullProcess, { collapsible: fullProcessCollapsible }) : _jsx(Process, {})), _jsxs("button", { className: `
|
|
190
199
|
cid-idp-selector-button cid-idp-selector-button--${theme}
|
|
191
|
-
${size ===
|
|
192
|
-
${type || showInfoContent ?
|
|
200
|
+
${size === "large" ? "cid-idp-selector-button--large" : ""}
|
|
201
|
+
${type || showInfoContent ? "cid-idp-selector-button--type" : ""}
|
|
193
202
|
`, 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) &&
|
|
194
|
-
introTextType !==
|
|
195
|
-
introTextType !==
|
|
203
|
+
introTextType !== "bank-details-plus-personal-info" &&
|
|
204
|
+
introTextType !== "bank-details-only" && _jsx(CidButtonInfo, {}), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasHowItWorks) && _jsx(CidButtonHowItWorks, {}), (connectIdButtonTypeConfig === null || connectIdButtonTypeConfig === void 0 ? void 0 : connectIdButtonTypeConfig.hasLearnMore) && _jsx(LearnMore, {})] }))] }));
|
|
196
205
|
};
|
package/CidButtonHowItWorks.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getCurrentUrlOrigin } from
|
|
3
|
-
import
|
|
4
|
-
import { ThemeContext } from
|
|
5
|
-
import { useContext } from
|
|
2
|
+
import { getCurrentUrlOrigin } from "./navigator.js";
|
|
3
|
+
import "./CidButtonHowItWorks.css";
|
|
4
|
+
import { ThemeContext } from "./ThemeContext.js";
|
|
5
|
+
import { useContext } from "react";
|
|
6
6
|
export const CidButtonHowItWorks = () => {
|
|
7
7
|
const theme = useContext(ThemeContext);
|
|
8
8
|
const handleClick = () => {
|
|
9
|
-
if (typeof analytics !==
|
|
10
|
-
analytics.track(
|
|
11
|
-
source:
|
|
12
|
-
link_url:
|
|
9
|
+
if (typeof analytics !== "undefined") {
|
|
10
|
+
analytics.track("Link to External Page Clicked", {
|
|
11
|
+
source: "how_does_it_work",
|
|
12
|
+
link_url: "https://connectid.com.au/#use-cases",
|
|
13
13
|
rp_sub_brand: getCurrentUrlOrigin(),
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
return (_jsx("a", { href: "https://connectid.com.au/#use-cases", onClick: handleClick, target: "_blank", tabIndex: 0, className: `cid-idp-selector-how-it-works ${theme ===
|
|
17
|
+
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?" }));
|
|
18
18
|
};
|
package/CidButtonInfo.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { ThemeContext } from
|
|
4
|
-
import { useContext } from
|
|
2
|
+
import "./CidButtonInfo.css";
|
|
3
|
+
import { ThemeContext } from "./ThemeContext.js";
|
|
4
|
+
import { useContext } from "react";
|
|
5
5
|
export const CidButtonInfo = () => {
|
|
6
6
|
const theme = useContext(ThemeContext);
|
|
7
|
-
return (_jsxs("div", { className: `cid-idp-selector-button-info ${theme ===
|
|
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
8
|
};
|
package/FullProcess.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext, useState } from
|
|
3
|
-
import { ThemeContext } from
|
|
4
|
-
import
|
|
2
|
+
import { useContext, useState } from "react";
|
|
3
|
+
import { ThemeContext } from "./ThemeContext.js";
|
|
4
|
+
import "./FullProcess.css";
|
|
5
5
|
// on a wide screen the layout is like this
|
|
6
6
|
// .----------.----------.
|
|
7
7
|
// text text text
|
|
@@ -31,5 +31,5 @@ export const FullProcess = ({ collapsible = false }) => {
|
|
|
31
31
|
return true;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
return (_jsxs("div", { className: `cid-idp-selector-full-process ${theme ===
|
|
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("h3", { 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
35
|
};
|
package/IdpLogoList.css
CHANGED
|
@@ -2,52 +2,22 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
justify-content: center;
|
|
5
|
-
flex-wrap: wrap;
|
|
6
5
|
gap: 8px;
|
|
7
|
-
margin-top:
|
|
8
|
-
margin-bottom:
|
|
6
|
+
margin-top: 10px;
|
|
7
|
+
margin-bottom: 16px;
|
|
9
8
|
}
|
|
10
|
-
.cid-idp-selector-idp-logo-list-
|
|
11
|
-
font-size:
|
|
12
|
-
color: var(--
|
|
9
|
+
.cid-idp-selector-idp-logo-list-label {
|
|
10
|
+
font-size: 13px;
|
|
11
|
+
color: var(--charcoal);
|
|
13
12
|
}
|
|
14
|
-
.cid-idp-selector-idp-logo-list-
|
|
13
|
+
.cid-idp-selector-idp-logo-list-label--dark {
|
|
15
14
|
color: white;
|
|
16
15
|
}
|
|
17
|
-
.cid-idp-selector-idp-logo-list {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-wrap: wrap;
|
|
20
|
-
gap: 8px;
|
|
21
|
-
}
|
|
22
16
|
.cid-idp-selector-idp-logo-list-logo {
|
|
23
|
-
|
|
24
|
-
height: 24px;
|
|
25
|
-
border-radius: 2px;
|
|
17
|
+
height: 30px;
|
|
26
18
|
}
|
|
27
19
|
.cid-idp-selector-idp-logo-list-skeleton-wrapper {
|
|
28
20
|
margin-top: 20px;
|
|
29
21
|
display: flex;
|
|
30
22
|
justify-content: center;
|
|
31
23
|
}
|
|
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
|
-
}
|
package/IdpLogoList.d.ts
CHANGED
package/IdpLogoList.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Skeleton } from
|
|
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
|
-
};
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "./IdpLogoList.css";
|
|
3
|
+
import { Skeleton } from "./Skeleton.js";
|
|
8
4
|
export const IdpLogoList = ({ loading, logoLockupStyle }) => {
|
|
9
5
|
if (loading) {
|
|
10
|
-
return (_jsx("div", { className: "cid-idp-selector-idp-logo-list-skeleton-wrapper", children: _jsx(Skeleton, { height: "
|
|
6
|
+
return (_jsx("div", { className: "cid-idp-selector-idp-logo-list-skeleton-wrapper", children: _jsx(Skeleton, { height: "25px", width: "203px", dataTestId: "idp-logo-list-loading" }) }));
|
|
11
7
|
}
|
|
12
|
-
const isDarkMode = logoLockupStyle ===
|
|
13
|
-
const imgSrc = isDarkMode ?
|
|
14
|
-
const dataTestId = isDarkMode ?
|
|
15
|
-
return (
|
|
8
|
+
const isDarkMode = logoLockupStyle === "dark";
|
|
9
|
+
const imgSrc = `https://cdn.connectid.com.au/images/idp-selector/logo-lockup/logo-lockup-${isDarkMode ? "dark" : "light"}2.svg`;
|
|
10
|
+
const dataTestId = `idp-logo-lockup-${isDarkMode ? "dark" : "light"}`;
|
|
11
|
+
return (_jsxs("div", { className: "cid-idp-selector-idp-logo-list-wrapper", "data-testid": "idp-logo-list-wrapper", children: [_jsx("span", { className: `cid-idp-selector-idp-logo-list-label ${isDarkMode ? "cid-idp-selector-idp-logo-list-label--dark" : ""}`, "data-testid": "idp-logo-list-label", children: "Available on" }), _jsx("img", { "data-testid": dataTestId, className: "cid-idp-selector-idp-logo-list-logo", src: imgSrc, alt: "CommBank, NAB, ANZ Plus and Westpac" })] }));
|
|
16
12
|
};
|
package/IntroText.d.ts
CHANGED
package/IntroText.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useContext } from
|
|
4
|
-
import { ThemeContext } from
|
|
2
|
+
import "./IntroText.css";
|
|
3
|
+
import { useContext } from "react";
|
|
4
|
+
import { ThemeContext } from "./ThemeContext.js";
|
|
5
5
|
const introTextContent = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
power:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
"verify-trust": "ConnectID lets you verify your identity through details stored with an organisation you already trust, like your bank.",
|
|
7
|
+
"verify-account": "Verify your identity through an organisation you already have an account with, like your bank.",
|
|
8
|
+
power: "ConnectID gives you the power to choose how you share your details, using organisations you already trust.",
|
|
9
|
+
"sign-up": "ConnectID lets you sign up using details stored with an organisation you already trust, like your bank.",
|
|
10
|
+
"bank-details-plus-personal-info": "Provide your preferred bank account and personal details in a secure and simple way, without oversharing information.",
|
|
11
|
+
"bank-details-only": "Provide your preferred bank account details in a secure and simple way, without oversharing information.",
|
|
12
|
+
"verify-age": "Verify your age through an organisation you already have an account with, like your bank.",
|
|
13
13
|
};
|
|
14
14
|
export const IntroText = ({ type }) => {
|
|
15
15
|
const theme = useContext(ThemeContext);
|
|
16
|
-
return (_jsx("div", { className: `cid-idp-selector-intro-text ${theme ===
|
|
16
|
+
return (_jsx("div", { className: `cid-idp-selector-intro-text ${theme === "light" ? "cid-idp-selector-intro-text--light" : ""}`, "data-testid": "intro-text", children: introTextContent[type] }));
|
|
17
17
|
};
|
package/LearnMore.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext } from
|
|
3
|
-
import
|
|
4
|
-
import { ThemeContext } from
|
|
5
|
-
import { getCurrentUrlOrigin } from
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import "./LearnMore.css";
|
|
4
|
+
import { ThemeContext } from "./ThemeContext.js";
|
|
5
|
+
import { getCurrentUrlOrigin } from "./navigator.js";
|
|
6
6
|
export const LearnMore = () => {
|
|
7
7
|
const theme = useContext(ThemeContext);
|
|
8
8
|
const handleClick = () => {
|
|
9
|
-
if (typeof analytics !==
|
|
10
|
-
analytics.track(
|
|
11
|
-
source:
|
|
12
|
-
link_url:
|
|
9
|
+
if (typeof analytics !== "undefined") {
|
|
10
|
+
analytics.track("Link to External Page Clicked", {
|
|
11
|
+
source: "learn_more",
|
|
12
|
+
link_url: "https://www.connectid.com.au",
|
|
13
13
|
rp_sub_brand: getCurrentUrlOrigin(),
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
return (_jsxs("div", { className: `cid-idp-selector-learn-more ${theme ===
|
|
17
|
+
return (_jsxs("div", { className: `cid-idp-selector-learn-more ${theme === "light" ? "cid-idp-selector-learn-more--light" : ""}`, children: ["Visit", " ", _jsx("a", { href: "https://www.connectid.com.au", onClick: handleClick, target: "_blank", tabIndex: 0, "data-testid": "learn-more", children: "connectid.com.au" }), " ", "to learn more."] }));
|
|
18
18
|
};
|
package/NoIdpError.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from
|
|
3
|
-
import { InfoBox } from
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { InfoBox } from "./InfoBox.js";
|
|
4
4
|
export const NoIdpError = ({ hasManualIdp, dataTestId }) => {
|
|
5
5
|
// This is only to trigger the alert on screen readers
|
|
6
6
|
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
|
|
@@ -8,5 +8,5 @@ export const NoIdpError = ({ hasManualIdp, dataTestId }) => {
|
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
setDisplayed(true);
|
|
10
10
|
}, []);
|
|
11
|
-
return (_jsx(InfoBox, { type: "warning", dataTestId: dataTestId, role: "alert", children: isDisplayed && (_jsxs(_Fragment, { children: [_jsx("h4", { className: "cid-idp-selector-popup-info-box-title", children: "We weren't able to load Identity Providers." }), _jsxs("p", { className: "cid-idp-selector-popup-info-box-text", children: ["Come back to us later", hasManualIdp &&
|
|
11
|
+
return (_jsx(InfoBox, { type: "warning", dataTestId: dataTestId, role: "alert", children: isDisplayed && (_jsxs(_Fragment, { children: [_jsx("h4", { className: "cid-idp-selector-popup-info-box-title", children: "We weren't able to load Identity Providers." }), _jsxs("p", { className: "cid-idp-selector-popup-info-box-text", children: ["Come back to us later", hasManualIdp && " or enter details manually instead", "."] })] })) }));
|
|
12
12
|
};
|
package/Popup.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { AuthorisationServerCertification, CertificationStatus, Claim, Participant, RequiredCertification } from
|
|
1
|
+
import "./global.css";
|
|
2
|
+
import "./Popup.css";
|
|
3
|
+
import { AuthorisationServerCertification, CertificationStatus, Claim, Participant, RequiredCertification } from "./types.js";
|
|
4
4
|
type PopupProps = {
|
|
5
5
|
onProceed: (authorisationServerId: string, authorisationServerName: string, authorisationServerCertifications: AuthorisationServerCertification[]) => void;
|
|
6
6
|
onCancel: () => void;
|