@@ -7,6 +7,9 @@ import { getStoryFactory } from "./getStory";
77import { assert } from "tsafe/assert" ;
88import type { Equals } from "tsafe" ;
99
10+ import artworkOvoidSvgUrl from "../dist/dsfr/artwork/background/ovoid.svg" ;
11+ import artworkTechnicalErrorSvgUrl from "../dist/dsfr/artwork/pictograms/system/technical-error.svg" ;
12+
1013import { fr } from "../dist" ;
1114
1215const { meta, getStory } = getStoryFactory ( {
@@ -151,7 +154,7 @@ export const CardWithShadow = getStory(
151154) ;
152155
153156export const CardWithoutImage = getStory (
154- { ...defaultProps , "imageUrl" : undefined } ,
157+ { ...defaultProps } ,
155158 { "description" : "Carte sans image" }
156159) ;
157160
@@ -351,7 +354,6 @@ export const CardHorizontalWithoutImage = getStory(
351354 ...defaultProps ,
352355 "horizontal" : true ,
353356 "size" : "large" ,
354- "imageUrl" : undefined ,
355357 "start" : (
356358 < ul className = { fr . cx ( "fr-badges-group" ) } >
357359 < li >
@@ -371,8 +373,7 @@ export const CardHorizontalWithoutImageAndEnlargeLink = getStory(
371373 ...defaultProps ,
372374 "horizontal" : true ,
373375 "enlargeLink" : false ,
374- "size" : "large" ,
375- "imageUrl" : undefined
376+ "size" : "large"
376377 } ,
377378 { "description" : "Carte horizontale sans image" , "defaultContainerWidth" : 900 }
378379) ;
@@ -432,3 +433,38 @@ export const CardNoLink = getStory(
432433 } ,
433434 { "description" : "Carte horizontale sans lien" , "defaultContainerWidth" : 900 }
434435) ;
436+
437+ export const CardWithImageComponent = getStory ( {
438+ ...defaultProps ,
439+ enlargeLink : false ,
440+ imageUrl : undefined ,
441+ imageAlt : undefined ,
442+ imageComponent : (
443+ < svg
444+ xmlns = "http://www.w3.org/2000/svg"
445+ className = "fr-responsive-img fr-artwork"
446+ aria-hidden = "true"
447+ viewBox = "0 0 160 200"
448+ >
449+ < use className = "fr-artwork-motif" href = { `${ artworkOvoidSvgUrl } #artwork-motif` } > </ use >
450+ < use
451+ className = "fr-artwork-background"
452+ href = { `${ artworkOvoidSvgUrl } #artwork-background` }
453+ > </ use >
454+ < g transform = "translate(40, 60)" >
455+ < use
456+ className = "fr-artwork-decorative"
457+ href = { `${ artworkTechnicalErrorSvgUrl } #artwork-decorative` }
458+ > </ use >
459+ < use
460+ className = "fr-artwork-minor"
461+ href = { `${ artworkTechnicalErrorSvgUrl } #artwork-minor` }
462+ > </ use >
463+ < use
464+ className = "fr-artwork-major"
465+ href = { `${ artworkTechnicalErrorSvgUrl } #artwork-major` }
466+ > </ use >
467+ </ g >
468+ </ svg >
469+ )
470+ } ) ;
0 commit comments