uibee 2.16.26 → 2.16.29
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/navbar/bubble.js +1 -1
- package/dist/src/components/navbar/navbar.d.ts +11 -11
- package/dist/src/components/navbar/navbar.js +8 -8
- package/dist/src/globals.css +4 -1
- package/package.json +1 -1
- package/src/components/navbar/bubble.tsx +1 -1
- package/src/components/navbar/navbar.tsx +30 -30
|
@@ -4,5 +4,5 @@ export default function Bubble({ bubble }) {
|
|
|
4
4
|
if (bubble.hide) {
|
|
5
5
|
return null;
|
|
6
6
|
}
|
|
7
|
-
return (_jsxs("a", { href: bubble.href, className: `
|
|
7
|
+
return (_jsxs("a", { href: bubble.href, className: `absolute top-5 min-w-10 ${bubble.className}`, children: [_jsxs("svg", { viewBox: '0 0 24 12', className: 'absolute -top-3 h-3 w-6', "aria-hidden": 'true', children: [_jsx("path", { d: 'M12 0 24 12H0Z', fill: bubble.fill, stroke: bubble.stroke, strokeWidth: '1.5', strokeLinejoin: 'round' }), _jsx("path", { d: 'M12 0 24 12H0Z', fill: bubble.fill })] }), _jsxs("div", { className: 'flex justify-between', children: [_jsx("span", { children: bubble.text }), _jsx(X, { onClick: bubble.handleHide, className: bubble.x })] })] }));
|
|
8
8
|
}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Language } from 'uibee/components';
|
|
3
|
-
type BubbleContent = {
|
|
4
|
-
condition: boolean;
|
|
5
|
-
href: string;
|
|
6
|
-
className: string;
|
|
7
|
-
text: string;
|
|
8
|
-
fill: string;
|
|
9
|
-
stroke: string;
|
|
10
|
-
x: string;
|
|
11
|
-
hide: boolean;
|
|
12
|
-
handleHide: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
|
|
13
|
-
};
|
|
14
3
|
export type NavbarProps = {
|
|
15
4
|
children: React.ReactNode;
|
|
16
5
|
bubble?: {
|
|
@@ -30,5 +19,16 @@ export type NavbarProps = {
|
|
|
30
19
|
theme?: string;
|
|
31
20
|
token?: string | null;
|
|
32
21
|
};
|
|
22
|
+
type BubbleContent = {
|
|
23
|
+
condition: boolean;
|
|
24
|
+
href: string;
|
|
25
|
+
className: string;
|
|
26
|
+
text: string;
|
|
27
|
+
fill: string;
|
|
28
|
+
stroke: string;
|
|
29
|
+
x: string;
|
|
30
|
+
hide: boolean;
|
|
31
|
+
handleHide: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
|
|
32
|
+
};
|
|
33
33
|
export default function Navbar({ children, bubble, className, disableLanguageToggle, disableThemeToggle, innerClassName, lang, loginPath, logoutPath, onlyLogo, profilePath, token }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
34
34
|
export {};
|
|
@@ -7,17 +7,12 @@ import LanguageToggle from '../toggle/language';
|
|
|
7
7
|
import ThemeToggle from '../toggle/theme';
|
|
8
8
|
import { LogOut, User } from 'lucide-react';
|
|
9
9
|
import Bubble from './bubble';
|
|
10
|
-
function hamburgerStyle(isOpen, isSecond) {
|
|
11
|
-
return `bg-login-50 h-0.5 absolute w-8 transition-all duration-[400ms] left-2 ${isOpen
|
|
12
|
-
? `top-6 ${isSecond ? 'rotate-45' : '-rotate-45'}`
|
|
13
|
-
: isSecond ? 'top-7' : 'top-4'}`;
|
|
14
|
-
}
|
|
15
10
|
export default function Navbar({ children, bubble, className, disableLanguageToggle, disableThemeToggle, innerClassName, lang, loginPath, logoutPath, onlyLogo, profilePath, token }) {
|
|
16
11
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
17
12
|
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: [_jsxs("div", { className: 'grid gap-2', children: [!disableThemeToggle &&
|
|
19
|
-
_jsx(ThemeToggle, {}), bubble?.theme?.condition && _jsx(Bubble, { bubble: bubble.theme })] }), _jsxs("div", { className: 'grid gap-2', children: [!disableLanguageToggle &&
|
|
20
|
-
_jsx(LanguageToggle, { language: lang }), bubble?.lang?.condition && _jsx(Bubble, { bubble: bubble.lang })] }), _jsxs("div", { className: 'grid gap-2', children: [loginPath && logoutPath &&
|
|
13
|
+
`, 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: [_jsxs("div", { className: 'relative grid gap-2', children: [!disableThemeToggle &&
|
|
14
|
+
_jsx(ThemeToggle, {}), bubble?.theme?.condition && _jsx(Bubble, { bubble: bubble.theme })] }), _jsxs("div", { className: 'relative grid gap-2', children: [!disableLanguageToggle &&
|
|
15
|
+
_jsx(LanguageToggle, { language: lang }), bubble?.lang?.condition && _jsx(Bubble, { bubble: bubble.lang })] }), _jsxs("div", { className: 'relative grid gap-2', children: [loginPath && logoutPath &&
|
|
21
16
|
_jsx(AuthButton, { profilePath: profilePath, token: token, loginPath: loginPath, logoutPath: logoutPath }), bubble?.login?.condition && _jsx(Bubble, { bubble: bubble.login })] })] }), _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
|
|
22
17
|
transition-all duration-500 ease-in-out overflow-hidden
|
|
23
18
|
${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
|
|
@@ -34,3 +29,8 @@ function AuthButton({ profilePath, logoutPath, loginPath, token }) {
|
|
|
34
29
|
}, className: 'grid items-center justify-center h-full w-full', children: _jsx(LogOut, { size: 24 }) }), profilePath &&
|
|
35
30
|
_jsx(Link, { href: profilePath, className: 'grid items-center justify-center h-full w-full', children: _jsx(User, { size: 24 }) })] })) : (_jsx(Link, { href: loginPath, className: 'grid items-center justify-center h-full w-full', children: _jsx(User, { size: 24 }) })) }));
|
|
36
31
|
}
|
|
32
|
+
function hamburgerStyle(isOpen, isSecond) {
|
|
33
|
+
return `bg-login-50 h-0.5 absolute w-8 transition-all duration-[400ms] left-2 ${isOpen
|
|
34
|
+
? `top-6 ${isSecond ? 'rotate-45' : '-rotate-45'}`
|
|
35
|
+
: isSecond ? 'top-7' : 'top-4'}`;
|
|
36
|
+
}
|
package/dist/src/globals.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.2.
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -348,6 +348,9 @@
|
|
|
348
348
|
.top-4 {
|
|
349
349
|
top: calc(var(--spacing) * 4);
|
|
350
350
|
}
|
|
351
|
+
.top-5 {
|
|
352
|
+
top: calc(var(--spacing) * 5);
|
|
353
|
+
}
|
|
351
354
|
.top-6 {
|
|
352
355
|
top: calc(var(--spacing) * 6);
|
|
353
356
|
}
|
package/package.json
CHANGED
|
@@ -9,26 +9,6 @@ import { Language } from 'uibee/components'
|
|
|
9
9
|
import { LogOut, User } from 'lucide-react'
|
|
10
10
|
import Bubble from './bubble'
|
|
11
11
|
|
|
12
|
-
type BubbleContent = {
|
|
13
|
-
condition: boolean
|
|
14
|
-
href: string
|
|
15
|
-
className: string
|
|
16
|
-
text: string
|
|
17
|
-
fill: string
|
|
18
|
-
stroke: string
|
|
19
|
-
x: string
|
|
20
|
-
hide: boolean
|
|
21
|
-
handleHide: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function hamburgerStyle (isOpen: boolean, isSecond?: boolean) {
|
|
25
|
-
return `bg-login-50 h-0.5 absolute w-8 transition-all duration-[400ms] left-2 ${
|
|
26
|
-
isOpen
|
|
27
|
-
? `top-6 ${isSecond ? 'rotate-45' : '-rotate-45'}`
|
|
28
|
-
: isSecond ? 'top-7' : 'top-4'
|
|
29
|
-
}`
|
|
30
|
-
}
|
|
31
|
-
|
|
32
12
|
export type NavbarProps = {
|
|
33
13
|
children: React.ReactNode
|
|
34
14
|
bubble?: {
|
|
@@ -49,6 +29,25 @@ export type NavbarProps = {
|
|
|
49
29
|
token?: string | null
|
|
50
30
|
}
|
|
51
31
|
|
|
32
|
+
type BubbleContent = {
|
|
33
|
+
condition: boolean
|
|
34
|
+
href: string
|
|
35
|
+
className: string
|
|
36
|
+
text: string
|
|
37
|
+
fill: string
|
|
38
|
+
stroke: string
|
|
39
|
+
x: string
|
|
40
|
+
hide: boolean
|
|
41
|
+
handleHide: (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => void
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type AuthButtonProps = {
|
|
45
|
+
profilePath?: string
|
|
46
|
+
logoutPath: string
|
|
47
|
+
loginPath: string
|
|
48
|
+
token?: string | null
|
|
49
|
+
}
|
|
50
|
+
|
|
52
51
|
export default function Navbar({
|
|
53
52
|
children,
|
|
54
53
|
bubble,
|
|
@@ -89,13 +88,13 @@ export default function Navbar({
|
|
|
89
88
|
|
|
90
89
|
{/* Controls */}
|
|
91
90
|
<nav className='flex w-[calc(100vw-8rem)] justify-end h-12 800px:w-fit'>
|
|
92
|
-
<div className='grid gap-2'>
|
|
91
|
+
<div className='relative grid gap-2'>
|
|
93
92
|
{!disableThemeToggle &&
|
|
94
93
|
<ThemeToggle />
|
|
95
94
|
}
|
|
96
95
|
{bubble?.theme?.condition && <Bubble bubble={bubble.theme} />}
|
|
97
96
|
</div>
|
|
98
|
-
<div className='grid gap-2'>
|
|
97
|
+
<div className='relative grid gap-2'>
|
|
99
98
|
{!disableLanguageToggle &&
|
|
100
99
|
<LanguageToggle
|
|
101
100
|
language={lang}
|
|
@@ -103,7 +102,7 @@ export default function Navbar({
|
|
|
103
102
|
}
|
|
104
103
|
{bubble?.lang?.condition && <Bubble bubble={bubble.lang} />}
|
|
105
104
|
</div>
|
|
106
|
-
<div className='grid gap-2'>
|
|
105
|
+
<div className='relative grid gap-2'>
|
|
107
106
|
{loginPath && logoutPath &&
|
|
108
107
|
<AuthButton
|
|
109
108
|
profilePath={profilePath}
|
|
@@ -153,13 +152,6 @@ export default function Navbar({
|
|
|
153
152
|
)
|
|
154
153
|
}
|
|
155
154
|
|
|
156
|
-
type AuthButtonProps = {
|
|
157
|
-
profilePath?: string
|
|
158
|
-
logoutPath: string
|
|
159
|
-
loginPath: string
|
|
160
|
-
token?: string | null
|
|
161
|
-
}
|
|
162
|
-
|
|
163
155
|
function AuthButton({ profilePath, logoutPath, loginPath, token }: AuthButtonProps) {
|
|
164
156
|
return (
|
|
165
157
|
<div className='rounded-[0.3rem] hover:bg-login-300/20 h-12 w-12'>
|
|
@@ -198,3 +190,11 @@ function AuthButton({ profilePath, logoutPath, loginPath, token }: AuthButtonPro
|
|
|
198
190
|
</div>
|
|
199
191
|
)
|
|
200
192
|
}
|
|
193
|
+
|
|
194
|
+
function hamburgerStyle (isOpen: boolean, isSecond?: boolean) {
|
|
195
|
+
return `bg-login-50 h-0.5 absolute w-8 transition-all duration-[400ms] left-2 ${
|
|
196
|
+
isOpen
|
|
197
|
+
? `top-6 ${isSecond ? 'rotate-45' : '-rotate-45'}`
|
|
198
|
+
: isSecond ? 'top-7' : 'top-4'
|
|
199
|
+
}`
|
|
200
|
+
}
|