@@ -18,6 +18,15 @@ const { meta, getStory } = getStoryFactory({
1818- [See source code](https://github.com/codegouvfr/react-dsfr/blob/main/src/Card.tsx)` ,
1919 "argTypes" : {
2020 "title" : { "description" : `Required.` } ,
21+ titleAs : {
22+ "description" : `Heading level` ,
23+ "options" : ( ( ) => {
24+ const headings = [ "h2" , "h3" , "h4" , "h5" , "h6" ] as const ;
25+ assert < Equals < typeof headings [ number ] | undefined , CardProps [ "titleAs" ] > > ( ) ;
26+ return headings ;
27+ } ) ( ) ,
28+ "control" : { "type" : "radio" }
29+ } ,
2130 "desc" : { "description" : `` } ,
2231 linkProps : {
2332 "description" : `Required only if enlargeLink is true. The Card Link props.`
@@ -30,9 +39,7 @@ const { meta, getStory } = getStoryFactory({
3039 "description" : "Card title text sizing" ,
3140 "options" : ( ( ) => {
3241 const sizes = [ "small" , "medium" , "large" ] as const ;
33-
3442 assert < Equals < typeof sizes [ number ] | undefined , CardProps [ "size" ] > > ( ) ;
35-
3643 return sizes ;
3744 } ) ( ) ,
3845 "control" : { "type" : "radio" }
@@ -49,6 +56,7 @@ export default meta;
4956const defaultProps = {
5057 "enlargeLink" : true as const ,
5158 "title" : "Intitulé de la carte (sur lequel se trouve le lien)" ,
59+ "titleAs" : "h3" as const ,
5260 "linkProps" : {
5361 "href" : "#"
5462 } ,
0 commit comments