11import React from 'react' ;
22import type { Meta , StoryObj } from '@storybook/react' ;
33
4- import { Heading } from './Heading' ;
4+ import { Heading , HeadingSize } from './Heading' ;
55
66const meta : Meta < typeof Heading > = {
77 component : Heading ,
@@ -32,7 +32,7 @@ export const Default: Story = {
3232
3333 Adjust the font `size` with the available sizes:
3434
35- `xxxl `, `xxl `, `xl `, `lg `, `md`, `sm`, `xs `
35+ `large `, `medium `, `small `, `text `, `subtext `
3636
3737 #### Best practices:
3838
@@ -61,12 +61,11 @@ export const Default: Story = {
6161export const Levels : Story = {
6262 render : ( ) => (
6363 < >
64- < Heading level = { 1 } size = "xxxl" > The fastest way to recruit research participants</ Heading >
65- < Heading level = { 2 } size = "xxl" > The fastest way to recruit research participants</ Heading >
66- < Heading level = { 3 } size = "xl" > The fastest way to recruit research participants</ Heading >
67- < Heading level = { 4 } size = "lg" > The fastest way to recruit research participants</ Heading >
68- < Heading level = { 5 } size = "md" > The fastest way to recruit research participants</ Heading >
69- < Heading level = { 6 } size = "sm" > The fastest way to recruit research participants</ Heading >
64+ < Heading level = { 1 } size = { HeadingSize . LARGE } > The fastest way to recruit research participants</ Heading >
65+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } > The fastest way to recruit research participants</ Heading >
66+ < Heading level = { 3 } size = { HeadingSize . SMALL } > The fastest way to recruit research participants</ Heading >
67+ < Heading level = { 4 } size = { HeadingSize . TEXT } > The fastest way to recruit research participants</ Heading >
68+ < Heading level = { 5 } size = { HeadingSize . SUBTEXT } > The fastest way to recruit research participants</ Heading >
7069 </ >
7170 ) ,
7271} ;
@@ -78,13 +77,11 @@ export const Levels: Story = {
7877export const Sizes : Story = {
7978 render : ( ) => (
8079 < >
81- < Heading level = { 2 } size = "xxxl" > This is a heading level 2 with size="xxxl"</ Heading >
82- < Heading level = { 2 } size = "xxl" > This is a heading level 2 with size="xxl"</ Heading >
83- < Heading level = { 2 } size = "xl" > This is a heading level 2 with size="xl"</ Heading >
84- < Heading level = { 2 } size = "lg" > This is a heading level 2 with size="lg"</ Heading >
85- < Heading level = { 2 } size = "md" > This is a heading level 2 with size="md"</ Heading >
86- < Heading level = { 2 } size = "sm" > This is a heading level 2 with size="sm"</ Heading >
87- < Heading level = { 2 } size = "xs" > This is a heading level 2 with size="xs"</ Heading >
80+ < Heading level = { 2 } size = { HeadingSize . LARGE } > This is a heading level 2 with size="large"</ Heading >
81+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } > This is a heading level 2 with size="medium"</ Heading >
82+ < Heading level = { 2 } size = { HeadingSize . SMALL } > This is a heading level 2 with size="small"</ Heading >
83+ < Heading level = { 2 } size = { HeadingSize . TEXT } > This is a heading level 2 with size="text"</ Heading >
84+ < Heading level = { 2 } size = { HeadingSize . SUBTEXT } > This is a heading level 2 with size="subtext"</ Heading >
8885 </ >
8986 ) ,
9087} ;
@@ -97,9 +94,9 @@ export const Sizes: Story = {
9794export const Weights : Story = {
9895 render : ( ) => (
9996 < >
100- < Heading level = { 2 } size = "xxl" weight = "bold" > The fastest way to recruit research participants</ Heading >
101- < Heading level = { 2 } size = "xxl" weight = "medium" > The fastest way to recruit research participants</ Heading >
102- < Heading level = { 2 } size = "xxl" weight = "regular" > The fastest way to recruit research participants</ Heading >
97+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } weight = "bold" > The fastest way to recruit research participants</ Heading >
98+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } weight = "medium" > The fastest way to recruit research participants</ Heading >
99+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } weight = "regular" > The fastest way to recruit research participants</ Heading >
103100 </ >
104101 ) ,
105102} ;
@@ -112,9 +109,9 @@ export const Weights: Story = {
112109export const Alignment : Story = {
113110 render : ( ) => (
114111 < >
115- < Heading level = { 2 } size = "xxl" textAlign = "left" weight = "bold" > The fastest way to recruit research participants</ Heading >
116- < Heading level = { 2 } size = "xxl" textAlign = "center" weight = "bold" > The fastest way to recruit research participants</ Heading >
117- < Heading level = { 2 } size = "xxl" textAlign = "right" weight = "bold" > The fastest way to recruit research participants</ Heading >
112+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } textAlign = "left" weight = "bold" > The fastest way to recruit research participants</ Heading >
113+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } textAlign = "center" weight = "bold" > The fastest way to recruit research participants</ Heading >
114+ < Heading level = { 2 } size = { HeadingSize . MEDIUM } textAlign = "right" weight = "bold" > The fastest way to recruit research participants</ Heading >
118115 </ >
119116 ) ,
120117} ;
0 commit comments