@useloops/design-system
Version:
The official React based Loops design system
2 lines (1 loc) • 4.76 kB
JavaScript
"use strict";var t=require("@mui/material"),e=require("../systems/BrandCore/colorRamps.js"),a=require("../systems/BrandCore/primitiveColor.js"),n=require("../systems/BrandCore/primitiveVariables.js"),o=require("../systems/BrandCore/semanticColor.js"),r=require("../systems/BrandCore/typography.js"),i=require("../systems/WebCore/utils/typography.util.js");const s="https://useloops-public.s3.eu-west-2.amazonaws.com/public/fonts/",l=(t,e)=>Object.fromEntries(Object.entries(t).map(([t,a])=>[t,a*e+"px"]));exports.customTheme=(p,d,m)=>t.createTheme({direction:m,p:l(n.padding,n.base),m:l(n.margin,n.base),r:l(n.radius,n.base),custom:{palette:{black:"#000000",white:"#ffffff",neutral:e.neutralRamp[p],neutralAlpha:"light"===p?a.neutralAlpha:a.darkNeutralAlpha,purple:e.purpleRamp[p],red:e.redRamp[p],peach:e.peachRamp[p],yellow:e.yellowRamp[p],blue:e.blueRamp[p],green:e.greenRamp[p],icon:o.semantic[p].icon,interaction:o.semantic[p].interaction,stroke:o.semantic[p].stroke,surface:o.semantic[p].surface,text:o.semantic[p].text,input:o.semantic[p].input,skeleton:o.semantic[p].skeleton,data:o.semantic[p].data,body:o.semantic[p].surface.default},margin:n.margin,padding:n.padding,radius:n.radius,elevation:n.elevation,elevationFilter:n.elevationFilter,boxShadow:n.boxShadow,easing:n.easing,typography:i.typographyVariantMap[d]},palette:{mode:p,primary:{main:a.purple[500]}},spacing:n.base,shape:{borderRadius:n.base,hotspot:{default:12,active:24}},breakpoints:{values:n.breakpoints},typography:{fontFamily:`"${r.fonts.FoundersGrotesk.name}", "Helvetica", "sans-serif"`},components:{MuiTypography:{variants:i.typographyVariants(d),styleOverrides:{root:{color:o.semantic[p].text.primary,letterSpacing:0,lineHeight:"140%"}}},MuiCssBaseline:{styleOverrides:t=>`\n\t\t\t\t\tbody {\n\t\t\t\t\t\tbackground: ${t.custom.palette.body};\n\t\t\t\t\t\tmin-width: 320px;\n\t\t\t\t\t}\n\t\t\t\t\ta {\n\t\t\t\t\t\tcolor: inherit;\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\ttext-decoration: none;\n\t\t\t\t\t}\n\t\t\t\t\tb {\n\t\t\t\t\t\tfont-weight: 500;\n\t\t\t\t\t}\n @font-face {\n font-family: '${r.fonts.Domaine.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${r.fonts.Domaine.default.weight};\n src: url(${s}${r.fonts.Domaine.default.fileName}) format('woff2');\n }\n @font-face {\n font-family: '${r.fonts.Domaine.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${r.fonts.Domaine.bold.weight};\n src: url(${s}${r.fonts.Domaine.bold.fileName}) format('woff2');\n }\n @font-face {\n font-family: '${r.fonts.FoundersGrotesk.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${r.fonts.FoundersGrotesk.default.weight};\n src: url(${s}${r.fonts.FoundersGrotesk.default.fileName}) format('woff2');\n }\n @font-face {\n font-family: '${r.fonts.FoundersGrotesk.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${r.fonts.FoundersGrotesk.bold.weight};\n src: url(${s}${r.fonts.FoundersGrotesk.bold.fileName}) format('woff2');\n }\n `},MuiContainer:{defaultProps:{maxWidth:"xl",disableGutters:!0},styleOverrides:{root:{paddingLeft:16,paddingRight:16,[`@media (min-width: ${n.breakpoints.md}px)`]:{paddingLeft:24,paddingRight:24},[`@media (min-width: ${n.breakpoints.lg}px)`]:{paddingLeft:48,paddingRight:48}}}},MuiButtonBase:{defaultProps:{disableTouchRipple:!0,disableRipple:!0}},MuiButton:{defaultProps:{disableTouchRipple:!0,disableRipple:!0}},MuiTooltip:{styleOverrides:{arrow:({theme:{custom:t}})=>({color:t.palette.surface.overlay}),tooltip:({theme:{custom:t}})=>({backgroundColor:t.palette.surface.overlay,borderRadius:t.radius.md,color:t.palette.text.primary,backdropFilter:"blur(0)",filter:t.elevationFilter.overlay,fontFamily:r.fonts.FoundersGrotesk.name,fontSize:t.typography.body.sm,fontWeight:400,padding:`${t.padding.sm*n.base}px ${t.padding.md*n.base}px`})}},MuiAvatarGroup:{styleOverrides:{root:{flexDirection:"row"},avatar:({theme:{custom:t}})=>({border:`1px solid ${t.palette.stroke.default}`,marginLeft:0,marginRight:-8,":last-child":{marginLeft:"auto"}})}},MuiPaper:{styleOverrides:{root:({theme:{custom:t}})=>({backgroundColor:t.palette.surface.default})}}}});