@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
@@ -3270,18 +3270,15 @@ const getComboboxAriaAttributes = (isOpen, isRequired, labelId, descriptionId, d
3270
3270
  };
3271
3271
  };
3272
3272
 
3273
- /** @deprecated since v4.0.0, will be removed with next major release. Use 2px instead. */
3274
- const borderWidthBase = '2px';
3275
-
3276
3273
  const fontPorscheNext = "'Porsche Next','Arial Narrow',Arial,'Heiti SC',SimHei,sans-serif";
3277
3274
 
3278
3275
  /** @deprecated since v4.0.0, will be removed with next major release. Use fontPorscheNext instead. */
3279
3276
  const fontFamily = fontPorscheNext;
3280
3277
 
3281
- const leadingNormal = 'calc(6px + 2.125ex)';
3278
+ const leadingNormal$1 = 'calc(6px + 2.125ex)';
3282
3279
 
3283
3280
  /** @deprecated since v4.0.0, will be removed with next major release. Use leadingNormal instead */
3284
- const fontLineHeight = leadingNormal;
3281
+ const fontLineHeight = leadingNormal$1;
3285
3282
 
3286
3283
  const typescaleSm = '1rem';
3287
3284
 
@@ -3440,7 +3437,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3440
3437
  'showPicker' in HTMLInputElement.prototype &&
3441
3438
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3442
3439
 
3443
- const prefix = `[Porsche Design System v${"4.0.0-beta.4"}]` // this part isn't covered by unit tests
3440
+ const prefix = `[Porsche Design System v${"4.0.0-rc.1"}]` // this part isn't covered by unit tests
3444
3441
  ;
3445
3442
  const consoleError$1 = (...messages) => {
3446
3443
  console.error(prefix, ...messages);
@@ -3461,64 +3458,6 @@ const supportsNativePopover = () => {
3461
3458
  const hasNativePopoverSupport = supportsNativePopover();
3462
3459
  // getter for easy mocking
3463
3460
  const getHasNativePopoverSupport = () => hasNativePopoverSupport;
3464
-
3465
- /*
3466
- Stencil Client Platform v4.23.2 | MIT Licensed | https://stenciljs.com
3467
- */
3468
- var __defProp = Object.defineProperty;
3469
- var __export = (target, all) => {
3470
- for (var name in all)
3471
- __defProp(target, name, { get: all[name], enumerable: true });
3472
- };
3473
-
3474
- // src/utils/result.ts
3475
- var result_exports = {};
3476
- __export(result_exports, {
3477
- err: () => err,
3478
- map: () => map,
3479
- ok: () => ok,
3480
- unwrap: () => unwrap,
3481
- unwrapErr: () => unwrapErr
3482
- });
3483
- var ok = (value) => ({
3484
- isOk: true,
3485
- isErr: false,
3486
- value
3487
- });
3488
- var err = (value) => ({
3489
- isOk: false,
3490
- isErr: true,
3491
- value
3492
- });
3493
- function map(result, fn) {
3494
- if (result.isOk) {
3495
- const val = fn(result.value);
3496
- if (val instanceof Promise) {
3497
- return val.then((newVal) => ok(newVal));
3498
- } else {
3499
- return ok(val);
3500
- }
3501
- }
3502
- if (result.isErr) {
3503
- const value = result.value;
3504
- return err(value);
3505
- }
3506
- throw "should never get here";
3507
- }
3508
- var unwrap = (result) => {
3509
- if (result.isOk) {
3510
- return result.value;
3511
- } else {
3512
- throw result.value;
3513
- }
3514
- };
3515
- var unwrapErr = (result) => {
3516
- if (result.isErr) {
3517
- return result.value;
3518
- } else {
3519
- throw result.value;
3520
- }
3521
- };
3522
3461
  const headerSlot = 'header';
3523
3462
  const anchorSlot = 'anchor';
3524
3463
 
@@ -3619,6 +3558,15 @@ const internalValidateProps = {
3619
3558
  const breakpointCustomizableTemplate = `value, ${internalValidateProps
3620
3559
  .formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {}))
3621
3560
  .replace(/"/g, '')}`;
3561
+ const getBannerAriaAttributes = (state, labelId, descriptionId) => {
3562
+ const isAlert = state === 'warning' || state === 'error';
3563
+ return {
3564
+ role: isAlert ? 'alert' : 'status',
3565
+ 'aria-live': isAlert ? 'assertive' : 'polite',
3566
+ 'aria-labelledby': labelId,
3567
+ 'aria-describedby': descriptionId,
3568
+ };
3569
+ };
3622
3570
  const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
3623
3571
  return {
3624
3572
  ...parseAndGetAriaAttributes(aria),
@@ -3767,16 +3715,7 @@ const buildIconUrl = (iconNameOrSource = DEFAULT_ICON_NAME) => {
3767
3715
  }
3768
3716
  return buildIconUrl(DEFAULT_ICON_NAME);
3769
3717
  };
3770
- const getInlineNotificationIconName = (state) => {
3771
- const iconMap = {
3772
- info: 'information-filled',
3773
- warning: 'warning-filled',
3774
- success: 'success-filled',
3775
- error: 'error-filled',
3776
- };
3777
- return iconMap[state];
3778
- };
3779
- const getContentAriaAttributes = (state, labelId, descriptionId) => {
3718
+ const getInlineNotificationAriaAttributes = (state, labelId, descriptionId) => {
3780
3719
  const isAlert = state === 'warning' || state === 'error';
3781
3720
  return {
3782
3721
  role: isAlert ? 'alert' : 'status',
@@ -3919,7 +3858,7 @@ const tempDiv = hasDocument ? document.createElement('div') : undefined;
3919
3858
  if (tempDiv) {
3920
3859
  tempDiv.style.position = 'absolute';
3921
3860
  tempDiv.style.visibility = 'hidden';
3922
- tempDiv.style.border = `${borderWidthBase} solid`;
3861
+ tempDiv.style.border = '1px solid';
3923
3862
  tempDiv.style.boxSizing = 'border-box';
3924
3863
  tempDiv.style.font = BUTTON_FONT.replace(fontFamily, tempFont);
3925
3864
  }
@@ -3976,12 +3915,12 @@ exports.createRange = createRange;
3976
3915
  exports.crestSize = crestSize;
3977
3916
  exports.descriptionId = descriptionId;
3978
3917
  exports.displaySizeToTagMap = displaySizeToTagMap;
3918
+ exports.getBannerAriaAttributes = getBannerAriaAttributes;
3979
3919
  exports.getButtonAriaAttributes = getButtonAriaAttributes;
3980
3920
  exports.getButtonBaseAriaAttributes = getButtonBaseAriaAttributes;
3981
3921
  exports.getButtonPureAriaAttributes = getButtonPureAriaAttributes;
3982
3922
  exports.getCDNBaseURL = getCDNBaseURL;
3983
3923
  exports.getComboboxAriaAttributes = getComboboxAriaAttributes;
3984
- exports.getContentAriaAttributes = getContentAriaAttributes;
3985
3924
  exports.getCurrentActivePage = getCurrentActivePage;
3986
3925
  exports.getDirectChildHTMLElement = getDirectChildHTMLElement;
3987
3926
  exports.getDisplayTagType = getDisplayTagType;
@@ -3989,7 +3928,7 @@ exports.getFieldsetAriaAttributes = getFieldsetAriaAttributes;
3989
3928
  exports.getHTMLElement = getHTMLElement;
3990
3929
  exports.getHasNativePopoverSupport = getHasNativePopoverSupport;
3991
3930
  exports.getHeadingTagType = getHeadingTagType;
3992
- exports.getInlineNotificationIconName = getInlineNotificationIconName;
3931
+ exports.getInlineNotificationAriaAttributes = getInlineNotificationAriaAttributes;
3993
3932
  exports.getSegmentedControlItemAriaAttributes = getSegmentedControlItemAriaAttributes;
3994
3933
  exports.getStepperHorizontalIconName = getStepperHorizontalIconName;
3995
3934
  exports.getSvgUrl = getSvgUrl;
@@ -7,22 +7,21 @@ var hooks = require('../../hooks.cjs');
7
7
  var utils = require('../../utils.cjs');
8
8
  var banner = require('../dsr-components/banner.cjs');
9
9
 
10
- const PBanner = /*#__PURE__*/ react.forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, state = 'info', className, children, ...rest }, ref) => {
10
+ const PBanner = /*#__PURE__*/ react.forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, position = { base: 'bottom', s: 'top' }, state = 'info', className, children, ...rest }, ref) => {
11
11
  const elementRef = react.useRef(undefined);
12
12
  hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
13
13
  const WebComponentTag = hooks.usePrefix('p-banner');
14
- const propsToSync = [description, dismissButton, heading, headingTag, open, state];
14
+ const propsToSync = [description, dismissButton, heading, headingTag, open, position, state];
15
15
  hooks.useBrowserLayoutEffect(() => {
16
16
  const { current } = elementRef;
17
- ['description', 'dismissButton', 'heading', 'headingTag', 'open', 'state'].forEach((propName, i) => (current[propName] = propsToSync[i]));
17
+ ['description', 'dismissButton', 'heading', 'headingTag', 'open', 'position', 'state'].forEach((propName, i) => (current[propName] = propsToSync[i]));
18
18
  }, propsToSync);
19
19
  const props = {
20
20
  ...rest,
21
21
  // @ts-ignore
22
22
  ...(!process.browser
23
23
  ? {
24
- ...{ "popover": "manual" },
25
- children: (jsxRuntime.jsx(banner.DSRBanner, { description, dismissButton, heading, headingTag, open, state, children })),
24
+ children: (jsxRuntime.jsx(banner.DSRBanner, { description, dismissButton, heading, headingTag, open, position, state, children })),
26
25
  }
27
26
  : {
28
27
  children,
@@ -6,7 +6,8 @@ require('../../provider.cjs');
6
6
  var splitChildren = require('../../splitChildren.cjs');
7
7
  var minifyCss = require('../../minifyCss.cjs');
8
8
  var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
9
- var inlineNotification_wrapper = require('../components/inline-notification.wrapper.cjs');
9
+ var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
10
+ var button_wrapper = require('../components/button.wrapper.cjs');
10
11
 
11
12
  /**
12
13
  * @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 }
@@ -16,12 +17,16 @@ var inlineNotification_wrapper = require('../components/inline-notification.wrap
16
17
  */
17
18
  class DSRBanner extends react.Component {
18
19
  host;
19
- inlineNotificationElement;
20
- closeBtn;
20
+ refPopover;
21
+ refDismiss;
21
22
  render() {
22
- const { namedSlotChildren} = splitChildren.splitChildren(this.props.children);
23
- const style = minifyCss.minifyCss(stylesEntry.getBannerCss(this.props.open));
24
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(inlineNotification_wrapper.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 && jsxRuntime.jsx("slot", { name: "heading", slot: "heading" }), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsxRuntime.jsx("slot", { name: "description" })] }) })] }), this.props.children] }));
23
+ splitChildren.splitChildren(this.props.children);
24
+ const bannerId = 'banner';
25
+ const labelId = 'heading';
26
+ const descriptionId = 'description';
27
+ const Heading = this.props.headingTag;
28
+ const style = minifyCss.minifyCss(stylesEntry.getBannerCss(this.props.open, this.props.position, this.props.state, this.props.dismissButton));
29
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("div", { id: bannerId, popover: "manual", "aria-hidden": this.props.open ? 'false' : 'true', ...utilsEntry.getBannerAriaAttributes(this.props.state, labelId, descriptionId), children: jsxRuntime.jsxs("div", { className: "banner", children: [this.props.heading ? jsxRuntime.jsx(Heading, { id: labelId, children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }), this.props.description ? jsxRuntime.jsx("p", { id: descriptionId, children: this.props.description }) : jsxRuntime.jsx("slot", { name: "description" }), this.props.dismissButton && (jsxRuntime.jsx(button_wrapper.PButton, { className: "dismiss", type: "button", variant: "secondary", icon: "close", hideLabel: true, compact: true, "aria-controls": bannerId, children: "Close banner" }))] }) })] }), this.props.children] }));
25
30
  }
26
31
  }
27
32
 
@@ -22,7 +22,7 @@ class DSRButton extends react.Component {
22
22
  render() {
23
23
  splitChildren.splitChildren(this.props.children);
24
24
  const style = minifyCss.minifyCss(stylesEntry.getButtonCss(this.props.icon, this.props.iconSource, this.props.variant, this.props.hideLabel, this.props.disabled, this.props.loading, this.props.compact));
25
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("button", { ...utilsEntry.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 ? loadingMessage.loadingId : undefined, children: [this.props.loading && jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", "aria-hidden": "true" }), utilsEntry.hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", size: "inherit", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: "inherit", "aria-hidden": "true" })), jsxRuntime.jsx("span", { className: "label", children: jsxRuntime.jsx("slot", {}) })] }), jsxRuntime.jsx(loadingMessage.LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
25
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("button", { ...utilsEntry.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 ? loadingMessage.loadingId : undefined, children: [this.props.loading && jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", "aria-hidden": "true" }), utilsEntry.hasVisibleIcon(this.props.icon, this.props.iconSource) && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: this.props.iconSource ? undefined : this.props.icon, source: this.props.iconSource, color: "inherit", "aria-hidden": "true" })), jsxRuntime.jsx("span", { className: "label", children: jsxRuntime.jsx("slot", {}) })] }), jsxRuntime.jsx(loadingMessage.LoadingMessage, { loading: this.props.loading, initialLoading: this.props.initialLoading })] })] }), this.props.children] }));
26
26
  }
27
27
  }
28
28
 
@@ -9,7 +9,6 @@ var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-e
9
9
  var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
10
10
  var button_wrapper = require('../components/button.wrapper.cjs');
11
11
  var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
12
- var icon_wrapper = require('../components/icon.wrapper.cjs');
13
12
 
14
13
  /**
15
14
  * @slot {"name": "heading", "description": "Shows a heading. Can be used to render rich markup." }
@@ -18,14 +17,13 @@ var icon_wrapper = require('../components/icon.wrapper.cjs');
18
17
  class DSRInlineNotification extends react.Component {
19
18
  host;
20
19
  render() {
21
- const { namedSlotChildren} = splitChildren.splitChildren(this.props.children);
22
- const bannerId = 'banner';
23
- const labelId = 'label';
20
+ splitChildren.splitChildren(this.props.children);
21
+ const notificationId = 'notification';
22
+ const labelId = 'heading';
24
23
  const descriptionId = 'description';
25
24
  const Heading = this.props.headingTag;
26
25
  const style = minifyCss.minifyCss(stylesEntry.getInlineNotificationCss(this.props.state, !!this.props.actionLabel, this.props.dismissButton));
27
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: utilsEntry.getInlineNotificationIconName(this.props.state), color: this.props.state, "aria-hidden": "true" }), jsxRuntime.jsxs("div", { id: bannerId, className: "content", ...utilsEntry.getContentAriaAttributes(this.props.state, labelId, descriptionId), children: [(this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0) &&
28
- (this.props.heading ? (jsxRuntime.jsx(Heading, { id: labelId, className: "heading", children: this.props.heading })) : (jsxRuntime.jsx("slot", { name: "heading" }))), jsxRuntime.jsx("p", { id: descriptionId, className: "description", children: this.props.description || jsxRuntime.jsx("slot", {}) })] }), this.props.actionLabel && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), this.props.dismissButton && (jsxRuntime.jsx(button_wrapper.PButton, { className: "close", type: "button", variant: "secondary", icon: "close", hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
26
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { id: notificationId, className: "notification", ...utilsEntry.getInlineNotificationAriaAttributes(this.props.state, labelId, descriptionId), children: [this.props.heading ? jsxRuntime.jsx(Heading, { id: labelId, children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }), this.props.description ? jsxRuntime.jsx("p", { id: descriptionId, children: this.props.description }) : jsxRuntime.jsx("slot", {}), this.props.actionLabel && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "action", icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), this.props.dismissButton && (jsxRuntime.jsx(button_wrapper.PButton, { className: "dismiss", type: "button", variant: "secondary", icon: "close", hideLabel: true, compact: true, "aria-controls": notificationId, children: "Close notification" }))] })] }), this.props.children] }));
29
27
  }
30
28
  }
31
29
 
@@ -10,10 +10,7 @@ const StateMessage = ({ hasMessage, state, message }) => {
10
10
  const isErrorState = state === 'error';
11
11
  return (
12
12
  // needs to be rendered always to have correct behaviour for screen readers
13
- jsxRuntime.jsx("span", { id: messageId, className: "message", role: state === 'success' ? 'status' : 'alert', children: hasMessage && [
14
- jsxRuntime.jsx(icon_wrapper.PIcon, { name: isErrorState ? 'exclamation' : 'check', color: isErrorState ? 'error' : 'success', "aria-hidden": "true" }),
15
- message || jsxRuntime.jsx("slot", { name: "message" }),
16
- ] }));
13
+ jsxRuntime.jsx("span", { id: messageId, className: "message", role: state === 'success' ? 'status' : 'alert', children: hasMessage && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(icon_wrapper.PIcon, { name: isErrorState ? 'exclamation' : 'check', color: isErrorState ? 'error' : 'success', "aria-hidden": "true" }), message || jsxRuntime.jsx("slot", { name: "message" })] })) }));
17
14
  };
18
15
 
19
16
  exports.StateMessage = StateMessage;