@ipulsehq/auth-ui 1.3.2 → 1.3.3
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.
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { LucideIcon } from 'lucide-react';
|
|
3
|
-
export interface IPulseRedirectSignInFeature {
|
|
4
|
-
icon: LucideIcon;
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
}
|
|
8
2
|
export interface IPulseRedirectSignInProps {
|
|
9
3
|
/** Callback URL after sign-in */
|
|
10
4
|
callbackUrl?: string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
5
|
+
/** Button text (default: "Inloggen via iPulse") */
|
|
6
|
+
buttonText?: string;
|
|
7
|
+
/** Subtext below the button (default: "Je wordt doorgestuurd naar iPulse om in te loggen.") */
|
|
8
|
+
subText?: string;
|
|
15
9
|
}
|
|
16
10
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Use in PulseFiles, PulseSync, etc.
|
|
11
|
+
* Generic sign-in page for iPulse OAuth clients.
|
|
12
|
+
* Shows a button to sign in via iPulse. Use in PulseFiles, PulseSync, PulseGuard, etc.
|
|
19
13
|
*/
|
|
20
14
|
export declare const IPulseRedirectSignIn: React.FC<IPulseRedirectSignInProps>;
|
|
21
15
|
//# sourceMappingURL=IPulseRedirectSignIn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPulseRedirectSignIn.d.ts","sourceRoot":"","sources":["../src/IPulseRedirectSignIn.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IPulseRedirectSignIn.d.ts","sourceRoot":"","sources":["../src/IPulseRedirectSignIn.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA8GpE,CAAC"}
|
|
@@ -39,27 +39,61 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
39
39
|
const React = __importStar(require("react"));
|
|
40
40
|
const react_1 = require("next-auth/react");
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
* Use in PulseFiles, PulseSync, etc.
|
|
42
|
+
* Generic sign-in page for iPulse OAuth clients.
|
|
43
|
+
* Shows a button to sign in via iPulse. Use in PulseFiles, PulseSync, PulseGuard, etc.
|
|
44
44
|
*/
|
|
45
|
-
const IPulseRedirectSignIn = ({ callbackUrl = '/',
|
|
46
|
-
React.
|
|
45
|
+
const IPulseRedirectSignIn = ({ callbackUrl = '/', buttonText = 'Inloggen via iPulse', subText = 'Je wordt doorgestuurd naar iPulse om in te loggen.', }) => {
|
|
46
|
+
const [loading, setLoading] = React.useState(false);
|
|
47
|
+
const handleSignIn = () => {
|
|
48
|
+
setLoading(true);
|
|
47
49
|
(0, react_1.signIn)('ipulse', { callbackUrl });
|
|
48
|
-
}
|
|
49
|
-
return ((0, jsx_runtime_1.
|
|
50
|
+
};
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
50
52
|
minHeight: '100vh',
|
|
51
53
|
display: 'flex',
|
|
52
54
|
alignItems: 'center',
|
|
53
55
|
justifyContent: 'center',
|
|
54
56
|
padding: '1rem',
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
backgroundColor: 'var(--background, #fff)',
|
|
58
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: { textAlign: 'center', maxWidth: '20rem', width: '100%' }, children: [(0, jsx_runtime_1.jsxs)("div", { style: { marginBottom: '2rem' }, children: [(0, jsx_runtime_1.jsxs)("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { margin: '0 auto 1rem auto', display: 'block' }, children: [(0, jsx_runtime_1.jsx)("rect", { width: "40", height: "40", rx: "10", fill: "var(--color-primary, oklch(0.52 0.19 238.36))" }), (0, jsx_runtime_1.jsx)("path", { d: "M13 20a7 7 0 1 1 14 0 7 7 0 0 1-14 0z", fill: "white", opacity: "0.3" }), (0, jsx_runtime_1.jsx)("path", { d: "M20 14v12M14 20h12", stroke: "white", strokeWidth: "2.5", strokeLinecap: "round" })] }), (0, jsx_runtime_1.jsx)("h1", { style: {
|
|
59
|
+
fontSize: '1.25rem',
|
|
60
|
+
fontWeight: 600,
|
|
61
|
+
margin: '0 0 0.5rem 0',
|
|
62
|
+
color: 'var(--foreground, #111)',
|
|
63
|
+
}, children: "Welkom" }), (0, jsx_runtime_1.jsx)("p", { style: {
|
|
64
|
+
fontSize: '0.875rem',
|
|
65
|
+
color: 'var(--color-muted-foreground, #71717a)',
|
|
66
|
+
margin: 0,
|
|
67
|
+
}, children: subText })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSignIn, disabled: loading, style: {
|
|
68
|
+
width: '100%',
|
|
69
|
+
padding: '0.75rem 1.5rem',
|
|
70
|
+
backgroundColor: loading
|
|
71
|
+
? 'var(--color-muted, #e4e4e7)'
|
|
72
|
+
: 'var(--color-primary, oklch(0.52 0.19 238.36))',
|
|
73
|
+
color: loading ? 'var(--color-muted-foreground, #71717a)' : '#fff',
|
|
74
|
+
border: 'none',
|
|
75
|
+
borderRadius: '0.5rem',
|
|
76
|
+
fontSize: '0.9375rem',
|
|
77
|
+
fontWeight: 500,
|
|
78
|
+
cursor: loading ? 'not-allowed' : 'pointer',
|
|
79
|
+
display: 'flex',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'center',
|
|
82
|
+
gap: '0.5rem',
|
|
83
|
+
transition: 'opacity 0.15s',
|
|
84
|
+
}, children: [loading && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
85
|
+
width: '1rem',
|
|
86
|
+
height: '1rem',
|
|
87
|
+
border: '2px solid currentColor',
|
|
88
|
+
borderTopColor: 'transparent',
|
|
89
|
+
borderRadius: '50%',
|
|
90
|
+
display: 'inline-block',
|
|
91
|
+
animation: 'spin 0.6s linear infinite',
|
|
92
|
+
} })), loading ? 'Doorsturen...' : buttonText] }), (0, jsx_runtime_1.jsx)("p", { style: {
|
|
93
|
+
marginTop: '1.5rem',
|
|
94
|
+
fontSize: '0.75rem',
|
|
95
|
+
color: 'var(--color-muted-foreground, #71717a)',
|
|
96
|
+
}, children: "Beveiligd door iPulse Auth" })] }), (0, jsx_runtime_1.jsx)("style", { children: `@keyframes spin { to { transform: rotate(360deg); } }` })] }));
|
|
63
97
|
};
|
|
64
98
|
exports.IPulseRedirectSignIn = IPulseRedirectSignIn;
|
|
65
99
|
//# sourceMappingURL=IPulseRedirectSignIn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPulseRedirectSignIn.js","sourceRoot":"","sources":["../src/IPulseRedirectSignIn.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,6CAA+B;AAC/B,2CAAyC;
|
|
1
|
+
{"version":3,"file":"IPulseRedirectSignIn.js","sourceRoot":"","sources":["../src/IPulseRedirectSignIn.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,6CAA+B;AAC/B,2CAAyC;AAWzC;;;GAGG;AACI,MAAM,oBAAoB,GAAwC,CAAC,EACxE,WAAW,GAAG,GAAG,EACjB,UAAU,GAAG,qBAAq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