@webdevarif/dashui 0.3.0 → 0.3.1

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/index.mjs CHANGED
@@ -1065,7 +1065,7 @@ function NotificationBell({
1065
1065
  import * as React17 from "react";
1066
1066
  import { useTheme } from "next-themes";
1067
1067
  import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
1068
- function ThemeToggle({ className }) {
1068
+ function ThemeToggle({ className, theme: externalTheme, onToggle }) {
1069
1069
  const { resolvedTheme, setTheme } = useTheme();
1070
1070
  const [mounted, setMounted] = React17.useState(false);
1071
1071
  React17.useEffect(() => {
@@ -1084,11 +1084,12 @@ function ThemeToggle({ className }) {
1084
1084
  }
1085
1085
  );
1086
1086
  }
1087
- const isDark = resolvedTheme === "dark";
1087
+ const isDark = externalTheme !== void 0 ? externalTheme === "dark" : resolvedTheme === "dark";
1088
+ const handleToggle = onToggle ?? (() => setTheme(isDark ? "light" : "dark"));
1088
1089
  return /* @__PURE__ */ jsx24(
1089
1090
  "button",
1090
1091
  {
1091
- onClick: () => setTheme(isDark ? "light" : "dark"),
1092
+ onClick: handleToggle,
1092
1093
  className: cn(
1093
1094
  "flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
1094
1095
  className