UNPKG

dgz-ui-shared

Version:

Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library

12 lines (11 loc) 2.24 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),t=require("../../dropdown-menu-BPBcxHRB-towSSPIs.cjs"),c=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),r=require("../../ThemeMode-BO6tit_Z.cjs"),a=require("../../useTheme-DSAqyhTz.cjs"),u=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 l=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],m=o.createLucideIcon("moon",l);/** * @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:i}){const{t:s}=u.useTranslation(),{setTheme:n}=a.useTheme();return e.jsxRuntimeExports.jsxs(t.Nt,{children:[e.jsxRuntimeExports.jsx(t.jt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(c.u,{variant:"tertiary",size:"icon",className:i,children:[e.jsxRuntimeExports.jsx(h,{className:"h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"}),e.jsxRuntimeExports.jsx(m,{className:"absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),e.jsxRuntimeExports.jsxs(t.ut,{align:"end",children:[e.jsxRuntimeExports.jsx(t.it,{onClick:()=>n(r.ThemeMode.LIGHT),children:s("Light")}),e.jsxRuntimeExports.jsx(t.it,{onClick:()=>n(r.ThemeMode.DARK),children:s("Dark")}),e.jsxRuntimeExports.jsx(t.it,{onClick:()=>n(r.ThemeMode.SYSTEM),children:s("System")})]})]})}exports.ThemeToggle=x;