import{n as e,o as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-C21x__mS.js";import{i as r,n as i,r as a}from"./iframe-DaN-XFub.js";import{a as o,i as s}from"./utils-DUM89eIj.js";import{n as c,t as l}from"./ui.module-DoMIk8Oc.js";import{n as u,r as d}from"./uiClasses-CO3Cdv1E.js";import{n as f,t as p}from"./CheckBox.module-BBzuj5He.js";var m,h;function g(){return(g=e((()=>{r(),m=[[`path`,{d:`M5 12h14`,key:`1ays0h`}]],h=a(`minus`,m)})))()}var _,v;function y(){return(y=e((()=>{r(),_=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]],v=a(`square`,_)})))()}function b({label:e,description:t,placeholder:n,disabled:r,size:i,className:a,onChange:s,value:l,noWrap:d,id:f,tone:m=`neutral`,indeterminate:g=!1,..._}){let y=(0,x.useId)(),b=f??y,C=t?`${b}-description`:void 0,w=e??n,T=l??!1,E=e=>{e&&(e.indeterminate=g)};return(0,S.jsxs)(`div`,{className:o(c.uiElement,i&&c.uiSizable,i&&c[i],r&&c.disabled,a),"aria-disabled":r||void 0,children:[(0,S.jsxs)(`div`,{className:p.row,children:[(0,S.jsxs)(`div`,{className:o(p.wrapper,u(m)),children:[(0,S.jsx)(`input`,{..._,ref:E,id:b,type:`checkbox`,checked:T,disabled:r,"aria-checked":g?`mixed`:T,"aria-describedby":C,className:o(c.uiSelectionControl,p.input,g&&p.inputIndeterminate),onChange:()=>s?.(!T)}),(0,S.jsx)(`div`,{className:o(c.uiSelectionIcon,p.icon),"aria-hidden":`true`,children:g?(0,S.jsx)(h,{}):(0,S.jsx)(v,{})})]}),w&&(0,S.jsx)(`label`,{htmlFor:b,className:o(c.uiLabelBase,d&&`textNoWrap`),children:w})]}),t&&(0,S.jsx)(`p`,{id:C,className:c.uiDescription,children:t})]})}var x,S;function C(){return(C=e((()=>{x=t(n(),1),s(),g(),y(),l(),d(),f(),S=i(),b.__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{g as i,C as n,h as r,b as t};