Skip to content

Commit

Permalink
[test] Run TypeScript module augmentation tests for Joy UI in CI (mui…
Browse files Browse the repository at this point in the history
…#33667)

* run typescript module augmentation for MUI Joy

* fix(mui-joy): CssVarsProvider spec
  • Loading branch information
ZeeshanTamboli authored and Daniel Rabe committed Nov 29, 2022
1 parent a967633 commit 69cbc48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ jobs:
command: |
yarn workspace @mui/material typescript:module-augmentation
yarn workspace @mui/base typescript:module-augmentation
yarn workspace @mui/joy typescript:module-augmentation
- restore_cache:
name: Restore generated declaration files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CssVarsProvider, extendTheme } from '@mui/joy/styles';
<CssVarsProvider
theme={extendTheme({
fontFamily: {
default: '"Rubik", sans-serif',
body: '"Rubik", sans-serif',
},
// @ts-expect-error 'color' does not exist in JoyTheme
color: {},
Expand All @@ -26,16 +26,16 @@ declare module '@mui/joy/styles' {
}
}

// extends ColorSystems
// extends ColorSystem
declare module '@mui/joy/styles' {
interface ColorSystem {
bgcolor: string;
}
}

// extends BorderRadius
// extends Radius
declare module '@mui/joy/styles' {
interface BorderRadius {
interface Radius {
xxxs: string;
}
}
Expand Down Expand Up @@ -68,7 +68,7 @@ declare module '@mui/joy/styles' {
}
}

// extends TypographySystems
// extends TypographySystem
declare module '@mui/joy/styles' {
interface TypographySystem {
ads: React.CSSProperties;
Expand All @@ -89,7 +89,7 @@ const extendedTheme = extendTheme({
bgcolor: '',
},
},
borderRadius: {
radius: {
xxxs: '',
},
fontSize: {
Expand Down Expand Up @@ -123,7 +123,7 @@ const extendedTheme = extendTheme({
height: 48,
});
}
if (variant === 'contained') {
if (variant === 'outlined') {
styles.push(theme.typography.body1);
}
return styles;
Expand All @@ -135,7 +135,7 @@ const extendedTheme = extendTheme({
thumb: ({ ownerState, theme }) => [
ownerState.color === 'primary' && {
'&:hover': {
backgroundColor: theme.vars.palette.primary.containedHoverBg,
backgroundColor: theme.vars.palette.primary.outlinedHoverBg,
},
},
],
Expand Down

0 comments on commit 69cbc48

Please sign in to comment.