@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/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
14
14
|
|
|
15
15
|
### [Unreleased]
|
|
16
16
|
|
|
17
|
+
### [3.15.0-rc.2] - 2024-04-22
|
|
18
|
+
|
|
19
|
+
#### Added
|
|
20
|
+
|
|
21
|
+
- `Accordion`: Add experimental property `sticky` for a fixed heading
|
|
22
|
+
([#3181](https://github.com/porsche-design-system/porsche-design-system/pull/3181))
|
|
23
|
+
- `Inline Notification`, `Banner`: heading hierarchy can now be customized with `headingTag` prop
|
|
24
|
+
([#3168](https://github.com/porsche-design-system/porsche-design-system/pull/3168))
|
|
25
|
+
|
|
26
|
+
#### Changed
|
|
27
|
+
|
|
28
|
+
- `Accordion`: `tag` property is deprecated. Use `headingTag` property instead to specify heading hierarchy level.
|
|
29
|
+
([#3168](https://github.com/porsche-design-system/porsche-design-system/pull/3168))
|
|
30
|
+
|
|
31
|
+
```diff
|
|
32
|
+
- <p-accordion tag="h3"></p-accordion>
|
|
33
|
+
+ <p-accordion heading-tag="h3"></p-accordion>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Fixed
|
|
37
|
+
|
|
38
|
+
- `Pin Code`: Input is entered twice in iOS
|
|
39
|
+
([#3192](https://github.com/porsche-design-system/porsche-design-system/pull/3192))
|
|
40
|
+
|
|
41
|
+
### [3.15.0-rc.1] - 2024-04-17
|
|
42
|
+
|
|
43
|
+
#### Added
|
|
44
|
+
|
|
45
|
+
- Partials: `getMetaTagsAndIconLinks`, `getComponentChunkLinks`, `getIconLinks` and `getFontLinks` support new format
|
|
46
|
+
option `js` ([#3179](https://github.com/porsche-design-system/porsche-design-system/pull/3179))
|
|
47
|
+
|
|
17
48
|
### [3.15.0-rc.0] - 2024-04-05
|
|
18
49
|
|
|
19
50
|
#### Changed
|
|
@@ -23,6 +54,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
|
|
|
23
54
|
|
|
24
55
|
### Fixed
|
|
25
56
|
|
|
57
|
+
- `Modal`: Missing box-shadow on sticky footer when slotted content changes
|
|
58
|
+
([#3154](https://github.com/porsche-design-system/porsche-design-system/pull/3154))
|
|
26
59
|
- `Select`: Hydration error in Next.js when using slotted `img`
|
|
27
60
|
([#3162](https://github.com/porsche-design-system/porsche-design-system/pull/3162))
|
|
28
61
|
- `Text Field Wrapper`, `Textarea Wrapper`: Dynamic changes of `showCounter` and `maxLength` are reflected. The counter
|
|
@@ -6,15 +6,15 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.cjs');
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
|
|
9
|
-
const PAccordion = react.forwardRef(({ compact, heading, onAccordionChange, onUpdate, open, size = 'small', tag
|
|
9
|
+
const PAccordion = react.forwardRef(({ compact, heading, headingTag = 'h2', onAccordionChange, onUpdate, open, size = 'small', sticky, tag, theme, className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'accordionChange', onAccordionChange);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-accordion');
|
|
14
|
-
const propsToSync = [compact, heading, open, size, tag, theme || hooks.useTheme()];
|
|
14
|
+
const propsToSync = [compact, heading, headingTag, open, size, sticky, tag, theme || hooks.useTheme()];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['compact', 'heading', 'open', 'size', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['compact', 'heading', 'headingTag', 'open', 'size', 'sticky', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
18
|
}, propsToSync);
|
|
19
19
|
const props = {
|
|
20
20
|
...rest,
|
|
@@ -6,14 +6,14 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.cjs');
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
|
|
9
|
-
const PBanner = react.forwardRef(({ description = '', dismissButton = true, heading = '', onDismiss, open = false, persistent, state = 'info', theme, width, className, ...rest }, ref) => {
|
|
9
|
+
const PBanner = react.forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, persistent, state = 'info', theme, width, className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-banner');
|
|
13
|
-
const propsToSync = [description, dismissButton, heading, open, persistent, state, theme || hooks.useTheme(), width];
|
|
13
|
+
const propsToSync = [description, dismissButton, heading, headingTag, open, persistent, state, theme || hooks.useTheme(), width];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['description', 'dismissButton', 'heading', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['description', 'dismissButton', 'heading', 'headingTag', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
const props = {
|
|
19
19
|
...rest,
|
|
@@ -6,15 +6,15 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.cjs');
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
|
|
9
|
-
const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', onAction, onDismiss, persistent, state = 'info', theme, className, ...rest }, ref) => {
|
|
9
|
+
const PInlineNotification = react.forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', headingTag = 'h5', onAction, onDismiss, persistent, state = 'info', theme, className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'action', onAction);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-inline-notification');
|
|
14
|
-
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme || hooks.useTheme()];
|
|
14
|
+
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, headingTag, persistent, state, theme || hooks.useTheme()];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'headingTag', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
18
|
}, propsToSync);
|
|
19
19
|
const props = {
|
|
20
20
|
...rest,
|
|
@@ -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 | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
56
|
+
*/
|
|
57
|
+
headingTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
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<"small" | "medium"> | undefined;
|
|
62
74
|
/**
|
|
63
|
-
*
|
|
75
|
+
* @experimental Sticks the Accordion heading at the top, fixed while scrolling
|
|
76
|
+
*/
|
|
77
|
+
sticky?: boolean | undefined;
|
|
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?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
66
82
|
/**
|
|
@@ -4,15 +4,15 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PAccordion = forwardRef(({ compact, heading, onAccordionChange, onUpdate, open, size = 'small', tag
|
|
7
|
+
const PAccordion = forwardRef(({ compact, heading, headingTag = 'h2', onAccordionChange, onUpdate, open, size = 'small', sticky, tag, theme, className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
useEventCallback(elementRef, 'accordionChange', onAccordionChange);
|
|
10
10
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
11
11
|
const WebComponentTag = usePrefix('p-accordion');
|
|
12
|
-
const propsToSync = [compact, heading, open, size, tag, theme || useTheme()];
|
|
12
|
+
const propsToSync = [compact, heading, headingTag, open, size, sticky, tag, theme || useTheme()];
|
|
13
13
|
useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['compact', 'heading', 'open', 'size', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['compact', 'heading', 'headingTag', 'open', 'size', 'sticky', 'tag', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -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 | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
61
|
+
*/
|
|
62
|
+
headingTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
55
63
|
/**
|
|
56
64
|
* Emitted when the close button is clicked.
|
|
57
65
|
*/
|
|
@@ -4,14 +4,14 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PBanner = forwardRef(({ description = '', dismissButton = true, heading = '', onDismiss, open = false, persistent, state = 'info', theme, width, className, ...rest }, ref) => {
|
|
7
|
+
const PBanner = forwardRef(({ description = '', dismissButton = true, heading = '', headingTag = 'h5', onDismiss, open = false, persistent, state = 'info', theme, width, className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
10
10
|
const WebComponentTag = usePrefix('p-banner');
|
|
11
|
-
const propsToSync = [description, dismissButton, heading, open, persistent, state, theme || useTheme(), width];
|
|
11
|
+
const propsToSync = [description, dismissButton, heading, headingTag, open, persistent, state, theme || useTheme(), width];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['description', 'dismissButton', 'heading', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['description', 'dismissButton', 'heading', 'headingTag', 'open', 'persistent', 'state', 'theme', 'width'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
const props = {
|
|
17
17
|
...rest,
|
|
@@ -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<"inherit" | "small" | "medium" | "large"> | undefined;
|
|
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?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
50
50
|
/**
|
|
@@ -18,7 +18,7 @@ export type PHeadingProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
18
18
|
*/
|
|
19
19
|
size?: BreakpointCustomizable<HeadingSize>;
|
|
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?: HeadingTag;
|
|
24
24
|
/**
|
|
@@ -44,7 +44,7 @@ export declare const PHeading: import("react").ForwardRefExoticComponent<Omit<HT
|
|
|
44
44
|
*/
|
|
45
45
|
size?: BreakpointCustomizable<"inherit" | "small" | "medium" | "large" | "x-large" | "xx-large"> | undefined;
|
|
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?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
50
50
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { InlineNotificationActionIcon, InlineNotificationState, Theme } from '../types';
|
|
2
|
+
import type { InlineNotificationActionIcon, InlineNotificationHeadingTag, InlineNotificationState, Theme } from '../types';
|
|
3
3
|
export type PInlineNotificationProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Action icon of the inline-notification.
|
|
@@ -25,6 +25,10 @@ export type PInlineNotificationProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
25
25
|
* Heading of the inline-notification.
|
|
26
26
|
*/
|
|
27
27
|
heading?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
30
|
+
*/
|
|
31
|
+
headingTag?: InlineNotificationHeadingTag;
|
|
28
32
|
/**
|
|
29
33
|
* Emitted when the action button is clicked.
|
|
30
34
|
*/
|
|
@@ -71,6 +75,10 @@ export declare const PInlineNotification: import("react").ForwardRefExoticCompon
|
|
|
71
75
|
* Heading of the inline-notification.
|
|
72
76
|
*/
|
|
73
77
|
heading?: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
80
|
+
*/
|
|
81
|
+
headingTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
74
82
|
/**
|
|
75
83
|
* Emitted when the action button is clicked.
|
|
76
84
|
*/
|
|
@@ -4,15 +4,15 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PInlineNotification = forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', onAction, onDismiss, persistent, state = 'info', theme, className, ...rest }, ref) => {
|
|
7
|
+
const PInlineNotification = forwardRef(({ actionIcon = 'arrow-right', actionLabel, actionLoading = false, description = '', dismissButton = true, heading = '', headingTag = 'h5', onAction, onDismiss, persistent, state = 'info', theme, className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
useEventCallback(elementRef, 'action', onAction);
|
|
10
10
|
useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
11
11
|
const WebComponentTag = usePrefix('p-inline-notification');
|
|
12
|
-
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, persistent, state, theme || useTheme()];
|
|
12
|
+
const propsToSync = [actionIcon, actionLabel, actionLoading, description, dismissButton, heading, headingTag, persistent, state, theme || useTheme()];
|
|
13
13
|
useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['actionIcon', 'actionLabel', 'actionLoading', 'description', 'dismissButton', 'heading', 'headingTag', 'persistent', 'state', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -14,7 +14,7 @@ export type PLinkTileModelSignatureProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
14
14
|
*/
|
|
15
15
|
heading: string;
|
|
16
16
|
/**
|
|
17
|
-
* Sets a
|
|
17
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
18
18
|
*/
|
|
19
19
|
headingTag?: LinkTileModelSignatureHeadingTag;
|
|
20
20
|
/**
|
|
@@ -44,7 +44,7 @@ export declare const PLinkTileModelSignature: import("react").ForwardRefExoticCo
|
|
|
44
44
|
*/
|
|
45
45
|
heading: string;
|
|
46
46
|
/**
|
|
47
|
-
* Sets a
|
|
47
|
+
* Sets a heading tag, so it fits correctly within the outline of the page.
|
|
48
48
|
*/
|
|
49
49
|
headingTag?: "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
50
50
|
/**
|
package/esm/lib/types.d.ts
CHANGED
|
@@ -530,6 +530,15 @@ declare const HEADING_SIZES: readonly [
|
|
|
530
530
|
"inherit"
|
|
531
531
|
];
|
|
532
532
|
export type HeadingSize = (typeof HEADING_SIZES)[number];
|
|
533
|
+
declare const HEADING_TAGS: readonly [
|
|
534
|
+
"h1",
|
|
535
|
+
"h2",
|
|
536
|
+
"h3",
|
|
537
|
+
"h4",
|
|
538
|
+
"h5",
|
|
539
|
+
"h6"
|
|
540
|
+
];
|
|
541
|
+
export type HeadingTag = typeof HEADING_TAGS[number];
|
|
533
542
|
declare const TEXT_SIZES: readonly [
|
|
534
543
|
"xx-small",
|
|
535
544
|
"x-small",
|
|
@@ -587,15 +596,6 @@ declare const BUTTON_TYPES: readonly [
|
|
|
587
596
|
"reset"
|
|
588
597
|
];
|
|
589
598
|
export type ButtonType = typeof BUTTON_TYPES[number];
|
|
590
|
-
declare const HEADING_TAGS: readonly [
|
|
591
|
-
"h1",
|
|
592
|
-
"h2",
|
|
593
|
-
"h3",
|
|
594
|
-
"h4",
|
|
595
|
-
"h5",
|
|
596
|
-
"h6"
|
|
597
|
-
];
|
|
598
|
-
export type HeadingTag = typeof HEADING_TAGS[number];
|
|
599
599
|
declare const LINK_BUTTON_VARIANTS: readonly [
|
|
600
600
|
"primary",
|
|
601
601
|
"secondary",
|
|
@@ -627,21 +627,34 @@ export type AccordionUpdateEvent = {
|
|
|
627
627
|
open: boolean;
|
|
628
628
|
};
|
|
629
629
|
export type AccordionUpdateEventDetail = AccordionUpdateEvent;
|
|
630
|
+
/** @deprecated */
|
|
630
631
|
export type AccordionTag = HeadingTag;
|
|
632
|
+
export type AccordionHeadingTag = HeadingTag;
|
|
633
|
+
declare const INLINE_NOTIFICATION_STATES: readonly [
|
|
634
|
+
"success",
|
|
635
|
+
"info",
|
|
636
|
+
"warning",
|
|
637
|
+
"error",
|
|
638
|
+
"neutral"
|
|
639
|
+
];
|
|
640
|
+
export type InlineNotificationState = (typeof INLINE_NOTIFICATION_STATES)[number];
|
|
641
|
+
export type InlineNotificationActionIcon = IconName;
|
|
642
|
+
export type InlineNotificationHeadingTag = HeadingTag;
|
|
631
643
|
declare const BANNER_STATES: readonly [
|
|
632
644
|
"info",
|
|
633
645
|
"warning",
|
|
634
646
|
"error",
|
|
635
647
|
"neutral"
|
|
636
648
|
];
|
|
637
|
-
export type BannerState = typeof BANNER_STATES[number];
|
|
649
|
+
export type BannerState = (typeof BANNER_STATES)[number];
|
|
638
650
|
declare const BANNER_WIDTHS: readonly [
|
|
639
651
|
"extended",
|
|
640
652
|
"basic",
|
|
641
653
|
"fluid"
|
|
642
654
|
];
|
|
643
655
|
/** @deprecated */
|
|
644
|
-
export type BannerWidth = typeof BANNER_WIDTHS[number];
|
|
656
|
+
export type BannerWidth = (typeof BANNER_WIDTHS)[number];
|
|
657
|
+
export type BannerHeadingTag = InlineNotificationHeadingTag;
|
|
645
658
|
export type ButtonIcon = LinkButtonIconName;
|
|
646
659
|
declare const GROUP_DIRECTIONS: readonly [
|
|
647
660
|
"row",
|
|
@@ -959,15 +972,6 @@ declare const ICON_COLORS: readonly [
|
|
|
959
972
|
"state-disabled"
|
|
960
973
|
];
|
|
961
974
|
export type IconColor = (typeof ICON_COLORS)[number];
|
|
962
|
-
declare const INLINE_NOTIFICATION_STATES: readonly [
|
|
963
|
-
"success",
|
|
964
|
-
"info",
|
|
965
|
-
"warning",
|
|
966
|
-
"error",
|
|
967
|
-
"neutral"
|
|
968
|
-
];
|
|
969
|
-
export type InlineNotificationState = typeof INLINE_NOTIFICATION_STATES[number];
|
|
970
|
-
export type InlineNotificationActionIcon = IconName;
|
|
971
975
|
export type LinkIcon = LinkButtonIconName;
|
|
972
976
|
export type LinkPureIcon = LinkButtonIconName;
|
|
973
977
|
export type LinkPureAriaAttribute = LinkAriaAttribute;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "3.15.0-rc.
|
|
3
|
+
"version": "3.15.0-rc.2",
|
|
4
4
|
"description": "Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"porsche",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "SEE LICENSE IN LICENSE",
|
|
18
18
|
"homepage": "https://designsystem.porsche.com",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@porsche-design-system/components-js": "3.15.0-rc.
|
|
20
|
+
"@porsche-design-system/components-js": "3.15.0-rc.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=18.0.0 <19.0.0",
|
|
@@ -42,7 +42,7 @@ function toPrimitive(t, r) {
|
|
|
42
42
|
|
|
43
43
|
function toPropertyKey(t) {
|
|
44
44
|
var i = toPrimitive(t, "string");
|
|
45
|
-
return "symbol" == _typeof(i) ? i :
|
|
45
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function _defineProperties(target, props) {
|
|
@@ -4066,6 +4066,8 @@ const isThemeDark = (theme) => {
|
|
|
4066
4066
|
return theme === 'dark';
|
|
4067
4067
|
};
|
|
4068
4068
|
|
|
4069
|
+
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
4070
|
+
|
|
4069
4071
|
const headerSlot = 'header';
|
|
4070
4072
|
const anchorSlot = 'anchor';
|
|
4071
4073
|
|
|
@@ -4079,11 +4081,11 @@ const formatObjectOutput = (value) => {
|
|
|
4079
4081
|
'value, ' +
|
|
4080
4082
|
formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '');
|
|
4081
4083
|
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4084
|
-
const
|
|
4085
|
-
const
|
|
4086
|
-
const
|
|
4084
|
+
const getComponentCss$15 = (size, compact, open, theme, sticky) => {
|
|
4085
|
+
const { primaryColor, hoverColor, contrastLowColor, backgroundColor } = getThemedColors(theme);
|
|
4086
|
+
const { primaryColor: primaryColorDark, hoverColor: hoverColorDark, contrastLowColor: contrastLowColorDark, backgroundColor: backgroundColorDark, } = getThemedColors('dark');
|
|
4087
|
+
const cssVariablePositionStickyTop = '--p-accordion-position-sticky-top';
|
|
4088
|
+
const positionStickyTopFallback = '0';
|
|
4087
4089
|
return getCss({
|
|
4088
4090
|
'@global': {
|
|
4089
4091
|
':host': {
|
|
@@ -4159,6 +4161,15 @@ const getComponentCss$15 = (size, compact, open, theme) => {
|
|
|
4159
4161
|
},
|
|
4160
4162
|
heading: {
|
|
4161
4163
|
margin: 0,
|
|
4164
|
+
...(sticky && {
|
|
4165
|
+
position: 'sticky',
|
|
4166
|
+
top: `var(${cssVariablePositionStickyTop}, ${positionStickyTopFallback})`,
|
|
4167
|
+
zIndex: 1, // to be on top of the collapsible
|
|
4168
|
+
backgroundColor,
|
|
4169
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
4170
|
+
backgroundColor: backgroundColorDark,
|
|
4171
|
+
}),
|
|
4172
|
+
}),
|
|
4162
4173
|
},
|
|
4163
4174
|
'icon-container': {
|
|
4164
4175
|
height: fontLineHeight,
|
|
@@ -4180,6 +4191,10 @@ const getComponentCss$15 = (size, compact, open, theme) => {
|
|
|
4180
4191
|
color: primaryColorDark,
|
|
4181
4192
|
}),
|
|
4182
4193
|
display: 'grid',
|
|
4194
|
+
...(sticky && {
|
|
4195
|
+
position: 'relative',
|
|
4196
|
+
zIndex: 0, // to be below the heading
|
|
4197
|
+
}),
|
|
4183
4198
|
...(open
|
|
4184
4199
|
? {
|
|
4185
4200
|
gridTemplateRows: '1fr',
|
|
@@ -5445,21 +5460,7 @@ ellipsis, theme) => {
|
|
|
5445
5460
|
};
|
|
5446
5461
|
const getTypographySlottedJssStyle = () => {
|
|
5447
5462
|
return {
|
|
5448
|
-
|
|
5449
|
-
padding: 'inherit',
|
|
5450
|
-
fontFamily: 'inherit',
|
|
5451
|
-
fontWeight: 'inherit',
|
|
5452
|
-
fontSize: 'inherit',
|
|
5453
|
-
lineHeight: 'inherit',
|
|
5454
|
-
fontStyle: 'inherit',
|
|
5455
|
-
fontVariant: 'inherit',
|
|
5456
|
-
color: 'inherit',
|
|
5457
|
-
textAlign: 'inherit',
|
|
5458
|
-
overflowWrap: 'inherit',
|
|
5459
|
-
wordWrap: 'inherit',
|
|
5460
|
-
hyphens: 'inherit',
|
|
5461
|
-
whiteSpace: 'inherit',
|
|
5462
|
-
letterSpacing: 'inherit',
|
|
5463
|
+
all: 'unset',
|
|
5463
5464
|
};
|
|
5464
5465
|
};
|
|
5465
5466
|
|
|
@@ -5478,9 +5479,7 @@ const getComponentCss$X = (size, align, color, ellipsis, theme) => {
|
|
|
5478
5479
|
...hostHiddenStyles,
|
|
5479
5480
|
}),
|
|
5480
5481
|
},
|
|
5481
|
-
|
|
5482
|
-
[DISPLAY_TAGS.map((i) => `&(${i})`).join()]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
5483
|
-
},
|
|
5482
|
+
[`::slotted(:is(${DISPLAY_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
5484
5483
|
},
|
|
5485
5484
|
root: getTypographyRootJssStyle(displayLargeStyle, buildResponsiveStyles(size, (sizeValue) => ({
|
|
5486
5485
|
fontSize: sizeValue === 'inherit' ? sizeValue : sizeMap$4[sizeValue],
|
|
@@ -6195,9 +6194,7 @@ const getComponentCss$M = (size, align, color, ellipsis, theme) => {
|
|
|
6195
6194
|
...hostHiddenStyles,
|
|
6196
6195
|
}),
|
|
6197
6196
|
},
|
|
6198
|
-
|
|
6199
|
-
[HEADING_TAGS.map((i) => `&(${i})`).join()]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
6200
|
-
},
|
|
6197
|
+
[`::slotted(:is(${HEADING_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
6201
6198
|
},
|
|
6202
6199
|
root: getTypographyRootJssStyle(headingXXLargeStyle, buildResponsiveStyles(size, (sizeValue) => ({
|
|
6203
6200
|
fontSize: sizeValue === 'inherit' ? sizeValue : sizeMap$3[sizeValue],
|
|
@@ -6461,6 +6458,17 @@ const getNotificationContentJssStyle = () => ({
|
|
|
6461
6458
|
});
|
|
6462
6459
|
|
|
6463
6460
|
const mediaQueryMaxS$1 = getMediaQueryMax('s');
|
|
6461
|
+
const getTextJssStyle = (theme) => ({
|
|
6462
|
+
margin: 0,
|
|
6463
|
+
color: getThemedColors(theme).primaryColor,
|
|
6464
|
+
...prefersColorSchemeDarkMediaQuery(theme, {
|
|
6465
|
+
color: getThemedColors('dark').primaryColor,
|
|
6466
|
+
}),
|
|
6467
|
+
});
|
|
6468
|
+
const getHeadingJssStyle = (theme) => ({
|
|
6469
|
+
...headingSmallStyle,
|
|
6470
|
+
...getTextJssStyle(theme),
|
|
6471
|
+
});
|
|
6464
6472
|
const getComponentCss$J = (state, hasAction, hasClose, theme) => {
|
|
6465
6473
|
return getCss({
|
|
6466
6474
|
'@global': {
|
|
@@ -6472,15 +6480,13 @@ const getComponentCss$J = (state, hasAction, hasClose, theme) => {
|
|
|
6472
6480
|
...hostHiddenStyles,
|
|
6473
6481
|
}),
|
|
6474
6482
|
},
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
}),
|
|
6483
|
-
},
|
|
6483
|
+
[`::slotted(:is(${HEADING_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
6484
|
+
'slot[name="heading"]': getHeadingJssStyle(theme),
|
|
6485
|
+
},
|
|
6486
|
+
heading: getHeadingJssStyle(theme),
|
|
6487
|
+
description: {
|
|
6488
|
+
...textSmallStyle,
|
|
6489
|
+
...getTextJssStyle(theme),
|
|
6484
6490
|
},
|
|
6485
6491
|
icon: getNotificationIconJssStyle(),
|
|
6486
6492
|
content: getNotificationContentJssStyle(),
|
|
@@ -10078,9 +10084,7 @@ const getComponentCss$4 = (size, weight, align, color, ellipsis, theme) => {
|
|
|
10078
10084
|
...hostHiddenStyles,
|
|
10079
10085
|
}),
|
|
10080
10086
|
},
|
|
10081
|
-
|
|
10082
|
-
[TEXT_TAGS.map((i) => `&(${i})`).join()]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
10083
|
-
},
|
|
10087
|
+
[`::slotted(:is(${TEXT_TAGS.join()}))`]: addImportantToEachRule(getTypographySlottedJssStyle()),
|
|
10084
10088
|
},
|
|
10085
10089
|
root: getTypographyRootJssStyle(textSmallStyle, buildResponsiveStyles(size, (sizeValue) => ({
|
|
10086
10090
|
fontSize: sizeValue === 'inherit' ? sizeValue : sizeMap[sizeValue],
|
|
@@ -42,7 +42,7 @@ function toPrimitive(t, r) {
|
|
|
42
42
|
|
|
43
43
|
function toPropertyKey(t) {
|
|
44
44
|
var i = toPrimitive(t, "string");
|
|
45
|
-
return "symbol" == _typeof(i) ? i :
|
|
45
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function _defineProperties(target, props) {
|
|
@@ -3596,6 +3596,8 @@ const hasDocument = typeof document !== 'undefined';
|
|
|
3596
3596
|
const isThemeDark = (theme) => {
|
|
3597
3597
|
return theme === 'dark';
|
|
3598
3598
|
};
|
|
3599
|
+
|
|
3600
|
+
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3599
3601
|
const headerSlot = 'header';
|
|
3600
3602
|
const anchorSlot = 'anchor';
|
|
3601
3603
|
|
|
@@ -3608,8 +3610,6 @@ const formatObjectOutput = (value) => {
|
|
|
3608
3610
|
};
|
|
3609
3611
|
'value, ' +
|
|
3610
3612
|
formatObjectOutput(breakpoints.reduce((prev, key) => ({ ...prev, [key + (key !== 'base' ? '?' : '')]: 'value' }), {})).replace(/"/g, '');
|
|
3611
|
-
|
|
3612
|
-
const HEADING_TAGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
|
3613
3613
|
const getButtonPureAriaAttributes = (isDisabled, isLoading, aria) => {
|
|
3614
3614
|
return {
|
|
3615
3615
|
...parseAndGetAriaAttributes(aria),
|