uibee 2.16.10 → 2.16.12

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,4 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  export default function Bubble({ href, className, fill, stroke, text }) {
3
- return (_jsxs("a", { href: href, className: className, children: [_jsxs("svg", { viewBox: '0 0 24 12', className: 'absolute -top-[0.68rem] right-6 h-3 w-6', "aria-hidden": 'true', children: [_jsx("path", { d: 'M12 0 24 12H0Z', fill: fill, stroke: stroke, strokeWidth: '1.5', strokeLinejoin: 'round' }), _jsx("path", { d: 'M12 0 24 12H0Z', fill: fill })] }), _jsx("span", { children: text })] }));
3
+ return (_jsxs("a", { href: href, className: className, children: [_jsxs("svg", { viewBox: '0 0 24 12', className: 'absolute -top-[0.65rem] right-6 h-3 w-6', "aria-hidden": 'true', children: [_jsx("path", { d: 'M12 0 24 12H0Z', fill: fill, stroke: stroke, strokeWidth: '1.5', strokeLinejoin: 'round' }), _jsx("path", { d: 'M12 0 24 12H0Z', fill: fill })] }), _jsx("span", { children: text })] }));
4
4
  }
@@ -9,12 +9,12 @@ type BubbleContent = {
9
9
  stroke: string;
10
10
  };
11
11
  export type NavbarProps = {
12
+ children: React.ReactNode;
12
13
  bubble?: {
13
14
  lang?: BubbleContent;
14
15
  theme?: BubbleContent;
15
16
  login?: BubbleContent;
16
17
  };
17
- children: React.ReactNode;
18
18
  className?: string;
19
19
  disableLanguageToggle?: boolean;
20
20
  disableThemeToggle?: boolean;
@@ -27,5 +27,5 @@ export type NavbarProps = {
27
27
  theme?: string;
28
28
  token?: string | null;
29
29
  };
30
- export default function Navbar({ lang, onlyLogo, disableLanguageToggle, disableThemeToggle, token, profilePath, loginPath, logoutPath, className, innerClassName, children, bubble }: NavbarProps): import("react/jsx-runtime").JSX.Element;
30
+ export default function Navbar({ children, bubble, className, disableLanguageToggle, disableThemeToggle, innerClassName, lang, loginPath, logoutPath, onlyLogo, profilePath, token }: NavbarProps): import("react/jsx-runtime").JSX.Element;
31
31
  export {};
@@ -12,13 +12,13 @@ function hamburgerStyle(isOpen, isSecond) {
12
12
  ? `top-6 ${isSecond ? 'rotate-45' : '-rotate-45'}`
13
13
  : isSecond ? 'top-7' : 'top-4'}`;
14
14
  }
15
- export default function Navbar({ lang, onlyLogo, disableLanguageToggle, disableThemeToggle, token, profilePath, loginPath, logoutPath, className, innerClassName, children, bubble }) {
15
+ export default function Navbar({ children, bubble, className, disableLanguageToggle, disableThemeToggle, innerClassName, lang, loginPath, logoutPath, onlyLogo, profilePath, token }) {
16
16
  const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
17
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 &&
19
- _jsx(ThemeToggle, {}), bubble?.theme?.condition && _jsx(Bubble, { href: bubble.theme.href, className: bubble.theme.className, text: bubble.theme.text, fill: bubble.theme.fill, stroke: bubble.theme.stroke }), !disableLanguageToggle &&
20
- _jsx(LanguageToggle, { language: lang }), bubble?.lang?.condition && _jsx(Bubble, { href: bubble.lang.href, className: bubble.lang.className, text: bubble.lang.text, fill: bubble.lang.fill, stroke: bubble.lang.stroke }), loginPath && logoutPath &&
21
- _jsx(AuthButton, { profilePath: profilePath, token: token, loginPath: loginPath, logoutPath: logoutPath }), bubble?.login?.condition && _jsx(Bubble, { href: bubble.login.href, className: bubble.login.className, text: bubble.login.text, fill: bubble.login.fill, stroke: bubble.login.stroke })] }), _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
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, { href: bubble.theme.href, className: bubble.theme.className, text: bubble.theme.text, fill: bubble.theme.fill, stroke: bubble.theme.stroke })] }), _jsxs("div", { className: 'grid gap-2', children: [!disableLanguageToggle &&
20
+ _jsx(LanguageToggle, { language: lang }), bubble?.lang?.condition && _jsx(Bubble, { href: bubble.lang.href, className: bubble.lang.className, text: bubble.lang.text, fill: bubble.lang.fill, stroke: bubble.lang.stroke })] }), _jsxs("div", { className: 'grid gap-2', children: [loginPath && logoutPath &&
21
+ _jsx(AuthButton, { profilePath: profilePath, token: token, loginPath: loginPath, logoutPath: logoutPath }), bubble?.login?.condition && _jsx(Bubble, { href: bubble.login.href, className: bubble.login.className, text: bubble.login.text, fill: bubble.login.fill, stroke: bubble.login.stroke })] })] }), _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
22
  transition-all duration-500 ease-in-out overflow-hidden
23
23
  ${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
24
24
  ? 'opacity-100 transform translate-y-0'
@@ -333,8 +333,8 @@
333
333
  .end {
334
334
  inset-inline-end: var(--spacing);
335
335
  }
336
- .-top-\[0\.68rem\] {
337
- top: calc(0.68rem * -1);
336
+ .-top-\[0\.65rem\] {
337
+ top: calc(0.65rem * -1);
338
338
  }
339
339
  .top-0 {
340
340
  top: calc(var(--spacing) * 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uibee",
3
- "version": "2.16.10",
3
+ "version": "2.16.12",
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": {
@@ -14,7 +14,7 @@ export default function Bubble({ href, className, fill, stroke, text }: BubbleTe
14
14
  >
15
15
  <svg
16
16
  viewBox='0 0 24 12'
17
- className='absolute -top-[0.68rem] right-6 h-3 w-6'
17
+ className='absolute -top-[0.65rem] right-6 h-3 w-6'
18
18
  aria-hidden='true'
19
19
  >
20
20
  <path
@@ -27,12 +27,12 @@ function hamburgerStyle (isOpen: boolean, isSecond?: boolean) {
27
27
  }
28
28
 
29
29
  export type NavbarProps = {
30
+ children: React.ReactNode
30
31
  bubble?: {
31
32
  lang?: BubbleContent
32
33
  theme?: BubbleContent
33
34
  login?: BubbleContent
34
35
  }
35
- children: React.ReactNode
36
36
  className?: string
37
37
  disableLanguageToggle?: boolean
38
38
  disableThemeToggle?: boolean
@@ -47,18 +47,18 @@ export type NavbarProps = {
47
47
  }
48
48
 
49
49
  export default function Navbar({
50
- lang,
51
- onlyLogo,
50
+ children,
51
+ bubble,
52
+ className,
52
53
  disableLanguageToggle,
53
54
  disableThemeToggle,
54
- token,
55
- profilePath,
55
+ innerClassName,
56
+ lang,
56
57
  loginPath,
57
58
  logoutPath,
58
- className,
59
- innerClassName,
60
- children,
61
- bubble
59
+ onlyLogo,
60
+ profilePath,
61
+ token
62
62
  }: NavbarProps) {
63
63
  const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
64
64
 
@@ -86,43 +86,49 @@ export default function Navbar({
86
86
 
87
87
  {/* Controls */}
88
88
  <nav className='flex w-[calc(100vw-8rem)] justify-end h-12 800px:w-fit'>
89
- {!disableThemeToggle &&
90
- <ThemeToggle />
91
- }
92
- {bubble?.theme?.condition && <Bubble
93
- href={bubble.theme.href}
94
- className={bubble.theme.className}
95
- text={bubble.theme.text}
96
- fill={bubble.theme.fill}
97
- stroke={bubble.theme.stroke}
98
- />}
99
- {!disableLanguageToggle &&
100
- <LanguageToggle
101
- language={lang}
102
- />
103
- }
104
- {bubble?.lang?.condition && <Bubble
105
- href={bubble.lang.href}
106
- className={bubble.lang.className}
107
- text={bubble.lang.text}
108
- fill={bubble.lang.fill}
109
- stroke={bubble.lang.stroke}
110
- />}
111
- {loginPath && logoutPath &&
112
- <AuthButton
113
- profilePath={profilePath}
114
- token={token}
115
- loginPath={loginPath}
116
- logoutPath={logoutPath}
117
- />
118
- }
119
- {bubble?.login?.condition && <Bubble
120
- href={bubble.login.href}
121
- className={bubble.login.className}
122
- text={bubble.login.text}
123
- fill={bubble.login.fill}
124
- stroke={bubble.login.stroke}
125
- />}
89
+ <div className='grid gap-2'>
90
+ {!disableThemeToggle &&
91
+ <ThemeToggle />
92
+ }
93
+ {bubble?.theme?.condition && <Bubble
94
+ href={bubble.theme.href}
95
+ className={bubble.theme.className}
96
+ text={bubble.theme.text}
97
+ fill={bubble.theme.fill}
98
+ stroke={bubble.theme.stroke}
99
+ />}
100
+ </div>
101
+ <div className='grid gap-2'>
102
+ {!disableLanguageToggle &&
103
+ <LanguageToggle
104
+ language={lang}
105
+ />
106
+ }
107
+ {bubble?.lang?.condition && <Bubble
108
+ href={bubble.lang.href}
109
+ className={bubble.lang.className}
110
+ text={bubble.lang.text}
111
+ fill={bubble.lang.fill}
112
+ stroke={bubble.lang.stroke}
113
+ />}
114
+ </div>
115
+ <div className='grid gap-2'>
116
+ {loginPath && logoutPath &&
117
+ <AuthButton
118
+ profilePath={profilePath}
119
+ token={token}
120
+ loginPath={loginPath}
121
+ logoutPath={logoutPath}
122
+ />
123
+ }
124
+ {bubble?.login?.condition && <Bubble
125
+ href={bubble.login.href}
126
+ className={bubble.login.className}
127
+ text={bubble.login.text}
128
+ fill={bubble.login.fill}
129
+ stroke={bubble.login.stroke}
130
+ />}
131
+ </div>
126
132
  </nav>
127
133
 
128
134
  {/* Mobile Menu Button */}