@vuer-ai/vuer-uikit 0.0.11 → 0.0.12

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 (109) hide show
  1. package/dist/{chunk-CP7QYV4N.mjs → chunk-44KW6PTD.mjs} +1 -0
  2. package/dist/{chunk-KQAHAGUG.js → chunk-AOUGWGQR.js} +2 -2
  3. package/dist/{chunk-J7PTSP4Q.mjs → chunk-EAZQH4IX.mjs} +8 -0
  4. package/dist/chunk-EOFYA6CS.js +53 -0
  5. package/dist/{chunk-O4TK3AKI.mjs → chunk-EYIFKSU2.mjs} +1 -1
  6. package/dist/{chunk-WMXX2UMD.mjs → chunk-FEOONYZ2.mjs} +2 -2
  7. package/dist/{chunk-66DYOZI3.js → chunk-FORVP7XH.js} +6 -5
  8. package/dist/{chunk-7X6N54LX.mjs → chunk-G5KMD72J.mjs} +6 -5
  9. package/dist/{chunk-5MZCQW4U.js → chunk-IXHMIR5P.js} +4 -4
  10. package/dist/{chunk-CCGUGCCV.js → chunk-JAJNLRY5.js} +9 -9
  11. package/dist/{chunk-WOZWC6KO.mjs → chunk-JMPVDU2C.mjs} +35 -4
  12. package/dist/{chunk-E5KWKBH3.mjs → chunk-LEPXSM36.mjs} +10 -24
  13. package/dist/{chunk-3XVIJY3H.mjs → chunk-MRVMXKZO.mjs} +1 -1
  14. package/dist/{chunk-UMIQYHO6.mjs → chunk-OOI3SJDU.mjs} +10 -4
  15. package/dist/{chunk-B5EMQBVL.js → chunk-OTPUWWEB.js} +8 -3
  16. package/dist/{chunk-FSMKJAZT.js → chunk-PVRQNCSJ.js} +9 -23
  17. package/dist/chunk-Q5KEB4UK.mjs +51 -0
  18. package/dist/{chunk-XUQ5A7ZA.js → chunk-QEY7BWIR.js} +10 -4
  19. package/dist/{chunk-QZASHJNJ.js → chunk-QJR6MCTR.js} +8 -0
  20. package/dist/{chunk-IOI3YFTY.js → chunk-U2ZLDPOE.js} +8 -8
  21. package/dist/{chunk-ZJXBC33M.js → chunk-UFHMEEGL.js} +1 -0
  22. package/dist/{chunk-5P3KAS53.js → chunk-WJ7T7FAH.js} +34 -3
  23. package/dist/{chunk-6L4KPPOD.mjs → chunk-XMG3IVGZ.mjs} +8 -3
  24. package/dist/{chunk-XCCC7HVN.mjs → chunk-ZVG2UKKC.mjs} +1 -1
  25. package/dist/highlight-cursor/cursor-provider.js +2 -2
  26. package/dist/highlight-cursor/cursor-provider.mjs +1 -1
  27. package/dist/highlight-cursor/enhanced-components.js +11 -10
  28. package/dist/highlight-cursor/enhanced-components.mjs +6 -5
  29. package/dist/highlight-cursor/index.js +15 -14
  30. package/dist/highlight-cursor/index.mjs +7 -6
  31. package/dist/highlight-cursor/tabs-cursor-context.js +3 -3
  32. package/dist/highlight-cursor/tabs-cursor-context.mjs +1 -1
  33. package/dist/highlight-cursor/with-cursor.js +2 -2
  34. package/dist/highlight-cursor/with-cursor.mjs +1 -1
  35. package/dist/index.d.mts +1 -0
  36. package/dist/index.d.ts +1 -0
  37. package/dist/index.js +64 -59
  38. package/dist/index.mjs +15 -14
  39. package/dist/ui/avatar.js +2 -1
  40. package/dist/ui/avatar.mjs +2 -1
  41. package/dist/ui/badge.js +2 -1
  42. package/dist/ui/badge.mjs +2 -1
  43. package/dist/ui/button.js +2 -1
  44. package/dist/ui/button.mjs +2 -1
  45. package/dist/ui/card.js +2 -1
  46. package/dist/ui/card.mjs +2 -1
  47. package/dist/ui/checkbox.js +2 -1
  48. package/dist/ui/checkbox.mjs +2 -1
  49. package/dist/ui/collapsible.js +2 -1
  50. package/dist/ui/collapsible.mjs +2 -1
  51. package/dist/ui/dropdown.js +2 -1
  52. package/dist/ui/dropdown.mjs +2 -1
  53. package/dist/ui/index.js +49 -48
  54. package/dist/ui/index.mjs +12 -11
  55. package/dist/ui/input-numbers.js +4 -3
  56. package/dist/ui/input-numbers.mjs +3 -2
  57. package/dist/ui/input.js +2 -1
  58. package/dist/ui/input.mjs +2 -1
  59. package/dist/ui/layout.js +2 -1
  60. package/dist/ui/layout.mjs +2 -1
  61. package/dist/ui/modal.js +2 -1
  62. package/dist/ui/modal.mjs +2 -1
  63. package/dist/ui/popover.js +2 -1
  64. package/dist/ui/popover.mjs +2 -1
  65. package/dist/ui/radio-group.js +2 -1
  66. package/dist/ui/radio-group.mjs +2 -1
  67. package/dist/ui/select.js +2 -1
  68. package/dist/ui/select.mjs +2 -1
  69. package/dist/ui/slider.js +2 -1
  70. package/dist/ui/slider.mjs +2 -1
  71. package/dist/ui/switch.js +2 -1
  72. package/dist/ui/switch.mjs +2 -1
  73. package/dist/ui/tabs.js +8 -7
  74. package/dist/ui/tabs.mjs +4 -3
  75. package/dist/ui/textarea.js +2 -1
  76. package/dist/ui/textarea.mjs +2 -1
  77. package/dist/ui/theme-context.js +6 -3
  78. package/dist/ui/theme-context.mjs +4 -1
  79. package/dist/ui/timeline.js +6 -5
  80. package/dist/ui/timeline.mjs +5 -4
  81. package/dist/ui/toast.d.mts +1 -1
  82. package/dist/ui/toast.d.ts +1 -1
  83. package/dist/ui/toast.js +3 -3
  84. package/dist/ui/toast.mjs +1 -1
  85. package/dist/ui/toggle-group.js +2 -1
  86. package/dist/ui/toggle-group.mjs +2 -1
  87. package/dist/ui/toggle.js +2 -1
  88. package/dist/ui/toggle.mjs +2 -1
  89. package/dist/ui/tooltip.d.mts +3 -3
  90. package/dist/ui/tooltip.d.ts +3 -3
  91. package/dist/ui/tooltip.js +7 -6
  92. package/dist/ui/tooltip.mjs +3 -2
  93. package/dist/ui/tree-view-v2.js +5 -4
  94. package/dist/ui/tree-view-v2.mjs +4 -3
  95. package/dist/ui/version-badge.js +2 -1
  96. package/dist/ui/version-badge.mjs +2 -1
  97. package/dist/utils/index.d.mts +1 -0
  98. package/dist/utils/index.d.ts +1 -0
  99. package/dist/utils/index.js +6 -1
  100. package/dist/utils/index.mjs +2 -1
  101. package/dist/utils/use-local-storage.d.mts +3 -0
  102. package/dist/utils/use-local-storage.d.ts +3 -0
  103. package/dist/utils/use-local-storage.js +10 -0
  104. package/dist/utils/use-local-storage.mjs +1 -0
  105. package/package.json +4 -3
  106. package/dist/chunk-OBWGRG45.js +0 -21
  107. package/dist/chunk-Z6XRPTIQ.mjs +0 -15
  108. /package/dist/{chunk-QS7WS6DD.mjs → chunk-M4IVLZIH.mjs} +0 -0
  109. /package/dist/{chunk-ST4P6AN6.js → chunk-XWS4SIB5.js} +0 -0
@@ -16,6 +16,7 @@ var getVisibleRect = (element, elementRect) => {
16
16
  y: elementRect.y
17
17
  };
18
18
  while (parent) {
19
+ if (typeof window === "undefined") break;
19
20
  const style = window.getComputedStyle(parent);
20
21
  const hasOverflow = [style.overflowY, style.overflowX].some(
21
22
  (overflow) => ["auto", "scroll", "hidden"].includes(overflow)
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkIOI3YFTY_js = require('./chunk-IOI3YFTY.js');
3
+ var chunkU2ZLDPOE_js = require('./chunk-U2ZLDPOE.js');
4
4
  var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
5
5
  var lucideReact = require('lucide-react');
6
6
  var React = require('react');
@@ -276,7 +276,7 @@ function Timeline({ data, totalDuration, getIcon }) {
276
276
  }, [viewStart, viewDuration, updateCursor]);
277
277
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-bg-primary text-text-primary border-line-secondary/20 rounded-uk-md mx-auto w-full max-w-7xl overflow-hidden border font-sans shadow-2xl", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[minmax(300px,30%)_1fr]", children: [
278
278
  /* @__PURE__ */ jsxRuntime.jsx(
279
- chunkIOI3YFTY_js.TreeView,
279
+ chunkU2ZLDPOE_js.TreeView,
280
280
  {
281
281
  data,
282
282
  getIcon,
@@ -1,9 +1,17 @@
1
+ import { useState, useEffect } from 'react';
1
2
  import { Toaster as Toaster$1 } from 'sonner';
2
3
  export { toast } from 'sonner';
3
4
  import { jsx } from 'react/jsx-runtime';
4
5
 
5
6
  // src/ui/toast.tsx
6
7
  var Toaster = ({ ...props }) => {
8
+ const [isClient, setIsClient] = useState(false);
9
+ useEffect(() => {
10
+ setIsClient(true);
11
+ }, []);
12
+ if (!isClient) {
13
+ return null;
14
+ }
7
15
  return /* @__PURE__ */ jsx(
8
16
  Toaster$1,
9
17
  {
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ // src/utils/use-local-storage.ts
6
+ function useLocalStorage(key, initialValue) {
7
+ const [storedValue, setStoredValue] = react.useState(() => {
8
+ if (typeof window === "undefined") {
9
+ return initialValue;
10
+ }
11
+ try {
12
+ const item = window.localStorage.getItem(key);
13
+ if (item === null) return initialValue;
14
+ if (typeof initialValue === "string") {
15
+ return item;
16
+ } else if (typeof initialValue === "number") {
17
+ return parseFloat(item) || initialValue;
18
+ } else if (typeof initialValue === "boolean") {
19
+ return item === "true";
20
+ } else {
21
+ return JSON.parse(item);
22
+ }
23
+ } catch (error) {
24
+ console.warn(`Error reading localStorage key "${key}":`, error);
25
+ return initialValue;
26
+ }
27
+ });
28
+ const setValue = react.useCallback(
29
+ (value) => {
30
+ try {
31
+ const valueToStore = value instanceof Function ? value(storedValue) : value;
32
+ setStoredValue(valueToStore);
33
+ if (typeof window !== "undefined") {
34
+ let stringValue;
35
+ if (typeof valueToStore === "string") {
36
+ stringValue = valueToStore;
37
+ } else if (typeof valueToStore === "number" || typeof valueToStore === "boolean") {
38
+ stringValue = valueToStore.toString();
39
+ } else {
40
+ stringValue = JSON.stringify(valueToStore);
41
+ }
42
+ window.localStorage.setItem(key, stringValue);
43
+ }
44
+ } catch (error) {
45
+ console.warn(`Error setting localStorage key "${key}":`, error);
46
+ }
47
+ },
48
+ [key, storedValue]
49
+ );
50
+ return [storedValue, setValue];
51
+ }
52
+
53
+ exports.useLocalStorage = useLocalStorage;
@@ -1,4 +1,4 @@
1
- import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from './chunk-WOZWC6KO.mjs';
1
+ import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from './chunk-JMPVDU2C.mjs';
2
2
  import { cn } from './chunk-KTNZSZ5Y.mjs';
3
3
  import { Search, CaseSensitive, Regex, ChevronDown } from 'lucide-react';
4
4
  import { useState, useMemo, useEffect } from 'react';
@@ -1,9 +1,9 @@
1
- import { Tabs } from './chunk-3XVIJY3H.mjs';
1
+ import { Tabs } from './chunk-MRVMXKZO.mjs';
2
2
  import { Textarea } from './chunk-DDOX4EEM.mjs';
3
3
  import { SelectTrigger } from './chunk-QVUX6LLD.mjs';
4
4
  import { Button } from './chunk-IQ6J7YTQ.mjs';
5
5
  import { InputRoot } from './chunk-QYRRQ65X.mjs';
6
- import { withCursor } from './chunk-CP7QYV4N.mjs';
6
+ import { withCursor } from './chunk-44KW6PTD.mjs';
7
7
 
8
8
  // src/highlight-cursor/enhanced-components.tsx
9
9
  var CursorButton = withCursor(Button);
@@ -31,6 +31,7 @@ var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValu
31
31
  const selectRange = react.useRef([null, null]);
32
32
  const inputChange = react.useRef(false);
33
33
  const stopClick = react.useCallback(() => {
34
+ if (typeof document === "undefined") return;
34
35
  const stopClick2 = (e) => {
35
36
  e.stopPropagation();
36
37
  e.preventDefault();
@@ -44,7 +45,7 @@ var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValu
44
45
  event.preventDefault();
45
46
  if (selectRange.current[0] === null) {
46
47
  selectRange.current[0] = getHoverElementAndIndex(
47
- document.elementFromPoint(...initial),
48
+ typeof document !== "undefined" ? document.elementFromPoint(...initial) : null,
48
49
  inputs.current
49
50
  );
50
51
  }
@@ -68,7 +69,7 @@ var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValu
68
69
  stopClick();
69
70
  }
70
71
  if (!inputChange.current) {
71
- const currentElement = document.elementFromPoint(...xy);
72
+ const currentElement = typeof document !== "undefined" ? document.elementFromPoint(...xy) : null;
72
73
  const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
73
74
  selectRange.current[1] = currentIndex ?? selectRange.current[1];
74
75
  changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
@@ -133,13 +134,13 @@ var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValu
133
134
  "data-[hover=y]:bg-bg-tertiary",
134
135
  "data-[hover=down]:cursor-move",
135
136
  "data-[hover=x]:cursor-col-resize",
136
- "data-[hover=y]:cursor-row-resize"
137
+ "data-[hover=y]:cursor-ns-resize"
137
138
  ]),
138
139
  inputClassName: chunkXXWQ4RVP_js.cn([
139
140
  "cursor-crosshair",
140
141
  "group-data-[hover=down]/number-input:cursor-move",
141
142
  "group-data-[hover=x]/number-input:cursor-col-resize",
142
- "group-data-[hover=y]/number-input:cursor-row-resize"
143
+ "group-data-[hover=y]/number-input:cursor-ns-resize"
143
144
  ]),
144
145
  children: /* @__PURE__ */ jsxRuntime.jsx(
145
146
  chunkSKO72K64_js.InputSlot,
@@ -148,7 +149,7 @@ var InputNumbers = react.forwardRef(function InputNumbers2({ size, value, onValu
148
149
  "cursor-crosshair",
149
150
  "group-data-[hover=down]/number-input:cursor-move",
150
151
  "group-data-[hover=x]/number-input:cursor-col-resize",
151
- "group-data-[hover=y]/number-input:cursor-row-resize"
152
+ "group-data-[hover=y]/number-input:cursor-ns-resize"
152
153
  ),
153
154
  children: prefix == null ? void 0 : prefix[index]
154
155
  }
@@ -29,6 +29,7 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
29
29
  const selectRange = useRef([null, null]);
30
30
  const inputChange = useRef(false);
31
31
  const stopClick = useCallback(() => {
32
+ if (typeof document === "undefined") return;
32
33
  const stopClick2 = (e) => {
33
34
  e.stopPropagation();
34
35
  e.preventDefault();
@@ -42,7 +43,7 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
42
43
  event.preventDefault();
43
44
  if (selectRange.current[0] === null) {
44
45
  selectRange.current[0] = getHoverElementAndIndex(
45
- document.elementFromPoint(...initial),
46
+ typeof document !== "undefined" ? document.elementFromPoint(...initial) : null,
46
47
  inputs.current
47
48
  );
48
49
  }
@@ -66,7 +67,7 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
66
67
  stopClick();
67
68
  }
68
69
  if (!inputChange.current) {
69
- const currentElement = document.elementFromPoint(...xy);
70
+ const currentElement = typeof document !== "undefined" ? document.elementFromPoint(...xy) : null;
70
71
  const currentIndex = getHoverElementAndIndex(currentElement, inputs.current);
71
72
  selectRange.current[1] = currentIndex ?? selectRange.current[1];
72
73
  changeElementsHoverState(inputs.current, selectRange.current, oy !== 0 ? "y" : "none");
@@ -131,13 +132,13 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
131
132
  "data-[hover=y]:bg-bg-tertiary",
132
133
  "data-[hover=down]:cursor-move",
133
134
  "data-[hover=x]:cursor-col-resize",
134
- "data-[hover=y]:cursor-row-resize"
135
+ "data-[hover=y]:cursor-ns-resize"
135
136
  ]),
136
137
  inputClassName: cn([
137
138
  "cursor-crosshair",
138
139
  "group-data-[hover=down]/number-input:cursor-move",
139
140
  "group-data-[hover=x]/number-input:cursor-col-resize",
140
- "group-data-[hover=y]/number-input:cursor-row-resize"
141
+ "group-data-[hover=y]/number-input:cursor-ns-resize"
141
142
  ]),
142
143
  children: /* @__PURE__ */ jsx(
143
144
  InputSlot,
@@ -146,7 +147,7 @@ var InputNumbers = forwardRef(function InputNumbers2({ size, value, onValuesChan
146
147
  "cursor-crosshair",
147
148
  "group-data-[hover=down]/number-input:cursor-move",
148
149
  "group-data-[hover=x]/number-input:cursor-col-resize",
149
- "group-data-[hover=y]/number-input:cursor-row-resize"
150
+ "group-data-[hover=y]/number-input:cursor-ns-resize"
150
151
  ),
151
152
  children: prefix == null ? void 0 : prefix[index]
152
153
  }
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
4
- var chunkB5EMQBVL_js = require('./chunk-B5EMQBVL.js');
4
+ var chunkOTPUWWEB_js = require('./chunk-OTPUWWEB.js');
5
5
  var TabsPrimitive = require('@radix-ui/react-tabs');
6
6
  var classVarianceAuthority = require('class-variance-authority');
7
7
  var react = require('react');
@@ -58,9 +58,9 @@ var tabsListVariants = classVarianceAuthority.cva(["inline-flex", "items-center"
58
58
  }
59
59
  });
60
60
  function TabsList({ className, ...props }) {
61
- const { setCursorTarget } = chunkB5EMQBVL_js.useTabsCursor();
61
+ const { setCursorTarget } = chunkOTPUWWEB_js.useTabsCursor();
62
62
  const { size } = useTabsContext();
63
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB5EMQBVL_js.TabsCursorProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
63
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkOTPUWWEB_js.TabsCursorProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
64
64
  TabsPrimitive__namespace.List,
65
65
  {
66
66
  onMouseLeave: () => setCursorTarget(null),
@@ -102,7 +102,7 @@ var tabsTriggerVariants = classVarianceAuthority.cva(
102
102
  }
103
103
  );
104
104
  function TabsTrigger({ className, ...props }) {
105
- const { setCursorTarget } = chunkB5EMQBVL_js.useTabsCursor();
105
+ const { setCursorTarget } = chunkOTPUWWEB_js.useTabsCursor();
106
106
  const { size } = useTabsContext();
107
107
  return /* @__PURE__ */ jsxRuntime.jsx(
108
108
  TabsPrimitive__namespace.Trigger,
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkMZ4POL3U_js = require('./chunk-MZ4POL3U.js');
4
- var chunk5MZCQW4U_js = require('./chunk-5MZCQW4U.js');
3
+ var chunkIXHMIR5P_js = require('./chunk-IXHMIR5P.js');
5
4
  var chunk5OUTEHVX_js = require('./chunk-5OUTEHVX.js');
6
- var chunkSKO72K64_js = require('./chunk-SKO72K64.js');
7
- var chunkZJXBC33M_js = require('./chunk-ZJXBC33M.js');
5
+ var chunkMZ4POL3U_js = require('./chunk-MZ4POL3U.js');
8
6
  var chunkQA7H2Z3Z_js = require('./chunk-QA7H2Z3Z.js');
7
+ var chunkSKO72K64_js = require('./chunk-SKO72K64.js');
8
+ var chunkUFHMEEGL_js = require('./chunk-UFHMEEGL.js');
9
9
 
10
10
  // src/highlight-cursor/enhanced-components.tsx
11
- var CursorButton = chunkZJXBC33M_js.withCursor(chunkQA7H2Z3Z_js.Button);
12
- var CursorTabs = chunkZJXBC33M_js.withCursor(chunk5MZCQW4U_js.Tabs);
13
- var CursorInputRoot = chunkZJXBC33M_js.withCursor(chunkSKO72K64_js.InputRoot);
14
- var CursorSelectTrigger = chunkZJXBC33M_js.withCursor(chunkMZ4POL3U_js.SelectTrigger);
15
- var CursorTextarea = chunkZJXBC33M_js.withCursor(chunk5OUTEHVX_js.Textarea);
11
+ var CursorButton = chunkUFHMEEGL_js.withCursor(chunkQA7H2Z3Z_js.Button);
12
+ var CursorTabs = chunkUFHMEEGL_js.withCursor(chunkIXHMIR5P_js.Tabs);
13
+ var CursorInputRoot = chunkUFHMEEGL_js.withCursor(chunkSKO72K64_js.InputRoot);
14
+ var CursorSelectTrigger = chunkUFHMEEGL_js.withCursor(chunkMZ4POL3U_js.SelectTrigger);
15
+ var CursorTextarea = chunkUFHMEEGL_js.withCursor(chunk5OUTEHVX_js.Textarea);
16
16
 
17
17
  exports.CursorButton = CursorButton;
18
18
  exports.CursorInputRoot = CursorInputRoot;
@@ -1,24 +1,48 @@
1
1
  import { cn } from './chunk-KTNZSZ5Y.mjs';
2
2
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
- import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { useState, useEffect } from 'react';
4
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
5
 
5
6
  function TooltipProvider({
6
7
  delayDuration = 0,
8
+ children,
7
9
  ...props
8
10
  }) {
11
+ const [isClient, setIsClient] = useState(false);
12
+ useEffect(() => {
13
+ setIsClient(true);
14
+ }, []);
15
+ if (!isClient) {
16
+ return /* @__PURE__ */ jsx(Fragment, { children });
17
+ }
9
18
  return /* @__PURE__ */ jsx(
10
19
  TooltipPrimitive.Provider,
11
20
  {
12
21
  "data-slot": "tooltip-provider",
13
22
  delayDuration,
14
- ...props
23
+ ...props,
24
+ children
15
25
  }
16
26
  );
17
27
  }
18
- function Tooltip({ ...props }) {
19
- return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
28
+ function Tooltip({ children, ...props }) {
29
+ const [isClient, setIsClient] = useState(false);
30
+ useEffect(() => {
31
+ setIsClient(true);
32
+ }, []);
33
+ if (!isClient) {
34
+ return /* @__PURE__ */ jsx(Fragment, { children });
35
+ }
36
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, children }) });
20
37
  }
21
38
  function TooltipTrigger({ ...props }) {
39
+ const [isClient, setIsClient] = useState(false);
40
+ useEffect(() => {
41
+ setIsClient(true);
42
+ }, []);
43
+ if (!isClient) {
44
+ return /* @__PURE__ */ jsx(Fragment, { children: props.children });
45
+ }
22
46
  return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
23
47
  }
24
48
  function TooltipContent({
@@ -27,6 +51,13 @@ function TooltipContent({
27
51
  children,
28
52
  ...props
29
53
  }) {
54
+ const [isClient, setIsClient] = useState(false);
55
+ useEffect(() => {
56
+ setIsClient(true);
57
+ }, []);
58
+ if (!isClient) {
59
+ return null;
60
+ }
30
61
  return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
31
62
  TooltipPrimitive.Content,
32
63
  {
@@ -1,7 +1,7 @@
1
- import { createContext, useState, useEffect, useMemo, useContext } from 'react';
1
+ import { useLocalStorage } from './chunk-Q5KEB4UK.mjs';
2
+ import { createContext, useEffect, useMemo, useContext } from 'react';
2
3
  import { jsx } from 'react/jsx-runtime';
3
4
 
4
- // src/ui/theme-context.tsx
5
5
  var initialState = {
6
6
  theme: "system",
7
7
  setTheme: () => null
@@ -13,10 +13,7 @@ function ThemeProvider({
13
13
  storageKey = "vuer-theme",
14
14
  ...props
15
15
  }) {
16
- const [theme, setTheme] = useState(() => {
17
- if (typeof window === "undefined") return defaultTheme;
18
- return localStorage.getItem(storageKey) || defaultTheme;
19
- });
16
+ const [theme, setTheme] = useLocalStorage(storageKey, defaultTheme);
20
17
  useEffect(() => {
21
18
  if (typeof window === "undefined") return;
22
19
  const root = window.document.documentElement;
@@ -31,25 +28,14 @@ function ThemeProvider({
31
28
  root.classList.add(theme);
32
29
  root.setAttribute("data-theme", theme);
33
30
  }, [theme]);
34
- return /* @__PURE__ */ jsx(
35
- ThemeProviderContext.Provider,
36
- {
37
- ...props,
38
- value: useMemo(
39
- () => ({
40
- theme,
41
- setTheme: (theme2) => {
42
- if (typeof window !== "undefined") {
43
- localStorage.setItem(storageKey, theme2);
44
- }
45
- setTheme(theme2);
46
- }
47
- }),
48
- [storageKey, theme]
49
- ),
50
- children
51
- }
31
+ const value = useMemo(
32
+ () => ({
33
+ theme,
34
+ setTheme
35
+ }),
36
+ [theme, setTheme]
52
37
  );
38
+ return /* @__PURE__ */ jsx(ThemeProviderContext.Provider, { ...props, value, children });
53
39
  }
54
40
  var useTheme = () => {
55
41
  const context = useContext(ThemeProviderContext);
@@ -1,5 +1,5 @@
1
1
  import { cn } from './chunk-KTNZSZ5Y.mjs';
2
- import { useTabsCursor, TabsCursorProvider } from './chunk-6L4KPPOD.mjs';
2
+ import { useTabsCursor, TabsCursorProvider } from './chunk-XMG3IVGZ.mjs';
3
3
  import * as TabsPrimitive from '@radix-ui/react-tabs';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { createContext, useContext } from 'react';
@@ -15,6 +15,7 @@ var CursorProvider = ({
15
15
  as: Component = "div",
16
16
  ...props
17
17
  }) => {
18
+ const [isClient, setIsClient] = useState(false);
18
19
  const [isMouseInside, setIsMouseInside] = useState(false);
19
20
  const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
20
21
  const [hoveredElementId, setHoveredElementId] = useState(null);
@@ -28,12 +29,16 @@ var CursorProvider = ({
28
29
  });
29
30
  const hoveredElementRef = useRef(null);
30
31
  useEffect(() => {
32
+ setIsClient(true);
33
+ }, []);
34
+ useEffect(() => {
35
+ if (!isClient) return;
31
36
  const handleMouseMove = (e) => {
32
37
  setMousePosition({ x: e.clientX, y: e.clientY });
33
38
  };
34
39
  document.addEventListener("mousemove", handleMouseMove);
35
40
  return () => document.removeEventListener("mousemove", handleMouseMove);
36
- }, []);
41
+ }, [isClient]);
37
42
  const handleMouseEnter = useCallback(() => {
38
43
  setIsMouseInside(true);
39
44
  }, []);
@@ -62,6 +67,7 @@ var CursorProvider = ({
62
67
  }
63
68
  }, [mousePosition, hoveredElementId]);
64
69
  useEffect(() => {
70
+ if (!isClient) return;
65
71
  const handleScroll = () => {
66
72
  checkMouseInElement();
67
73
  };
@@ -69,7 +75,7 @@ var CursorProvider = ({
69
75
  return () => {
70
76
  document.removeEventListener("scroll", handleScroll, { capture: true });
71
77
  };
72
- }, [checkMouseInElement]);
78
+ }, [checkMouseInElement, isClient]);
73
79
  const registerHoveredElement = useCallback(
74
80
  (id, dimensions, element) => {
75
81
  setHoveredElementId(id);
@@ -168,7 +174,7 @@ var CursorProvider = ({
168
174
  } else {
169
175
  styleClass = `opacity-90 rounded-xl z-10 transition-[width,height,left,top] duration-${transitionDuration} ease-out transition-opacity duration-${transitionDuration}`;
170
176
  }
171
- const cursorElement = isMouseInside && /* @__PURE__ */ jsx(
177
+ const cursorElement = isClient && isMouseInside && /* @__PURE__ */ jsx(
172
178
  "div",
173
179
  {
174
180
  className: `pointer-events-none fixed ${styleClass} ${hoveredElementId ? "" : cursorClassName || ""}`,
@@ -179,7 +185,7 @@ var CursorProvider = ({
179
185
  }
180
186
  );
181
187
  return /* @__PURE__ */ jsxs(Fragment, { children: [
182
- typeof document !== "undefined" && document.body && cursorElement && createPortal(cursorElement, document.body),
188
+ isClient && typeof document !== "undefined" && document.body && cursorElement && createPortal(cursorElement, document.body),
183
189
  /* @__PURE__ */ jsx(CursorContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
184
190
  Component,
185
191
  {
@@ -12,17 +12,22 @@ var TabsCursorProvider = ({
12
12
  className,
13
13
  ...props
14
14
  }) => {
15
+ const [isClient, setIsClient] = react.useState(false);
15
16
  const [cursorTarget, setCursorTarget] = react.useState(null);
16
17
  const [targetRect, setTargetRect] = react.useState(null);
17
18
  const [mousePosition, setMousePosition] = react.useState({ x: 0, y: 0 });
18
19
  const [isMouseInside, setIsMouseInside] = react.useState(false);
19
20
  react.useEffect(() => {
21
+ setIsClient(true);
22
+ }, []);
23
+ react.useEffect(() => {
24
+ if (!isClient) return;
20
25
  const handleMouseMove = (e) => {
21
26
  setMousePosition({ x: e.clientX, y: e.clientY });
22
27
  };
23
28
  document.addEventListener("mousemove", handleMouseMove);
24
29
  return () => document.removeEventListener("mousemove", handleMouseMove);
25
- }, []);
30
+ }, [isClient]);
26
31
  react.useEffect(() => {
27
32
  if (cursorTarget) {
28
33
  setTargetRect(cursorTarget.getBoundingClientRect());
@@ -51,7 +56,7 @@ var TabsCursorProvider = ({
51
56
  onMouseLeave: handleMouseLeave,
52
57
  children: /* @__PURE__ */ jsxRuntime.jsxs(TabsCursorContext.Provider, { value: contextValue, children: [
53
58
  children,
54
- isMouseInside && reactDom.createPortal(
59
+ isClient && isMouseInside && typeof document !== "undefined" && document.body && reactDom.createPortal(
55
60
  /* @__PURE__ */ jsxRuntime.jsx(
56
61
  framerMotion.motion.div,
57
62
  {
@@ -62,7 +67,7 @@ var TabsCursorProvider = ({
62
67
  y: targetRect ? targetRect.top : mousePosition.y - 8,
63
68
  width: targetRect ? targetRect.width : 16,
64
69
  height: targetRect ? targetRect.height : 16,
65
- borderRadius: targetRect && cursorTarget ? getComputedStyle(cursorTarget).borderRadius : "50%"
70
+ borderRadius: targetRect && cursorTarget && typeof window !== "undefined" ? getComputedStyle(cursorTarget).borderRadius : "50%"
66
71
  },
67
72
  transition: { type: "spring", stiffness: 1e3, damping: 60, mass: 1 },
68
73
  style: {
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
+ var chunkEOFYA6CS_js = require('./chunk-EOFYA6CS.js');
3
4
  var react = require('react');
4
5
  var jsxRuntime = require('react/jsx-runtime');
5
6
 
6
- // src/ui/theme-context.tsx
7
7
  var initialState = {
8
8
  theme: "system",
9
9
  setTheme: () => null
@@ -15,10 +15,7 @@ function ThemeProvider({
15
15
  storageKey = "vuer-theme",
16
16
  ...props
17
17
  }) {
18
- const [theme, setTheme] = react.useState(() => {
19
- if (typeof window === "undefined") return defaultTheme;
20
- return localStorage.getItem(storageKey) || defaultTheme;
21
- });
18
+ const [theme, setTheme] = chunkEOFYA6CS_js.useLocalStorage(storageKey, defaultTheme);
22
19
  react.useEffect(() => {
23
20
  if (typeof window === "undefined") return;
24
21
  const root = window.document.documentElement;
@@ -33,25 +30,14 @@ function ThemeProvider({
33
30
  root.classList.add(theme);
34
31
  root.setAttribute("data-theme", theme);
35
32
  }, [theme]);
36
- return /* @__PURE__ */ jsxRuntime.jsx(
37
- ThemeProviderContext.Provider,
38
- {
39
- ...props,
40
- value: react.useMemo(
41
- () => ({
42
- theme,
43
- setTheme: (theme2) => {
44
- if (typeof window !== "undefined") {
45
- localStorage.setItem(storageKey, theme2);
46
- }
47
- setTheme(theme2);
48
- }
49
- }),
50
- [storageKey, theme]
51
- ),
52
- children
53
- }
33
+ const value = react.useMemo(
34
+ () => ({
35
+ theme,
36
+ setTheme
37
+ }),
38
+ [theme, setTheme]
54
39
  );
40
+ return /* @__PURE__ */ jsxRuntime.jsx(ThemeProviderContext.Provider, { ...props, value, children });
55
41
  }
56
42
  var useTheme = () => {
57
43
  const context = react.useContext(ThemeProviderContext);
@@ -0,0 +1,51 @@
1
+ import { useState, useCallback } from 'react';
2
+
3
+ // src/utils/use-local-storage.ts
4
+ function useLocalStorage(key, initialValue) {
5
+ const [storedValue, setStoredValue] = useState(() => {
6
+ if (typeof window === "undefined") {
7
+ return initialValue;
8
+ }
9
+ try {
10
+ const item = window.localStorage.getItem(key);
11
+ if (item === null) return initialValue;
12
+ if (typeof initialValue === "string") {
13
+ return item;
14
+ } else if (typeof initialValue === "number") {
15
+ return parseFloat(item) || initialValue;
16
+ } else if (typeof initialValue === "boolean") {
17
+ return item === "true";
18
+ } else {
19
+ return JSON.parse(item);
20
+ }
21
+ } catch (error) {
22
+ console.warn(`Error reading localStorage key "${key}":`, error);
23
+ return initialValue;
24
+ }
25
+ });
26
+ const setValue = useCallback(
27
+ (value) => {
28
+ try {
29
+ const valueToStore = value instanceof Function ? value(storedValue) : value;
30
+ setStoredValue(valueToStore);
31
+ if (typeof window !== "undefined") {
32
+ let stringValue;
33
+ if (typeof valueToStore === "string") {
34
+ stringValue = valueToStore;
35
+ } else if (typeof valueToStore === "number" || typeof valueToStore === "boolean") {
36
+ stringValue = valueToStore.toString();
37
+ } else {
38
+ stringValue = JSON.stringify(valueToStore);
39
+ }
40
+ window.localStorage.setItem(key, stringValue);
41
+ }
42
+ } catch (error) {
43
+ console.warn(`Error setting localStorage key "${key}":`, error);
44
+ }
45
+ },
46
+ [key, storedValue]
47
+ );
48
+ return [storedValue, setValue];
49
+ }
50
+
51
+ export { useLocalStorage };