@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.es.js CHANGED
@@ -1,44 +1,44 @@
1
- import { ref as U, watch as L, onBeforeUnmount as le, provide as de, computed as Y, createElementBlock as me, openBlock as J, normalizeStyle as fe, renderSlot as he, createBlock as pe, unref as b, withCtx as W, createVNode as x, createElementVNode as be } from "vue";
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 ge, DropdownItemGroup as ke, DropdownItemRadio as V } from "@gospore/dropdown-menu";
4
- const j = ["auto", "light", "dark"], X = "gospore-theme-mode", Me = 60 * 60 * 24 * 365, ve = "(prefers-color-scheme: dark)";
5
- function G() {
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 = we(X);
9
- return n && j.includes(n) ? n : null;
8
+ const n = Oe(te);
9
+ return n && B.includes(n) ? n : null;
10
10
  }
11
- function Ee(n) {
12
- if (typeof document > "u" || !j.includes(n))
11
+ function we(n) {
12
+ if (typeof document > "u" || !B.includes(n))
13
13
  return;
14
- const c = typeof window < "u" ? window.location.hostname : "", s = typeof window < "u" ? window.location.protocol : "", a = Se(c), g = s === "https:", k = [
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=${Me}`,
16
+ `max-age=${Ee}`,
17
17
  "SameSite=Lax"
18
18
  ];
19
- a && k.push(`domain=${a}`), g && k.push("Secure"), document.cookie = [
20
- `${encodeURIComponent(X)}=${encodeURIComponent(n)}`,
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 Z(n) {
24
+ function ne(n) {
25
25
  if (typeof document > "u")
26
26
  return;
27
- const c = typeof n == "string" && j.includes(n) ? n : G() ?? "auto";
28
- console.log("Applying theme mode:", c);
29
- const s = ye(c);
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 we(n) {
32
+ function Oe(n) {
33
33
  if (typeof document > "u" || !document.cookie)
34
34
  return null;
35
- const c = `${encodeURIComponent(n)}=`, s = document.cookie.split("; ");
36
- for (const a of s)
37
- if (a.startsWith(c))
38
- return decodeURIComponent(a.slice(c.length));
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 Se(n) {
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 ye(n) {
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 c = typeof window.matchMedia == "function" ? window.matchMedia(ve) : null;
56
- return c ? c.matches : !1;
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 Oe = "(prefers-color-scheme: dark)", Re = "(prefers-reduced-motion: reduce)", _e = 200, Ae = /* @__PURE__ */ Object.assign({
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 c = n, s = [], a = /* @__PURE__ */ new Set();
83
- function g() {
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
- a.forEach((r) => {
102
+ c.forEach((r) => {
88
103
  e.style.removeProperty(r);
89
- }), a.clear();
90
- const t = [...s].reverse().find((r) => r.vars && Object.keys(r.vars).length > 0);
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), a.add(r);
109
+ e.style.setProperty(r, o), c.add(r);
93
110
  });
94
111
  }
95
- const k = window.matchMedia(Oe), P = window.matchMedia(
96
- Re
97
- ), D = Q();
98
- Z(D);
99
- const I = U(D), i = U({
100
- darkMode: u(D)
101
- });
102
- k.addEventListener("change", M), L(
103
- () => c.mode,
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
- f();
122
+ d();
106
123
  },
107
124
  { immediate: !0 }
108
- ), L(
109
- () => i.value.darkMode,
125
+ ), A(
126
+ () => l.value.darkMode,
110
127
  (e, t) => {
111
128
  if (t === void 0) {
112
- K(e);
129
+ Q(e);
113
130
  return;
114
131
  }
115
- ee(() => {
116
- K(e);
132
+ re(() => {
133
+ Q(e);
117
134
  });
118
135
  },
119
136
  { immediate: !0 }
120
- ), le(() => {
121
- k.removeEventListener("change", M);
122
- const e = s.indexOf(N);
123
- e !== -1 && s.splice(e, 1), g();
137
+ ), pe(() => {
138
+ k.removeEventListener("change", Y);
139
+ const e = s.indexOf($);
140
+ e !== -1 && s.splice(e, 1), p();
124
141
  });
125
- function f() {
126
- const e = Q();
127
- I.value = e, i.value.darkMode = u(e);
142
+ function d() {
143
+ const e = q();
144
+ I.value = e, l.value.darkMode = M(e);
128
145
  }
129
- function u(e) {
146
+ function M(e) {
130
147
  return e === "dark" ? !0 : e === "light" ? !1 : k.matches;
131
148
  }
132
- function M(e) {
133
- !e || I.value !== "auto" || (i.value.darkMode = e.matches);
149
+ function Y(e) {
150
+ !e || I.value !== "auto" || (l.value.darkMode = e.matches);
134
151
  }
135
- function K(e) {
152
+ function Q(e) {
136
153
  document.documentElement.setAttribute("dark-mode", e);
137
154
  }
138
- function ee(e) {
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: _e,
171
+ duration: Ce,
155
172
  easing: "ease-in-out"
156
173
  });
157
174
  });
158
175
  }
159
- function Q() {
160
- return c.mode ?? G() ?? "auto";
176
+ function q() {
177
+ return a.mode ?? V() ?? "auto";
161
178
  }
162
- de("theme", i);
163
- function q(e) {
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], l = t[2], m = t[3];
169
- return `#${o}${o}${l}${l}${m}${m}`;
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 te(e) {
174
- const t = q(e);
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), l = parseInt(t.slice(5, 7), 16);
177
- return { r, g: o, b: l };
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 ne({ r: e, g: t, b: r }) {
180
- const o = (l) => l.toString(16).padStart(2, "0");
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 B(e) {
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 H(e) {
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 oe({ r: e, g: t, b: r }) {
194
- const o = e / 255, l = t / 255, m = r / 255, w = B(o), _ = B(l), d = B(m), v = 0.4122214708 * w + 0.5363325363 * _ + 0.0514459929 * d, E = 0.2119034982 * w + 0.6806995451 * _ + 0.1073969566 * d, S = 0.0883024619 * w + 0.2817188376 * _ + 0.6299787005 * d, p = Math.cbrt(v), y = Math.cbrt(E), T = Math.cbrt(S), $ = 0.2104542553 * p + 0.793617785 * y - 0.0040720468 * T, O = 1.9779984951 * p - 2.428592205 * y + 0.4505937099 * T, R = 0.0259040371 * p + 0.7827717662 * y - 0.808675766 * T, C = Math.sqrt(O * O + R * R);
195
- let A = Math.atan2(R, O) * (180 / Math.PI);
196
- return A < 0 && (A += 360), { l: $, c: C, h: A };
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 z(e, t, r, o = !1) {
199
- const l = r * Math.PI / 180, m = t * Math.cos(l), w = t * Math.sin(l), _ = e + 0.3963377774 * m + 0.2158037573 * w, d = e - 0.1055613458 * m - 0.0638541728 * w, v = e - 0.0894841775 * m - 1.291485548 * w, E = o ? h(_) : _, S = o ? h(d) : d, p = o ? h(v) : v;
200
- if (!o && (E < -1e-4 || E > 1.0001 || S < -1e-4 || S > 1.0001 || p < -1e-4 || p > 1.0001))
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 y = E * E * E, T = S * S * S, $ = p * p * p;
203
- let O = 4.0767416621 * y - 3.3077115913 * T + 0.2309699292 * $, R = -1.2684380046 * y + 2.6097574011 * T - 0.3413193965 * $, C = -0.0041960863 * y - 0.7034186147 * T + 1.707614701 * $;
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), R = h(R), C = h(C);
206
- else if (O < -1e-4 || O > 1.0001 || R < -1e-4 || R > 1.0001 || C < -1e-4 || C > 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 A = h(H(O)), se = h(H(R)), ie = h(H(C));
225
+ const x = h(G(O)), de = h(G(_)), me = h(G(C));
209
226
  return {
210
- r: Math.round(A * 255),
211
- g: Math.round(se * 255),
212
- b: Math.round(ie * 255)
227
+ r: Math.round(x * 255),
228
+ g: Math.round(de * 255),
229
+ b: Math.round(me * 255)
213
230
  };
214
231
  }
215
- function re(e, t, r) {
232
+ function le(e, t, r) {
216
233
  let o = t;
217
- for (let l = 0; l < 8; l += 1) {
218
- const m = z(e, o, r);
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 z(e, h(o), r, !0) || { r: 0, g: 0, b: 0 };
240
+ return F(e, h(o), r, !0) || { r: 0, g: 0, b: 0 };
224
241
  }
225
- function ce(e) {
226
- const t = q(e);
242
+ function ie(e) {
243
+ const t = z(e);
227
244
  if (!t) return null;
228
- const r = te(t);
245
+ const r = ae(t);
229
246
  if (!r) return null;
230
- const o = oe(r), l = {
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 = {}, w = (d) => d === 0 ? o.l : d > 0 ? h(o.l + d * (1 - o.l)) : h(o.l * (1 + d)), _ = (d) => {
242
- if (d === 1)
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 * d;
261
+ const v = o.c * u;
245
262
  return Math.max(0, Math.min(0.4, v));
246
263
  };
247
- return Object.entries(l).forEach(([d, v]) => {
248
- const E = `--color-brand-${d}`;
264
+ return Object.entries(i).forEach(([u, v]) => {
265
+ const y = `--color-brand-${u}`;
249
266
  if (v.base) {
250
- m[E] = t;
267
+ m[y] = t;
251
268
  return;
252
269
  }
253
- const S = w(v.lightness), p = _(v.chroma), y = re(S, p, o.h);
254
- m[E] = ne(y);
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 F = Y(() => ce(c.accentColor) ?? {}), ae = Y(() => F.value), N = {
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(N), L(
261
- F,
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 ? N.vars = { ...e } : N.vars = {}, g();
287
+ e && Object.keys(e).length > 0 ? $.vars = { ...e } : $.vars = {}, p();
264
288
  },
265
289
  { immediate: !0 }
266
- ), (e, t) => (J(), me("div", {
290
+ ), (e, t) => (Z(), be("div", {
267
291
  class: "theme",
268
- style: fe(ae.value)
292
+ style: ge(ue.value)
269
293
  }, [
270
- he(e.$slots, "default")
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
- }), De = (n, c) => {
302
+ }), Ae = (n, a) => {
274
303
  const s = n.__vccOpts || n;
275
- for (const [a, g] of c)
276
- s[a] = g;
304
+ for (const [c, p] of a)
305
+ s[c] = p;
277
306
  return s;
278
- }, Te = {
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: c }) {
289
- const a = [
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, u) => (f[u.value] = u.label, f), {}), g = j, k = n, P = c;
294
- Z();
295
- const D = U(!1), I = G() ?? k.mode, i = U(
296
- g.includes(I) ? I : "auto"
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 Y(
299
- () => a[i.value] ?? a.auto
300
- ), L(
327
+ return j(
328
+ () => c[l.value] ?? c.auto
329
+ ), A(
301
330
  () => k.mode,
302
331
  (f) => {
303
- g.includes(f) && f !== i.value && (i.value = f);
332
+ p.includes(f) && f !== l.value && (l.value = f);
304
333
  }
305
- ), L(
306
- i,
334
+ ), A(
335
+ l,
307
336
  (f) => {
308
- if (!g.includes(f)) {
309
- i.value = "auto";
337
+ if (!p.includes(f)) {
338
+ l.value = "auto";
310
339
  return;
311
340
  }
312
- D.value = !1, P("update:mode", f), Ee(f);
341
+ T.value = !1, P("update:mode", f), we(f);
313
342
  },
314
343
  { immediate: !0 }
315
- ), (f, u) => (J(), pe(b(ge), {
316
- open: D.value,
317
- "onUpdate:open": u[3] || (u[3] = (M) => D.value = M),
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: W(() => [
322
- x(b(ke), { title: "Theme" }, {
323
- default: W(() => [
324
- x(b(V), {
325
- checked: i.value,
326
- "onUpdate:checked": u[0] || (u[0] = (M) => i.value = M),
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: b(a).auto,
329
- "aria-label": `${b(a).auto} mode`
357
+ label: g(c).auto,
358
+ "aria-label": `${g(c).auto} mode`
330
359
  }, null, 8, ["checked", "label", "aria-label"]),
331
- u[4] || (u[4] = be("hr", {
360
+ d[4] || (d[4] = ee("hr", {
332
361
  class: "theme-switcher-divider",
333
362
  role: "separator"
334
363
  }, null, -1)),
335
- x(b(V), {
336
- checked: i.value,
337
- "onUpdate:checked": u[1] || (u[1] = (M) => i.value = M),
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: b(a).light,
340
- "aria-label": `${b(a).light} mode`
368
+ label: g(c).light,
369
+ "aria-label": `${g(c).light} mode`
341
370
  }, null, 8, ["checked", "label", "aria-label"]),
342
- x(b(V), {
343
- checked: i.value,
344
- "onUpdate:checked": u[2] || (u[2] = (M) => i.value = M),
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: b(a).dark,
347
- "aria-label": `${b(a).dark} mode`
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
- }, Le = /* @__PURE__ */ De(Te, [["__scopeId", "data-v-bcbc87cb"]]);
385
+ }, je = /* @__PURE__ */ Ae(Ie, [["__scopeId", "data-v-bcbc87cb"]]);
357
386
  export {
358
- Ae as Theme,
359
- Le as ThemeSwitcher
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