@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.
- package/CHANGELOG.md +72 -4
- package/cjs/lib/components/banner.wrapper.cjs +3 -3
- package/esm/lib/components/accordion.wrapper.d.ts +8 -0
- package/esm/lib/components/banner.wrapper.d.ts +37 -15
- package/esm/lib/components/banner.wrapper.mjs +3 -3
- package/esm/lib/components/button-pure.wrapper.d.ts +22 -0
- package/esm/lib/components/button-tile.wrapper.d.ts +20 -0
- package/esm/lib/components/button.wrapper.d.ts +14 -0
- package/esm/lib/components/canvas.wrapper.d.ts +6 -0
- package/esm/lib/components/carousel.wrapper.d.ts +22 -0
- package/esm/lib/components/checkbox.wrapper.d.ts +24 -0
- package/esm/lib/components/crest.wrapper.d.ts +2 -0
- package/esm/lib/components/display.wrapper.d.ts +8 -0
- package/esm/lib/components/divider.wrapper.d.ts +4 -0
- package/esm/lib/components/drilldown-item.wrapper.d.ts +6 -0
- package/esm/lib/components/drilldown-link.wrapper.d.ts +4 -0
- package/esm/lib/components/drilldown.wrapper.d.ts +2 -0
- package/esm/lib/components/fieldset.wrapper.d.ts +10 -0
- package/esm/lib/components/flag.wrapper.d.ts +4 -0
- package/esm/lib/components/flyout.wrapper.d.ts +12 -0
- package/esm/lib/components/heading.wrapper.d.ts +12 -0
- package/esm/lib/components/icon.wrapper.d.ts +6 -0
- package/esm/lib/components/inline-notification.wrapper.d.ts +14 -0
- package/esm/lib/components/input-date.wrapper.d.ts +24 -0
- package/esm/lib/components/input-email.wrapper.d.ts +28 -0
- package/esm/lib/components/input-month.wrapper.d.ts +24 -0
- package/esm/lib/components/input-number.wrapper.d.ts +28 -0
- package/esm/lib/components/input-password.wrapper.d.ts +26 -0
- package/esm/lib/components/input-search.wrapper.d.ts +28 -0
- package/esm/lib/components/input-tel.wrapper.d.ts +26 -0
- package/esm/lib/components/input-text.wrapper.d.ts +26 -0
- package/esm/lib/components/input-time.wrapper.d.ts +24 -0
- package/esm/lib/components/input-url.wrapper.d.ts +26 -0
- package/esm/lib/components/input-week.wrapper.d.ts +24 -0
- package/esm/lib/components/link-pure.wrapper.d.ts +18 -0
- package/esm/lib/components/link-tile-product.wrapper.d.ts +8 -0
- package/esm/lib/components/link-tile.wrapper.d.ts +14 -0
- package/esm/lib/components/link.wrapper.d.ts +10 -0
- package/esm/lib/components/modal.wrapper.d.ts +12 -0
- package/esm/lib/components/model-signature.wrapper.d.ts +12 -0
- package/esm/lib/components/multi-select-option.wrapper.d.ts +2 -0
- package/esm/lib/components/multi-select.wrapper.d.ts +20 -0
- package/esm/lib/components/optgroup.wrapper.d.ts +2 -0
- package/esm/lib/components/pagination.wrapper.d.ts +10 -0
- package/esm/lib/components/pin-code.wrapper.d.ts +24 -0
- package/esm/lib/components/popover.wrapper.d.ts +2 -0
- package/esm/lib/components/radio-group-option.wrapper.d.ts +4 -0
- package/esm/lib/components/radio-group.wrapper.d.ts +22 -0
- package/esm/lib/components/scroller.wrapper.d.ts +6 -0
- package/esm/lib/components/segmented-control-item.wrapper.d.ts +2 -0
- package/esm/lib/components/segmented-control.wrapper.d.ts +18 -0
- package/esm/lib/components/select-option.wrapper.d.ts +2 -0
- package/esm/lib/components/select.wrapper.d.ts +20 -0
- package/esm/lib/components/sheet.wrapper.d.ts +8 -0
- package/esm/lib/components/spinner.wrapper.d.ts +4 -0
- package/esm/lib/components/stepper-horizontal-item.wrapper.d.ts +2 -0
- package/esm/lib/components/stepper-horizontal.wrapper.d.ts +2 -0
- package/esm/lib/components/switch.wrapper.d.ts +14 -0
- package/esm/lib/components/table-cell.wrapper.d.ts +2 -0
- package/esm/lib/components/table-head-cell.wrapper.d.ts +4 -0
- package/esm/lib/components/table.wrapper.d.ts +6 -0
- package/esm/lib/components/tabs-bar.wrapper.d.ts +6 -0
- package/esm/lib/components/tabs.wrapper.d.ts +8 -0
- package/esm/lib/components/tag-dismissible.wrapper.d.ts +2 -0
- package/esm/lib/components/tag.wrapper.d.ts +6 -0
- package/esm/lib/components/text-list.wrapper.d.ts +2 -0
- package/esm/lib/components/text.wrapper.d.ts +14 -0
- package/esm/lib/components/textarea.wrapper.d.ts +30 -0
- package/esm/lib/components/wordmark.wrapper.d.ts +4 -0
- package/esm/lib/types.d.ts +5 -0
- package/global-styles/cn/index.css +1 -0
- package/global-styles/index.css +1 -0
- package/global-styles/variables.css +1 -0
- package/package.json +4 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +723 -775
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +16 -77
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.cjs +4 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +11 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.cjs +4 -6
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.cjs +1 -4
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +723 -775
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +15 -76
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.mjs +4 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +11 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +5 -7
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.mjs +2 -5
- package/ssr/esm/lib/components/accordion.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/banner.wrapper.d.ts +37 -15
- package/ssr/esm/lib/components/button-pure.wrapper.d.ts +22 -0
- package/ssr/esm/lib/components/button-tile.wrapper.d.ts +20 -0
- package/ssr/esm/lib/components/button.wrapper.d.ts +14 -0
- package/ssr/esm/lib/components/canvas.wrapper.d.ts +6 -0
- package/ssr/esm/lib/components/carousel.wrapper.d.ts +22 -0
- package/ssr/esm/lib/components/checkbox.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/crest.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/display.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/divider.wrapper.d.ts +4 -0
- package/ssr/esm/lib/components/drilldown-item.wrapper.d.ts +6 -0
- package/ssr/esm/lib/components/drilldown-link.wrapper.d.ts +4 -0
- package/ssr/esm/lib/components/drilldown.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/fieldset.wrapper.d.ts +10 -0
- package/ssr/esm/lib/components/flag.wrapper.d.ts +4 -0
- package/ssr/esm/lib/components/flyout.wrapper.d.ts +12 -0
- package/ssr/esm/lib/components/heading.wrapper.d.ts +12 -0
- package/ssr/esm/lib/components/icon.wrapper.d.ts +6 -0
- package/ssr/esm/lib/components/inline-notification.wrapper.d.ts +14 -0
- package/ssr/esm/lib/components/input-date.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/input-email.wrapper.d.ts +28 -0
- package/ssr/esm/lib/components/input-month.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/input-number.wrapper.d.ts +28 -0
- package/ssr/esm/lib/components/input-password.wrapper.d.ts +26 -0
- package/ssr/esm/lib/components/input-search.wrapper.d.ts +28 -0
- package/ssr/esm/lib/components/input-tel.wrapper.d.ts +26 -0
- package/ssr/esm/lib/components/input-text.wrapper.d.ts +26 -0
- package/ssr/esm/lib/components/input-time.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/input-url.wrapper.d.ts +26 -0
- package/ssr/esm/lib/components/input-week.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/link-pure.wrapper.d.ts +18 -0
- package/ssr/esm/lib/components/link-tile-product.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/link-tile.wrapper.d.ts +14 -0
- package/ssr/esm/lib/components/link.wrapper.d.ts +10 -0
- package/ssr/esm/lib/components/modal.wrapper.d.ts +12 -0
- package/ssr/esm/lib/components/model-signature.wrapper.d.ts +12 -0
- package/ssr/esm/lib/components/multi-select-option.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/multi-select.wrapper.d.ts +20 -0
- package/ssr/esm/lib/components/optgroup.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/pagination.wrapper.d.ts +10 -0
- package/ssr/esm/lib/components/pin-code.wrapper.d.ts +24 -0
- package/ssr/esm/lib/components/popover.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/radio-group-option.wrapper.d.ts +4 -0
- package/ssr/esm/lib/components/radio-group.wrapper.d.ts +22 -0
- package/ssr/esm/lib/components/scroller.wrapper.d.ts +6 -0
- package/ssr/esm/lib/components/segmented-control-item.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/segmented-control.wrapper.d.ts +18 -0
- package/ssr/esm/lib/components/select-option.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/select.wrapper.d.ts +20 -0
- package/ssr/esm/lib/components/sheet.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/spinner.wrapper.d.ts +4 -0
- package/ssr/esm/lib/components/stepper-horizontal-item.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/stepper-horizontal.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/switch.wrapper.d.ts +14 -0
- package/ssr/esm/lib/components/table-cell.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/table-head-cell.wrapper.d.ts +4 -0
- package/ssr/esm/lib/components/table.wrapper.d.ts +6 -0
- package/ssr/esm/lib/components/tabs-bar.wrapper.d.ts +6 -0
- package/ssr/esm/lib/components/tabs.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/tag-dismissible.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/tag.wrapper.d.ts +6 -0
- package/ssr/esm/lib/components/text-list.wrapper.d.ts +2 -0
- package/ssr/esm/lib/components/text.wrapper.d.ts +14 -0
- package/ssr/esm/lib/components/textarea.wrapper.d.ts +30 -0
- package/ssr/esm/lib/components/wordmark.wrapper.d.ts +4 -0
- package/ssr/esm/lib/dsr-components/banner.d.ts +2 -2
- package/ssr/esm/lib/types.d.ts +5 -0
- 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-
|
|
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
|
|
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 =
|
|
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.
|
|
3931
|
+
exports.getInlineNotificationAriaAttributes = getInlineNotificationAriaAttributes;
|
|
3993
3932
|
exports.getSegmentedControlItemAriaAttributes = getSegmentedControlItemAriaAttributes;
|
|
3994
3933
|
exports.getStepperHorizontalIconName = getStepperHorizontalIconName;
|
|
3995
3934
|
exports.getSvgUrl = getSvgUrl;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.cjs
CHANGED
|
@@ -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
|
-
|
|
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,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs
CHANGED
|
@@ -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
|
|
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
|
-
|
|
20
|
-
|
|
20
|
+
refPopover;
|
|
21
|
+
refDismiss;
|
|
21
22
|
render() {
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
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
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.cjs
CHANGED
|
@@ -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",
|
|
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
|
-
|
|
22
|
-
const
|
|
23
|
-
const labelId = '
|
|
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(
|
|
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
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.cjs
CHANGED
|
@@ -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;
|