@useloops/design-system
Version:
The official React based Loops design system
2 lines (1 loc) • 1.34 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/material"),a=require("@mui/material/Chip"),r=require("../../../BrandCore/Icon/Icon.js");function i(e){return e&&e.__esModule?e:{default:e}}var s=i(a);const o=e=>{switch(e){case"xs":return 16;case"sm":case"md":case"lg":default:return 24;case"xl":return 32}},d=t.styled(s.default)(({theme:e,sizing:t})=>({height:o(t||"lg"),paddingLeft:e.spacing(e.custom.padding.xs),paddingRight:e.spacing(e.custom.padding.xs),borderRadius:e.spacing(e.custom.radius.sm),border:`1px solid ${e.custom.palette.stroke.default}`,backgroundColor:e.custom.palette.surface.default,margin:0,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:e.spacing(e.custom.padding.xs),paddingRight:e.spacing(e.custom.padding.xs)},"&:hover":{backgroundColor:e.custom.palette.surface.default},"&:active":{backgroundColor:e.custom.palette.surface.default},"& .MuiChip-deleteIcon":{backgroundColor:e.custom.palette.surface.transparent,color:e.custom.palette.icon.primary,width:e.spacing(2),height:e.spacing(2),borderRadius:"50%",margin:0,padding:3},"&.MuiAutocomplete-tag":{margin:0,maxWidth:180}}));exports.StyledChip=d,exports.default=t=>e.jsx(d,{...t,deleteIcon:e.jsx(r.default,{name:"close"})}),exports.getChipHeight=o;