-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[charts] Add missing
themeAugmentation
in pro plan (#14313)
Co-authored-by: Jose Quintas <juniorquintas@gmail.com> Co-authored-by: alex <alex.fauquette@gmail.com>
- Loading branch information
1 parent
2c8d5fc
commit 0c30a6f
Showing
31 changed files
with
199 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/x-charts-pro/src/themeAugmentation/components.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentsProps, ComponentsOverrides } from '@mui/material/styles'; | ||
|
||
export interface ChartsProComponents<Theme = unknown> { | ||
// BarChartPro components | ||
MuiBarChartPro?: { | ||
defaultProps?: ComponentsProps['MuiBarChartPro']; | ||
}; | ||
// LineChartPro components | ||
MuiLineChartPro?: { | ||
defaultProps?: ComponentsProps['MuiLineChartPro']; | ||
}; | ||
// Heatmap components | ||
MuiHeatmap?: { | ||
defaultProps?: ComponentsProps['MuiHeatmap']; | ||
styleOverrides?: ComponentsOverrides<Theme>['MuiHeatmap']; | ||
}; | ||
// ScatterChartPro components | ||
MuiScatterChartPro?: { | ||
defaultProps?: ComponentsProps['MuiScatterChartPro']; | ||
}; | ||
} | ||
|
||
declare module '@mui/material/styles' { | ||
interface Components<Theme = unknown> extends ChartsProComponents<Theme> {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Prefer to use `import type {} from '@mui/x-charts-pro/themeAugmentation';` instead to avoid importing an empty file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from '@mui/x-charts/themeAugmentation'; | ||
export * from './overrides'; | ||
export * from './props'; | ||
export * from './components'; |
13 changes: 13 additions & 0 deletions
13
packages/x-charts-pro/src/themeAugmentation/overrides.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { HeatmapClassKey } from '../Heatmap'; | ||
|
||
export interface ChartsProComponentNameToClassKey { | ||
// Heatmap components | ||
MuiHeatmap: HeatmapClassKey; | ||
} | ||
|
||
declare module '@mui/material/styles' { | ||
interface ComponentNameToClassKey extends ChartsProComponentNameToClassKey {} | ||
} | ||
|
||
// disable automatic export | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ScatterChartProProps } from '../ScatterChartPro'; | ||
import { BarChartProProps } from '../BarChartPro'; | ||
import { HeatmapProps } from '../Heatmap/Heatmap'; | ||
import { LineChartProProps } from '../LineChartPro'; | ||
|
||
export interface ChartsProComponentsPropsList { | ||
// BarChartPro components | ||
MuiBarChartPro: BarChartProProps; | ||
// LineChartPro components | ||
MuiLineChartPro: LineChartProProps; | ||
// Heatmap components | ||
MuiHeatmap: HeatmapProps; | ||
// ScatterChartPro components | ||
MuiScatterChartPro: ScatterChartProProps; | ||
} | ||
|
||
declare module '@mui/material/styles' { | ||
interface ComponentsPropsList extends ChartsProComponentsPropsList {} | ||
} | ||
|
||
// disable automatic export | ||
export {}; |
39 changes: 39 additions & 0 deletions
39
packages/x-charts-pro/src/themeAugmentation/themeAugmentation.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { createTheme } from '@mui/material/styles'; | ||
|
||
createTheme({ | ||
components: { | ||
MuiBarChartPro: { | ||
defaultProps: { | ||
title: 'toto', | ||
// @ts-expect-error invalid MuiChartsAxis prop | ||
someRandomProp: true, | ||
}, | ||
}, | ||
MuiLineChartPro: { | ||
defaultProps: { | ||
title: 'toto', | ||
// @ts-expect-error invalid MuiChartsAxis prop | ||
someRandomProp: true, | ||
}, | ||
}, | ||
MuiScatterChartPro: { | ||
defaultProps: { | ||
title: 'toto', | ||
// @ts-expect-error invalid MuiChartsAxis prop | ||
someRandomProp: true, | ||
}, | ||
}, | ||
MuiHeatmap: { | ||
defaultProps: { | ||
title: 'toto', | ||
// @ts-expect-error invalid MuiChartsAxis prop | ||
someRandomProp: true, | ||
}, | ||
styleOverrides: { | ||
highlighted: { backgroundColor: 'red' }, | ||
// @ts-expect-error invalid MuiChartsAxis class key | ||
constent: { color: 'red' }, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.