next-helios-fe 1.7.22 → 1.7.23
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/index.js +1 -1
- package/package.json +1 -1
- package/src/components/button/index.tsx +20 -13
package/package.json
CHANGED
@@ -47,10 +47,10 @@ export const Button: React.FC<ButtonProps> = ({
|
|
47
47
|
const width = options?.width === "fit" ? "w-fit" : "w-full";
|
48
48
|
const height =
|
49
49
|
options?.height === "short"
|
50
|
-
? "
|
50
|
+
? "py-1 gap-2"
|
51
51
|
: options?.height === "high"
|
52
|
-
? "
|
53
|
-
: "
|
52
|
+
? "py-2 gap-4"
|
53
|
+
: "py-1.5 gap-2";
|
54
54
|
const position =
|
55
55
|
options?.position === "center"
|
56
56
|
? "justify-center"
|
@@ -64,19 +64,26 @@ export const Button: React.FC<ButtonProps> = ({
|
|
64
64
|
|
65
65
|
return (
|
66
66
|
<button
|
67
|
-
className={`relative
|
67
|
+
className={`relative ${width} px-3 ${height} rounded-md text-left ${variant} ${border} ${isActive} select-none disabled:pointer-events-none ${className}`}
|
68
68
|
disabled={loading || rest.disabled}
|
69
69
|
{...rest}
|
70
70
|
>
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
71
|
+
<div
|
72
|
+
className={`flex ${position} items-center w-full h-full ${
|
73
|
+
loading && "invisible"
|
74
|
+
}`}
|
75
|
+
>
|
76
|
+
{children}
|
77
|
+
</div>
|
78
|
+
{loading && (
|
79
|
+
<div className="absolute left-0 top-0 flex justify-center items-center w-full h-full">
|
80
|
+
<Icon
|
81
|
+
icon="mingcute:loading-fill"
|
82
|
+
className={`animate-spin ${
|
83
|
+
options?.height === "high" ? "text-2xl" : "text-xl"
|
84
|
+
}`}
|
85
|
+
/>
|
86
|
+
</div>
|
80
87
|
)}
|
81
88
|
{tooltip && <Tooltip id={rest.id as string} content={tooltip.content} />}
|
82
89
|
</button>
|