File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export type CallOutProps = {
19
19
iconId ?: FrIconClassName | RiIconClassName ;
20
20
title ?: ReactNode ;
21
21
titleAs ?: `h${2 | 3 | 4 | 5 | 6 } ` | "p" ;
22
+ bodyAs ?: "p" | "div" ;
22
23
buttonProps ?: ButtonProps ;
23
24
colorVariant ?: CallOutProps . ColorVariant ;
24
25
classes ?: Partial < Record < "root" | "title" | "text" | "button" , string > > ;
@@ -43,6 +44,7 @@ export const CallOut = memo(
43
44
iconId,
44
45
title,
45
46
titleAs : HtmlTitleTag = "h3" ,
47
+ bodyAs : HtmlBodyTag = "p" ,
46
48
buttonProps,
47
49
colorVariant,
48
50
classes = { } ,
@@ -79,7 +81,9 @@ export const CallOut = memo(
79
81
{ title }
80
82
</ HtmlTitleTag >
81
83
) }
82
- < p className = { cx ( fr . cx ( "fr-callout__text" ) , classes . text ) } > { children } </ p >
84
+ < HtmlBodyTag className = { cx ( fr . cx ( "fr-callout__text" ) , classes . text ) } >
85
+ { children }
86
+ </ HtmlBodyTag >
83
87
{ buttonProps !== undefined && (
84
88
< Button
85
89
{ ...buttonProps }
Original file line number Diff line number Diff line change @@ -114,3 +114,18 @@ export const NoButton = getStory({
114
114
accomplir : les CAF versent automatiquement l’ARS aux familles déjà allocataires
115
115
qui remplissent les conditions.`
116
116
} ) ;
117
+
118
+ export const BodyWithList = getStory ( {
119
+ "title" : "Titre mise en avant avec liste dans le body" ,
120
+ "iconId" : "ri-information-line" ,
121
+ "children" : (
122
+ < >
123
+ Une mise en avant peut contenir une liste :
124
+ < ul >
125
+ < li > Un élément de liste</ li >
126
+ < li > Un autre élément de liste</ li >
127
+ </ ul >
128
+ </ >
129
+ ) ,
130
+ "bodyAs" : "div"
131
+ } ) ;
You can’t perform that action at this time.
0 commit comments