HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/design.system/storybook-static/assets/Switch.stories-DOm1e-SV.js
import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as p}from"./index-2yJIXLcc.js";import{c as x}from"./index-BORBwRSE.js";import{B as u}from"./Body-mIfF2_xz.js";const w="_root_5d01c_1",y="_disabled_5d01c_7",j="_label_5d01c_7",T="_description_5d01c_10",C="_wrapper_5d01c_16",E="_input_5d01c_23",n={root:w,disabled:y,label:j,description:T,switch:"_switch_5d01c_13",wrapper:C,input:E},d=p.forwardRef(({checked:i,label:a,description:s,disabled:r,onChange:c,className:o,...g},b)=>{const l=p.useId(),f=k=>{c(k.target.checked)};return e.jsxs("div",{className:x(n.root,{[n.disabled]:r},o),children:[e.jsx("input",{id:l,ref:b,type:"checkbox",className:n.input,checked:i,onChange:f,disabled:r,...g}),e.jsxs("div",{className:n.wrapper,children:[e.jsx("span",{className:n.switch}),e.jsx("label",{htmlFor:l,children:e.jsx(u,{className:n.label,children:a})})]}),s&&e.jsx(u,{className:n.description,children:s})]})});d.__docgenInfo={description:`Поддерживает все стандартные пропсы HTMLInputElement.

Полную документацию смотрите сайте: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement`,methods:[],displayName:"Switch",props:{checked:{required:!0,tsType:{name:"boolean"},description:""},label:{required:!0,tsType:{name:"string"},description:""},description:{required:!1,tsType:{name:"string"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},className:{required:!1,tsType:{name:"string"},description:""},onChange:{required:!0,tsType:{name:"signature",type:"function",raw:"(checked: boolean) => void",signature:{arguments:[{type:{name:"boolean"},name:"checked"}],return:{name:"void"}}},description:""}},composes:["Omit"]};const{useArgs:I}=__STORYBOOK_MODULE_PREVIEW_API__,q={component:d,title:"Molecules/Inputs/Switch",tags:["autodocs"],argTypes:{checked:{control:"boolean"}}},t={render:function(a){const[{checked:s},r]=I(),c=o=>{r({checked:o})};return e.jsx(d,{...a,checked:s,onChange:c})},args:{checked:!1,label:"Label",description:"Description"}};var h,m,_;t.parameters={...t.parameters,docs:{...(h=t.parameters)==null?void 0:h.docs,source:{originalSource:`{
  render: function Render(args) {
    const [{
      checked
    }, updateArgs] = useArgs();
    const handleChange = (value: boolean) => {
      updateArgs({
        checked: value
      });
    };
    return <Switch {...args} checked={checked} onChange={handleChange} />;
  },
  args: {
    checked: false,
    label: 'Label',
    description: 'Description'
  }
}`,...(_=(m=t.parameters)==null?void 0:m.docs)==null?void 0:_.source}}};const O=["Default"];export{t as Default,O as __namedExportsOrder,q as default};