Skip to content

Commit

Permalink
feat(odyssey-react-mui): increase default icon size to 16px; add ui t…
Browse files Browse the repository at this point in the history
…ype variant
  • Loading branch information
edburyenegren-okta committed Nov 16, 2022
1 parent 28c1276 commit 6577c33
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/odyssey-react-mui/src/theme/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export const components: ThemeOptions["components"] = {
outlineColor: "transparent",
outlineOffset: "0",
fontSize: theme.typography.body1.fontSize,
lineHeight: "1.14285714",
lineHeight: theme.typography.ui.lineHeight,
whiteSpace: "nowrap",

".MuiButton-root + &": {
Expand All @@ -328,7 +328,7 @@ export const components: ThemeOptions["components"] = {
},

".MuiButton-startIcon > *:nth-of-type(1)": {
fontSize: "1.14285714em",
fontSize: `${theme.typography.ui.lineHeight}em`,
},
}),
startIcon: ({ theme }) => ({
Expand Down Expand Up @@ -391,7 +391,7 @@ export const components: ThemeOptions["components"] = {
paddingBlock: theme.spacing(2),
paddingInline: theme.spacing(3),
fontSize: theme.typography.body1.fontSize,
lineHeight: "1.14285714",
lineHeight: theme.typography.ui.lineHeight,
borderRadius: "1.5em",
backgroundColor: theme.palette.grey[100],

Expand Down Expand Up @@ -443,7 +443,7 @@ export const components: ThemeOptions["components"] = {
},
MuiCircularProgress: {
defaultProps: {
// TODO: defaultProps cannot take a theme object; needs workaround
// TODO: defaultProps cannot take a theme object; matches theme.typography.ui.lineHeight
size: "1.14285714rem",
thickness: 8,
color: "primary",
Expand Down Expand Up @@ -627,7 +627,7 @@ export const components: ThemeOptions["components"] = {
styleOverrides: {
root: ({ theme }) => ({
color: theme.palette.text.primary,
lineHeight: "1.14285714",
lineHeight: theme.typography.ui.lineHeight,
fontSize: "1rem",
fontWeight: 600,
marginBottom: theme.spacing(2),
Expand Down Expand Up @@ -713,7 +713,7 @@ export const components: ThemeOptions["components"] = {
flex: "1",
width: "auto",
color: theme.palette.text.primary,
lineHeight: "1.14285714",
lineHeight: theme.typography.ui.lineHeight,
borderWidth: theme.mixins.borderWidth,
borderStyle: theme.mixins.borderStyle,
borderRadius: theme.mixins.borderRadius,
Expand Down Expand Up @@ -944,6 +944,11 @@ export const components: ThemeOptions["components"] = {
fontSize: "inherit",
color: "inherit",
},
styleOverrides: {
root: ({ theme }) => ({
fontSize: `${theme.typography.ui.lineHeight}em`,
}),
},
},
MuiTab: {
defaultProps: {
Expand Down Expand Up @@ -1018,7 +1023,7 @@ export const components: ThemeOptions["components"] = {
borderRadius: theme.mixins.borderRadius,
marginBlock: theme.spacing(0),
marginInline: theme.spacing(0),
lineHeight: "1.14285714",
lineHeight: theme.typography.ui.lineHeight,

"&:only-child": {
marginBlockEnd: 0,
Expand Down
6 changes: 6 additions & 0 deletions packages/odyssey-react-mui/src/theme/typography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,10 @@ export const typography: ThemeOptions["typography"] = {
lineHeight: Tokens.FontLineHeightHeading6,
marginBottom: Tokens.SpaceScale1,
},
ui: {
fontWeight: Number(Tokens.FontWeightNormal),
fontSize: Tokens.FontScale1,
lineHeight: Tokens.FontLineHeightUi,
letterSpacing: "initial",
},
};
3 changes: 3 additions & 0 deletions packages/odyssey-react-mui/src/theme/typography.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ declare module "@mui/material/styles" {
interface TypographyVariants {
kbd: CSSProperties;
legend: CSSProperties;
ui: CSSProperties;
}
interface TypographyVariantsOptions {
kbd?: CSSProperties;
legend?: CSSProperties;
ui: CSSProperties;
}
}

Expand All @@ -33,6 +35,7 @@ declare module "@mui/material/Typography" {
overline: false;
subtitle1: true; // Design may refer to this as "caption"
subtitle2: false;
ui: true;
default: true; // used by <Link>
monochrome: true; // used by <Link>
}
Expand Down

0 comments on commit 6577c33

Please sign in to comment.