@porsche-design-system/components-react 2.19.0-rc.2 → 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 +33 -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');
@@ -11,13 +12,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
11
12
 
12
13
  class DSRStepperHorizontalItem 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 style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getStepperHorizontalItemCss(this.props.state, this.props.disabled, this.props.theme || 'light')));
22
17
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("button", { type: "button", "aria-disabled": !this.props.state || this.props.disabled ? 'true' : null, "aria-current": this.props.state === 'current' ? 'step' : null, children: [utilsEntry.isStateCompleteOrWarning(this.props.state) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getStepperHorizontalIconName(this.props.state), size: "inherit", theme: this.props.theme || 'light', color: "inherit", "aria-hidden": "true" })), this.props.state && jsxRuntime.jsxs("span", { className: "sr-only", children: [this.props.state, ": "] }), jsxRuntime.jsx("slot", {})] }) })] }), this.props.children] }));
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');
@@ -14,14 +15,8 @@ class DSRStepperHorizontal extends react.Component {
14
15
  this.stepperHorizontalItems = [];
15
16
  }
16
17
  render() {
17
- const children = Array.isArray(this.props.children)
18
- ? this.props.children
19
- : this.props.children
20
- ? [this.props.children]
21
- : [];
22
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
23
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
24
- const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
18
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
19
+ const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
25
20
  ? { ...child, props: { ...child.props, theme: this.props.theme } }
26
21
  : child);
27
22
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getStepperHorizontalCss(this.props.size)));
@@ -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');
@@ -14,13 +15,7 @@ class DSRSwitch extends react.Component {
14
15
  return utilsEntry.isDisabledOrLoading(this.props.disabled, this.props.loading);
15
16
  }
16
17
  render() {
17
- const children = Array.isArray(this.props.children)
18
- ? this.props.children
19
- : this.props.children
20
- ? [this.props.children]
21
- : [];
22
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
23
- children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
18
+ splitChildren.splitChildren(this.props.children);
24
19
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSwitchCss(this.props.alignLabel, this.props.hideLabel, this.props.stretch, this.props.checked, this.props.loading, this.isDisabledOrLoading, this.props.theme)));
25
20
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("label", { className: "root", children: [jsxRuntime.jsx("span", { id: "label", className: "text", children: jsxRuntime.jsx("slot", {}) }), jsxRuntime.jsx("button", { ...utilsEntry.getSwitchButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.checked), type: "button", role: "switch", tabIndex: this.props.tabbable ? parseInt(null, 10) || null : -1, children: jsxRuntime.jsx("span", { className: "toggle", children: this.props.loading && (jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", theme: this.props.checked ? 'light' : 'dark', aria: { 'aria-label': 'Loading state' } })) }) })] })] }), this.props.children] }));
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 DSRTableBody 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.getTableBodyCss()));
19
14
  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("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 DSRTableCell 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.getTableCellCss(this.props.multiline)));
19
14
  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("slot", {}) })] }), this.props.children] }));
20
15
  }
@@ -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 DSRTableHeadCell 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 { active, direction } = this.props.sort || {};
22
17
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTableHeadCellCss(active, direction, this.props.hideLabel, this.props.multiline)));
23
18
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: utilsEntry.isSortable(active, direction) ? (jsxRuntime.jsxs("button", { type: "button", children: [jsxRuntime.jsx("slot", {}), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", color: "inherit", name: "arrow-up", "aria-hidden": "true" })] })) : (jsxRuntime.jsx("span", { children: 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,13 +9,7 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRTableHeadRow 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.getTableHeadRowCss()));
19
14
  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("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 DSRTableHead 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.getTableHeadCss()));
19
14
  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("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 DSRTableRow 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.getTableRowCss()));
19
14
  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("slot", {}) })] }), this.props.children] }));
20
15
  }
@@ -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,14 +16,8 @@ class DSRTable extends react.Component {
15
16
  this.isScrollable = 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
- const namedSlottedChildren = 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); });
25
- const hasSlottedCaption = namedSlottedChildren.filter(({ props: { slot } }) => slot === 'caption').length > 0;
19
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
20
+ const hasSlottedCaption = namedSlotChildren.filter(({ props: { slot } }) => slot === 'caption').length > 0;
26
21
  const captionId = 'caption';
27
22
  const tableAttr = this.props.caption
28
23
  ? { 'aria-label': this.props.caption }
@@ -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 DSRTabsBar extends react.Component {
15
16
  this.direction = 'next';
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.getTabsBarCss(this.props.size, this.props.weight, this.props.theme)));
26
21
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(scroller_wrapper.PScroller, { className: "scroller", role: "tablist", theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, scrollIndicatorPosition: "top", children: [jsxRuntime.jsx("slot", {}), jsxRuntime.jsx("span", { className: "bar" })] })] }), this.props.children] }));
27
22
  }
@@ -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 DSRTabsItem 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.getTabsItemCss(this.props.theme || 'light' // 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] }));
@@ -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');
@@ -14,18 +15,12 @@ class DSRTabs extends react.Component {
14
15
  this.tabsItemElements = [];
15
16
  }
16
17
  render() {
17
- const children = Array.isArray(this.props.children)
18
- ? this.props.children
19
- : this.props.children
20
- ? [this.props.children]
21
- : [];
22
- children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
23
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
24
- const manipulatedChildren = children.map((child, i) => typeof child === 'object' && defaultChildren.includes(child)
18
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
19
+ const manipulatedChildren = children.map((child, i) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
25
20
  ? { ...child, props: { ...child.props, theme: this.props.theme, hidden: this.props.activeTabIndex !== i ? true : null } }
26
21
  : child);
27
22
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTabsCss()));
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.jsx(tabsBar_wrapper.PTabsBar, { className: "root", size: this.props.size, weight: this.props.weight, theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, activeTabIndex: this.props.activeTabIndex, children: defaultChildren.map((tab, index) => (jsxRuntime.jsx("button", { type: "button", children: tab.props.label }, index))) }), jsxRuntime.jsx("slot", {})] })] }), manipulatedChildren] }));
23
+ 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(tabsBar_wrapper.PTabsBar, { className: "root", size: this.props.size, weight: this.props.weight, theme: this.props.theme, gradientColorScheme: this.props.gradientColorScheme, activeTabIndex: this.props.activeTabIndex, children: otherChildren.map((tab, index) => (jsxRuntime.jsx("button", { type: "button", children: typeof tab === 'object' && 'props' in tab && tab.props.label }, index))) }), jsxRuntime.jsx("slot", {})] })] }), manipulatedChildren] }));
29
24
  }
30
25
  }
31
26
 
@@ -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 DSRTagDismissible 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 style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTagDismissibleCss(this.props.color, !!this.props.label)));
22
17
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("button", { type: "button", ...utilsEntry.parseAndGetAriaAttributes(this.props.aria), children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Remove:" }), this.props.label && jsxRuntime.jsx("span", { className: "label", children: this.props.label }), jsxRuntime.jsx("slot", {}), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "close", color: "inherit", "aria-hidden": "true" })] })] }), this.props.children] }));
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');
@@ -11,13 +12,7 @@ var icon_wrapper = require('../components/icon.wrapper.js');
11
12
 
12
13
  class DSRTag 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 style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTagCss(this.props.color, !!utilsEntry.getDirectChildHTMLElement(null, 'a,button'), this.props.theme)));
22
17
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("span", { children: [(this.props.icon || this.props.iconSource) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: this.props.icon, source: this.props.iconSource, color: "inherit", theme: this.props.theme, "aria-hidden": "true" })), jsxRuntime.jsx("div", { children: jsxRuntime.jsx("slot", {}) })] })] }), this.props.children] }));
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');
@@ -19,14 +20,8 @@ class DSRTextFieldWrapper extends react.Component {
19
20
  }
20
21
  render() {
21
22
  var _a, _b;
22
- const children = Array.isArray(this.props.children)
23
- ? this.props.children
24
- : this.props.children
25
- ? [this.props.children]
26
- : [];
27
- const namedSlottedChildren = children.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
28
- const defaultChildren = children.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
29
- const { readOnly, disabled, type } = ((_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
23
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
24
+ const { readOnly, disabled, type } = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props) || {};
30
25
  const disabledOrReadOnly = disabled || readOnly;
31
26
  const labelProps = {};
32
27
  const iconProps = {
@@ -37,17 +32,17 @@ class DSRTextFieldWrapper extends react.Component {
37
32
  const isPassword = utilsEntry.isType(type, 'password');
38
33
  utilsEntry.isWithinForm(this.props.host);
39
34
  const hasAction = utilsEntry.hasLocateAction(this.props.actionIcon);
40
- const hasCounter = false; // hasCounterAndIsTypeText(defaultChildren[0]?.props);
35
+ const hasCounter = false; // hasCounterAndIsTypeText(otherChildren[0]?.props);
41
36
  const isCounterVisible = this.props.showCharacterCount && hasCounter;
42
- const isClearable = !!((_b = defaultChildren[0]) === null || _b === void 0 ? void 0 : _b.props.value);
37
+ const isClearable = typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && !!((_b = otherChildren[0]) === null || _b === void 0 ? void 0 : _b.props.value);
43
38
  const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTextFieldWrapperCss(disabled, this.props.hideLabel, this.props.state, isCounterVisible, isCounterVisible ? 'suffix' : this.props.unitPosition, isPassword ? 'password' : type, this.props.isWithinForm, hasAction, hasAction && this.props.actionLoading)));
44
- 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" }) })), (isCounterVisible) && (jsxRuntime.jsx("span", { className: "unit", ...labelProps, "aria-hidden": "true", children: this.props.unit })), jsxRuntime.jsx("slot", {}), hasCounter ] }), isPassword ? (jsxRuntime.jsxs("button", { type: "button", disabled: disabled, "aria-pressed": this.props.showPassword ? 'true' : 'false', children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle password visibility" }), jsxRuntime.jsx(icon_wrapper.PIcon, { name: this.props.showPassword ? 'view-off' : 'view', ...iconProps })] })) : (isSearch && [
39
+ 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" }) })), (isCounterVisible) && (jsxRuntime.jsx("span", { className: "unit", ...labelProps, "aria-hidden": "true", children: this.props.unit })), jsxRuntime.jsx("slot", {}), hasCounter ] }), isPassword ? (jsxRuntime.jsxs("button", { type: "button", disabled: disabled, "aria-pressed": this.props.showPassword ? 'true' : 'false', children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Toggle password visibility" }), jsxRuntime.jsx(icon_wrapper.PIcon, { name: this.props.showPassword ? 'view-off' : 'view', ...iconProps })] })) : (isSearch && [
45
40
  jsxRuntime.jsx("button", { type: "button", tabIndex: -1, hidden: !isClearable, disabled: disabledOrReadOnly, children: jsxRuntime.jsx(icon_wrapper.PIcon, { name: "close", ...iconProps }) }, "btn-clear"),
46
41
  hasAction && (jsxRuntime.jsxs("button", { type: "button", hidden: isClearable, disabled: disabledOrReadOnly, children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Locate me" }), this.props.actionLoading ? (jsxRuntime.jsx(spinner_wrapper.PSpinner, { size: "inherit" })) : (
47
42
  // hardcoded locate icon
48
43
  jsxRuntime.jsx(icon_wrapper.PIcon, { name: "locate", ...iconProps }))] }, "btn-action")),
49
44
  this.props.isWithinForm ? (jsxRuntime.jsxs("button", { type: "submit", disabled: disabledOrReadOnly, children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Search" }), jsxRuntime.jsx(icon_wrapper.PIcon, { name: "search", ...iconProps })] }, "btn-submit")) : (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "search", ...iconProps }, "icon")),
50
- ])] }), (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] }));
45
+ ])] }), (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] }));
51
46
  }
52
47
  }
53
48
 
@@ -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 DSRTextListItem 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.getTextListItemCss(this.props.listType || 'unordered', // default as fallback
19
14
  this.props.orderType || 'numbered' // default as fallback
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,14 +9,8 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
8
9
 
9
10
  class DSRTextList 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, listType: this.props.listType, orderType: this.props.orderType } }
20
15
  : child);
21
16
  const TagType = this.props.listType === 'unordered' ? 'ul' : 'ol';
@@ -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 DSRText 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 firstChild = utilsEntry.getHTMLElement(null, ':first-child');
20
15
  const hasSlottedTextTag = firstChild === null || firstChild === void 0 ? void 0 : firstChild.matches('p,span,div,address,blockquote,figcaption,cite,time,legend');
21
16
  const TagType = hasSlottedTextTag ? 'div' : this.props.tag;
@@ -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,16 +11,10 @@ var stateMessage = require('./state-message.js');
10
11
  class DSRTextareaWrapper 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); });
14
+ const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
20
15
  const labelProps = {};
21
- const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTextareaWrapperCss((_a = defaultChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled, this.props.hideLabel, this.props.state, this.props.isCounterVisible, this.props.hasCounter)));
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("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" }) })), this.props.isCounterVisible && (jsxRuntime.jsx("span", { className: "counter", ...labelProps, "aria-hidden": "true" })), jsxRuntime.jsx("slot", {}), this.props.hasCounter && jsxRuntime.jsx("span", { className: "sr-only", "aria-live": "polite" })] }), (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] }));
16
+ const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getTextareaWrapperCss(typeof otherChildren[0] === 'object' && 'props' in otherChildren[0] && ((_a = otherChildren[0]) === null || _a === void 0 ? void 0 : _a.props.disabled), this.props.hideLabel, this.props.state, this.props.isCounterVisible, this.props.hasCounter)));
17
+ 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", { 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" }) })), this.props.isCounterVisible && (jsxRuntime.jsx("span", { className: "counter", ...labelProps, "aria-hidden": "true" })), jsxRuntime.jsx("slot", {}), this.props.hasCounter && jsxRuntime.jsx("span", { className: "sr-only", "aria-live": "polite" })] }), (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] }));
23
18
  }
24
19
  }
25
20
 
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ /**
6
+ * @param children derived from PropsWithChildren
7
+ *
8
+ * type PropsWithChildren<P = unknown> = P & { children?: ReactNode | undefined };
9
+ * type ReactNode = ReactElement | string | number | ReactFragment | ReactPortal | boolean | null | undefined;
10
+ * interface ReactElement<P = any, T extends string | JSXElementConstructor<any> = string | JSXElementConstructor<any>> {
11
+ * type: T;
12
+ * props: P;
13
+ * key: Key | null;
14
+ * }
15
+ */
16
+ const splitChildren = (children) => {
17
+ children =
18
+ typeof children === 'object' && 'type' in children && children.type === react.Fragment
19
+ ? children.props.children // Unpack children of React.Fragment
20
+ : children;
21
+ const childrenArray = (Array.isArray(children) ? children : children ? [children] : []).filter((x) => x !== undefined && x !== null // children are filtered due to cases where conditionally rendered children can be undefined.
22
+ );
23
+ const otherChildren = childrenArray.filter((child) => { var _a; return !((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot); });
24
+ const namedSlotChildren = childrenArray.filter((child) => { var _a; return (_a = child.props) === null || _a === void 0 ? void 0 : _a.slot; });
25
+ return { children: childrenArray, namedSlotChildren, otherChildren };
26
+ };
27
+
28
+ exports.splitChildren = splitChildren;