@@ -12,13 +12,20 @@ import '@gouvfr/dsfr/dist/component/callout/callout.css';
1212 * @visibleName Callout
1313 */
1414const Callout = ( {
15- hasInfoIcon, children, className, colorFamily, colors, ...remainingProps
15+ hasInfoIcon, icon , children, className, colorFamily, colors, ...remainingProps
1616} ) => {
17+ if ( ! hasInfoIcon ) { // TODO Delete deprecated prop hasInfoIcon when reaching major version 4.0.0
18+ // eslint-disable-next-line no-console
19+ console . warn ( "'hasInfoIcon' is deprecated and will be deleted in version 4.0.0. Please use 'icon' instead" , hasInfoIcon ) ;
20+ // eslint-disable-next-line no-param-reassign
21+ icon = undefined ;
22+ }
23+
1724 const theme = useTheme ( ) ;
1825 const [ color , backgroundColor ] = colors ;
1926 const calloutRef = useRef ( ) ;
2027 const _className = classNames ( 'fr-callout' , className , {
21- ' fr-fi-information-line' : hasInfoIcon ,
28+ [ ` fr-fi-${ icon } ` ] : icon ,
2229 [ `fr-callout--${ colorFamily } ` ] : colorFamily ,
2330 } ) ;
2431
@@ -45,13 +52,15 @@ const Callout = ({
4552} ;
4653
4754Callout . defaultProps = {
55+ icon : 'information-line' ,
4856 hasInfoIcon : true ,
4957 className : '' ,
5058 colors : [ ] ,
5159 colorFamily : '' ,
5260} ;
5361
5462Callout . propTypes = {
63+ icon : PropTypes . string ,
5564 hasInfoIcon : PropTypes . bool ,
5665 colorFamily : PropTypes . oneOf ( [ ...colorFamilies , '' ] ) ,
5766 /**
0 commit comments