"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/jsx-runtime.js"),f=require("react"),n=require("../styles.js"),r=require("../../../utils/index.js"),m=require("../../../icons/AlertCircle.js"),v=require("./CheckboxInput.js");function I({id:i,name:x,label:t,value:k,checked:h,onChange:j=r.noop,disabled:p=!1,hasError:d=!1,errorText:u,assistText:o,indeterminate:R,tabIndex:l,...a},C){const c=r.getId(a["data-testid"]),s=r.getId(a["data-trackid"]);return!i&&t&&(i=r.slugify(t)),e.jsxRuntimeExports.jsxs(n.CheckRadioInputGroupWrapper,{children:[e.jsxRuntimeExports.jsx(v.CheckboxInput,{id:i,ref:C,name:x,value:k,disabled:p,"aria-checked":a["aria-checked"],checked:h,onChange:j,"data-testid":c("check"),"data-trackid":s("check"),"aria-label":a["aria-label"]||t,hasError:d,label:t,indeterminate:R,tabIndex:l}),d&&u&&e.jsxRuntimeExports.jsxs(n.CheckRadioErrorArea,{"data-testid":c("error"),"data-trackid":s("error"),children:[e.jsxRuntimeExports.jsx(m.default,{}),u]}),o&&!d&&e.jsxRuntimeExports.jsx(n.CheckRadioHintArea,{"data-testid":c("assistText"),"data-trackid":s("assistText"),children:o})]})}const q=f.forwardRef(I);exports.Checkbox=q;
