dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
12 lines (11 loc) • 2.24 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),t=require("../../dropdown-menu-D3ab2Xna-DfNVOtLW.cjs"),i=require("../../check-DE-1lGDl-C_ZPlJ0c.cjs"),r=require("../../ThemeMode-BO6tit_Z.cjs"),a=require("../../useTheme-DSAqyhTz.cjs"),l=require("../../useTranslation-CZf20ucv.cjs"),o=require("../../createLucideIcon-BnAj0RnC.cjs");/**
* @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 m=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],u=o.createLucideIcon("moon",m);/**
* @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 d=[["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"}]],h=o.createLucideIcon("sun",d);function x({className:c}){const{setTheme:s}=a.useTheme(),{t:n}=l.useTranslation();return e.jsxRuntimeExports.jsxs(t.Ot,{children:[e.jsxRuntimeExports.jsx(t.kt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(i.u,{variant:"tertiary",size:"icon",className:c,children:[e.jsxRuntimeExports.jsx(h,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),e.jsxRuntimeExports.jsx(u,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),e.jsxRuntimeExports.jsxs(t.dt,{align:"end",children:[e.jsxRuntimeExports.jsx(t.lt,{onClick:()=>s(r.ThemeMode.LIGHT),children:n("Light")}),e.jsxRuntimeExports.jsx(t.lt,{onClick:()=>s(r.ThemeMode.DARK),children:n("Dark")}),e.jsxRuntimeExports.jsx(t.lt,{onClick:()=>s(r.ThemeMode.SYSTEM),children:n("System")})]})]})}exports.ThemeToggle=x;