@porsche-design-system/components-react 4.0.0-beta.4 → 4.0.0-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 (157) hide show
  1. package/CHANGELOG.md +72 -4
  2. package/cjs/lib/components/banner.wrapper.cjs +3 -3
  3. package/esm/lib/components/accordion.wrapper.d.ts +8 -0
  4. package/esm/lib/components/banner.wrapper.d.ts +37 -15
  5. package/esm/lib/components/banner.wrapper.mjs +3 -3
  6. package/esm/lib/components/button-pure.wrapper.d.ts +22 -0
  7. package/esm/lib/components/button-tile.wrapper.d.ts +20 -0
  8. package/esm/lib/components/button.wrapper.d.ts +14 -0
  9. package/esm/lib/components/canvas.wrapper.d.ts +6 -0
  10. package/esm/lib/components/carousel.wrapper.d.ts +22 -0
  11. package/esm/lib/components/checkbox.wrapper.d.ts +24 -0
  12. package/esm/lib/components/crest.wrapper.d.ts +2 -0
  13. package/esm/lib/components/display.wrapper.d.ts +8 -0
  14. package/esm/lib/components/divider.wrapper.d.ts +4 -0
  15. package/esm/lib/components/drilldown-item.wrapper.d.ts +6 -0
  16. package/esm/lib/components/drilldown-link.wrapper.d.ts +4 -0
  17. package/esm/lib/components/drilldown.wrapper.d.ts +2 -0
  18. package/esm/lib/components/fieldset.wrapper.d.ts +10 -0
  19. package/esm/lib/components/flag.wrapper.d.ts +4 -0
  20. package/esm/lib/components/flyout.wrapper.d.ts +12 -0
  21. package/esm/lib/components/heading.wrapper.d.ts +12 -0
  22. package/esm/lib/components/icon.wrapper.d.ts +6 -0
  23. package/esm/lib/components/inline-notification.wrapper.d.ts +14 -0
  24. package/esm/lib/components/input-date.wrapper.d.ts +24 -0
  25. package/esm/lib/components/input-email.wrapper.d.ts +28 -0
  26. package/esm/lib/components/input-month.wrapper.d.ts +24 -0
  27. package/esm/lib/components/input-number.wrapper.d.ts +28 -0
  28. package/esm/lib/components/input-password.wrapper.d.ts +26 -0
  29. package/esm/lib/components/input-search.wrapper.d.ts +28 -0
  30. package/esm/lib/components/input-tel.wrapper.d.ts +26 -0
  31. package/esm/lib/components/input-text.wrapper.d.ts +26 -0
  32. package/esm/lib/components/input-time.wrapper.d.ts +24 -0
  33. package/esm/lib/components/input-url.wrapper.d.ts +26 -0
  34. package/esm/lib/components/input-week.wrapper.d.ts +24 -0
  35. package/esm/lib/components/link-pure.wrapper.d.ts +18 -0
  36. package/esm/lib/components/link-tile-product.wrapper.d.ts +8 -0
  37. package/esm/lib/components/link-tile.wrapper.d.ts +14 -0
  38. package/esm/lib/components/link.wrapper.d.ts +10 -0
  39. package/esm/lib/components/modal.wrapper.d.ts +12 -0
  40. package/esm/lib/components/model-signature.wrapper.d.ts +12 -0
  41. package/esm/lib/components/multi-select-option.wrapper.d.ts +2 -0
  42. package/esm/lib/components/multi-select.wrapper.d.ts +20 -0
  43. package/esm/lib/components/optgroup.wrapper.d.ts +2 -0
  44. package/esm/lib/components/pagination.wrapper.d.ts +10 -0
  45. package/esm/lib/components/pin-code.wrapper.d.ts +24 -0
  46. package/esm/lib/components/popover.wrapper.d.ts +2 -0
  47. package/esm/lib/components/radio-group-option.wrapper.d.ts +4 -0
  48. package/esm/lib/components/radio-group.wrapper.d.ts +22 -0
  49. package/esm/lib/components/scroller.wrapper.d.ts +6 -0
  50. package/esm/lib/components/segmented-control-item.wrapper.d.ts +2 -0
  51. package/esm/lib/components/segmented-control.wrapper.d.ts +18 -0
  52. package/esm/lib/components/select-option.wrapper.d.ts +2 -0
  53. package/esm/lib/components/select.wrapper.d.ts +20 -0
  54. package/esm/lib/components/sheet.wrapper.d.ts +8 -0
  55. package/esm/lib/components/spinner.wrapper.d.ts +4 -0
  56. package/esm/lib/components/stepper-horizontal-item.wrapper.d.ts +2 -0
  57. package/esm/lib/components/stepper-horizontal.wrapper.d.ts +2 -0
  58. package/esm/lib/components/switch.wrapper.d.ts +14 -0
  59. package/esm/lib/components/table-cell.wrapper.d.ts +2 -0
  60. package/esm/lib/components/table-head-cell.wrapper.d.ts +4 -0
  61. package/esm/lib/components/table.wrapper.d.ts +6 -0
  62. package/esm/lib/components/tabs-bar.wrapper.d.ts +6 -0
  63. package/esm/lib/components/tabs.wrapper.d.ts +8 -0
  64. package/esm/lib/components/tag-dismissible.wrapper.d.ts +2 -0
  65. package/esm/lib/components/tag.wrapper.d.ts +6 -0
  66. package/esm/lib/components/text-list.wrapper.d.ts +2 -0
  67. package/esm/lib/components/text.wrapper.d.ts +14 -0
  68. package/esm/lib/components/textarea.wrapper.d.ts +30 -0
  69. package/esm/lib/components/wordmark.wrapper.d.ts +4 -0
  70. package/esm/lib/types.d.ts +5 -0
  71. package/global-styles/cn/index.css +1 -0
  72. package/global-styles/index.css +1 -0
  73. package/global-styles/variables.css +1 -0
  74. package/package.json +4 -2
  75. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +723 -775
  76. package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +16 -77
  77. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.cjs +4 -5
  78. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +11 -6
  79. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +1 -1
  80. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.cjs +4 -6
  81. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.cjs +1 -4
  82. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +723 -775
  83. package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +15 -76
  84. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.mjs +4 -5
  85. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +11 -6
  86. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +1 -1
  87. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +5 -7
  88. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.mjs +2 -5
  89. package/ssr/esm/lib/components/accordion.wrapper.d.ts +8 -0
  90. package/ssr/esm/lib/components/banner.wrapper.d.ts +37 -15
  91. package/ssr/esm/lib/components/button-pure.wrapper.d.ts +22 -0
  92. package/ssr/esm/lib/components/button-tile.wrapper.d.ts +20 -0
  93. package/ssr/esm/lib/components/button.wrapper.d.ts +14 -0
  94. package/ssr/esm/lib/components/canvas.wrapper.d.ts +6 -0
  95. package/ssr/esm/lib/components/carousel.wrapper.d.ts +22 -0
  96. package/ssr/esm/lib/components/checkbox.wrapper.d.ts +24 -0
  97. package/ssr/esm/lib/components/crest.wrapper.d.ts +2 -0
  98. package/ssr/esm/lib/components/display.wrapper.d.ts +8 -0
  99. package/ssr/esm/lib/components/divider.wrapper.d.ts +4 -0
  100. package/ssr/esm/lib/components/drilldown-item.wrapper.d.ts +6 -0
  101. package/ssr/esm/lib/components/drilldown-link.wrapper.d.ts +4 -0
  102. package/ssr/esm/lib/components/drilldown.wrapper.d.ts +2 -0
  103. package/ssr/esm/lib/components/fieldset.wrapper.d.ts +10 -0
  104. package/ssr/esm/lib/components/flag.wrapper.d.ts +4 -0
  105. package/ssr/esm/lib/components/flyout.wrapper.d.ts +12 -0
  106. package/ssr/esm/lib/components/heading.wrapper.d.ts +12 -0
  107. package/ssr/esm/lib/components/icon.wrapper.d.ts +6 -0
  108. package/ssr/esm/lib/components/inline-notification.wrapper.d.ts +14 -0
  109. package/ssr/esm/lib/components/input-date.wrapper.d.ts +24 -0
  110. package/ssr/esm/lib/components/input-email.wrapper.d.ts +28 -0
  111. package/ssr/esm/lib/components/input-month.wrapper.d.ts +24 -0
  112. package/ssr/esm/lib/components/input-number.wrapper.d.ts +28 -0
  113. package/ssr/esm/lib/components/input-password.wrapper.d.ts +26 -0
  114. package/ssr/esm/lib/components/input-search.wrapper.d.ts +28 -0
  115. package/ssr/esm/lib/components/input-tel.wrapper.d.ts +26 -0
  116. package/ssr/esm/lib/components/input-text.wrapper.d.ts +26 -0
  117. package/ssr/esm/lib/components/input-time.wrapper.d.ts +24 -0
  118. package/ssr/esm/lib/components/input-url.wrapper.d.ts +26 -0
  119. package/ssr/esm/lib/components/input-week.wrapper.d.ts +24 -0
  120. package/ssr/esm/lib/components/link-pure.wrapper.d.ts +18 -0
  121. package/ssr/esm/lib/components/link-tile-product.wrapper.d.ts +8 -0
  122. package/ssr/esm/lib/components/link-tile.wrapper.d.ts +14 -0
  123. package/ssr/esm/lib/components/link.wrapper.d.ts +10 -0
  124. package/ssr/esm/lib/components/modal.wrapper.d.ts +12 -0
  125. package/ssr/esm/lib/components/model-signature.wrapper.d.ts +12 -0
  126. package/ssr/esm/lib/components/multi-select-option.wrapper.d.ts +2 -0
  127. package/ssr/esm/lib/components/multi-select.wrapper.d.ts +20 -0
  128. package/ssr/esm/lib/components/optgroup.wrapper.d.ts +2 -0
  129. package/ssr/esm/lib/components/pagination.wrapper.d.ts +10 -0
  130. package/ssr/esm/lib/components/pin-code.wrapper.d.ts +24 -0
  131. package/ssr/esm/lib/components/popover.wrapper.d.ts +2 -0
  132. package/ssr/esm/lib/components/radio-group-option.wrapper.d.ts +4 -0
  133. package/ssr/esm/lib/components/radio-group.wrapper.d.ts +22 -0
  134. package/ssr/esm/lib/components/scroller.wrapper.d.ts +6 -0
  135. package/ssr/esm/lib/components/segmented-control-item.wrapper.d.ts +2 -0
  136. package/ssr/esm/lib/components/segmented-control.wrapper.d.ts +18 -0
  137. package/ssr/esm/lib/components/select-option.wrapper.d.ts +2 -0
  138. package/ssr/esm/lib/components/select.wrapper.d.ts +20 -0
  139. package/ssr/esm/lib/components/sheet.wrapper.d.ts +8 -0
  140. package/ssr/esm/lib/components/spinner.wrapper.d.ts +4 -0
  141. package/ssr/esm/lib/components/stepper-horizontal-item.wrapper.d.ts +2 -0
  142. package/ssr/esm/lib/components/stepper-horizontal.wrapper.d.ts +2 -0
  143. package/ssr/esm/lib/components/switch.wrapper.d.ts +14 -0
  144. package/ssr/esm/lib/components/table-cell.wrapper.d.ts +2 -0
  145. package/ssr/esm/lib/components/table-head-cell.wrapper.d.ts +4 -0
  146. package/ssr/esm/lib/components/table.wrapper.d.ts +6 -0
  147. package/ssr/esm/lib/components/tabs-bar.wrapper.d.ts +6 -0
  148. package/ssr/esm/lib/components/tabs.wrapper.d.ts +8 -0
  149. package/ssr/esm/lib/components/tag-dismissible.wrapper.d.ts +2 -0
  150. package/ssr/esm/lib/components/tag.wrapper.d.ts +6 -0
  151. package/ssr/esm/lib/components/text-list.wrapper.d.ts +2 -0
  152. package/ssr/esm/lib/components/text.wrapper.d.ts +14 -0
  153. package/ssr/esm/lib/components/textarea.wrapper.d.ts +30 -0
  154. package/ssr/esm/lib/components/wordmark.wrapper.d.ts +4 -0
  155. package/ssr/esm/lib/dsr-components/banner.d.ts +2 -2
  156. package/ssr/esm/lib/types.d.ts +5 -0
  157. package/tailwindcss/index.css +73 -14
@@ -3268,18 +3268,15 @@ const getComboboxAriaAttributes = (isOpen, isRequired, labelId, descriptionId, d
3268
3268
  };
3269
3269
  };
3270
3270
 
3271
- /** @deprecated since v4.0.0, will be removed with next major release. Use 2px instead. */
3272
- const borderWidthBase = '2px';
3273
-
3274
3271
  const fontPorscheNext = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
3275
3272
 
3276
3273
  /** @deprecated since v4.0.0, will be removed with next major release. Use fontPorscheNext instead. */
3277
3274
  const fontFamily = fontPorscheNext;
3278
3275
 
3279
- const leadingNormal = 'calc(6px + 2.125ex)';
3276
+ const leadingNormal$1 = 'calc(6px + 2.125ex)';
3280
3277
 
3281
3278
  /** @deprecated since v4.0.0, will be removed with next major release. Use leadingNormal instead */
3282
- const fontLineHeight = leadingNormal;
3279
+ const fontLineHeight = leadingNormal$1;
3283
3280
 
3284
3281
  const typescaleSm = '1rem';
3285
3282
 
@@ -3438,7 +3435,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3438
3435
  'showPicker' in HTMLInputElement.prototype &&
3439
3436
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3440
3437
 
3441
- const prefix = `[Porsche Design System v${"4.0.0-beta.4"}]` // this part isn't covered by unit tests
3438
+ const prefix = `[Porsche Design System v${"4.0.0-rc.1"}]` // this part isn't covered by unit tests
3442
3439
  ;
3443
3440
  const consoleError$1 = (...messages) => {
3444
3441
  console.error(prefix, ...messages);
@@ -3459,64 +3456,6 @@ const supportsNativePopover = () => {
3459
3456
  const hasNativePopoverSupport = supportsNativePopover();
3460
3457
  // getter for easy mocking
3461
3458
  const getHasNativePopoverSupport = () => hasNativePopoverSupport;
3462
-
3463
- /*
3464
- Stencil Client Platform v4.23.2 | MIT Licensed | https://stenciljs.com
3465
- */
3466
- var __defProp = Object.defineProperty;
3467
- var __export = (target, all) => {
3468
- for (var name in all)
3469
- __defProp(target, name, { get: all[name], enumerable: true });
3470
- };
3471
-
3472
- // src/utils/result.ts
3473
- var result_exports = {};
3474
- __export(result_exports, {
3475
- err: () => err,
3476
- map: () => map,
3477
- ok: () => ok,
3478
- unwrap: () => unwrap,
3479
- unwrapErr: () => unwrapErr
3480
- });
3481
- var ok = (value) => ({
3482
- isOk: true,
3483
- isErr: false,
3484
- value
3485
- });
3486
- var err = (value) => ({
3487
- isOk: false,
3488
- isErr: true,
3489
- value
3490
- });
3491
- function map(result, fn) {
3492
- if (result.isOk) {
3493
- const val = fn(result.value);
3494
- if (val instanceof Promise) {
3495
- return val.then((newVal) => ok(newVal));
3496
- } else {
3497
- return ok(val);
3498
- }
3499
- }
3500
- if (result.isErr) {
3501
- const value = result.value;
3502
- return err(value);
3503
- }
3504
- throw "should never get here";
3505
- }
3506
- var unwrap = (result) => {
3507
- if (result.isOk) {
3508
- return result.value;
3509
- } else {
3510
- throw result.value;
3511
- }
3512
- };
3513
- var unwrapErr = (result) => {
3514
- if (result.isErr) {
3515
- return result.value;
3516
- } else {
3517
- throw result.value;
3518
- }
3519
- };
3520
3459
  const headerSlot = 'header';
3521
3460
  const anchorSlot = 'anchor';
3522
3461
 
@@ -3617,6 +3556,15 @@ const internalValidateProps = {
3617
3556
  const breakpointCustomizableTemplate = `value, ${internalValidateProps
3618
3557
  .formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {}))
3619
3558
  .replace(/"/g, '')}`;
3559
+ const getBannerAriaAttributes = (state, labelId, descriptionId) => {
3560
+ const isAlert = state === 'warning' || state === 'error';
3561
+ return {
3562
+ role: isAlert ? 'alert' : 'status',
3563
+ 'aria-live': isAlert ? 'assertive' : 'polite',
3564
+ 'aria-labelledby': labelId,
3565
+ 'aria-describedby': descriptionId,
3566
+ };
3567
+ };
3620
3568
  const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
3621
3569
  return {
3622
3570
  ...parseAndGetAriaAttributes(aria),
@@ -3765,16 +3713,7 @@ const buildIconUrl = (iconNameOrSource = DEFAULT_ICON_NAME) => {
3765
3713
  }
3766
3714
  return buildIconUrl(DEFAULT_ICON_NAME);
3767
3715
  };
3768
- const getInlineNotificationIconName = (state) => {
3769
- const iconMap = {
3770
- info: 'information-filled',
3771
- warning: 'warning-filled',
3772
- success: 'success-filled',
3773
- error: 'error-filled',
3774
- };
3775
- return iconMap[state];
3776
- };
3777
- const getContentAriaAttributes = (state, labelId, descriptionId) => {
3716
+ const getInlineNotificationAriaAttributes = (state, labelId, descriptionId) => {
3778
3717
  const isAlert = state === 'warning' || state === 'error';
3779
3718
  return {
3780
3719
  role: isAlert ? 'alert' : 'status',
@@ -3917,7 +3856,7 @@ const tempDiv = hasDocument ? document.createElement('div') : undefined;
3917
3856
  if (tempDiv) {
3918
3857
  tempDiv.style.position = 'absolute';
3919
3858
  tempDiv.style.visibility = 'hidden';
3920
- tempDiv.style.border = `${borderWidthBase} solid`;
3859
+ tempDiv.style.border = '1px solid';
3921
3860
  tempDiv.style.boxSizing = 'border-box';
3922
3861
  tempDiv.style.font = BUTTON_FONT.replace(fontFamily, tempFont);
3923
3862
  }
@@ -3959,4 +3898,4 @@ const getTextTagType = (host, tag) => {
3959
3898
  return tag;
3960
3899
  };
3961
3900
 
3962
- export { DISPLAY_TAGS, HEADING_TAGS, ItemType, TEXT_TAGS, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, consoleError$1 as consoleError, createPaginationItems, createRange, crestSize, descriptionId, displaySizeToTagMap, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getComboboxAriaAttributes, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getInlineNotificationIconName, 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 };
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 };
@@ -5,22 +5,21 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
5
5
  import { syncRef } from '../../utils.mjs';
6
6
  import { DSRBanner } from '../dsr-components/banner.mjs';
7
7
 
8
- const PBanner = /*#__PURE__*/ forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, state = 'info', className, children, ...rest }, ref) => {
8
+ const PBanner = /*#__PURE__*/ forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, position = { base: 'bottom', s: 'top' }, state = 'info', className, children, ...rest }, ref) => {
9
9
  const elementRef = useRef(undefined);
10
10
  useEventCallback(elementRef, 'dismiss', onDismiss);
11
11
  const WebComponentTag = usePrefix('p-banner');
12
- const propsToSync = [description, dismissButton, heading, headingTag, open, state];
12
+ const propsToSync = [description, dismissButton, heading, headingTag, open, position, state];
13
13
  useBrowserLayoutEffect(() => {
14
14
  const { current } = elementRef;
15
- ['description', 'dismissButton', 'heading', 'headingTag', 'open', 'state'].forEach((propName, i) => (current[propName] = propsToSync[i]));
15
+ ['description', 'dismissButton', 'heading', 'headingTag', 'open', 'position', 'state'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
16
  }, propsToSync);
17
17
  const props = {
18
18
  ...rest,
19
19
  // @ts-ignore
20
20
  ...(!process.browser
21
21
  ? {
22
- ...{ "popover": "manual" },
23
- children: (jsx(DSRBanner, { description, dismissButton, heading, headingTag, open, state, children })),
22
+ children: (jsx(DSRBanner, { description, dismissButton, heading, headingTag, open, position, state, children })),
24
23
  }
25
24
  : {
26
25
  children,
@@ -4,7 +4,8 @@ import '../../provider.mjs';
4
4
  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
- import { PInlineNotification } from '../components/inline-notification.wrapper.mjs';
7
+ import { getBannerAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
+ import { PButton } from '../components/button.wrapper.mjs';
8
9
 
9
10
  /**
10
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 }
@@ -14,12 +15,16 @@ import { PInlineNotification } from '../components/inline-notification.wrapper.m
14
15
  */
15
16
  class DSRBanner extends Component {
16
17
  host;
17
- inlineNotificationElement;
18
- closeBtn;
18
+ refPopover;
19
+ refDismiss;
19
20
  render() {
20
- const { namedSlotChildren} = splitChildren(this.props.children);
21
- const style = minifyCss(getComponentCss$18(this.props.open));
22
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsxs(PInlineNotification, { heading: this.props.heading, headingTag: this.props.headingTag, description: this.props.description, state: this.props.state, dismissButton: this.props.dismissButton, "aria-hidden": this.props.open ? 'false' : 'true', children: [namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 && jsx("slot", { name: "heading", slot: "heading" }), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsx("slot", { name: "description" })] }) })] }), this.props.children] }));
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] }));
23
28
  }
24
29
  }
25
30
 
@@ -20,7 +20,7 @@ class DSRButton extends Component {
20
20
  render() {
21
21
  splitChildren(this.props.children);
22
22
  const style = minifyCss(getComponentCss$15(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.compact));
23
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("button", { ...getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingId : undefined, children: [this.props.loading && jsx(PSpinner, { className: "spinner", size: "inherit", "aria-hidden": "true" }), hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsx(PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: "inherit", "aria-hidden": "true" })), jsx("span", { className: "label", children: jsx("slot", {}) })] }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
23
+ return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsxs("button", { ...getButtonAriaAttributes(this.props.disabled, this.props.loading, this.props.aria), className: "root", type: this.props.type, name: this.props.name, value: this.props.value, "aria-describedby": this.props.loading ? loadingId : undefined, children: [this.props.loading && jsx(PSpinner, { className: "spinner", "aria-hidden": "true" }), hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsx(PIcon, { className: "icon", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: "inherit", "aria-hidden": "true" })), jsx("span", { className: "label", children: jsx("slot", {}) })] }), jsx(LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
24
24
  }
25
25
  }
26
26
 
@@ -4,10 +4,9 @@ import '../../provider.mjs';
4
4
  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
- import { getInlineNotificationIconName, getContentAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
7
+ import { getInlineNotificationAriaAttributes } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
8
  import { PButton } from '../components/button.wrapper.mjs';
9
9
  import { PButtonPure } from '../components/button-pure.wrapper.mjs';
10
- import { PIcon } from '../components/icon.wrapper.mjs';
11
10
 
12
11
  /**
13
12
  * @slot {"name": "heading", "description": "Shows a heading. Can be used to render rich markup." }
@@ -16,14 +15,13 @@ import { PIcon } from '../components/icon.wrapper.mjs';
16
15
  class DSRInlineNotification extends Component {
17
16
  host;
18
17
  render() {
19
- const { namedSlotChildren} = splitChildren(this.props.children);
20
- const bannerId = 'banner';
21
- const labelId = 'label';
18
+ splitChildren(this.props.children);
19
+ const notificationId = 'notification';
20
+ const labelId = 'heading';
22
21
  const descriptionId = 'description';
23
22
  const Heading = this.props.headingTag;
24
23
  const style = minifyCss(getComponentCss$S(this.props.state, !!this.props.actionLabel, this.props.dismissButton));
25
- return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(PIcon, { className: "icon", name: getInlineNotificationIconName(this.props.state), color: this.props.state, "aria-hidden": "true" }), jsxs("div", { id: bannerId, className: "content", ...getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) &&
26
- (this.props.heading ? (jsx(Heading, { id: labelId, className: "heading", children: this.props.heading })) : (jsx("slot", { name: "heading" }))), jsx("p", { id: descriptionId, className: "description", 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: "close", type: "button", variant: "secondary", icon: "close", hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
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] }));
27
25
  }
28
26
  }
29
27
 
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import 'react';
3
3
  import '../../provider.mjs';
4
4
  import { PIcon } from '../components/icon.wrapper.mjs';
@@ -8,10 +8,7 @@ const StateMessage = ({ hasMessage, state, message }) => {
8
8
  const isErrorState = state === 'error';
9
9
  return (
10
10
  // needs to be rendered always to have correct behaviour for screen readers
11
- jsx("span", { id: messageId, className: "message", role: state === 'success' ? 'status' : 'alert', children: hasMessage && [
12
- jsx(PIcon, { name: isErrorState ? 'exclamation' : 'check', color: isErrorState ? 'error' : 'success', "aria-hidden": "true" }),
13
- message || jsx("slot", { name: "message" }),
14
- ] }));
11
+ jsx("span", { id: messageId, className: "message", role: state === 'success' ? 'status' : 'alert', children: hasMessage && (jsxs(Fragment, { children: [jsx(PIcon, { name: isErrorState ? 'exclamation' : 'check', color: isErrorState ? 'error' : 'success', "aria-hidden": "true" }), message || jsx("slot", { name: "message" })] })) }));
15
12
  };
16
13
 
17
14
  export { StateMessage, messageId };
@@ -3,10 +3,12 @@ import type { AccordionAlignMarker, AccordionBackground, AccordionHeadingTag, Ac
3
3
  export type PAccordionProps = BaseProps & {
4
4
  /**
5
5
  * Aligns the marker within the summary section.
6
+ * @default 'end'
6
7
  */
7
8
  alignMarker?: AccordionAlignMarker;
8
9
  /**
9
10
  * Defines the background color. Use `frosted` only on images, videos or gradients.
11
+ * @default 'none'
10
12
  */
11
13
  background?: AccordionBackground;
12
14
  /**
@@ -19,6 +21,7 @@ export type PAccordionProps = BaseProps & {
19
21
  heading?: string;
20
22
  /**
21
23
  * @deprecated Will be removed in the next major release. Use the `summary` slot instead. Sets the heading tag for proper semantic structure within the page.
24
+ * @default 'h2'
22
25
  */
23
26
  headingTag?: AccordionHeadingTag;
24
27
  /**
@@ -31,6 +34,7 @@ export type PAccordionProps = BaseProps & {
31
34
  open?: boolean;
32
35
  /**
33
36
  * @deprecated Will be removed in the next major release. Use the `summary` slot instead. Controls the heading size in the summary section (only applies when using the `heading` prop or `heading` slot).
37
+ * @default 'small'
34
38
  */
35
39
  size?: BreakpointCustomizable<AccordionSize>;
36
40
  /**
@@ -41,10 +45,12 @@ export type PAccordionProps = BaseProps & {
41
45
  export declare const PAccordion: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
42
46
  /**
43
47
  * Aligns the marker within the summary section.
48
+ * @default 'end'
44
49
  */
45
50
  alignMarker?: AccordionAlignMarker;
46
51
  /**
47
52
  * Defines the background color. Use `frosted` only on images, videos or gradients.
53
+ * @default 'none'
48
54
  */
49
55
  background?: AccordionBackground;
50
56
  /**
@@ -57,6 +63,7 @@ export declare const PAccordion: import("react").ForwardRefExoticComponent<Omit<
57
63
  heading?: string;
58
64
  /**
59
65
  * @deprecated Will be removed in the next major release. Use the `summary` slot instead. Sets the heading tag for proper semantic structure within the page.
66
+ * @default 'h2'
60
67
  */
61
68
  headingTag?: AccordionHeadingTag;
62
69
  /**
@@ -69,6 +76,7 @@ export declare const PAccordion: import("react").ForwardRefExoticComponent<Omit<
69
76
  open?: boolean;
70
77
  /**
71
78
  * @deprecated Will be removed in the next major release. Use the `summary` slot instead. Controls the heading size in the summary section (only applies when using the `heading` prop or `heading` slot).
79
+ * @default 'small'
72
80
  */
73
81
  size?: BreakpointCustomizable<AccordionSize>;
74
82
  /**
@@ -1,62 +1,84 @@
1
1
  import type { BaseProps } from '../../BaseProps';
2
- import type { BannerHeadingTag, BannerState } from '../types';
2
+ import type { BannerHeadingTag, BreakpointCustomizable, BannerPosition, BannerState } from '../types';
3
3
  export type PBannerProps = BaseProps & {
4
4
  /**
5
- * Description of the banner.
5
+ * Sets the description text of the banner.
6
+ * @default ''
6
7
  */
7
8
  description?: string;
8
9
  /**
9
- * If false, the banner will not have a dismiss button.
10
+ * Shows a dismiss button allowing the banner to be closed.
11
+ * @default true
10
12
  */
11
13
  dismissButton?: boolean;
12
14
  /**
13
- * Heading of the banner.
15
+ * Sets the heading text of the banner.
16
+ * @default ''
14
17
  */
15
18
  heading?: string;
16
19
  /**
17
- * Sets a heading tag, so it fits correctly within the outline of the page.
20
+ * Sets the heading tag for proper semantic structure within the page.
21
+ * @default 'h5'
18
22
  */
19
23
  headingTag?: BannerHeadingTag;
20
24
  /**
21
- * Emitted when the close button is clicked.
25
+ * Emitted when the banner is requested to be dismissed.
22
26
  */
23
27
  onDismiss?: (event: CustomEvent<void>) => void;
24
28
  /**
25
- * If true, the banner is open.
29
+ * Controls whether the banner is open or closed.
30
+ * @default false
26
31
  */
27
32
  open: boolean;
28
33
  /**
29
- * State of the banner.
34
+ * Sets the position of the banner.
35
+ * @default { base: 'bottom', s: 'top' }
36
+ */
37
+ position?: BreakpointCustomizable<BannerPosition>;
38
+ /**
39
+ * Defines the visual state of the banner.
40
+ * @default 'info'
30
41
  */
31
42
  state?: BannerState;
32
43
  };
33
44
  export declare const PBanner: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
34
45
  /**
35
- * Description of the banner.
46
+ * Sets the description text of the banner.
47
+ * @default ''
36
48
  */
37
49
  description?: string;
38
50
  /**
39
- * If false, the banner will not have a dismiss button.
51
+ * Shows a dismiss button allowing the banner to be closed.
52
+ * @default true
40
53
  */
41
54
  dismissButton?: boolean;
42
55
  /**
43
- * Heading of the banner.
56
+ * Sets the heading text of the banner.
57
+ * @default ''
44
58
  */
45
59
  heading?: string;
46
60
  /**
47
- * Sets a heading tag, so it fits correctly within the outline of the page.
61
+ * Sets the heading tag for proper semantic structure within the page.
62
+ * @default 'h5'
48
63
  */
49
64
  headingTag?: BannerHeadingTag;
50
65
  /**
51
- * Emitted when the close button is clicked.
66
+ * Emitted when the banner is requested to be dismissed.
52
67
  */
53
68
  onDismiss?: (event: CustomEvent<void>) => void;
54
69
  /**
55
- * If true, the banner is open.
70
+ * Controls whether the banner is open or closed.
71
+ * @default false
56
72
  */
57
73
  open: boolean;
58
74
  /**
59
- * State of the banner.
75
+ * Sets the position of the banner.
76
+ * @default { base: 'bottom', s: 'top' }
77
+ */
78
+ position?: BreakpointCustomizable<BannerPosition>;
79
+ /**
80
+ * Defines the visual state of the banner.
81
+ * @default 'info'
60
82
  */
61
83
  state?: BannerState;
62
84
  } & {
@@ -3,10 +3,12 @@ import type { BreakpointCustomizable, ButtonPureAlignLabel, SelectedAriaAttribut
3
3
  export type PButtonPureProps = BaseProps & {
4
4
  /**
5
5
  * Displays the button in its active state.
6
+ * @default false
6
7
  */
7
8
  active?: boolean;
8
9
  /**
9
10
  * Aligns the label.
11
+ * @default 'end'
10
12
  */
11
13
  alignLabel?: BreakpointCustomizable<ButtonPureAlignLabel>;
12
14
  /**
@@ -15,10 +17,12 @@ export type PButtonPureProps = BaseProps & {
15
17
  aria?: SelectedAriaAttributes<ButtonPureAriaAttribute>;
16
18
  /**
17
19
  * The color.
20
+ * @default 'primary'
18
21
  */
19
22
  color?: ButtonPureColor;
20
23
  /**
21
24
  * Disables the button. No events will be triggered while disabled state is active.
25
+ * @default false
22
26
  */
23
27
  disabled?: boolean;
24
28
  /**
@@ -27,10 +31,12 @@ export type PButtonPureProps = BaseProps & {
27
31
  form?: string;
28
32
  /**
29
33
  * Shows or hides the label. For better accessibility, it is recommended to show the label.
34
+ * @default false
30
35
  */
31
36
  hideLabel?: BreakpointCustomizable<boolean>;
32
37
  /**
33
38
  * The icon shown.
39
+ * @default 'arrow-right'
34
40
  */
35
41
  icon?: ButtonPureIcon;
36
42
  /**
@@ -39,6 +45,7 @@ export type PButtonPureProps = BaseProps & {
39
45
  iconSource?: string;
40
46
  /**
41
47
  * Disables the button and shows a loading indicator. No events will be triggered while loading state is active.
48
+ * @default false
42
49
  */
43
50
  loading?: boolean;
44
51
  /**
@@ -47,18 +54,22 @@ export type PButtonPureProps = BaseProps & {
47
54
  name?: string;
48
55
  /**
49
56
  * Size of the button.
57
+ * @default 'sm'
50
58
  */
51
59
  size?: BreakpointCustomizable<ButtonPureSize>;
52
60
  /**
53
61
  * Stretches the area between icon and label to max available space.
62
+ * @default false
54
63
  */
55
64
  stretch?: BreakpointCustomizable<boolean>;
56
65
  /**
57
66
  * Specifies the type of the button.
67
+ * @default 'submit'
58
68
  */
59
69
  type?: ButtonPureType;
60
70
  /**
61
71
  * Shows an underline under the label.
72
+ * @default false
62
73
  */
63
74
  underline?: boolean;
64
75
  /**
@@ -69,10 +80,12 @@ export type PButtonPureProps = BaseProps & {
69
80
  export declare const PButtonPure: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
70
81
  /**
71
82
  * Displays the button in its active state.
83
+ * @default false
72
84
  */
73
85
  active?: boolean;
74
86
  /**
75
87
  * Aligns the label.
88
+ * @default 'end'
76
89
  */
77
90
  alignLabel?: BreakpointCustomizable<ButtonPureAlignLabel>;
78
91
  /**
@@ -81,10 +94,12 @@ export declare const PButtonPure: import("react").ForwardRefExoticComponent<Omit
81
94
  aria?: SelectedAriaAttributes<ButtonPureAriaAttribute>;
82
95
  /**
83
96
  * The color.
97
+ * @default 'primary'
84
98
  */
85
99
  color?: ButtonPureColor;
86
100
  /**
87
101
  * Disables the button. No events will be triggered while disabled state is active.
102
+ * @default false
88
103
  */
89
104
  disabled?: boolean;
90
105
  /**
@@ -93,10 +108,12 @@ export declare const PButtonPure: import("react").ForwardRefExoticComponent<Omit
93
108
  form?: string;
94
109
  /**
95
110
  * Shows or hides the label. For better accessibility, it is recommended to show the label.
111
+ * @default false
96
112
  */
97
113
  hideLabel?: BreakpointCustomizable<boolean>;
98
114
  /**
99
115
  * The icon shown.
116
+ * @default 'arrow-right'
100
117
  */
101
118
  icon?: ButtonPureIcon;
102
119
  /**
@@ -105,6 +122,7 @@ export declare const PButtonPure: import("react").ForwardRefExoticComponent<Omit
105
122
  iconSource?: string;
106
123
  /**
107
124
  * Disables the button and shows a loading indicator. No events will be triggered while loading state is active.
125
+ * @default false
108
126
  */
109
127
  loading?: boolean;
110
128
  /**
@@ -113,18 +131,22 @@ export declare const PButtonPure: import("react").ForwardRefExoticComponent<Omit
113
131
  name?: string;
114
132
  /**
115
133
  * Size of the button.
134
+ * @default 'sm'
116
135
  */
117
136
  size?: BreakpointCustomizable<ButtonPureSize>;
118
137
  /**
119
138
  * Stretches the area between icon and label to max available space.
139
+ * @default false
120
140
  */
121
141
  stretch?: BreakpointCustomizable<boolean>;
122
142
  /**
123
143
  * Specifies the type of the button.
144
+ * @default 'submit'
124
145
  */
125
146
  type?: ButtonPureType;
126
147
  /**
127
148
  * Shows an underline under the label.
149
+ * @default false
128
150
  */
129
151
  underline?: boolean;
130
152
  /**