UNPKG

@useloops/design-system

Version:

The official React based Loops design system

2 lines (1 loc) 4.63 kB
import{createTheme as t}from"@mui/material";import{greenRamp as e,blueRamp as o,yellowRamp as a,peachRamp as r,redRamp as n,purpleRamp as i,neutralRamp as s}from"../systems/BrandCore/colorRamps.js";import{purple as l,neutralAlpha as d,darkNeutralAlpha as p}from"../systems/BrandCore/primitiveColor.js";import{breakpoints as m,base as f,easing as u,boxShadow as c,elevationFilter as y,elevation as g,radius as h,padding as b,margin as w}from"../systems/BrandCore/primitiveVariables.js";import{semantic as $}from"../systems/BrandCore/semanticColor.js";import{fonts as v}from"../systems/BrandCore/typography.js";import{typographyVariants as k,typographyVariantMap as x}from"../systems/WebCore/utils/typography.util.js";const F="https://useloops-public.s3.eu-west-2.amazonaws.com/public/fonts/",C=(t,e)=>Object.fromEntries(Object.entries(t).map(([t,o])=>[t,o*e+"px"])),R=(R,G,B)=>t({direction:B,p:C(b,f),m:C(w,f),r:C(h,f),custom:{palette:{black:"#000000",white:"#ffffff",neutral:s[R],neutralAlpha:"light"===R?d:p,purple:i[R],red:n[R],peach:r[R],yellow:a[R],blue:o[R],green:e[R],icon:$[R].icon,interaction:$[R].interaction,stroke:$[R].stroke,surface:$[R].surface,text:$[R].text,input:$[R].input,skeleton:$[R].skeleton,data:$[R].data,body:$[R].surface.default},margin:w,padding:b,radius:h,elevation:g,elevationFilter:y,boxShadow:c,easing:u,typography:x[G]},palette:{mode:R,primary:{main:l[500]}},spacing:f,shape:{borderRadius:f,hotspot:{default:12,active:24}},breakpoints:{values:m},typography:{fontFamily:`"${v.FoundersGrotesk.name}", "Helvetica", "sans-serif"`},components:{MuiTypography:{variants:k(G),styleOverrides:{root:{color:$[R].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: '${v.Domaine.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${v.Domaine.default.weight};\n src: url(${F}${v.Domaine.default.fileName}) format('woff2');\n }\n @font-face {\n font-family: '${v.Domaine.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${v.Domaine.bold.weight};\n src: url(${F}${v.Domaine.bold.fileName}) format('woff2');\n }\n @font-face {\n font-family: '${v.FoundersGrotesk.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${v.FoundersGrotesk.default.weight};\n src: url(${F}${v.FoundersGrotesk.default.fileName}) format('woff2');\n }\n @font-face {\n font-family: '${v.FoundersGrotesk.name}';\n font-style: normal;\n font-display: swap;\n font-weight: ${v.FoundersGrotesk.bold.weight};\n src: url(${F}${v.FoundersGrotesk.bold.fileName}) format('woff2');\n }\n `},MuiContainer:{defaultProps:{maxWidth:"xl",disableGutters:!0},styleOverrides:{root:{paddingLeft:16,paddingRight:16,[`@media (min-width: ${m.md}px)`]:{paddingLeft:24,paddingRight:24},[`@media (min-width: ${m.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:v.FoundersGrotesk.name,fontSize:t.typography.body.sm,fontWeight:400,padding:`${t.padding.sm*f}px ${t.padding.md*f}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})}}}});export{R as customTheme};