UNPKG

@useloops/design-system

Version:

The official React based Loops design system

2 lines (1 loc) 1.15 kB
import{styled as t,Chip as e}from"@mui/material";import{typographyVariantMap as a}from"../utils/typography.util.js";const o=(t,e)=>"light"===e?{fontWeight:400}:{fontWeight:500,textTransform:"uppercase"},p=(t,e,a)=>{switch(e){case"peach":return{background:t.custom.palette.peach[100],color:"heavy"===a?t.custom.palette.peach[1e3]:t.custom.palette.peach[800]};case"peachDark":return{background:t.custom.palette.peach[800],color:t.custom.palette.peach[0]};case"purple":return{background:t.custom.palette.purple[100],color:"heavy"===a?t.custom.palette.purple[1e3]:t.custom.palette.purple[800]};default:return{background:t.custom.palette.neutral[100],color:"heavy"===a?t.custom.palette.neutral[1e3]:t.custom.palette.neutral[800]}}},r=t(e,{shouldForwardProp:t=>!["variation","weight"].includes(t)})(({theme:t,variation:e,weight:r})=>({borderRadius:t.spacing(t.custom.radius.md),height:28,padding:`${t.spacing(t.custom.padding.xs)} ${t.spacing(t.custom.padding.sm)}`,...p(t,e,r),"& .MuiChip-label":{fontSize:`${a.sm.body.sm}`,padding:0,...o(0,r)},"& .MuiChip-icon":{width:"0.8em",height:"0.8em",marginRight:4,...p(t,e,r),...o(0,r)}}));export{r as StyledLabel};