import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useMemo as o}from"react";import n from"classnames";import{FormControl as a,FormLabel as i,FormGroup as t,FormHelperText as l}from"@material-ui/core";import c from"./RadioAndCheckboxGroup.scss.js";var s={normal:c.spacing_normal,dense:c.spacing_dense},m={horizontal:c.horizontal,vertical:c.vertical},d=function(d){var p=d.component,u=d.getOnChangeHandler,v=d.getOptionChecked,h=d.value,f=d.testId,g=d.className,b=d.label,z=d.status,C=d.message,N=d.options,k=void 0===N?[]:N,x=d.size,j=void 0===x?"medium":x,O=d.spacing,_=void 0===O?"normal":O,A=d.direction,G=void 0===A?"vertical":A,H=o((function(){return null==k?void 0:k.map((function(e){var r=e.value;return u(r,h)}))}),[k,u,h]);return e("div",{className:n(c.root,s[_],m[G],g),"data-testid":f,children:r(a,{component:"fieldset",error:"error"===z,className:c.group,children:[b&&e(i,{component:"legend",className:c.label,children:b}),e(t,{children:k.map((function(r,o){return e(p,{label:r.label,checked:v(r.value,h),size:j,onChange:H[o]},o)}))}),C&&e(l,{children:C})]})})};export{d as RadioAndCheckboxGroup};
//# sourceMappingURL=RadioAndCheckboxGroup.js.map
