uibee 2.4.13 → 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.
- package/dist/src/components/buttons/button.d.ts +13 -0
- package/dist/src/components/buttons/button.js +24 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.js +2 -0
- package/dist/src/components/inputs/label.js +1 -1
- package/dist/src/components/toast/toaster.js +1 -1
- package/dist/src/globals.css +66 -7
- package/package.json +1 -1
- package/src/components/buttons/button.tsx +74 -0
- package/src/components/container/highlight.tsx +1 -1
- package/src/components/index.ts +3 -0
- package/src/components/inputs/label.tsx +1 -1
- package/src/components/inputs/select.tsx +0 -2
- package/src/components/navbar/navbarDropdown.tsx +1 -1
- package/src/components/navbar/navbarItem.tsx +1 -1
- package/src/components/toast/toaster.tsx +1 -1
- package/src/components/toggle/theme.tsx +1 -1
- package/src/components/version/version.tsx +1 -1
- package/src/globals.css +1 -1
- package/src/utils/auth/callback.ts +1 -1
- package/src/utils/auth/token.ts +1 -1
- package/src/utils/cookies/cookies.ts +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
type ButtonProps = {
|
|
3
|
+
text: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
icon?: string | JSX.Element;
|
|
6
|
+
path?: string;
|
|
7
|
+
type?: 'button' | 'submit' | 'reset';
|
|
8
|
+
color?: 'primary' | 'secondary';
|
|
9
|
+
onClick?: (_: object) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export default function Button({ text, className, icon, path, color, type, onClick, disabled }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
export default function Button({ text, className, icon, path, color, type, onClick, disabled }) {
|
|
4
|
+
const bg = color === 'secondary'
|
|
5
|
+
? 'bg-login-600/70 outline-login-600 hover:bg-login-600/90'
|
|
6
|
+
: 'bg-login/70 outline-login hover:bg-login/90';
|
|
7
|
+
if (!path) {
|
|
8
|
+
return (_jsxs("button", { type: type || 'button', disabled: disabled, onClick: onClick, "aria-label": text, className: `
|
|
9
|
+
${bg} cursor-pointer px-4 rounded-md h-6 flex
|
|
10
|
+
justify-evenly items-center gap-2 select-none
|
|
11
|
+
focus:outline-none border-0 outline w-fit ${className}
|
|
12
|
+
`, children: [_jsx("h1", { className: 'font-bold', children: icon ? icon : '' }), _jsx("h1", { children: text })] }));
|
|
13
|
+
}
|
|
14
|
+
if (disabled) {
|
|
15
|
+
return (_jsxs("div", { className: `
|
|
16
|
+
${bg} cursor-not-allowed px-4 rounded-md h-6 flex
|
|
17
|
+
justify-evenly items-center gap-2 select-none
|
|
18
|
+
`, children: [_jsx("h1", { className: 'font-bold', children: icon ? `${icon}` : '' }), _jsx("h1", { className: '', children: text })] }));
|
|
19
|
+
}
|
|
20
|
+
return (_jsxs(Link, { href: path, className: `
|
|
21
|
+
${bg} cursor-pointer px-4 rounded-md h-6 flex
|
|
22
|
+
justify-evenly items-center gap-2 select-none
|
|
23
|
+
`, children: [_jsx("h1", { className: 'font-bold', children: icon ? `${icon}` : '' }), _jsx("h1", { className: '', children: text })] }));
|
|
24
|
+
}
|
|
@@ -15,3 +15,4 @@ export { default as Highlight } from './container/highlight';
|
|
|
15
15
|
export { default as VersionTag } from './version/version';
|
|
16
16
|
export { default as LoginPage } from './login/loginPage';
|
|
17
17
|
export { default as Toaster, addToast } from './toast/toaster';
|
|
18
|
+
export { default as Button } from './buttons/button';
|
|
@@ -21,3 +21,5 @@ export { default as Highlight } from './container/highlight';
|
|
|
21
21
|
export { default as VersionTag } from './version/version';
|
|
22
22
|
export { default as LoginPage } from './login/loginPage';
|
|
23
23
|
export { default as Toaster, addToast } from './toast/toaster';
|
|
24
|
+
// Buttons
|
|
25
|
+
export { default as Button } from './buttons/button';
|
|
@@ -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-
|
|
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: '
|
|
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 }) {
|
package/dist/src/globals.css
CHANGED
|
@@ -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);
|
|
@@ -603,6 +600,9 @@
|
|
|
603
600
|
.animate-jump {
|
|
604
601
|
animation: jump 0.4s 1;
|
|
605
602
|
}
|
|
603
|
+
.cursor-not-allowed {
|
|
604
|
+
cursor: not-allowed;
|
|
605
|
+
}
|
|
606
606
|
.cursor-pointer {
|
|
607
607
|
cursor: pointer;
|
|
608
608
|
}
|
|
@@ -642,6 +642,9 @@
|
|
|
642
642
|
.justify-end {
|
|
643
643
|
justify-content: flex-end;
|
|
644
644
|
}
|
|
645
|
+
.justify-evenly {
|
|
646
|
+
justify-content: space-evenly;
|
|
647
|
+
}
|
|
645
648
|
.gap-0\.5 {
|
|
646
649
|
gap: calc(var(--spacing) * 0.5);
|
|
647
650
|
}
|
|
@@ -696,6 +699,10 @@
|
|
|
696
699
|
border-style: var(--tw-border-style);
|
|
697
700
|
border-width: 1px;
|
|
698
701
|
}
|
|
702
|
+
.border-0 {
|
|
703
|
+
border-style: var(--tw-border-style);
|
|
704
|
+
border-width: 0px;
|
|
705
|
+
}
|
|
699
706
|
.border-\[0\.10rem\] {
|
|
700
707
|
border-style: var(--tw-border-style);
|
|
701
708
|
border-width: 0.10rem;
|
|
@@ -729,6 +736,12 @@
|
|
|
729
736
|
.bg-login-600 {
|
|
730
737
|
background-color: var(--color-login-600);
|
|
731
738
|
}
|
|
739
|
+
.bg-login-600\/70 {
|
|
740
|
+
background-color: color-mix(in srgb, #212121 70%, transparent);
|
|
741
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
742
|
+
background-color: color-mix(in oklab, var(--color-login-600) 70%, transparent);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
732
745
|
.bg-login-700 {
|
|
733
746
|
background-color: var(--color-login-700);
|
|
734
747
|
}
|
|
@@ -750,6 +763,12 @@
|
|
|
750
763
|
background-color: color-mix(in oklab, var(--color-login-900) 20%, transparent);
|
|
751
764
|
}
|
|
752
765
|
}
|
|
766
|
+
.bg-login\/70 {
|
|
767
|
+
background-color: color-mix(in srgb, #fd8738 70%, transparent);
|
|
768
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
769
|
+
background-color: color-mix(in oklab, var(--color-login) 70%, transparent);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
753
772
|
.bg-transparent {
|
|
754
773
|
background-color: transparent;
|
|
755
774
|
}
|
|
@@ -1002,6 +1021,16 @@
|
|
|
1002
1021
|
--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
1003
1022
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
1004
1023
|
}
|
|
1024
|
+
.outline {
|
|
1025
|
+
outline-style: var(--tw-outline-style);
|
|
1026
|
+
outline-width: 1px;
|
|
1027
|
+
}
|
|
1028
|
+
.outline-login {
|
|
1029
|
+
outline-color: var(--color-login);
|
|
1030
|
+
}
|
|
1031
|
+
.outline-login-600 {
|
|
1032
|
+
outline-color: var(--color-login-600);
|
|
1033
|
+
}
|
|
1005
1034
|
.backdrop-blur-xl {
|
|
1006
1035
|
--tw-backdrop-blur: blur(var(--blur-xl));
|
|
1007
1036
|
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
@@ -1072,6 +1101,10 @@
|
|
|
1072
1101
|
--tw-outline-style: none;
|
|
1073
1102
|
outline-style: none;
|
|
1074
1103
|
}
|
|
1104
|
+
.select-none {
|
|
1105
|
+
-webkit-user-select: none;
|
|
1106
|
+
user-select: none;
|
|
1107
|
+
}
|
|
1075
1108
|
.group-\[\.dropdown\]\:h-auto {
|
|
1076
1109
|
&:is(:where(.group):is(.dropdown) *) {
|
|
1077
1110
|
height: auto;
|
|
@@ -1202,6 +1235,16 @@
|
|
|
1202
1235
|
}
|
|
1203
1236
|
}
|
|
1204
1237
|
}
|
|
1238
|
+
.hover\:bg-login-600\/90 {
|
|
1239
|
+
&:hover {
|
|
1240
|
+
@media (hover: hover) {
|
|
1241
|
+
background-color: color-mix(in srgb, #212121 90%, transparent);
|
|
1242
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1243
|
+
background-color: color-mix(in oklab, var(--color-login-600) 90%, transparent);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1205
1248
|
.hover\:bg-login\/80 {
|
|
1206
1249
|
&:hover {
|
|
1207
1250
|
@media (hover: hover) {
|
|
@@ -1212,6 +1255,16 @@
|
|
|
1212
1255
|
}
|
|
1213
1256
|
}
|
|
1214
1257
|
}
|
|
1258
|
+
.hover\:bg-login\/90 {
|
|
1259
|
+
&:hover {
|
|
1260
|
+
@media (hover: hover) {
|
|
1261
|
+
background-color: color-mix(in srgb, #fd8738 90%, transparent);
|
|
1262
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1263
|
+
background-color: color-mix(in oklab, var(--color-login) 90%, transparent);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1215
1268
|
.hover\:text-red-800 {
|
|
1216
1269
|
&:hover {
|
|
1217
1270
|
@media (hover: hover) {
|
|
@@ -1472,6 +1525,11 @@
|
|
|
1472
1525
|
inherits: false;
|
|
1473
1526
|
initial-value: 0 0 #0000;
|
|
1474
1527
|
}
|
|
1528
|
+
@property --tw-outline-style {
|
|
1529
|
+
syntax: "*";
|
|
1530
|
+
inherits: false;
|
|
1531
|
+
initial-value: solid;
|
|
1532
|
+
}
|
|
1475
1533
|
@property --tw-backdrop-blur {
|
|
1476
1534
|
syntax: "*";
|
|
1477
1535
|
inherits: false;
|
|
@@ -1553,6 +1611,7 @@
|
|
|
1553
1611
|
--tw-ring-offset-width: 0px;
|
|
1554
1612
|
--tw-ring-offset-color: #fff;
|
|
1555
1613
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
1614
|
+
--tw-outline-style: solid;
|
|
1556
1615
|
--tw-backdrop-blur: initial;
|
|
1557
1616
|
--tw-backdrop-brightness: initial;
|
|
1558
1617
|
--tw-backdrop-contrast: initial;
|
|
@@ -1567,4 +1626,4 @@
|
|
|
1567
1626
|
--tw-content: "";
|
|
1568
1627
|
}
|
|
1569
1628
|
}
|
|
1570
|
-
}
|
|
1629
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import Link from 'next/link'
|
|
2
|
+
import type { JSX } from 'react'
|
|
3
|
+
|
|
4
|
+
type ButtonProps = {
|
|
5
|
+
text: string
|
|
6
|
+
className?: string
|
|
7
|
+
icon?: string | JSX.Element
|
|
8
|
+
path?: string
|
|
9
|
+
type?: 'button' | 'submit' | 'reset'
|
|
10
|
+
color?: 'primary' | 'secondary'
|
|
11
|
+
onClick?: (_: object) => void
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function Button({
|
|
16
|
+
text,
|
|
17
|
+
className,
|
|
18
|
+
icon,
|
|
19
|
+
path,
|
|
20
|
+
color,
|
|
21
|
+
type,
|
|
22
|
+
onClick,
|
|
23
|
+
disabled
|
|
24
|
+
}: ButtonProps) {
|
|
25
|
+
const bg = color === 'secondary'
|
|
26
|
+
? 'bg-login-600/70 outline-login-600 hover:bg-login-600/90'
|
|
27
|
+
: 'bg-login/70 outline-login hover:bg-login/90'
|
|
28
|
+
|
|
29
|
+
if (!path) {
|
|
30
|
+
return (
|
|
31
|
+
<button
|
|
32
|
+
type={type || 'button'}
|
|
33
|
+
disabled={disabled}
|
|
34
|
+
onClick={onClick}
|
|
35
|
+
aria-label={text}
|
|
36
|
+
className={`
|
|
37
|
+
${bg} cursor-pointer px-4 rounded-md h-6 flex
|
|
38
|
+
justify-evenly items-center gap-2 select-none
|
|
39
|
+
focus:outline-none border-0 outline w-fit ${className}
|
|
40
|
+
`}
|
|
41
|
+
>
|
|
42
|
+
<h1 className='font-bold'>{icon ? icon : ''}</h1>
|
|
43
|
+
<h1>{text}</h1>
|
|
44
|
+
</button>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (disabled) {
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
className={`
|
|
52
|
+
${bg} cursor-not-allowed px-4 rounded-md h-6 flex
|
|
53
|
+
justify-evenly items-center gap-2 select-none
|
|
54
|
+
`}
|
|
55
|
+
>
|
|
56
|
+
<h1 className='font-bold'>{icon ? `${icon}` : ''}</h1>
|
|
57
|
+
<h1 className=''>{text}</h1>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Link
|
|
64
|
+
href={path}
|
|
65
|
+
className={`
|
|
66
|
+
${bg} cursor-pointer px-4 rounded-md h-6 flex
|
|
67
|
+
justify-evenly items-center gap-2 select-none
|
|
68
|
+
`}
|
|
69
|
+
>
|
|
70
|
+
<h1 className='font-bold'>{icon ? `${icon}` : ''}</h1>
|
|
71
|
+
<h1 className=''>{text}</h1>
|
|
72
|
+
</Link>
|
|
73
|
+
)
|
|
74
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -26,3 +26,6 @@ export { default as Highlight } from './container/highlight'
|
|
|
26
26
|
export { default as VersionTag } from './version/version'
|
|
27
27
|
export { default as LoginPage } from './login/loginPage'
|
|
28
28
|
export { default as Toaster, addToast } from './toast/toaster'
|
|
29
|
+
|
|
30
|
+
// Buttons
|
|
31
|
+
export { default as Button } from './buttons/button'
|
|
@@ -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-
|
|
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 '
|
|
@@ -94,7 +94,7 @@ export default function Toaster() {
|
|
|
94
94
|
transform: `scale(${1 - idx * 0.05})`,
|
|
95
95
|
}}
|
|
96
96
|
>
|
|
97
|
-
<span className='
|
|
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'>
|
package/src/globals.css
CHANGED
package/src/utils/auth/token.ts
CHANGED