@gopherium/react-auth 0.2.0 → 0.3.0
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.
|
@@ -14,5 +14,5 @@ export function AccountPanel({ className }) {
|
|
|
14
14
|
if (!user) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
-
return (_jsxs(Stack, { direction: "column", gap: "sm", className: className, children: [_jsx(Text, { children: user.name }), _jsx(Button, { variant: "outline",
|
|
17
|
+
return (_jsxs(Stack, { direction: "column", gap: "sm", className: className, children: [_jsx(Text, { children: user.name }), _jsx(Button, { variant: "outline", loading: signOut.isPending, onClick: () => signOut.mutate(), children: "Log out" }), signOut.isError ? (_jsx(Text, { role: "alert", children: "Logout failed, please try again." })) : null] }));
|
|
18
18
|
}
|
package/dist/wpds/LoginScreen.js
CHANGED
|
@@ -34,5 +34,5 @@ export function LoginScreen({ brand, onLogin, }) {
|
|
|
34
34
|
return (_jsx("div", { className: "gopherium-login", children: _jsx(Card.Root, { className: "gopherium-login__card", children: _jsx(Card.Content, { children: _jsx("form", { onSubmit: (event) => {
|
|
35
35
|
event.preventDefault();
|
|
36
36
|
attempt.mutate();
|
|
37
|
-
}, children: _jsxs(Stack, { direction: "column", gap: "lg", children: [_jsx(Text, { variant: "heading-lg", render: _jsx("h1", {}), children: brand }), _jsx(InputControl, { label: "Email", type: "email", value: email, onChange: (event) => setEmail(event.target.value) }), _jsx(InputControl, { label: "Password", type: "password", value: password, onChange: (event) => setPassword(event.target.value) }), _jsx(Button, { type: "submit", disabled: email.trim() === '' || password === '' || attempt.isPending, children: "Log in" }), attempt.isError ? (_jsx(Text, { role: "alert", children: loginErrorMessage(attempt.error) })) : null] }) }) }) }) }));
|
|
37
|
+
}, children: _jsxs(Stack, { direction: "column", gap: "lg", children: [_jsx(Text, { variant: "heading-lg", render: _jsx("h1", {}), children: brand }), _jsx(InputControl, { label: "Email", type: "email", value: email, onChange: (event) => setEmail(event.target.value) }), _jsx(InputControl, { label: "Password", type: "password", value: password, onChange: (event) => setPassword(event.target.value) }), _jsx(Button, { type: "submit", disabled: email.trim() === '' || password === '' || attempt.isPending, loading: attempt.isPending, children: "Log in" }), attempt.isError ? (_jsx(Text, { role: "alert", children: loginErrorMessage(attempt.error) })) : null] }) }) }) }) }));
|
|
38
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gopherium/react-auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Session authentication for React apps backed by gouncer's authkit.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@testing-library/jest-dom": "^6.9.1",
|
|
49
49
|
"@testing-library/react": "^16.3.2",
|
|
50
50
|
"@wordpress/theme": ">=1.0.0 <2.0.0",
|
|
51
|
-
"@wordpress/ui": ">=0.
|
|
51
|
+
"@wordpress/ui": ">=0.19.0 <0.20.0",
|
|
52
52
|
"msw": "^2.15.0",
|
|
53
53
|
"react": "^19.2.7",
|
|
54
54
|
"vitest": "^4.1.10"
|