UNPKG

@useloops/design-system

Version:

The official React based Loops design system

2 lines (1 loc) 2.9 kB
import{jsx as e}from"react/jsx-runtime";import{useTheme as t}from"@mui/material";import{Fragment as r}from"react";import a from"../../BrandCore/Icon/Icon.js";import o from"../GraphBar/GraphBar.js";import i from"../LikertGraph/LikertGraph.js";import"../SliderGraph/_partials/SliderGraphYAxis/SliderGraphYAxis.js";import n from"../SliderGraph/SliderGraph.js";import"../SliderGraph/_partials/StyledComponents.js";const l=({data:t})=>e(i,{hideLabels:!0,hideCheckboxes:!0,hideColorIndicators:!0,data:t,slotProps:{graphBarContainer:{sx:{height:"48px",alignSelf:"center"}},root:{sx:{minWidth:"227px"}}}}),s=({data:r})=>{const a=t();return e(n,{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]}}}}}})},p=({data:i})=>{const n=t();return i.map((t,l)=>e(r,{children:e(o,{id:t.id,label:t?.label,relativePercentage:(i.length-l)/i.length*100,percentageSymbol:!0,respondentCount:t.respondentCount,checked:!0,slotProps:{graphBar:{barColor:n.custom.palette.purple[100]},listItem:{sx:{marginBottom:0}}},hideCheckbox:!0,hideUnitColumn1:!0,hideUnitColumn2:!0,icon:e(a,{name:`number-${(l+1).toString()}`,sx:{color:n.custom.palette.icon.secondary}}),animated:!0},t.id)},t.id))},d=({data:a})=>{const i=t();return a.map((t,a)=>e(r,{children:e(o,{id:t.id,label:t.label,relativePercentage:t.relativePercentage,value:t.value,percentageSymbol:!0,respondentCount:t.respondentCount,checked:!0,slotProps:{graphBar:{barColor:i.custom.palette.purple[100]},listItem:{sx:{marginBottom:0}}},hideCheckbox:!0,hideIcon:!0,animated:!0,compact:!0},t.id)},t.id))},m=({data:a})=>{const i=t();return a.map((t,a)=>e(r,{children:e(o,{id:t.id,label:t.label,relativePercentage:t.relativePercentage,value:t.value,percentageSymbol:!0,respondentCount:t.respondentCount,checked:!0,slotProps:{graphBar:{barColor:i.custom.palette.purple[100]},listItem:{sx:{marginBottom:0}}},hideCheckbox:!0,icon:t.icon,animated:!0,compact:!0},t.id)},t.id))},c=({data:i})=>{const n=t();return i.map((t,l)=>e(r,{children:e(o,{id:t.id,label:t.label,relativePercentage:(i.length-l)/i.length*100,hideUnitColumn2:!0,percentageSymbol:!0,value:t.value,icon:e(a,{name:`number-${l+1}`}),hideCheckbox:!0,compact:!0,checked:!0,slotProps:{graphBar:{barColor:"positive"===t.sentiment?n.custom.palette.data.sentimentPositive:n.custom.palette.data.sentimentNegative},unitText2:{sx:{width:"unset",maxWidth:42,flexShrink:1}},icon:{sx:{color:"positive"===t.sentiment?n.custom.palette.data.sentimentVeryPositive:n.custom.palette.data.sentimentVeryNegative}},graphBarTypography:{weight:"bold",sx:{color:n.custom.palette.red[1e3]}},listItem:{sx:{marginBottom:0}}}})},t.id))};export{m as MiniEmojiGraph,l as MiniLikertGraph,c as MiniOpenQuestionGraph,d as MiniPunchGraph,p as MiniRankGraph,s as MiniSliderGraph};