@deepnoid/ui 0.0.103 → 0.0.104
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/{chunk-FY5YCQL5.mjs → chunk-YZTGM3A3.mjs} +26 -16
- package/dist/components/select/index.mjs +2 -2
- package/dist/components/select/select.mjs +2 -2
- package/dist/components/select/select.test.mjs +2 -2
- package/dist/components/tooltip/index.d.mts +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/index.js +26 -16
- package/dist/components/tooltip/index.mjs +1 -1
- package/dist/components/tooltip/tooltip-utils.d.mts +1 -1
- package/dist/components/tooltip/tooltip-utils.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.mts +2 -1
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.js +26 -16
- package/dist/components/tooltip/tooltip.mjs +1 -1
- package/dist/components/tooltip/tooltip.test.js +26 -16
- package/dist/components/tooltip/tooltip.test.mjs +1 -1
- package/dist/components/tooltip/useTooltip.d.mts +1 -1
- package/dist/components/tooltip/useTooltip.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +26 -16
- package/dist/index.mjs +30 -30
- package/dist/{tooltip-utils-CrCabndd.d.mts → tooltip-utils-DR0UEfBN.d.mts} +1 -0
- package/dist/{tooltip-utils-CrCabndd.d.ts → tooltip-utils-DR0UEfBN.d.ts} +1 -0
- package/package.json +1 -1
- package/dist/{chunk-2BCJZILI.mjs → chunk-JN7EGKJL.mjs} +3 -3
|
@@ -15,11 +15,12 @@ import { createPortal } from "react-dom";
|
|
|
15
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
var Tooltip = forwardRef((originalProps, ref) => {
|
|
17
17
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltip.variantKeys);
|
|
18
|
-
const { placement = "bottom", offset = 5, classNames, ...tooltipProps } = props;
|
|
18
|
+
const { placement = "bottom", offset = 5, delay = 100, classNames, ...tooltipProps } = props;
|
|
19
19
|
const slots = useMemo(() => tooltip({ ...variantProps }), [variantProps]);
|
|
20
20
|
const [targetRect, setTargetRect] = useState(null);
|
|
21
|
-
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, targetRect });
|
|
21
|
+
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, delay, targetRect });
|
|
22
22
|
const childrenRef = useRef(null);
|
|
23
|
+
const delayTimeout = useRef(null);
|
|
23
24
|
const getBaseProps = useCallback(
|
|
24
25
|
() => ({
|
|
25
26
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
@@ -32,26 +33,31 @@ var Tooltip = forwardRef((originalProps, ref) => {
|
|
|
32
33
|
}),
|
|
33
34
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
34
35
|
);
|
|
36
|
+
const handleMouseEnter = useCallback(() => {
|
|
37
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
38
|
+
if (childrenRef.current) {
|
|
39
|
+
const rect = childrenRef.current.getBoundingClientRect();
|
|
40
|
+
setTargetRect({
|
|
41
|
+
width: rect.width,
|
|
42
|
+
height: rect.height,
|
|
43
|
+
left: rect.left,
|
|
44
|
+
top: rect.top,
|
|
45
|
+
right: rect.right,
|
|
46
|
+
bottom: rect.bottom
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
const handleMouseLeave = useCallback(() => {
|
|
51
|
+
delayTimeout.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
52
|
+
}, [delay]);
|
|
35
53
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
54
|
/* @__PURE__ */ jsx(
|
|
37
55
|
"div",
|
|
38
56
|
{
|
|
39
57
|
ref: ref || childrenRef,
|
|
40
58
|
...getBaseProps(),
|
|
41
|
-
onPointerLeave:
|
|
42
|
-
onPointerEnter:
|
|
43
|
-
if (childrenRef.current) {
|
|
44
|
-
const rect = childrenRef.current.getBoundingClientRect();
|
|
45
|
-
setTargetRect({
|
|
46
|
-
width: rect.width,
|
|
47
|
-
height: rect.height,
|
|
48
|
-
left: rect.left,
|
|
49
|
-
top: rect.top,
|
|
50
|
-
right: rect.right,
|
|
51
|
-
bottom: rect.bottom
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
},
|
|
59
|
+
onPointerLeave: handleMouseLeave,
|
|
60
|
+
onPointerEnter: handleMouseEnter,
|
|
55
61
|
children: props.children
|
|
56
62
|
}
|
|
57
63
|
),
|
|
@@ -61,6 +67,10 @@ var Tooltip = forwardRef((originalProps, ref) => {
|
|
|
61
67
|
{
|
|
62
68
|
ref: tooltipRef,
|
|
63
69
|
...getContentProps(),
|
|
70
|
+
onPointerEnter: () => {
|
|
71
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
72
|
+
},
|
|
73
|
+
onPointerLeave: handleMouseLeave,
|
|
64
74
|
style: {
|
|
65
75
|
visibility: tooltipPosition.x !== 0 ? "visible" : "hidden",
|
|
66
76
|
transform: `translate3d(${tooltipPosition.x}px, ${tooltipPosition.y}px, 0)`
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import "../../chunk-QCEKPS7U.mjs";
|
|
3
3
|
import {
|
|
4
4
|
select_default
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-S3QS5B7F.mjs";
|
|
5
|
+
} from "../../chunk-JN7EGKJL.mjs";
|
|
7
6
|
import "../../chunk-RZZWHI6O.mjs";
|
|
7
|
+
import "../../chunk-S3QS5B7F.mjs";
|
|
8
8
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
9
9
|
import "../../chunk-LCI6RPWE.mjs";
|
|
10
10
|
import "../../chunk-IOCRFIQF.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
select_default
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-S3QS5B7F.mjs";
|
|
4
|
+
} from "../../chunk-JN7EGKJL.mjs";
|
|
6
5
|
import "../../chunk-RZZWHI6O.mjs";
|
|
6
|
+
import "../../chunk-S3QS5B7F.mjs";
|
|
7
7
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
8
8
|
import "../../chunk-LCI6RPWE.mjs";
|
|
9
9
|
import "../../chunk-IOCRFIQF.mjs";
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from "../../chunk-S4DTK5GI.mjs";
|
|
5
5
|
import {
|
|
6
6
|
select_default
|
|
7
|
-
} from "../../chunk-
|
|
8
|
-
import "../../chunk-S3QS5B7F.mjs";
|
|
7
|
+
} from "../../chunk-JN7EGKJL.mjs";
|
|
9
8
|
import "../../chunk-RZZWHI6O.mjs";
|
|
9
|
+
import "../../chunk-S3QS5B7F.mjs";
|
|
10
10
|
import {
|
|
11
11
|
act,
|
|
12
12
|
render
|
|
@@ -154,11 +154,12 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
154
154
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
155
155
|
var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
156
156
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltip.variantKeys);
|
|
157
|
-
const { placement = "bottom", offset = 5, classNames, ...tooltipProps } = props;
|
|
157
|
+
const { placement = "bottom", offset = 5, delay = 100, classNames, ...tooltipProps } = props;
|
|
158
158
|
const slots = (0, import_react2.useMemo)(() => tooltip({ ...variantProps }), [variantProps]);
|
|
159
159
|
const [targetRect, setTargetRect] = (0, import_react2.useState)(null);
|
|
160
|
-
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, targetRect });
|
|
160
|
+
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, delay, targetRect });
|
|
161
161
|
const childrenRef = (0, import_react2.useRef)(null);
|
|
162
|
+
const delayTimeout = (0, import_react2.useRef)(null);
|
|
162
163
|
const getBaseProps = (0, import_react2.useCallback)(
|
|
163
164
|
() => ({
|
|
164
165
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
@@ -171,26 +172,31 @@ var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
171
172
|
}),
|
|
172
173
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
173
174
|
);
|
|
175
|
+
const handleMouseEnter = (0, import_react2.useCallback)(() => {
|
|
176
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
177
|
+
if (childrenRef.current) {
|
|
178
|
+
const rect = childrenRef.current.getBoundingClientRect();
|
|
179
|
+
setTargetRect({
|
|
180
|
+
width: rect.width,
|
|
181
|
+
height: rect.height,
|
|
182
|
+
left: rect.left,
|
|
183
|
+
top: rect.top,
|
|
184
|
+
right: rect.right,
|
|
185
|
+
bottom: rect.bottom
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}, []);
|
|
189
|
+
const handleMouseLeave = (0, import_react2.useCallback)(() => {
|
|
190
|
+
delayTimeout.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
191
|
+
}, [delay]);
|
|
174
192
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
175
193
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
176
194
|
"div",
|
|
177
195
|
{
|
|
178
196
|
ref: ref || childrenRef,
|
|
179
197
|
...getBaseProps(),
|
|
180
|
-
onPointerLeave:
|
|
181
|
-
onPointerEnter:
|
|
182
|
-
if (childrenRef.current) {
|
|
183
|
-
const rect = childrenRef.current.getBoundingClientRect();
|
|
184
|
-
setTargetRect({
|
|
185
|
-
width: rect.width,
|
|
186
|
-
height: rect.height,
|
|
187
|
-
left: rect.left,
|
|
188
|
-
top: rect.top,
|
|
189
|
-
right: rect.right,
|
|
190
|
-
bottom: rect.bottom
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
},
|
|
198
|
+
onPointerLeave: handleMouseLeave,
|
|
199
|
+
onPointerEnter: handleMouseEnter,
|
|
194
200
|
children: props.children
|
|
195
201
|
}
|
|
196
202
|
),
|
|
@@ -200,6 +206,10 @@ var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
200
206
|
{
|
|
201
207
|
ref: tooltipRef,
|
|
202
208
|
...getContentProps(),
|
|
209
|
+
onPointerEnter: () => {
|
|
210
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
211
|
+
},
|
|
212
|
+
onPointerLeave: handleMouseLeave,
|
|
203
213
|
style: {
|
|
204
214
|
visibility: tooltipPosition.x !== 0 ? "visible" : "hidden",
|
|
205
215
|
transform: `translate3d(${tooltipPosition.x}px, ${tooltipPosition.y}px, 0)`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { T as TooltipPlacement, g as getTooltipPosition } from '../../tooltip-utils-
|
|
1
|
+
export { T as TooltipPlacement, g as getTooltipPosition } from '../../tooltip-utils-DR0UEfBN.mjs';
|
|
2
2
|
import 'react';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { T as TooltipPlacement, g as getTooltipPosition } from '../../tooltip-utils-
|
|
1
|
+
export { T as TooltipPlacement, g as getTooltipPosition } from '../../tooltip-utils-DR0UEfBN.js';
|
|
2
2
|
import 'react';
|
|
@@ -4,12 +4,13 @@ import * as tailwind_variants_dist_config from 'tailwind-variants/dist/config';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import { SlotsToClasses } from '../../utils/types.mjs';
|
|
7
|
-
import { T as TooltipPlacement } from '../../tooltip-utils-
|
|
7
|
+
import { T as TooltipPlacement } from '../../tooltip-utils-DR0UEfBN.mjs';
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
content?: ReactNode | string;
|
|
12
12
|
offset?: number;
|
|
13
|
+
delay?: number;
|
|
13
14
|
placement?: TooltipPlacement;
|
|
14
15
|
classNames?: SlotsToClasses<TooltipSlots>;
|
|
15
16
|
}
|
|
@@ -4,12 +4,13 @@ import * as tailwind_variants_dist_config from 'tailwind-variants/dist/config';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import { SlotsToClasses } from '../../utils/types.js';
|
|
7
|
-
import { T as TooltipPlacement } from '../../tooltip-utils-
|
|
7
|
+
import { T as TooltipPlacement } from '../../tooltip-utils-DR0UEfBN.js';
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
content?: ReactNode | string;
|
|
12
12
|
offset?: number;
|
|
13
|
+
delay?: number;
|
|
13
14
|
placement?: TooltipPlacement;
|
|
14
15
|
classNames?: SlotsToClasses<TooltipSlots>;
|
|
15
16
|
}
|
|
@@ -152,11 +152,12 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
152
152
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
153
153
|
var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
154
154
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltip.variantKeys);
|
|
155
|
-
const { placement = "bottom", offset = 5, classNames, ...tooltipProps } = props;
|
|
155
|
+
const { placement = "bottom", offset = 5, delay = 100, classNames, ...tooltipProps } = props;
|
|
156
156
|
const slots = (0, import_react2.useMemo)(() => tooltip({ ...variantProps }), [variantProps]);
|
|
157
157
|
const [targetRect, setTargetRect] = (0, import_react2.useState)(null);
|
|
158
|
-
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, targetRect });
|
|
158
|
+
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, delay, targetRect });
|
|
159
159
|
const childrenRef = (0, import_react2.useRef)(null);
|
|
160
|
+
const delayTimeout = (0, import_react2.useRef)(null);
|
|
160
161
|
const getBaseProps = (0, import_react2.useCallback)(
|
|
161
162
|
() => ({
|
|
162
163
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
@@ -169,26 +170,31 @@ var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
169
170
|
}),
|
|
170
171
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
171
172
|
);
|
|
173
|
+
const handleMouseEnter = (0, import_react2.useCallback)(() => {
|
|
174
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
175
|
+
if (childrenRef.current) {
|
|
176
|
+
const rect = childrenRef.current.getBoundingClientRect();
|
|
177
|
+
setTargetRect({
|
|
178
|
+
width: rect.width,
|
|
179
|
+
height: rect.height,
|
|
180
|
+
left: rect.left,
|
|
181
|
+
top: rect.top,
|
|
182
|
+
right: rect.right,
|
|
183
|
+
bottom: rect.bottom
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}, []);
|
|
187
|
+
const handleMouseLeave = (0, import_react2.useCallback)(() => {
|
|
188
|
+
delayTimeout.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
189
|
+
}, [delay]);
|
|
172
190
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
173
191
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
174
192
|
"div",
|
|
175
193
|
{
|
|
176
194
|
ref: ref || childrenRef,
|
|
177
195
|
...getBaseProps(),
|
|
178
|
-
onPointerLeave:
|
|
179
|
-
onPointerEnter:
|
|
180
|
-
if (childrenRef.current) {
|
|
181
|
-
const rect = childrenRef.current.getBoundingClientRect();
|
|
182
|
-
setTargetRect({
|
|
183
|
-
width: rect.width,
|
|
184
|
-
height: rect.height,
|
|
185
|
-
left: rect.left,
|
|
186
|
-
top: rect.top,
|
|
187
|
-
right: rect.right,
|
|
188
|
-
bottom: rect.bottom
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
},
|
|
196
|
+
onPointerLeave: handleMouseLeave,
|
|
197
|
+
onPointerEnter: handleMouseEnter,
|
|
192
198
|
children: props.children
|
|
193
199
|
}
|
|
194
200
|
),
|
|
@@ -198,6 +204,10 @@ var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
198
204
|
{
|
|
199
205
|
ref: tooltipRef,
|
|
200
206
|
...getContentProps(),
|
|
207
|
+
onPointerEnter: () => {
|
|
208
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
209
|
+
},
|
|
210
|
+
onPointerLeave: handleMouseLeave,
|
|
201
211
|
style: {
|
|
202
212
|
visibility: tooltipPosition.x !== 0 ? "visible" : "hidden",
|
|
203
213
|
transform: `translate3d(${tooltipPosition.x}px, ${tooltipPosition.y}px, 0)`
|
|
@@ -12999,11 +12999,12 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
12999
12999
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
13000
13000
|
var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
13001
13001
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltip.variantKeys);
|
|
13002
|
-
const { placement = "bottom", offset = 5, classNames, ...tooltipProps } = props;
|
|
13002
|
+
const { placement = "bottom", offset = 5, delay = 100, classNames, ...tooltipProps } = props;
|
|
13003
13003
|
const slots = (0, import_react2.useMemo)(() => tooltip({ ...variantProps }), [variantProps]);
|
|
13004
13004
|
const [targetRect, setTargetRect] = (0, import_react2.useState)(null);
|
|
13005
|
-
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, targetRect });
|
|
13005
|
+
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, delay, targetRect });
|
|
13006
13006
|
const childrenRef = (0, import_react2.useRef)(null);
|
|
13007
|
+
const delayTimeout = (0, import_react2.useRef)(null);
|
|
13007
13008
|
const getBaseProps = (0, import_react2.useCallback)(
|
|
13008
13009
|
() => ({
|
|
13009
13010
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
@@ -13016,26 +13017,31 @@ var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
13016
13017
|
}),
|
|
13017
13018
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
13018
13019
|
);
|
|
13020
|
+
const handleMouseEnter = (0, import_react2.useCallback)(() => {
|
|
13021
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
13022
|
+
if (childrenRef.current) {
|
|
13023
|
+
const rect = childrenRef.current.getBoundingClientRect();
|
|
13024
|
+
setTargetRect({
|
|
13025
|
+
width: rect.width,
|
|
13026
|
+
height: rect.height,
|
|
13027
|
+
left: rect.left,
|
|
13028
|
+
top: rect.top,
|
|
13029
|
+
right: rect.right,
|
|
13030
|
+
bottom: rect.bottom
|
|
13031
|
+
});
|
|
13032
|
+
}
|
|
13033
|
+
}, []);
|
|
13034
|
+
const handleMouseLeave = (0, import_react2.useCallback)(() => {
|
|
13035
|
+
delayTimeout.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
13036
|
+
}, [delay]);
|
|
13019
13037
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
13020
13038
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
13021
13039
|
"div",
|
|
13022
13040
|
{
|
|
13023
13041
|
ref: ref || childrenRef,
|
|
13024
13042
|
...getBaseProps(),
|
|
13025
|
-
onPointerLeave:
|
|
13026
|
-
onPointerEnter:
|
|
13027
|
-
if (childrenRef.current) {
|
|
13028
|
-
const rect = childrenRef.current.getBoundingClientRect();
|
|
13029
|
-
setTargetRect({
|
|
13030
|
-
width: rect.width,
|
|
13031
|
-
height: rect.height,
|
|
13032
|
-
left: rect.left,
|
|
13033
|
-
top: rect.top,
|
|
13034
|
-
right: rect.right,
|
|
13035
|
-
bottom: rect.bottom
|
|
13036
|
-
});
|
|
13037
|
-
}
|
|
13038
|
-
},
|
|
13043
|
+
onPointerLeave: handleMouseLeave,
|
|
13044
|
+
onPointerEnter: handleMouseEnter,
|
|
13039
13045
|
children: props.children
|
|
13040
13046
|
}
|
|
13041
13047
|
),
|
|
@@ -13045,6 +13051,10 @@ var Tooltip = (0, import_react2.forwardRef)((originalProps, ref) => {
|
|
|
13045
13051
|
{
|
|
13046
13052
|
ref: tooltipRef,
|
|
13047
13053
|
...getContentProps(),
|
|
13054
|
+
onPointerEnter: () => {
|
|
13055
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
13056
|
+
},
|
|
13057
|
+
onPointerLeave: handleMouseLeave,
|
|
13048
13058
|
style: {
|
|
13049
13059
|
visibility: tooltipPosition.x !== 0 ? "visible" : "hidden",
|
|
13050
13060
|
transform: `translate3d(${tooltipPosition.x}px, ${tooltipPosition.y}px, 0)`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { a as TargetRect, u as useTooltip } from '../../tooltip-utils-
|
|
2
|
+
export { a as TargetRect, u as useTooltip } from '../../tooltip-utils-DR0UEfBN.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { a as TargetRect, u as useTooltip } from '../../tooltip-utils-
|
|
2
|
+
export { a as TargetRect, u as useTooltip } from '../../tooltip-utils-DR0UEfBN.js';
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -7102,11 +7102,12 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
7102
7102
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
7103
7103
|
var Tooltip = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
7104
7104
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltip.variantKeys);
|
|
7105
|
-
const { placement = "bottom", offset = 5, classNames, ...tooltipProps } = props;
|
|
7105
|
+
const { placement = "bottom", offset = 5, delay = 100, classNames, ...tooltipProps } = props;
|
|
7106
7106
|
const slots = (0, import_react21.useMemo)(() => tooltip({ ...variantProps }), [variantProps]);
|
|
7107
7107
|
const [targetRect, setTargetRect] = (0, import_react21.useState)(null);
|
|
7108
|
-
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, targetRect });
|
|
7108
|
+
const { tooltipPosition, tooltipRef } = useTooltip({ placement, offset, delay, targetRect });
|
|
7109
7109
|
const childrenRef = (0, import_react21.useRef)(null);
|
|
7110
|
+
const delayTimeout = (0, import_react21.useRef)(null);
|
|
7110
7111
|
const getBaseProps = (0, import_react21.useCallback)(
|
|
7111
7112
|
() => ({
|
|
7112
7113
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
@@ -7119,26 +7120,31 @@ var Tooltip = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
|
7119
7120
|
}),
|
|
7120
7121
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
7121
7122
|
);
|
|
7123
|
+
const handleMouseEnter = (0, import_react21.useCallback)(() => {
|
|
7124
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
7125
|
+
if (childrenRef.current) {
|
|
7126
|
+
const rect = childrenRef.current.getBoundingClientRect();
|
|
7127
|
+
setTargetRect({
|
|
7128
|
+
width: rect.width,
|
|
7129
|
+
height: rect.height,
|
|
7130
|
+
left: rect.left,
|
|
7131
|
+
top: rect.top,
|
|
7132
|
+
right: rect.right,
|
|
7133
|
+
bottom: rect.bottom
|
|
7134
|
+
});
|
|
7135
|
+
}
|
|
7136
|
+
}, []);
|
|
7137
|
+
const handleMouseLeave = (0, import_react21.useCallback)(() => {
|
|
7138
|
+
delayTimeout.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
7139
|
+
}, [delay]);
|
|
7122
7140
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
7123
7141
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7124
7142
|
"div",
|
|
7125
7143
|
{
|
|
7126
7144
|
ref: ref || childrenRef,
|
|
7127
7145
|
...getBaseProps(),
|
|
7128
|
-
onPointerLeave:
|
|
7129
|
-
onPointerEnter:
|
|
7130
|
-
if (childrenRef.current) {
|
|
7131
|
-
const rect = childrenRef.current.getBoundingClientRect();
|
|
7132
|
-
setTargetRect({
|
|
7133
|
-
width: rect.width,
|
|
7134
|
-
height: rect.height,
|
|
7135
|
-
left: rect.left,
|
|
7136
|
-
top: rect.top,
|
|
7137
|
-
right: rect.right,
|
|
7138
|
-
bottom: rect.bottom
|
|
7139
|
-
});
|
|
7140
|
-
}
|
|
7141
|
-
},
|
|
7146
|
+
onPointerLeave: handleMouseLeave,
|
|
7147
|
+
onPointerEnter: handleMouseEnter,
|
|
7142
7148
|
children: props.children
|
|
7143
7149
|
}
|
|
7144
7150
|
),
|
|
@@ -7148,6 +7154,10 @@ var Tooltip = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
|
7148
7154
|
{
|
|
7149
7155
|
ref: tooltipRef,
|
|
7150
7156
|
...getContentProps(),
|
|
7157
|
+
onPointerEnter: () => {
|
|
7158
|
+
if (delayTimeout.current) clearTimeout(delayTimeout.current);
|
|
7159
|
+
},
|
|
7160
|
+
onPointerLeave: handleMouseLeave,
|
|
7151
7161
|
style: {
|
|
7152
7162
|
visibility: tooltipPosition.x !== 0 ? "visible" : "hidden",
|
|
7153
7163
|
transform: `translate3d(${tooltipPosition.x}px, ${tooltipPosition.y}px, 0)`
|
package/dist/index.mjs
CHANGED
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
import "./chunk-HIE2YRGA.mjs";
|
|
3
3
|
import {
|
|
4
4
|
tooltip_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YZTGM3A3.mjs";
|
|
6
6
|
import "./chunk-DSBSLSJW.mjs";
|
|
7
7
|
import "./chunk-ODMRJXLJ.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
textarea_default
|
|
11
|
-
} from "./chunk-OJ2OEI5B.mjs";
|
|
12
|
-
import "./chunk-3MY6LO7N.mjs";
|
|
8
|
+
import "./chunk-QCEKPS7U.mjs";
|
|
13
9
|
import {
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
10
|
+
select_default
|
|
11
|
+
} from "./chunk-JN7EGKJL.mjs";
|
|
12
|
+
import "./chunk-RZZWHI6O.mjs";
|
|
13
|
+
import "./chunk-S3QS5B7F.mjs";
|
|
16
14
|
import "./chunk-LUWGOKLG.mjs";
|
|
17
15
|
import {
|
|
18
16
|
ToastProvider,
|
|
@@ -22,34 +20,36 @@ import "./chunk-ZOTHPHXA.mjs";
|
|
|
22
20
|
import {
|
|
23
21
|
toast_default
|
|
24
22
|
} from "./chunk-PXUBPWKU.mjs";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
table_default
|
|
28
|
-
} from "./chunk-R2E7UZZO.mjs";
|
|
29
|
-
import "./chunk-VWD26TIQ.mjs";
|
|
30
|
-
import "./chunk-PO3ADNA5.mjs";
|
|
31
|
-
import "./chunk-LVFI2NOH.mjs";
|
|
23
|
+
import "./chunk-3MY6LO7N.mjs";
|
|
32
24
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
25
|
+
tabs_default
|
|
26
|
+
} from "./chunk-KRI5IALM.mjs";
|
|
27
|
+
import "./chunk-RRAZM5D3.mjs";
|
|
36
28
|
import {
|
|
37
|
-
|
|
38
|
-
} from "./chunk-
|
|
29
|
+
textarea_default
|
|
30
|
+
} from "./chunk-OJ2OEI5B.mjs";
|
|
39
31
|
import "./chunk-MV2WCFK7.mjs";
|
|
40
32
|
import {
|
|
41
33
|
slider_default
|
|
42
34
|
} from "./chunk-A3RWT3JJ.mjs";
|
|
35
|
+
import "./chunk-LVFI2NOH.mjs";
|
|
36
|
+
import {
|
|
37
|
+
switch_default
|
|
38
|
+
} from "./chunk-S3O52LLG.mjs";
|
|
39
|
+
import "./chunk-2UUH2MBF.mjs";
|
|
40
|
+
import {
|
|
41
|
+
table_default
|
|
42
|
+
} from "./chunk-R2E7UZZO.mjs";
|
|
43
|
+
import "./chunk-VWD26TIQ.mjs";
|
|
44
|
+
import "./chunk-PO3ADNA5.mjs";
|
|
43
45
|
import "./chunk-7VOQKIIK.mjs";
|
|
44
46
|
import {
|
|
45
47
|
progress_default
|
|
46
48
|
} from "./chunk-N2JULHST.mjs";
|
|
47
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-TPFN22HR.mjs";
|
|
48
50
|
import {
|
|
49
|
-
|
|
50
|
-
} from "./chunk-
|
|
51
|
-
import "./chunk-S3QS5B7F.mjs";
|
|
52
|
-
import "./chunk-RZZWHI6O.mjs";
|
|
51
|
+
radio_default
|
|
52
|
+
} from "./chunk-QWFOYO3D.mjs";
|
|
53
53
|
import "./chunk-DJOG6Z35.mjs";
|
|
54
54
|
import {
|
|
55
55
|
modal_default
|
|
@@ -63,11 +63,11 @@ import "./chunk-2GCSFWHD.mjs";
|
|
|
63
63
|
import {
|
|
64
64
|
input_default
|
|
65
65
|
} from "./chunk-ZNEEYSIK.mjs";
|
|
66
|
-
import "./chunk-HAOK24MK.mjs";
|
|
67
66
|
import "./chunk-QZ3LVYJW.mjs";
|
|
67
|
+
import "./chunk-HAOK24MK.mjs";
|
|
68
68
|
import {
|
|
69
|
-
|
|
70
|
-
} from "./chunk-
|
|
69
|
+
card_default
|
|
70
|
+
} from "./chunk-2ALY3PH5.mjs";
|
|
71
71
|
import "./chunk-75HLCORR.mjs";
|
|
72
72
|
import {
|
|
73
73
|
dateTimePicker_default
|
|
@@ -92,8 +92,8 @@ import {
|
|
|
92
92
|
button_default
|
|
93
93
|
} from "./chunk-UR64ZUAU.mjs";
|
|
94
94
|
import {
|
|
95
|
-
|
|
96
|
-
} from "./chunk-
|
|
95
|
+
checkbox_default
|
|
96
|
+
} from "./chunk-ANYPMQH4.mjs";
|
|
97
97
|
import "./chunk-27Y6K5NK.mjs";
|
|
98
98
|
import {
|
|
99
99
|
accordion_default
|
package/package.json
CHANGED