File tree Expand file tree Collapse file tree
example/src/components/Callout
src/components/interface/Callout Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const CalloutExample = () => (
1717 </ Callout >
1818 </ Col >
1919 < Col n = "12" spacing = "py-2w" >
20- < Callout >
20+ < Callout icon = { null } >
2121 < CalloutTitle > Mise en avant</ CalloutTitle >
2222 < CalloutText > Callout text that might be short and concise.</ CalloutText >
2323 </ Callout >
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ export type CalloutColorFamily = 'green-tilleul-verveine' | 'green-bourgeon' | '
55export type CalloutChildren = React . ReactNode [ ] | React . ReactNode ;
66
77export interface CalloutProps {
8+ /**
9+ * @deprecated The method should not be used
10+ */
811 hasInfoIcon ?: boolean ;
12+ icon ?: Nullable < string > ;
913 colorFamily ?: CalloutColorFamily ;
1014 /**
1115 * first color is color of the border, second is background
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const Callout = ({
2525 const [ color , backgroundColor ] = colors ;
2626 const calloutRef = useRef ( ) ;
2727 const _className = classNames ( 'fr-callout' , className , {
28- [ `fr-fi- ${ icon } ` ] : icon ,
28+ [ icon ] : icon ,
2929 [ `fr-callout--${ colorFamily } ` ] : colorFamily ,
3030 } ) ;
3131
@@ -52,15 +52,18 @@ const Callout = ({
5252} ;
5353
5454Callout . defaultProps = {
55- icon : 'information-line' ,
55+ icon : 'fr-fi- information-line' ,
5656 hasInfoIcon : true ,
5757 className : '' ,
5858 colors : [ ] ,
5959 colorFamily : '' ,
6060} ;
6161
6262Callout . propTypes = {
63- icon : PropTypes . string ,
63+ icon : PropTypes . oneOfType ( [
64+ PropTypes . oneOf ( [ null ] ) ,
65+ PropTypes . string ,
66+ ] ) ,
6467 hasInfoIcon : PropTypes . bool ,
6568 colorFamily : PropTypes . oneOf ( [ ...colorFamilies , '' ] ) ,
6669 /**
Original file line number Diff line number Diff line change @@ -39,14 +39,24 @@ ButtonCallout.storyName = 'Mise en avant avec bouton';
3939
4040export const WithoutIconCallout = Template . bind ( { } ) ;
4141WithoutIconCallout . args = {
42- hasInfoIcon : false ,
42+ icon : null ,
4343 children : [
4444 < CalloutTitle as = "h3" > Callout title</ CalloutTitle > ,
4545 < CalloutText > Callout text that might be short and concise.</ CalloutText > ,
4646 ] ,
4747} ;
4848WithoutIconCallout . storyName = 'Mise en avant sans icone' ;
4949
50+ export const DifferentIconCallout = Template . bind ( { } ) ;
51+ DifferentIconCallout . args = {
52+ icon : 'fr-fi-lock-line' ,
53+ children : [
54+ < CalloutTitle as = "h3" > Callout title</ CalloutTitle > ,
55+ < CalloutText > Callout text that might be short and concise.</ CalloutText > ,
56+ ] ,
57+ } ;
58+ DifferentIconCallout . storyName = 'Mise en avant avec une autre icone' ;
59+
5060export const ColoredCallout = Template . bind ( { } ) ;
5161ColoredCallout . args = {
5262 colors : [ '#f13d3d' , '#ffb0b0' ] ,
You can’t perform that action at this time.
0 commit comments