"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),a=require("../index-DEZRGktf.js"),g=require("lucide-react");require("react-router-dom");require("react-dom");const C=[{label:"Primary",color:"primary"},{label:"Secondary",color:"secondary"},{label:"Danger",color:"danger"},{label:"Info",color:"info"},{label:"Success",color:"success"},{label:"Warning",color:"warning"}],p=()=>{const[c,s]=n.useState(!1),[i,t]=n.useState(!0),[h,o]=n.useState({primary:!0,secondary:!0,danger:!0,info:!0,success:!0,warning:!0}),d=r=>l=>{o(m=>({...m,[r]:l}))};return e.jsxs(e.Fragment,{children:[e.jsx(a.HeroCard,{title:"Switch",description:"A toggle switch component for binary on/off states.",icon:e.jsx("div",{className:"w-20 h-20 sm:w-24 sm:h-24 md:w-32 md:h-32 bg-linear-to-br from-emerald-500 via-green-500 to-lime-500 rounded-full flex items-center justify-center shadow-lg border border-emerald-500/50",children:e.jsx(g.ToggleLeft,{className:"w-10 h-10 sm:w-12 sm:h-12 md:w-16 md:h-16 text-white filter drop-shadow-lg"})})}),e.jsx(a.CardContainer,{className:"overflow-hidden",children:e.jsx(a.CardTitle,{title:"Examples",className:"mt-2 mb-2",children:e.jsx("div",{className:"w-full p-4 sm:p-6",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"Basic Switch"}),e.jsx(a.Switch,{label:"Enable notifications",checked:c,onChange:s})]}),e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"Custom Labels"}),e.jsx(a.Switch,{label:"Dark mode",onLabel:"ON",offLabel:"OFF",checked:c,onChange:s})]}),e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"With Helper Text"}),e.jsx(a.Switch,{label:"Auto-save",helperText:"Automatically save your work",checked:c,onChange:s})]}),e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"With Error"}),e.jsx(a.Switch,{label:"Required switch",errorMessage:"This field is required",checked:c,onChange:s})]}),e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"Disabled"}),e.jsx(a.Switch,{label:"Disabled switch",disabled:!0,checked:c,onChange:s})]})]})})})}),e.jsx(a.CardContainer,{className:"overflow-hidden",children:e.jsx(a.CardTitle,{title:"Variants",className:"mt-2 mb-2",children:e.jsx("div",{className:"w-full p-4 sm:p-6",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"Ghost (default)"}),e.jsx(a.Switch,{label:"Ghost Variant",variant:"ghost",checked:c,onChange:s})]}),e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"Solid"}),e.jsx(a.Switch,{label:"Solid Variant",variant:"solid",checked:c,onChange:s})]}),e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:"Transparent"}),e.jsx(a.Switch,{label:"Transparent Variant",variant:"transparent",checked:c,onChange:s})]})]})})})}),e.jsx(a.CardContainer,{className:"overflow-hidden",children:e.jsx(a.CardTitle,{title:"Colors",className:"mt-2 mb-2",children:e.jsx("div",{className:"w-full p-4 sm:p-6",children:e.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:C.map(({label:r,color:l})=>e.jsxs(a.CardContainer,{className:"p-4",children:[e.jsx(a.Typography,{tag:"h5",className:"mb-3",children:r}),e.jsx(a.Switch,{label:`${r} Switch`,color:l,checked:h[l],onChange:d(l)})]},l))})})})}),e.jsx(a.PropPlayground,{componentName:"Switch",defaultValues:{label:"Preview Switch",onLabel:"ON",offLabel:"OFF",variant:"ghost",color:"primary",helperText:"",errorMessage:"",disabled:!1},includeProps:["label","onLabel","offLabel","variant","color","helperText","errorMessage","disabled"],excludeProps:["checked","onChange"],children:r=>e.jsx(a.Switch,{...r,checked:i,onChange:t})}),e.jsx(a.AutoPropsTable,{componentName:"Switch"}),e.jsx(a.CardContainer,{className:"overflow-hidden",children:e.jsx(a.CardTitle,{title:"Code Example",className:"mt-2 mb-2",children:e.jsx("div",{className:"w-full p-4 sm:p-6",children:e.jsx(a.CodeBlock,{language:"tsx",code:`import { Switch } from '@e-burgos/tucu-ui';

<Switch
  label="Enable notifications"
  checked={checked}
  onChange={setChecked}
/>

<Switch
  label="Dark mode"
  onLabel="ON"
  offLabel="OFF"
  checked={checked}
  onChange={setChecked}
/>

// Variants
<Switch label="Ghost" variant="ghost" checked={checked} onChange={setChecked} />
<Switch label="Solid" variant="solid" checked={checked} onChange={setChecked} />
<Switch label="Transparent" variant="transparent" checked={checked} onChange={setChecked} />

// Colors
<Switch label="Primary" color="primary" checked={checked} onChange={setChecked} />
<Switch label="Secondary" color="secondary" checked={checked} onChange={setChecked} />
<Switch label="Danger" color="danger" checked={checked} onChange={setChecked} />
<Switch label="Info" color="info" checked={checked} onChange={setChecked} />
<Switch label="Success" color="success" checked={checked} onChange={setChecked} />
<Switch label="Warning" color="warning" checked={checked} onChange={setChecked} />`})})})})]})};exports.default=p;
