uibee 2.3.2 → 2.3.4
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/globals.css +15 -12
- package/dist/src/components/navbar/navbar.d.ts +3 -1
- package/dist/src/components/navbar/navbar.js +8 -5
- package/dist/src/components/navbar/navbarDropdown.js +2 -2
- package/dist/src/components/navbar/navbarItem.js +1 -1
- package/package.json +1 -1
- package/src/components/navbar/navbar.tsx +18 -12
- package/src/components/navbar/navbarDropdown.tsx +2 -2
- package/src/components/navbar/navbarItem.tsx +1 -1
package/dist/globals.css
CHANGED
|
@@ -522,11 +522,11 @@
|
|
|
522
522
|
.max-w-6xl {
|
|
523
523
|
max-width: var(--container-6xl);
|
|
524
524
|
}
|
|
525
|
-
.max-w
|
|
526
|
-
max-width:
|
|
525
|
+
.max-w-140 {
|
|
526
|
+
max-width: calc(var(--spacing) * 140);
|
|
527
527
|
}
|
|
528
|
-
.max-w
|
|
529
|
-
max-width:
|
|
528
|
+
.max-w-200 {
|
|
529
|
+
max-width: calc(var(--spacing) * 200);
|
|
530
530
|
}
|
|
531
531
|
.max-w-md {
|
|
532
532
|
max-width: var(--container-md);
|
|
@@ -543,6 +543,9 @@
|
|
|
543
543
|
.flex-shrink-0 {
|
|
544
544
|
flex-shrink: 0;
|
|
545
545
|
}
|
|
546
|
+
.shrink-0 {
|
|
547
|
+
flex-shrink: 0;
|
|
548
|
+
}
|
|
546
549
|
.origin-\[0\] {
|
|
547
550
|
transform-origin: 0;
|
|
548
551
|
}
|
|
@@ -1051,6 +1054,10 @@
|
|
|
1051
1054
|
--tw-duration: 500ms;
|
|
1052
1055
|
transition-duration: 500ms;
|
|
1053
1056
|
}
|
|
1057
|
+
.duration-600 {
|
|
1058
|
+
--tw-duration: 600ms;
|
|
1059
|
+
transition-duration: 600ms;
|
|
1060
|
+
}
|
|
1054
1061
|
.duration-1000 {
|
|
1055
1062
|
--tw-duration: 1000ms;
|
|
1056
1063
|
transition-duration: 1000ms;
|
|
@@ -1059,10 +1066,6 @@
|
|
|
1059
1066
|
--tw-duration: 400ms;
|
|
1060
1067
|
transition-duration: 400ms;
|
|
1061
1068
|
}
|
|
1062
|
-
.duration-\[600ms\] {
|
|
1063
|
-
--tw-duration: 600ms;
|
|
1064
|
-
transition-duration: 600ms;
|
|
1065
|
-
}
|
|
1066
1069
|
.ease-in-out {
|
|
1067
1070
|
--tw-ease: var(--ease-in-out);
|
|
1068
1071
|
transition-timing-function: var(--ease-in-out);
|
|
@@ -1221,16 +1224,16 @@
|
|
|
1221
1224
|
left: calc(1/2 * 100%);
|
|
1222
1225
|
}
|
|
1223
1226
|
}
|
|
1224
|
-
.before\:h
|
|
1227
|
+
.before\:h-2\.5 {
|
|
1225
1228
|
&::before {
|
|
1226
1229
|
content: var(--tw-content);
|
|
1227
|
-
height:
|
|
1230
|
+
height: calc(var(--spacing) * 2.5);
|
|
1228
1231
|
}
|
|
1229
1232
|
}
|
|
1230
|
-
.before\:w
|
|
1233
|
+
.before\:w-2\.5 {
|
|
1231
1234
|
&::before {
|
|
1232
1235
|
content: var(--tw-content);
|
|
1233
|
-
width:
|
|
1236
|
+
width: calc(var(--spacing) * 2.5);
|
|
1234
1237
|
}
|
|
1235
1238
|
}
|
|
1236
1239
|
.before\:-translate-x-1\/2 {
|
|
@@ -9,6 +9,8 @@ export type NavbarProps = {
|
|
|
9
9
|
token?: string | null;
|
|
10
10
|
disableAuthButton?: boolean;
|
|
11
11
|
profileURL?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
innerClassName?: string;
|
|
12
14
|
children: React.ReactNode;
|
|
13
15
|
};
|
|
14
|
-
export default function Navbar({ lang, onlyLogo,
|
|
16
|
+
export default function Navbar({ lang, onlyLogo, disableLanguageToggle, disableThemeToggle, disableAuthButton, profileURL, className, innerClassName, children, }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,15 +5,17 @@ import Link from 'next/link';
|
|
|
5
5
|
import LogoSmall from '../logo/logoSmall';
|
|
6
6
|
import LanguageToggle from '../toggle/language';
|
|
7
7
|
import ThemeToggle from '../toggle/theme';
|
|
8
|
+
import { getCookie } from 'uibee/utils';
|
|
8
9
|
import { LogOut } from 'lucide-react';
|
|
9
10
|
function hamburgerStyle(isOpen, isSecond) {
|
|
10
11
|
return `bg-login-50 h-0.5 absolute w-8 transition-all duration-[400ms] left-2 ${isOpen
|
|
11
12
|
? `top-6 ${isSecond ? 'rotate-45' : '-rotate-45'}`
|
|
12
13
|
: isSecond ? 'top-7' : 'top-4'}`;
|
|
13
14
|
}
|
|
14
|
-
export default function Navbar({ lang, onlyLogo,
|
|
15
|
+
export default function Navbar({ lang, onlyLogo, disableLanguageToggle, disableThemeToggle, disableAuthButton, profileURL, className, innerClassName, children, }) {
|
|
15
16
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
16
|
-
return (_jsx("div", { className: `${isMobileMenuOpen ? 'bg-[#181818f0]' : 'bg-[#18181899]'} backdrop-blur-xl fixed top-0 z-900 w-full`, 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' : ''}
|
|
17
|
+
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}
|
|
18
|
+
`, 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 && _jsx(ThemeToggle, {}), !disableLanguageToggle && _jsx(LanguageToggle, { language: lang }), !disableAuthButton && _jsx(AuthButton, { profileURL: profileURL })] }), _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
|
|
17
19
|
transition-all duration-500 ease-in-out overflow-hidden
|
|
18
20
|
${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
|
|
19
21
|
? 'opacity-100 transform translate-y-0'
|
|
@@ -21,21 +23,22 @@ export default function Navbar({ lang, onlyLogo, token, children, disableLanguag
|
|
|
21
23
|
transitionDelay: isMobileMenuOpen ? `${index * 80}ms` : '0ms'
|
|
22
24
|
}, children: child }, index))) })] }))] }) }));
|
|
23
25
|
}
|
|
24
|
-
function AuthButton({
|
|
26
|
+
function AuthButton({ profileURL }) {
|
|
27
|
+
const token = getCookie('access_token');
|
|
25
28
|
return (_jsx("div", { className: 'rounded-[0.3rem] hover:bg-[#6464641a] h-12 w-12', children: token ? (_jsxs(_Fragment, { children: [_jsx(Link, { href: '/api/logout', prefetch: false, onClick: (e) => {
|
|
26
29
|
e.preventDefault();
|
|
27
30
|
window.location.href = '/api/logout';
|
|
28
31
|
}, className: 'grid items-center justify-center h-full w-full', children: _jsx(LogOut, { size: 24 }) }), profileURL &&
|
|
29
32
|
_jsx(Link, { href: profileURL, className: 'grid items-center justify-center h-full w-full', children: _jsx("div", { className: `relative w-[30px] h-5
|
|
30
33
|
before:content-[""] before:absolute before:top-0 before:left-1/2 before:-translate-x-1/2
|
|
31
|
-
before:w-
|
|
34
|
+
before:w-2.5 before:h-2.5 before:border-2 before:border-login-50
|
|
32
35
|
before:rounded-full before:bg-transparent
|
|
33
36
|
after:content-[""] after:absolute after:bottom-0 after:left-1/2 after:-translate-x-1/2
|
|
34
37
|
after:w-[18px] after:h-2 after:border-2 after:border-login-50
|
|
35
38
|
after:rounded-t-[22px] after:border-b-0 after:bg-transparent
|
|
36
39
|
` }) })] })) : (_jsx(Link, { href: '/api/login', className: 'grid items-center justify-center h-full w-full', children: _jsx("div", { className: `relative w-[30px] h-5
|
|
37
40
|
before:content-[""] before:absolute before:top-0 before:left-1/2 before:-translate-x-1/2
|
|
38
|
-
before:w-
|
|
41
|
+
before:w-2.5 before:h-2.5 before:border-2 before:border-login-50
|
|
39
42
|
before:rounded-full before:bg-transparent
|
|
40
43
|
after:content-[""] after:absolute after:bottom-0 after:left-1/2 after:-translate-x-1/2
|
|
41
44
|
after:w-[18px] after:h-2 after:border-2 after:border-login-50
|
|
@@ -13,8 +13,8 @@ export default function NavDropdown({ children, title }) {
|
|
|
13
13
|
e.stopPropagation();
|
|
14
14
|
setIsMobileDropdownOpen(!isMobileDropdownOpen);
|
|
15
15
|
}, children: _jsxs("li", { className: `list-none no-underline text-2xl leading-6 overflow-hidden
|
|
16
|
-
w-full pl-4 pr-4 rounded-[0.3rem] transition-all duration-
|
|
17
|
-
flex items-center gap-2 opacity-100 min-h-16 py-5 `, children: [_jsx("span", { children: title }), _jsx(ChevronDown, { className: `w-6 h-6 transition-transform duration-400
|
|
16
|
+
w-full pl-4 pr-4 rounded-[0.3rem] transition-all duration-600
|
|
17
|
+
flex items-center gap-2 opacity-100 min-h-16 py-5 `, children: [_jsx("span", { children: title }), _jsx(ChevronDown, { className: `w-6 h-6 transition-transform duration-400 shrink-0
|
|
18
18
|
${isMobileDropdownOpen ? 'rotate-180' : ''}` })] }) }), _jsx("div", { className: `list-none no-underline text-xl px-6 ${isMobileDropdownOpen ? 'pb-4' : ''}`, children: React.Children.map(children, (child, index) => (_jsx("div", { className: `leading-6 transition-all duration-500 group dropdown
|
|
19
19
|
${isMobileDropdownOpen ? 'h-11 opacity-100' : 'h-0 opacity-0'}
|
|
20
20
|
`, children: child }, index))) })] })] }));
|
|
@@ -7,6 +7,6 @@ export default function NavItem({ href, children, external = false, target, rel,
|
|
|
7
7
|
const linkProps = { href, target, rel, title };
|
|
8
8
|
return (_jsxs(_Fragment, { children: [_jsx(Link, { ...linkProps, className: 'hidden 800px:flex', children: _jsxs("li", { className: `${commonStyling} text-base leading-4 p-3 font-bold transition-colors link-corner-hover
|
|
9
9
|
group-[.dropdown]:p-2.5 group-[.dropdown]:pr-3 group-[.dropdown]:pl-1`, children: [icon, children, external && _jsx(ArrowUpRight, { className: 'w-6 h-6 stroke-login' })] }) }), _jsx(Link, { ...linkProps, className: '800px:hidden', children: _jsxs("li", { className: `${commonStyling} text-2xl leading-6 overflow-hidden w-auto pl-4 rounded-[0.3rem] transition-all
|
|
10
|
-
duration-
|
|
10
|
+
duration-600 opacity-100 h-16 py-5 group-[.dropdown]:p-0 group-[.dropdown]:text-lg group-[.dropdown]:h-auto
|
|
11
11
|
group-[.dropdown]:py-2.5 group-[.dropdown]:pl-4`, children: [children, external && _jsx(ArrowUpRight, { className: 'w-6 h-6 stroke-login' })] }) })] }));
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import Link from 'next/link'
|
|
|
5
5
|
import LogoSmall from '@components/logo/logoSmall'
|
|
6
6
|
import LanguageToggle from '@components/toggle/language'
|
|
7
7
|
import ThemeToggle from '@components/toggle/theme'
|
|
8
|
+
import { getCookie } from 'uibee/utils'
|
|
8
9
|
import { Language } from 'uibee/components'
|
|
9
10
|
import { LogOut } from 'lucide-react'
|
|
10
11
|
|
|
@@ -26,26 +27,29 @@ export type NavbarProps = {
|
|
|
26
27
|
token?: string | null
|
|
27
28
|
disableAuthButton?: boolean
|
|
28
29
|
profileURL?: string
|
|
30
|
+
className?: string
|
|
31
|
+
innerClassName?: string
|
|
29
32
|
children: React.ReactNode
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
export default function Navbar({
|
|
33
36
|
lang,
|
|
34
37
|
onlyLogo,
|
|
35
|
-
token,
|
|
36
|
-
children,
|
|
37
38
|
disableLanguageToggle,
|
|
38
39
|
disableThemeToggle,
|
|
39
40
|
disableAuthButton,
|
|
40
|
-
profileURL
|
|
41
|
+
profileURL,
|
|
42
|
+
className,
|
|
43
|
+
innerClassName,
|
|
44
|
+
children,
|
|
41
45
|
}: NavbarProps) {
|
|
42
46
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
|
|
43
47
|
|
|
44
48
|
return (
|
|
45
|
-
<div className={`${isMobileMenuOpen ? 'bg-[#181818f0]' : 'bg-[#18181899]'} backdrop-blur-xl fixed top-0 z-900 w-full`}>
|
|
49
|
+
<div className={`${isMobileMenuOpen ? 'bg-[#181818f0]' : 'bg-[#18181899]'} backdrop-blur-xl fixed top-0 z-900 w-full ${className}`}>
|
|
46
50
|
<div className={`flex w-full max-w-6xl m-auto p-2 transition duration-500 800px:justify-between 800px:p-4 ${
|
|
47
|
-
isMobileMenuOpen ? 'h-screen bg-login-900/20 800px:h-20' : ''
|
|
48
|
-
|
|
51
|
+
isMobileMenuOpen ? 'h-screen bg-login-900/20 800px:h-20' : ''} ${innerClassName}
|
|
52
|
+
`}>
|
|
49
53
|
{/* Logo */}
|
|
50
54
|
<div className='block h-12 p-1 800px:p-0'>
|
|
51
55
|
<Link
|
|
@@ -59,7 +63,7 @@ export default function Navbar({
|
|
|
59
63
|
{onlyLogo ? null : (
|
|
60
64
|
<>
|
|
61
65
|
{/* Desktop Navigation */}
|
|
62
|
-
<nav className='hidden 800px:flex 800px:justify-between 800px:items-center 800px:w-fill max-w-
|
|
66
|
+
<nav className='hidden 800px:flex 800px:justify-between 800px:items-center 800px:w-fill max-w-200'>
|
|
63
67
|
{children}
|
|
64
68
|
</nav>
|
|
65
69
|
|
|
@@ -67,7 +71,7 @@ export default function Navbar({
|
|
|
67
71
|
<nav className='flex w-[calc(100vw-8rem)] justify-end h-12 800px:w-fit'>
|
|
68
72
|
{!disableThemeToggle && <ThemeToggle />}
|
|
69
73
|
{!disableLanguageToggle && <LanguageToggle language={lang} />}
|
|
70
|
-
{!disableAuthButton && <AuthButton
|
|
74
|
+
{!disableAuthButton && <AuthButton profileURL={profileURL} />}
|
|
71
75
|
</nav>
|
|
72
76
|
|
|
73
77
|
{/* Mobile Menu Button */}
|
|
@@ -80,7 +84,7 @@ export default function Navbar({
|
|
|
80
84
|
</button>
|
|
81
85
|
|
|
82
86
|
{/* Mobile Navigation */}
|
|
83
|
-
<nav className={`fixed top-16 w-[calc(100%-2rem)] max-w-
|
|
87
|
+
<nav className={`fixed top-16 w-[calc(100%-2rem)] max-w-140 mx-auto left-0 right-0 800px:hidden
|
|
84
88
|
transition-all duration-500 ease-in-out overflow-hidden
|
|
85
89
|
${isMobileMenuOpen ? 'max-h-[calc(100vh-4rem)] opacity-100' : 'max-h-0 opacity-0'}`}
|
|
86
90
|
onClick={() => setIsMobileMenuOpen(false)}>
|
|
@@ -107,7 +111,9 @@ export default function Navbar({
|
|
|
107
111
|
)
|
|
108
112
|
}
|
|
109
113
|
|
|
110
|
-
function AuthButton({
|
|
114
|
+
function AuthButton({ profileURL }: { profileURL?: string }) {
|
|
115
|
+
const token = getCookie('access_token')
|
|
116
|
+
|
|
111
117
|
return (
|
|
112
118
|
<div className='rounded-[0.3rem] hover:bg-[#6464641a] h-12 w-12'>
|
|
113
119
|
{token ? (
|
|
@@ -130,7 +136,7 @@ function AuthButton({ token, profileURL }: { token?: string | null, profileURL?:
|
|
|
130
136
|
>
|
|
131
137
|
<div className={`relative w-[30px] h-5
|
|
132
138
|
before:content-[""] before:absolute before:top-0 before:left-1/2 before:-translate-x-1/2
|
|
133
|
-
before:w-
|
|
139
|
+
before:w-2.5 before:h-2.5 before:border-2 before:border-login-50
|
|
134
140
|
before:rounded-full before:bg-transparent
|
|
135
141
|
after:content-[""] after:absolute after:bottom-0 after:left-1/2 after:-translate-x-1/2
|
|
136
142
|
after:w-[18px] after:h-2 after:border-2 after:border-login-50
|
|
@@ -147,7 +153,7 @@ function AuthButton({ token, profileURL }: { token?: string | null, profileURL?:
|
|
|
147
153
|
>
|
|
148
154
|
<div className={`relative w-[30px] h-5
|
|
149
155
|
before:content-[""] before:absolute before:top-0 before:left-1/2 before:-translate-x-1/2
|
|
150
|
-
before:w-
|
|
156
|
+
before:w-2.5 before:h-2.5 before:border-2 before:border-login-50
|
|
151
157
|
before:rounded-full before:bg-transparent
|
|
152
158
|
after:content-[""] after:absolute after:bottom-0 after:left-1/2 after:-translate-x-1/2
|
|
153
159
|
after:w-[18px] after:h-2 after:border-2 after:border-login-50
|
|
@@ -53,11 +53,11 @@ export default function NavDropdown({ children, title }: NavDropdownProps) {
|
|
|
53
53
|
}}
|
|
54
54
|
>
|
|
55
55
|
<li className={`list-none no-underline text-2xl leading-6 overflow-hidden
|
|
56
|
-
w-full pl-4 pr-4 rounded-[0.3rem] transition-all duration-
|
|
56
|
+
w-full pl-4 pr-4 rounded-[0.3rem] transition-all duration-600
|
|
57
57
|
flex items-center gap-2 opacity-100 min-h-16 py-5 `}
|
|
58
58
|
>
|
|
59
59
|
<span>{title}</span>
|
|
60
|
-
<ChevronDown className={`w-6 h-6 transition-transform duration-400
|
|
60
|
+
<ChevronDown className={`w-6 h-6 transition-transform duration-400 shrink-0
|
|
61
61
|
${isMobileDropdownOpen ? 'rotate-180' : ''}`}
|
|
62
62
|
/>
|
|
63
63
|
</li>
|
|
@@ -35,7 +35,7 @@ export default function NavItem({ href, children, external = false, target, rel,
|
|
|
35
35
|
{/* Mobile version */}
|
|
36
36
|
<Link {...linkProps} className='800px:hidden'>
|
|
37
37
|
<li className={`${commonStyling} text-2xl leading-6 overflow-hidden w-auto pl-4 rounded-[0.3rem] transition-all
|
|
38
|
-
duration-
|
|
38
|
+
duration-600 opacity-100 h-16 py-5 group-[.dropdown]:p-0 group-[.dropdown]:text-lg group-[.dropdown]:h-auto
|
|
39
39
|
group-[.dropdown]:py-2.5 group-[.dropdown]:pl-4`
|
|
40
40
|
}>
|
|
41
41
|
{children}
|