UNPKG

@useloops/design-system

Version:

The official React based Loops design system

2 lines (1 loc) 922 B
"use strict";var e=require("react/jsx-runtime"),r=require("react"),a=require("./_partials/LikertActionController/LikertActionController.js"),t=require("./_partials/LikertGraphBar/LikertGraphBar.js"),n=require("./_partials/StyledComponents.js");var o=r.memo(({data:r,onChangeHandler:o,slotProps:i,hideCheckboxes:s,hideLabels:l,hideColorIndicators:c,...h})=>{const C=s&&l&&c;return e.jsxs(n.LikertGraphContainer,{...i?.root,children:[e.jsx(n.LikertGraphBarContainer,{...i?.graphBarContainer,children:r.map((r,a)=>e.jsx(t,{...r,...h},a))}),!C&&e.jsx(n.LikertGraphActionsControllerContainer,{...i?.actionsControllerContainer,children:r.map((r,t)=>{const{onChange:n,amount:i,percentage:C,relativePercentage:d,label:p}=r;return e.jsx(a,{...r,hideCheckboxes:s,hideLabels:l,hideColorIndicators:c,...h,onChange:o?(e,r)=>o(e,r):n?(e,r)=>n({amount:i,percentage:C,name:p,relativePercentage:d},r):void 0},t)})})]})});module.exports=o;