import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{pn as n,t as r}from"./iframe-CMLjY6eW.js";import{a as i,i as a}from"./utils-PcgESe3m.js";import{n as o,t as s}from"./ui.module-wFHXkJzp.js";var c,l,u,d,f,p,m,h,g,_=t((()=>{c=`FFyoOs`,l=`zPYy7T`,u=`j6ek6R`,d=`HFTPXI`,f=`_0RK4xF`,p=`kDPnKt`,m=`DQHqws`,h=`nCQ9v4`,g={row:c,wrapper:l,input:u,track:d,thumb:f,unchecked:p,checked:m,option:h}}));function v({label:e,description:t,placeholder:n,disabled:r,size:a,className:s,onChange:c,value:l,id:u,checkedText:d=`ВКЛ`,uncheckedText:f=`ВЫКЛ`,labelPosition:p=`before`,...m}){let h=(0,y.useId)(),_=u??h,v=t?`${_}-description`:void 0,x=e??n,S=!!l,C=!x&&!m[`aria-label`]?`${f} / ${d}`:void 0,w=x?(0,b.jsx)(`label`,{htmlFor:_,className:o.uiLabel,children:x}):null;return(0,b.jsxs)(`div`,{className:i(o.uiElement,r&&o.disabled,a&&o.uiSizable,a&&o[a],s),"aria-disabled":r||void 0,children:[(0,b.jsxs)(`div`,{className:g.row,children:[p===`before`&&w,(0,b.jsxs)(`div`,{className:g.wrapper,children:[(0,b.jsx)(`input`,{...m,id:_,type:`checkbox`,role:`switch`,checked:S,disabled:r,"aria-checked":S,"aria-describedby":v,"aria-label":C,className:i(o.uiInputControl,g.input),onChange:e=>c?.(e.currentTarget.checked)}),(0,b.jsxs)(`div`,{className:g.track,"data-disabled":r||void 0,"aria-hidden":`true`,children:[(0,b.jsx)(`div`,{className:g.thumb}),(0,b.jsx)(`div`,{className:i(g.option,g.unchecked),children:f}),(0,b.jsx)(`div`,{className:i(g.option,g.checked),children:d})]})]}),p===`after`&&w]}),t&&(0,b.jsx)(`p`,{id:v,className:o.uiDescription,children:t})]})}var y,b,x=t((()=>{y=e(n(),1),a(),s(),_(),b=r(),v.__docgenInfo={description:`Переключаемая кнопка с сохранением активного состояния. Используется для локального выбора режима, фильтра или форматирования.`,methods:[],displayName:`Toggle`,props:{label:{required:!1,tsType:{name:`ReactNode`},description:``},description:{required:!1,tsType:{name:`string`},description:``},placeholder:{required:!1,tsType:{name:`string`},description:``},disabled:{required:!1,tsType:{name:`boolean`},description:``},size:{required:!1,tsType:{name:`union`,raw:`"xs" | "sm" | "md" | "lg" | "xl"`,elements:[{name:`literal`,value:`"xs"`},{name:`literal`,value:`"sm"`},{name:`literal`,value:`"md"`},{name:`literal`,value:`"lg"`},{name:`literal`,value:`"xl"`}]},description:``},value:{required:!0,tsType:{name:`V`},description:"Если начальное состояние может быть `null | undefined`\nзначит `onChange` тоже должен ументь сбрасывать.\nПоэтому такой контрол явно должен передавать `UiBaseProps<AnyType | undefined>`"},onChange:{required:!0,tsType:{name:`signature`,type:`function`,raw:`(value: T) => void`,signature:{arguments:[{type:{name:`C`},name:`value`}],return:{name:`void`}}},description:``},checkedText:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"ВКЛ"`,computed:!1}},uncheckedText:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"ВЫКЛ"`,computed:!1}},labelPosition:{required:!1,tsType:{name:`union`,raw:`"before" | "after"`,elements:[{name:`literal`,value:`"before"`},{name:`literal`,value:`"after"`}]},description:``,defaultValue:{value:`"before"`,computed:!1}}},composes:[`Omit`]}}));export{x as n,v as t};