@deepnoid/ui 0.0.102 → 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.
Files changed (34) hide show
  1. package/dist/{chunk-A5PEB7CC.mjs → chunk-R2E7UZZO.mjs} +1 -1
  2. package/dist/{chunk-ON2OTH5K.mjs → chunk-TSMVRGDO.mjs} +2 -1
  3. package/dist/{chunk-FY5YCQL5.mjs → chunk-YZTGM3A3.mjs} +26 -16
  4. package/dist/components/dateTimePicker/dateTimePicker.js +2 -1
  5. package/dist/components/dateTimePicker/dateTimePicker.mjs +1 -1
  6. package/dist/components/dateTimePicker/index.js +2 -1
  7. package/dist/components/dateTimePicker/index.mjs +1 -1
  8. package/dist/components/table/index.js +1 -1
  9. package/dist/components/table/index.mjs +1 -1
  10. package/dist/components/table/table.js +1 -1
  11. package/dist/components/table/table.mjs +1 -1
  12. package/dist/components/table/table.test.js +1 -1
  13. package/dist/components/table/table.test.mjs +1 -1
  14. package/dist/components/tooltip/index.d.mts +1 -1
  15. package/dist/components/tooltip/index.d.ts +1 -1
  16. package/dist/components/tooltip/index.js +26 -16
  17. package/dist/components/tooltip/index.mjs +1 -1
  18. package/dist/components/tooltip/tooltip-utils.d.mts +1 -1
  19. package/dist/components/tooltip/tooltip-utils.d.ts +1 -1
  20. package/dist/components/tooltip/tooltip.d.mts +2 -1
  21. package/dist/components/tooltip/tooltip.d.ts +2 -1
  22. package/dist/components/tooltip/tooltip.js +26 -16
  23. package/dist/components/tooltip/tooltip.mjs +1 -1
  24. package/dist/components/tooltip/tooltip.test.js +26 -16
  25. package/dist/components/tooltip/tooltip.test.mjs +1 -1
  26. package/dist/components/tooltip/useTooltip.d.mts +1 -1
  27. package/dist/components/tooltip/useTooltip.d.ts +1 -1
  28. package/dist/index.d.mts +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +29 -18
  31. package/dist/index.mjs +33 -33
  32. package/dist/{tooltip-utils-CrCabndd.d.ts → tooltip-utils-DR0UEfBN.d.mts} +1 -0
  33. package/dist/{tooltip-utils-CrCabndd.d.mts → tooltip-utils-DR0UEfBN.d.ts} +1 -0
  34. package/package.json +1 -1
@@ -98,7 +98,7 @@ var Table = forwardRef((originalProps, ref) => {
98
98
  }
99
99
  )
100
100
  ] }),
101
- /* @__PURE__ */ jsx("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
101
+ rows.length > 0 && /* @__PURE__ */ jsx("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
102
102
  ] });
103
103
  });
104
104
  Table.displayName = "Table";
@@ -53,7 +53,8 @@ var DatePicker = forwardRef((originalProps, ref) => {
53
53
  handleBlueInput,
54
54
  calculatePositionWithScroll
55
55
  } = useDatePicker({
56
- initialDate: void 0
56
+ initialDate: typeof value === "string" ? new Date(value) : void 0,
57
+ initialTime: typeof value === "string" ? value : void 0
57
58
  });
58
59
  const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
59
60
  const getBaseProps = useCallback(
@@ -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: () => setTargetRect(null),
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)`
@@ -4217,7 +4217,8 @@ var DatePicker = (0, import_react6.forwardRef)((originalProps, ref) => {
4217
4217
  handleBlueInput,
4218
4218
  calculatePositionWithScroll
4219
4219
  } = useDatePicker({
4220
- initialDate: void 0
4220
+ initialDate: typeof value === "string" ? new Date(value) : void 0,
4221
+ initialTime: typeof value === "string" ? value : void 0
4221
4222
  });
4222
4223
  const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
4223
4224
  const getBaseProps = (0, import_react6.useCallback)(
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  dateTimePickerStyle,
4
4
  dateTimePicker_default
5
- } from "../../chunk-ON2OTH5K.mjs";
5
+ } from "../../chunk-TSMVRGDO.mjs";
6
6
  import "../../chunk-FWJ2ZKH6.mjs";
7
7
  import "../../chunk-FDKT4IBP.mjs";
8
8
  import "../../chunk-P732YGHO.mjs";
@@ -4218,7 +4218,8 @@ var DatePicker = (0, import_react6.forwardRef)((originalProps, ref) => {
4218
4218
  handleBlueInput,
4219
4219
  calculatePositionWithScroll
4220
4220
  } = useDatePicker({
4221
- initialDate: void 0
4221
+ initialDate: typeof value === "string" ? new Date(value) : void 0,
4222
+ initialTime: typeof value === "string" ? value : void 0
4222
4223
  });
4223
4224
  const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
4224
4225
  const getBaseProps = (0, import_react6.useCallback)(
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-75HLCORR.mjs";
3
3
  import {
4
4
  dateTimePicker_default
5
- } from "../../chunk-ON2OTH5K.mjs";
5
+ } from "../../chunk-TSMVRGDO.mjs";
6
6
  import "../../chunk-FWJ2ZKH6.mjs";
7
7
  import "../../chunk-FDKT4IBP.mjs";
8
8
  import "../../chunk-P732YGHO.mjs";
@@ -4136,7 +4136,7 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
4136
4136
  }
4137
4137
  )
4138
4138
  ] }),
4139
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
4139
+ rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
4140
4140
  ] });
4141
4141
  });
4142
4142
  Table.displayName = "Table";
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-2UUH2MBF.mjs";
3
3
  import {
4
4
  table_default
5
- } from "../../chunk-A5PEB7CC.mjs";
5
+ } from "../../chunk-R2E7UZZO.mjs";
6
6
  import "../../chunk-VWD26TIQ.mjs";
7
7
  import "../../chunk-PO3ADNA5.mjs";
8
8
  import "../../chunk-QZ3LVYJW.mjs";
@@ -4134,7 +4134,7 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
4134
4134
  }
4135
4135
  )
4136
4136
  ] }),
4137
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
4137
+ rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
4138
4138
  ] });
4139
4139
  });
4140
4140
  Table.displayName = "Table";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  table_default
4
- } from "../../chunk-A5PEB7CC.mjs";
4
+ } from "../../chunk-R2E7UZZO.mjs";
5
5
  import "../../chunk-VWD26TIQ.mjs";
6
6
  import "../../chunk-PO3ADNA5.mjs";
7
7
  import "../../chunk-QZ3LVYJW.mjs";
@@ -16971,7 +16971,7 @@ var Table = (0, import_react6.forwardRef)((originalProps, ref) => {
16971
16971
  }
16972
16972
  )
16973
16973
  ] }),
16974
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
16974
+ rows2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
16975
16975
  ] });
16976
16976
  });
16977
16977
  Table.displayName = "Table";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  table_default
4
- } from "../../chunk-A5PEB7CC.mjs";
4
+ } from "../../chunk-R2E7UZZO.mjs";
5
5
  import "../../chunk-VWD26TIQ.mjs";
6
6
  import "../../chunk-PO3ADNA5.mjs";
7
7
  import "../../chunk-QZ3LVYJW.mjs";
@@ -3,4 +3,4 @@ import 'tailwind-variants';
3
3
  import 'tailwind-variants/dist/config';
4
4
  import 'react';
5
5
  import '../../utils/types.mjs';
6
- import '../../tooltip-utils-CrCabndd.mjs';
6
+ import '../../tooltip-utils-DR0UEfBN.mjs';
@@ -3,4 +3,4 @@ import 'tailwind-variants';
3
3
  import 'tailwind-variants/dist/config';
4
4
  import 'react';
5
5
  import '../../utils/types.js';
6
- import '../../tooltip-utils-CrCabndd.js';
6
+ import '../../tooltip-utils-DR0UEfBN.js';
@@ -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: () => setTargetRect(null),
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)`
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-HIE2YRGA.mjs";
3
3
  import {
4
4
  tooltip_default
5
- } from "../../chunk-FY5YCQL5.mjs";
5
+ } from "../../chunk-YZTGM3A3.mjs";
6
6
  import "../../chunk-DSBSLSJW.mjs";
7
7
  import "../../chunk-ODMRJXLJ.mjs";
8
8
  import "../../chunk-E3G5QXSH.mjs";
@@ -1,2 +1,2 @@
1
- export { T as TooltipPlacement, g as getTooltipPosition } from '../../tooltip-utils-CrCabndd.mjs';
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-CrCabndd.js';
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-CrCabndd.mjs';
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-CrCabndd.js';
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: () => setTargetRect(null),
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)`
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  tooltip_default
4
- } from "../../chunk-FY5YCQL5.mjs";
4
+ } from "../../chunk-YZTGM3A3.mjs";
5
5
  import "../../chunk-DSBSLSJW.mjs";
6
6
  import "../../chunk-ODMRJXLJ.mjs";
7
7
  import "../../chunk-E3G5QXSH.mjs";
@@ -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: () => setTargetRect(null),
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,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  tooltip_default
4
- } from "../../chunk-FY5YCQL5.mjs";
4
+ } from "../../chunk-YZTGM3A3.mjs";
5
5
  import "../../chunk-DSBSLSJW.mjs";
6
6
  import "../../chunk-ODMRJXLJ.mjs";
7
7
  import "../../chunk-VUYUQGLF.mjs";
@@ -1,2 +1,2 @@
1
1
  import 'react';
2
- export { a as TargetRect, u as useTooltip } from '../../tooltip-utils-CrCabndd.mjs';
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-CrCabndd.js';
2
+ export { a as TargetRect, u as useTooltip } from '../../tooltip-utils-DR0UEfBN.js';
package/dist/index.d.mts CHANGED
@@ -30,5 +30,5 @@ import 'react';
30
30
  import './utils/types.mjs';
31
31
  import 'react/jsx-runtime';
32
32
  import './components/icon/template.mjs';
33
- import './tooltip-utils-CrCabndd.mjs';
33
+ import './tooltip-utils-DR0UEfBN.mjs';
34
34
  import './components/toast/toast-utils.mjs';
package/dist/index.d.ts CHANGED
@@ -30,5 +30,5 @@ import 'react';
30
30
  import './utils/types.js';
31
31
  import 'react/jsx-runtime';
32
32
  import './components/icon/template.js';
33
- import './tooltip-utils-CrCabndd.js';
33
+ import './tooltip-utils-DR0UEfBN.js';
34
34
  import './components/toast/toast-utils.js';
package/dist/index.js CHANGED
@@ -5550,7 +5550,7 @@ var Table = (0, import_react11.forwardRef)((originalProps, ref) => {
5550
5550
  }
5551
5551
  )
5552
5552
  ] }),
5553
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
5553
+ rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...getLoadingWrapperProps(), children: loadingContent || "Loading..." })
5554
5554
  ] });
5555
5555
  });
5556
5556
  Table.displayName = "Table";
@@ -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: () => setTargetRect(null),
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)`
@@ -8446,7 +8456,8 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
8446
8456
  handleBlueInput,
8447
8457
  calculatePositionWithScroll
8448
8458
  } = useDatePicker({
8449
- initialDate: void 0
8459
+ initialDate: typeof value === "string" ? new Date(value) : void 0,
8460
+ initialTime: typeof value === "string" ? value : void 0
8450
8461
  });
8451
8462
  const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
8452
8463
  const getBaseProps = (0, import_react33.useCallback)(
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-FY5YCQL5.mjs";
5
+ } from "./chunk-YZTGM3A3.mjs";
6
6
  import "./chunk-DSBSLSJW.mjs";
7
7
  import "./chunk-ODMRJXLJ.mjs";
8
- import "./chunk-RRAZM5D3.mjs";
9
- import {
10
- textarea_default
11
- } from "./chunk-OJ2OEI5B.mjs";
12
- import "./chunk-3MY6LO7N.mjs";
8
+ import "./chunk-QCEKPS7U.mjs";
13
9
  import {
14
- tabs_default
15
- } from "./chunk-KRI5IALM.mjs";
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-2UUH2MBF.mjs";
23
+ import "./chunk-3MY6LO7N.mjs";
26
24
  import {
27
- table_default
28
- } from "./chunk-A5PEB7CC.mjs";
29
- import "./chunk-VWD26TIQ.mjs";
30
- import "./chunk-PO3ADNA5.mjs";
31
- import "./chunk-TPFN22HR.mjs";
25
+ tabs_default
26
+ } from "./chunk-KRI5IALM.mjs";
27
+ import "./chunk-RRAZM5D3.mjs";
32
28
  import {
33
- radio_default
34
- } from "./chunk-QWFOYO3D.mjs";
29
+ textarea_default
30
+ } from "./chunk-OJ2OEI5B.mjs";
31
+ import "./chunk-MV2WCFK7.mjs";
32
+ import {
33
+ slider_default
34
+ } from "./chunk-A3RWT3JJ.mjs";
35
35
  import "./chunk-LVFI2NOH.mjs";
36
36
  import {
37
37
  switch_default
38
38
  } from "./chunk-S3O52LLG.mjs";
39
- import "./chunk-QCEKPS7U.mjs";
40
- import {
41
- select_default
42
- } from "./chunk-JN7EGKJL.mjs";
43
- import "./chunk-RZZWHI6O.mjs";
44
- import "./chunk-S3QS5B7F.mjs";
45
- import "./chunk-MV2WCFK7.mjs";
39
+ import "./chunk-2UUH2MBF.mjs";
46
40
  import {
47
- slider_default
48
- } from "./chunk-A3RWT3JJ.mjs";
41
+ table_default
42
+ } from "./chunk-R2E7UZZO.mjs";
43
+ import "./chunk-VWD26TIQ.mjs";
44
+ import "./chunk-PO3ADNA5.mjs";
49
45
  import "./chunk-7VOQKIIK.mjs";
50
46
  import {
51
47
  progress_default
52
48
  } from "./chunk-N2JULHST.mjs";
49
+ import "./chunk-TPFN22HR.mjs";
50
+ import {
51
+ radio_default
52
+ } from "./chunk-QWFOYO3D.mjs";
53
53
  import "./chunk-DJOG6Z35.mjs";
54
54
  import {
55
55
  modal_default
@@ -63,15 +63,15 @@ import "./chunk-2GCSFWHD.mjs";
63
63
  import {
64
64
  input_default
65
65
  } from "./chunk-ZNEEYSIK.mjs";
66
- import "./chunk-VUYUQGLF.mjs";
67
66
  import "./chunk-QZ3LVYJW.mjs";
67
+ import "./chunk-HAOK24MK.mjs";
68
68
  import {
69
- checkbox_default
70
- } from "./chunk-ANYPMQH4.mjs";
69
+ card_default
70
+ } from "./chunk-2ALY3PH5.mjs";
71
71
  import "./chunk-75HLCORR.mjs";
72
72
  import {
73
73
  dateTimePicker_default
74
- } from "./chunk-ON2OTH5K.mjs";
74
+ } from "./chunk-TSMVRGDO.mjs";
75
75
  import "./chunk-FWJ2ZKH6.mjs";
76
76
  import "./chunk-FDKT4IBP.mjs";
77
77
  import "./chunk-P732YGHO.mjs";
@@ -84,16 +84,16 @@ import {
84
84
  listItem_default
85
85
  } from "./chunk-V77MALL4.mjs";
86
86
  import "./chunk-NMSDSEBD.mjs";
87
- import "./chunk-HAOK24MK.mjs";
88
- import {
89
- card_default
90
- } from "./chunk-2ALY3PH5.mjs";
87
+ import "./chunk-VUYUQGLF.mjs";
91
88
  import {
92
89
  button_group_default
93
90
  } from "./chunk-NGQ3MK2J.mjs";
94
91
  import {
95
92
  button_default
96
93
  } from "./chunk-UR64ZUAU.mjs";
94
+ import {
95
+ checkbox_default
96
+ } from "./chunk-ANYPMQH4.mjs";
97
97
  import "./chunk-27Y6K5NK.mjs";
98
98
  import {
99
99
  accordion_default
@@ -11,6 +11,7 @@ type TargetRect = {
11
11
  interface UseTooltipProps {
12
12
  placement: TooltipPlacement;
13
13
  offset: number;
14
+ delay: number;
14
15
  targetRect: TargetRect | null;
15
16
  }
16
17
  declare const useTooltip: ({ placement, offset, targetRect }: UseTooltipProps) => {
@@ -11,6 +11,7 @@ type TargetRect = {
11
11
  interface UseTooltipProps {
12
12
  placement: TooltipPlacement;
13
13
  offset: number;
14
+ delay: number;
14
15
  targetRect: TargetRect | null;
15
16
  }
16
17
  declare const useTooltip: ({ placement, offset, targetRect }: UseTooltipProps) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnoid/ui",
3
- "version": "0.0.102",
3
+ "version": "0.0.104",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",