import React from 'react';
import { StoryFn } from '@storybook/react-webpack5';
import { Box } from '@mui/material';
import { styled } from '@mui/material/styles';
import Typography from '@/components/Typography';
import { variantArray, variants } from './const';
import TypographyGroup from './TypographyGroup';
export const AllVariants = () => (
<>
AI will be the new standard of care. 123456789
By Lunit. With AI, we aim to make data-driven medicine
the new standard of care.
>
}
variants={variants.body}
/>
AI will be the new standard of care. 123456789
By Lunit. With AI, we aim to make data-driven medicine
the new standard of care.
>
}
variants={variants.smallBody}
/>
>
);
export default {
title: 'Foundation/Typography',
component: Typography,
argTypes: {
variant: {
control: 'select',
options: variantArray,
},
},
};
const TypographyTemplate: StoryFn = (args) => {
const { variant, children } = args;
return (
{children}
);
};
export const TypographyComponent = {
render: TypographyTemplate,
args: {
variant: 'body1_16_regular',
children:
'AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.',
},
};
const SXTemplate: StoryFn = (args) => {
const { variant, children } = args;
return {children};
};
export const SXProps = {
render: SXTemplate,
args: {
variant: 'body1_16_regular',
children:
'AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.',
},
};
const StyledBox = styled('div', {
shouldForwardProp: (prop) => !['variant'].includes(prop.toString()),
})<{ variant: (typeof variantArray)[number] }>(({ theme, variant }) => ({
...theme.typography[variant],
whiteSpace: 'pre-line',
}));
const StyledTemplate: StoryFn = (args) => {
const { variant, children } = args;
return {children};
};
export const Styled = {
render: StyledTemplate,
args: {
variant: 'body1_16_regular',
children:
'AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.',
},
parameters: {
docs: {
source: {
code: `
const StyledBox = styled("div")(({ theme }) => ({
...theme.typography.body1_16_regular,
whiteSpace: "pre-line",
}));
...
return (
AI will be the new standard of care. 123456789\nBy Lunit. With AI, we aim to make data-driven medicine\nthe new standard of care.
);
`,
language: 'tsx',
type: 'code',
},
},
},
};