@porsche-design-system/components-react 2.19.0 → 2.19.1-rc.1

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +31 -3
  2. package/jsdom-polyfill/index.js +12 -1
  3. package/jsdom-polyfill.d.ts +1 -0
  4. package/lib/components/button-group.wrapper.d.ts +3 -3
  5. package/lib/components/button-pure.wrapper.d.ts +3 -3
  6. package/lib/components/divider.wrapper.d.ts +3 -3
  7. package/lib/components/flex-item.wrapper.d.ts +13 -13
  8. package/lib/components/flex.wrapper.d.ts +13 -13
  9. package/lib/components/grid-item.wrapper.d.ts +5 -5
  10. package/lib/components/grid.wrapper.d.ts +7 -7
  11. package/lib/components/icon.wrapper.d.ts +3 -3
  12. package/lib/components/link-pure.wrapper.d.ts +5 -5
  13. package/lib/components/link-tile.wrapper.d.ts +3 -3
  14. package/lib/components/link.wrapper.d.ts +3 -3
  15. package/lib/components/marque.wrapper.d.ts +3 -3
  16. package/lib/components/modal.wrapper.d.ts +3 -3
  17. package/lib/components/spinner.wrapper.d.ts +5 -5
  18. package/lib/components/switch.wrapper.d.ts +3 -3
  19. package/lib/types.d.ts +26 -47
  20. package/package.json +2 -2
  21. package/ssr/components/dist/styles/esm/styles-entry.js +46 -23
  22. package/ssr/components/dist/utils/esm/utils-entry.js +46 -23
  23. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +2 -7
  24. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +3 -8
  25. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.js +2 -7
  26. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.js +4 -9
  27. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +2 -7
  28. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +4 -9
  29. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +4 -9
  30. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js +2 -7
  31. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js +5 -10
  32. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.js +2 -7
  33. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.js +2 -7
  34. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.js +2 -7
  35. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.js +3 -8
  36. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js +2 -7
  37. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +3 -8
  38. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js +4 -9
  39. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js +2 -7
  40. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -7
  41. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.js +2 -7
  42. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.js +3 -8
  43. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js +2 -7
  44. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.js +4 -9
  45. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js +2 -7
  46. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.js +2 -7
  47. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +3 -8
  48. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js +4 -9
  49. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal-item.js +2 -7
  50. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.js +3 -8
  51. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js +2 -7
  52. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js +2 -7
  53. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js +2 -7
  54. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-cell.js +2 -7
  55. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js +2 -7
  56. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js +2 -7
  57. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js +2 -7
  58. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.js +3 -8
  59. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js +2 -7
  60. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js +2 -7
  61. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +4 -9
  62. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag-dismissible.js +2 -7
  63. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.js +2 -7
  64. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +7 -12
  65. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js +2 -7
  66. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js +3 -8
  67. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text.js +2 -7
  68. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea-wrapper.js +4 -9
  69. package/ssr/components-react/projects/react-ssr-wrapper/src/splitChildren.js +28 -0
  70. package/ssr/esm/components/dist/styles/esm/styles-entry.js +46 -23
  71. package/ssr/esm/components/dist/utils/esm/utils-entry.js +46 -23
  72. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +2 -7
  73. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +3 -8
  74. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.js +2 -7
  75. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.js +4 -9
  76. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +2 -7
  77. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +4 -9
  78. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +4 -9
  79. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js +2 -7
  80. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js +5 -10
  81. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.js +2 -7
  82. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.js +2 -7
  83. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.js +2 -7
  84. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.js +3 -8
  85. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js +2 -7
  86. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +3 -8
  87. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js +4 -9
  88. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js +2 -7
  89. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -7
  90. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.js +2 -7
  91. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.js +3 -8
  92. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js +2 -7
  93. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.js +4 -9
  94. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js +2 -7
  95. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.js +2 -7
  96. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +3 -8
  97. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js +4 -9
  98. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal-item.js +2 -7
  99. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.js +3 -8
  100. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js +2 -7
  101. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js +2 -7
  102. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js +2 -7
  103. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-cell.js +2 -7
  104. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js +2 -7
  105. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js +2 -7
  106. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js +2 -7
  107. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.js +3 -8
  108. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js +2 -7
  109. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js +2 -7
  110. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +4 -9
  111. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag-dismissible.js +2 -7
  112. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.js +2 -7
  113. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +7 -12
  114. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js +2 -7
  115. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js +3 -8
  116. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text.js +2 -7
  117. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea-wrapper.js +4 -9
  118. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/splitChildren.js +26 -0
  119. package/ssr/lib/components/button-group.wrapper.d.ts +3 -3
  120. package/ssr/lib/components/button-pure.wrapper.d.ts +3 -3
  121. package/ssr/lib/components/divider.wrapper.d.ts +3 -3
  122. package/ssr/lib/components/flex-item.wrapper.d.ts +13 -13
  123. package/ssr/lib/components/flex.wrapper.d.ts +13 -13
  124. package/ssr/lib/components/grid-item.wrapper.d.ts +5 -5
  125. package/ssr/lib/components/grid.wrapper.d.ts +7 -7
  126. package/ssr/lib/components/icon.wrapper.d.ts +3 -3
  127. package/ssr/lib/components/link-pure.wrapper.d.ts +5 -5
  128. package/ssr/lib/components/link-tile.wrapper.d.ts +3 -3
  129. package/ssr/lib/components/link.wrapper.d.ts +3 -3
  130. package/ssr/lib/components/marque.wrapper.d.ts +3 -3
  131. package/ssr/lib/components/modal.wrapper.d.ts +3 -3
  132. package/ssr/lib/components/spinner.wrapper.d.ts +5 -5
  133. package/ssr/lib/components/switch.wrapper.d.ts +3 -3
  134. package/ssr/lib/types.d.ts +26 -47
  135. package/ssr/splitChildren.d.ts +17 -0
  136. package/testing/index.js +8 -42
  137. package/testing.d.ts +1 -9
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -15,13 +16,7 @@ class DSRButton extends react.Component {
15
16
  return utilsEntry.isDisabledOrLoading(this.props.disabled, this.props.loading);
16
17
  }
17
18
  render() {
18
- const children = Array.isArray(this.props.children)
19
- ? this.props.children
20
- : this.props.children
21
- ? [this.props.children]
22
- : [];
23
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
24
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
19
+ splitChildren.splitChildren(this.props.children);
25
20
  const iconProps = {
26
21
  className: 'icon',
27
22
  size: 'inherit',
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -15,13 +16,7 @@ class DSRCarousel extends react.Component {
15
16
  }
16
17
  render() {
17
18
  var _a;
18
- const children = Array.isArray(this.props.children)
19
- ? this.props.children
20
- : this.props.children
21
- ? [this.props.children]
22
- : [];
23
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
24
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
19
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
25
20
  const btnProps = {
26
21
  className: 'btn',
27
22
  type: 'button',
@@ -30,8 +25,8 @@ class DSRCarousel extends react.Component {
30
25
  // 'aria-controls': 'splide-track', // TODO: cross shadow dom? use native button tag instead of p-button-pure?
31
26
  };
32
27
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCarouselCss(this.props.wrapContent, this.props.disablePagination, this.props.theme)));
33
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "header", children: [this.props.heading ? jsxRuntime.jsx("h2", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }), (this.props.description || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) &&
34
- ((this.props.description && jsxRuntime.jsx("p", { children: this.props.description })) || jsxRuntime.jsx("slot", { name: "description" })), jsxRuntime.jsxs("div", { className: "nav", children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-left" }), jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-right" })] })] }), jsxRuntime.jsx("div", { id: "splide", className: "splide", "aria-label": this.props.heading || ((_a = namedSlottedChildren.find(({ props: { slot } }) => slot === 'heading')) === null || _a === void 0 ? void 0 : _a.props.children), children: jsxRuntime.jsx("div", { className: "splide__track", children: jsxRuntime.jsx("div", { className: "splide__list", children: defaultChildren.map((_, i) => (jsxRuntime.jsx("div", { className: "splide__slide", children: jsxRuntime.jsx("slot", { name: `slide-${i}` }) }, i))) }) }) }), this.props.disablePagination !== true && jsxRuntime.jsx("div", { className: "pagination" })] })] }), this.props.children] }));
28
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "header", children: [this.props.heading ? jsxRuntime.jsx("h2", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) &&
29
+ ((this.props.description && jsxRuntime.jsx("p", { children: this.props.description })) || jsxRuntime.jsx("slot", { name: "description" })), jsxRuntime.jsxs("div", { className: "nav", children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-left" }), jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { ...btnProps, icon: "arrow-right" })] })] }), jsxRuntime.jsx("div", { id: "splide", className: "splide", "aria-label": this.props.heading || ((_a = namedSlotChildren.find(({ props: { slot } }) => slot === 'heading')) === null || _a === void 0 ? void 0 : _a.props.children), children: jsxRuntime.jsx("div", { className: "splide__track", children: jsxRuntime.jsx("div", { className: "splide__list", children: otherChildren.map((_, i) => (jsxRuntime.jsx("div", { className: "splide__slide", children: jsxRuntime.jsx("slot", { name: `slide-${i}` }) }, i))) }) }) }), this.props.disablePagination !== true && jsxRuntime.jsx("div", { className: "pagination" })] })] }), this.props.children] }));
35
30
  }
36
31
  }
37
32
 
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -10,15 +11,9 @@ var stateMessage = require('./state-message.js');
10
11
  class DSRCheckboxWrapper extends react.Component {
11
12
  render() {
12
13
  var _a;
13
- const children = Array.isArray(this.props.children)
14
- ? this.props.children
15
- : this.props.children
16
- ? [this.props.children]
17
- : [];
18
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
19
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
20
- const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCheckboxWrapperCss(this.props.hideLabel, this.props.state, (_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled)));
21
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
14
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
15
+ const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getCheckboxWrapperCss(this.props.hideLabel, this.props.state, typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled))));
16
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
22
17
  }
23
18
  }
24
19
 
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRContentWrapper extends react.Component {
10
11
  render() {
11
- const children = Array.isArray(this.props.children)
12
- ? this.props.children
13
- : this.props.children
14
- ? [this.props.children]
15
- : [];
16
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
17
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
12
+ splitChildren.splitChildren(this.props.children);
18
13
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getContentWrapperCss(this.props.width, this.props.backgroundColor, this.props.theme)));
19
14
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("div", { className: "root", children: jsxRuntime.jsx("slot", {}) })] }), this.props.children] }));
20
15
  }
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -10,17 +11,11 @@ var required = require('./required.js');
10
11
 
11
12
  class DSRFieldsetWrapper extends react.Component {
12
13
  render() {
13
- const children = Array.isArray(this.props.children)
14
- ? this.props.children
15
- : this.props.children
16
- ? [this.props.children]
17
- : [];
18
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
19
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
14
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
20
15
  const messageId = 'message';
21
- const hasMessageValue = (this.props.message || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state);
22
- const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFieldsetWrapperCss(this.props.state, this.props.labelSize, (this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0))));
23
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("fieldset", { "aria-describedby": hasMessageValue ? messageId : null, children: [(this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsxs("legend", { children: [this.props.label || jsxRuntime.jsx("slot", { name: "label" }), this.props.required && jsxRuntime.jsx(required.Required, {})] })), jsxRuntime.jsx("slot", {}), hasMessageValue && jsxRuntime.jsx(stateMessage.StateMessage, { id: messageId, state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
16
+ const hasMessageValue = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state);
17
+ const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFieldsetWrapperCss(this.props.state, this.props.labelSize, (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0))));
18
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("fieldset", { "aria-describedby": hasMessageValue ? messageId : null, children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsxs("legend", { children: [this.props.label || jsxRuntime.jsx("slot", { name: "label" }), this.props.required && jsxRuntime.jsx(required.Required, {})] })), jsxRuntime.jsx("slot", {}), hasMessageValue && jsxRuntime.jsx(stateMessage.StateMessage, { id: messageId, state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
24
19
  }
25
20
  }
26
21
 
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRFlexItem extends react.Component {
10
11
  render() {
11
- const children = Array.isArray(this.props.children)
12
- ? this.props.children
13
- : this.props.children
14
- ? [this.props.children]
15
- : [];
16
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
17
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
12
+ splitChildren.splitChildren(this.props.children);
18
13
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlexItemCss(this.props.width, this.props.offset, this.props.alignSelf, this.props.grow, this.props.shrink, this.props.flex)));
19
14
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("slot", {})] }), this.props.children] }));
20
15
  }
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRFlex extends react.Component {
10
11
  render() {
11
- const children = Array.isArray(this.props.children)
12
- ? this.props.children
13
- : this.props.children
14
- ? [this.props.children]
15
- : [];
16
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
17
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
12
+ splitChildren.splitChildren(this.props.children);
18
13
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getFlexCss(this.props.inline, this.props.wrap, this.props.direction, this.props.justifyContent, this.props.alignItems, this.props.alignContent)));
19
14
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("slot", {})] }), this.props.children] }));
20
15
  }
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -8,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRGridItem extends react.Component {
10
11
  render() {
11
- const children = Array.isArray(this.props.children)
12
- ? this.props.children
13
- : this.props.children
14
- ? [this.props.children]
15
- : [];
16
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
17
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
12
+ splitChildren.splitChildren(this.props.children);
18
13
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getGridItemCss(this.props.size, this.props.offset, this.props.gutter || { base: 16, s: 24, m: 36 } // default as fallback
19
14
  )));
20
15
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("slot", {})] }), this.props.children] }));
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -8,14 +9,8 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRGrid extends react.Component {
10
11
  render() {
11
- const children = Array.isArray(this.props.children)
12
- ? this.props.children
13
- : this.props.children
14
- ? [this.props.children]
15
- : [];
16
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
17
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
18
- const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
12
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
13
+ const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
19
14
  ? { ...child, props: { ...child.props, gutter: this.props.gutter } }
20
15
  : child);
21
16
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getGridCss(this.props.direction, this.props.wrap, this.props.gutter)));
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -9,13 +10,7 @@ var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entr
9
10
 
10
11
  class DSRHeadline extends react.Component {
11
12
  render() {
12
- const children = Array.isArray(this.props.children)
13
- ? this.props.children
14
- : this.props.children
15
- ? [this.props.children]
16
- : [];
17
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
18
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
13
+ splitChildren.splitChildren(this.props.children);
19
14
  const TagName = utilsEntry.getHeadlineTagName(null, this.props.variant, this.props.tag);
20
15
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getHeadlineCss(this.props.variant, this.props.align, this.props.color, this.props.ellipsis, this.props.theme)));
21
16
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(TagName, { className: "root", children: jsxRuntime.jsx("slot", {}) }) })] }), this.props.children] }));
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -12,18 +13,12 @@ var icon_wrapper = require('../components/icon.wrapper.js');
12
13
 
13
14
  class DSRInlineNotification extends react.Component {
14
15
  render() {
15
- const children = Array.isArray(this.props.children)
16
- ? this.props.children
17
- : this.props.children
18
- ? [this.props.children]
19
- : [];
20
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
21
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
16
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
22
17
  const bannerId = 'banner';
23
18
  const labelId = 'label';
24
19
  const descriptionId = 'description';
25
20
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getInlineNotificationCss(this.props.state, !!this.props.actionLabel, !this.props.persistent, this.props.theme)));
26
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getInlineNotificationIconName(this.props.state), color: "inherit", "aria-hidden": "true" }), jsxRuntime.jsxs("div", { id: bannerId, className: "content", ...utilsEntry.getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) && jsxRuntime.jsx("h5", { id: labelId, children: this.props.heading || jsxRuntime.jsx("slot", { name: "heading" }) }), jsxRuntime.jsx("p", { id: descriptionId, children: this.props.description || jsxRuntime.jsx("slot", {}) })] }), this.props.actionLabel && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), !this.props.persistent && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "close", type: "button", icon: "close", hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
21
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getInlineNotificationIconName(this.props.state), color: "inherit", "aria-hidden": "true" }), jsxRuntime.jsxs("div", { id: bannerId, className: "content", ...utilsEntry.getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) && jsxRuntime.jsx("h5", { id: labelId, children: this.props.heading || jsxRuntime.jsx("slot", { name: "heading" }) }), jsxRuntime.jsx("p", { id: descriptionId, children: this.props.description || jsxRuntime.jsx("slot", {}) })] }), this.props.actionLabel && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), !this.props.persistent && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "close", type: "button", icon: "close", hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
27
22
  }
28
23
  }
29
24
 
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -11,16 +12,10 @@ var icon_wrapper = require('../components/icon.wrapper.js');
11
12
 
12
13
  class DSRLinkPure extends react.Component {
13
14
  render() {
14
- const children = Array.isArray(this.props.children)
15
- ? this.props.children
16
- : this.props.children
17
- ? [this.props.children]
18
- : [];
19
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
20
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
21
- const hasSubline = namedSlottedChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0;
15
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
16
+ const hasSubline = namedSlotChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0;
22
17
  const TagType = this.props.href === undefined ? 'span' : 'a';
23
- const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkPureCss(this.props.icon, this.props.active, this.props.stretch, this.props.size, this.props.weight, this.props.hideLabel, this.props.alignLabel, namedSlottedChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0, !this.props.href, this.props.theme)));
18
+ const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkPureCss(this.props.icon, this.props.active, this.props.stretch, this.props.size, this.props.weight, this.props.hideLabel, this.props.alignLabel, namedSlotChildren.filter(({ props: { slot } }) => slot === 'subline').length > 0, !this.props.href, this.props.theme)));
24
19
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
25
20
  href: this.props.href,
26
21
  target: this.props.target,
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -10,13 +11,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
10
11
 
11
12
  class DSRLinkSocial extends react.Component {
12
13
  render() {
13
- const children = Array.isArray(this.props.children)
14
- ? this.props.children
15
- : this.props.children
16
- ? [this.props.children]
17
- : [];
18
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
19
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
14
+ splitChildren.splitChildren(this.props.children);
20
15
  const TagType = this.props.href === undefined ? 'span' : 'a';
21
16
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkSocialCss(this.props.icon, this.props.hideLabel, !!this.props.href, this.props.theme)));
22
17
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -12,13 +13,7 @@ var linkPure_wrapper = require('../components/link-pure.wrapper.js');
12
13
 
13
14
  class DSRLinkTile extends react.Component {
14
15
  render() {
15
- const children = Array.isArray(this.props.children)
16
- ? this.props.children
17
- : this.props.children
18
- ? [this.props.children]
19
- : [];
20
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
21
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
16
+ splitChildren.splitChildren(this.props.children);
22
17
  const descriptionId = 'description';
23
18
  const linkProps = {
24
19
  theme: 'dark',
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -11,13 +12,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
11
12
 
12
13
  class DSRLink extends react.Component {
13
14
  render() {
14
- const children = Array.isArray(this.props.children)
15
- ? this.props.children
16
- : this.props.children
17
- ? [this.props.children]
18
- : [];
19
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
20
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
15
+ splitChildren.splitChildren(this.props.children);
21
16
  const TagType = this.props.href === undefined ? 'span' : 'a';
22
17
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkCss(this.props.variant, this.props.hideLabel, !this.props.href, this.props.theme)));
23
18
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(TagType, { className: "root", ...(TagType === 'a' && {
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -11,15 +12,9 @@ var buttonPure_wrapper = require('../components/button-pure.wrapper.js');
11
12
 
12
13
  class DSRModal extends react.Component {
13
14
  render() {
14
- const children = Array.isArray(this.props.children)
15
- ? this.props.children
16
- : this.props.children
17
- ? [this.props.children]
18
- : [];
19
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
20
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
15
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
21
16
  if (this.props.open) ;
22
- const hasHeader = !!this.props.heading || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0;
17
+ const hasHeader = !!this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0;
23
18
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getModalCss(this.props.open, this.props.fullscreen, this.props.disableCloseButton, hasHeader)));
24
19
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "root", role: "dialog", "aria-modal": "true", ...{ 'aria-label': this.props.heading, ...utilsEntry.parseAndGetAriaAttributes(this.props.aria) }, "aria-hidden": !this.props.open ? 'true' : 'false', tabIndex: -1, children: [!this.props.disableCloseButton && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "close", type: "button", hideLabel: true, icon: "close", children: "Close modal" })), hasHeader && (jsxRuntime.jsx("div", { className: "header", children: this.props.heading ? jsxRuntime.jsx("h1", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }) })), jsxRuntime.jsx("slot", {})] }) })] }), this.props.children] }));
25
20
  }
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -15,13 +16,7 @@ class DSRPopover extends react.Component {
15
16
  this.open = false;
16
17
  }
17
18
  render() {
18
- const children = Array.isArray(this.props.children)
19
- ? this.props.children
20
- : this.props.children
21
- ? [this.props.children]
22
- : [];
23
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
24
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
19
+ splitChildren.splitChildren(this.props.children);
25
20
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getPopoverCss(this.props.direction).replace(/(:host {[\S\s]+?})[\S\s]+/, '$1')));
26
21
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { type: "button", icon: "information", hideLabel: true,
27
22
  // pass string to avoid another update on p-button on each render because of new object reference
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -10,15 +11,9 @@ var stateMessage = require('./state-message.js');
10
11
  class DSRRadioButtonWrapper extends react.Component {
11
12
  render() {
12
13
  var _a;
13
- const children = Array.isArray(this.props.children)
14
- ? this.props.children
15
- : this.props.children
16
- ? [this.props.children]
17
- : [];
18
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
19
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
20
- const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getRadioButtonWrapperCss(this.props.hideLabel, this.props.state, (_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled)));
21
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
14
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
15
+ const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getRadioButtonWrapperCss(this.props.hideLabel, this.props.state, typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled))));
16
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("label", { children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label", children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), jsxRuntime.jsx("slot", {})] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
22
17
  }
23
18
  }
24
19
 
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -17,13 +18,7 @@ class DSRScroller extends react.Component {
17
18
  }
18
19
  // should only update if scrollable
19
20
  render() {
20
- const children = Array.isArray(this.props.children)
21
- ? this.props.children
22
- : this.props.children
23
- ? [this.props.children]
24
- : [];
25
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
26
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
21
+ splitChildren.splitChildren(this.props.children);
27
22
  const renderPrevNextButton = (direction) => {
28
23
  return (jsxRuntime.jsx("div", { className: direction === 'next' ? 'action-next' : 'action-prev', children: jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "button", type: "button", tabIndex: -1, hideLabel: true, size: "inherit", icon: direction === 'next' ? 'arrow-head-right' : 'arrow-head-left', theme: this.props.theme, "aria-hidden": "true", children: direction }) }, direction));
29
24
  };
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -11,13 +12,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
11
12
 
12
13
  class DSRSegmentedControlItem extends react.Component {
13
14
  render() {
14
- const children = Array.isArray(this.props.children)
15
- ? this.props.children
16
- : this.props.children
17
- ? [this.props.children]
18
- : [];
19
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
20
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
15
+ splitChildren.splitChildren(this.props.children);
21
16
  // this additional validation is still needed because undefined is allowed with current propTypes
22
17
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSegmentedControlItemCss(this.props.disabled, this.props.selected, this.props.backgroundColor || 'background-default', // default as fallback
23
18
  this.props.theme || 'light' // default as fallback
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
+ var splitChildren = require('../../splitChildren.js');
4
5
  var react = require('react');
5
6
  var minifyCss = require('../../minifyCss.js');
6
7
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
@@ -8,16 +9,10 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRSegmentedControl extends react.Component {
10
11
  render() {
11
- const children = Array.isArray(this.props.children)
12
- ? this.props.children
13
- : this.props.children
14
- ? [this.props.children]
15
- : [];
16
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
17
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
12
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
18
13
  const manipulatedChildren = children.map((child, i) => {
19
14
  var _a;
20
- return typeof child === 'object' && defaultChildren.includes(child)
15
+ return typeof child === 'object' && 'props' in child && otherChildren.includes(child)
21
16
  ? { ...child, props: { ...child.props, selected: ((_a = child.props) === null || _a === void 0 ? void 0 : _a.value) === this.props.value, backgroundColor: this.props.backgroundColor, theme: this.props.theme } }
22
17
  : child;
23
18
  });
@@ -3,6 +3,7 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  require('../../provider.js');
6
+ var splitChildren = require('../../splitChildren.js');
6
7
  var minifyCss = require('../../minifyCss.js');
7
8
  var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.js');
8
9
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.js');
@@ -12,19 +13,13 @@ var icon_wrapper = require('../components/icon.wrapper.js');
12
13
  class DSRSelectWrapper extends react.Component {
13
14
  render() {
14
15
  var _a;
15
- const children = Array.isArray(this.props.children)
16
- ? this.props.children
17
- : this.props.children
18
- ? [this.props.children]
19
- : [];
20
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
21
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
22
- const { disabled } = ((_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
16
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
17
+ const { disabled } = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
23
18
  const labelProps = disabled
24
19
  ? {}
25
20
  : {};
26
21
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSelectWrapperCss(disabled, this.props.hideLabel, this.props.state, this.props.theme)));
27
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsxs("label", { className: "label", children: [(this.props.label || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label__text", ...labelProps, children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), (this.props.description || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) && (jsxRuntime.jsx("span", { className: "label__text label__text--description", ...labelProps, children: this.props.description || jsxRuntime.jsx("slot", { name: "description" }) })), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", color: "inherit", "aria-hidden": "true" }), jsxRuntime.jsx("slot", {})] }), this.props.hasCustomDropdown && (jsxRuntime.jsx(jsxRuntime.Fragment, {}))] }), (this.props.message || namedSlottedChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
22
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsxs("label", { className: "label", children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxRuntime.jsx("span", { className: "label__text", ...labelProps, children: this.props.label || jsxRuntime.jsx("slot", { name: "label" }) })), (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) && (jsxRuntime.jsx("span", { className: "label__text label__text--description", ...labelProps, children: this.props.description || jsxRuntime.jsx("slot", { name: "description" }) })), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", color: "inherit", "aria-hidden": "true" }), jsxRuntime.jsx("slot", {})] }), this.props.hasCustomDropdown && (jsxRuntime.jsx(jsxRuntime.Fragment, {}))] }), (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) && (jsxRuntime.jsx(stateMessage.StateMessage, { state: this.props.state, message: this.props.message, host: null }))] })] }), this.props.children] }));
28
23
  }
29
24
  }
30
25