@vuer-ai/vuer-uikit 0.0.50 → 0.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-WZ6GCPO6.mjs → chunk-6UBBRJGO.mjs} +19 -10
- package/dist/{chunk-FIEU3WRH.mjs → chunk-F43NGNKR.mjs} +1 -1
- package/dist/{chunk-CSRGTGG7.js → chunk-HS3WEBRT.js} +1 -1
- package/dist/{chunk-EPHUL35Z.js → chunk-WWJYQ2DN.js} +19 -10
- package/dist/index.js +5 -5
- package/dist/index.mjs +2 -2
- package/dist/ui/index.js +5 -5
- package/dist/ui/index.mjs +2 -2
- package/dist/ui/theme/ThemeToggles.d.mts +8 -3
- package/dist/ui/theme/ThemeToggles.d.ts +8 -3
- package/dist/ui/theme/ThemeToggles.js +3 -3
- package/dist/ui/theme/ThemeToggles.mjs +1 -1
- package/dist/ui/theme/index.d.mts +3 -0
- package/dist/ui/theme/index.d.ts +3 -0
- package/dist/ui/theme/index.js +3 -3
- package/dist/ui/theme/index.mjs +1 -1
- package/dist/ui/version-badge.js +2 -2
- package/dist/ui/version-badge.mjs +1 -1
- package/package.json +1 -1
- package/src/ui/theme/ThemeToggles.tsx +25 -14
|
@@ -2,11 +2,14 @@ import { useTheme } from './chunk-DCSGUVTI.mjs';
|
|
|
2
2
|
import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-TCN3UDQE.mjs';
|
|
3
3
|
import { Button } from './chunk-GY65PGYR.mjs';
|
|
4
4
|
import { createClientOnlyComponent } from './chunk-4F2GSF2T.mjs';
|
|
5
|
+
import { useDocument } from './chunk-QG5Z4C65.mjs';
|
|
6
|
+
import { cn } from './chunk-WM2VP7MI.mjs';
|
|
5
7
|
import { Droplet, Sun, SunMoon, Moon } from 'lucide-react';
|
|
6
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
9
|
|
|
8
|
-
var LiquidToggleButton = () => {
|
|
10
|
+
var LiquidToggleButton = (props) => {
|
|
9
11
|
const { theme, setTheme, storageKey } = useTheme();
|
|
12
|
+
const document = useDocument();
|
|
10
13
|
const handleLiquidToggle = () => {
|
|
11
14
|
let newTheme;
|
|
12
15
|
if (theme === "light") {
|
|
@@ -22,7 +25,9 @@ var LiquidToggleButton = () => {
|
|
|
22
25
|
} else {
|
|
23
26
|
newTheme = "liquid-light";
|
|
24
27
|
}
|
|
25
|
-
document
|
|
28
|
+
if (document) {
|
|
29
|
+
document.cookie = `${storageKey}=${newTheme}`;
|
|
30
|
+
}
|
|
26
31
|
setTheme(newTheme);
|
|
27
32
|
};
|
|
28
33
|
const isLiquid = theme === "liquid-light" || theme === "liquid-dark";
|
|
@@ -32,11 +37,12 @@ var LiquidToggleButton = () => {
|
|
|
32
37
|
Button,
|
|
33
38
|
{
|
|
34
39
|
icon: true,
|
|
35
|
-
onClick: handleLiquidToggle,
|
|
36
40
|
variant: "ghost",
|
|
37
41
|
value: isLiquid,
|
|
38
42
|
"aria-label": `Toggle liquid theme: ${isSystem ? "disabled (system mode)" : isLiquid ? "on" : "off"}`,
|
|
39
|
-
|
|
43
|
+
...props,
|
|
44
|
+
onClick: handleLiquidToggle,
|
|
45
|
+
className: cn(props.className, isSystem && "cursor-not-allowed opacity-50"),
|
|
40
46
|
disabled: isSystem,
|
|
41
47
|
children: /* @__PURE__ */ jsx(Droplet, { size: 20 })
|
|
42
48
|
}
|
|
@@ -44,8 +50,9 @@ var LiquidToggleButton = () => {
|
|
|
44
50
|
/* @__PURE__ */ jsx(TooltipContent, { children: "Toggle liquid theme" })
|
|
45
51
|
] });
|
|
46
52
|
};
|
|
47
|
-
var ThemeToggleButton = () => {
|
|
53
|
+
var ThemeToggleButton = (props) => {
|
|
48
54
|
const { theme, setTheme, storageKey } = useTheme();
|
|
55
|
+
const document = useDocument();
|
|
49
56
|
const handleThemeChange = () => {
|
|
50
57
|
let newTheme;
|
|
51
58
|
if (theme === "light") {
|
|
@@ -61,7 +68,9 @@ var ThemeToggleButton = () => {
|
|
|
61
68
|
} else {
|
|
62
69
|
newTheme = "light";
|
|
63
70
|
}
|
|
64
|
-
document
|
|
71
|
+
if (document) {
|
|
72
|
+
document.cookie = `${storageKey}=${newTheme}`;
|
|
73
|
+
}
|
|
65
74
|
setTheme(newTheme);
|
|
66
75
|
};
|
|
67
76
|
const isDark = theme === "dark" || theme === "liquid-dark";
|
|
@@ -70,15 +79,15 @@ var ThemeToggleButton = () => {
|
|
|
70
79
|
Button,
|
|
71
80
|
{
|
|
72
81
|
icon: true,
|
|
73
|
-
onClick: handleThemeChange,
|
|
74
82
|
variant: "ghost",
|
|
75
|
-
value: !isSystem,
|
|
76
83
|
"aria-label": `Current theme: ${isSystem ? "system" : isDark ? "dark" : "light"}`,
|
|
84
|
+
...props,
|
|
85
|
+
onClick: handleThemeChange,
|
|
77
86
|
children: isSystem ? /* @__PURE__ */ jsx(SunMoon, { size: 20 }) : isDark ? /* @__PURE__ */ jsx(Moon, { size: 20 }) : /* @__PURE__ */ jsx(Sun, { size: 20 })
|
|
78
87
|
}
|
|
79
88
|
);
|
|
80
89
|
};
|
|
81
|
-
var LiquidToggle = createClientOnlyComponent(LiquidToggleButton, () => /* @__PURE__ */ jsx(Button, { icon: true, variant: "ghost", "aria-label": "Liquid toggle loading...", children: /* @__PURE__ */ jsx(Droplet, { size: 20 }) }));
|
|
82
|
-
var ThemeToggle = createClientOnlyComponent(ThemeToggleButton, () => /* @__PURE__ */ jsx(Button, { icon: true, variant: "ghost", "aria-label": "Theme toggle loading...", children: /* @__PURE__ */ jsx(Sun, { size: 20 }) }));
|
|
90
|
+
var LiquidToggle = createClientOnlyComponent(LiquidToggleButton, (props) => /* @__PURE__ */ jsx(Button, { icon: true, variant: "ghost", "aria-label": "Liquid toggle loading...", ...props, children: /* @__PURE__ */ jsx(Droplet, { size: 20 }) }));
|
|
91
|
+
var ThemeToggle = createClientOnlyComponent(ThemeToggleButton, (props) => /* @__PURE__ */ jsx(Button, { icon: true, variant: "ghost", "aria-label": "Theme toggle loading...", ...props, children: /* @__PURE__ */ jsx(Sun, { size: 20 }) }));
|
|
83
92
|
|
|
84
93
|
export { LiquidToggle, ThemeToggle };
|
|
@@ -4,11 +4,14 @@ var chunk37WZTN4K_js = require('./chunk-37WZTN4K.js');
|
|
|
4
4
|
var chunkER6XHUS7_js = require('./chunk-ER6XHUS7.js');
|
|
5
5
|
var chunkX6APNY5D_js = require('./chunk-X6APNY5D.js');
|
|
6
6
|
var chunkQG7ZF6TO_js = require('./chunk-QG7ZF6TO.js');
|
|
7
|
+
var chunkOASPTOVZ_js = require('./chunk-OASPTOVZ.js');
|
|
8
|
+
var chunk7KYAICHB_js = require('./chunk-7KYAICHB.js');
|
|
7
9
|
var lucideReact = require('lucide-react');
|
|
8
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
11
|
|
|
10
|
-
var LiquidToggleButton = () => {
|
|
12
|
+
var LiquidToggleButton = (props) => {
|
|
11
13
|
const { theme, setTheme, storageKey } = chunk37WZTN4K_js.useTheme();
|
|
14
|
+
const document = chunkOASPTOVZ_js.useDocument();
|
|
12
15
|
const handleLiquidToggle = () => {
|
|
13
16
|
let newTheme;
|
|
14
17
|
if (theme === "light") {
|
|
@@ -24,7 +27,9 @@ var LiquidToggleButton = () => {
|
|
|
24
27
|
} else {
|
|
25
28
|
newTheme = "liquid-light";
|
|
26
29
|
}
|
|
27
|
-
document
|
|
30
|
+
if (document) {
|
|
31
|
+
document.cookie = `${storageKey}=${newTheme}`;
|
|
32
|
+
}
|
|
28
33
|
setTheme(newTheme);
|
|
29
34
|
};
|
|
30
35
|
const isLiquid = theme === "liquid-light" || theme === "liquid-dark";
|
|
@@ -34,11 +39,12 @@ var LiquidToggleButton = () => {
|
|
|
34
39
|
chunkX6APNY5D_js.Button,
|
|
35
40
|
{
|
|
36
41
|
icon: true,
|
|
37
|
-
onClick: handleLiquidToggle,
|
|
38
42
|
variant: "ghost",
|
|
39
43
|
value: isLiquid,
|
|
40
44
|
"aria-label": `Toggle liquid theme: ${isSystem ? "disabled (system mode)" : isLiquid ? "on" : "off"}`,
|
|
41
|
-
|
|
45
|
+
...props,
|
|
46
|
+
onClick: handleLiquidToggle,
|
|
47
|
+
className: chunk7KYAICHB_js.cn(props.className, isSystem && "cursor-not-allowed opacity-50"),
|
|
42
48
|
disabled: isSystem,
|
|
43
49
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Droplet, { size: 20 })
|
|
44
50
|
}
|
|
@@ -46,8 +52,9 @@ var LiquidToggleButton = () => {
|
|
|
46
52
|
/* @__PURE__ */ jsxRuntime.jsx(chunkER6XHUS7_js.TooltipContent, { children: "Toggle liquid theme" })
|
|
47
53
|
] });
|
|
48
54
|
};
|
|
49
|
-
var ThemeToggleButton = () => {
|
|
55
|
+
var ThemeToggleButton = (props) => {
|
|
50
56
|
const { theme, setTheme, storageKey } = chunk37WZTN4K_js.useTheme();
|
|
57
|
+
const document = chunkOASPTOVZ_js.useDocument();
|
|
51
58
|
const handleThemeChange = () => {
|
|
52
59
|
let newTheme;
|
|
53
60
|
if (theme === "light") {
|
|
@@ -63,7 +70,9 @@ var ThemeToggleButton = () => {
|
|
|
63
70
|
} else {
|
|
64
71
|
newTheme = "light";
|
|
65
72
|
}
|
|
66
|
-
document
|
|
73
|
+
if (document) {
|
|
74
|
+
document.cookie = `${storageKey}=${newTheme}`;
|
|
75
|
+
}
|
|
67
76
|
setTheme(newTheme);
|
|
68
77
|
};
|
|
69
78
|
const isDark = theme === "dark" || theme === "liquid-dark";
|
|
@@ -72,16 +81,16 @@ var ThemeToggleButton = () => {
|
|
|
72
81
|
chunkX6APNY5D_js.Button,
|
|
73
82
|
{
|
|
74
83
|
icon: true,
|
|
75
|
-
onClick: handleThemeChange,
|
|
76
84
|
variant: "ghost",
|
|
77
|
-
value: !isSystem,
|
|
78
85
|
"aria-label": `Current theme: ${isSystem ? "system" : isDark ? "dark" : "light"}`,
|
|
86
|
+
...props,
|
|
87
|
+
onClick: handleThemeChange,
|
|
79
88
|
children: isSystem ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SunMoon, { size: 20 }) : isDark ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { size: 20 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { size: 20 })
|
|
80
89
|
}
|
|
81
90
|
);
|
|
82
91
|
};
|
|
83
|
-
var LiquidToggle = chunkQG7ZF6TO_js.createClientOnlyComponent(LiquidToggleButton, () => /* @__PURE__ */ jsxRuntime.jsx(chunkX6APNY5D_js.Button, { icon: true, variant: "ghost", "aria-label": "Liquid toggle loading...", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Droplet, { size: 20 }) }));
|
|
84
|
-
var ThemeToggle = chunkQG7ZF6TO_js.createClientOnlyComponent(ThemeToggleButton, () => /* @__PURE__ */ jsxRuntime.jsx(chunkX6APNY5D_js.Button, { icon: true, variant: "ghost", "aria-label": "Theme toggle loading...", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { size: 20 }) }));
|
|
92
|
+
var LiquidToggle = chunkQG7ZF6TO_js.createClientOnlyComponent(LiquidToggleButton, (props) => /* @__PURE__ */ jsxRuntime.jsx(chunkX6APNY5D_js.Button, { icon: true, variant: "ghost", "aria-label": "Liquid toggle loading...", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Droplet, { size: 20 }) }));
|
|
93
|
+
var ThemeToggle = chunkQG7ZF6TO_js.createClientOnlyComponent(ThemeToggleButton, (props) => /* @__PURE__ */ jsxRuntime.jsx(chunkX6APNY5D_js.Button, { icon: true, variant: "ghost", "aria-label": "Theme toggle loading...", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { size: 20 }) }));
|
|
85
94
|
|
|
86
95
|
exports.LiquidToggle = LiquidToggle;
|
|
87
96
|
exports.ThemeToggle = ThemeToggle;
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./chunk-GLGYNU3Q.js');
|
|
4
4
|
require('./chunk-EDJTVLBN.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkWWJYQ2DN_js = require('./chunk-WWJYQ2DN.js');
|
|
6
6
|
var chunk37WZTN4K_js = require('./chunk-37WZTN4K.js');
|
|
7
7
|
var chunkFRMG67QP_js = require('./chunk-FRMG67QP.js');
|
|
8
8
|
require('./chunk-GVDU3F7X.js');
|
|
@@ -24,7 +24,7 @@ var chunk6TMEH2MB_js = require('./chunk-6TMEH2MB.js');
|
|
|
24
24
|
var chunkFSFUZ7Y6_js = require('./chunk-FSFUZ7Y6.js');
|
|
25
25
|
var chunkEAN5SZYQ_js = require('./chunk-EAN5SZYQ.js');
|
|
26
26
|
var chunkEOTROHFU_js = require('./chunk-EOTROHFU.js');
|
|
27
|
-
var
|
|
27
|
+
var chunkHS3WEBRT_js = require('./chunk-HS3WEBRT.js');
|
|
28
28
|
var chunkWRF3C24J_js = require('./chunk-WRF3C24J.js');
|
|
29
29
|
var chunk4HJQPZQ2_js = require('./chunk-4HJQPZQ2.js');
|
|
30
30
|
var chunkUGCFQYE2_js = require('./chunk-UGCFQYE2.js');
|
|
@@ -75,11 +75,11 @@ var chunkOTPUWWEB_js = require('./chunk-OTPUWWEB.js');
|
|
|
75
75
|
|
|
76
76
|
Object.defineProperty(exports, "LiquidToggle", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkWWJYQ2DN_js.LiquidToggle; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "ThemeToggle", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkWWJYQ2DN_js.ThemeToggle; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
85
85
|
enumerable: true,
|
|
@@ -171,7 +171,7 @@ Object.defineProperty(exports, "TreeView", {
|
|
|
171
171
|
});
|
|
172
172
|
Object.defineProperty(exports, "VersionBadge", {
|
|
173
173
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkHS3WEBRT_js.VersionBadge; }
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "createSelectable", {
|
|
177
177
|
enumerable: true,
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './chunk-ZFWQLAQA.mjs';
|
|
2
2
|
import './chunk-6NK7UMFP.mjs';
|
|
3
|
-
export { LiquidToggle, ThemeToggle } from './chunk-
|
|
3
|
+
export { LiquidToggle, ThemeToggle } from './chunk-6UBBRJGO.mjs';
|
|
4
4
|
export { ThemeProvider, useTheme } from './chunk-DCSGUVTI.mjs';
|
|
5
5
|
export { ThemeScript } from './chunk-NSI47INE.mjs';
|
|
6
6
|
import './chunk-OJUTHWTF.mjs';
|
|
@@ -22,7 +22,7 @@ export { NumberInput } from './chunk-QD6L25T6.mjs';
|
|
|
22
22
|
export { ToggleGroup, ToggleGroupItem } from './chunk-G6CSH3FC.mjs';
|
|
23
23
|
export { Toggle, toggleVariants } from './chunk-K6R7H7R2.mjs';
|
|
24
24
|
export { TreeView } from './chunk-DDG2W6BX.mjs';
|
|
25
|
-
export { VersionBadge } from './chunk-
|
|
25
|
+
export { VersionBadge } from './chunk-F43NGNKR.mjs';
|
|
26
26
|
export { createSelectable } from './chunk-TVKPO5VK.mjs';
|
|
27
27
|
export { DragSelectProvider, useDragSelectContext } from './chunk-JBQP2CBI.mjs';
|
|
28
28
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from './chunk-SG2PPP7N.mjs';
|
package/dist/ui/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('../chunk-GLGYNU3Q.js');
|
|
4
4
|
require('../chunk-EDJTVLBN.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkWWJYQ2DN_js = require('../chunk-WWJYQ2DN.js');
|
|
6
6
|
var chunk37WZTN4K_js = require('../chunk-37WZTN4K.js');
|
|
7
7
|
var chunkFRMG67QP_js = require('../chunk-FRMG67QP.js');
|
|
8
8
|
require('../chunk-GVDU3F7X.js');
|
|
@@ -24,7 +24,7 @@ var chunk6TMEH2MB_js = require('../chunk-6TMEH2MB.js');
|
|
|
24
24
|
var chunkFSFUZ7Y6_js = require('../chunk-FSFUZ7Y6.js');
|
|
25
25
|
var chunkEAN5SZYQ_js = require('../chunk-EAN5SZYQ.js');
|
|
26
26
|
var chunkEOTROHFU_js = require('../chunk-EOTROHFU.js');
|
|
27
|
-
var
|
|
27
|
+
var chunkHS3WEBRT_js = require('../chunk-HS3WEBRT.js');
|
|
28
28
|
var chunkWRF3C24J_js = require('../chunk-WRF3C24J.js');
|
|
29
29
|
var chunk4HJQPZQ2_js = require('../chunk-4HJQPZQ2.js');
|
|
30
30
|
var chunkUGCFQYE2_js = require('../chunk-UGCFQYE2.js');
|
|
@@ -70,11 +70,11 @@ require('../chunk-OTPUWWEB.js');
|
|
|
70
70
|
|
|
71
71
|
Object.defineProperty(exports, "LiquidToggle", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkWWJYQ2DN_js.LiquidToggle; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "ThemeToggle", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkWWJYQ2DN_js.ThemeToggle; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
80
80
|
enumerable: true,
|
|
@@ -166,7 +166,7 @@ Object.defineProperty(exports, "TreeView", {
|
|
|
166
166
|
});
|
|
167
167
|
Object.defineProperty(exports, "VersionBadge", {
|
|
168
168
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunkHS3WEBRT_js.VersionBadge; }
|
|
170
170
|
});
|
|
171
171
|
Object.defineProperty(exports, "createSelectable", {
|
|
172
172
|
enumerable: true,
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../chunk-ZFWQLAQA.mjs';
|
|
2
2
|
import '../chunk-6NK7UMFP.mjs';
|
|
3
|
-
export { LiquidToggle, ThemeToggle } from '../chunk-
|
|
3
|
+
export { LiquidToggle, ThemeToggle } from '../chunk-6UBBRJGO.mjs';
|
|
4
4
|
export { ThemeProvider, useTheme } from '../chunk-DCSGUVTI.mjs';
|
|
5
5
|
export { ThemeScript } from '../chunk-NSI47INE.mjs';
|
|
6
6
|
import '../chunk-OJUTHWTF.mjs';
|
|
@@ -22,7 +22,7 @@ export { NumberInput } from '../chunk-QD6L25T6.mjs';
|
|
|
22
22
|
export { ToggleGroup, ToggleGroupItem } from '../chunk-G6CSH3FC.mjs';
|
|
23
23
|
export { Toggle, toggleVariants } from '../chunk-K6R7H7R2.mjs';
|
|
24
24
|
export { TreeView } from '../chunk-DDG2W6BX.mjs';
|
|
25
|
-
export { VersionBadge } from '../chunk-
|
|
25
|
+
export { VersionBadge } from '../chunk-F43NGNKR.mjs';
|
|
26
26
|
export { createSelectable } from '../chunk-TVKPO5VK.mjs';
|
|
27
27
|
export { DragSelectProvider, useDragSelectContext } from '../chunk-JBQP2CBI.mjs';
|
|
28
28
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar } from '../chunk-SG2PPP7N.mjs';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import react__default from 'react';
|
|
1
|
+
import react__default, { ComponentProps } from 'react';
|
|
2
|
+
import { Button } from '../button.mjs';
|
|
3
|
+
import 'class-variance-authority/types';
|
|
4
|
+
import 'class-variance-authority';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
type LiquidToggleProps = Omit<ComponentProps<typeof Button>, "onClick" | "children">;
|
|
7
|
+
type ThemeToggleProps = Omit<ComponentProps<typeof Button>, "onClick" | "children">;
|
|
8
|
+
declare const LiquidToggle: react__default.ComponentType<LiquidToggleProps>;
|
|
9
|
+
declare const ThemeToggle: react__default.ComponentType<ThemeToggleProps>;
|
|
5
10
|
|
|
6
11
|
export { LiquidToggle, ThemeToggle };
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import react__default from 'react';
|
|
1
|
+
import react__default, { ComponentProps } from 'react';
|
|
2
|
+
import { Button } from '../button.js';
|
|
3
|
+
import 'class-variance-authority/types';
|
|
4
|
+
import 'class-variance-authority';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
type LiquidToggleProps = Omit<ComponentProps<typeof Button>, "onClick" | "children">;
|
|
7
|
+
type ThemeToggleProps = Omit<ComponentProps<typeof Button>, "onClick" | "children">;
|
|
8
|
+
declare const LiquidToggle: react__default.ComponentType<LiquidToggleProps>;
|
|
9
|
+
declare const ThemeToggle: react__default.ComponentType<ThemeToggleProps>;
|
|
5
10
|
|
|
6
11
|
export { LiquidToggle, ThemeToggle };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWWJYQ2DN_js = require('../../chunk-WWJYQ2DN.js');
|
|
4
4
|
require('../../chunk-37WZTN4K.js');
|
|
5
5
|
require('../../chunk-FRMG67QP.js');
|
|
6
6
|
require('../../chunk-ER6XHUS7.js');
|
|
@@ -17,9 +17,9 @@ require('../../chunk-7KYAICHB.js');
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "LiquidToggle", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkWWJYQ2DN_js.LiquidToggle; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "ThemeToggle", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkWWJYQ2DN_js.ThemeToggle; }
|
|
25
25
|
});
|
|
@@ -4,3 +4,6 @@ export { ThemeScript } from './themeScript.mjs';
|
|
|
4
4
|
export { Attribute, ThemeProviderProps, UseThemeProps } from './types.mjs';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
6
6
|
import 'react';
|
|
7
|
+
import '../button.mjs';
|
|
8
|
+
import 'class-variance-authority/types';
|
|
9
|
+
import 'class-variance-authority';
|
package/dist/ui/theme/index.d.ts
CHANGED
|
@@ -4,3 +4,6 @@ export { ThemeScript } from './themeScript.js';
|
|
|
4
4
|
export { Attribute, ThemeProviderProps, UseThemeProps } from './types.js';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
6
6
|
import 'react';
|
|
7
|
+
import '../button.js';
|
|
8
|
+
import 'class-variance-authority/types';
|
|
9
|
+
import 'class-variance-authority';
|
package/dist/ui/theme/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../../chunk-EDJTVLBN.js');
|
|
4
|
-
var
|
|
4
|
+
var chunkWWJYQ2DN_js = require('../../chunk-WWJYQ2DN.js');
|
|
5
5
|
var chunk37WZTN4K_js = require('../../chunk-37WZTN4K.js');
|
|
6
6
|
var chunkFRMG67QP_js = require('../../chunk-FRMG67QP.js');
|
|
7
7
|
require('../../chunk-ER6XHUS7.js');
|
|
@@ -18,11 +18,11 @@ require('../../chunk-7KYAICHB.js');
|
|
|
18
18
|
|
|
19
19
|
Object.defineProperty(exports, "LiquidToggle", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkWWJYQ2DN_js.LiquidToggle; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "ThemeToggle", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkWWJYQ2DN_js.ThemeToggle; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
28
28
|
enumerable: true,
|
package/dist/ui/theme/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../../chunk-6NK7UMFP.mjs';
|
|
2
|
-
export { LiquidToggle, ThemeToggle } from '../../chunk-
|
|
2
|
+
export { LiquidToggle, ThemeToggle } from '../../chunk-6UBBRJGO.mjs';
|
|
3
3
|
export { ThemeProvider, useTheme } from '../../chunk-DCSGUVTI.mjs';
|
|
4
4
|
export { ThemeScript } from '../../chunk-NSI47INE.mjs';
|
|
5
5
|
import '../../chunk-TCN3UDQE.mjs';
|
package/dist/ui/version-badge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHS3WEBRT_js = require('../chunk-HS3WEBRT.js');
|
|
4
4
|
require('../chunk-ILJK43VJ.js');
|
|
5
5
|
require('../chunk-UBVYEZI3.js');
|
|
6
6
|
require('../chunk-W3APG27Q.js');
|
|
@@ -14,5 +14,5 @@ require('../chunk-7KYAICHB.js');
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "VersionBadge", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkHS3WEBRT_js.VersionBadge; }
|
|
18
18
|
});
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// Liquid toggle component
|
|
2
|
+
import React, { type ComponentProps } from "react";
|
|
2
3
|
import { Droplet, Moon, Sun, SunMoon } from "lucide-react";
|
|
3
|
-
import React from "react";
|
|
4
|
-
|
|
5
4
|
import { Button } from "../button";
|
|
6
5
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip";
|
|
7
6
|
import { useTheme } from "./ThemeProvider";
|
|
8
|
-
import { createClientOnlyComponent } from "../../hooks";
|
|
7
|
+
import { createClientOnlyComponent, useDocument, cn } from "../../hooks";
|
|
8
|
+
|
|
9
|
+
type LiquidToggleProps = Omit<ComponentProps<typeof Button>, "onClick" | "children">;
|
|
9
10
|
|
|
10
|
-
const LiquidToggleButton: React.FC = () => {
|
|
11
|
+
const LiquidToggleButton: React.FC<LiquidToggleProps> = (props) => {
|
|
11
12
|
const { theme, setTheme, storageKey } = useTheme();
|
|
13
|
+
const document = useDocument();
|
|
12
14
|
|
|
13
15
|
const handleLiquidToggle = () => {
|
|
14
16
|
let newTheme: string;
|
|
@@ -27,7 +29,9 @@ const LiquidToggleButton: React.FC = () => {
|
|
|
27
29
|
// Default fallback
|
|
28
30
|
newTheme = "liquid-light";
|
|
29
31
|
}
|
|
30
|
-
document
|
|
32
|
+
if (document) {
|
|
33
|
+
document.cookie = `${storageKey}=${newTheme}`;
|
|
34
|
+
}
|
|
31
35
|
setTheme(newTheme);
|
|
32
36
|
};
|
|
33
37
|
|
|
@@ -39,11 +43,12 @@ const LiquidToggleButton: React.FC = () => {
|
|
|
39
43
|
<TooltipTrigger asChild>
|
|
40
44
|
<Button
|
|
41
45
|
icon
|
|
42
|
-
onClick={handleLiquidToggle}
|
|
43
46
|
variant="ghost"
|
|
44
47
|
value={isLiquid}
|
|
45
48
|
aria-label={`Toggle liquid theme: ${isSystem ? "disabled (system mode)" : isLiquid ? "on" : "off"}`}
|
|
46
|
-
|
|
49
|
+
{...props}
|
|
50
|
+
onClick={handleLiquidToggle}
|
|
51
|
+
className={cn(props.className, isSystem && "cursor-not-allowed opacity-50")}
|
|
47
52
|
disabled={isSystem}
|
|
48
53
|
>
|
|
49
54
|
<Droplet size={20} />
|
|
@@ -54,8 +59,11 @@ const LiquidToggleButton: React.FC = () => {
|
|
|
54
59
|
);
|
|
55
60
|
};
|
|
56
61
|
// Theme toggle component for light/dark
|
|
57
|
-
|
|
62
|
+
type ThemeToggleProps = Omit<ComponentProps<typeof Button>, "onClick" | "children">;
|
|
63
|
+
|
|
64
|
+
const ThemeToggleButton: React.FC<ThemeToggleProps> = (props) => {
|
|
58
65
|
const { theme, setTheme, storageKey } = useTheme();
|
|
66
|
+
const document = useDocument();
|
|
59
67
|
|
|
60
68
|
const handleThemeChange = () => {
|
|
61
69
|
let newTheme: string;
|
|
@@ -73,7 +81,9 @@ const ThemeToggleButton: React.FC = () => {
|
|
|
73
81
|
// Default fallback
|
|
74
82
|
newTheme = "light";
|
|
75
83
|
}
|
|
76
|
-
document
|
|
84
|
+
if (document) {
|
|
85
|
+
document.cookie = `${storageKey}=${newTheme}`;
|
|
86
|
+
}
|
|
77
87
|
setTheme(newTheme);
|
|
78
88
|
};
|
|
79
89
|
|
|
@@ -83,23 +93,24 @@ const ThemeToggleButton: React.FC = () => {
|
|
|
83
93
|
return (
|
|
84
94
|
<Button
|
|
85
95
|
icon
|
|
86
|
-
onClick={handleThemeChange}
|
|
87
96
|
variant="ghost"
|
|
88
97
|
aria-label={`Current theme: ${isSystem ? "system" : isDark ? "dark" : "light"}`}
|
|
98
|
+
{...props}
|
|
99
|
+
onClick={handleThemeChange}
|
|
89
100
|
>
|
|
90
101
|
{isSystem ? <SunMoon size={20} /> : isDark ? <Moon size={20} /> : <Sun size={20} />}
|
|
91
102
|
</Button>
|
|
92
103
|
);
|
|
93
104
|
};
|
|
94
105
|
// Create client-only versions to prevent hydration mismatch
|
|
95
|
-
export const LiquidToggle = createClientOnlyComponent(LiquidToggleButton, () => (
|
|
96
|
-
<Button icon variant="ghost" aria-label="Liquid toggle loading...">
|
|
106
|
+
export const LiquidToggle = createClientOnlyComponent(LiquidToggleButton, (props: LiquidToggleProps) => (
|
|
107
|
+
<Button icon variant="ghost" aria-label="Liquid toggle loading..." {...props}>
|
|
97
108
|
<Droplet size={20} />
|
|
98
109
|
</Button>
|
|
99
110
|
));
|
|
100
111
|
|
|
101
|
-
export const ThemeToggle = createClientOnlyComponent(ThemeToggleButton, () => (
|
|
102
|
-
<Button icon variant="ghost" aria-label="Theme toggle loading...">
|
|
112
|
+
export const ThemeToggle = createClientOnlyComponent(ThemeToggleButton, (props: ThemeToggleProps) => (
|
|
113
|
+
<Button icon variant="ghost" aria-label="Theme toggle loading..." {...props}>
|
|
103
114
|
<Sun size={20} />
|
|
104
115
|
</Button>
|
|
105
116
|
));
|