next-helios-fe 1.1.40 → 1.1.42
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/components/button/index.d.ts +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/tooltip/index.d.ts +7 -0
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +7 -0
- package/package.json +2 -1
- package/src/components/button/index.tsx +5 -1
- package/src/components/form/input/number.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/tooltip/index.tsx +24 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "next-helios-fe",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.42",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -32,6 +32,7 @@
|
|
32
32
|
"react-leaflet": "^4.2.1",
|
33
33
|
"react-pin-field": "^3.1.5",
|
34
34
|
"react-syntax-highlighter": "^15.5.0",
|
35
|
+
"react-tooltip": "^5.28.0",
|
35
36
|
"sass": "^1.77.8",
|
36
37
|
"xlsx": "^0.18.5"
|
37
38
|
},
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import React from "react";
|
3
|
+
import { Tooltip } from "../../components";
|
3
4
|
import { Icon } from "@iconify/react";
|
4
5
|
|
5
6
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
@@ -17,6 +18,7 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
18
|
position?: "left" | "center" | "right";
|
18
19
|
border?: boolean;
|
19
20
|
};
|
21
|
+
tooltip?: { content: React.ReactNode };
|
20
22
|
loading?: boolean;
|
21
23
|
active?: boolean;
|
22
24
|
}
|
@@ -25,6 +27,7 @@ export const Button: React.FC<ButtonProps> = ({
|
|
25
27
|
children,
|
26
28
|
className,
|
27
29
|
options,
|
30
|
+
tooltip,
|
28
31
|
loading,
|
29
32
|
active,
|
30
33
|
...rest
|
@@ -61,7 +64,7 @@ export const Button: React.FC<ButtonProps> = ({
|
|
61
64
|
|
62
65
|
return (
|
63
66
|
<button
|
64
|
-
className={`
|
67
|
+
className={`relative flex ${position} items-center ${width} px-3 ${height} rounded-md text-left ${variant} ${border} ${isActive} select-none disabled:pointer-events-none active:opacity-70 active:duration-300 active:ease-out ${className}`}
|
65
68
|
{...rest}
|
66
69
|
>
|
67
70
|
{loading ? (
|
@@ -69,6 +72,7 @@ export const Button: React.FC<ButtonProps> = ({
|
|
69
72
|
) : (
|
70
73
|
children
|
71
74
|
)}
|
75
|
+
{tooltip && <Tooltip id={rest.id as string} content={tooltip.content} />}
|
72
76
|
</button>
|
73
77
|
);
|
74
78
|
};
|
@@ -25,7 +25,7 @@ export const Number: React.FC<NumberProps> = ({ options, label, ...rest }) => {
|
|
25
25
|
if (rest.value) {
|
26
26
|
setTempValue(rest.value as string);
|
27
27
|
return;
|
28
|
-
} else if (rest.defaultValue) {
|
28
|
+
} else if (rest.defaultValue || rest.defaultValue === 0) {
|
29
29
|
setTempValue(rest.defaultValue as string);
|
30
30
|
return;
|
31
31
|
}
|
package/src/components/index.ts
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
"use client";
|
2
|
+
import React from "react";
|
3
|
+
import { Tooltip as Tt } from "react-tooltip";
|
4
|
+
|
5
|
+
interface TooltipProps {
|
6
|
+
id: string;
|
7
|
+
content: React.ReactNode;
|
8
|
+
}
|
9
|
+
|
10
|
+
export const Tooltip: React.FC<TooltipProps> = ({ id, content }) => {
|
11
|
+
return (
|
12
|
+
<Tt
|
13
|
+
anchorSelect={`#${id}`}
|
14
|
+
style={{
|
15
|
+
maxWidth: "16rem",
|
16
|
+
zIndex: 999,
|
17
|
+
borderRadius: "0.375rem",
|
18
|
+
backgroundColor: "rgba(26,26,26,0.3)",
|
19
|
+
}}
|
20
|
+
positionStrategy="fixed"
|
21
|
+
render={() => content}
|
22
|
+
/>
|
23
|
+
);
|
24
|
+
};
|