uibee 2.9.1 → 2.9.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.
- package/dist/src/components/login/loginPage.d.ts +1 -1
- package/dist/src/components/login/loginPage.js +4 -4
- package/dist/src/components/navbar/navbar.js +1 -1
- package/package.json +1 -1
- package/src/components/login/loginPage.tsx +5 -5
- package/src/components/navbar/navbar.tsx +1 -1
- package/src/types/components.d.ts +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { LoginPageProps } from 'uibee/components';
|
|
2
|
-
export default function LoginPage({ title, description,
|
|
2
|
+
export default function LoginPage({ title, description, redirectPath, version, btg, handleSubmit, guestRedirectPath, guestText }: LoginPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,17 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { LogIn } from 'lucide-react';
|
|
3
3
|
import Logo from '../logo/logo';
|
|
4
4
|
import Link from 'next/link';
|
|
5
|
-
export default function LoginPage({ title, description,
|
|
5
|
+
export default function LoginPage({ title, description, redirectPath, version, btg, handleSubmit, guestRedirectPath, guestText }) {
|
|
6
6
|
return (_jsx("main", { className: 'w-full h-full flex items-center justify-center bg-login-800 p-8', children: _jsxs("div", { className: 'flex flex-col justify-center items-center bg-login-600 px-4 py-12 rounded-xl w-full max-w-md gap-4 md:gap-6', children: [_jsx("div", { className: 'relative aspect-3/1 w-full', children: _jsx(Logo, { className: 'object-contain px-6 sm:px-12' }) }), _jsxs("h1", { className: 'text-3xl font-extrabold text-login text-center tracking-tight', children: [title, " ", btg ? ' - Break the Glass' : ''] }), description && (_jsx("p", { className: 'text-center font-medium text-lg mb-2 max-w-xs', children: description })), btg ? (_jsxs("form", { className: 'w-full flex flex-col gap-3 max-w-xs', onSubmit: e => {
|
|
7
7
|
e.preventDefault();
|
|
8
8
|
handleSubmit?.(new FormData(e.currentTarget));
|
|
9
9
|
e.currentTarget.reset();
|
|
10
10
|
}, children: [_jsx("input", { type: 'text', name: 'name', placeholder: 'Name', className: 'py-2 px-3 rounded bg-login-900 font-medium focus:outline-none', required: true }), _jsx("input", { type: 'password', name: 'token', placeholder: 'Token', className: 'py-2 px-3 rounded bg-login-900 font-medium focus:outline-none', required: true }), _jsx("button", { type: 'submit', className: 'py-2 px-4 rounded-xl bg-login font-bold text-lg ' +
|
|
11
|
-
'hover:bg-login/80 transition-all duration-200 mt-2', children: "Login" })] })) : (_jsxs(Link, { href:
|
|
11
|
+
'hover:bg-login/80 transition-all duration-200 mt-2', children: "Login" })] })) : (_jsxs(Link, { href: redirectPath, className: `
|
|
12
12
|
flex items-center justify-center gap-2 w-full
|
|
13
13
|
max-w-xs py-3 px-6 rounded-xl bg-login font-bold
|
|
14
14
|
text-lg hover:bg-login/80 transition-all
|
|
15
15
|
duration-200 mb-2 mt-2 cursor-pointer
|
|
16
|
-
`, children: ["Login", _jsx(LogIn, { className: 'w-6 h-6' })] })),
|
|
17
|
-
_jsx(Link, { href:
|
|
16
|
+
`, children: ["Login", _jsx(LogIn, { className: 'w-6 h-6' })] })), guestRedirectPath &&
|
|
17
|
+
_jsx(Link, { href: guestRedirectPath, className: 'text-sm font-semibold cursor-pointer opacity-50', children: guestText || 'Continue as guest' }), _jsxs("span", { className: 'text-sm mt-2', children: ["v", version] })] }) }));
|
|
18
18
|
}
|
|
@@ -16,7 +16,7 @@ export default function Navbar({ lang, onlyLogo, disableLanguageToggle, disableT
|
|
|
16
16
|
return (_jsx("div", { className: `${isMobileMenuOpen ? 'bg-[#181818f0]' : 'bg-[#18181899]'} backdrop-blur-xl fixed top-0 z-900 w-full ${className}`, children: _jsxs("div", { className: `flex w-full max-w-6xl m-auto p-2 transition duration-500 800px:justify-between 800px:p-4 ${isMobileMenuOpen ? 'h-screen bg-login-900/20 800px:h-20' : ''} ${innerClassName}
|
|
17
17
|
`, children: [_jsx("div", { className: 'block h-12 p-1 800px:p-0', children: _jsx(Link, { href: '/', onClick: () => setIsMobileMenuOpen(false), children: _jsx(LogoSmall, {}) }) }), onlyLogo ? null : (_jsxs(_Fragment, { children: [_jsx("nav", { className: 'hidden 800px:flex 800px:justify-between 800px:items-center 800px:w-fill max-w-200', children: children }), _jsxs("nav", { className: 'flex w-[calc(100vw-8rem)] justify-end h-12 800px:w-fit', children: [!disableThemeToggle &&
|
|
18
18
|
_jsx(ThemeToggle, {}), !disableLanguageToggle &&
|
|
19
|
-
_jsx(LanguageToggle, { language: lang }),
|
|
19
|
+
_jsx(LanguageToggle, { language: lang }), loginPath && logoutPath &&
|
|
20
20
|
_jsx(AuthButton, { profilePath: profilePath, token: token, loginPath: loginPath, logoutPath: logoutPath })] }), _jsxs("button", { className: 'w-12 h-12 relative cursor-pointer bg-none border-none 800px:hidden', onClick: () => setIsMobileMenuOpen(!isMobileMenuOpen), children: [_jsx("div", { className: hamburgerStyle(isMobileMenuOpen) }), _jsx("div", { className: hamburgerStyle(isMobileMenuOpen, true) })] }), _jsx("nav", { className: `fixed top-16 w-[calc(100%-2rem)] max-w-140 mx-auto left-0 right-0 800px:hidden
|
|
21
21
|
transition-all duration-500 ease-in-out overflow-hidden
|
|
22
22
|
${isMobileMenuOpen ? 'max-h-[calc(100vh-4rem)] opacity-100' : 'max-h-0 opacity-0'}`, onClick: () => setIsMobileMenuOpen(false), children: React.Children.map(children, (child, index) => (_jsx("div", { className: `transition-all duration-500 ease-out ${isMobileMenuOpen
|
package/package.json
CHANGED
|
@@ -6,11 +6,11 @@ import Link from 'next/link'
|
|
|
6
6
|
export default function LoginPage({
|
|
7
7
|
title,
|
|
8
8
|
description,
|
|
9
|
-
|
|
9
|
+
redirectPath,
|
|
10
10
|
version,
|
|
11
11
|
btg,
|
|
12
12
|
handleSubmit,
|
|
13
|
-
|
|
13
|
+
guestRedirectPath,
|
|
14
14
|
guestText
|
|
15
15
|
}: LoginPageProps) {
|
|
16
16
|
return (
|
|
@@ -66,7 +66,7 @@ export default function LoginPage({
|
|
|
66
66
|
</form>
|
|
67
67
|
) : (
|
|
68
68
|
<Link
|
|
69
|
-
href={
|
|
69
|
+
href={redirectPath}
|
|
70
70
|
className={`
|
|
71
71
|
flex items-center justify-center gap-2 w-full
|
|
72
72
|
max-w-xs py-3 px-6 rounded-xl bg-login font-bold
|
|
@@ -78,9 +78,9 @@ export default function LoginPage({
|
|
|
78
78
|
<LogIn className='w-6 h-6' />
|
|
79
79
|
</Link>
|
|
80
80
|
)}
|
|
81
|
-
{
|
|
81
|
+
{guestRedirectPath &&
|
|
82
82
|
<Link
|
|
83
|
-
href={
|
|
83
|
+
href={guestRedirectPath}
|
|
84
84
|
className='text-sm font-semibold cursor-pointer opacity-50'
|
|
85
85
|
>
|
|
86
86
|
{guestText || 'Continue as guest'}
|
|
@@ -3,11 +3,11 @@ declare module 'uibee/components' {
|
|
|
3
3
|
export interface LoginPageProps {
|
|
4
4
|
title: string
|
|
5
5
|
description?: string
|
|
6
|
-
|
|
6
|
+
redirectPath: string
|
|
7
7
|
version: string
|
|
8
8
|
btg?: boolean
|
|
9
9
|
handleSubmit?: (formData: FormData) => void
|
|
10
|
-
|
|
10
|
+
guestRedirectPath?: string
|
|
11
11
|
guestText?: string
|
|
12
12
|
}
|
|
13
13
|
|