@@ -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
@@ -310,6 +313,24 @@ export const CardHorizontal = getStory(
310313 { "description" : "Carte horizontale" , "defaultContainerWidth" : 700 }
311314) ;
312315
316+ export const CardHorizontalTierRatio = getStory (
317+ {
318+ ...defaultProps ,
319+ "horizontal" : true ,
320+ ratio : "33/66"
321+ } ,
322+ { "description" : "Carte horizontale" , "defaultContainerWidth" : 700 }
323+ ) ;
324+
325+ export const CardHorizontalHalfRatio = getStory (
326+ {
327+ ...defaultProps ,
328+ "horizontal" : true ,
329+ ratio : "50/50"
330+ } ,
331+ { "description" : "Carte horizontale" , "defaultContainerWidth" : 700 }
332+ ) ;
333+
313334export const CardHorizontalSM = getStory (
314335 {
315336 ...defaultProps ,
@@ -333,7 +354,6 @@ export const CardHorizontalWithoutImage = getStory(
333354 ...defaultProps ,
334355 "horizontal" : true ,
335356 "size" : "large" ,
336- "imageUrl" : undefined ,
337357 "start" : (
338358 < ul className = { fr . cx ( "fr-badges-group" ) } >
339359 < li >
@@ -353,8 +373,7 @@ export const CardHorizontalWithoutImageAndEnlargeLink = getStory(
353373 ...defaultProps ,
354374 "horizontal" : true ,
355375 "enlargeLink" : false ,
356- "size" : "large" ,
357- "imageUrl" : undefined
376+ "size" : "large"
358377 } ,
359378 { "description" : "Carte horizontale sans image" , "defaultContainerWidth" : 900 }
360379) ;
@@ -414,3 +433,38 @@ export const CardNoLink = getStory(
414433 } ,
415434 { "description" : "Carte horizontale sans lien" , "defaultContainerWidth" : 900 }
416435) ;
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