@redsift/design-system 12.0.0-muiv7 → 12.1.0-muiv5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_internal/DetailedCard.js +27 -4
- package/_internal/DetailedCard.js.map +1 -1
- package/_internal/DetailedCardSection.js +18 -3
- package/_internal/DetailedCardSection.js.map +1 -1
- package/index.d.ts +20 -20
- package/package.json +3 -3
- package/style/index.css +515 -19
- package/style/redsift-fonts.css +515 -19
- package/style/redsift.css +515 -19
|
@@ -6777,10 +6777,25 @@ const COMPONENT_NAME = 'DetailedCard';
|
|
|
6777
6777
|
const CLASSNAME = 'redsift-detailed-card';
|
|
6778
6778
|
const hasMultipleCollapsibleChildren = children => {
|
|
6779
6779
|
const collapsibleChildren = [];
|
|
6780
|
-
const
|
|
6781
|
-
|
|
6780
|
+
const processChild = child => {
|
|
6781
|
+
if (! /*#__PURE__*/React__default.isValidElement(child)) {
|
|
6782
|
+
return;
|
|
6783
|
+
}
|
|
6784
|
+
|
|
6785
|
+
// Check if child has children property that's an array
|
|
6786
|
+
if ( /*#__PURE__*/React__default.isValidElement(child) && child.props && Array.isArray(child.props.children)) {
|
|
6787
|
+
child.props.children.forEach(processChild);
|
|
6788
|
+
return;
|
|
6789
|
+
}
|
|
6782
6790
|
if (isComponent(DetailedCardSection)(child)) {
|
|
6783
|
-
|
|
6791
|
+
// Check if section has explicit isCollapsible={true} prop
|
|
6792
|
+
if (child.props.isCollapsible === true) {
|
|
6793
|
+
collapsibleChildren.push(child);
|
|
6794
|
+
return;
|
|
6795
|
+
}
|
|
6796
|
+
|
|
6797
|
+
// Otherwise, auto-detect by checking for CollapsibleSectionItems as direct children
|
|
6798
|
+
let hasCollapsibleItems = false;
|
|
6784
6799
|
React__default.Children.forEach(child.props.children, sectionChild => {
|
|
6785
6800
|
if (isComponent(DetailedCardCollapsibleSectionItems)(sectionChild)) {
|
|
6786
6801
|
hasCollapsibleItems = true;
|
|
@@ -6790,7 +6805,15 @@ const hasMultipleCollapsibleChildren = children => {
|
|
|
6790
6805
|
collapsibleChildren.push(child);
|
|
6791
6806
|
}
|
|
6792
6807
|
}
|
|
6793
|
-
}
|
|
6808
|
+
};
|
|
6809
|
+
React__default.Children.forEach(children, child => {
|
|
6810
|
+
// If child is an array, process each element
|
|
6811
|
+
if (Array.isArray(child)) {
|
|
6812
|
+
child.forEach(processChild);
|
|
6813
|
+
} else {
|
|
6814
|
+
processChild(child);
|
|
6815
|
+
}
|
|
6816
|
+
});
|
|
6794
6817
|
return collapsibleChildren.length > 1;
|
|
6795
6818
|
};
|
|
6796
6819
|
|