uibee 2.5.0 → 2.5.1

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.
@@ -4,9 +4,10 @@ type ButtonProps = {
4
4
  className?: string;
5
5
  icon?: string | JSX.Element;
6
6
  path?: string;
7
+ type?: 'button' | 'submit' | 'reset';
7
8
  color?: 'primary' | 'secondary';
8
9
  onClick?: (_: object) => void;
9
10
  disabled?: boolean;
10
11
  };
11
- export default function Button({ text, className, icon, path, color, onClick, disabled }: ButtonProps): import("react/jsx-runtime").JSX.Element;
12
+ export default function Button({ text, className, icon, path, color, type, onClick, disabled }: ButtonProps): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from 'next/link';
3
- export default function Button({ text, className, icon, path, color, onClick, disabled }) {
3
+ export default function Button({ text, className, icon, path, color, type, onClick, disabled }) {
4
4
  const bg = color === 'secondary'
5
5
  ? 'bg-login-600/70 outline-login-600 hover:bg-login-600/90'
6
6
  : 'bg-login/70 outline-login hover:bg-login/90';
7
7
  if (!path) {
8
- return (_jsxs("button", { type: 'button', disabled: disabled, onClick: onClick, "aria-label": text, className: `
8
+ return (_jsxs("button", { type: type || 'button', disabled: disabled, onClick: onClick, "aria-label": text, className: `
9
9
  ${bg} cursor-pointer px-4 rounded-md h-6 flex
10
10
  justify-evenly items-center gap-2 select-none
11
11
  focus:outline-none border-0 outline w-fit ${className}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  export default function Label({ label, value, required, showRequired, className, color }) {
3
3
  return (_jsx("label", { className: 'w-[calc(100%-10px)] truncate pointer-events-none absolute text-sm duration-300 transform z-10 ' +
4
- 'peer-focus:px-2 peer-focus:top-2 origin-[0] px-2 pt-1 peer-focus:scale-75 peer-focus:-translate-y-5 start-2 ' +
4
+ 'peer-focus:px-2 peer-focus:top-2 origin-left px-2 pt-1 peer-focus:scale-75 peer-focus:-translate-y-5 start-2 ' +
5
5
  `${color ? color : 'bg-login-800'} ` +
6
6
  `${value ? '-translate-y-5 scale-75 top-2 w-fit '
7
7
  : '-translate-y-1/2 scale-100 top-1/2 '
@@ -72,7 +72,7 @@ export default function Toaster() {
72
72
  top: mainToastPosition ? `${mainToastPosition.top - idx * 8}px` : 'auto',
73
73
  zIndex: 100 - idx,
74
74
  transform: `scale(${1 - idx * 0.05})`,
75
- }, children: [_jsx("span", { className: 'flex-shrink-0 w-10 h-10 flex items-center justify-center', children: _jsx(ToastIcon, { type: toast.type }) }), _jsxs("div", { className: 'pr-1 pb-1', children: [_jsx("span", { className: 'font-bold', children: toast.title }), (idx === 0 || isHovered) &&
75
+ }, children: [_jsx("span", { className: 'shrink-0 w-10 h-10 flex items-center justify-center', children: _jsx(ToastIcon, { type: toast.type }) }), _jsxs("div", { className: 'pr-1 pb-1', children: [_jsx("span", { className: 'font-bold', children: toast.title }), (idx === 0 || isHovered) &&
76
76
  _jsx("span", { className: 'text-sm line-clamp-3', children: toast.description })] })] }, `${toast.id}-${idx}`))) }));
77
77
  }
78
78
  function ToastIcon({ type }) {
@@ -537,18 +537,15 @@
537
537
  .flex-1 {
538
538
  flex: 1;
539
539
  }
540
- .flex-shrink-0 {
541
- flex-shrink: 0;
542
- }
543
540
  .shrink-0 {
544
541
  flex-shrink: 0;
545
542
  }
546
- .origin-\[0\] {
547
- transform-origin: 0;
548
- }
549
543
  .origin-center {
550
544
  transform-origin: center;
551
545
  }
546
+ .origin-left {
547
+ transform-origin: 0;
548
+ }
552
549
  .translate-x-4 {
553
550
  --tw-translate-x: calc(var(--spacing) * 4);
554
551
  translate: var(--tw-translate-x) var(--tw-translate-y);
@@ -1629,4 +1626,4 @@
1629
1626
  --tw-content: "";
1630
1627
  }
1631
1628
  }
1632
- }
1629
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uibee",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
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,6 +6,7 @@ type ButtonProps = {
6
6
  className?: string
7
7
  icon?: string | JSX.Element
8
8
  path?: string
9
+ type?: 'button' | 'submit' | 'reset'
9
10
  color?: 'primary' | 'secondary'
10
11
  onClick?: (_: object) => void
11
12
  disabled?: boolean
@@ -17,6 +18,7 @@ export default function Button({
17
18
  icon,
18
19
  path,
19
20
  color,
21
+ type,
20
22
  onClick,
21
23
  disabled
22
24
  }: ButtonProps) {
@@ -27,7 +29,7 @@ export default function Button({
27
29
  if (!path) {
28
30
  return (
29
31
  <button
30
- type='button'
32
+ type={type || 'button'}
31
33
  disabled={disabled}
32
34
  onClick={onClick}
33
35
  aria-label={text}
@@ -13,7 +13,7 @@ export default function Label({ label, value, required, showRequired, className,
13
13
  <label
14
14
  className={
15
15
  'w-[calc(100%-10px)] truncate pointer-events-none absolute text-sm duration-300 transform z-10 ' +
16
- 'peer-focus:px-2 peer-focus:top-2 origin-[0] px-2 pt-1 peer-focus:scale-75 peer-focus:-translate-y-5 start-2 ' +
16
+ 'peer-focus:px-2 peer-focus:top-2 origin-left px-2 pt-1 peer-focus:scale-75 peer-focus:-translate-y-5 start-2 ' +
17
17
  `${color ? color : 'bg-login-800'} ` +
18
18
  `${value ? '-translate-y-5 scale-75 top-2 w-fit '
19
19
  : '-translate-y-1/2 scale-100 top-1/2 '
@@ -200,5 +200,3 @@ function SelectedOption({ value, selectedOption }: SelectedOptionProps) {
200
200
  </div>
201
201
  )
202
202
  }
203
-
204
-
@@ -84,4 +84,4 @@ export default function NavDropdown({ children, title, className }: NavDropdownP
84
84
  </div>
85
85
  </>
86
86
  )
87
- }
87
+ }
@@ -44,4 +44,4 @@ export default function NavItem({ href, children, external = false, target, rel,
44
44
  </Link>
45
45
  </>
46
46
  )
47
- }
47
+ }
@@ -94,7 +94,7 @@ export default function Toaster() {
94
94
  transform: `scale(${1 - idx * 0.05})`,
95
95
  }}
96
96
  >
97
- <span className='flex-shrink-0 w-10 h-10 flex items-center justify-center'>
97
+ <span className='shrink-0 w-10 h-10 flex items-center justify-center'>
98
98
  <ToastIcon type={toast.type} />
99
99
  </span>
100
100
  <div className='pr-1 pb-1'>
@@ -147,4 +147,4 @@ function ThemeIcon({ theme }: { theme: 'dark' | 'light' }) {
147
147
  />
148
148
  </svg>
149
149
  )
150
- }
150
+ }
@@ -31,4 +31,4 @@ export default function VersionTag({version, url, className}: VersionTagProps) {
31
31
  v{version}
32
32
  </div>
33
33
  )
34
- }
34
+ }
package/src/globals.css CHANGED
@@ -183,4 +183,4 @@
183
183
  padding: .5rem 0 .5rem 1rem;
184
184
  font-size: 1.2rem;
185
185
  font-weight: 500;
186
- }
186
+ }
@@ -86,4 +86,4 @@ export default async function authCallback({
86
86
  console.error('Error during OAuth flow:', error.message)
87
87
  return NextResponse.json({ error: 'Authentication failed' }, { status: 500 })
88
88
  }
89
- }
89
+ }
@@ -29,4 +29,4 @@ export default async function AuthToken({ req, frontendURL, redirectPath }: Auth
29
29
  response.cookies.set('user_groups', userGroups)
30
30
 
31
31
  return response
32
- }
32
+ }
@@ -40,4 +40,4 @@ export function removeCookies(...cookies: string[]) {
40
40
  for (const cookie of cookies) {
41
41
  removeCookie(cookie)
42
42
  }
43
- }
43
+ }