dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
52 lines (51 loc) • 2.4 kB
JavaScript
import { j as e } from "../../jsx-runtime-C5mzlN2N.js";
import { O as c, k as i, d as m, l as a } from "../../dropdown-menu-D3ab2Xna-ClM4t858.js";
import { u as l } from "../../check-DE-1lGDl-24KCJ29m.js";
import { T as r } from "../../ThemeMode-CqURAYDL.js";
import { u as h } from "../../useTheme-B5ZHXyfv.js";
import { u as d } from "../../useTranslation-dH-uwymc.js";
import { c as o } from "../../createLucideIcon-B950nf2d.js";
/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const k = [
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
], p = o("moon", k);
/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const u = [
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
["path", { d: "M12 2v2", key: "tus03m" }],
["path", { d: "M12 20v2", key: "1lh1kg" }],
["path", { d: "m4.93 4.93 1.41 1.41", key: "149t6j" }],
["path", { d: "m17.66 17.66 1.41 1.41", key: "ptbguv" }],
["path", { d: "M2 12h2", key: "1t8f8n" }],
["path", { d: "M20 12h2", key: "1q8mjw" }],
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
], x = o("sun", u);
function v({ className: n }) {
const { setTheme: t } = h(), { t: s } = d();
return /* @__PURE__ */ e.jsxs(c, { children: [
/* @__PURE__ */ e.jsx(i, { asChild: !0, children: /* @__PURE__ */ e.jsxs(l, { variant: "tertiary", size: "icon", className: n, children: [
/* @__PURE__ */ e.jsx(x, { className: "h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
/* @__PURE__ */ e.jsx(p, { className: "absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" }),
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Toggle theme" })
] }) }),
/* @__PURE__ */ e.jsxs(m, { align: "end", children: [
/* @__PURE__ */ e.jsx(a, { onClick: () => t(r.LIGHT), children: s("Light") }),
/* @__PURE__ */ e.jsx(a, { onClick: () => t(r.DARK), children: s("Dark") }),
/* @__PURE__ */ e.jsx(a, { onClick: () => t(r.SYSTEM), children: s("System") })
] })
] });
}
export {
v as ThemeToggle
};