|
| 1 | +import type { Meta, StoryObj } from '@storybook/react'; |
| 2 | + |
| 3 | +import { Text } from '@concepta/react-material-ui'; |
| 4 | + |
| 5 | +const meta = { |
| 6 | + component: Text, |
| 7 | + tags: ['autodocs'], |
| 8 | + args: {}, |
| 9 | + argTypes: { |
| 10 | + variant: { |
| 11 | + control: 'select', |
| 12 | + options: [ |
| 13 | + 'body1', |
| 14 | + 'body2', |
| 15 | + 'caption', |
| 16 | + 'button', |
| 17 | + 'overline', |
| 18 | + 'subtitle1', |
| 19 | + 'subtitle2', |
| 20 | + 'h1', |
| 21 | + 'h2', |
| 22 | + 'h3', |
| 23 | + 'h4', |
| 24 | + 'h5', |
| 25 | + 'h6', |
| 26 | + ], |
| 27 | + }, |
| 28 | + fontWeight: { |
| 29 | + control: 'select', |
| 30 | + options: ['100', '200', '300', '400', '500', '600', '700', '800', '900'], |
| 31 | + }, |
| 32 | + align: { |
| 33 | + control: 'select', |
| 34 | + options: ['inherit', 'left', 'center', 'right', 'justify'], |
| 35 | + }, |
| 36 | + sx: { |
| 37 | + control: 'object', |
| 38 | + }, |
| 39 | + }, |
| 40 | +} satisfies Meta<typeof Text>; |
| 41 | + |
| 42 | +export default meta; |
| 43 | + |
| 44 | +type Story = StoryObj<typeof meta>; |
| 45 | + |
| 46 | +export const Default: Story = { |
| 47 | + args: { |
| 48 | + children: 'Default Text', |
| 49 | + fontWeight: '300', |
| 50 | + align: 'left', |
| 51 | + sx: {}, |
| 52 | + variant: 'body1', |
| 53 | + }, |
| 54 | +}; |
| 55 | + |
| 56 | +export const CustomFontWeight: Story = { |
| 57 | + args: { |
| 58 | + children: 'Custom Font Weight', |
| 59 | + fontWeight: '700', |
| 60 | + }, |
| 61 | +}; |
| 62 | + |
| 63 | +export const CustomFontSize: Story = { |
| 64 | + args: { |
| 65 | + children: 'Custom Font Size', |
| 66 | + fontSize: '2rem', |
| 67 | + }, |
| 68 | +}; |
| 69 | + |
| 70 | +export const CustomColor: Story = { |
| 71 | + args: { |
| 72 | + children: 'Custom Color', |
| 73 | + color: 'red', |
| 74 | + }, |
| 75 | +}; |
| 76 | + |
| 77 | +export const DifferentVariants: Story = { |
| 78 | + args: { |
| 79 | + children: 'Heading 1 Text', |
| 80 | + variant: 'h1', |
| 81 | + }, |
| 82 | +}; |
| 83 | + |
| 84 | +export const TextAlignment: Story = { |
| 85 | + args: { |
| 86 | + children: 'Center Aligned Text', |
| 87 | + align: 'center', |
| 88 | + }, |
| 89 | +}; |
| 90 | + |
| 91 | +export const TextWithCustomStyles: Story = { |
| 92 | + args: { |
| 93 | + children: 'Text with Custom Styles', |
| 94 | + sx: { color: 'purple', textTransform: 'uppercase', letterSpacing: '2px' }, |
| 95 | + }, |
| 96 | +}; |
0 commit comments