import { Story, Meta } from '@storybook/react'; import { useTheme, makeStyles } from '@mui/styles'; import type { Palette } from '@mui/material/styles/createPalette'; import Tooltip from '@mui/material/Tooltip'; import Typography from '@mui/material/Typography'; import Grid from '@mui/material/Grid'; import Box from '@mui/material/Box'; import map from 'lodash/map'; const size = '50px'; const createClasses = makeStyles(theme => ({ title: { marginBottom: theme.spacing(3) }, block: { height: size } })); const colorsMap: { [key in keyof Partial]: number[]; } = { primary: [100, 200, 300, 400, 500, 600], secondary: [100, 200, 300, 400, 500, 600, 700], error: [200, 500, 600], success: [200, 500], warning: [500] }; const PaletteTemplate = () => { const classes = createClasses(); const { palette } = useTheme(); return ( Hover the colors to see their value: {map(colorsMap, (value: number[], key: keyof Palette) => { return ( {map(palette[key] as Record, (val, k) => { if (!value.includes(Number(k))) { return null; } const title = `${key} ${k}: ${val}`; return ( ); })} ); })} Charts (special colors):  {map(palette.specialColors, value => { return ( ); })} ); }; export default { title: 'Foundations', argTypes: {} } as Meta; const Template: Story = () => ; export const Colors = Template.bind({});