UIKit/lib/components/theme.ts

613 lines
21 KiB
TypeScript
Raw Normal View History

2023-08-14 12:25:19 +00:00
import { createTheme } from "@mui/material";
export const penaMuiTheme = createTheme({
breakpoints: {
values: {
xs: 300,
sm: 560,
md: 900,
lg: 1200,
xl: 1536,
},
},
palette: {
mode: "light",
primary: {
main: "#000000",
},
secondary: {
2023-08-22 09:31:00 +00:00
main: "#252734",
2023-08-14 12:25:19 +00:00
},
text: {
primary: "#000000",
secondary: "#7E2AEA",
},
background: {
default: "#F2F3F7",
},
2023-08-21 13:37:25 +00:00
purple: {
2023-08-24 12:44:51 +00:00
main: "#7E2AEA",
2023-08-28 12:57:28 +00:00
dark: "#581CA7",
light: "#944FEE",
2023-08-14 12:25:19 +00:00
},
2023-08-21 13:37:25 +00:00
bg: {
2023-08-28 12:57:28 +00:00
main: "#333647",
dark: "#252734",
2023-08-14 12:25:19 +00:00
},
2023-08-21 13:37:25 +00:00
gray: {
2023-08-28 12:57:28 +00:00
main: "#9A9AAF",
dark: "#4D4D4D",
2023-08-14 12:25:19 +00:00
},
orange: {
main: "#FB5607",
2023-08-21 11:10:34 +00:00
light: "#FC712F",
2023-08-14 12:25:19 +00:00
},
},
components: {
MuiButton: {
variants: [
{
2023-08-21 11:10:34 +00:00
props: { variant: "pena-contained-dark" },
2023-08-14 12:25:19 +00:00
style: ({ theme }) => theme.unstable_sx({
2023-08-14 14:09:38 +00:00
minWidth: "180px",
py: "9px",
2023-08-21 11:10:34 +00:00
px: "43px",
2023-08-14 12:25:19 +00:00
borderRadius: "8px",
boxShadow: "none",
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
2023-08-14 14:09:38 +00:00
color: "white",
2023-08-28 12:57:28 +00:00
backgroundColor: theme.palette.purple.main,
border: `1px solid ${theme.palette.purple.main}`,
2023-08-14 14:09:38 +00:00
"&:hover": {
2023-08-28 12:57:28 +00:00
color: "white",
2023-08-24 12:44:51 +00:00
backgroundColor: theme.palette.purple.light,
border: `1px solid ${theme.palette.purple.light}`,
2023-08-14 14:09:38 +00:00
},
"&:active": {
2023-08-24 12:44:51 +00:00
color: theme.palette.purple.main,
2023-08-28 12:57:28 +00:00
backgroundColor: "white",
border: `1px solid ${theme.palette.purple.main}`,
2023-08-14 14:09:38 +00:00
}
}),
},
{
2023-08-21 11:10:34 +00:00
props: { variant: "pena-outlined-dark" },
2023-08-14 14:09:38 +00:00
style: ({ theme }) => theme.unstable_sx({
minWidth: "180px",
py: "9px",
2023-08-21 11:10:34 +00:00
px: "43px",
2023-08-14 14:09:38 +00:00
borderRadius: "8px",
boxShadow: "none",
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
color: "white",
2023-08-28 12:57:28 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
border: `1px solid white`,
2023-08-14 14:09:38 +00:00
"&:hover": {
2023-08-28 12:57:28 +00:00
color: "white",
2023-08-21 13:37:25 +00:00
backgroundColor: theme.palette.bg.dark,
2023-08-28 12:57:28 +00:00
border: `1px solid white`,
2023-08-14 14:09:38 +00:00
},
"&:active": {
2023-08-28 12:57:28 +00:00
color: "white",
2023-08-24 12:44:51 +00:00
backgroundColor: theme.palette.purple.main,
2023-08-28 12:57:28 +00:00
border: `1px solid ${theme.palette.purple.main}`,
2023-08-14 14:09:38 +00:00
}
}),
},
2023-08-21 11:10:34 +00:00
{
props: { variant: "pena-contained-light" },
style: ({ theme }) => theme.unstable_sx({
minWidth: "180px",
py: "9px",
px: "43px",
borderRadius: "8px",
boxShadow: "none",
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
2023-08-21 13:37:25 +00:00
color: theme.palette.bg.dark,
2023-08-28 12:57:28 +00:00
backgroundColor: "white",
border: `1px solid white`,
2023-08-21 11:10:34 +00:00
"&:hover": {
2023-08-28 12:57:28 +00:00
color: theme.palette.bg.dark,
2023-08-21 11:10:34 +00:00
backgroundColor: theme.palette.background.default,
2023-08-23 12:18:11 +00:00
border: `1px solid ${theme.palette.background.default}`,
2023-08-21 11:10:34 +00:00
},
"&:active": {
color: "white",
2023-08-28 12:57:28 +00:00
backgroundColor: "black",
2023-08-21 11:10:34 +00:00
border: `1px solid black`,
}
}),
},
{
props: { variant: "pena-outlined-light" },
style: ({ theme }) => theme.unstable_sx({
minWidth: "180px",
py: "9px",
px: "43px",
borderRadius: "8px",
boxShadow: "none",
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
color: "white",
2023-08-28 12:57:28 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
border: `1px solid white`,
2023-08-21 11:10:34 +00:00
"&:hover": {
2023-08-28 12:57:28 +00:00
color: "white",
2023-08-21 11:10:34 +00:00
backgroundColor: "#581CA7",
2023-08-28 12:57:28 +00:00
border: `1px solid white`,
2023-08-21 11:10:34 +00:00
},
"&:active": {
2023-08-28 12:57:28 +00:00
color: "white",
2023-08-21 11:10:34 +00:00
backgroundColor: "black",
2023-08-28 12:57:28 +00:00
border: `1px solid black`,
2023-08-21 11:10:34 +00:00
}
}),
},
{
props: { variant: "pena-outlined-purple" },
style: ({ theme }) => theme.unstable_sx({
minWidth: "180px",
py: "9px",
px: "43px",
borderRadius: "8px",
boxShadow: "none",
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
2023-08-24 12:44:51 +00:00
color: theme.palette.purple.main,
2023-08-28 12:57:28 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
border: `1px solid ${theme.palette.purple.main}`,
2023-08-21 11:10:34 +00:00
"&:hover": {
2023-08-28 12:57:28 +00:00
color: theme.palette.purple.main,
2023-08-21 11:10:34 +00:00
backgroundColor: theme.palette.background.default,
2023-08-28 12:57:28 +00:00
border: `1px solid ${theme.palette.purple.main}`,
2023-08-21 11:10:34 +00:00
},
"&:active": {
color: "white",
2023-08-28 12:57:28 +00:00
backgroundColor: theme.palette.purple.dark,
border: `1px solid ${theme.palette.purple.dark}`,
2023-08-21 11:10:34 +00:00
}
}),
},
{
props: { variant: "pena-navitem-dark" },
style: ({ theme }) => theme.unstable_sx({
p: 0,
boxShadow: "none",
fontSize: "16px",
lineHeight: "20px",
fontWeight: 500,
textTransform: "none",
2023-09-04 14:13:14 +00:00
whiteSpace: "nowrap",
2023-08-21 11:10:34 +00:00
color: "white",
2023-08-28 12:57:28 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
2023-08-21 11:10:34 +00:00
"&:hover": {
2023-08-24 12:44:51 +00:00
color: theme.palette.purple.light,
2023-08-22 12:39:03 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
2023-08-21 11:10:34 +00:00
},
"&:active": {
2023-08-24 12:44:51 +00:00
color: theme.palette.purple.light,
2023-08-28 12:57:28 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
2023-08-21 11:10:34 +00:00
}
}),
},
{
props: { variant: "pena-navitem-light" },
style: ({ theme }) => theme.unstable_sx({
p: 0,
boxShadow: "none",
fontSize: "16px",
lineHeight: "20px",
fontWeight: 500,
textTransform: "none",
2023-09-04 14:13:14 +00:00
whiteSpace: "nowrap",
2023-08-21 11:10:34 +00:00
color: "black",
2023-08-28 12:57:28 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
2023-08-21 11:10:34 +00:00
"&:hover": {
2023-08-24 12:44:51 +00:00
color: theme.palette.purple.main,
2023-08-22 12:39:03 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
2023-08-21 11:10:34 +00:00
},
"&:active": {
2023-08-24 12:44:51 +00:00
color: theme.palette.purple.main,
2023-08-28 12:57:28 +00:00
backgroundColor: "rgb(0 0 0 / 0)",
}
}),
},
{
2023-09-01 10:18:57 +00:00
props: { variant: "pena-contained-white1" },
2023-08-28 12:57:28 +00:00
style: ({ theme }) => theme.unstable_sx({
minWidth: "180px",
py: "9px",
px: "43px",
borderRadius: "8px",
boxShadow: "none",
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
color: theme.palette.purple.main,
backgroundColor: theme.palette.background.default,
border: `1px solid ${theme.palette.gray.main}`,
"&:hover": {
color: "white",
backgroundColor: theme.palette.purple.main,
border: `1px solid ${theme.palette.purple.main}`,
},
"&:active": {
color: "white",
backgroundColor: "black",
border: `1px solid black`,
2023-08-21 11:10:34 +00:00
}
}),
},
2023-09-01 10:18:57 +00:00
{
props: { variant: "pena-contained-white2" },
style: ({ theme }) => theme.unstable_sx({
minWidth: "180px",
py: "9px",
px: "43px",
borderRadius: "8px",
boxShadow: "none",
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
color: "black",
backgroundColor: theme.palette.background.default,
border: `1px solid ${theme.palette.background.default}`,
"&:hover": {
color: "white",
backgroundColor: theme.palette.purple.light,
border: `1px solid white`,
},
"&:active": {
color: theme.palette.purple.main,
backgroundColor: "white",
border: `1px solid ${theme.palette.purple.light}`,
}
}),
},
2023-09-04 13:00:45 +00:00
{
props: {
variant: "pena-text",
},
style: ({ theme }) => ({
color: theme.palette.purple.main,
padding: 0,
textTransform: "none",
textDecoration: "underline",
textUnderlineOffset: "7px",
fontSize: "16px",
fontWeight: 500,
lineHeight: "20px",
}),
},
2023-08-14 14:09:38 +00:00
],
defaultProps: {
disableTouchRipple: true,
},
2023-08-14 12:25:19 +00:00
},
2023-08-21 11:10:34 +00:00
MuiIconButton: {
defaultProps: {
disableTouchRipple: true,
},
},
2023-08-14 12:25:19 +00:00
MuiTypography: {
defaultProps: {
variantMapping: {
p1: "p",
2023-09-01 12:27:35 +00:00
t1: "p",
"pena-h1": "h1",
"pena-card-header1": "h5",
2023-08-14 12:25:19 +00:00
}
},
},
2023-08-22 10:59:11 +00:00
MuiAlert: {
styleOverrides: {
filledError: {
backgroundColor: "#FB5607",
},
root: {
borderRadius: "8px",
}
}
},
2023-08-30 15:52:27 +00:00
MuiPagination: {
variants: [
{
props: { variant: "pena-pagination" },
style: {
marginRight: "-15px",
marginLeft: "-15px",
"& .MuiPaginationItem-root": {
height: "30px",
width: "30px",
minWidth: "30px",
marginLeft: "5px",
marginRight: "5px",
backgroundColor: "white",
color: "black",
fontSize: "16px",
lineHeight: "20px",
fontWeight: 400,
borderRadius: "5px",
"&.Mui-selected": {
backgroundColor: "white",
color: "#7E2AEA",
fontWeight: 500,
},
"&:hover": {
backgroundColor: "#ffffff55",
},
"&:active": {
backgroundColor: "#7F2CEA",
color: "white",
},
boxShadow: `
0px 77.2727px 238.773px rgba(210, 208, 225, 0.24),
0px 32.2827px 99.7535px rgba(210, 208, 225, 0.172525),
0px 17.2599px 53.333px rgba(210, 208, 225, 0.143066),
0px 9.67574px 29.8981px rgba(210, 208, 225, 0.12),
0px 5.13872px 15.8786px rgba(210, 208, 225, 0.0969343),
0px 2.13833px 6.60745px rgba(210, 208, 225, 0.0674749)
`,
},
"& .MuiPaginationItem-previousNext": {
backgroundColor: "#7E2AEA",
color: "white",
marginLeft: "15px",
marginRight: "15px",
"&:hover": {
backgroundColor: "#995DED",
},
},
}
}
],
},
2023-09-01 12:27:35 +00:00
MuiSwitch: {
styleOverrides: {
root: {
color: "#7E2AEA",
height: "50px",
width: "69px",
"& .MuiSwitch-switchBase.Mui-checked+.MuiSwitch-track": {
backgroundColor: "#7E2AEA",
opacity: 1,
},
},
track: {
height: "12px",
alignSelf: "center",
backgroundColor: "#00000000",
opacity: 1,
border: "1px solid #9A9AAF",
},
thumb: {
height: "32px",
width: "32px",
border: `6px solid #7E2AEA`,
backgroundColor: "white",
boxShadow: `0px 0px 0px 3px white,
0px 4px 4px 3px #C3C8DD
`,
"&:focus, &:hover, &.Mui-active, &.Mui-focusVisible": {
boxShadow: `0px 0px 0px 3px white,
0px 4px 4px 3px #C3C8DD
`,
},
},
},
},
2023-08-14 14:09:38 +00:00
},
2023-08-21 11:10:34 +00:00
typography: palette => ({
2023-08-14 14:09:38 +00:00
h5: {
fontSize: "24px",
lineHeight: "28.44px",
fontWeight: 500,
},
button: {
fontSize: "18px",
lineHeight: "24px",
fontWeight: 400,
textTransform: "none",
},
body1: {
fontSize: "18px",
lineHeight: "21.33px",
fontWeight: 400,
},
body2: {
fontSize: "16px",
lineHeight: "20px",
fontWeight: 500,
},
p1: {
fontSize: "20px",
lineHeight: "24px",
fontWeight: 500,
},
price: {
fontWeight: 500,
fontSize: "20px",
lineHeight: "24px",
2023-08-21 13:37:25 +00:00
color: palette.gray.dark,
2023-08-14 14:09:38 +00:00
},
oldPrice: {
fontWeight: 400,
fontSize: "18px",
lineHeight: "21px",
textDecorationLine: "line-through",
2023-08-21 11:10:34 +00:00
color: palette.orange.main,
2023-08-14 14:09:38 +00:00
},
2023-09-01 12:27:35 +00:00
t1: {
display: "block",
fontWeight: 400,
fontSize: "18px",
lineHeight: "21.33px",
2023-09-04 13:00:45 +00:00
},
2023-08-14 14:09:38 +00:00
fontFamily: [
"Rubik",
"-apple-system",
"BlinkMacSystemFont",
'"Segoe UI"',
'"Helvetica Neue"',
"Arial",
"sans-serif",
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
].join(","),
2023-08-21 11:10:34 +00:00
}),
2023-08-14 12:25:19 +00:00
});
2023-09-01 12:27:35 +00:00
penaMuiTheme.typography["pena-h1"] = {
fontSize: "70px",
fontWeight: 500,
lineHeight: "100%",
[penaMuiTheme.breakpoints.down("md")]: {
fontSize: "36px",
lineHeight: "100%",
},
};
penaMuiTheme.typography["pena-h3"] = {
color: "#000000",
fontWeight: 500,
fontSize: "36px",
lineHeight: "100%",
[penaMuiTheme.breakpoints.down("md")]: {
fontSize: "30px",
lineHeight: "100%",
},
};
penaMuiTheme.typography["pena-card-header1"] = {
fontWeight: 500,
fontSize: "24px",
lineHeight: "100%",
[penaMuiTheme.breakpoints.down("md")]: {
fontSize: "21px",
lineHeight: "100%",
},
};
2023-08-22 09:44:16 +00:00
penaMuiTheme.typography.h2 = {
fontSize: "70px",
lineHeight: "70px",
fontWeight: 500,
[penaMuiTheme.breakpoints.down("md")]: {
fontSize: "42px",
lineHeight: "50px",
}
};
penaMuiTheme.typography.h4 = {
fontSize: "36px",
lineHeight: "42.66px",
fontWeight: 500,
[penaMuiTheme.breakpoints.down("md")]: {
fontSize: "24px",
lineHeight: "28.44px",
}
};
penaMuiTheme.typography.infographic = {
fontSize: "80px",
lineHeight: "94.8px",
fontWeight: 400,
[penaMuiTheme.breakpoints.down("md")]: {
fontSize: "50px",
lineHeight: "59px",
fontWeight: 400,
}
};
2023-08-14 12:25:19 +00:00
declare module '@mui/material/Button' {
interface ButtonPropsVariantOverrides {
2023-08-21 11:10:34 +00:00
"pena-contained-light": true;
"pena-outlined-light": true;
"pena-contained-dark": true;
"pena-outlined-dark": true;
"pena-outlined-purple": true;
"pena-navitem-light": true;
"pena-navitem-dark": true;
2023-09-01 10:18:57 +00:00
"pena-contained-white1": true;
"pena-contained-white2": true;
2023-09-04 13:00:45 +00:00
"pena-text": true;
2023-08-14 12:25:19 +00:00
}
}
2023-08-30 15:52:27 +00:00
declare module '@mui/material/Pagination' {
interface PaginationPropsVariantOverrides {
"pena-pagination": true;
}
}
2023-08-14 12:25:19 +00:00
declare module "@mui/material/styles" {
interface Palette {
2023-08-21 13:37:25 +00:00
purple: Palette["primary"],
bg: Palette["primary"],
gray: Palette["primary"],
2023-08-14 12:25:19 +00:00
orange: Palette["primary"],
}
interface PaletteOptions {
2023-08-21 13:37:25 +00:00
purple?: PaletteOptions["primary"],
bg?: PaletteOptions["primary"],
gray?: PaletteOptions["primary"],
2023-08-14 12:25:19 +00:00
orange?: PaletteOptions["primary"],
}
interface TypographyVariants {
infographic: React.CSSProperties;
p1: React.CSSProperties;
price: React.CSSProperties;
oldPrice: React.CSSProperties;
2023-09-01 12:30:37 +00:00
t1: React.CSSProperties;
2023-09-01 12:27:35 +00:00
"pena-card-header1": React.CSSProperties;
"pena-h1": React.CSSProperties;
"pena-h3": React.CSSProperties;
2023-08-14 12:25:19 +00:00
}
interface TypographyVariantsOptions {
infographic?: React.CSSProperties;
p1?: React.CSSProperties;
price?: React.CSSProperties;
oldPrice?: React.CSSProperties;
2023-09-01 12:30:37 +00:00
t1?: React.CSSProperties;
2023-09-01 12:27:35 +00:00
"pena-card-header1"?: React.CSSProperties;
"pena-h1"?: React.CSSProperties;
"pena-h3"?: React.CSSProperties;
2023-08-14 12:25:19 +00:00
}
}
declare module "@mui/material/Typography" {
interface TypographyPropsVariantOverrides {
infographic: true;
p1: true;
price: true;
oldPrice: true;
2023-09-01 12:27:35 +00:00
t1: true;
"pena-card-header1": true;
"pena-h1": true;
"pena-h3": true;
}
}
declare module "@mui/material/Switch" {
interface SwitchPropsVariantOverrides {
"pena-switch": true;
2023-08-14 12:25:19 +00:00
}
}