@useloops/design-system
Version:
The official React based Loops design system
2 lines (1 loc) • 933 B
JavaScript
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{memo as o}from"react";import t from"./_partials/LikertActionController/LikertActionController.js";import a from"./_partials/LikertGraphBar/LikertGraphBar.js";import{LikertGraphContainer as n,LikertGraphBarContainer as i,LikertGraphActionsControllerContainer as l}from"./_partials/StyledComponents.js";const s=o(({data:o,onChangeHandler:s,slotProps:c,hideCheckboxes:p,hideLabels:h,hideColorIndicators:m,...d})=>{const C=p&&h&&m;return e(n,{...c?.root,children:[r(i,{...c?.graphBarContainer,children:o.map((e,o)=>r(a,{...e,...d},o))}),!C&&r(l,{...c?.actionsControllerContainer,children:o.map((e,o)=>{const{onChange:a,amount:n,percentage:i,relativePercentage:l,label:c}=e;return r(t,{...e,hideCheckboxes:p,hideLabels:h,hideColorIndicators:m,...d,onChange:s?(e,r)=>s(e,r):a?(e,r)=>a({amount:n,percentage:i,name:c,relativePercentage:l},r):void 0},o)})})]})});export{s as default};