@vuer-ai/vuer-uikit 0.0.7 → 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.
- package/README.md +2 -0
- package/dist/{chunk-EGPLKTJM.js → chunk-2YCL2ET2.js} +1 -1
- package/dist/{chunk-CP7QYV4N.mjs → chunk-44KW6PTD.mjs} +1 -0
- package/dist/{chunk-KQAHAGUG.js → chunk-AOUGWGQR.js} +2 -2
- package/dist/{chunk-J7PTSP4Q.mjs → chunk-EAZQH4IX.mjs} +8 -0
- package/dist/{chunk-4PAHMURP.js → chunk-EFIRD3FN.js} +2 -1
- package/dist/chunk-EOFYA6CS.js +53 -0
- package/dist/{chunk-O4TK3AKI.mjs → chunk-EYIFKSU2.mjs} +1 -1
- package/dist/{chunk-WMXX2UMD.mjs → chunk-FEOONYZ2.mjs} +2 -2
- package/dist/{chunk-66DYOZI3.js → chunk-FORVP7XH.js} +6 -5
- package/dist/{chunk-7X6N54LX.mjs → chunk-G5KMD72J.mjs} +6 -5
- package/dist/{chunk-5MZCQW4U.js → chunk-IXHMIR5P.js} +4 -4
- package/dist/{chunk-OBWGRG45.js → chunk-JAJNLRY5.js} +7 -7
- package/dist/{chunk-WOZWC6KO.mjs → chunk-JMPVDU2C.mjs} +35 -4
- package/dist/{chunk-E5KWKBH3.mjs → chunk-LEPXSM36.mjs} +10 -24
- package/dist/chunk-M4TZHOUK.js +41 -0
- package/dist/{chunk-3XVIJY3H.mjs → chunk-MRVMXKZO.mjs} +1 -1
- package/dist/{chunk-UMIQYHO6.mjs → chunk-OOI3SJDU.mjs} +10 -4
- package/dist/{chunk-B5EMQBVL.js → chunk-OTPUWWEB.js} +8 -3
- package/dist/{chunk-FSMKJAZT.js → chunk-PVRQNCSJ.js} +9 -23
- package/dist/chunk-Q5KEB4UK.mjs +51 -0
- package/dist/{chunk-XUQ5A7ZA.js → chunk-QEY7BWIR.js} +10 -4
- package/dist/{chunk-QZASHJNJ.js → chunk-QJR6MCTR.js} +8 -0
- package/dist/chunk-T3WBC5YK.mjs +39 -0
- package/dist/{chunk-IOI3YFTY.js → chunk-U2ZLDPOE.js} +8 -8
- package/dist/{chunk-ZJXBC33M.js → chunk-UFHMEEGL.js} +1 -0
- package/dist/{chunk-IG43DNY2.mjs → chunk-UKFVRXAR.mjs} +1 -1
- package/dist/{chunk-5P3KAS53.js → chunk-WJ7T7FAH.js} +34 -3
- package/dist/{chunk-SP3DH5MP.mjs → chunk-WO3WHXDP.mjs} +2 -1
- package/dist/{chunk-6L4KPPOD.mjs → chunk-XMG3IVGZ.mjs} +8 -3
- package/dist/{chunk-XCCC7HVN.mjs → chunk-ZVG2UKKC.mjs} +1 -1
- package/dist/highlight-cursor/cursor-provider.js +2 -2
- package/dist/highlight-cursor/cursor-provider.mjs +1 -1
- package/dist/highlight-cursor/enhanced-components.js +11 -10
- package/dist/highlight-cursor/enhanced-components.mjs +6 -5
- package/dist/highlight-cursor/index.js +15 -14
- package/dist/highlight-cursor/index.mjs +7 -6
- package/dist/highlight-cursor/tabs-cursor-context.js +3 -3
- package/dist/highlight-cursor/tabs-cursor-context.mjs +1 -1
- package/dist/highlight-cursor/with-cursor.js +2 -2
- package/dist/highlight-cursor/with-cursor.mjs +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +72 -62
- package/dist/index.mjs +18 -16
- package/dist/ui/avatar.js +2 -1
- package/dist/ui/avatar.mjs +2 -1
- package/dist/ui/badge.d.mts +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.js +5 -4
- package/dist/ui/badge.mjs +3 -2
- package/dist/ui/button.js +2 -1
- package/dist/ui/button.mjs +2 -1
- package/dist/ui/card.js +2 -1
- package/dist/ui/card.mjs +2 -1
- package/dist/ui/checkbox.js +2 -1
- package/dist/ui/checkbox.mjs +2 -1
- package/dist/ui/collapsible.js +2 -1
- package/dist/ui/collapsible.mjs +2 -1
- package/dist/ui/dropdown.js +2 -1
- package/dist/ui/dropdown.mjs +2 -1
- package/dist/ui/index.d.mts +1 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +57 -51
- package/dist/ui/index.mjs +15 -13
- package/dist/ui/input-numbers.js +4 -3
- package/dist/ui/input-numbers.mjs +3 -2
- package/dist/ui/input.d.mts +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/input.js +2 -1
- package/dist/ui/input.mjs +2 -1
- package/dist/ui/layout.js +2 -1
- package/dist/ui/layout.mjs +2 -1
- package/dist/ui/modal.js +2 -1
- package/dist/ui/modal.mjs +2 -1
- package/dist/ui/popover.js +2 -1
- package/dist/ui/popover.mjs +2 -1
- package/dist/ui/radio-group.js +2 -1
- package/dist/ui/radio-group.mjs +2 -1
- package/dist/ui/select.d.mts +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.js +2 -1
- package/dist/ui/select.mjs +2 -1
- package/dist/ui/slider.js +2 -1
- package/dist/ui/slider.mjs +2 -1
- package/dist/ui/switch.js +2 -1
- package/dist/ui/switch.mjs +2 -1
- package/dist/ui/tabs.js +8 -7
- package/dist/ui/tabs.mjs +4 -3
- package/dist/ui/textarea.d.mts +1 -1
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/textarea.js +2 -1
- package/dist/ui/textarea.mjs +2 -1
- package/dist/ui/theme-context.js +6 -3
- package/dist/ui/theme-context.mjs +4 -1
- package/dist/ui/timeline.js +6 -5
- package/dist/ui/timeline.mjs +5 -4
- package/dist/ui/toast.d.mts +1 -1
- package/dist/ui/toast.d.ts +1 -1
- package/dist/ui/toast.js +3 -3
- package/dist/ui/toast.mjs +1 -1
- package/dist/ui/toggle-group.js +2 -1
- package/dist/ui/toggle-group.mjs +2 -1
- package/dist/ui/toggle.js +2 -1
- package/dist/ui/toggle.mjs +2 -1
- package/dist/ui/tooltip.d.mts +3 -3
- package/dist/ui/tooltip.d.ts +3 -3
- package/dist/ui/tooltip.js +7 -6
- package/dist/ui/tooltip.mjs +3 -2
- package/dist/ui/tree-view-v2.js +5 -4
- package/dist/ui/tree-view-v2.mjs +4 -3
- package/dist/ui/tree-view.js +2 -2
- package/dist/ui/tree-view.mjs +1 -1
- package/dist/ui/version-badge.d.mts +26 -0
- package/dist/ui/version-badge.d.ts +26 -0
- package/dist/ui/version-badge.js +14 -0
- package/dist/ui/version-badge.mjs +5 -0
- package/dist/utils/index.d.mts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +6 -1
- package/dist/utils/index.mjs +2 -1
- package/dist/utils/use-local-storage.d.mts +3 -0
- package/dist/utils/use-local-storage.d.ts +3 -0
- package/dist/utils/use-local-storage.js +10 -0
- package/dist/utils/use-local-storage.mjs +1 -0
- package/package.json +4 -3
- /package/dist/{chunk-IKIXD35H.mjs → chunk-F56ZKT7B.mjs} +0 -0
- /package/dist/{chunk-QS7WS6DD.mjs → chunk-M4IVLZIH.mjs} +0 -0
- /package/dist/{chunk-P3NMVNEO.js → chunk-N7CINZS2.js} +0 -0
- /package/dist/{chunk-ST4P6AN6.js → chunk-XWS4SIB5.js} +0 -0
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ var TreeView = react.forwardRef(
|
|
|
111
111
|
"div",
|
|
112
112
|
{
|
|
113
113
|
className: chunkXXWQ4RVP_js.cn(
|
|
114
|
-
"bg-bg-primary relative max-w-[300px] min-w-[240px] overflow-hidden p-2",
|
|
114
|
+
"bg-bg-primary rounded-uk-md relative max-w-[300px] min-w-[240px] overflow-hidden p-2",
|
|
115
115
|
className
|
|
116
116
|
),
|
|
117
117
|
"data-tree-container": true,
|
|
@@ -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
|
|
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
|
-
|
|
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
|
{
|
|
@@ -32,7 +32,8 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
32
32
|
secondary: "bg-bg-secondary",
|
|
33
33
|
destructive: "bg-danger-primary",
|
|
34
34
|
success: "bg-accent-success",
|
|
35
|
-
warning: "bg-accent-warning"
|
|
35
|
+
warning: "bg-accent-warning",
|
|
36
|
+
accent: "bg-accent-primary text-text-primary"
|
|
36
37
|
},
|
|
37
38
|
type: {
|
|
38
39
|
default: "",
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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 } =
|
|
61
|
+
const { setCursorTarget } = chunkOTPUWWEB_js.useTabsCursor();
|
|
62
62
|
const { size } = useTabsContext();
|
|
63
|
-
return /* @__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 } =
|
|
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
|
|
3
|
+
var chunkIXHMIR5P_js = require('./chunk-IXHMIR5P.js');
|
|
4
4
|
var chunk5OUTEHVX_js = require('./chunk-5OUTEHVX.js');
|
|
5
5
|
var chunkMZ4POL3U_js = require('./chunk-MZ4POL3U.js');
|
|
6
6
|
var chunkQA7H2Z3Z_js = require('./chunk-QA7H2Z3Z.js');
|
|
7
7
|
var chunkSKO72K64_js = require('./chunk-SKO72K64.js');
|
|
8
|
-
var
|
|
8
|
+
var chunkUFHMEEGL_js = require('./chunk-UFHMEEGL.js');
|
|
9
9
|
|
|
10
10
|
// src/highlight-cursor/enhanced-components.tsx
|
|
11
|
-
var CursorButton =
|
|
12
|
-
var CursorTabs =
|
|
13
|
-
var CursorInputRoot =
|
|
14
|
-
var CursorSelectTrigger =
|
|
15
|
-
var CursorTextarea =
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
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] =
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkEFIRD3FN_js = require('./chunk-EFIRD3FN.js');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
var PACKAGE_VERSION = "0.0.11";
|
|
7
|
+
var PACKAGE_NAME = "@vuer-ai/vuer-uikit";
|
|
8
|
+
function VersionBadge({
|
|
9
|
+
className,
|
|
10
|
+
showPrefix = true,
|
|
11
|
+
linkable = true,
|
|
12
|
+
version: overrideVersion
|
|
13
|
+
}) {
|
|
14
|
+
const currentVersion = overrideVersion || PACKAGE_VERSION;
|
|
15
|
+
const displayVersion = showPrefix ? `v${currentVersion}` : currentVersion;
|
|
16
|
+
const npmUrl = `https://www.npmjs.com/package/${PACKAGE_NAME}/v/${currentVersion}`;
|
|
17
|
+
const badge = /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
+
chunkEFIRD3FN_js.Badge,
|
|
19
|
+
{
|
|
20
|
+
variant: "accent",
|
|
21
|
+
className,
|
|
22
|
+
style: linkable ? { cursor: "pointer" } : void 0,
|
|
23
|
+
children: displayVersion
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
if (linkable) {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
28
|
+
"a",
|
|
29
|
+
{
|
|
30
|
+
href: npmUrl,
|
|
31
|
+
target: "_blank",
|
|
32
|
+
rel: "noopener noreferrer",
|
|
33
|
+
className: "no-underline hover:no-underline",
|
|
34
|
+
children: badge
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return badge;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.VersionBadge = VersionBadge;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from './chunk-KTNZSZ5Y.mjs';
|
|
2
|
-
import { useTabsCursor, TabsCursorProvider } from './chunk-
|
|
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] =
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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);
|