@gospore/theme 1.0.126 → 1.0.128
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/Theme.vue.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/portalHost.d.ts +2 -0
- package/dist/theme.cjs.js +1 -1
- package/dist/theme.cjs.js.map +1 -1
- package/dist/theme.css +1 -1
- package/dist/theme.es.js +188 -157
- package/dist/theme.es.js.map +1 -1
- package/dist/theme.umd.js +1 -1
- package/dist/theme.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/theme.es.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject as he, computed as j, ref as N, watch as A, onBeforeUnmount as pe, provide as J, createElementBlock as be, openBlock as Z, normalizeStyle as ge, renderSlot as ke, createElementVNode as ee, createBlock as Me, unref as g, withCtx as X, createVNode as U } from "vue";
|
|
2
2
|
import "what-input";
|
|
3
|
-
import { DropdownMenu as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
3
|
+
import { DropdownMenu as ve, DropdownItemGroup as ye, DropdownItemRadio as K } from "@gospore/dropdown-menu";
|
|
4
|
+
const B = ["auto", "light", "dark"], te = "gospore-theme-mode", Ee = 60 * 60 * 24 * 365, Se = "(prefers-color-scheme: dark)";
|
|
5
|
+
function V() {
|
|
6
6
|
if (typeof document > "u")
|
|
7
7
|
return null;
|
|
8
|
-
const n =
|
|
9
|
-
return n &&
|
|
8
|
+
const n = Oe(te);
|
|
9
|
+
return n && B.includes(n) ? n : null;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
if (typeof document > "u" || !
|
|
11
|
+
function we(n) {
|
|
12
|
+
if (typeof document > "u" || !B.includes(n))
|
|
13
13
|
return;
|
|
14
|
-
const
|
|
14
|
+
const a = typeof window < "u" ? window.location.hostname : "", s = typeof window < "u" ? window.location.protocol : "", c = _e(a), p = s === "https:", k = [
|
|
15
15
|
"path=/",
|
|
16
|
-
`max-age=${
|
|
16
|
+
`max-age=${Ee}`,
|
|
17
17
|
"SameSite=Lax"
|
|
18
18
|
];
|
|
19
|
-
|
|
20
|
-
`${encodeURIComponent(
|
|
19
|
+
c && k.push(`domain=${c}`), p && k.push("Secure"), document.cookie = [
|
|
20
|
+
`${encodeURIComponent(te)}=${encodeURIComponent(n)}`,
|
|
21
21
|
...k
|
|
22
22
|
].join("; ");
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ne(n) {
|
|
25
25
|
if (typeof document > "u")
|
|
26
26
|
return;
|
|
27
|
-
const
|
|
28
|
-
console.log("Applying theme mode:",
|
|
29
|
-
const s =
|
|
27
|
+
const a = typeof n == "string" && B.includes(n) ? n : V() ?? "auto";
|
|
28
|
+
console.log("Applying theme mode:", a);
|
|
29
|
+
const s = Re(a);
|
|
30
30
|
document.documentElement.setAttribute("dark-mode", s);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Oe(n) {
|
|
33
33
|
if (typeof document > "u" || !document.cookie)
|
|
34
34
|
return null;
|
|
35
|
-
const
|
|
36
|
-
for (const
|
|
37
|
-
if (
|
|
38
|
-
return decodeURIComponent(
|
|
35
|
+
const a = `${encodeURIComponent(n)}=`, s = document.cookie.split("; ");
|
|
36
|
+
for (const c of s)
|
|
37
|
+
if (c.startsWith(a))
|
|
38
|
+
return decodeURIComponent(c.slice(a.length));
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function _e(n) {
|
|
42
42
|
if (!n || n === "localhost")
|
|
43
43
|
return null;
|
|
44
44
|
if (/^\d+(?:\.\d+){3}$/.test(n))
|
|
@@ -46,19 +46,26 @@ function Se(n) {
|
|
|
46
46
|
const s = n.split(".");
|
|
47
47
|
return s.length <= 1 ? null : s.length === 2 ? n : s.slice(-2).join(".");
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function Re(n) {
|
|
50
50
|
if (n === "dark")
|
|
51
51
|
return !0;
|
|
52
52
|
if (n === "light" || typeof window > "u")
|
|
53
53
|
return !1;
|
|
54
54
|
try {
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
const a = typeof window.matchMedia == "function" ? window.matchMedia(Se) : null;
|
|
56
|
+
return a ? a.matches : !1;
|
|
57
57
|
} catch {
|
|
58
58
|
return !1;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const oe = Symbol.for("gospore.theme.portalHost");
|
|
62
|
+
function Ne() {
|
|
63
|
+
const n = he(oe, null);
|
|
64
|
+
console.log("Using theme portal host:", n);
|
|
65
|
+
const a = typeof document < "u" ? document.body : "body";
|
|
66
|
+
return j(() => n?.value ?? a);
|
|
67
|
+
}
|
|
68
|
+
const Te = "(prefers-color-scheme: dark)", De = "(prefers-reduced-motion: reduce)", Ce = 200, Ue = /* @__PURE__ */ Object.assign({
|
|
62
69
|
name: "Theme"
|
|
63
70
|
}, {
|
|
64
71
|
__name: "Theme",
|
|
@@ -76,66 +83,76 @@ const Oe = "(prefers-color-scheme: dark)", Re = "(prefers-reduced-motion: reduce
|
|
|
76
83
|
type: String,
|
|
77
84
|
required: !1,
|
|
78
85
|
default: void 0
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* When true the brand vars are also exposed on <html>, allowing portals
|
|
89
|
+
* attached outside the Theme subtree to inherit the accent colors.
|
|
90
|
+
*/
|
|
91
|
+
exposeGlobalAccent: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: !1
|
|
79
94
|
}
|
|
80
95
|
},
|
|
81
96
|
setup(n) {
|
|
82
|
-
const
|
|
83
|
-
function
|
|
97
|
+
const a = n, s = [], c = /* @__PURE__ */ new Set();
|
|
98
|
+
function p() {
|
|
84
99
|
const e = document.documentElement;
|
|
85
100
|
if (!e)
|
|
86
101
|
return;
|
|
87
|
-
|
|
102
|
+
c.forEach((r) => {
|
|
88
103
|
e.style.removeProperty(r);
|
|
89
|
-
}),
|
|
90
|
-
const t = [...s].reverse().find(
|
|
104
|
+
}), c.clear();
|
|
105
|
+
const t = [...s].reverse().find(
|
|
106
|
+
(r) => r.enabled && r.vars && Object.keys(r.vars).length > 0
|
|
107
|
+
);
|
|
91
108
|
t && Object.entries(t.vars).forEach(([r, o]) => {
|
|
92
|
-
e.style.setProperty(r, o),
|
|
109
|
+
e.style.setProperty(r, o), c.add(r);
|
|
93
110
|
});
|
|
94
111
|
}
|
|
95
|
-
const k = window.matchMedia(
|
|
96
|
-
|
|
97
|
-
),
|
|
98
|
-
|
|
99
|
-
const I =
|
|
100
|
-
darkMode:
|
|
101
|
-
});
|
|
102
|
-
k.addEventListener("change",
|
|
103
|
-
() =>
|
|
112
|
+
const k = window.matchMedia(Te), P = window.matchMedia(
|
|
113
|
+
De
|
|
114
|
+
), T = q();
|
|
115
|
+
ne(T);
|
|
116
|
+
const I = N(T), l = N({
|
|
117
|
+
darkMode: M(T)
|
|
118
|
+
}), f = N(null);
|
|
119
|
+
k.addEventListener("change", Y), A(
|
|
120
|
+
() => a.mode,
|
|
104
121
|
() => {
|
|
105
|
-
|
|
122
|
+
d();
|
|
106
123
|
},
|
|
107
124
|
{ immediate: !0 }
|
|
108
|
-
),
|
|
109
|
-
() =>
|
|
125
|
+
), A(
|
|
126
|
+
() => l.value.darkMode,
|
|
110
127
|
(e, t) => {
|
|
111
128
|
if (t === void 0) {
|
|
112
|
-
|
|
129
|
+
Q(e);
|
|
113
130
|
return;
|
|
114
131
|
}
|
|
115
|
-
|
|
116
|
-
|
|
132
|
+
re(() => {
|
|
133
|
+
Q(e);
|
|
117
134
|
});
|
|
118
135
|
},
|
|
119
136
|
{ immediate: !0 }
|
|
120
|
-
),
|
|
121
|
-
k.removeEventListener("change",
|
|
122
|
-
const e = s.indexOf(
|
|
123
|
-
e !== -1 && s.splice(e, 1),
|
|
137
|
+
), pe(() => {
|
|
138
|
+
k.removeEventListener("change", Y);
|
|
139
|
+
const e = s.indexOf($);
|
|
140
|
+
e !== -1 && s.splice(e, 1), p();
|
|
124
141
|
});
|
|
125
|
-
function
|
|
126
|
-
const e =
|
|
127
|
-
I.value = e,
|
|
142
|
+
function d() {
|
|
143
|
+
const e = q();
|
|
144
|
+
I.value = e, l.value.darkMode = M(e);
|
|
128
145
|
}
|
|
129
|
-
function
|
|
146
|
+
function M(e) {
|
|
130
147
|
return e === "dark" ? !0 : e === "light" ? !1 : k.matches;
|
|
131
148
|
}
|
|
132
|
-
function
|
|
133
|
-
!e || I.value !== "auto" || (
|
|
149
|
+
function Y(e) {
|
|
150
|
+
!e || I.value !== "auto" || (l.value.darkMode = e.matches);
|
|
134
151
|
}
|
|
135
|
-
function
|
|
152
|
+
function Q(e) {
|
|
136
153
|
document.documentElement.setAttribute("dark-mode", e);
|
|
137
154
|
}
|
|
138
|
-
function
|
|
155
|
+
function re(e) {
|
|
139
156
|
if (P.matches) {
|
|
140
157
|
e();
|
|
141
158
|
return;
|
|
@@ -151,83 +168,83 @@ const Oe = "(prefers-color-scheme: dark)", Re = "(prefers-reduced-motion: reduce
|
|
|
151
168
|
const r = document.documentElement;
|
|
152
169
|
typeof r.animate == "function" && window.requestAnimationFrame(() => {
|
|
153
170
|
r.animate([{ opacity: 0.85 }, { opacity: 1 }], {
|
|
154
|
-
duration:
|
|
171
|
+
duration: Ce,
|
|
155
172
|
easing: "ease-in-out"
|
|
156
173
|
});
|
|
157
174
|
});
|
|
158
175
|
}
|
|
159
|
-
function
|
|
160
|
-
return
|
|
176
|
+
function q() {
|
|
177
|
+
return a.mode ?? V() ?? "auto";
|
|
161
178
|
}
|
|
162
|
-
|
|
163
|
-
function
|
|
179
|
+
J("theme", l), J(oe, f);
|
|
180
|
+
function z(e) {
|
|
164
181
|
if (!e) return null;
|
|
165
182
|
const t = e.trim().toLowerCase();
|
|
166
183
|
if (!/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t)) return null;
|
|
167
184
|
if (t.length === 4) {
|
|
168
|
-
const o = t[1],
|
|
169
|
-
return `#${o}${o}${
|
|
185
|
+
const o = t[1], i = t[2], m = t[3];
|
|
186
|
+
return `#${o}${o}${i}${i}${m}${m}`;
|
|
170
187
|
}
|
|
171
188
|
return t;
|
|
172
189
|
}
|
|
173
|
-
function
|
|
174
|
-
const t =
|
|
190
|
+
function ae(e) {
|
|
191
|
+
const t = z(e);
|
|
175
192
|
if (!t) return null;
|
|
176
|
-
const r = parseInt(t.slice(1, 3), 16), o = parseInt(t.slice(3, 5), 16),
|
|
177
|
-
return { r, g: o, b:
|
|
193
|
+
const r = parseInt(t.slice(1, 3), 16), o = parseInt(t.slice(3, 5), 16), i = parseInt(t.slice(5, 7), 16);
|
|
194
|
+
return { r, g: o, b: i };
|
|
178
195
|
}
|
|
179
|
-
function
|
|
180
|
-
const o = (
|
|
196
|
+
function ce({ r: e, g: t, b: r }) {
|
|
197
|
+
const o = (i) => i.toString(16).padStart(2, "0");
|
|
181
198
|
return `#${o(e)}${o(t)}${o(r)}`;
|
|
182
199
|
}
|
|
183
200
|
function h(e) {
|
|
184
201
|
return Math.max(0, Math.min(1, e));
|
|
185
202
|
}
|
|
186
|
-
function
|
|
203
|
+
function H(e) {
|
|
187
204
|
return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
|
|
188
205
|
}
|
|
189
|
-
function
|
|
206
|
+
function G(e) {
|
|
190
207
|
const t = h(e);
|
|
191
208
|
return t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055;
|
|
192
209
|
}
|
|
193
|
-
function
|
|
194
|
-
const o = e / 255,
|
|
195
|
-
let
|
|
196
|
-
return
|
|
210
|
+
function se({ r: e, g: t, b: r }) {
|
|
211
|
+
const o = e / 255, i = t / 255, m = r / 255, E = H(o), R = H(i), u = H(m), v = 0.4122214708 * E + 0.5363325363 * R + 0.0514459929 * u, y = 0.2119034982 * E + 0.6806995451 * R + 0.1073969566 * u, S = 0.0883024619 * E + 0.2817188376 * R + 0.6299787005 * u, b = Math.cbrt(v), w = Math.cbrt(y), D = Math.cbrt(S), L = 0.2104542553 * b + 0.793617785 * w - 0.0040720468 * D, O = 1.9779984951 * b - 2.428592205 * w + 0.4505937099 * D, _ = 0.0259040371 * b + 0.7827717662 * w - 0.808675766 * D, C = Math.sqrt(O * O + _ * _);
|
|
212
|
+
let x = Math.atan2(_, O) * (180 / Math.PI);
|
|
213
|
+
return x < 0 && (x += 360), { l: L, c: C, h: x };
|
|
197
214
|
}
|
|
198
|
-
function
|
|
199
|
-
const
|
|
200
|
-
if (!o && (
|
|
215
|
+
function F(e, t, r, o = !1) {
|
|
216
|
+
const i = r * Math.PI / 180, m = t * Math.cos(i), E = t * Math.sin(i), R = e + 0.3963377774 * m + 0.2158037573 * E, u = e - 0.1055613458 * m - 0.0638541728 * E, v = e - 0.0894841775 * m - 1.291485548 * E, y = o ? h(R) : R, S = o ? h(u) : u, b = o ? h(v) : v;
|
|
217
|
+
if (!o && (y < -1e-4 || y > 1.0001 || S < -1e-4 || S > 1.0001 || b < -1e-4 || b > 1.0001))
|
|
201
218
|
return null;
|
|
202
|
-
const
|
|
203
|
-
let O = 4.0767416621 *
|
|
219
|
+
const w = y * y * y, D = S * S * S, L = b * b * b;
|
|
220
|
+
let O = 4.0767416621 * w - 3.3077115913 * D + 0.2309699292 * L, _ = -1.2684380046 * w + 2.6097574011 * D - 0.3413193965 * L, C = -0.0041960863 * w - 0.7034186147 * D + 1.707614701 * L;
|
|
204
221
|
if (o)
|
|
205
|
-
O = h(O),
|
|
206
|
-
else if (O < -1e-4 || O > 1.0001 ||
|
|
222
|
+
O = h(O), _ = h(_), C = h(C);
|
|
223
|
+
else if (O < -1e-4 || O > 1.0001 || _ < -1e-4 || _ > 1.0001 || C < -1e-4 || C > 1.0001)
|
|
207
224
|
return null;
|
|
208
|
-
const
|
|
225
|
+
const x = h(G(O)), de = h(G(_)), me = h(G(C));
|
|
209
226
|
return {
|
|
210
|
-
r: Math.round(
|
|
211
|
-
g: Math.round(
|
|
212
|
-
b: Math.round(
|
|
227
|
+
r: Math.round(x * 255),
|
|
228
|
+
g: Math.round(de * 255),
|
|
229
|
+
b: Math.round(me * 255)
|
|
213
230
|
};
|
|
214
231
|
}
|
|
215
|
-
function
|
|
232
|
+
function le(e, t, r) {
|
|
216
233
|
let o = t;
|
|
217
|
-
for (let
|
|
218
|
-
const m =
|
|
234
|
+
for (let i = 0; i < 8; i += 1) {
|
|
235
|
+
const m = F(e, o, r);
|
|
219
236
|
if (m)
|
|
220
237
|
return m;
|
|
221
238
|
o *= 0.9;
|
|
222
239
|
}
|
|
223
|
-
return
|
|
240
|
+
return F(e, h(o), r, !0) || { r: 0, g: 0, b: 0 };
|
|
224
241
|
}
|
|
225
|
-
function
|
|
226
|
-
const t =
|
|
242
|
+
function ie(e) {
|
|
243
|
+
const t = z(e);
|
|
227
244
|
if (!t) return null;
|
|
228
|
-
const r =
|
|
245
|
+
const r = ae(t);
|
|
229
246
|
if (!r) return null;
|
|
230
|
-
const o =
|
|
247
|
+
const o = se(r), i = {
|
|
231
248
|
100: { lightness: 0.35, chroma: 0.45 },
|
|
232
249
|
200: { lightness: 0.28, chroma: 0.5 },
|
|
233
250
|
300: { lightness: 0.22, chroma: 0.6 },
|
|
@@ -238,44 +255,56 @@ const Oe = "(prefers-color-scheme: dark)", Re = "(prefers-reduced-motion: reduce
|
|
|
238
255
|
800: { lightness: -0.18, chroma: 1.1 },
|
|
239
256
|
900: { lightness: -0.28, chroma: 1.15 },
|
|
240
257
|
1e3: { lightness: -0.35, chroma: 1.2 }
|
|
241
|
-
}, m = {},
|
|
242
|
-
if (
|
|
258
|
+
}, m = {}, E = (u) => u === 0 ? o.l : u > 0 ? h(o.l + u * (1 - o.l)) : h(o.l * (1 + u)), R = (u) => {
|
|
259
|
+
if (u === 1)
|
|
243
260
|
return o.c;
|
|
244
|
-
const v = o.c *
|
|
261
|
+
const v = o.c * u;
|
|
245
262
|
return Math.max(0, Math.min(0.4, v));
|
|
246
263
|
};
|
|
247
|
-
return Object.entries(
|
|
248
|
-
const
|
|
264
|
+
return Object.entries(i).forEach(([u, v]) => {
|
|
265
|
+
const y = `--color-brand-${u}`;
|
|
249
266
|
if (v.base) {
|
|
250
|
-
m[
|
|
267
|
+
m[y] = t;
|
|
251
268
|
return;
|
|
252
269
|
}
|
|
253
|
-
const S =
|
|
254
|
-
m[
|
|
270
|
+
const S = E(v.lightness), b = R(v.chroma), w = le(S, b, o.h);
|
|
271
|
+
m[y] = ce(w);
|
|
255
272
|
}), m;
|
|
256
273
|
}
|
|
257
|
-
const
|
|
258
|
-
vars: {}
|
|
274
|
+
const W = j(() => ie(a.accentColor) ?? {}), ue = j(() => W.value), $ = {
|
|
275
|
+
vars: {},
|
|
276
|
+
enabled: !!a.exposeGlobalAccent
|
|
259
277
|
};
|
|
260
|
-
return s.push(
|
|
261
|
-
|
|
278
|
+
return s.push($), A(
|
|
279
|
+
() => a.exposeGlobalAccent,
|
|
280
|
+
(e) => {
|
|
281
|
+
$.enabled = !!e, p();
|
|
282
|
+
},
|
|
283
|
+
{ immediate: !0 }
|
|
284
|
+
), A(
|
|
285
|
+
W,
|
|
262
286
|
(e) => {
|
|
263
|
-
e && Object.keys(e).length > 0 ?
|
|
287
|
+
e && Object.keys(e).length > 0 ? $.vars = { ...e } : $.vars = {}, p();
|
|
264
288
|
},
|
|
265
289
|
{ immediate: !0 }
|
|
266
|
-
), (e, t) => (
|
|
290
|
+
), (e, t) => (Z(), be("div", {
|
|
267
291
|
class: "theme",
|
|
268
|
-
style:
|
|
292
|
+
style: ge(ue.value)
|
|
269
293
|
}, [
|
|
270
|
-
|
|
294
|
+
ke(e.$slots, "default"),
|
|
295
|
+
ee("div", {
|
|
296
|
+
ref_key: "portalHost",
|
|
297
|
+
ref: f,
|
|
298
|
+
class: "theme__portal-host"
|
|
299
|
+
}, null, 512)
|
|
271
300
|
], 4));
|
|
272
301
|
}
|
|
273
|
-
}),
|
|
302
|
+
}), Ae = (n, a) => {
|
|
274
303
|
const s = n.__vccOpts || n;
|
|
275
|
-
for (const [
|
|
276
|
-
s[
|
|
304
|
+
for (const [c, p] of a)
|
|
305
|
+
s[c] = p;
|
|
277
306
|
return s;
|
|
278
|
-
},
|
|
307
|
+
}, Ie = {
|
|
279
308
|
__name: "ThemeSwitcher",
|
|
280
309
|
props: {
|
|
281
310
|
mode: {
|
|
@@ -285,66 +314,66 @@ const Oe = "(prefers-color-scheme: dark)", Re = "(prefers-reduced-motion: reduce
|
|
|
285
314
|
}
|
|
286
315
|
},
|
|
287
316
|
emits: ["update:mode"],
|
|
288
|
-
setup(n, { emit:
|
|
289
|
-
const
|
|
317
|
+
setup(n, { emit: a }) {
|
|
318
|
+
const c = [
|
|
290
319
|
{ value: "auto", label: "System" },
|
|
291
320
|
{ value: "light", label: "Light" },
|
|
292
321
|
{ value: "dark", label: "Dark" }
|
|
293
|
-
].reduce((f,
|
|
294
|
-
|
|
295
|
-
const
|
|
296
|
-
|
|
322
|
+
].reduce((f, d) => (f[d.value] = d.label, f), {}), p = B, k = n, P = a;
|
|
323
|
+
ne();
|
|
324
|
+
const T = N(!1), I = V() ?? k.mode, l = N(
|
|
325
|
+
p.includes(I) ? I : "auto"
|
|
297
326
|
);
|
|
298
|
-
return
|
|
299
|
-
() =>
|
|
300
|
-
),
|
|
327
|
+
return j(
|
|
328
|
+
() => c[l.value] ?? c.auto
|
|
329
|
+
), A(
|
|
301
330
|
() => k.mode,
|
|
302
331
|
(f) => {
|
|
303
|
-
|
|
332
|
+
p.includes(f) && f !== l.value && (l.value = f);
|
|
304
333
|
}
|
|
305
|
-
),
|
|
306
|
-
|
|
334
|
+
), A(
|
|
335
|
+
l,
|
|
307
336
|
(f) => {
|
|
308
|
-
if (!
|
|
309
|
-
|
|
337
|
+
if (!p.includes(f)) {
|
|
338
|
+
l.value = "auto";
|
|
310
339
|
return;
|
|
311
340
|
}
|
|
312
|
-
|
|
341
|
+
T.value = !1, P("update:mode", f), we(f);
|
|
313
342
|
},
|
|
314
343
|
{ immediate: !0 }
|
|
315
|
-
), (f,
|
|
316
|
-
open:
|
|
317
|
-
"onUpdate:open":
|
|
344
|
+
), (f, d) => (Z(), Me(g(ve), {
|
|
345
|
+
open: T.value,
|
|
346
|
+
"onUpdate:open": d[3] || (d[3] = (M) => T.value = M),
|
|
318
347
|
text: "Theme",
|
|
319
348
|
"aria-label": "Select theme mode"
|
|
320
349
|
}, {
|
|
321
|
-
default:
|
|
322
|
-
|
|
323
|
-
default:
|
|
324
|
-
|
|
325
|
-
checked:
|
|
326
|
-
"onUpdate:checked":
|
|
350
|
+
default: X(() => [
|
|
351
|
+
U(g(ye), { title: "Theme" }, {
|
|
352
|
+
default: X(() => [
|
|
353
|
+
U(g(K), {
|
|
354
|
+
checked: l.value,
|
|
355
|
+
"onUpdate:checked": d[0] || (d[0] = (M) => l.value = M),
|
|
327
356
|
value: "auto",
|
|
328
|
-
label:
|
|
329
|
-
"aria-label": `${
|
|
357
|
+
label: g(c).auto,
|
|
358
|
+
"aria-label": `${g(c).auto} mode`
|
|
330
359
|
}, null, 8, ["checked", "label", "aria-label"]),
|
|
331
|
-
|
|
360
|
+
d[4] || (d[4] = ee("hr", {
|
|
332
361
|
class: "theme-switcher-divider",
|
|
333
362
|
role: "separator"
|
|
334
363
|
}, null, -1)),
|
|
335
|
-
|
|
336
|
-
checked:
|
|
337
|
-
"onUpdate:checked":
|
|
364
|
+
U(g(K), {
|
|
365
|
+
checked: l.value,
|
|
366
|
+
"onUpdate:checked": d[1] || (d[1] = (M) => l.value = M),
|
|
338
367
|
value: "light",
|
|
339
|
-
label:
|
|
340
|
-
"aria-label": `${
|
|
368
|
+
label: g(c).light,
|
|
369
|
+
"aria-label": `${g(c).light} mode`
|
|
341
370
|
}, null, 8, ["checked", "label", "aria-label"]),
|
|
342
|
-
|
|
343
|
-
checked:
|
|
344
|
-
"onUpdate:checked":
|
|
371
|
+
U(g(K), {
|
|
372
|
+
checked: l.value,
|
|
373
|
+
"onUpdate:checked": d[2] || (d[2] = (M) => l.value = M),
|
|
345
374
|
value: "dark",
|
|
346
|
-
label:
|
|
347
|
-
"aria-label": `${
|
|
375
|
+
label: g(c).dark,
|
|
376
|
+
"aria-label": `${g(c).dark} mode`
|
|
348
377
|
}, null, 8, ["checked", "label", "aria-label"])
|
|
349
378
|
]),
|
|
350
379
|
_: 1
|
|
@@ -353,9 +382,11 @@ const Oe = "(prefers-color-scheme: dark)", Re = "(prefers-reduced-motion: reduce
|
|
|
353
382
|
_: 1
|
|
354
383
|
}, 8, ["open"]));
|
|
355
384
|
}
|
|
356
|
-
},
|
|
385
|
+
}, je = /* @__PURE__ */ Ae(Ie, [["__scopeId", "data-v-bcbc87cb"]]);
|
|
357
386
|
export {
|
|
358
|
-
|
|
359
|
-
|
|
387
|
+
Ue as Theme,
|
|
388
|
+
je as ThemeSwitcher,
|
|
389
|
+
oe as themePortalHostKey,
|
|
390
|
+
Ne as useThemePortalTarget
|
|
360
391
|
};
|
|
361
392
|
//# sourceMappingURL=theme.es.js.map
|