Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dataesr/react-dsfr",
"version": "3.4.3",
"version": "3.5.0",
Comment thread
MustThinkOfAName marked this conversation as resolved.
Outdated
"private": false,
"description": "A React implementation of the french government design system.",
"license": "MIT",
Expand Down
13 changes: 11 additions & 2 deletions src/components/interface/Callout/Callout.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ import '@gouvfr/dsfr/dist/component/callout/callout.css';
* @visibleName Callout
*/
const Callout = ({
hasInfoIcon, children, className, colorFamily, colors, ...remainingProps
hasInfoIcon, icon, children, className, colorFamily, colors, ...remainingProps
}) => {
if (!hasInfoIcon) { // TODO Delete deprecated prop hasInfoIcon when reaching major version 4.0.0
Comment thread
MustThinkOfAName marked this conversation as resolved.
// eslint-disable-next-line no-console
console.warn("'hasInfoIcon' is deprecated and will be deleted in version 4.0.0. Please use 'icon' instead", hasInfoIcon);
// eslint-disable-next-line no-param-reassign
icon = undefined;
}

const theme = useTheme();
const [color, backgroundColor] = colors;
const calloutRef = useRef();
const _className = classNames('fr-callout', className, {
'fr-fi-information-line': hasInfoIcon,
[`fr-fi-${icon}`]: icon,
Comment thread
MustThinkOfAName marked this conversation as resolved.
Outdated
[`fr-callout--${colorFamily}`]: colorFamily,
});

Expand All @@ -45,13 +52,15 @@ const Callout = ({
};

Callout.defaultProps = {
icon: 'information-line',
hasInfoIcon: true,
className: '',
colors: [],
colorFamily: '',
};

Callout.propTypes = {
icon: PropTypes.string,
Comment thread
MustThinkOfAName marked this conversation as resolved.
Outdated
hasInfoIcon: PropTypes.bool,
colorFamily: PropTypes.oneOf([...colorFamilies, '']),
/**
Expand Down