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

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 (161) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/OSS_NOTICE +195 -855
  3. package/README.md +0 -5
  4. package/bin/patchRemixRunProcessBrowserGlobalIdentifier.js +0 -0
  5. package/cjs/lib/components/segmented-control.wrapper.cjs +3 -3
  6. package/esm/hooks.mjs +1 -1
  7. package/esm/lib/components/segmented-control.wrapper.d.ts +10 -0
  8. package/esm/lib/components/segmented-control.wrapper.mjs +3 -3
  9. package/esm/lib/types.d.ts +29 -25
  10. package/global-styles/cn/index.css +42 -39
  11. package/global-styles/color-scheme.css +24 -24
  12. package/global-styles/index.css +42 -39
  13. package/global-styles/variables.css +18 -15
  14. package/package.json +3 -3
  15. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +497 -249
  16. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +47 -12
  17. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.cjs +4 -4
  18. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.cjs +1 -1
  19. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +14 -9
  20. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.cjs +1 -1
  21. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.cjs +1 -1
  22. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.cjs +3 -2
  23. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-item.cjs +1 -1
  24. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset.cjs +1 -1
  25. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.cjs +1 -1
  26. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.cjs +13 -9
  27. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +3 -1
  28. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs +1 -1
  29. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +4 -5
  30. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/notification-base.cjs +10 -0
  31. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.cjs +5 -2
  32. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.cjs +1 -1
  33. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group-option.cjs +1 -2
  34. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group.cjs +4 -2
  35. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.cjs +1 -1
  36. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.cjs +8 -4
  37. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +6 -5
  38. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.cjs +1 -1
  39. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.cjs +1 -3
  40. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.cjs +1 -1
  41. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.cjs +1 -1
  42. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.cjs +1 -1
  43. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.cjs +4 -24
  44. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.cjs +1 -1
  45. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.cjs +4 -2
  46. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +497 -250
  47. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +45 -13
  48. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/hooks.mjs +1 -1
  49. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.mjs +4 -4
  50. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +1 -1
  51. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +14 -9
  52. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +1 -1
  53. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +1 -1
  54. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +1 -1
  55. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +5 -4
  56. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.mjs +1 -1
  57. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-item.mjs +1 -1
  58. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset.mjs +1 -1
  59. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flag.mjs +1 -1
  60. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +1 -1
  61. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/icon.mjs +1 -1
  62. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +13 -9
  63. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +4 -2
  64. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.mjs +1 -1
  65. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs +1 -1
  66. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +5 -6
  67. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/notification-base.mjs +8 -0
  68. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pin-code.mjs +6 -3
  69. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.mjs +1 -1
  70. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group-option.mjs +1 -2
  71. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-group.mjs +5 -3
  72. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.mjs +1 -1
  73. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.mjs +10 -6
  74. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +7 -6
  75. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/sheet.mjs +1 -1
  76. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.mjs +1 -3
  77. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.mjs +1 -1
  78. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.mjs +1 -1
  79. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.mjs +1 -1
  80. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.mjs +4 -24
  81. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.mjs +1 -1
  82. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.mjs +5 -3
  83. package/ssr/esm/lib/components/segmented-control.wrapper.d.ts +10 -0
  84. package/ssr/esm/lib/dsr-components/accordion.d.ts +1 -0
  85. package/ssr/esm/lib/dsr-components/banner.d.ts +6 -2
  86. package/ssr/esm/lib/dsr-components/button-pure.d.ts +1 -0
  87. package/ssr/esm/lib/dsr-components/button-tile.d.ts +1 -0
  88. package/ssr/esm/lib/dsr-components/button.d.ts +1 -0
  89. package/ssr/esm/lib/dsr-components/canvas.d.ts +1 -0
  90. package/ssr/esm/lib/dsr-components/carousel.d.ts +1 -0
  91. package/ssr/esm/lib/dsr-components/checkbox.d.ts +1 -0
  92. package/ssr/esm/lib/dsr-components/crest.d.ts +1 -0
  93. package/ssr/esm/lib/dsr-components/display.d.ts +1 -0
  94. package/ssr/esm/lib/dsr-components/divider.d.ts +1 -0
  95. package/ssr/esm/lib/dsr-components/drilldown-item.d.ts +1 -0
  96. package/ssr/esm/lib/dsr-components/drilldown-link.d.ts +1 -0
  97. package/ssr/esm/lib/dsr-components/drilldown.d.ts +1 -0
  98. package/ssr/esm/lib/dsr-components/fieldset.d.ts +1 -0
  99. package/ssr/esm/lib/dsr-components/flag.d.ts +1 -0
  100. package/ssr/esm/lib/dsr-components/flyout.d.ts +1 -0
  101. package/ssr/esm/lib/dsr-components/heading.d.ts +1 -0
  102. package/ssr/esm/lib/dsr-components/icon.d.ts +1 -0
  103. package/ssr/esm/lib/dsr-components/inline-notification.d.ts +4 -2
  104. package/ssr/esm/lib/dsr-components/input-base.d.ts +1 -0
  105. package/ssr/esm/lib/dsr-components/input-date.d.ts +1 -0
  106. package/ssr/esm/lib/dsr-components/input-email.d.ts +1 -0
  107. package/ssr/esm/lib/dsr-components/input-month.d.ts +1 -0
  108. package/ssr/esm/lib/dsr-components/input-number.d.ts +1 -0
  109. package/ssr/esm/lib/dsr-components/input-password.d.ts +1 -0
  110. package/ssr/esm/lib/dsr-components/input-search.d.ts +1 -0
  111. package/ssr/esm/lib/dsr-components/input-tel.d.ts +1 -0
  112. package/ssr/esm/lib/dsr-components/input-text.d.ts +1 -0
  113. package/ssr/esm/lib/dsr-components/input-time.d.ts +1 -0
  114. package/ssr/esm/lib/dsr-components/input-url.d.ts +1 -0
  115. package/ssr/esm/lib/dsr-components/input-week.d.ts +1 -0
  116. package/ssr/esm/lib/dsr-components/label.d.ts +1 -0
  117. package/ssr/esm/lib/dsr-components/link-pure.d.ts +1 -0
  118. package/ssr/esm/lib/dsr-components/link-tile-product.d.ts +1 -0
  119. package/ssr/esm/lib/dsr-components/link-tile.d.ts +1 -0
  120. package/ssr/esm/lib/dsr-components/link.d.ts +1 -0
  121. package/ssr/esm/lib/dsr-components/modal.d.ts +1 -0
  122. package/ssr/esm/lib/dsr-components/model-signature.d.ts +1 -0
  123. package/ssr/esm/lib/dsr-components/multi-select-option.d.ts +1 -0
  124. package/ssr/esm/lib/dsr-components/multi-select.d.ts +1 -0
  125. package/ssr/esm/lib/dsr-components/notification-base.d.ts +14 -0
  126. package/ssr/esm/lib/dsr-components/optgroup.d.ts +1 -0
  127. package/ssr/esm/lib/dsr-components/pagination.d.ts +1 -0
  128. package/ssr/esm/lib/dsr-components/pin-code.d.ts +1 -0
  129. package/ssr/esm/lib/dsr-components/popover.d.ts +1 -0
  130. package/ssr/esm/lib/dsr-components/radio-group-option.d.ts +1 -0
  131. package/ssr/esm/lib/dsr-components/radio-group.d.ts +1 -0
  132. package/ssr/esm/lib/dsr-components/scroller.d.ts +1 -0
  133. package/ssr/esm/lib/dsr-components/segmented-control-item.d.ts +1 -0
  134. package/ssr/esm/lib/dsr-components/segmented-control.d.ts +1 -0
  135. package/ssr/esm/lib/dsr-components/select-option.d.ts +1 -0
  136. package/ssr/esm/lib/dsr-components/select.d.ts +1 -0
  137. package/ssr/esm/lib/dsr-components/sheet.d.ts +1 -0
  138. package/ssr/esm/lib/dsr-components/spinner.d.ts +1 -0
  139. package/ssr/esm/lib/dsr-components/stepper-horizontal-item.d.ts +1 -0
  140. package/ssr/esm/lib/dsr-components/stepper-horizontal.d.ts +1 -0
  141. package/ssr/esm/lib/dsr-components/switch.d.ts +1 -0
  142. package/ssr/esm/lib/dsr-components/table-body.d.ts +1 -0
  143. package/ssr/esm/lib/dsr-components/table-cell.d.ts +1 -0
  144. package/ssr/esm/lib/dsr-components/table-head-cell.d.ts +1 -0
  145. package/ssr/esm/lib/dsr-components/table-head-row.d.ts +1 -0
  146. package/ssr/esm/lib/dsr-components/table-head.d.ts +1 -0
  147. package/ssr/esm/lib/dsr-components/table-row.d.ts +1 -0
  148. package/ssr/esm/lib/dsr-components/table.d.ts +1 -0
  149. package/ssr/esm/lib/dsr-components/tabs-bar.d.ts +1 -0
  150. package/ssr/esm/lib/dsr-components/tabs-item.d.ts +1 -0
  151. package/ssr/esm/lib/dsr-components/tabs.d.ts +1 -0
  152. package/ssr/esm/lib/dsr-components/tag-dismissible.d.ts +1 -0
  153. package/ssr/esm/lib/dsr-components/tag.d.ts +1 -0
  154. package/ssr/esm/lib/dsr-components/text-list-item.d.ts +1 -0
  155. package/ssr/esm/lib/dsr-components/text-list.d.ts +1 -0
  156. package/ssr/esm/lib/dsr-components/text.d.ts +1 -0
  157. package/ssr/esm/lib/dsr-components/textarea.d.ts +1 -0
  158. package/ssr/esm/lib/dsr-components/toast.d.ts +1 -0
  159. package/ssr/esm/lib/dsr-components/wordmark.d.ts +1 -0
  160. package/ssr/esm/lib/types.d.ts +29 -25
  161. package/tailwindcss/index.css +277 -78
@@ -3185,7 +3185,7 @@ var jssPluginSortMediaQueries = /*@__PURE__*/getDefaultExportFromCjs(distExports
3185
3185
  const getTagName = (el) => el.tagName.toLowerCase();
3186
3186
  const getTagNameWithoutPrefix = (host) => {
3187
3187
  const tagName = getTagName(host);
3188
- const [, tagNameWithoutPrefix = ''] = /^(?:[a-z-]+-)?(p-[a-z-]+)$/.exec(tagName) || [];
3188
+ const [, tagNameWithoutPrefix = ''] = /^(?:[a-z0-9-]+-)?(p-[a-z-]+)$/.exec(tagName) || [];
3189
3189
  return (tagNameWithoutPrefix || tagName); // return tagName as fallback for default tags
3190
3190
  };
3191
3191
 
@@ -3250,21 +3250,38 @@ const parseAndGetAriaAttributes = (rawAttributes) => {
3250
3250
  }
3251
3251
  return undefined;
3252
3252
  };
3253
+ /**
3254
+ * Builds a space-separated IDREF string from conditional ID entries.
3255
+ * Returns `null` when no IDs are truthy — safe for JSX attribute assignment.
3256
+ */
3257
+ const setAriaIDREF = (...ids) => {
3258
+ const result = ids.filter(Boolean).join(' ');
3259
+ return result || null;
3260
+ };
3253
3261
 
3254
3262
  const getButtonBaseAriaAttributes = (isDisabled, isLoading) => {
3255
3263
  return {
3256
3264
  'aria-disabled': isDisabledOrLoading(isDisabled, isLoading) ? 'true' : null,
3257
3265
  };
3258
3266
  };
3259
- // TODO: Can this be shared with select-wrapper dropdown?
3260
- const getComboboxAriaAttributes = (isOpen, isRequired, labelId, descriptionId, dropdownId) => {
3267
+
3268
+ const getComboboxAriaAttributes = (isOpen, isRequired, labelId, messageId, descriptionId, listboxId) => {
3261
3269
  return {
3262
3270
  'aria-labelledby': labelId || null,
3263
- 'aria-describedby': descriptionId || null,
3271
+ 'aria-describedby': setAriaIDREF(messageId, descriptionId),
3264
3272
  'aria-haspopup': 'listbox',
3265
3273
  'aria-expanded': isOpen ? 'true' : 'false',
3266
3274
  'aria-required': isRequired ? 'true' : 'false',
3267
- 'aria-controls': dropdownId,
3275
+ 'aria-controls': listboxId || null,
3276
+ };
3277
+ };
3278
+ const getListboxAriaAttributes = (isRequired, labelId, messageId, descriptionId, multiselectable) => {
3279
+ return {
3280
+ role: 'listbox',
3281
+ 'aria-labelledby': labelId || null,
3282
+ 'aria-describedby': setAriaIDREF(messageId, descriptionId),
3283
+ 'aria-required': isRequired ? 'true' : 'false',
3284
+ 'aria-multiselectable': multiselectable ? 'true' : 'false',
3268
3285
  };
3269
3286
  };
3270
3287
 
@@ -3435,7 +3452,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3435
3452
  'showPicker' in HTMLInputElement.prototype &&
3436
3453
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3437
3454
 
3438
- const prefix = `[Porsche Design System v${"4.0.0-rc.1"}]` // this part isn't covered by unit tests
3455
+ const prefix = `[Porsche Design System v${"4.0.0"}]` // this part isn't covered by unit tests
3439
3456
  ;
3440
3457
  const consoleError$1 = (...messages) => {
3441
3458
  console.error(prefix, ...messages);
@@ -3556,13 +3573,12 @@ const internalValidateProps = {
3556
3573
  const breakpointCustomizableTemplate = `value, ${internalValidateProps
3557
3574
  .formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {}))
3558
3575
  .replace(/"/g, '')}`;
3559
- const getBannerAriaAttributes = (state, labelId, descriptionId) => {
3576
+ const getBannerAriaAttributes = (state, heading) => {
3560
3577
  const isAlert = state === 'warning' || state === 'error';
3561
3578
  return {
3562
3579
  role: isAlert ? 'alert' : 'status',
3563
3580
  'aria-live': isAlert ? 'assertive' : 'polite',
3564
- 'aria-labelledby': labelId,
3565
- 'aria-describedby': descriptionId,
3581
+ 'aria-label': heading || null,
3566
3582
  };
3567
3583
  };
3568
3584
  const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
@@ -3713,13 +3729,12 @@ const buildIconUrl = (iconNameOrSource = DEFAULT_ICON_NAME) => {
3713
3729
  }
3714
3730
  return buildIconUrl(DEFAULT_ICON_NAME);
3715
3731
  };
3716
- const getInlineNotificationAriaAttributes = (state, labelId, descriptionId) => {
3732
+ const getInlineNotificationAriaAttributes = (state, heading) => {
3717
3733
  const isAlert = state === 'warning' || state === 'error';
3718
3734
  return {
3719
3735
  role: isAlert ? 'alert' : 'status',
3720
3736
  'aria-live': isAlert ? 'assertive' : 'polite',
3721
- 'aria-labelledby': labelId,
3722
- 'aria-describedby': descriptionId,
3737
+ 'aria-label': heading || null,
3723
3738
  };
3724
3739
  };
3725
3740
  const getSvgUrl = (model) => {
@@ -3886,6 +3901,23 @@ const getSwitchButtonAriaAttributes = (isDisabled, isLoading, isChecked) => {
3886
3901
  const isSortable = (active, direction) => {
3887
3902
  return active !== undefined && direction !== undefined;
3888
3903
  };
3904
+ /**
3905
+ * Clamps and validates a tab index against the available tabs array.
3906
+ * Returns `undefined` if the index is out of range or invalid.
3907
+ * @internal
3908
+ */
3909
+ const getSanitizedActiveTabIndex = (tabIndex, tabs) => {
3910
+ const maxIndex = tabs.length - 1; // can be -1 without children
3911
+ if (tabIndex === undefined ||
3912
+ tabIndex === null ||
3913
+ !Number.isInteger(tabIndex) ||
3914
+ maxIndex < 0 ||
3915
+ tabIndex < 0 ||
3916
+ tabIndex > maxIndex) {
3917
+ return undefined;
3918
+ }
3919
+ return tabIndex;
3920
+ };
3889
3921
  const isListTypeOrdered = (type) => {
3890
3922
  return type !== 'unordered';
3891
3923
  };
@@ -3898,4 +3930,4 @@ const getTextTagType = (host, tag) => {
3898
3930
  return tag;
3899
3931
  };
3900
3932
 
3901
- export { DISPLAY_TAGS, HEADING_TAGS, ItemType, TEXT_TAGS, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, consoleError$1 as consoleError, createPaginationItems, createRange, crestSize, descriptionId, displaySizeToTagMap, getBannerAriaAttributes, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getComboboxAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getInlineNotificationAriaAttributes, getSegmentedControlItemAriaAttributes, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, internalDrilldown, isCurrentInput, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isSortable, isStateCompleteOrWarning, isUrl, labelId, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateDrilldownItemState };
3933
+ export { DISPLAY_TAGS, HEADING_TAGS, ItemType, TEXT_TAGS, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, consoleError$1 as consoleError, createPaginationItems, createRange, crestSize, descriptionId, displaySizeToTagMap, getBannerAriaAttributes, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getComboboxAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getInlineNotificationAriaAttributes, getListboxAriaAttributes, getSanitizedActiveTabIndex, getSegmentedControlItemAriaAttributes, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, internalDrilldown, isCurrentInput, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isSortable, isStateCompleteOrWarning, isUrl, labelId, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, setAriaIDREF, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateDrilldownItemState };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useLayoutEffect, useEffect, useContext, useRef, useMemo } from 'react';
2
+ import { useContext, useEffect, useRef, useMemo, useLayoutEffect } from 'react';
3
3
  import { PorscheDesignSystemContext } from './provider.mjs';
4
4
  import { getMergedClassName } from './utils.mjs';
5
5
 
@@ -5,22 +5,22 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
5
5
  import { syncRef } from '../../utils.mjs';
6
6
  import { DSRSegmentedControl } from '../dsr-components/segmented-control.mjs';
7
7
 
8
- const PSegmentedControl = /*#__PURE__*/ forwardRef(({ columns = 'auto', compact = false, description = '', disabled = false, form, hideLabel = false, label = '', message = '', name, onBlur, onChange, required = false, state = 'none', value, className, children, ...rest }, ref) => {
8
+ const PSegmentedControl = /*#__PURE__*/ forwardRef(({ columns = 'auto', compact = false, description = '', disabled = false, form, hideLabel = false, label = '', message = '', name, noWrap = false, onBlur, onChange, required = false, state = 'none', value, className, children, ...rest }, ref) => {
9
9
  const elementRef = useRef(undefined);
10
10
  useEventCallback(elementRef, 'blur', onBlur);
11
11
  useEventCallback(elementRef, 'change', onChange);
12
12
  const WebComponentTag = usePrefix('p-segmented-control');
13
- const propsToSync = [columns, compact, description, disabled, form, hideLabel, label, message, name, required, state, value];
13
+ const propsToSync = [columns, compact, description, disabled, form, hideLabel, label, message, name, noWrap, required, state, value];
14
14
  useBrowserLayoutEffect(() => {
15
15
  const { current } = elementRef;
16
- ['columns', 'compact', 'description', 'disabled', 'form', 'hideLabel', 'label', 'message', 'name', 'required', 'state', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
+ ['columns', 'compact', 'description', 'disabled', 'form', 'hideLabel', 'label', 'message', 'name', 'noWrap', 'required', 'state', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
17
17
  }, propsToSync);
18
18
  const props = {
19
19
  ...rest,
20
20
  // @ts-ignore
21
21
  ...(!process.browser
22
22
  ? {
23
- children: (jsx(DSRSegmentedControl, { columns, compact, description, disabled, form, hideLabel, label, message, name, required, state, value, children })),
23
+ children: (jsx(DSRSegmentedControl, { columns, compact, description, disabled, form, hideLabel, label, message, name, noWrap, required, state, value, children })),
24
24
  }
25
25
  : {
26
26
  children,
@@ -19,7 +19,7 @@ class DSRAccordion extends Component {
19
19
  hasSummaryBefore;
20
20
  hasSummaryAfter;
21
21
  render() {
22
- const { namedSlotChildren} = splitChildren(this.props.children);
22
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
23
23
  const hasSummary = namedSlotChildren.filter(({ props: { slot } }) => slot === 'summary').length > 0;
24
24
  const hasSummaryBefore = namedSlotChildren.filter(({ props: { slot } }) => slot === 'summary-before').length > 0;
25
25
  const hasSummaryAfter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'summary-after').length > 0;
@@ -5,11 +5,13 @@ import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getBannerCss as getComponentCss$18 } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
7
  import { getBannerAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
+ import { NotificationBase } from './notification-base.mjs';
8
9
  import { PButton } from '../components/button.wrapper.mjs';
9
10
 
10
11
  /**
11
- * @slot {"name": "heading", "description": "Defines the heading used in the banner. Can be used alternatively to the heading prop. Can be used for rich content.", "hasAltProp": true }
12
- * @slot {"name": "description", "description": "Defines the description used in the banner. Can be used alternatively to the description prop. Can be used for rich content.", "hasAltProp": true }
12
+ * @slot {"name": "heading", "description": "Defines the heading of the banner. Can be used as an alternative to the `heading` prop for rich content." }
13
+ * @slot {"name": "", "description": "Default slot for the banner description content." }
14
+ * @slot {"name": "description", "description": "Deprecated: Use the default slot instead.", "isDeprecated": true }
13
15
  *
14
16
  * @controlled {"props": ["open"], "event": "dismiss"}
15
17
  */
@@ -17,14 +19,17 @@ class DSRBanner extends Component {
17
19
  host;
18
20
  refPopover;
19
21
  refDismiss;
22
+ hasHeadingSlot;
23
+ hasDescriptionSlot;
20
24
  render() {
21
- splitChildren(this.props.children);
22
- const bannerId = 'banner';
23
- const labelId = 'heading';
24
- const descriptionId = 'description';
25
- const Heading = this.props.headingTag;
26
- const style = minifyCss(getComponentCss$18(this.props.open, this.props.position, this.props.state, this.props.dismissButton));
27
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("div", { id: bannerId, popover: "manual", "aria-hidden": this.props.open ? 'false' : 'true', ...getBannerAriaAttributes(this.props.state, labelId, descriptionId), children: jsxs("div", { className: "banner", children: [this.props.heading ? jsx(Heading, { id: labelId, children: this.props.heading }) : jsx("slot", { name: "heading" }), this.props.description ? jsx("p", { id: descriptionId, children: this.props.description }) : jsx("slot", { name: "description" }), this.props.dismissButton && (jsx(PButton, { className: "dismiss", type: "button", variant: "secondary", icon: "close", hideLabel: true, compact: true, "aria-controls": bannerId, children: "Close banner" }))] }) })] }), this.props.children] }));
25
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
26
+ const hasHeadingSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0;
27
+ const hasDescriptionSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0;
28
+ const headingText = this.props.heading ? this.props.heading : namedSlotChildren.find(({ props: { slot } }) => slot === 'heading')?.props.children;
29
+ const style = minifyCss(getComponentCss$18(this.props.open, this.props.position, this.props.state, this.props.dismissButton, !!(this.props.heading || hasHeadingSlot)));
30
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx("div", { popover: "manual", "aria-hidden": this.props.open ? 'false' : 'true', ...getBannerAriaAttributes(this.props.state, headingText), children: jsx(NotificationBase, { heading: this.props.heading, headingTag: this.props.headingTag, hasHeadingSlot: hasHeadingSlot, description: this.props.description, hasDescriptionSlot: hasDescriptionSlot, ...(this.props.dismissButton && {
31
+ dismissButton: (jsx(PButton, { className: "dismiss", type: "button", variant: "secondary", icon: "close", hideLabel: true, compact: true, ...(headingText ? { aria: { 'aria-description': headingText } } : {}), children: "Close banner" })),
32
+ }) }) })] }), this.props.children] }));
28
33
  }
29
34
  }
30
35
 
@@ -4,7 +4,7 @@ import '../../provider.mjs';
4
4
  import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getButtonCss as getComponentCss$15 } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
- import { hasVisibleIcon, getButtonAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
7
+ import { getButtonAriaAttributes, hasVisibleIcon } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
8
  import { loadingId, LoadingMessage } from './loading-message.mjs';
9
9
  import { PIcon } from '../components/icon.wrapper.mjs';
10
10
  import { PSpinner } from '../components/spinner.wrapper.mjs';
@@ -28,7 +28,7 @@ class DSRCanvas extends Component {
28
28
  hasFooter;
29
29
  hasBackground;
30
30
  render() {
31
- const { namedSlotChildren} = splitChildren(this.props.children);
31
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
32
32
  const hasTitle = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
33
33
  const hasSidebarEnd = namedSlotChildren.filter(({ props: { slot } }) => slot === 'sidebar-end').length > 0;
34
34
  const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
@@ -32,7 +32,7 @@ class DSRCarousel extends Component {
32
32
  return this.props.slidesPerPage === 'auto' || this.props.amountOfPages > 1;
33
33
  }
34
34
  render() {
35
- const { namedSlotChildren, otherChildren } = splitChildren(this.props.children);
35
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
36
36
  const hasHeadingPropOrSlot = (this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0);
37
37
  const hasDescriptionPropOrSlot = (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0);
38
38
  const hasControlsSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'controls').length > 0;
@@ -4,8 +4,8 @@ import '../../provider.mjs';
4
4
  import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getCheckboxCss as getComponentCss$12 } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
- import { descriptionId } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
- import { LoadingMessage } from './loading-message.mjs';
7
+ import { setAriaIDREF } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
+ import { loadingId, LoadingMessage } from './loading-message.mjs';
9
9
  import { Label } from './label.mjs';
10
10
  import { messageId, StateMessage } from './state-message.mjs';
11
11
  import { PSpinner } from '../components/spinner.wrapper.mjs';
@@ -33,10 +33,11 @@ class DSRCheckbox extends Component {
33
33
  formStateRestoreCallback() {
34
34
  }
35
35
  render() {
36
- const { namedSlotChildren} = splitChildren(this.props.children);
36
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
37
+ const selectMessageId = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) ? messageId : undefined;
37
38
  const id = 'x';
38
39
  const style = minifyCss(getComponentCss$12(this.props.hideLabel, this.props.state, this.props.disabled, this.props.loading, this.props.compact));
39
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsxs("div", { className: "wrapper", children: [jsxs("div", { className: "input-wrapper", children: [jsx("input", { type: "checkbox", id: id, "aria-describedby": `${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading || this.props.disabled ? 'true' : null, checked: this.props.checked, form: this.props.form, value: this.props.value, name: this.props.name, onBlur: this.props.onBlur, required: this.props.required, disabled: this.props.disabled }), this.props.loading && jsx(PSpinner, { className: "spinner", "aria-hidden": "true" })] }), jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, htmlFor: id, label: this.props.label, isLoading: this.props.loading, isDisabled: this.props.disabled, isRequired: this.props.required })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
40
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsxs("div", { className: "wrapper", children: [jsxs("div", { className: "input-wrapper", children: [jsx("input", { type: "checkbox", id: id, "aria-describedby": setAriaIDREF(this.props.loading && loadingId, selectMessageId), "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading || this.props.disabled ? 'true' : null, checked: this.props.checked, form: this.props.form, value: this.props.value, name: this.props.name, onBlur: this.props.onBlur, required: this.props.required, disabled: this.props.disabled }), this.props.loading && jsx(PSpinner, { className: "spinner", "aria-hidden": "true" })] }), jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, htmlFor: id, label: this.props.label, isLoading: this.props.loading, isDisabled: this.props.disabled, isRequired: this.props.required })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
40
41
  }
41
42
  }
42
43
 
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { Component } from 'react';
3
3
  import { minifyCss } from '../../minifyCss.mjs';
4
4
  import { getCrestCss as getComponentCss$11 } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
5
- import { buildCrestSrcSet, crestSize, buildCrestImgSrc, parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
5
+ import { buildCrestSrcSet, buildCrestImgSrc, parseAndGetAriaAttributes, crestSize } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
6
6
 
7
7
  const { width, height } = crestSize;
8
8
  class DSRCrest extends Component {
@@ -18,7 +18,7 @@ class DSRDrilldownItem extends Component {
18
18
  hasSlottedHeader;
19
19
  hasSlottedButton;
20
20
  render() {
21
- const { namedSlotChildren} = splitChildren(this.props.children);
21
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
22
22
  const hasSlottedHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;
23
23
  const hasSlottedButton = namedSlotChildren.filter(({ props: { slot } }) => slot === 'button').length > 0;
24
24
  const style = minifyCss(getComponentCss$Z(this.props.primary, this.props.secondary, this.props.cascade));
@@ -15,7 +15,7 @@ import { messageId, StateMessage } from './state-message.mjs';
15
15
  class DSRFieldset extends Component {
16
16
  host;
17
17
  render() {
18
- const { namedSlotChildren} = splitChildren(this.props.children);
18
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
19
19
  const hasMessageValue = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state);
20
20
  const style = minifyCss(getComponentCss$X(this.props.state, this.props.labelSize, (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0)));
21
21
  return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("fieldset", { "aria-describedby": hasMessageValue ? messageId : null, ...getFieldsetAriaAttributes(this.props.required, this.props.state === 'error', this.props.aria), children: [(this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && (jsxs("legend", { children: [this.props.label || jsx("slot", { name: "label" }), this.props.required && jsx(Required, {})] })), jsx("slot", {}), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { Component } from 'react';
3
3
  import { minifyCss } from '../../minifyCss.mjs';
4
4
  import { getFlagCss as getComponentCss$W } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
5
- import { parseAndGetAriaAttributes, buildFlagUrl } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
5
+ import { buildFlagUrl, parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
6
6
 
7
7
  class DSRFlag extends Component {
8
8
  host;
@@ -25,7 +25,7 @@ class DSRFlyout extends Component {
25
25
  hasFooter;
26
26
  hasSubFooter;
27
27
  render() {
28
- const { namedSlotChildren} = splitChildren(this.props.children);
28
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
29
29
  const hasHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;
30
30
  const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
31
31
  const hasSubFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'sub-footer').length > 0;
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { Component } from 'react';
3
3
  import { minifyCss } from '../../minifyCss.mjs';
4
4
  import { getIconCss as getComponentCss$T } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
5
- import { parseAndGetAriaAttributes, buildIconUrl } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
5
+ import { buildIconUrl, parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
6
6
 
7
7
  class DSRIcon extends Component {
8
8
  host;
@@ -5,23 +5,27 @@ import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getInlineNotificationCss as getComponentCss$S } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
7
  import { getInlineNotificationAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
+ import { NotificationBase } from './notification-base.mjs';
8
9
  import { PButton } from '../components/button.wrapper.mjs';
9
10
  import { PButtonPure } from '../components/button-pure.wrapper.mjs';
10
11
 
11
12
  /**
12
- * @slot {"name": "heading", "description": "Shows a heading. Can be used to render rich markup." }
13
- * @slot {"name": "", "description": "Default slot to render a description. Can be used to render rich markup." }
13
+ * @slot {"name": "heading", "description": "Defines the heading of the inline notification. Can be used as an alternative to the `heading` prop for rich content." }
14
+ * @slot {"name": "", "description": "Default slot for the inline notification description content." }
14
15
  */
15
16
  class DSRInlineNotification extends Component {
16
17
  host;
18
+ hasHeadingSlot;
17
19
  render() {
18
- splitChildren(this.props.children);
19
- const notificationId = 'notification';
20
- const labelId = 'heading';
21
- const descriptionId = 'description';
22
- const Heading = this.props.headingTag;
23
- const style = minifyCss(getComponentCss$S(this.props.state, !!this.props.actionLabel, this.props.dismissButton));
24
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { id: notificationId, className: "notification", ...getInlineNotificationAriaAttributes(this.props.state, labelId, descriptionId), children: [this.props.heading ? jsx(Heading, { id: labelId, children: this.props.heading }) : jsx("slot", { name: "heading" }), this.props.description ? jsx("p", { id: descriptionId, children: this.props.description }) : jsx("slot", {}), this.props.actionLabel && (jsx(PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), this.props.dismissButton && (jsx(PButton, { className: "dismiss", type: "button", variant: "secondary", icon: "close", hideLabel: true, compact: true, "aria-controls": notificationId, children: "Close notification" }))] })] }), this.props.children] }));
20
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
21
+ const hasHeadingSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0;
22
+ const headingText = this.props.heading ? this.props.heading : namedSlotChildren.find(({ props: { slot } }) => slot === 'heading')?.props.children;
23
+ const style = minifyCss(getComponentCss$S(this.props.state, !!this.props.actionLabel, this.props.dismissButton, !!(this.props.heading || hasHeadingSlot)));
24
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(NotificationBase, { ...getInlineNotificationAriaAttributes(this.props.state, headingText), heading: this.props.heading, headingTag: this.props.headingTag, hasHeadingSlot: hasHeadingSlot, description: this.props.description, ...(this.props.actionLabel && {
25
+ actionLabel: (jsx(PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })),
26
+ }), ...(this.props.dismissButton && {
27
+ dismissButton: (jsx(PButton, { className: "dismiss", type: "button", variant: "secondary", icon: "close", hideLabel: true, compact: true, ...(headingText ? { aria: { 'aria-description': headingText } } : {}), children: "Close notification" })),
28
+ }) })] }), this.props.children] }));
25
29
  }
26
30
  }
27
31
 
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { splitChildren } from '../../splitChildren.mjs';
3
3
  import 'react';
4
4
  import '../../provider.mjs';
5
- import { descriptionId } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
5
+ import { descriptionId, setAriaIDREF } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
6
6
  import { loadingId, LoadingMessage } from './loading-message.mjs';
7
7
  import { Label } from './label.mjs';
8
8
  import { messageId, StateMessage } from './state-message.mjs';
@@ -19,7 +19,9 @@ id, label, description, loading, initialLoading, required, disabled, state, mess
19
19
  // refElement,
20
20
  start, end, }) => {
21
21
  const { namedSlotChildren } = splitChildren(children);
22
- return (jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: !!label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label, description: description, htmlFor: id, isRequired: required, isLoading: loading, isDisabled: disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", { name: "start" }), start, jsx("input", { "aria-describedby": loading ? loadingId : `${descriptionId} ${messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": disabled || loading ? 'true' : null, "aria-readonly": readOnly ? 'true' : null, id: id, name: name, form: form, type: type, required: required, placeholder: placeholder || null, maxLength: maxLength, minLength: minLength, spellCheck: spellCheck, max: max, min: min, step: step, defaultValue: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled, pattern: pattern, multiple: multiple, dir: "auto" // This overwrites the default: let the browser now decide in which direction the value should be placed.
22
+ const inputDescriptionId = (description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) ? descriptionId : undefined;
23
+ const inputMessageId = (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state) ? messageId : undefined;
24
+ return (jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: !!label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label, description: description, htmlFor: id, isRequired: required, isLoading: loading, isDisabled: disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", { name: "start" }), start, jsx("input", { "aria-describedby": setAriaIDREF(loading && loadingId, inputMessageId, inputDescriptionId), "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": disabled || loading ? 'true' : null, "aria-readonly": readOnly ? 'true' : null, id: id, name: name, form: form, type: type, required: required, placeholder: placeholder || null, maxLength: maxLength, minLength: minLength, spellCheck: spellCheck, max: max, min: min, step: step, defaultValue: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled, pattern: pattern, multiple: multiple, dir: "auto" // This overwrites the default: let the browser now decide in which direction the value should be placed.
23
25
  }), end, jsx("slot", { name: "end" }), loading && jsx(PSpinner, { "aria-hidden": "true" })] }), jsx(StateMessage, { hasMessage: (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state), state: state, message: message, host: null }), jsx(LoadingMessage, { loading: loading, initialLoading: initialLoading })] }));
24
26
  };
25
27
 
@@ -4,7 +4,7 @@ import '../../provider.mjs';
4
4
  import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getLinkCss as getComponentCss$D } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
- import { hasVisibleIcon, parseAndGetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
7
+ import { parseAndGetAriaAttributes, hasVisibleIcon } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
8
  import { PIcon } from '../components/icon.wrapper.mjs';
9
9
 
10
10
  /**
@@ -22,7 +22,7 @@ class DSRModal extends Component {
22
22
  hasHeader;
23
23
  hasFooter;
24
24
  render() {
25
- const { namedSlotChildren} = splitChildren(this.props.children);
25
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
26
26
  const hasHeader = namedSlotChildren.filter(({ props: { slot } }) => slot === 'header').length > 0;
27
27
  const hasFooter = namedSlotChildren.filter(({ props: { slot } }) => slot === 'footer').length > 0;
28
28
  this.props.disableCloseButton ? false : this.props.dismissButton;
@@ -4,7 +4,7 @@ import '../../provider.mjs';
4
4
  import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getMultiSelectCss as getComponentCss$y } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
- import { getHasNativePopoverSupport, getComboboxAriaAttributes, labelId } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
7
+ import { getHasNativePopoverSupport, descriptionId, getComboboxAriaAttributes, labelId, getListboxAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
8
  import { PButtonPure } from '../components/button-pure.wrapper.mjs';
9
9
  import { Label } from './label.mjs';
10
10
  import { messageId, StateMessage } from './state-message.mjs';
@@ -61,16 +61,15 @@ class DSRMultiSelect extends Component {
61
61
  this.props.setFormValue(this.props.defaultValue);
62
62
  }
63
63
  render() {
64
- const { namedSlotChildren} = splitChildren(this.props.children);
64
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
65
65
  const hasCustomFilterSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'filter').length > 0;
66
66
  const hasCustomSelectedSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'selected').length > 0;
67
67
  const buttonId = 'button';
68
- const popoverId = 'list';
69
- const descriptionId = this.props.description ? 'description' : undefined;
68
+ const listboxId = 'listbox';
69
+ const selectDescriptionId = (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) ? descriptionId : undefined;
70
70
  const selectMessageId = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) ? messageId : undefined;
71
- const ariaDescribedBy = [descriptionId, selectMessageId].filter(Boolean).join(' ');
72
71
  const style = minifyCss(getComponentCss$y(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.compact));
73
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: buttonId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, ...getComboboxAriaAttributes(this.props.isOpen, this.props.required, labelId, ariaDescribedBy, popoverId), disabled: this.props.disabled, onBlur: this.props.onComboBlur, children: [hasCustomSelectedSlot ? (jsx("slot", { name: "selected" })) : (jsx("span", { children: this.selectedOptions.map((option) => (option.textContent ?? '').toString().trim()).join(', ') })), this.props.value.length > 0 && (jsx(PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, disabled: this.props.disabled, children: "Reset selection" })), jsx(PIcon, { className: "icon", name: "arrow-head-down", color: "primary", "aria-hidden": "true" })] }), jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, onBlur: (e) => e.stopPropagation(), role: "dialog", "aria-label": this.props.label, "aria-hidden": this.props.isOpen ? null : 'true', children: [hasCustomFilterSlot ? (jsx("slot", { name: "filter" })) : (jsx(PInputSearch, { className: "filter", name: "filter", label: "Filter options", hideLabel: true, autoComplete: "off", clear: true, indicator: true, compact: true, onBlur: (e) => e.stopPropagation() })), jsxs("div", { className: "options", role: "listbox", "aria-label": this.props.label, "aria-multiselectable": "true", onPointerMove: this.props.onPointerMove, children: [!this.props.hasFilterResults && jsx(NoResultsOption, {}), jsx("slot", { name: "options-status" }), jsx("slot", {})] })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
72
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: buttonId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxs("button", { "aria-invalid": this.props.state === 'error' ? 'true' : null, type: "button", role: "combobox", id: buttonId, tabIndex: 0, ...getComboboxAriaAttributes(this.props.isOpen, this.props.required, (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && labelId, selectMessageId, selectDescriptionId, listboxId), disabled: this.props.disabled, onBlur: this.props.onComboBlur, children: [hasCustomSelectedSlot ? (jsx("slot", { name: "selected" })) : (jsx("span", { children: this.selectedOptions.map((option) => (option.textContent ?? '').toString().trim()).join(', ') })), this.props.value.length > 0 && (jsx(PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, disabled: this.props.disabled, children: "Reset selection" })), jsx(PIcon, { className: "icon", name: "arrow-head-down", color: "primary", "aria-hidden": "true" })] }), jsxs("div", { popover: "manual", tabIndex: 0, children: [hasCustomFilterSlot ? (jsx("slot", { name: "filter" })) : (jsx(PInputSearch, { className: "filter", name: "filter", label: "Filter options", hideLabel: true, autoComplete: "off", clear: true, indicator: true, compact: true, onBlur: (e) => e.stopPropagation() })), jsxs("div", { id: listboxId, className: "options", ...getListboxAriaAttributes(this.props.required, (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) && labelId, selectMessageId, selectDescriptionId, true), onPointerMove: this.props.onPointerMove, onBlur: (e) => e.stopPropagation(), children: [!this.props.hasFilterResults && jsx(NoResultsOption, {}), jsx("slot", { name: "options-status" }), jsx("slot", {})] })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null })] })] }), this.props.children] }));
74
73
  }
75
74
  }
76
75
 
@@ -0,0 +1,8 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+
3
+ const NotificationBase = ({ heading, headingTag, hasHeadingSlot, description, hasDescriptionSlot, innerHTML, actionLabel, dismissButton, ...rest }) => {
4
+ const Heading = headingTag;
5
+ return (jsxs("div", { className: "notification", ...rest, children: [heading ? jsx(Heading, { children: heading }) : hasHeadingSlot && jsx("slot", { name: "heading" }), description ? (innerHTML ? (jsx("p", { dangerouslySetInnerHTML: { __html: description } })) : (jsx("p", { children: description }))) : hasDescriptionSlot ? (jsx("slot", { name: "description" })) : (jsx("slot", {})), actionLabel, dismissButton] }));
6
+ };
7
+
8
+ export { NotificationBase };
@@ -4,7 +4,7 @@ import '../../provider.mjs';
4
4
  import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getPinCodeCss as getComponentCss$w } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
- import { labelId, descriptionId, getFieldsetAriaAttributes, isCurrentInput } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
7
+ import { labelId, descriptionId, getFieldsetAriaAttributes, setAriaIDREF, isCurrentInput } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
8
  import { loadingId, LoadingMessage } from './loading-message.mjs';
9
9
  import { Label } from './label.mjs';
10
10
  import { messageId, StateMessage } from './state-message.mjs';
@@ -35,12 +35,15 @@ class DSRPinCode extends Component {
35
35
  formStateRestoreCallback() {
36
36
  }
37
37
  render() {
38
- const { namedSlotChildren} = splitChildren(this.props.children);
38
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
39
39
  // reset array of input elements
40
40
  this.inputElements = [];
41
41
  const currentInputId = 'current-input';
42
+ const inputLabelId = (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) ? labelId : undefined;
43
+ const inputDescriptionId = (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) ? descriptionId : undefined;
44
+ const inputMessageId = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) ? messageId : undefined;
42
45
  const style = minifyCss(getComponentCss$w(this.props.hideLabel, this.props.state, this.props.disabled, this.props.loading, this.props.length, this.props.compact));
43
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("fieldset", { className: "root", disabled: this.props.disabled, ...getFieldsetAriaAttributes(this.props.required, this.props.state === 'error'), "aria-describedby": this.props.loading ? loadingId : `${descriptionId} ${messageId}`, "aria-labelledby": labelId, children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: currentInputId, isRequired: this.props.required, isLoading: this.props.loading, isDisabled: this.props.disabled }), jsxs("div", { className: "wrapper", dir: "ltr", children: [Array.from(new Array(this.props.length), (_, index) => (jsx("input", { name: this.props.name, form: this.props.form, ...(isCurrentInput(index, this.props.value, this.props.length) && { id: currentInputId }), type: this.props.type === 'number' ? 'text' : this.props.type, "aria-label": `${index + 1}-${this.props.length}`, "aria-describedby": `${labelId} ${descriptionId} ${messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading ? 'true' : null, autoComplete: "one-time-code", pattern: "\\d*", inputMode: "numeric" // get numeric keyboard on mobile
46
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("fieldset", { className: "root", disabled: this.props.disabled, ...getFieldsetAriaAttributes(this.props.required, this.props.state === 'error'), "aria-describedby": setAriaIDREF(this.props.loading && loadingId, inputMessageId, inputDescriptionId), "aria-labelledby": (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) ? labelId : null, children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: currentInputId, isRequired: this.props.required, isLoading: this.props.loading, isDisabled: this.props.disabled }), jsxs("div", { className: "wrapper", dir: "ltr", children: [Array.from(new Array(this.props.length), (_, index) => (jsx("input", { name: this.props.name, form: this.props.form, ...(isCurrentInput(index, this.props.value, this.props.length) && { id: currentInputId }), type: this.props.type === 'number' ? 'text' : this.props.type, "aria-label": `${index + 1}-${this.props.length}`, "aria-describedby": setAriaIDREF(inputLabelId, inputMessageId), "aria-invalid": this.props.state === 'error' ? 'true' : null, "aria-disabled": this.props.loading ? 'true' : null, autoComplete: "one-time-code", pattern: "\\d*", inputMode: "numeric" // get numeric keyboard on mobile
44
47
  , defaultValue: this.props.value[index] === ' ' ? null : this.props.value[index], disabled: this.props.disabled, required: this.props.required, onBlur: this.props.onInputBlur }, index))), this.props.loading && jsx(PSpinner, { className: "spinner", size: "inherit", "aria-hidden": "true" })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
45
48
  }
46
49
  }
@@ -23,7 +23,7 @@ class DSRPopover extends Component {
23
23
  // TODO: This should be updated when slot is changed
24
24
  hasSlottedButton;
25
25
  render() {
26
- const { namedSlotChildren} = splitChildren(this.props.children);
26
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
27
27
  const hasSlottedButton = namedSlotChildren.filter(({ props: { slot } }) => slot === 'button').length > 0;
28
28
  const style = minifyCss(getComponentCss$v()).replace(/(:host {[\S\s]+?})[\S\s]+(button {[\S\s]+?})[\S\s]+(.icon {[\S\s]+?})[\S\s]+(.label {[\S\s]+?})[\S\s]+/, '$1\n$2\n$3\n$4');
29
29
  return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [hasSlottedButton ? (jsx("slot", { name: "button" })) : (jsxs("button", { type: "button", ...parseAndGetAriaAttributes({
@@ -6,7 +6,6 @@ import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getRadioGroupOptionCss as getComponentCss$u } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
7
  import { loadingId, LoadingMessage } from './loading-message.mjs';
8
8
  import { Label } from './label.mjs';
9
- import { messageId } from './state-message.mjs';
10
9
  import { PSpinner } from '../components/spinner.wrapper.mjs';
11
10
 
12
11
  // Though "description" and "message" slots are technically available (provided by the "label" component),
@@ -29,7 +28,7 @@ class DSRRadioGroupOption extends Component {
29
28
  const style = minifyCss(getComponentCss$u(isDisabled, isLoading, state));
30
29
  return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs("div", { className: "root", children: [jsxs("div", { className: "wrapper", children: [jsx("input", { id: id, type: "radio", name: name, checked: isSelected, disabled: isDisabled || isLoading, value: this.props.value, onClick: (e) => {
31
30
  e.stopPropagation();
32
- }, onBlur: this.props.onBlur, "aria-describedby": isLoading ? loadingId : `${messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": isDisabled || isLoading ? 'true' : null }), isOptionLoading && !this.props.loadingParent && (jsx(PSpinner, { className: "spinner", "aria-hidden": "true" }))] }), jsx(Label, { hasLabel: this.props.label, hasDescription: false, host: null, label: this.props.label, htmlFor: id, isDisabled: isDisabled, isLoading: isLoading, stopClickPropagation: true }), !this.props.loadingParent && (jsx(LoadingMessage, { loading: isOptionLoading, initialLoading: this.props.initialLoading }))] }) })] }), this.props.children] }));
31
+ }, onBlur: this.props.onBlur, "aria-describedby": isLoading ? loadingId : null, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": isDisabled || isLoading ? 'true' : null }), isOptionLoading && !this.props.loadingParent && (jsx(PSpinner, { className: "spinner", "aria-hidden": "true" }))] }), jsx(Label, { hasLabel: this.props.label, hasDescription: false, host: null, label: this.props.label, htmlFor: id, isDisabled: isDisabled, isLoading: isLoading, stopClickPropagation: true }), !this.props.loadingParent && (jsx(LoadingMessage, { loading: isOptionLoading, initialLoading: this.props.initialLoading }))] }) })] }), this.props.children] }));
33
32
  }
34
33
  }
35
34
 
@@ -4,7 +4,7 @@ import '../../provider.mjs';
4
4
  import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getRadioGroupCss as getComponentCss$t } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
- import { labelId, descriptionId, getFieldsetAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
7
+ import { descriptionId, getFieldsetAriaAttributes, setAriaIDREF, labelId } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
8
  import { loadingId, LoadingMessage } from './loading-message.mjs';
9
9
  import { Label } from './label.mjs';
10
10
  import { messageId, StateMessage } from './state-message.mjs';
@@ -35,9 +35,11 @@ class DSRRadioGroup extends Component {
35
35
  formStateRestoreCallback() {
36
36
  }
37
37
  render() {
38
- const { namedSlotChildren} = splitChildren(this.props.children);
38
+ const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
39
+ const inputDescriptionId = (this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0) ? descriptionId : undefined;
40
+ const inputMessageId = (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state) ? messageId : undefined;
39
41
  const style = minifyCss(getComponentCss$t(this.props.disabled, this.props.loading, this.props.hideLabel, this.props.state, this.props.compact, this.props.direction));
40
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("fieldset", { className: "root", disabled: this.props.disabled, ...getFieldsetAriaAttributes(this.props.required, this.props.state === 'error', { role: 'radiogroup' }), "aria-describedby": this.props.loading ? loadingId : `${descriptionId} ${messageId}`, "aria-labelledby": labelId, children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, tag: "div", label: this.props.label, description: this.props.description, isRequired: this.props.required, isLoading: this.props.loading, isDisabled: this.props.disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), this.props.loading && jsx(PSpinner, { className: "spinner", "aria-hidden": "true" })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
42
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("fieldset", { className: "root", disabled: this.props.disabled, ...getFieldsetAriaAttributes(this.props.required, this.props.state === 'error', { role: 'radiogroup' }), "aria-describedby": setAriaIDREF(this.props.loading && loadingId, inputMessageId, inputDescriptionId), "aria-labelledby": (this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0) ? labelId : null, children: [jsx(Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, tag: "div", label: this.props.label, description: this.props.description, isRequired: this.props.required, isLoading: this.props.loading, isDisabled: this.props.disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", {}), this.props.loading && jsx(PSpinner, { className: "spinner", "aria-hidden": "true" })] }), jsx(StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, host: null }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
41
43
  }
42
44
  }
43
45