@vuer-ai/vuer-uikit 0.0.36 → 0.0.38
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-WTKYHPQL.js → chunk-4LJVGD5N.js} +1 -1
- package/dist/{chunk-EMHRYI5O.js → chunk-72PCXNEI.js} +4 -4
- package/dist/{chunk-3ZFILFNB.js → chunk-DCURVZQ2.js} +8 -20
- package/dist/{chunk-4QERYDMC.mjs → chunk-KQ6LMA4V.mjs} +7 -19
- package/dist/{chunk-YIBD2FEV.mjs → chunk-MS5G6UZ4.mjs} +4 -4
- package/dist/{chunk-4WJTS3OL.mjs → chunk-ZEK2T25J.mjs} +1 -1
- package/dist/index.js +7 -7
- package/dist/index.mjs +3 -3
- package/dist/ui/index.js +7 -7
- package/dist/ui/index.mjs +3 -3
- package/dist/ui/theme/ThemeProvider.js +4 -4
- package/dist/ui/theme/ThemeProvider.mjs +2 -2
- package/dist/ui/theme/index.js +5 -5
- package/dist/ui/theme/index.mjs +2 -2
- package/dist/ui/theme/themeScript.js +2 -2
- package/dist/ui/theme/themeScript.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/ThemeProvider.tsx +7 -18
- package/src/ui/theme/themeScript.tsx +6 -4
|
@@ -6,7 +6,6 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
// src/ui/theme/themeScript.tsx
|
|
7
7
|
var themeScript = (defaultTheme, storageKey, attribute, themes, value, forcedTheme, enableSystem, enableColorScheme) => {
|
|
8
8
|
const el = document.documentElement;
|
|
9
|
-
const systemThemes = ["light", "dark"];
|
|
10
9
|
function updateDOM(theme) {
|
|
11
10
|
const attributes = Array.isArray(attribute) ? attribute : [attribute];
|
|
12
11
|
attributes.forEach((attr) => {
|
|
@@ -22,12 +21,13 @@ var themeScript = (defaultTheme, storageKey, attribute, themes, value, forcedThe
|
|
|
22
21
|
setColorScheme(theme);
|
|
23
22
|
}
|
|
24
23
|
function setColorScheme(theme) {
|
|
25
|
-
if (enableColorScheme
|
|
26
|
-
|
|
24
|
+
if (enableColorScheme) {
|
|
25
|
+
const isDark = theme.includes("dark");
|
|
26
|
+
el.style.colorScheme = isDark ? "dark" : "light";
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
function getSystemTheme() {
|
|
30
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
30
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "liquid-dark" : "liquid-light";
|
|
31
31
|
}
|
|
32
32
|
if (forcedTheme) {
|
|
33
33
|
updateDOM(forcedTheme);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk72PCXNEI_js = require('./chunk-72PCXNEI.js');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
|
-
var colorSchemes = ["light", "dark"];
|
|
8
7
|
var MEDIA = "(prefers-color-scheme: dark)";
|
|
9
8
|
var isServer = typeof window === "undefined";
|
|
10
9
|
var ThemeContext = react.createContext(void 0);
|
|
@@ -24,13 +23,13 @@ var ThemeProvider = (props) => {
|
|
|
24
23
|
if (context) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.children });
|
|
25
24
|
return /* @__PURE__ */ jsxRuntime.jsx(Theme, { ...props });
|
|
26
25
|
};
|
|
27
|
-
var defaultThemes = ["light", "dark", "
|
|
26
|
+
var defaultThemes = ["light", "dark", "liquid-light", "liquid-dark"];
|
|
28
27
|
var Theme = ({
|
|
29
28
|
forcedTheme,
|
|
30
29
|
disableTransitionOnChange = false,
|
|
31
30
|
enableSystem = true,
|
|
32
31
|
enableColorScheme = false,
|
|
33
|
-
storageKey = "theme",
|
|
32
|
+
storageKey = "vuer-uikit-theme",
|
|
34
33
|
themes = defaultThemes,
|
|
35
34
|
defaultTheme = enableSystem ? "system" : "light",
|
|
36
35
|
attribute = "class",
|
|
@@ -69,20 +68,8 @@ var Theme = ({
|
|
|
69
68
|
if (Array.isArray(attribute)) attribute.forEach(handleAttribute);
|
|
70
69
|
else handleAttribute(attribute);
|
|
71
70
|
if (enableColorScheme) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(schema, currentValue) => {
|
|
75
|
-
if (defaultTheme.includes(currentValue)) {
|
|
76
|
-
fallback = currentValue;
|
|
77
|
-
}
|
|
78
|
-
if (resolved.includes(currentValue)) {
|
|
79
|
-
return currentValue;
|
|
80
|
-
}
|
|
81
|
-
return schema;
|
|
82
|
-
},
|
|
83
|
-
void 0
|
|
84
|
-
);
|
|
85
|
-
d.style.colorScheme = c ?? fallback;
|
|
71
|
+
const isDark = resolved.includes("dark");
|
|
72
|
+
d.style.colorScheme = isDark ? "dark" : "light";
|
|
86
73
|
}
|
|
87
74
|
enable == null ? void 0 : enable();
|
|
88
75
|
},
|
|
@@ -161,7 +148,7 @@ var Theme = ({
|
|
|
161
148
|
),
|
|
162
149
|
children: [
|
|
163
150
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
164
|
-
|
|
151
|
+
chunk72PCXNEI_js.ThemeScript,
|
|
165
152
|
{
|
|
166
153
|
...{
|
|
167
154
|
forcedTheme,
|
|
@@ -208,9 +195,10 @@ var disableAnimation = (nonce) => {
|
|
|
208
195
|
};
|
|
209
196
|
};
|
|
210
197
|
var getSystemTheme = (e) => {
|
|
198
|
+
if (isServer) return "liquid-light";
|
|
211
199
|
if (!e) e = window.matchMedia(MEDIA);
|
|
212
200
|
const isDark = e.matches;
|
|
213
|
-
return isDark ? "dark" : "light";
|
|
201
|
+
return isDark ? "liquid-dark" : "liquid-light";
|
|
214
202
|
};
|
|
215
203
|
|
|
216
204
|
exports.ThemeProvider = ThemeProvider;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ThemeScript } from './chunk-
|
|
1
|
+
import { ThemeScript } from './chunk-MS5G6UZ4.mjs';
|
|
2
2
|
import { createContext, useContext, useState, useCallback, useEffect, useMemo } from 'react';
|
|
3
3
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
var colorSchemes = ["light", "dark"];
|
|
6
5
|
var MEDIA = "(prefers-color-scheme: dark)";
|
|
7
6
|
var isServer = typeof window === "undefined";
|
|
8
7
|
var ThemeContext = createContext(void 0);
|
|
@@ -22,13 +21,13 @@ var ThemeProvider = (props) => {
|
|
|
22
21
|
if (context) return /* @__PURE__ */ jsx(Fragment, { children: props.children });
|
|
23
22
|
return /* @__PURE__ */ jsx(Theme, { ...props });
|
|
24
23
|
};
|
|
25
|
-
var defaultThemes = ["light", "dark", "
|
|
24
|
+
var defaultThemes = ["light", "dark", "liquid-light", "liquid-dark"];
|
|
26
25
|
var Theme = ({
|
|
27
26
|
forcedTheme,
|
|
28
27
|
disableTransitionOnChange = false,
|
|
29
28
|
enableSystem = true,
|
|
30
29
|
enableColorScheme = false,
|
|
31
|
-
storageKey = "theme",
|
|
30
|
+
storageKey = "vuer-uikit-theme",
|
|
32
31
|
themes = defaultThemes,
|
|
33
32
|
defaultTheme = enableSystem ? "system" : "light",
|
|
34
33
|
attribute = "class",
|
|
@@ -67,20 +66,8 @@ var Theme = ({
|
|
|
67
66
|
if (Array.isArray(attribute)) attribute.forEach(handleAttribute);
|
|
68
67
|
else handleAttribute(attribute);
|
|
69
68
|
if (enableColorScheme) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(schema, currentValue) => {
|
|
73
|
-
if (defaultTheme.includes(currentValue)) {
|
|
74
|
-
fallback = currentValue;
|
|
75
|
-
}
|
|
76
|
-
if (resolved.includes(currentValue)) {
|
|
77
|
-
return currentValue;
|
|
78
|
-
}
|
|
79
|
-
return schema;
|
|
80
|
-
},
|
|
81
|
-
void 0
|
|
82
|
-
);
|
|
83
|
-
d.style.colorScheme = c ?? fallback;
|
|
69
|
+
const isDark = resolved.includes("dark");
|
|
70
|
+
d.style.colorScheme = isDark ? "dark" : "light";
|
|
84
71
|
}
|
|
85
72
|
enable == null ? void 0 : enable();
|
|
86
73
|
},
|
|
@@ -206,9 +193,10 @@ var disableAnimation = (nonce) => {
|
|
|
206
193
|
};
|
|
207
194
|
};
|
|
208
195
|
var getSystemTheme = (e) => {
|
|
196
|
+
if (isServer) return "liquid-light";
|
|
209
197
|
if (!e) e = window.matchMedia(MEDIA);
|
|
210
198
|
const isDark = e.matches;
|
|
211
|
-
return isDark ? "dark" : "light";
|
|
199
|
+
return isDark ? "liquid-dark" : "liquid-light";
|
|
212
200
|
};
|
|
213
201
|
|
|
214
202
|
export { ThemeProvider, useTheme };
|
|
@@ -4,7 +4,6 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
// src/ui/theme/themeScript.tsx
|
|
5
5
|
var themeScript = (defaultTheme, storageKey, attribute, themes, value, forcedTheme, enableSystem, enableColorScheme) => {
|
|
6
6
|
const el = document.documentElement;
|
|
7
|
-
const systemThemes = ["light", "dark"];
|
|
8
7
|
function updateDOM(theme) {
|
|
9
8
|
const attributes = Array.isArray(attribute) ? attribute : [attribute];
|
|
10
9
|
attributes.forEach((attr) => {
|
|
@@ -20,12 +19,13 @@ var themeScript = (defaultTheme, storageKey, attribute, themes, value, forcedThe
|
|
|
20
19
|
setColorScheme(theme);
|
|
21
20
|
}
|
|
22
21
|
function setColorScheme(theme) {
|
|
23
|
-
if (enableColorScheme
|
|
24
|
-
|
|
22
|
+
if (enableColorScheme) {
|
|
23
|
+
const isDark = theme.includes("dark");
|
|
24
|
+
el.style.colorScheme = isDark ? "dark" : "light";
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
function getSystemTheme() {
|
|
28
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
28
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "liquid-dark" : "liquid-light";
|
|
29
29
|
}
|
|
30
30
|
if (forcedTheme) {
|
|
31
31
|
updateDOM(forcedTheme);
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ var chunkQJR6MCTR_js = require('./chunk-QJR6MCTR.js');
|
|
|
6
6
|
var chunkFSFUZ7Y6_js = require('./chunk-FSFUZ7Y6.js');
|
|
7
7
|
var chunkEAN5SZYQ_js = require('./chunk-EAN5SZYQ.js');
|
|
8
8
|
var chunkR3SHGA4V_js = require('./chunk-R3SHGA4V.js');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var chunk4LJVGD5N_js = require('./chunk-4LJVGD5N.js');
|
|
10
|
+
var chunkDCURVZQ2_js = require('./chunk-DCURVZQ2.js');
|
|
11
|
+
var chunk72PCXNEI_js = require('./chunk-72PCXNEI.js');
|
|
12
12
|
var chunkBXYVNNXU_js = require('./chunk-BXYVNNXU.js');
|
|
13
13
|
var chunkGFPXAGJY_js = require('./chunk-GFPXAGJY.js');
|
|
14
14
|
var chunkJ2ZRCEKZ_js = require('./chunk-J2ZRCEKZ.js');
|
|
@@ -77,19 +77,19 @@ Object.defineProperty(exports, "TreeView", {
|
|
|
77
77
|
});
|
|
78
78
|
Object.defineProperty(exports, "VersionBadge", {
|
|
79
79
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunk4LJVGD5N_js.VersionBadge; }
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
83
83
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkDCURVZQ2_js.ThemeProvider; }
|
|
85
85
|
});
|
|
86
86
|
Object.defineProperty(exports, "useTheme", {
|
|
87
87
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkDCURVZQ2_js.useTheme; }
|
|
89
89
|
});
|
|
90
90
|
Object.defineProperty(exports, "ThemeScript", {
|
|
91
91
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
92
|
+
get: function () { return chunk72PCXNEI_js.ThemeScript; }
|
|
93
93
|
});
|
|
94
94
|
Object.defineProperty(exports, "RadioGroup", {
|
|
95
95
|
enumerable: true,
|
package/dist/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ export { Toaster, toast } from './chunk-EAZQH4IX.mjs';
|
|
|
4
4
|
export { ToggleGroup, ToggleGroupItem } from './chunk-G6CSH3FC.mjs';
|
|
5
5
|
export { Toggle, toggleVariants } from './chunk-K6R7H7R2.mjs';
|
|
6
6
|
export { TreeView } from './chunk-NKNUMZJL.mjs';
|
|
7
|
-
export { VersionBadge } from './chunk-
|
|
8
|
-
export { ThemeProvider, useTheme } from './chunk-
|
|
9
|
-
export { ThemeScript } from './chunk-
|
|
7
|
+
export { VersionBadge } from './chunk-ZEK2T25J.mjs';
|
|
8
|
+
export { ThemeProvider, useTheme } from './chunk-KQ6LMA4V.mjs';
|
|
9
|
+
export { ThemeScript } from './chunk-MS5G6UZ4.mjs';
|
|
10
10
|
export { RadioGroup, RadioGroupItem } from './chunk-EL4FTB5J.mjs';
|
|
11
11
|
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from './chunk-KAUA4ODT.mjs';
|
|
12
12
|
export { Slider } from './chunk-47WYS4WO.mjs';
|
package/dist/ui/index.js
CHANGED
|
@@ -6,9 +6,9 @@ var chunkQJR6MCTR_js = require('../chunk-QJR6MCTR.js');
|
|
|
6
6
|
var chunkFSFUZ7Y6_js = require('../chunk-FSFUZ7Y6.js');
|
|
7
7
|
var chunkEAN5SZYQ_js = require('../chunk-EAN5SZYQ.js');
|
|
8
8
|
var chunkR3SHGA4V_js = require('../chunk-R3SHGA4V.js');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var chunk4LJVGD5N_js = require('../chunk-4LJVGD5N.js');
|
|
10
|
+
var chunkDCURVZQ2_js = require('../chunk-DCURVZQ2.js');
|
|
11
|
+
var chunk72PCXNEI_js = require('../chunk-72PCXNEI.js');
|
|
12
12
|
var chunkBXYVNNXU_js = require('../chunk-BXYVNNXU.js');
|
|
13
13
|
var chunkGFPXAGJY_js = require('../chunk-GFPXAGJY.js');
|
|
14
14
|
var chunkJ2ZRCEKZ_js = require('../chunk-J2ZRCEKZ.js');
|
|
@@ -72,19 +72,19 @@ Object.defineProperty(exports, "TreeView", {
|
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "VersionBadge", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunk4LJVGD5N_js.VersionBadge; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkDCURVZQ2_js.ThemeProvider; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "useTheme", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkDCURVZQ2_js.useTheme; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "ThemeScript", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunk72PCXNEI_js.ThemeScript; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "RadioGroup", {
|
|
90
90
|
enumerable: true,
|
package/dist/ui/index.mjs
CHANGED
|
@@ -4,9 +4,9 @@ export { Toaster, toast } from '../chunk-EAZQH4IX.mjs';
|
|
|
4
4
|
export { ToggleGroup, ToggleGroupItem } from '../chunk-G6CSH3FC.mjs';
|
|
5
5
|
export { Toggle, toggleVariants } from '../chunk-K6R7H7R2.mjs';
|
|
6
6
|
export { TreeView } from '../chunk-NKNUMZJL.mjs';
|
|
7
|
-
export { VersionBadge } from '../chunk-
|
|
8
|
-
export { ThemeProvider, useTheme } from '../chunk-
|
|
9
|
-
export { ThemeScript } from '../chunk-
|
|
7
|
+
export { VersionBadge } from '../chunk-ZEK2T25J.mjs';
|
|
8
|
+
export { ThemeProvider, useTheme } from '../chunk-KQ6LMA4V.mjs';
|
|
9
|
+
export { ThemeScript } from '../chunk-MS5G6UZ4.mjs';
|
|
10
10
|
export { RadioGroup, RadioGroupItem } from '../chunk-EL4FTB5J.mjs';
|
|
11
11
|
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from '../chunk-KAUA4ODT.mjs';
|
|
12
12
|
export { Slider } from '../chunk-47WYS4WO.mjs';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var chunkDCURVZQ2_js = require('../../chunk-DCURVZQ2.js');
|
|
4
|
+
require('../../chunk-72PCXNEI.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkDCURVZQ2_js.ThemeProvider; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useTheme", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkDCURVZQ2_js.useTheme; }
|
|
15
15
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ThemeProvider, useTheme } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { ThemeProvider, useTheme } from '../../chunk-KQ6LMA4V.mjs';
|
|
2
|
+
import '../../chunk-MS5G6UZ4.mjs';
|
package/dist/ui/theme/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('../../chunk-Y2QBWXB4.js');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkDCURVZQ2_js = require('../../chunk-DCURVZQ2.js');
|
|
5
|
+
var chunk72PCXNEI_js = require('../../chunk-72PCXNEI.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "ThemeProvider", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkDCURVZQ2_js.ThemeProvider; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "useTheme", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkDCURVZQ2_js.useTheme; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ThemeScript", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk72PCXNEI_js.ThemeScript; }
|
|
20
20
|
});
|
package/dist/ui/theme/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../chunk-AMB2H6WS.mjs';
|
|
2
|
-
export { ThemeProvider, useTheme } from '../../chunk-
|
|
3
|
-
export { ThemeScript } from '../../chunk-
|
|
2
|
+
export { ThemeProvider, useTheme } from '../../chunk-KQ6LMA4V.mjs';
|
|
3
|
+
export { ThemeScript } from '../../chunk-MS5G6UZ4.mjs';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk72PCXNEI_js = require('../../chunk-72PCXNEI.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "ThemeScript", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk72PCXNEI_js.ThemeScript; }
|
|
10
10
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ThemeScript } from '../../chunk-
|
|
1
|
+
export { ThemeScript } from '../../chunk-MS5G6UZ4.mjs';
|
package/dist/ui/version-badge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4LJVGD5N_js = require('../chunk-4LJVGD5N.js');
|
|
4
4
|
require('../chunk-ILJK43VJ.js');
|
|
5
5
|
require('../chunk-T4N7UHZ7.js');
|
|
6
6
|
require('../chunk-QG7ZF6TO.js');
|
|
@@ -13,5 +13,5 @@ require('../chunk-7KYAICHB.js');
|
|
|
13
13
|
|
|
14
14
|
Object.defineProperty(exports, "VersionBadge", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunk4LJVGD5N_js.VersionBadge; }
|
|
17
17
|
});
|
package/package.json
CHANGED
|
@@ -49,7 +49,7 @@ const ThemeProvider = (props: PropsWithChildren<ThemeProviderProps>) => {
|
|
|
49
49
|
return <Theme {...props} />;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
const defaultThemes = ["light", "dark", "
|
|
52
|
+
const defaultThemes = ["light", "dark", "liquid-light", "liquid-dark"];
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Internal component implementing theme persistence, system preference,
|
|
@@ -60,7 +60,7 @@ const Theme = ({
|
|
|
60
60
|
disableTransitionOnChange = false,
|
|
61
61
|
enableSystem = true,
|
|
62
62
|
enableColorScheme = false,
|
|
63
|
-
storageKey = "theme",
|
|
63
|
+
storageKey = "vuer-uikit-theme",
|
|
64
64
|
themes = defaultThemes,
|
|
65
65
|
defaultTheme = enableSystem ? "system" : "light",
|
|
66
66
|
attribute = "class",
|
|
@@ -106,21 +106,9 @@ const Theme = ({
|
|
|
106
106
|
else handleAttribute(attribute);
|
|
107
107
|
|
|
108
108
|
if (enableColorScheme) {
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
if (defaultTheme.includes(currentValue)) {
|
|
113
|
-
fallback = currentValue;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (resolved.includes(currentValue)) {
|
|
117
|
-
return currentValue;
|
|
118
|
-
}
|
|
119
|
-
return schema;
|
|
120
|
-
},
|
|
121
|
-
undefined,
|
|
122
|
-
);
|
|
123
|
-
d.style.colorScheme = c ?? fallback;
|
|
109
|
+
// Extract base color scheme from theme name
|
|
110
|
+
const isDark = resolved.includes("dark");
|
|
111
|
+
d.style.colorScheme = isDark ? "dark" : "light";
|
|
124
112
|
}
|
|
125
113
|
|
|
126
114
|
enable?.();
|
|
@@ -270,9 +258,10 @@ const disableAnimation = (nonce?: string) => {
|
|
|
270
258
|
};
|
|
271
259
|
|
|
272
260
|
const getSystemTheme = (e?: MediaQueryList | MediaQueryListEvent) => {
|
|
261
|
+
if (isServer) return "liquid-light";
|
|
273
262
|
if (!e) e = window.matchMedia(MEDIA);
|
|
274
263
|
const isDark = e.matches;
|
|
275
|
-
return isDark ? "dark" : "light";
|
|
264
|
+
return isDark ? "liquid-dark" : "liquid-light";
|
|
276
265
|
};
|
|
277
266
|
|
|
278
267
|
export { useTheme, ThemeProvider };
|
|
@@ -13,7 +13,7 @@ const themeScript = (
|
|
|
13
13
|
enableColorScheme?: boolean | undefined,
|
|
14
14
|
) => {
|
|
15
15
|
const el = document.documentElement;
|
|
16
|
-
const systemThemes = ["light", "dark"];
|
|
16
|
+
const systemThemes = ["light", "dark", "liquid-light", "liquid-dark"];
|
|
17
17
|
|
|
18
18
|
function updateDOM(theme: string) {
|
|
19
19
|
const attributes = Array.isArray(attribute) ? attribute : [attribute];
|
|
@@ -33,13 +33,15 @@ const themeScript = (
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function setColorScheme(theme: string) {
|
|
36
|
-
if (enableColorScheme
|
|
37
|
-
|
|
36
|
+
if (enableColorScheme) {
|
|
37
|
+
// Extract base color scheme from theme name
|
|
38
|
+
const isDark = theme.includes("dark");
|
|
39
|
+
el.style.colorScheme = isDark ? "dark" : "light";
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
function getSystemTheme() {
|
|
42
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
44
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "liquid-dark" : "liquid-light";
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
if (forcedTheme) {
|