@porsche-design-system/components-react 3.15.0-rc.0 → 3.15.0-rc.2
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 +33 -0
- package/cjs/lib/components/accordion.wrapper.cjs +3 -3
- package/cjs/lib/components/banner.wrapper.cjs +3 -3
- package/cjs/lib/components/inline-notification.wrapper.cjs +3 -3
- package/esm/lib/components/accordion.wrapper.d.ts +19 -3
- package/esm/lib/components/accordion.wrapper.mjs +3 -3
- package/esm/lib/components/banner.wrapper.d.ts +9 -1
- package/esm/lib/components/banner.wrapper.mjs +3 -3
- package/esm/lib/components/display.wrapper.d.ts +2 -2
- package/esm/lib/components/heading.wrapper.d.ts +2 -2
- package/esm/lib/components/inline-notification.wrapper.d.ts +9 -1
- package/esm/lib/components/inline-notification.wrapper.mjs +3 -3
- package/esm/lib/components/link-tile-model-signature.wrapper.d.ts +2 -2
- package/esm/lib/types.d.ts +24 -20
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +43 -39
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +3 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/inline-notification.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.cjs +2 -2
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.cjs +3 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs +1 -11
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +43 -39
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +3 -3
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/inline-notification.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +3 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs +1 -11
- package/ssr/esm/lib/components/accordion.wrapper.d.ts +19 -3
- package/ssr/esm/lib/components/banner.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/display.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/heading.wrapper.d.ts +2 -2
- package/ssr/esm/lib/components/inline-notification.wrapper.d.ts +9 -1
- package/ssr/esm/lib/components/link-tile-model-signature.wrapper.d.ts +2 -2
- package/ssr/esm/lib/dsr-components/modal.d.ts +0 -8
- package/ssr/esm/lib/types.d.ts +24 -20
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.cjs
CHANGED
|
@@ -7,15 +7,15 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var accordion = require('../dsr-components/accordion.cjs');
|
|
9
9
|
|
|
10
|
-
const PAccordion = react.forwardRef(({ compact, heading, onAccordionChange, onUpdate, open, size = 'small', tag
|
|
10
|
+
const PAccordion = react.forwardRef(({ compact, heading, headingTag = 'h2', onAccordionChange, onUpdate, open, size = 'small', sticky, tag, theme, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
hooks.useEventCallback(elementRef, 'accordionChange', onAccordionChange);
|
|
13
13
|
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
14
14
|
const WebComponentTag = hooks.usePrefix('p-accordion');
|
|
15
|
-
const propsToSync = [compact, heading, open, size, tag, theme || hooks.useTheme()];
|
|
15
|
+
const propsToSync = [compact, heading, headingTag, open, size, sticky, tag, theme || hooks.useTheme()];
|
|
16
16
|
hooks.useBrowserLayoutEffect(() => {
|
|
17
17
|
const { current } = elementRef;
|
|
18
|
-
['compact', 'heading', 'open', 'size', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
|
+
['compact', 'heading', 'headingTag', 'open', 'size', 'sticky', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
19
19
|
}, propsToSync);
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
if (!process.browser) {
|
|
@@ -26,7 +26,7 @@ const PAccordion = react.forwardRef(({ compact, heading, onAccordionChange, onUp
|
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
...(!process.browser
|
|
28
28
|
? {
|
|
29
|
-
children: (jsxRuntime.jsx(accordion.DSRAccordion, { compact, heading, open, size, tag, theme: theme || hooks.useTheme(), children })),
|
|
29
|
+
children: (jsxRuntime.jsx(accordion.DSRAccordion, { compact, heading, headingTag, open, size, sticky, tag, theme: theme || hooks.useTheme(), children })),
|
|
30
30
|
}
|
|
31
31
|
: {
|
|
32
32
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.cjs
CHANGED
|
@@ -7,14 +7,14 @@ 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 = react.forwardRef(({ description = '', dismissButton = true, heading = '', onDismiss, open = false, persistent, state = 'info', theme, width, className, children, ...rest }, ref) => {
|
|
10
|
+
const PBanner = react.forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, persistent, state = 'info', theme, width, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-banner');
|
|
14
|
-
const propsToSync = [description, dismissButton, heading, open, persistent, state, theme || hooks.useTheme(), width];
|
|
14
|
+
const propsToSync = [description, dismissButton, heading, headingTag, open, persistent, state, theme || hooks.useTheme(), width];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['description', 'dismissButton', 'heading', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['description', 'dismissButton', 'heading', 'headingTag', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
18
|
}, propsToSync);
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
if (!process.browser) {
|
|
@@ -25,7 +25,7 @@ const PBanner = react.forwardRef(({ description = '', dismissButton = true, head
|
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
...(!process.browser
|
|
27
27
|
? {
|
|
28
|
-
children: (jsxRuntime.jsx(banner.DSRBanner, { description, dismissButton, heading, open, persistent, state, theme: theme || hooks.useTheme(), width, children })),
|
|
28
|
+
children: (jsxRuntime.jsx(banner.DSRBanner, { description, dismissButton, heading, headingTag, open, persistent, state, theme: theme || hooks.useTheme(), width, children })),
|
|
29
29
|
}
|
|
30
30
|
: {
|
|
31
31
|
children,
|
|
@@ -7,15 +7,15 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var inlineNotification = require('../dsr-components/inline-notification.cjs');
|
|
9
9
|
|
|
10
|
-
const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', onAction, onDismiss, persistent, state = 'info', theme, className, children, ...rest }, ref) => {
|
|
10
|
+
const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', headingTag = 'h5', onAction, onDismiss, persistent, state = 'info', theme, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
hooks.useEventCallback(elementRef, 'action', onAction);
|
|
13
13
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
14
14
|
const WebComponentTag = hooks.usePrefix('p-inline-notification');
|
|
15
|
-
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme || hooks.useTheme()];
|
|
15
|
+
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, headingTag, persistent, state, theme || hooks.useTheme()];
|
|
16
16
|
hooks.useBrowserLayoutEffect(() => {
|
|
17
17
|
const { current } = elementRef;
|
|
18
|
-
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
|
+
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'headingTag', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
19
19
|
}, propsToSync);
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
if (!process.browser) {
|
|
@@ -26,7 +26,7 @@ const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', acti
|
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
...(!process.browser
|
|
28
28
|
? {
|
|
29
|
-
children: (jsxRuntime.jsx(inlineNotification.DSRInlineNotification, { actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme: theme || hooks.useTheme(), children })),
|
|
29
|
+
children: (jsxRuntime.jsx(inlineNotification.DSRInlineNotification, { actionIcon, actionLabel, actionLoading, description, dismissButton, heading, headingTag, persistent, state, theme: theme || hooks.useTheme(), children })),
|
|
30
30
|
}
|
|
31
31
|
: {
|
|
32
32
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.cjs
CHANGED
|
@@ -82,8 +82,8 @@ class DSRAccordion extends react.Component {
|
|
|
82
82
|
splitChildren.splitChildren(this.props.children);
|
|
83
83
|
const buttonId = 'accordion-control';
|
|
84
84
|
const contentId = 'accordion-panel';
|
|
85
|
-
const Heading = this.props.tag;
|
|
86
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getAccordionCss(this.props.size, this.props.compact, this.props.open, this.props.theme)));
|
|
85
|
+
const Heading = this.props.tag || this.props.headingTag;
|
|
86
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getAccordionCss(this.props.size, this.props.compact, this.props.open, this.props.theme, this.props.sticky)));
|
|
87
87
|
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(Heading, { className: "heading", children: jsxRuntime.jsxs("button", { id: buttonId, type: "button", "aria-expanded": this.props.open ? 'true' : 'false', "aria-controls": contentId, children: [this.props.heading || jsxRuntime.jsx("slot", { name: "heading" }), jsxRuntime.jsx("span", { className: "icon-container", children: jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: this.props.open ? 'minus' : 'plus', theme: this.props.theme, size: "xx-small", "aria-hidden": "true" }) })] }) }), jsxRuntime.jsx("div", { id: contentId, className: "collapsible", role: "region", "aria-labelledby": buttonId, children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx("slot", {}) }) })] })] }), this.props.children] }));
|
|
88
88
|
}
|
|
89
89
|
}
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.cjs
CHANGED
|
@@ -87,7 +87,7 @@ class DSRBanner extends react.Component {
|
|
|
87
87
|
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
88
88
|
const hasTitleSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
|
|
89
89
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getBannerCss(this.props.open)));
|
|
90
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(inlineNotification_wrapper.PInlineNotification, { heading: this.props.heading, description: this.props.description, state: this.props.state, dismissButton: this.hasDismissButton, theme: this.props.theme, "aria-hidden": !this.props.open ? 'true' : 'false', children: [namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsxRuntime.jsx("slot", { name: "heading", slot: "heading" })) : (hasTitleSlot && jsxRuntime.jsx("slot", { name: "title", slot: "heading" })), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsxRuntime.jsx("slot", { name: "description" })] })] }), this.props.children] }));
|
|
90
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs(inlineNotification_wrapper.PInlineNotification, { heading: this.props.heading, headingTag: this.props.headingTag, description: this.props.description, state: this.props.state, dismissButton: this.hasDismissButton, theme: this.props.theme, "aria-hidden": !this.props.open ? 'true' : 'false', children: [namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsxRuntime.jsx("slot", { name: "heading", slot: "heading" })) : (hasTitleSlot && jsxRuntime.jsx("slot", { name: "title", slot: "heading" })), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsxRuntime.jsx("slot", { name: "description" })] })] }), this.props.children] }));
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -87,8 +87,10 @@ class DSRInlineNotification extends react.Component {
|
|
|
87
87
|
const bannerId = 'banner';
|
|
88
88
|
const labelId = 'label';
|
|
89
89
|
const descriptionId = 'description';
|
|
90
|
+
const Heading = this.props.headingTag;
|
|
90
91
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getInlineNotificationCss(this.props.state, !!this.props.actionLabel, this.hasDismissButton, this.props.theme)));
|
|
91
|
-
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: `notification-${this.props.state}`, theme: this.props.theme, "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) &&
|
|
92
|
+
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: `notification-${this.props.state}`, theme: this.props.theme, "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) &&
|
|
93
|
+
(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", theme: this.props.theme, icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), this.hasDismissButton && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "close", type: "button", icon: "close", theme: this.props.theme, hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.cjs
CHANGED
|
@@ -79,16 +79,6 @@ var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entr
|
|
|
79
79
|
|
|
80
80
|
class DSRModal extends react.Component {
|
|
81
81
|
host;
|
|
82
|
-
scrollContainerEl; // Necessary to avoid stacking background bug in safari
|
|
83
|
-
focusedElBeforeOpen;
|
|
84
|
-
dismissBtn;
|
|
85
|
-
hasHeader;
|
|
86
|
-
hasFooter;
|
|
87
|
-
footer;
|
|
88
|
-
dialog;
|
|
89
|
-
get hasDismissButton() {
|
|
90
|
-
return this.props.disableCloseButton ? false : this.props.dismissButton;
|
|
91
|
-
}
|
|
92
82
|
render() {
|
|
93
83
|
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
94
84
|
const hasHeader = (this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0);
|
|
@@ -101,7 +91,7 @@ class DSRModal extends react.Component {
|
|
|
101
91
|
'aria-label': this.props.heading,
|
|
102
92
|
'aria-hidden': !this.props.open,
|
|
103
93
|
...utilsEntry.parseAndGetAriaAttributes(this.props.aria),
|
|
104
|
-
}), tabIndex: -1, inert: this.props.open ? null : '', children: [hasDismissButton && (jsxRuntime.jsx("div", { className: "controls", children: jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss modal" }) })), hasHeader && (jsxRuntime.jsx("div", { className: "header", children: this.props.heading ? jsxRuntime.jsx("h2", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }) })), jsxRuntime.jsx("div", { className: "content", children: jsxRuntime.jsx("slot", {}) }), hasFooter && (jsxRuntime.jsx("div", { className: "footer", children: jsxRuntime.jsx("slot", { name: "footer" }) }))] }) }) })] }), this.props.children] }));
|
|
94
|
+
}), tabIndex: -1, inert: this.props.open ? null : '', children: [hasDismissButton && (jsxRuntime.jsx("div", { className: "controls", children: jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss modal" }) })), hasHeader && (jsxRuntime.jsx("div", { className: "header", children: this.props.heading ? jsxRuntime.jsx("h2", { children: this.props.heading }) : jsxRuntime.jsx("slot", { name: "heading" }) }, "heading")), jsxRuntime.jsx("div", { className: "content", children: jsxRuntime.jsx("slot", {}) }), hasFooter && (jsxRuntime.jsx("div", { className: "footer", children: jsxRuntime.jsx("slot", { name: "footer" }) }, "footer"))] }) }) })] }), this.props.children] }));
|
|
105
95
|
}
|
|
106
96
|
}
|
|
107
97
|
|
|
@@ -40,7 +40,7 @@ function toPrimitive(t, r) {
|
|
|
40
40
|
|
|
41
41
|
function toPropertyKey(t) {
|
|
42
42
|
var i = toPrimitive(t, "string");
|
|
43
|
-
return "symbol" == _typeof(i) ? i :
|
|
43
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function _defineProperties(target, props) {
|
|
@@ -4064,6 +4064,8 @@ const isThemeDark = (theme) => {
|
|
|
4064
4064
|
return theme === 'dark';
|
|
4065
4065
|
};
|
|
4066
4066
|
|
|
4067
|
+
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
4068
|
+
|
|
4067
4069
|
const headerSlot = 'header';
|
|
4068
4070
|
const anchorSlot = 'anchor';
|
|
4069
4071
|
|
|
@@ -4077,11 +4079,11 @@ const formatObjectOutput = (value) => {
|
|
|
4077
4079
|
'value, ' +
|
|
4078
4080
|
formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '');
|
|
4079
4081
|
|
|
4080
|
-
const
|
|
4081
|
-
|
|
4082
|
-
const
|
|
4083
|
-
const
|
|
4084
|
-
const
|
|
4082
|
+
const getComponentCss$15 = (size, compact, open, theme, sticky) => {
|
|
4083
|
+
const { primaryColor, hoverColor, contrastLowColor, backgroundColor } = getThemedColors(theme);
|
|
4084
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
4085
|
+
const cssVariablePositionStickyTop = '--p-accordion-position-sticky-top';
|
|
4086
|
+
const positionStickyTopFallback = '0';
|
|
4085
4087
|
return getCss({
|
|
4086
4088
|
'@global': {
|
|
4087
4089
|
':host': {
|
|
@@ -4157,6 +4159,15 @@ const getComponentCss$15 = (size, compact, open, theme) => {
|
|
|
4157
4159
|
},
|
|
4158
4160
|
heading: {
|
|
4159
4161
|
margin: 0,
|
|
4162
|
+
...(sticky && {
|
|
4163
|
+
position: 'sticky',
|
|
4164
|
+
top: `var(${cssVariablePositionStickyTop}, ${positionStickyTopFallback})`,
|
|
4165
|
+
zIndex: 1, // to be on top of the collapsible
|
|
4166
|
+
backgroundColor,
|
|
4167
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4168
|
+
backgroundColor: backgroundColorDark,
|
|
4169
|
+
}),
|
|
4170
|
+
}),
|
|
4160
4171
|
},
|
|
4161
4172
|
'icon-container': {
|
|
4162
4173
|
height: fontLineHeight,
|
|
@@ -4178,6 +4189,10 @@ const getComponentCss$15 = (size, compact, open, theme) => {
|
|
|
4178
4189
|
color: primaryColorDark,
|
|
4179
4190
|
}),
|
|
4180
4191
|
display: 'grid',
|
|
4192
|
+
...(sticky && {
|
|
4193
|
+
position: 'relative',
|
|
4194
|
+
zIndex: 0, // to be below the heading
|
|
4195
|
+
}),
|
|
4181
4196
|
...(open
|
|
4182
4197
|
? {
|
|
4183
4198
|
gridTemplateRows: '1fr',
|
|
@@ -5443,21 +5458,7 @@ ellipsis, theme) => {
|
|
|
5443
5458
|
};
|
|
5444
5459
|
const getTypographySlottedJssStyle = () => {
|
|
5445
5460
|
return {
|
|
5446
|
-
|
|
5447
|
-
padding: 'inherit',
|
|
5448
|
-
fontFamily: 'inherit',
|
|
5449
|
-
fontWeight: 'inherit',
|
|
5450
|
-
fontSize: 'inherit',
|
|
5451
|
-
lineHeight: 'inherit',
|
|
5452
|
-
fontStyle: 'inherit',
|
|
5453
|
-
fontVariant: 'inherit',
|
|
5454
|
-
color: 'inherit',
|
|
5455
|
-
textAlign: 'inherit',
|
|
5456
|
-
overflowWrap: 'inherit',
|
|
5457
|
-
wordWrap: 'inherit',
|
|
5458
|
-
hyphens: 'inherit',
|
|
5459
|
-
whiteSpace: 'inherit',
|
|
5460
|
-
letterSpacing: 'inherit',
|
|
5461
|
+
all: 'unset',
|
|
5461
5462
|
};
|
|
5462
5463
|
};
|
|
5463
5464
|
|
|
@@ -5476,9 +5477,7 @@ const getComponentCss$X = (size, align, color, ellipsis, theme) => {
|
|
|
5476
5477
|
...hostHiddenStyles,
|
|
5477
5478
|
}),
|
|
5478
5479
|
},
|
|
5479
|
-
|
|
5480
|
-
[DISPLAY_TAGS.map((i) => `&(${i})`).join()]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
5481
|
-
},
|
|
5480
|
+
[`::slotted(:is(${DISPLAY_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
5482
5481
|
},
|
|
5483
5482
|
root: getTypographyRootJssStyle(displayLargeStyle, buildResponsiveStyles(size, (sizeValue) => ({
|
|
5484
5483
|
fontSize: sizeValue === 'inherit' ? sizeValue : sizeMap$4[sizeValue],
|
|
@@ -6193,9 +6192,7 @@ const getComponentCss$M = (size, align, color, ellipsis, theme) => {
|
|
|
6193
6192
|
...hostHiddenStyles,
|
|
6194
6193
|
}),
|
|
6195
6194
|
},
|
|
6196
|
-
|
|
6197
|
-
[HEADING_TAGS.map((i) => `&(${i})`).join()]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
6198
|
-
},
|
|
6195
|
+
[`::slotted(:is(${HEADING_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
6199
6196
|
},
|
|
6200
6197
|
root: getTypographyRootJssStyle(headingXXLargeStyle, buildResponsiveStyles(size, (sizeValue) => ({
|
|
6201
6198
|
fontSize: sizeValue === 'inherit' ? sizeValue : sizeMap$3[sizeValue],
|
|
@@ -6459,6 +6456,17 @@ const getNotificationContentJssStyle = () => ({
|
|
|
6459
6456
|
});
|
|
6460
6457
|
|
|
6461
6458
|
const mediaQueryMaxS$1 = getMediaQueryMax('s');
|
|
6459
|
+
const getTextJssStyle = (theme) => ({
|
|
6460
|
+
margin: 0,
|
|
6461
|
+
color: getThemedColors(theme).primaryColor,
|
|
6462
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6463
|
+
color: getThemedColors('dark').primaryColor,
|
|
6464
|
+
}),
|
|
6465
|
+
});
|
|
6466
|
+
const getHeadingJssStyle = (theme) => ({
|
|
6467
|
+
...headingSmallStyle,
|
|
6468
|
+
...getTextJssStyle(theme),
|
|
6469
|
+
});
|
|
6462
6470
|
const getComponentCss$J = (state, hasAction, hasClose, theme) => {
|
|
6463
6471
|
return getCss({
|
|
6464
6472
|
'@global': {
|
|
@@ -6470,15 +6478,13 @@ const getComponentCss$J = (state, hasAction, hasClose, theme) => {
|
|
|
6470
6478
|
...hostHiddenStyles,
|
|
6471
6479
|
}),
|
|
6472
6480
|
},
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
}),
|
|
6481
|
-
},
|
|
6481
|
+
[`::slotted(:is(${HEADING_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
6482
|
+
'slot[name="heading"]': getHeadingJssStyle(theme),
|
|
6483
|
+
},
|
|
6484
|
+
heading: getHeadingJssStyle(theme),
|
|
6485
|
+
description: {
|
|
6486
|
+
...textSmallStyle,
|
|
6487
|
+
...getTextJssStyle(theme),
|
|
6482
6488
|
},
|
|
6483
6489
|
icon: getNotificationIconJssStyle(),
|
|
6484
6490
|
content: getNotificationContentJssStyle(),
|
|
@@ -10076,9 +10082,7 @@ const getComponentCss$4 = (size, weight, align, color, ellipsis, theme) => {
|
|
|
10076
10082
|
...hostHiddenStyles,
|
|
10077
10083
|
}),
|
|
10078
10084
|
},
|
|
10079
|
-
|
|
10080
|
-
[TEXT_TAGS.map((i) => `&(${i})`).join()]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
10081
|
-
},
|
|
10085
|
+
[`::slotted(:is(${TEXT_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
10082
10086
|
},
|
|
10083
10087
|
root: getTypographyRootJssStyle(textSmallStyle, buildResponsiveStyles(size, (sizeValue) => ({
|
|
10084
10088
|
fontSize: sizeValue === 'inherit' ? sizeValue : sizeMap[sizeValue],
|
|
@@ -40,7 +40,7 @@ function toPrimitive(t, r) {
|
|
|
40
40
|
|
|
41
41
|
function toPropertyKey(t) {
|
|
42
42
|
var i = toPrimitive(t, "string");
|
|
43
|
-
return "symbol" == _typeof(i) ? i :
|
|
43
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function _defineProperties(target, props) {
|
|
@@ -3594,6 +3594,8 @@ const hasDocument = typeof document !== 'undefined';
|
|
|
3594
3594
|
const isThemeDark = (theme) => {
|
|
3595
3595
|
return theme === 'dark';
|
|
3596
3596
|
};
|
|
3597
|
+
|
|
3598
|
+
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3597
3599
|
const headerSlot = 'header';
|
|
3598
3600
|
const anchorSlot = 'anchor';
|
|
3599
3601
|
|
|
@@ -3606,8 +3608,6 @@ const formatObjectOutput = (value) => {
|
|
|
3606
3608
|
};
|
|
3607
3609
|
'value, ' +
|
|
3608
3610
|
formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '');
|
|
3609
|
-
|
|
3610
|
-
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3611
3611
|
const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
|
|
3612
3612
|
return {
|
|
3613
3613
|
...parseAndGetAriaAttributes(aria),
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.mjs
CHANGED
|
@@ -5,15 +5,15 @@ import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMerge
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRAccordion } from '../dsr-components/accordion.mjs';
|
|
7
7
|
|
|
8
|
-
const PAccordion = forwardRef(({ compact, heading, onAccordionChange, onUpdate, open, size = 'small', tag
|
|
8
|
+
const PAccordion = forwardRef(({ compact, heading, headingTag = 'h2', onAccordionChange, onUpdate, open, size = 'small', sticky, tag, theme, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
useEventCallback(elementRef, 'accordionChange', onAccordionChange);
|
|
11
11
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
12
12
|
const WebComponentTag = usePrefix('p-accordion');
|
|
13
|
-
const propsToSync = [compact, heading, open, size, tag, theme || useTheme()];
|
|
13
|
+
const propsToSync = [compact, heading, headingTag, open, size, sticky, tag, theme || useTheme()];
|
|
14
14
|
useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['compact', 'heading', 'open', 'size', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['compact', 'heading', 'headingTag', 'open', 'size', 'sticky', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PAccordion = forwardRef(({ compact, heading, onAccordionChange, onUpdate,
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsx(DSRAccordion, { compact, heading, open, size, tag, theme: theme || useTheme(), children })),
|
|
27
|
+
children: (jsx(DSRAccordion, { compact, heading, headingTag, open, size, sticky, tag, theme: theme || useTheme(), children })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.mjs
CHANGED
|
@@ -5,14 +5,14 @@ import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMerge
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRBanner } from '../dsr-components/banner.mjs';
|
|
7
7
|
|
|
8
|
-
const PBanner = forwardRef(({ description = '', dismissButton = true, heading = '', onDismiss, open = false, persistent, state = 'info', theme, width, className, children, ...rest }, ref) => {
|
|
8
|
+
const PBanner = forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, persistent, state = 'info', theme, width, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
11
11
|
const WebComponentTag = usePrefix('p-banner');
|
|
12
|
-
const propsToSync = [description, dismissButton, heading, open, persistent, state, theme || useTheme(), width];
|
|
12
|
+
const propsToSync = [description, dismissButton, heading, headingTag, open, persistent, state, theme || useTheme(), width];
|
|
13
13
|
useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['description', 'dismissButton', 'heading', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['description', 'dismissButton', 'heading', 'headingTag', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
// @ts-ignore
|
|
18
18
|
if (!process.browser) {
|
|
@@ -23,7 +23,7 @@ const PBanner = forwardRef(({ description = '', dismissButton = true, heading =
|
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
...(!process.browser
|
|
25
25
|
? {
|
|
26
|
-
children: (jsx(DSRBanner, { description, dismissButton, heading, open, persistent, state, theme: theme || useTheme(), width, children })),
|
|
26
|
+
children: (jsx(DSRBanner, { description, dismissButton, heading, headingTag, open, persistent, state, theme: theme || useTheme(), width, children })),
|
|
27
27
|
}
|
|
28
28
|
: {
|
|
29
29
|
children,
|
|
@@ -5,15 +5,15 @@ import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMerge
|
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
import { DSRInlineNotification } from '../dsr-components/inline-notification.mjs';
|
|
7
7
|
|
|
8
|
-
const PInlineNotification = forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', onAction, onDismiss, persistent, state = 'info', theme, className, children, ...rest }, ref) => {
|
|
8
|
+
const PInlineNotification = forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', headingTag = 'h5', onAction, onDismiss, persistent, state = 'info', theme, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
useEventCallback(elementRef, 'action', onAction);
|
|
11
11
|
useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
12
12
|
const WebComponentTag = usePrefix('p-inline-notification');
|
|
13
|
-
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme || useTheme()];
|
|
13
|
+
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, headingTag, persistent, state, theme || useTheme()];
|
|
14
14
|
useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'headingTag', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PInlineNotification = forwardRef(({ actionIcon = 'arrow-right', actionLabe
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsx(DSRInlineNotification, { actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme: theme || useTheme(), children })),
|
|
27
|
+
children: (jsx(DSRInlineNotification, { actionIcon, actionLabel, actionLoading, description, dismissButton, heading, headingTag, persistent, state, theme: theme || useTheme(), children })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs
CHANGED
|
@@ -80,8 +80,8 @@ class DSRAccordion extends Component {
|
|
|
80
80
|
splitChildren(this.props.children);
|
|
81
81
|
const buttonId = 'accordion-control';
|
|
82
82
|
const contentId = 'accordion-panel';
|
|
83
|
-
const Heading = this.props.tag;
|
|
84
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$15(this.props.size, this.props.compact, this.props.open, this.props.theme)));
|
|
83
|
+
const Heading = this.props.tag || this.props.headingTag;
|
|
84
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$15(this.props.size, this.props.compact, this.props.open, this.props.theme, this.props.sticky)));
|
|
85
85
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(Fragment, { children: [jsx(Heading, { className: "heading", children: jsxs("button", { id: buttonId, type: "button", "aria-expanded": this.props.open ? 'true' : 'false', "aria-controls": contentId, children: [this.props.heading || jsx("slot", { name: "heading" }), jsx("span", { className: "icon-container", children: jsx(PIcon, { className: "icon", name: this.props.open ? 'minus' : 'plus', theme: this.props.theme, size: "xx-small", "aria-hidden": "true" }) })] }) }), jsx("div", { id: contentId, className: "collapsible", role: "region", "aria-labelledby": buttonId, children: jsx("div", { children: jsx("slot", {}) }) })] })] }), this.props.children] }));
|
|
86
86
|
}
|
|
87
87
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs
CHANGED
|
@@ -85,7 +85,7 @@ class DSRBanner extends Component {
|
|
|
85
85
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
86
86
|
const hasTitleSlot = namedSlotChildren.filter(({ props: { slot } }) => slot === 'title').length > 0;
|
|
87
87
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$14(this.props.open)));
|
|
88
|
-
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(PInlineNotification, { heading: this.props.heading, description: this.props.description, state: this.props.state, dismissButton: this.hasDismissButton, theme: this.props.theme, "aria-hidden": !this.props.open ? 'true' : 'false', children: [namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsx("slot", { name: "heading", slot: "heading" })) : (hasTitleSlot && jsx("slot", { name: "title", slot: "heading" })), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsx("slot", { name: "description" })] })] }), this.props.children] }));
|
|
88
|
+
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs(PInlineNotification, { heading: this.props.heading, headingTag: this.props.headingTag, description: this.props.description, state: this.props.state, dismissButton: this.hasDismissButton, theme: this.props.theme, "aria-hidden": !this.props.open ? 'true' : 'false', children: [namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0 ? (jsx("slot", { name: "heading", slot: "heading" })) : (hasTitleSlot && jsx("slot", { name: "title", slot: "heading" })), namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0 && jsx("slot", { name: "description" })] })] }), this.props.children] }));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -85,8 +85,10 @@ class DSRInlineNotification extends Component {
|
|
|
85
85
|
const bannerId = 'banner';
|
|
86
86
|
const labelId = 'label';
|
|
87
87
|
const descriptionId = 'description';
|
|
88
|
+
const Heading = this.props.headingTag;
|
|
88
89
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$J(this.props.state, !!this.props.actionLabel, this.hasDismissButton, this.props.theme)));
|
|
89
|
-
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: `notification-${this.props.state}`, theme: this.props.theme, "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) &&
|
|
90
|
+
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: `notification-${this.props.state}`, theme: this.props.theme, "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) &&
|
|
91
|
+
(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", theme: this.props.theme, icon: this.props.actionIcon, loading: this.props.actionLoading, children: this.props.actionLabel })), this.hasDismissButton && (jsx(PButtonPure, { className: "close", type: "button", icon: "close", theme: this.props.theme, hideLabel: true, "aria-controls": bannerId, children: "Close notification" }))] })] }), this.props.children] }));
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.mjs
CHANGED
|
@@ -77,16 +77,6 @@ import { parseAndGetAriaAttributes } from '../../../../../../components/dist/uti
|
|
|
77
77
|
|
|
78
78
|
class DSRModal extends Component {
|
|
79
79
|
host;
|
|
80
|
-
scrollContainerEl; // Necessary to avoid stacking background bug in safari
|
|
81
|
-
focusedElBeforeOpen;
|
|
82
|
-
dismissBtn;
|
|
83
|
-
hasHeader;
|
|
84
|
-
hasFooter;
|
|
85
|
-
footer;
|
|
86
|
-
dialog;
|
|
87
|
-
get hasDismissButton() {
|
|
88
|
-
return this.props.disableCloseButton ? false : this.props.dismissButton;
|
|
89
|
-
}
|
|
90
80
|
render() {
|
|
91
81
|
const { children, namedSlotChildren, otherChildren } = splitChildren(this.props.children);
|
|
92
82
|
const hasHeader = (this.props.heading || namedSlotChildren.filter(({ props: { slot } }) => slot === 'heading').length > 0);
|
|
@@ -99,7 +89,7 @@ class DSRModal extends Component {
|
|
|
99
89
|
'aria-label': this.props.heading,
|
|
100
90
|
'aria-hidden': !this.props.open,
|
|
101
91
|
...parseAndGetAriaAttributes(this.props.aria),
|
|
102
|
-
}), tabIndex: -1, inert: this.props.open ? null : '', children: [hasDismissButton && (jsx("div", { className: "controls", children: jsx(PButtonPure, { className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss modal" }) })), hasHeader && (jsx("div", { className: "header", children: this.props.heading ? jsx("h2", { children: this.props.heading }) : jsx("slot", { name: "heading" }) })), jsx("div", { className: "content", children: jsx("slot", {}) }), hasFooter && (jsx("div", { className: "footer", children: jsx("slot", { name: "footer" }) }))] }) }) })] }), this.props.children] }));
|
|
92
|
+
}), tabIndex: -1, inert: this.props.open ? null : '', children: [hasDismissButton && (jsx("div", { className: "controls", children: jsx(PButtonPure, { className: "dismiss", type: "button", hideLabel: true, icon: "close", theme: this.props.theme, children: "Dismiss modal" }) })), hasHeader && (jsx("div", { className: "header", children: this.props.heading ? jsx("h2", { children: this.props.heading }) : jsx("slot", { name: "heading" }) }, "heading")), jsx("div", { className: "content", children: jsx("slot", {}) }), hasFooter && (jsx("div", { className: "footer", children: jsx("slot", { name: "footer" }) }, "footer"))] }) }) })] }), this.props.children] }));
|
|
103
93
|
}
|
|
104
94
|
}
|
|
105
95
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { AccordionUpdateEventDetail, BreakpointCustomizable, AccordionSize, AccordionTag, Theme } from '../types';
|
|
2
|
+
import type { AccordionHeadingTag, AccordionUpdateEventDetail, BreakpointCustomizable, AccordionSize, AccordionTag, Theme } from '../types';
|
|
3
3
|
export type PAccordionProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Displays the Accordion as compact version with thinner border and smaller paddings.
|
|
@@ -9,6 +9,10 @@ export type PAccordionProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
9
9
|
* Defines the heading used in accordion.
|
|
10
10
|
*/
|
|
11
11
|
heading?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
14
|
+
*/
|
|
15
|
+
headingTag?: AccordionHeadingTag;
|
|
12
16
|
/**
|
|
13
17
|
* @deprecated since v3.0.0, will be removed with next major release, use `update` event instead. Emitted when accordion state is changed.
|
|
14
18
|
*/
|
|
@@ -26,7 +30,11 @@ export type PAccordionProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
26
30
|
*/
|
|
27
31
|
size?: BreakpointCustomizable<AccordionSize>;
|
|
28
32
|
/**
|
|
29
|
-
*
|
|
33
|
+
* @experimental Sticks the Accordion heading at the top, fixed while scrolling
|
|
34
|
+
*/
|
|
35
|
+
sticky?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated , will be removed with next major release, use `heading-tag` instead. Sets a heading tag, so it fits correctly within the outline of the page.
|
|
30
38
|
*/
|
|
31
39
|
tag?: AccordionTag;
|
|
32
40
|
/**
|
|
@@ -43,6 +51,10 @@ export declare const PAccordion: import("react").ForwardRefExoticComponent<Omit<
|
|
|
43
51
|
* Defines the heading used in accordion.
|
|
44
52
|
*/
|
|
45
53
|
heading?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
56
|
+
*/
|
|
57
|
+
headingTag?: AccordionHeadingTag;
|
|
46
58
|
/**
|
|
47
59
|
* @deprecated since v3.0.0, will be removed with next major release, use `update` event instead. Emitted when accordion state is changed.
|
|
48
60
|
*/
|
|
@@ -60,7 +72,11 @@ export declare const PAccordion: import("react").ForwardRefExoticComponent<Omit<
|
|
|
60
72
|
*/
|
|
61
73
|
size?: BreakpointCustomizable<AccordionSize>;
|
|
62
74
|
/**
|
|
63
|
-
*
|
|
75
|
+
* @experimental Sticks the Accordion heading at the top, fixed while scrolling
|
|
76
|
+
*/
|
|
77
|
+
sticky?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated , will be removed with next major release, use `heading-tag` instead. Sets a heading tag, so it fits correctly within the outline of the page.
|
|
64
80
|
*/
|
|
65
81
|
tag?: AccordionTag;
|
|
66
82
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { BannerState, Theme, BannerWidth } from '../types';
|
|
2
|
+
import type { BannerHeadingTag, BannerState, Theme, BannerWidth } from '../types';
|
|
3
3
|
export type PBannerProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Description of the banner.
|
|
@@ -13,6 +13,10 @@ export type PBannerProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
13
13
|
* Heading of the banner.
|
|
14
14
|
*/
|
|
15
15
|
heading?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
18
|
+
*/
|
|
19
|
+
headingTag?: BannerHeadingTag;
|
|
16
20
|
/**
|
|
17
21
|
* Emitted when the close button is clicked.
|
|
18
22
|
*/
|
|
@@ -52,6 +56,10 @@ export declare const PBanner: import("react").ForwardRefExoticComponent<Omit<HTM
|
|
|
52
56
|
* Heading of the banner.
|
|
53
57
|
*/
|
|
54
58
|
heading?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
61
|
+
*/
|
|
62
|
+
headingTag?: BannerHeadingTag;
|
|
55
63
|
/**
|
|
56
64
|
* Emitted when the close button is clicked.
|
|
57
65
|
*/
|
|
@@ -18,7 +18,7 @@ export type PDisplayProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
18
18
|
*/
|
|
19
19
|
size?: BreakpointCustomizable<DisplaySize>;
|
|
20
20
|
/**
|
|
21
|
-
* Sets a
|
|
21
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
22
22
|
*/
|
|
23
23
|
tag?: DisplayTag;
|
|
24
24
|
/**
|
|
@@ -44,7 +44,7 @@ export declare const PDisplay: import("react").ForwardRefExoticComponent<Omit<HT
|
|
|
44
44
|
*/
|
|
45
45
|
size?: BreakpointCustomizable<DisplaySize>;
|
|
46
46
|
/**
|
|
47
|
-
* Sets a
|
|
47
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
48
48
|
*/
|
|
49
49
|
tag?: DisplayTag;
|
|
50
50
|
/**
|