@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.
- package/Benefits.css +48 -0
- package/Benefits.d.ts +4 -0
- package/Benefits.js +20 -0
- package/CidButton.css +57 -0
- package/CidButton.d.ts +26 -0
- package/CidButton.js +133 -0
- package/CidButtonHowItWorks.css +25 -0
- package/CidButtonHowItWorks.d.ts +2 -0
- package/CidButtonHowItWorks.js +20 -0
- package/CidButtonInfo.css +33 -0
- package/CidButtonInfo.d.ts +2 -0
- package/CidButtonInfo.js +8 -0
- package/FullProcess.css +150 -0
- package/FullProcess.d.ts +4 -0
- package/FullProcess.js +35 -0
- package/IdpLogoList.css +53 -0
- package/IdpLogoList.d.ts +8 -0
- package/IdpLogoList.js +13 -0
- package/InfoBox.css +49 -0
- package/InfoBox.d.ts +9 -0
- package/InfoBox.js +12 -0
- package/IntroText.css +24 -0
- package/IntroText.d.ts +5 -0
- package/IntroText.js +14 -0
- package/LearnMore.css +27 -0
- package/LearnMore.d.ts +2 -0
- package/LearnMore.js +20 -0
- package/NoIdpError.d.ts +6 -0
- package/NoIdpError.js +12 -0
- package/Overlay.css +9 -0
- package/Overlay.d.ts +6 -0
- package/Overlay.js +6 -0
- package/ParticipantsLoader.css +50 -0
- package/ParticipantsLoader.d.ts +2 -0
- package/ParticipantsLoader.js +12 -0
- package/Popup.css +457 -0
- package/Popup.d.ts +22 -0
- package/Popup.js +137 -0
- package/Process.css +51 -0
- package/Process.d.ts +2 -0
- package/Process.js +12 -0
- package/README.md +633 -0
- package/Skeleton.css +27 -0
- package/Skeleton.d.ts +10 -0
- package/Skeleton.js +5 -0
- package/TabHook.d.ts +2 -0
- package/TabHook.js +37 -0
- package/ThemeContext.d.ts +2 -0
- package/ThemeContext.js +2 -0
- package/analytics.d.ts +1 -0
- package/analytics.js +88 -0
- package/certification.d.ts +8 -0
- package/certification.js +103 -0
- package/certification.test.d.ts +1 -0
- package/certification.test.js +387 -0
- package/global.css +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/license +201 -0
- package/navigator.d.ts +1 -0
- package/navigator.js +1 -0
- package/package.json +46 -0
- package/types.d.ts +41 -0
- package/types.js +1 -0
- package/userAgent.d.ts +2 -0
- package/userAgent.js +10 -0
- package/validator.d.ts +3 -0
- package/validator.js +12 -0
- package/validator.test.d.ts +1 -0
- package/validator.test.js +36 -0
package/InfoBox.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.cid-idp-selector-popup-info-box {
|
|
2
|
+
padding: 12px 12px 12px 20px;
|
|
3
|
+
background-color: #F9FDFB;
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
.cid-idp-selector-popup-info-box--info {
|
|
8
|
+
background-color: #F9FDFB;
|
|
9
|
+
}
|
|
10
|
+
.cid-idp-selector-popup-info-box--warning {
|
|
11
|
+
background-color: #FFF9F5;
|
|
12
|
+
}
|
|
13
|
+
.cid-idp-selector-popup-info-box::before {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
background-color: #BEEDD2;
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 8px;
|
|
20
|
+
border-top-left-radius: 8px;
|
|
21
|
+
border-bottom-left-radius: 8px;
|
|
22
|
+
content: '';
|
|
23
|
+
}
|
|
24
|
+
.cid-idp-selector-popup-info-box--warning::before {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
background-color: #FFC1A0;
|
|
29
|
+
height: 100%;
|
|
30
|
+
width: 8px;
|
|
31
|
+
border-top-left-radius: 8px;
|
|
32
|
+
border-bottom-left-radius: 8px;
|
|
33
|
+
content: '';
|
|
34
|
+
}
|
|
35
|
+
.cid-idp-selector-popup-info-box--info .cid-idp-selector-popup-info-box::before {
|
|
36
|
+
background-color: #BEEDD2;
|
|
37
|
+
}
|
|
38
|
+
.cid-idp-selector-popup-info-box--warning .cid-idp-selector-popup-info-box::before {
|
|
39
|
+
background-color: #FFC1A0;
|
|
40
|
+
}
|
|
41
|
+
.cid-idp-selector-popup-info-box-container {
|
|
42
|
+
display: flex;
|
|
43
|
+
}
|
|
44
|
+
.cid-idp-selector-popup-info-box-content {
|
|
45
|
+
margin-left: 20px;
|
|
46
|
+
}
|
|
47
|
+
.cid-idp-selector-popup-info-box-icon {
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
}
|
package/InfoBox.d.ts
ADDED
package/InfoBox.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import './InfoBox.css';
|
|
3
|
+
export const InfoBox = ({ children, role, dataTestId, type = 'info' }) => {
|
|
4
|
+
const renderIcon = () => {
|
|
5
|
+
if (type === 'info') {
|
|
6
|
+
return (_jsxs("svg", { className: "cid-idp-selector-popup-info-box-icon", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20Z", fill: "#BEEDD2" }), _jsx("path", { d: "M8.07129 13.8572H11.9284H8.07129Z", fill: "#BEEDD2" }), _jsx("path", { d: "M8.07129 13.8572H11.9284", stroke: "#262626", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M10.0003 6.78571C10.3553 6.78571 10.6431 6.49789 10.6431 6.14286C10.6431 5.78782 10.3553 5.5 10.0003 5.5C9.64524 5.5 9.35742 5.78782 9.35742 6.14286C9.35742 6.49789 9.64524 6.78571 10.0003 6.78571Z", fill: "#262626", stroke: "#262626", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M10.0006 13.8572V9.35718H8.71484", stroke: "#262626", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
7
|
+
}
|
|
8
|
+
// warning
|
|
9
|
+
return (_jsxs("svg", { className: "cid-idp-selector-popup-info-box-icon", width: "20", height: "20", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M9.96487 2.53513L2.53513 9.96487C1.96344 10.5366 1.96344 11.4634 2.53513 12.0351L9.96487 19.4649C10.5366 20.0366 11.4634 20.0366 12.0351 19.4649L19.4649 12.0351C20.0366 11.4634 20.0366 10.5366 19.4649 9.96487L12.0351 2.53513C11.4634 1.96344 10.5366 1.96344 9.96487 2.53513Z", fill: "#FFC1A0", stroke: "#FFC1A0", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M11.0029 6.66895V10.7733", stroke: "#262626", strokeWidth: "1.4", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M10.9419 15.4863C11.3197 15.4863 11.6259 15.18 11.6259 14.8022C11.6259 14.4244 11.3197 14.1182 10.9419 14.1182C10.5641 14.1182 10.2578 14.4244 10.2578 14.8022C10.2578 15.18 10.5641 15.4863 10.9419 15.4863Z", fill: "#262626", stroke: "#262626", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
10
|
+
};
|
|
11
|
+
return (_jsx("div", { className: `cid-idp-selector-popup-info-box cid-idp-selector-popup-info-box--${type}`, role: role, "data-testid": dataTestId, children: _jsxs("div", { className: "cid-idp-selector-popup-info-box-container", children: [renderIcon(), _jsx("div", { className: "cid-idp-selector-popup-info-box-content", children: children })] }) }));
|
|
12
|
+
};
|
package/IntroText.css
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.cid-idp-selector-intro-text {
|
|
2
|
+
color: var(--charcoal);
|
|
3
|
+
font-size: 18px;
|
|
4
|
+
line-height: 23px;
|
|
5
|
+
margin-bottom: 20px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.cid-idp-selector-intro-text.cid-idp-selector-intro-text--light {
|
|
9
|
+
color: white;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (max-width: 430px) {
|
|
13
|
+
.cid-idp-selector-intro-text {
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
line-height: 20px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (max-width: 375px) {
|
|
20
|
+
.cid-idp-selector-intro-text {
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
line-height: 18px;
|
|
23
|
+
}
|
|
24
|
+
}
|
package/IntroText.d.ts
ADDED
package/IntroText.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './IntroText.css';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { ThemeContext } from './ThemeContext';
|
|
5
|
+
const introTextContent = {
|
|
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
|
+
};
|
|
11
|
+
export const IntroText = ({ type }) => {
|
|
12
|
+
const theme = useContext(ThemeContext);
|
|
13
|
+
return (_jsx("div", { className: `cid-idp-selector-intro-text ${theme === 'light' ? 'cid-idp-selector-intro-text--light' : ''}`, "data-testid": "intro-text", children: introTextContent[type] }));
|
|
14
|
+
};
|
package/LearnMore.css
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.cid-idp-selector-learn-more {
|
|
2
|
+
text-align: center;
|
|
3
|
+
margin-top: 8px;
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
color: var(--charcoal);
|
|
6
|
+
}
|
|
7
|
+
.cid-idp-selector-learn-more a {
|
|
8
|
+
color: var(--charcoal);
|
|
9
|
+
}
|
|
10
|
+
.cid-idp-selector-learn-more--light {
|
|
11
|
+
color: white;
|
|
12
|
+
}
|
|
13
|
+
.cid-idp-selector-learn-more--light a {
|
|
14
|
+
color: white;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media (max-width: 744px) {
|
|
18
|
+
.cid-idp-selector-learn-more {
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (max-width: 375px) {
|
|
24
|
+
.cid-idp-selector-learn-more {
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
}
|
|
27
|
+
}
|
package/LearnMore.d.ts
ADDED
package/LearnMore.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 './LearnMore.css';
|
|
4
|
+
import { ThemeContext } from './ThemeContext';
|
|
5
|
+
import { useAnalytics } from './analytics';
|
|
6
|
+
import { getCurrentUrlOrigin } from './navigator';
|
|
7
|
+
export const LearnMore = () => {
|
|
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: 'learn_more',
|
|
15
|
+
link_url: 'https://www.connectid.com.au',
|
|
16
|
+
rp_sub_brand: getCurrentUrlOrigin(),
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
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."] }));
|
|
20
|
+
};
|
package/NoIdpError.d.ts
ADDED
package/NoIdpError.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { InfoBox } from './InfoBox';
|
|
4
|
+
export const NoIdpError = ({ hasManualIdp, dataTestId }) => {
|
|
5
|
+
// This is only to trigger the alert on screen readers
|
|
6
|
+
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
|
|
7
|
+
const [isDisplayed, setDisplayed] = useState(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setDisplayed(true);
|
|
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 && ' or enter details manually instead', "."] })] })) }));
|
|
12
|
+
};
|
package/Overlay.css
ADDED
package/Overlay.d.ts
ADDED
package/Overlay.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import './Overlay.css';
|
|
4
|
+
export const Overlay = ({ onClick }) => {
|
|
5
|
+
return ReactDOM.createPortal(_jsx("div", { className: "cid-idp-selector-overlay", onClick: onClick }), document.querySelector('body'));
|
|
6
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@keyframes rotation {
|
|
2
|
+
0% {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
transform: rotate(360deg);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.cid-idp-selector-participants-loader {
|
|
11
|
+
border: 1px solid #c9c9c9;
|
|
12
|
+
padding: 20px;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
height: 240px;
|
|
18
|
+
margin-top: 24px;
|
|
19
|
+
border-radius: 12px;
|
|
20
|
+
}
|
|
21
|
+
.cid-idp-selector-participants-loader__label {
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
color: #5c5c5c;
|
|
24
|
+
margin-top: 12px;
|
|
25
|
+
}
|
|
26
|
+
.cid-idp-selector-participants-loader__spinner {
|
|
27
|
+
width: 30px;
|
|
28
|
+
height: 30px;
|
|
29
|
+
border: 3px dotted #5c5c5c;
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
display: inline-block;
|
|
32
|
+
position: relative;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
animation: rotation 2.5s linear infinite;
|
|
35
|
+
/* this is a request from vision australia, this wont happen (taking more than 5 sec to load participants) although we need it to get the WCAG certification so dont bother */
|
|
36
|
+
animation-iteration-count: 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (prefers-reduced-motion: reduce) {
|
|
40
|
+
.cid-idp-selector-participants-loader__spinner {
|
|
41
|
+
animation: none;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (max-width: 488px) {
|
|
46
|
+
.cid-idp-selector-participants-loader {
|
|
47
|
+
height: 180px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import './ParticipantsLoader.css';
|
|
4
|
+
export const ParticipantsLoader = () => {
|
|
5
|
+
// This is only to trigger the alert on screen readers
|
|
6
|
+
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
|
|
7
|
+
const [isDisplayed, setDisplayed] = useState(false);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setDisplayed(true);
|
|
10
|
+
}, []);
|
|
11
|
+
return (_jsx("div", { className: "cid-idp-selector-participants-loader", "data-testid": "participants-loader", role: "alert", children: isDisplayed && (_jsxs(_Fragment, { children: [_jsx("span", { className: "cid-idp-selector-participants-loader__spinner" }), _jsx("span", { className: "cid-idp-selector-participants-loader__label", children: "Loading a list of identity providers" })] })) }));
|
|
12
|
+
};
|