@useloops/design-system
Version:
The official React based Loops design system
2 lines (1 loc) • 3.02 kB
JavaScript
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),r=require("react"),a=require("../../BrandCore/Icon/Icon.js"),i=require("../GraphBar/GraphBar.js"),n=require("../LikertGraph/LikertGraph.js");require("../SliderGraph/_partials/SliderGraphYAxis/SliderGraphYAxis.js");var o=require("../SliderGraph/SliderGraph.js");require("../SliderGraph/_partials/StyledComponents.js");exports.MiniEmojiGraph=({data:a})=>{const n=t.useTheme();return a.map((t,a)=>e.jsx(r.Fragment,{children:e.jsx(i,{id:t.id,label:t.label,relativePercentage:t.relativePercentage,value:t.value,percentageSymbol:!0,respondentCount:t.respondentCount,checked:!0,slotProps:{graphBar:{barColor:n.custom.palette.purple[100]},listItem:{sx:{marginBottom:0}}},hideCheckbox:!0,icon:t.icon,animated:!0,compact:!0},t.id)},t.id))},exports.MiniLikertGraph=({data:t})=>e.jsx(n,{hideLabels:!0,hideCheckboxes:!0,hideColorIndicators:!0,data:t,slotProps:{graphBarContainer:{sx:{height:"48px",alignSelf:"center"}},root:{sx:{minWidth:"227px"}}}}),exports.MiniOpenQuestionGraph=({data:n})=>{const o=t.useTheme();return n.map((t,s)=>e.jsx(r.Fragment,{children:e.jsx(i,{id:t.id,label:t.label,relativePercentage:(n.length-s)/n.length*100,hideUnitColumn2:!0,percentageSymbol:!0,value:t.value,icon:e.jsx(a.default,{name:`number-${s+1}`}),hideCheckbox:!0,compact:!0,checked:!0,slotProps:{graphBar:{barColor:"positive"===t.sentiment?o.custom.palette.data.sentimentPositive:o.custom.palette.data.sentimentNegative},unitText2:{sx:{width:"unset",maxWidth:42,flexShrink:1}},icon:{sx:{color:"positive"===t.sentiment?o.custom.palette.data.sentimentVeryPositive:o.custom.palette.data.sentimentVeryNegative}},graphBarTypography:{weight:"bold",sx:{color:o.custom.palette.red[1e3]}},listItem:{sx:{marginBottom:0}}}})},t.id))},exports.MiniPunchGraph=({data:a})=>{const n=t.useTheme();return a.map((t,a)=>e.jsx(r.Fragment,{children:e.jsx(i,{id:t.id,label:t.label,relativePercentage:t.relativePercentage,value:t.value,percentageSymbol:!0,respondentCount:t.respondentCount,checked:!0,slotProps:{graphBar:{barColor:n.custom.palette.purple[100]},listItem:{sx:{marginBottom:0}}},hideCheckbox:!0,hideIcon:!0,animated:!0,compact:!0},t.id)},t.id))},exports.MiniRankGraph=({data:n})=>{const o=t.useTheme();return n.map((t,s)=>e.jsx(r.Fragment,{children:e.jsx(i,{id:t.id,label:t?.label,relativePercentage:(n.length-s)/n.length*100,percentageSymbol:!0,respondentCount:t.respondentCount,checked:!0,slotProps:{graphBar:{barColor:o.custom.palette.purple[100]},listItem:{sx:{marginBottom:0}}},hideCheckbox:!0,hideUnitColumn1:!0,hideUnitColumn2:!0,icon:e.jsx(a.default,{name:`number-${(s+1).toString()}`,sx:{color:o.custom.palette.icon.secondary}}),animated:!0},t.id)},t.id))},exports.MiniSliderGraph=({data:r})=>{const a=t.useTheme();return e.jsx(o,{maxHeight:96,data:r,rounding:10,tickInterval:5,hideCheckboxes:!0,hideYAxis:!0,responsive:!0,slotProps:{root:{sx:{height:"96px",minHeight:"96px",padding:0}},bar:{slotProps:{bar:{sx:{backgroundColor:a.custom.palette.purple[100]}}}}}})};