@porsche-design-system/components-react 3.18.0 → 3.19.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/cjs/lib/components/canvas.wrapper.cjs +3 -5
  3. package/cjs/lib/components/carousel.wrapper.cjs +3 -3
  4. package/esm/lib/components/canvas.wrapper.d.ts +13 -21
  5. package/esm/lib/components/canvas.wrapper.mjs +4 -6
  6. package/esm/lib/components/carousel.wrapper.d.ts +17 -1
  7. package/esm/lib/components/carousel.wrapper.mjs +3 -3
  8. package/esm/lib/types.d.ts +8 -7
  9. package/package.json +2 -2
  10. package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +244 -63
  11. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.cjs +4 -6
  12. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.cjs +4 -4
  13. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.cjs +16 -21
  14. package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.cjs +3 -2
  15. package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +244 -63
  16. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/canvas.wrapper.mjs +5 -7
  17. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.mjs +4 -4
  18. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +16 -21
  19. package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +3 -2
  20. package/ssr/esm/lib/components/canvas.wrapper.d.ts +13 -21
  21. package/ssr/esm/lib/components/carousel.wrapper.d.ts +17 -1
  22. package/ssr/esm/lib/dsr-components/canvas.d.ts +5 -4
  23. package/ssr/esm/lib/dsr-components/carousel.d.ts +1 -0
  24. package/ssr/esm/lib/types.d.ts +8 -7
package/CHANGELOG.md CHANGED
@@ -14,6 +14,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
14
14
 
15
15
  ### [Unreleased]
16
16
 
17
+ ### [3.19.0-rc.1] - 2024-09-06
18
+
19
+ #### Changed
20
+
21
+ - `Canvas`: Improve UX ([#3494](https://github.com/porsche-design-system/porsche-design-system/pull/3494))
22
+
23
+ ### [3.19.0-rc.0] - 2024-09-03
24
+
25
+ #### Added
26
+
27
+ - `componentsReady()`: Introduce optional `readyState` parameter
28
+ ([#3460](https://github.com/porsche-design-system/porsche-design-system/pull/3460))
29
+ - `Carousel`: introduce `focusOnCenterSlide` & `gradientColor` props
30
+ ([#3488](https://github.com/porsche-design-system/porsche-design-system/pull/3488))
31
+
32
+ #### Changed
33
+
34
+ - `Text Field Wrapper`: width calculation of counter and unit element are now CSS based in relation to the number of
35
+ characters ([#3472](https://github.com/porsche-design-system/porsche-design-system/pull/3472))
36
+
37
+ #### Fixed
38
+
39
+ - `jsdom-polyfill`: errors from included polyfill packages
40
+ ([3481](https://github.com/porsche-design-system/porsche-design-system/pull/3481))
41
+
17
42
  ### [3.18.0] - 2024-08-21
18
43
 
19
44
  ### [3.18.0-rc.0] - 2024-08-21
@@ -6,15 +6,13 @@ var react = require('react');
6
6
  var hooks = require('../../hooks.cjs');
7
7
  var utils = require('../../utils.cjs');
8
8
 
9
- const PCanvas = react.forwardRef(({ onDismissSidebarEnd, onDismissSidebarStart, sidebarEndOpen = false, sidebarEndWidth = 'medium', sidebarStartOpen = false, sidebarStartWidth = 'medium', className, ...rest }, ref) => {
9
+ const PCanvas = react.forwardRef(({ sidebarEndIcon = 'configurate', sidebarEndOpen = false, sidebarStartIcon = 'menu-lines', sidebarStartOpen = false, theme, className, ...rest }, ref) => {
10
10
  const elementRef = react.useRef();
11
- hooks.useEventCallback(elementRef, 'dismissSidebarEnd', onDismissSidebarEnd);
12
- hooks.useEventCallback(elementRef, 'dismissSidebarStart', onDismissSidebarStart);
13
11
  const WebComponentTag = hooks.usePrefix('p-canvas');
14
- const propsToSync = [sidebarEndOpen, sidebarEndWidth, sidebarStartOpen, sidebarStartWidth];
12
+ const propsToSync = [sidebarEndIcon, sidebarEndOpen, sidebarStartIcon, sidebarStartOpen, theme || hooks.useTheme()];
15
13
  hooks.useBrowserLayoutEffect(() => {
16
14
  const { current } = elementRef;
17
- ['sidebarEndOpen', 'sidebarEndWidth', 'sidebarStartOpen', 'sidebarStartWidth'].forEach((propName, i) => (current[propName] = propsToSync[i]));
15
+ ['sidebarEndIcon', 'sidebarEndOpen', 'sidebarStartIcon', 'sidebarStartOpen', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
18
16
  }, propsToSync);
19
17
  const props = {
20
18
  ...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 PCarousel = react.forwardRef(({ activeSlideIndex = 0, alignHeader = 'start', aria, description, disablePagination, heading, headingSize = 'x-large', intl, onCarouselChange, onUpdate, pagination = true, rewind = true, skipLinkTarget, slidesPerPage = 1, theme, width = 'basic', wrapContent, className, ...rest }, ref) => {
9
+ const PCarousel = react.forwardRef(({ activeSlideIndex = 0, alignHeader = 'start', aria, description, disablePagination, focusOnCenterSlide = false, gradientColor = 'none', heading, headingSize = 'x-large', intl, onCarouselChange, onUpdate, pagination = true, rewind = true, skipLinkTarget, slidesPerPage = 1, theme, width = 'basic', wrapContent, className, ...rest }, ref) => {
10
10
  const elementRef = react.useRef();
11
11
  hooks.useEventCallback(elementRef, 'carouselChange', onCarouselChange);
12
12
  hooks.useEventCallback(elementRef, 'update', onUpdate);
13
13
  const WebComponentTag = hooks.usePrefix('p-carousel');
14
- const propsToSync = [activeSlideIndex, alignHeader, aria, description, disablePagination, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme || hooks.useTheme(), width, wrapContent];
14
+ const propsToSync = [activeSlideIndex, alignHeader, aria, description, disablePagination, focusOnCenterSlide, gradientColor, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme || hooks.useTheme(), width, wrapContent];
15
15
  hooks.useBrowserLayoutEffect(() => {
16
16
  const { current } = elementRef;
17
- ['activeSlideIndex', 'alignHeader', 'aria', 'description', 'disablePagination', 'heading', 'headingSize', 'intl', 'pagination', 'rewind', 'skipLinkTarget', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
17
+ ['activeSlideIndex', 'alignHeader', 'aria', 'description', 'disablePagination', 'focusOnCenterSlide', 'gradientColor', 'heading', 'headingSize', 'intl', 'pagination', 'rewind', 'skipLinkTarget', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
18
18
  }, propsToSync);
19
19
  const props = {
20
20
  ...rest,
@@ -1,56 +1,48 @@
1
1
  import type { BaseProps } from '../../BaseProps';
2
- import type { CanvasSidebarEndWidth, CanvasSidebarStartWidth } from '../types';
2
+ import type { CanvasSidebarEndIcon, CanvasSidebarStartIcon, Theme } from '../types';
3
3
  export type PCanvasProps = BaseProps & {
4
4
  /**
5
- * Emitted when the component requests to close the sidebar on the end side.
5
+ * The icon to toggle the Sidebar on the end side
6
6
  */
7
- onDismissSidebarEnd?: (event: CustomEvent<void>) => void;
8
- /**
9
- * Emitted when the component requests to close the sidebar on the start side.
10
- */
11
- onDismissSidebarStart?: (event: CustomEvent<void>) => void;
7
+ sidebarEndIcon?: CanvasSidebarEndIcon;
12
8
  /**
13
9
  * Open Sidebar on the end side
14
10
  */
15
11
  sidebarEndOpen?: boolean;
16
12
  /**
17
- * Defines the width of the sidebar on the end side
13
+ * The icon to toggle the Sidebar on the start side
18
14
  */
19
- sidebarEndWidth?: CanvasSidebarEndWidth;
15
+ sidebarStartIcon?: CanvasSidebarStartIcon;
20
16
  /**
21
17
  * Open Sidebar on the start side
22
18
  */
23
19
  sidebarStartOpen?: boolean;
24
20
  /**
25
- * Defines the width of the sidebar on the start side
21
+ * Adapts the color depending on the theme. Has no effect when "inherit" is set as color prop.
26
22
  */
27
- sidebarStartWidth?: CanvasSidebarStartWidth;
23
+ theme?: Theme;
28
24
  };
29
25
  export declare const PCanvas: import("react").ForwardRefExoticComponent<import("react").DOMAttributes<{}> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
30
26
  /**
31
- * Emitted when the component requests to close the sidebar on the end side.
32
- */
33
- onDismissSidebarEnd?: (event: CustomEvent<void>) => void;
34
- /**
35
- * Emitted when the component requests to close the sidebar on the start side.
27
+ * The icon to toggle the Sidebar on the end side
36
28
  */
37
- onDismissSidebarStart?: (event: CustomEvent<void>) => void;
29
+ sidebarEndIcon?: CanvasSidebarEndIcon;
38
30
  /**
39
31
  * Open Sidebar on the end side
40
32
  */
41
33
  sidebarEndOpen?: boolean;
42
34
  /**
43
- * Defines the width of the sidebar on the end side
35
+ * The icon to toggle the Sidebar on the start side
44
36
  */
45
- sidebarEndWidth?: CanvasSidebarEndWidth;
37
+ sidebarStartIcon?: CanvasSidebarStartIcon;
46
38
  /**
47
39
  * Open Sidebar on the start side
48
40
  */
49
41
  sidebarStartOpen?: boolean;
50
42
  /**
51
- * Defines the width of the sidebar on the start side
43
+ * Adapts the color depending on the theme. Has no effect when "inherit" is set as color prop.
52
44
  */
53
- sidebarStartWidth?: CanvasSidebarStartWidth;
45
+ theme?: Theme;
54
46
  } & {
55
47
  children?: import("react").ReactNode | undefined;
56
48
  } & import("react").RefAttributes<HTMLElement>>;
@@ -1,18 +1,16 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef, useRef } from 'react';
4
- import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
4
+ import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
5
5
  import { syncRef } from '../../utils.mjs';
6
6
 
7
- const PCanvas = forwardRef(({ onDismissSidebarEnd, onDismissSidebarStart, sidebarEndOpen = false, sidebarEndWidth = 'medium', sidebarStartOpen = false, sidebarStartWidth = 'medium', className, ...rest }, ref) => {
7
+ const PCanvas = forwardRef(({ sidebarEndIcon = 'configurate', sidebarEndOpen = false, sidebarStartIcon = 'menu-lines', sidebarStartOpen = false, theme, className, ...rest }, ref) => {
8
8
  const elementRef = useRef();
9
- useEventCallback(elementRef, 'dismissSidebarEnd', onDismissSidebarEnd);
10
- useEventCallback(elementRef, 'dismissSidebarStart', onDismissSidebarStart);
11
9
  const WebComponentTag = usePrefix('p-canvas');
12
- const propsToSync = [sidebarEndOpen, sidebarEndWidth, sidebarStartOpen, sidebarStartWidth];
10
+ const propsToSync = [sidebarEndIcon, sidebarEndOpen, sidebarStartIcon, sidebarStartOpen, theme || useTheme()];
13
11
  useBrowserLayoutEffect(() => {
14
12
  const { current } = elementRef;
15
- ['sidebarEndOpen', 'sidebarEndWidth', 'sidebarStartOpen', 'sidebarStartWidth'].forEach((propName, i) => (current[propName] = propsToSync[i]));
13
+ ['sidebarEndIcon', 'sidebarEndOpen', 'sidebarStartIcon', 'sidebarStartOpen', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
14
  }, propsToSync);
17
15
  const props = {
18
16
  ...rest,
@@ -1,5 +1,5 @@
1
1
  import type { BaseProps } from '../../BaseProps';
2
- import type { CarouselAlignHeader, SelectedAriaAttributes, CarouselAriaAttribute, BreakpointCustomizable, CarouselHeadingSize, CarouselInternationalization, CarouselUpdateEventDetail, Theme, CarouselWidth } from '../types';
2
+ import type { CarouselAlignHeader, SelectedAriaAttributes, CarouselAriaAttribute, BreakpointCustomizable, CarouselGradientColor, CarouselHeadingSize, CarouselInternationalization, CarouselUpdateEventDetail, Theme, CarouselWidth } from '../types';
3
3
  export type PCarouselProps = BaseProps & {
4
4
  /**
5
5
  * Defines which slide to be active (zero-based numbering).
@@ -21,6 +21,14 @@ export type PCarouselProps = BaseProps & {
21
21
  * @deprecated since v3.0.0, will be removed with next major release, use `pagination` instead. If true, the carousel will not show pagination bullets at the bottom.
22
22
  */
23
23
  disablePagination?: BreakpointCustomizable<boolean>;
24
+ /**
25
+ * Indicates whether focus should be set on the center slide. If true, the carousel loops by individual slide; otherwise, it loops by page.
26
+ */
27
+ focusOnCenterSlide?: boolean;
28
+ /**
29
+ * Adapts the background gradient for the left and right edge.
30
+ */
31
+ gradientColor?: CarouselGradientColor;
24
32
  /**
25
33
  * Defines the heading used in the carousel.
26
34
  */
@@ -92,6 +100,14 @@ export declare const PCarousel: import("react").ForwardRefExoticComponent<import
92
100
  * @deprecated since v3.0.0, will be removed with next major release, use `pagination` instead. If true, the carousel will not show pagination bullets at the bottom.
93
101
  */
94
102
  disablePagination?: BreakpointCustomizable<boolean>;
103
+ /**
104
+ * Indicates whether focus should be set on the center slide. If true, the carousel loops by individual slide; otherwise, it loops by page.
105
+ */
106
+ focusOnCenterSlide?: boolean;
107
+ /**
108
+ * Adapts the background gradient for the left and right edge.
109
+ */
110
+ gradientColor?: CarouselGradientColor;
95
111
  /**
96
112
  * Defines the heading used in the carousel.
97
113
  */
@@ -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 PCarousel = forwardRef(({ activeSlideIndex = 0, alignHeader = 'start', aria, description, disablePagination, heading, headingSize = 'x-large', intl, onCarouselChange, onUpdate, pagination = true, rewind = true, skipLinkTarget, slidesPerPage = 1, theme, width = 'basic', wrapContent, className, ...rest }, ref) => {
7
+ const PCarousel = forwardRef(({ activeSlideIndex = 0, alignHeader = 'start', aria, description, disablePagination, focusOnCenterSlide = false, gradientColor = 'none', heading, headingSize = 'x-large', intl, onCarouselChange, onUpdate, pagination = true, rewind = true, skipLinkTarget, slidesPerPage = 1, theme, width = 'basic', wrapContent, className, ...rest }, ref) => {
8
8
  const elementRef = useRef();
9
9
  useEventCallback(elementRef, 'carouselChange', onCarouselChange);
10
10
  useEventCallback(elementRef, 'update', onUpdate);
11
11
  const WebComponentTag = usePrefix('p-carousel');
12
- const propsToSync = [activeSlideIndex, alignHeader, aria, description, disablePagination, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme || useTheme(), width, wrapContent];
12
+ const propsToSync = [activeSlideIndex, alignHeader, aria, description, disablePagination, focusOnCenterSlide, gradientColor, heading, headingSize, intl, pagination, rewind, skipLinkTarget, slidesPerPage, theme || useTheme(), width, wrapContent];
13
13
  useBrowserLayoutEffect(() => {
14
14
  const { current } = elementRef;
15
- ['activeSlideIndex', 'alignHeader', 'aria', 'description', 'disablePagination', 'heading', 'headingSize', 'intl', 'pagination', 'rewind', 'skipLinkTarget', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
15
+ ['activeSlideIndex', 'alignHeader', 'aria', 'description', 'disablePagination', 'focusOnCenterSlide', 'gradientColor', 'heading', 'headingSize', 'intl', 'pagination', 'rewind', 'skipLinkTarget', 'slidesPerPage', 'theme', 'width', 'wrapContent'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
16
  }, propsToSync);
17
17
  const props = {
18
18
  ...rest,
@@ -684,18 +684,19 @@ export type ButtonTileSize = TileSize;
684
684
  export type ButtonTileBackground = TileBackground;
685
685
  export type ButtonTileWeight = TileWeight;
686
686
  export type ButtonTileAlign = TileAlign;
687
- declare const CANVAS_SIDEBAR_WIDTHS: readonly [
688
- "medium",
689
- "large"
690
- ];
691
- export type CanvasSidebarWidth = (typeof CANVAS_SIDEBAR_WIDTHS)[number];
692
- export type CanvasSidebarStartWidth = CanvasSidebarWidth;
693
- export type CanvasSidebarEndWidth = CanvasSidebarWidth;
687
+ export type CanvasSidebarStartIcon = IconName;
688
+ export type CanvasSidebarEndIcon = IconName;
694
689
  declare const CAROUSEL_WIDTHS: readonly [
695
690
  "basic",
696
691
  "extended"
697
692
  ];
698
693
  export type CarouselWidth = (typeof CAROUSEL_WIDTHS)[number];
694
+ declare const CAROUSEL_GRADIENT_COLORS: readonly [
695
+ "background-base",
696
+ "background-surface",
697
+ "none"
698
+ ];
699
+ export type CarouselGradientColor = (typeof CAROUSEL_GRADIENT_COLORS)[number];
699
700
  declare const CAROUSEL_ALIGN_HEADERS: readonly [
700
701
  "start",
701
702
  "center",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porsche-design-system/components-react",
3
- "version": "3.18.0",
3
+ "version": "3.19.0-rc.1",
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.18.0"
20
+ "@porsche-design-system/components-js": "3.19.0-rc.1"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=18.0.0 <19.0.0",