@lets-events/react 12.6.1 → 12.6.3
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +171 -156
- package/dist/index.mjs +168 -153
- package/package.json +1 -1
- package/src/components/Button/index.tsx +7 -2
- package/src/components/Button/styledComponents.ts +7 -0
- package/src/components/Tooltip/index.tsx +38 -32
|
@@ -1,67 +1,73 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as TooltipPrimitive from
|
|
3
|
-
import { styled } from
|
|
4
|
-
import { Text } from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
import { styled } from "../../styles";
|
|
4
|
+
import { Text } from "../Text";
|
|
5
5
|
|
|
6
|
-
const TooltipProvider = TooltipPrimitive.Provider
|
|
7
|
-
const TooltipRoot = TooltipPrimitive.Root
|
|
8
|
-
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
7
|
+
const TooltipRoot = TooltipPrimitive.Root;
|
|
8
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
9
9
|
|
|
10
10
|
const TooltipContent = styled(TooltipPrimitive.Content, {
|
|
11
|
-
backgroundColor:
|
|
12
|
-
color:
|
|
13
|
-
borderRadius:
|
|
14
|
-
padding:
|
|
15
|
-
fontSize:
|
|
11
|
+
backgroundColor: "$dark800",
|
|
12
|
+
color: "$neutral50",
|
|
13
|
+
borderRadius: "4px",
|
|
14
|
+
padding: "10px 15px",
|
|
15
|
+
fontSize: "14px",
|
|
16
16
|
lineHeight: 1,
|
|
17
17
|
zIndex: 100,
|
|
18
|
-
boxShadow:
|
|
19
|
-
userSelect:
|
|
20
|
-
animationDuration:
|
|
21
|
-
animationTimingFunction:
|
|
22
|
-
willChange:
|
|
18
|
+
boxShadow: "0 2px 10px rgba(0, 0, 0, 0.1)",
|
|
19
|
+
userSelect: "none",
|
|
20
|
+
animationDuration: "400ms",
|
|
21
|
+
animationTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
22
|
+
willChange: "transform, opacity",
|
|
23
23
|
'&[data-state="delayed-open"][data-side="top"]': {
|
|
24
|
-
animationName:
|
|
24
|
+
animationName: "slideDownAndFade",
|
|
25
25
|
},
|
|
26
26
|
'&[data-state="delayed-open"][data-side="right"]': {
|
|
27
|
-
animationName:
|
|
27
|
+
animationName: "slideLeftAndFade",
|
|
28
28
|
},
|
|
29
29
|
'&[data-state="delayed-open"][data-side="bottom"]': {
|
|
30
|
-
animationName:
|
|
30
|
+
animationName: "slideUpAndFade",
|
|
31
31
|
},
|
|
32
32
|
'&[data-state="delayed-open"][data-side="left"]': {
|
|
33
|
-
animationName:
|
|
33
|
+
animationName: "slideRightAndFade",
|
|
34
34
|
},
|
|
35
|
-
})
|
|
35
|
+
});
|
|
36
36
|
|
|
37
37
|
const TooltipArrow = styled(TooltipPrimitive.Arrow, {
|
|
38
|
-
fill:
|
|
39
|
-
})
|
|
38
|
+
fill: "$dark800",
|
|
39
|
+
});
|
|
40
40
|
|
|
41
41
|
export interface TooltipProps {
|
|
42
|
-
children: React.ReactNode
|
|
43
|
-
content: React.ReactNode
|
|
44
|
-
delayDuration?: number
|
|
45
|
-
side?:
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
content: React.ReactNode;
|
|
44
|
+
delayDuration?: number;
|
|
45
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export function Tooltip({
|
|
49
49
|
children,
|
|
50
50
|
content,
|
|
51
51
|
delayDuration = 200,
|
|
52
|
-
side =
|
|
52
|
+
side = "top",
|
|
53
53
|
}: TooltipProps) {
|
|
54
54
|
return (
|
|
55
55
|
<TooltipProvider>
|
|
56
56
|
<TooltipRoot delayDuration={delayDuration}>
|
|
57
57
|
<TooltipTrigger asChild>{children}</TooltipTrigger>
|
|
58
58
|
<TooltipContent side={side} sideOffset={5}>
|
|
59
|
-
{typeof content ===
|
|
59
|
+
{typeof content === "string" ? (
|
|
60
|
+
<Text typography={"tooltip"} color="grey50">
|
|
61
|
+
{content}
|
|
62
|
+
</Text>
|
|
63
|
+
) : (
|
|
64
|
+
content
|
|
65
|
+
)}
|
|
60
66
|
<TooltipArrow />
|
|
61
67
|
</TooltipContent>
|
|
62
68
|
</TooltipRoot>
|
|
63
69
|
</TooltipProvider>
|
|
64
|
-
)
|
|
70
|
+
);
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
export { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent }
|
|
73
|
+
export { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipContent };
|