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.
@@ -1,2 +1,2 @@
1
1
  import { LoginPageProps } from 'uibee/components';
2
- export default function LoginPage({ title, description, redirectURL, version, btg, handleSubmit, guestRedirectURL, guestText }: LoginPageProps): import("react/jsx-runtime").JSX.Element;
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, redirectURL, version, btg, handleSubmit, guestRedirectURL, guestText }) {
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: redirectURL, className: `
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' })] })), guestRedirectURL &&
17
- _jsx(Link, { href: guestRedirectURL, className: 'text-sm font-semibold cursor-pointer opacity-50', children: guestText || 'Continue as guest' }), _jsxs("span", { className: 'text-sm mt-2', children: ["v", version] })] }) }));
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 }), !loginPath && !logoutPath &&
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uibee",
3
- "version": "2.9.1",
3
+ "version": "2.9.3",
4
4
  "description": "Shared components, functions and hooks for reuse across Login projects",
5
5
  "homepage": "https://github.com/Login-Linjeforening-for-IT/uibee#readme",
6
6
  "bugs": {
@@ -6,11 +6,11 @@ import Link from 'next/link'
6
6
  export default function LoginPage({
7
7
  title,
8
8
  description,
9
- redirectURL,
9
+ redirectPath,
10
10
  version,
11
11
  btg,
12
12
  handleSubmit,
13
- guestRedirectURL,
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={redirectURL}
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
- {guestRedirectURL &&
81
+ {guestRedirectPath &&
82
82
  <Link
83
- href={guestRedirectURL}
83
+ href={guestRedirectPath}
84
84
  className='text-sm font-semibold cursor-pointer opacity-50'
85
85
  >
86
86
  {guestText || 'Continue as guest'}
@@ -79,7 +79,7 @@ export default function Navbar({
79
79
  language={lang}
80
80
  />
81
81
  }
82
- {!loginPath && !logoutPath &&
82
+ {loginPath && logoutPath &&
83
83
  <AuthButton
84
84
  profilePath={profilePath}
85
85
  token={token}
@@ -3,11 +3,11 @@ declare module 'uibee/components' {
3
3
  export interface LoginPageProps {
4
4
  title: string
5
5
  description?: string
6
- redirectURL: string
6
+ redirectPath: string
7
7
  version: string
8
8
  btg?: boolean
9
9
  handleSubmit?: (formData: FormData) => void
10
- guestRedirectURL?: string
10
+ guestRedirectPath?: string
11
11
  guestText?: string
12
12
  }
13
13