import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{_ as n,j as r,n as i,pn as a,t as o}from"./iframe-NOj5DEP4.js";import{a as s,i as c}from"./utils-C5_R17vJ.js";import{n as l,t as u}from"./ui.module-wFHXkJzp.js";import{n as d,r as f}from"./uiClasses-CaHp0EWd.js";import{n as p,t as m}from"./CheckBox.module-ezWPE2pa.js";function h({label:e,description:t,placeholder:i,disabled:a,size:o,className:c,onChange:u,value:f,noWrap:p,id:h,tone:v=`neutral`,indeterminate:y=!1,...b}){let x=(0,g.useId)(),S=h??x,C=t?`${S}-description`:void 0,w=e??i,T=f??!1,E=e=>{e&&(e.indeterminate=y)};return(0,_.jsxs)(`div`,{className:s(l.uiElement,o&&l.uiSizable,o&&l[o],a&&l.disabled,c),"aria-disabled":a||void 0,children:[(0,_.jsxs)(`div`,{className:m.row,children:[(0,_.jsxs)(`div`,{className:s(m.wrapper,d(v)),children:[(0,_.jsx)(`input`,{...b,ref:E,id:S,type:`checkbox`,checked:T,disabled:a,"aria-checked":y?`mixed`:T,"aria-describedby":C,className:s(l.uiSelectionControl,m.input,y&&m.inputIndeterminate),onChange:()=>u?.(!T)}),(0,_.jsx)(`div`,{className:s(l.uiSelectionIcon,m.icon),"aria-hidden":`true`,children:y?(0,_.jsx)(r,{}):(0,_.jsx)(n,{})})]}),w&&(0,_.jsx)(`label`,{htmlFor:S,className:s(l.uiLabelBase,p&&`textNoWrap`),children:w})]}),t&&(0,_.jsx)(`p`,{id:C,className:l.uiDescription,children:t})]})}var g,_,v=t((()=>{g=e(a(),1),c(),i(),u(),f(),p(),_=o(),h.__docgenInfo={description:`Компонент флажка для выбора булевого значения в формах и списках.
Поддерживает tone + appearance и использует общие selection utility-классы из ui.module.scss.`,methods:[],displayName:`CheckBox`,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:``},tone:{required:!1,tsType:{name:`union`,raw:`"neutral" | "error" | "warning" | "success" | "info"`,elements:[{name:`literal`,value:`"neutral"`},{name:`literal`,value:`"error"`},{name:`literal`,value:`"warning"`},{name:`literal`,value:`"success"`},{name:`literal`,value:`"info"`}]},description:``,defaultValue:{value:`"neutral"`,computed:!1}},noWrap:{required:!1,tsType:{name:`boolean`},description:``},indeterminate:{required:!1,tsType:{name:`boolean`},description:'Показывает частично выбранную группу и публикует `aria-checked="mixed"`.',defaultValue:{value:`false`,computed:!1}}},composes:[`Omit`]}}));export{v as n,h as t};