import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i}from"./dist-DtfJeYQK.js";import{t as a}from"./jsx-runtime-C2wGStra.js";import{n as o,t as s}from"./dist-Cc1j9Pjk.js";var c,l,u,d=t((()=>{c=`Switch__mFYAU`,l=`thumb__IEKpQ`,u={Switch:c,thumb:l}}));function f(e){let t={};return Object.entries(e).forEach(([e,n])=>{switch(e){case`id`:case`disabled`:case`aria-label`:case`aria-labelledby`:case`aria-describedby`:case`aria-invalid`:case`aria-errormessage`:t[e]=n}}),t}var p,m,h,g=t((()=>{p=e(n(),1),i(),s(),d(),m=a(),h=(0,p.forwardRef)(function({checked:e,defaultChecked:t,onCheckedChange:n,dataset:i,...a},s){let[c,l]=(0,p.useState)(t??!1),d=e!==void 0,h=d?e:c,g=()=>{let e=!h;d||l(e),n?.(e)};return(0,m.jsx)(`button`,{...f(a),...r(i,{preplyDsComponent:o.Switch}),ref:s,role:`switch`,"aria-checked":h,className:u.Switch,onClick:g,children:(0,m.jsx)(`span`,{className:u.thumb})})});try{h.displayName=`Switch`,h.__docgenInfo={description:``,displayName:`Switch`,props:{checked:{defaultValue:null,description:`The state of the switch.
Use this for a controlled switch.
@example const [checked, setChecked] = useState(initialChecked);
<Switch
  checked={checked}
  onCheckedChange={setChecked}
/>`,name:`checked`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},defaultChecked:{defaultValue:null,description:`The default state of the switch.
Use for an uncontrolled switch.
@example <Switch
  defaultChecked={mySetting}
  onCheckedChange={updateMySetting}
/>`,name:`defaultChecked`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},onCheckedChange:{defaultValue:null,description:`Callback for when the switch state changes.`,name:`onCheckedChange`,required:!1,type:{name:`enum`,value:[{value:`(checked: boolean) => void`}]}},id:{defaultValue:null,description:`The unique identifier for the switch element.`,name:`id`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},disabled:{defaultValue:null,description:`Disables interactions with the switch.`,name:`disabled`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},"aria-label":{defaultValue:null,description:`Accessible label for the switch.`,name:`aria-label`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},"aria-labelledby":{defaultValue:null,description:`ID of the element that labels the switch.`,name:`aria-labelledby`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},"aria-describedby":{defaultValue:null,description:`ID of the element that describes the switch.`,name:`aria-describedby`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},"aria-invalid":{defaultValue:null,description:`Indicates whether the switch value is invalid.`,name:`aria-invalid`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},"aria-errormessage":{defaultValue:null,description:`ID of the element that describes the error, if any.`,name:`aria-errormessage`,required:!1,type:{name:`enum`,value:[{value:`string`}]}},dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}}));export{g as n,h as t};