mood-ui 0.8.0 → 0.8.2

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/mood-ui.mjs CHANGED
@@ -460,10 +460,12 @@ function kt(e) {
460
460
  }
461
461
  //#endregion
462
462
  //#region src/composables/useColorMode.ts
463
- var At = "modo-color-mode", jt = "dark", Mt = O("system"), Nt = O(!1), Pt = jt, Ft = i(() => Mt.value === "system" ? Nt.value ? "dark" : "light" : Mt.value), It = () => {
464
- typeof document > "u" || document.documentElement.classList.toggle(Pt, Ft.value === "dark");
463
+ var At = "modo-color-mode", jt = "dark", Mt = O("system"), Nt = O(!1), Pt = null, Ft = i(() => Mt.value === "system" ? Nt.value ? "dark" : "light" : Mt.value), It = () => {
464
+ if (typeof document > "u") return;
465
+ let e = Ft.value === "dark";
466
+ document.documentElement.classList.toggle(jt, e), Pt && document.documentElement.classList.toggle(Pt, e);
465
467
  }, Lt = (e) => {
466
- !e || e === Pt || (typeof document < "u" && document.documentElement.classList.remove(Pt), Pt = e, It());
468
+ !e || e === Pt || (typeof document < "u" && Pt && document.documentElement.classList.remove(Pt), Pt = e, It());
467
469
  };
468
470
  function Rt(e) {
469
471
  e.darkClass && Lt(e.darkClass);
@@ -579,7 +581,12 @@ var Wt = ["data-modo-theme"], Gt = /* @__PURE__ */ f({
579
581
  }, { deep: !0 }), U(() => r?.value.darkSurfaces, (e) => {
580
582
  t.darkSurfaces === void 0 && (c.value.darkSurfaces = e);
581
583
  }, { deep: !0 });
582
- let { isDark: l } = Ht(), u = i(() => t.scoped && o.value !== void 0 ? o.value === "dark" : l.value), d = i(() => {
584
+ let { isDark: l } = Ht(), u = i(() => t.scoped && o.value !== void 0 ? o.value === "dark" : l.value), d = O(!1);
585
+ S(() => {
586
+ d.value = !0;
587
+ });
588
+ let f = i(() => {
589
+ if (!d.value) return {};
583
590
  let e = st(c.value.palettes), t = ct(c.value.palettes, St, kt), n = !u.value && c.value.surfaces ? _t(c.value.surfaces) : {}, r = u.value && c.value.darkSurfaces ? _t(c.value.darkSurfaces) : {};
584
591
  return {
585
592
  ...e,
@@ -592,7 +599,7 @@ var Wt = ["data-modo-theme"], Gt = /* @__PURE__ */ f({
592
599
  let e = [];
593
600
  U(() => ({
594
601
  scoped: t.scoped,
595
- vars: d.value
602
+ vars: f.value
596
603
  }), ({ scoped: t, vars: n }) => {
597
604
  if (t) return;
598
605
  let r = document.body;
@@ -611,12 +618,12 @@ var Wt = ["data-modo-theme"], Gt = /* @__PURE__ */ f({
611
618
  }
612
619
  });
613
620
  }
614
- let f = h(ht, void 0);
621
+ let p = h(ht, void 0);
615
622
  return E(ht, i(() => {
616
- let e = f?.value ?? dt;
623
+ let e = p?.value ?? dt;
617
624
  return t.locale ? ft(e, t.locale) : e;
618
625
  })), (t, n) => (T(), s("div", {
619
- style: b(d.value),
626
+ style: b(f.value),
620
627
  class: v(e.scoped ? "modo-scope" : "contents"),
621
628
  "data-modo-theme": e.scoped ? o.value : void 0
622
629
  }, [A(t.$slots, "default")], 14, Wt));
@@ -12071,7 +12078,7 @@ var zs = ["for"], Bs = {
12071
12078
  "aria-checked": t.modelValue === n.value,
12072
12079
  "aria-label": n.label,
12073
12080
  disabled: t.disabled,
12074
- class: v(["relative z-10 inline-flex items-center justify-center rounded-full text-muted-foreground transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background", [
12081
+ class: v(["modo-color-mode-option relative z-10 inline-flex items-center justify-center rounded-full text-muted-foreground transition-colors duration-150", [
12075
12082
  t.showLabels ? F[t.size].lbl : F[t.size].btn,
12076
12083
  t.modelValue === n.value ? "text-foreground" : "hover:text-foreground",
12077
12084
  t.disabled ? "cursor-not-allowed" : "cursor-pointer"
@@ -12086,7 +12093,7 @@ var zs = ["for"], Bs = {
12086
12093
  "aria-checked": t.modelValue === n.value,
12087
12094
  "aria-label": n.label,
12088
12095
  disabled: t.disabled,
12089
- class: v(["relative z-10 inline-flex items-center justify-center rounded-full text-muted-foreground transition-colors duration-150", [
12096
+ class: v(["modo-color-mode-option relative z-10 inline-flex items-center justify-center rounded-full text-muted-foreground transition-colors duration-150", [
12090
12097
  t.showLabels ? F[t.size].lbl : F[t.size].btn,
12091
12098
  t.modelValue === n.value ? "text-foreground" : "hover:text-foreground",
12092
12099
  t.disabled ? "cursor-not-allowed" : "cursor-pointer"