From 6d9f9b7da2be59900d09368963e538ef54ffdc20 Mon Sep 17 00:00:00 2001 From: Alex Peterson Date: Mon, 14 Oct 2024 13:48:31 -0500 Subject: [PATCH] feat(expandablecard): add new optional key prop --- packages/sage-react/lib/ExpandableCard/ExpandableCard.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/sage-react/lib/ExpandableCard/ExpandableCard.jsx b/packages/sage-react/lib/ExpandableCard/ExpandableCard.jsx index 2109efdaae..ab109b1fc6 100644 --- a/packages/sage-react/lib/ExpandableCard/ExpandableCard.jsx +++ b/packages/sage-react/lib/ExpandableCard/ExpandableCard.jsx @@ -12,6 +12,7 @@ export const ExpandableCard = ({ expanded, children, className, + customKey, headerContent, name, onClick, @@ -32,7 +33,7 @@ export const ExpandableCard = ({ } }; - const id = uuid(); + const id = customKey || uuid(); const containerClassnames = classnames( 'sage-expandable-card', @@ -98,6 +99,7 @@ ExpandableCard.defaultProps = { expanded: false, children: null, className: null, + customKey: null, headerContent: null, alignTrigger: 'middle', name: null, @@ -109,6 +111,7 @@ ExpandableCard.defaultProps = { ExpandableCard.propTypes = { alignArrowRight: PropTypes.bool, bodyBordered: PropTypes.bool, + customKey: PropTypes.string, headerContent: PropTypes.node, expanded: PropTypes.bool, className: PropTypes.string,