@redsift/design-system 12.0.0-muiv6 → 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.
@@ -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 childrenArray = React__default.Children.toArray(children);
6781
- for (const child of childrenArray) {
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
- let hasCollapsibleItems = Boolean(child.isCollapsible);
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