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 { N as i, j as c, u as m, i as a } from "../../dropdown-menu-BPBcxHRB-EjT0ADL9.js";
import { u as l } from "../../button-Bp2lHjov-BTlHPcva.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 p = [
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
], k = o("moon", p);
/**
* @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" }]
], j = o("sun", u);
function v({ className: n }) {
const { t } = d(), { setTheme: s } = h();
return /* @__PURE__ */ e.jsxs(i, { children: [
/* @__PURE__ */ e.jsx(c, { asChild: !0, children: /* @__PURE__ */ e.jsxs(l, { variant: "tertiary", size: "icon", className: n, children: [
/* @__PURE__ */ e.jsx(j, { className: "h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" }),
/* @__PURE__ */ e.jsx(k, { className: "absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" }),
/* @__PURE__ */ e.jsx("span", { className: "sr-only", children: "Toggle theme" })
] }) }),
/* @__PURE__ */ e.jsxs(m, { align: "end", children: [
/* @__PURE__ */ e.jsx(a, { onClick: () => s(r.LIGHT), children: t("Light") }),
/* @__PURE__ */ e.jsx(a, { onClick: () => s(r.DARK), children: t("Dark") }),
/* @__PURE__ */ e.jsx(a, { onClick: () => s(r.SYSTEM), children: t("System") })
] })
] });
}
export {
v as ThemeToggle
};