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