@porsche-design-system/components-react 4.3.0 → 4.4.0-rc.0

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 CHANGED
@@ -14,6 +14,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [4.4.0-rc.0] - 2026-07-06
18
+
19
+ ### Added
20
+
21
+ - `Popover` ([#4562](https://github.com/porsche-design-system/porsche-design-system/pull/4562)):
22
+ - Support for controlled and uncontrolled usage: when the `open` prop is omitted the component manages its own
23
+ visibility (uncontrolled), when it is set the consumer owns the open state via a custom trigger projected through
24
+ the named `button` slot (controlled)
25
+ - `open` prop to control the popover's visibility in controlled mode
26
+ - `compact` prop to reduce padding and spacing for a more compact layout, useful in space-constrained interfaces
27
+ - `dismiss` event emitted in controlled mode when the user requests to close the popover via the `Escape` key, an
28
+ outside click, or when keyboard focus leaves the popover (`Tab` / `Shift+Tab`)
29
+ - CSS variables to customize the popover panel: `--p-popover-w`, `--p-popover-h`, `--p-popover-min-w`,
30
+ `--p-popover-min-h`, `--p-popover-max-w`, `--p-popover-max-h`, `--p-popover-px`, `--p-popover-py` and
31
+ `--p-popover-radius`
32
+
33
+ ### Changed
34
+
35
+ - `Popover`: Improved visual appearance
36
+ ([#4562](https://github.com/porsche-design-system/porsche-design-system/pull/4562))
37
+
17
38
  ## [4.3.0] - 2026-06-24
18
39
 
19
40
  ## [4.3.0-rc.0] - 2026-06-24
@@ -6,13 +6,14 @@ var react = require('react');
6
6
  var hooks = require('../../hooks.cjs');
7
7
  var utils = require('../../utils.cjs');
8
8
 
9
- const PPopover = /*#__PURE__*/ react.forwardRef(({ aria, description, direction = 'bottom', className, ...rest }, ref) => {
9
+ const PPopover = /*#__PURE__*/ react.forwardRef(({ aria, compact, description, direction = 'bottom', onDismiss, open, className, ...rest }, ref) => {
10
10
  const elementRef = react.useRef(undefined);
11
+ hooks.useEventCallback(elementRef, 'dismiss', onDismiss);
11
12
  const WebComponentTag = hooks.usePrefix('p-popover');
12
- const propsToSync = [aria, description, direction];
13
+ const propsToSync = [aria, compact, description, direction, open];
13
14
  hooks.useBrowserLayoutEffect(() => {
14
15
  const { current } = elementRef;
15
- ['aria', 'description', 'direction'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
+ ['aria', 'compact', 'description', 'direction', 'open'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
17
  }, propsToSync);
17
18
  const props = {
18
19
  ...rest,
@@ -6,7 +6,11 @@ export type PPopoverProps = BaseProps & {
6
6
  */
7
7
  aria?: SelectedAriaAttributes<PopoverAriaAttribute>;
8
8
  /**
9
- * Sets the text content displayed inside the popover panel when it is open, providing contextual help or information.
9
+ * Reduces padding and spacing for a more compact layout, useful in space-constrained interfaces.
10
+ */
11
+ compact?: boolean;
12
+ /**
13
+ * Sets the text content displayed inside the popover panel when it is open, providing contextual help or information. Takes precedence over the default slot when both are provided.
10
14
  */
11
15
  description?: string;
12
16
  /**
@@ -14,6 +18,14 @@ export type PPopoverProps = BaseProps & {
14
18
  * @default 'bottom'
15
19
  */
16
20
  direction?: PopoverDirection;
21
+ /**
22
+ * Emitted in controlled mode when the user requests to close the popover via the Escape key, an outside click, or when keyboard focus leaves the popover (Tab / Shift+Tab).
23
+ */
24
+ onDismiss?: (event: CustomEvent<void>) => void;
25
+ /**
26
+ * Controls whether the popover is visible. When set (controlled mode), visibility follows this prop and the consumer owns the open state via a slotted `button`. When omitted (uncontrolled mode), the component manages visibility itself.
27
+ */
28
+ open?: boolean;
17
29
  };
18
30
  export declare const PPopover: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "inputMode" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
19
31
  /**
@@ -21,7 +33,11 @@ export declare const PPopover: import("react").ForwardRefExoticComponent<Omit<im
21
33
  */
22
34
  aria?: SelectedAriaAttributes<PopoverAriaAttribute>;
23
35
  /**
24
- * Sets the text content displayed inside the popover panel when it is open, providing contextual help or information.
36
+ * Reduces padding and spacing for a more compact layout, useful in space-constrained interfaces.
37
+ */
38
+ compact?: boolean;
39
+ /**
40
+ * Sets the text content displayed inside the popover panel when it is open, providing contextual help or information. Takes precedence over the default slot when both are provided.
25
41
  */
26
42
  description?: string;
27
43
  /**
@@ -29,6 +45,14 @@ export declare const PPopover: import("react").ForwardRefExoticComponent<Omit<im
29
45
  * @default 'bottom'
30
46
  */
31
47
  direction?: PopoverDirection;
48
+ /**
49
+ * Emitted in controlled mode when the user requests to close the popover via the Escape key, an outside click, or when keyboard focus leaves the popover (Tab / Shift+Tab).
50
+ */
51
+ onDismiss?: (event: CustomEvent<void>) => void;
52
+ /**
53
+ * Controls whether the popover is visible. When set (controlled mode), visibility follows this prop and the consumer owns the open state via a slotted `button`. When omitted (uncontrolled mode), the component manages visibility itself.
54
+ */
55
+ open?: boolean;
32
56
  } & {
33
57
  children?: import("react").ReactNode | undefined;
34
58
  } & import("react").RefAttributes<HTMLElement>>;
@@ -1,16 +1,17 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef, useRef } from 'react';
4
- import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
4
+ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
5
5
  import { syncRef } from '../../utils.mjs';
6
6
 
7
- const PPopover = /*#__PURE__*/ forwardRef(({ aria, description, direction = 'bottom', className, ...rest }, ref) => {
7
+ const PPopover = /*#__PURE__*/ forwardRef(({ aria, compact, description, direction = 'bottom', onDismiss, open, className, ...rest }, ref) => {
8
8
  const elementRef = useRef(undefined);
9
+ useEventCallback(elementRef, 'dismiss', onDismiss);
9
10
  const WebComponentTag = usePrefix('p-popover');
10
- const propsToSync = [aria, description, direction];
11
+ const propsToSync = [aria, compact, description, direction, open];
11
12
  useBrowserLayoutEffect(() => {
12
13
  const { current } = elementRef;
13
- ['aria', 'description', 'direction'].forEach((propName, i) => (current[propName] = propsToSync[i]));
14
+ ['aria', 'compact', 'description', 'direction', 'open'].forEach((propName, i) => (current[propName] = propsToSync[i]));
14
15
  }, propsToSync);
15
16
  const props = {
16
17
  ...rest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porsche-design-system/components-react",
3
- "version": "4.3.0",
3
+ "version": "4.4.0-rc.0",
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",
@@ -21,7 +21,7 @@
21
21
  "url": "https://github.com/porsche-design-system/porsche-design-system"
22
22
  },
23
23
  "dependencies": {
24
- "@porsche-design-system/components-js": "4.3.0"
24
+ "@porsche-design-system/components-js": "4.4.0-rc.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "ag-grid-community": ">= 35.0.0 <36.0.0",
@@ -3849,7 +3849,7 @@ const OPTION_LIST_SAFE_ZONE = 6;
3849
3849
 
3850
3850
  const getCDNBaseURL = () => global.PORSCHE_DESIGN_SYSTEM_CDN_URL + "/porsche-design-system";
3851
3851
 
3852
- const prefix = `[Porsche Design System v${"4.3.0"}]` // this part isn't covered by unit tests
3852
+ const prefix = `[Porsche Design System v${"4.4.0-rc.0"}]` // this part isn't covered by unit tests
3853
3853
  ;
3854
3854
  const consoleError = (...messages) => {
3855
3855
  console.error(prefix, ...messages);
@@ -3984,11 +3984,11 @@ const cssVarSummaryTopDeprecated = '--p-accordion-position-sticky-top'; // depre
3984
3984
  /**
3985
3985
  * @css-variable {"name": "--p-accordion-px", "description": "Horizontal padding of the accordion.", "defaultValue": "16px"}
3986
3986
  */
3987
- const cssVarPaddingInline$1 = '--p-accordion-px';
3987
+ const cssVarPaddingInline$2 = '--p-accordion-px';
3988
3988
  /**
3989
3989
  * @css-variable {"name": "--p-accordion-py", "description": "Vertical padding of the accordion.", "defaultValue": "16px"}
3990
3990
  */
3991
- const cssVarPaddingBlock = '--p-accordion-py';
3991
+ const cssVarPaddingBlock$1 = '--p-accordion-py';
3992
3992
  const iconMarker = getInlineSVGBackgroundImage(`<path d="m12 15.125h-.001l-.005-.006-6.494-5.476.642-.768 5.858 4.94 5.858-4.94.642.769-6.497 5.477z"/>`);
3993
3993
  const backgroundMap$1 = {
3994
3994
  canvas: ref(colorCanvas),
@@ -4069,7 +4069,7 @@ const getComponentCss$1a = (alignMarker, background, isCompact, indent, isOpen,
4069
4069
  gridTemplate: `repeat(2, auto) / ${hasSummaryBefore ? 'auto ' : ''}${isIconAlignedStart ? 'auto minmax(0, 1fr)' : 'minmax(0, 1fr) auto'}${hasSummaryAfter ? ' auto ' : ''}`,
4070
4070
  columnGap: gap,
4071
4071
  alignItems: 'center',
4072
- padding: `${ref(cssVarPaddingBlock, background === 'none' ? '0' : paddingBlock)} ${ref(cssVarPaddingInline$1, background === 'none' ? '0' : paddingInline)}`,
4072
+ padding: `${ref(cssVarPaddingBlock$1, background === 'none' ? '0' : paddingBlock)} ${ref(cssVarPaddingInline$2, background === 'none' ? '0' : paddingInline)}`,
4073
4073
  background: backgroundMap$1[background],
4074
4074
  ...(background === 'frosted' && {
4075
4075
  WebkitBackdropFilter: ref(blurFrosted),
@@ -4079,7 +4079,7 @@ const getComponentCss$1a = (alignMarker, background, isCompact, indent, isOpen,
4079
4079
  ...forcedColorsMediaQuery({
4080
4080
  outline: '1px solid CanvasText',
4081
4081
  outlineOffset: background === 'none' ? '0' : '-1px',
4082
- padding: `${ref(cssVarPaddingBlock, paddingBlock)} ${ref(cssVarPaddingInline$1, paddingInline)}`,
4082
+ padding: `${ref(cssVarPaddingBlock$1, paddingBlock)} ${ref(cssVarPaddingInline$2, paddingInline)}`,
4083
4083
  }),
4084
4084
  '&::details-content': addImportantToEachRule({
4085
4085
  display: 'contents', // allows <details> to be used as grid layout
@@ -4104,8 +4104,8 @@ const getComponentCss$1a = (alignMarker, background, isCompact, indent, isOpen,
4104
4104
  opacity: 1,
4105
4105
  paddingTop,
4106
4106
  zIndex: 2, // Ensure details are above summary when using custom padding
4107
- paddingInline: `${ref(cssVarPaddingInline$1, background === 'none' ? '0' : paddingInline)}`,
4108
- marginInline: `calc(-1 * ${ref(cssVarPaddingInline$1, background === 'none' ? '0' : paddingInline)})`,
4107
+ paddingInline: `${ref(cssVarPaddingInline$2, background === 'none' ? '0' : paddingInline)}`,
4108
+ marginInline: `calc(-1 * ${ref(cssVarPaddingInline$2, background === 'none' ? '0' : paddingInline)})`,
4109
4109
  // as soon as all browsers support calc-size(auto) to be transitionable, we can remove the grid-template-rows rule and animation
4110
4110
  gridTemplateRows: '1fr',
4111
4111
  visibility: 'inherit', // since `::details-content` and `allow-discrete` transition doesn't work in Safari we need to take care ourselves for visibility state to be a11y compliant
@@ -4122,8 +4122,8 @@ const getComponentCss$1a = (alignMarker, background, isCompact, indent, isOpen,
4122
4122
  gridTemplateColumns: 'subgrid',
4123
4123
  alignItems: 'center',
4124
4124
  cursor: 'pointer',
4125
- padding: `${ref(cssVarPaddingBlock, background === 'none' ? '0' : paddingBlock)} ${ref(cssVarPaddingInline$1, background === 'none' ? '0' : paddingInline)}`,
4126
- margin: `calc(-1 * ${ref(cssVarPaddingBlock, background === 'none' ? '0' : paddingBlock)}) calc(-1 * ${ref(cssVarPaddingInline$1, background === 'none' ? '0' : paddingInline)})`,
4125
+ padding: `${ref(cssVarPaddingBlock$1, background === 'none' ? '0' : paddingBlock)} ${ref(cssVarPaddingInline$2, background === 'none' ? '0' : paddingInline)}`,
4126
+ margin: `calc(-1 * ${ref(cssVarPaddingBlock$1, background === 'none' ? '0' : paddingBlock)}) calc(-1 * ${ref(cssVarPaddingInline$2, background === 'none' ? '0' : paddingInline)})`,
4127
4127
  ...(isSticky &&
4128
4128
  (background === 'canvas' || background === 'surface') && {
4129
4129
  position: 'sticky',
@@ -5207,7 +5207,7 @@ const getComponentCss$14 = (isSidebarStartOpen, isSidebarEndOpen, background) =>
5207
5207
  /**
5208
5208
  * @css-variable {"name": "--p-carousel-px", "description": "Defines the logical inline start and end padding of the carousel, the extra space is used to show parts of the next/previous slide. When used then the prop `width` has no effect anymore.", "defaultValue": ""}
5209
5209
  */
5210
- const cssVarPaddingInline = '--p-carousel-px';
5210
+ const cssVarPaddingInline$1 = '--p-carousel-px';
5211
5211
  /**
5212
5212
  * @css-variable {"name": "--p-carousel-ps", "description": "Defines the logical inline start padding of the carousel, the extra space is used to show parts of the next/previous slide. Needs to be used in combination with `--p-carousel-px` or `--p-carousel-pe`. When used then the prop `width` has no effect anymore.", "defaultValue": ""}
5213
5213
  */
@@ -5326,17 +5326,17 @@ const getComponentCss$13 = (gradient, hasHeading, hasDescription, hasControlsSlo
5326
5326
  },
5327
5327
  header: {
5328
5328
  display: 'grid',
5329
- paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline, spacingMap[width].base)),
5330
- paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline, spacingMap[width].base)),
5329
+ paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline$1, spacingMap[width].base)),
5330
+ paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline$1, spacingMap[width].base)),
5331
5331
  [mediaQueryS]: {
5332
5332
  gridTemplateColumns: 'minmax(0px,1fr) auto',
5333
- paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline, spacingMap[width].s)),
5334
- paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline, spacingMap[width].s)),
5333
+ paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline$1, spacingMap[width].s)),
5334
+ paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline$1, spacingMap[width].s)),
5335
5335
  ...(hasNavigation && { columnGap: ref(spacingStaticMd) }),
5336
5336
  },
5337
5337
  [mediaQueryXXL]: {
5338
- paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline, spacingMap[width].xxl)),
5339
- paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline, spacingMap[width].xxl)),
5338
+ paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline$1, spacingMap[width].xxl)),
5339
+ paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline$1, spacingMap[width].xxl)),
5340
5340
  },
5341
5341
  },
5342
5342
  nav: {
@@ -5373,15 +5373,15 @@ const getComponentCss$13 = (gradient, hasHeading, hasDescription, hasControlsSlo
5373
5373
  // !important is necessary to override inline styles set by splide library
5374
5374
  ...addImportantToEachRule({
5375
5375
  paddingBlock: '0px',
5376
- paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline, spacingMap[width].base)),
5377
- paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline, spacingMap[width].base)),
5376
+ paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline$1, spacingMap[width].base)),
5377
+ paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline$1, spacingMap[width].base)),
5378
5378
  [mediaQueryS]: {
5379
- paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline, spacingMap[width].s)),
5380
- paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline, spacingMap[width].s)),
5379
+ paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline$1, spacingMap[width].s)),
5380
+ paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline$1, spacingMap[width].s)),
5381
5381
  },
5382
5382
  [mediaQueryXXL]: {
5383
- paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline, spacingMap[width].xxl)),
5384
- paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline, spacingMap[width].xxl)),
5383
+ paddingInlineStart: ref(cssVarPaddingInlineStart, ref(cssVarPaddingInline$1, spacingMap[width].xxl)),
5384
+ paddingInlineEnd: ref(cssVarPaddingInlineEnd, ref(cssVarPaddingInline$1, spacingMap[width].xxl)),
5385
5385
  },
5386
5386
  }),
5387
5387
  '&--draggable': {
@@ -5659,8 +5659,20 @@ const getFunctionalComponentLabelAfterStyles = () => {
5659
5659
  const labelAfterStyles = {
5660
5660
  display: 'inline-block',
5661
5661
  verticalAlign: 'top',
5662
+ // The inline-start spacing is applied to the assigned elements via `::slotted(*)` (not to the `<slot>` box or via
5663
+ // `:empty`), so it only exists when the "label-after" slot actually has content — an empty slot renders no margin.
5664
+ // `::slotted()` alone would fail for a slotted `p-popover`, whose `:host` uses `display: contents` (a `contents` box
5665
+ // has no margins). To fix that, we also set `display: inline-block` on the slotted element: since `::slotted()` is a
5666
+ // rule from the *outer* shadow tree, its normal declarations win over the popover's own (inner-tree) normal
5667
+ // `:host { display: contents }` in the shadow-tree cascade — this is a cascade/context precedence, not specificity.
5668
+ // The re-established inline-block box then has something for `margin-inline-start` to apply to.
5669
+ // Note: relies on `p-popover`'s `:host { display: contents }` staying non-`!important`; an inner `!important` would
5670
+ // beat this outer normal declaration. Keeping inline flow (vs. flex/gap) lets label-after follow a wrapped label's
5671
+ // last line. `:host(:has([slot="label-after"]))` would be an alternative but lacks reliable Chrome support for now.
5662
5672
  '&::slotted(*)': {
5663
5673
  ...addImportantToEachRule({
5674
+ display: 'inline-block',
5675
+ verticalAlign: 'top',
5664
5676
  marginInlineStart: ref(spacingStaticXs$1),
5665
5677
  }),
5666
5678
  },
@@ -7046,7 +7058,7 @@ const getComponentCss$W = (size) => {
7046
7058
  /**
7047
7059
  * @css-variable {"name": "--p-flyout-width", "description": "Width of the flyout.", "defaultValue": "auto"}
7048
7060
  */
7049
- const cssVariableWidth$2 = '--p-flyout-width';
7061
+ const cssVariableWidth$3 = '--p-flyout-width';
7050
7062
  /**
7051
7063
  * @css-variable {"name": "--p-flyout-sticky-top", "description": "@experimental Exposes the header's height as a read-only CSS variable, set automatically by the component. Slotted sticky content can use this value to offset their top position correctly."}
7052
7064
  */
@@ -7129,7 +7141,7 @@ const getComponentCss$V = (isOpen, background, backdrop, position, hasHeader, ha
7129
7141
  },
7130
7142
  }
7131
7143
  : {
7132
- width: ref(cssVariableWidth$2, 'auto'),
7144
+ width: ref(cssVariableWidth$3, 'auto'),
7133
7145
  minWidth: '320px',
7134
7146
  maxWidth: '100vw',
7135
7147
  clipPath: isPositionStart
@@ -7902,7 +7914,7 @@ const getComponentCss$D = (icon, iconSource, variant, hideLabel, hasSlottedAncho
7902
7914
  * @css-variable {"name": "--p-modal-spacing-top", "description": "Spacing of the modal to the top.", "defaultValue": "clamp(16px, 10vh, 192px)"}
7903
7915
  * @css-variable {"name": "--p-modal-spacing-bottom", "description": "Spacing of the modal to the bottom.", "defaultValue": "clamp(16px, 10vh, 192px)"}
7904
7916
  */
7905
- const cssVariableWidth$1 = '--p-modal-width';
7917
+ const cssVariableWidth$2 = '--p-modal-width';
7906
7918
  const cssVariableSpacingTop = '--p-modal-spacing-top'; // TODO: maybe --p-modal-spacing-block-start would be more precise?
7907
7919
  const cssVariableSpacingBottom = '--p-modal-spacing-bottom'; // TODO: maybe --p-modal-spacing-block-end would be more precise?
7908
7920
  /**
@@ -7962,7 +7974,7 @@ const getComponentCss$C = (isOpen, background, backdrop, fullscreen, hasDismissB
7962
7974
  clipPath: 'none', // fullscreen has square corners, so disable corner clipping
7963
7975
  }
7964
7976
  : {
7965
- width: ref(cssVariableWidth$1, 'auto'),
7977
+ width: ref(cssVariableWidth$2, 'auto'),
7966
7978
  minWidth: '276px', // to be in sync with "Porsche Grid" on viewport = 320px: calc(${gridColumnWidthBase} * 6 + ${gridGap} * 5)
7967
7979
  maxWidth: '1535.5px', // to be in sync with "Porsche Grid" on viewport >= 1920px: `calc(${gridColumnWidthXXL} * 14 + ${gridGap} * 13)`
7968
7980
  placeSelf: 'center',
@@ -7988,11 +8000,11 @@ const getSvgUrl = (model) => {
7988
8000
  /**
7989
8001
  * @css-variable {"name": "--p-model-signature-width", "description": "Overrides the width of the model signature.", "defaultValue": ""}
7990
8002
  */
7991
- const cssVariableWidth = '--p-model-signature-width';
8003
+ const cssVariableWidth$1 = '--p-model-signature-width';
7992
8004
  /**
7993
8005
  * @css-variable {"name": "--p-model-signature-height", "description": "Overrides the height of the model signature.", "defaultValue": "auto"}
7994
8006
  */
7995
- const cssVariableHeight = '--p-model-signature-height';
8007
+ const cssVariableHeight$1 = '--p-model-signature-height';
7996
8008
  /**
7997
8009
  * @css-variable {"name": "--p-model-signature-color", "description": "Overrides the fill color of the model signature. Overrides the `color` property when set.", "defaultValue": ""}
7998
8010
  */
@@ -8015,8 +8027,8 @@ const getComponentCss$B = (model, safeZone, size, color) => {
8015
8027
  maxWidth: '100%',
8016
8028
  maxHeight: '100%',
8017
8029
  // width + height style can't be !important atm to be backwards compatible with e.g. `<p-model-signature size="inherit" style="height: 50px"/>`
8018
- width: ref(cssVariableWidth, isSizeInherit ? 'auto' : `${width}px`),
8019
- height: ref(cssVariableHeight, 'auto'),
8030
+ width: ref(cssVariableWidth$1, isSizeInherit ? 'auto' : `${width}px`),
8031
+ height: ref(cssVariableHeight$1, 'auto'),
8020
8032
  ...addImportantToEachRule({
8021
8033
  mask: `url(${getSvgUrl(model)}) no-repeat left top / contain`,
8022
8034
  aspectRatio: `${width} / ${safeZone ? 36 : height}`, // 36px is the max-height for SVG model signature creation
@@ -8347,97 +8359,201 @@ const getComponentCss$w = (hideLabel, state, isDisabled, isLoading, length, isCo
8347
8359
  });
8348
8360
  };
8349
8361
 
8362
+ // Minimum gap (in px) kept between the panel and the viewport edges. Used both as Floating UI `shift`/`flip` padding
8363
+ // and to inset the panel's default max-width/height (`100dvw/dvh - 2 * POPOVER_SAFE_ZONE`) so it never touches the edge.
8350
8364
  const POPOVER_SAFE_ZONE = 8;
8351
8365
 
8352
- const getComponentCss$v = () => {
8353
- const shadowColor = 'rgba(0,0,0,0.3)';
8354
- return getCss({
8366
+ /**
8367
+ * @css-variable {"name": "--p-popover-w", "description": "Width of the popover.", "defaultValue": "max-content"}
8368
+ */
8369
+ const cssVariableWidth = '--p-popover-w';
8370
+ /**
8371
+ * @css-variable {"name": "--p-popover-h", "description": "Height of the popover.", "defaultValue": "auto"}
8372
+ */
8373
+ const cssVariableHeight = '--p-popover-h';
8374
+ /**
8375
+ * @css-variable {"name": "--p-popover-min-w", "description": "Min width of the popover.", "defaultValue": "0px"}
8376
+ */
8377
+ const cssVariableMinWidth = '--p-popover-min-w';
8378
+ /**
8379
+ * @css-variable {"name": "--p-popover-min-h", "description": "Min height of the popover.", "defaultValue": "auto"}
8380
+ */
8381
+ const cssVariableMinHeight = '--p-popover-min-h';
8382
+ /**
8383
+ * @css-variable {"name": "--p-popover-max-w", "description": "Max width of the popover.", "defaultValue": "min(calc(100dvw - 16px), 48ch)"}
8384
+ */
8385
+ const cssVariableMaxWidth = '--p-popover-max-w';
8386
+ /**
8387
+ * @css-variable {"name": "--p-popover-max-h", "description": "Max height of the popover.", "defaultValue": "calc(100dvh - 16px)"}
8388
+ */
8389
+ const cssVariableMaxHeight = '--p-popover-max-h';
8390
+ /**
8391
+ * @css-variable {"name": "--p-popover-px", "description": "Horizontal padding of the popover. It is recommended to apply an existing Porsche Design System spacing token, e.g. the CSS declaration `--p-popover-px: var(--p-spacing-static-md)`, the Tailwind CSS arbitrary property `[--p-popover-px:var(--spacing-static-md)]` or the equivalent SCSS/JS token.", "defaultValue": "16px"}
8392
+ */
8393
+ const cssVarPaddingInline = '--p-popover-px';
8394
+ /**
8395
+ * @css-variable {"name": "--p-popover-py", "description": "Vertical padding of the popover. It is recommended to apply an existing Porsche Design System spacing token, e.g. the CSS declaration `--p-popover-py: var(--p-spacing-static-sm)`, the Tailwind CSS arbitrary property `[--p-popover-py:var(--spacing-static-sm)]` or the equivalent SCSS/JS token.", "defaultValue": "12px"}
8396
+ */
8397
+ const cssVarPaddingBlock = '--p-popover-py';
8398
+ /**
8399
+ * @css-variable {"name": "--p-popover-radius", "description": "Border radius of the popover. It is recommended to apply an existing Porsche Design System border-radius token, e.g. the CSS declaration `--p-popover-radius: var(--p-radius-lg)`, the Tailwind CSS arbitrary property `[--p-popover-radius:var(--radius-lg)]` or the equivalent SCSS/JS token.", "defaultValue": "12px"}
8400
+ */
8401
+ const cssVarRadius = '--p-popover-radius';
8402
+ const iconInfo = getInlineSVGBackgroundImage(`<path d="M12.5 10v6h-1v-6zm0-2v1h-1V8zM12 4a8 8 0 0 1 0 16 8 8 0 0 1 0-16m0-1c-4.95 0-9 4.05-9 9s4.05 9 9 9 9-4.05 9-9-4.05-9-9-9"/>`);
8403
+ /**
8404
+ * Builds the popover's scoped CSS.
8405
+ * @param isOpen - The effective open state; drives the fade-in/fade-out direction and the `@starting-style` append.
8406
+ * @param isCompact - Reduces padding/spacing and uses smaller radii (mirrors the `compact` prop).
8407
+ * @returns The component CSS string, with a trailing `@starting-style` rule appended while opening.
8408
+ */
8409
+ const getComponentCss$v = (isOpen, isCompact) => {
8410
+ // fade-in on open (via `@starting-style` below), fade-out on close. While closing, the panel keeps `display: grid`
8411
+ // (Chromium via `overlay` + `display` `allow-discrete`; Safari/Firefox via the deferred `hidePopover()`), so
8412
+ // `display: none` only describes the fully-closed terminal state. Tabbability / a11y-tree removal during the fade-out
8413
+ // is handled immediately via the `inert` attribute on the panel (see popover.tsx), so no `visibility` toggle is needed.
8414
+ const transition = getTransition('opacity', 'short', isOpen ? 'in' : 'out');
8415
+ const css = getCss({
8355
8416
  '@global': {
8356
- '@keyframes fade-in': {
8357
- from: {
8358
- opacity: 0,
8359
- },
8360
- to: {
8361
- opacity: 1,
8362
- },
8363
- },
8364
8417
  ':host': {
8365
- position: 'relative', // ensures correct reference for floating ui fallback positioning in older browsers
8366
- display: 'inline-block',
8367
- verticalAlign: 'top',
8368
- ...addImportantToEachRule({
8369
- ...hostHiddenStyles,
8370
- }),
8418
+ // `display: contents` so the host box does not participate in visual DOM rendering — the popover mimics the
8419
+ // native `[popover]` element, so the slotted trigger (or default info button) lays out directly in the parent
8420
+ // flow. Enabled by anchoring Floating UI to the assigned trigger element (see `triggerElement` in popover.tsx)
8421
+ // instead of the `<slot>` box, so the slot no longer needs a layout box of its own.
8422
+ display: 'contents',
8423
+ ...addImportantToEachRule(hostHiddenStyles),
8371
8424
  },
8372
- 'slot[name="button"]': {
8425
+ 'slot:not([name]), p': {
8373
8426
  display: 'block',
8374
- },
8375
- ...preventFoucOfNestedElementsStyles,
8376
- p: {
8377
- font: `${ref(fontWeightNormal$1)} ${ref(typescaleSm$1)} / ${ref(leadingNormal$1)} ${ref(fontPorscheNext$1)}`,
8378
- margin: 0,
8427
+ margin: 0, // reset ua-style for paragraphs
8428
+ minWidth: 0, // allow the grid item to shrink below its content size (needed for correct clamping via --p-popover-max-w)
8429
+ minHeight: 0, // allow the grid item to shrink below its content size so overflow scrolls instead of expanding the panel (needed for --p-popover-max-h)
8430
+ maxWidth: 'inherit',
8431
+ maxHeight: 'inherit',
8432
+ boxSizing: 'border-box',
8433
+ padding: `${ref(cssVarPaddingBlock, isCompact ? ref(spacingStaticXs$1) : `calc(12 * ${ref(spacingStatic2Xs)})`)} ${ref(cssVarPaddingInline, isCompact ? ref(spacingStaticSm$1) : ref(spacingStaticMd))}`,
8434
+ overflow: 'hidden auto',
8435
+ overscrollBehaviorY: 'none',
8379
8436
  },
8380
8437
  button: {
8381
8438
  all: 'unset',
8382
- display: 'block',
8439
+ display: 'inline-grid',
8440
+ verticalAlign: 'top',
8383
8441
  font: `${ref(typescaleSm$1)} ${ref(fontPorscheNext$1)}`, // needed for correct width/height definition based on ex-unit
8384
- width: ref(leadingNormal$1), // width needed to improve ssr support
8385
- height: ref(leadingNormal$1), // height needed to improve ssr support
8442
+ width: ref(leadingNormal$1),
8443
+ height: ref(leadingNormal$1),
8386
8444
  borderRadius: ref(radiusFull),
8387
8445
  cursor: 'pointer',
8388
- backgroundColor: ref(colorFrosted),
8446
+ background: ref(colorFrosted),
8389
8447
  transition: getTransition('background-color'),
8390
8448
  WebkitBackdropFilter: ref(blurFrosted),
8391
8449
  backdropFilter: ref(blurFrosted),
8392
8450
  ...hoverMediaQuery({
8393
8451
  '&:hover': {
8394
- backgroundColor: ref(colorFrostedSoft),
8452
+ background: ref(colorFrostedSoft),
8395
8453
  },
8396
8454
  }),
8397
8455
  '&:focus-visible': getFocusBaseStyles(),
8456
+ '&::after': {
8457
+ content: '""',
8458
+ WebkitMask: `${iconInfo} center/contain no-repeat`, // necessary for Sogou browser support :-)
8459
+ mask: `${iconInfo} center/contain no-repeat`,
8460
+ background: ref(colorPrimary),
8461
+ ...forcedColorsMediaQuery({
8462
+ background: 'CanvasText',
8463
+ }),
8464
+ },
8398
8465
  },
8399
8466
  '[popover]': {
8400
8467
  all: 'unset',
8401
- position: 'absolute',
8402
- pointerEvents: 'none',
8403
- filter: `drop-shadow(0 0 16px ${shadowColor})`,
8468
+ position: 'fixed', // matches floating ui's `fixed` strategy; required for correct top-layer positioning in Safari
8469
+ top: 0,
8470
+ left: 0,
8471
+ filter: 'drop-shadow(0 0 16px rgba(0,0,0,.3))',
8404
8472
  backdropFilter: 'drop-shadow(0 0 transparent)', // workaround for Firefox bug not rendering PDS frosted glass correctly when nested inside CSS filter: https://bugzilla.mozilla.org/show_bug.cgi?id=1797051
8405
- animation: `${ref(cssVariableAnimationDuration, ref(durationSm))} fade-in ${ref(easeInOut)} forwards`,
8406
- '&:not(:popover-open)': {
8407
- display: 'none', // ensures popover is not flickering when closed in some situations
8473
+ borderRadius: ref(cssVarRadius, isCompact ? ref(radiusLg) : ref(radiusXl)),
8474
+ // Fallback for engines without CSS relative color syntax (< Chromium 119 / Safari 16.4 / Firefox 128): the
8475
+ // `hsl(from …)` override below would be an invalid value and get dropped, leaving the panel with no background.
8476
+ // The plain `light-dark()` token renders correct white (light) / near-black (dark) as graceful degradation.
8477
+ background: ref(colorCanvas),
8478
+ // Relative color syntax: lightens ONLY the dark scheme (light `#fff` clamps at l=100 → stays white; dark
8479
+ // `l≈1.2%` → `≈15.2%`). Feature-test string kept in sync with `spinner-styles.ts` (one relative-color feature
8480
+ // covers all color functions).
8481
+ '@supports (color: oklch(from red l c h))': {
8482
+ background: `hsl(from ${ref(colorCanvas)} h 0% calc(l + 14))`,
8483
+ },
8484
+ font: `${ref(fontWeightNormal$1)} ${ref(typescaleSm$1)} / ${ref(leadingNormal$1)} ${ref(fontPorscheNext$1)}`,
8485
+ color: ref(colorPrimary),
8486
+ width: ref(cssVariableWidth, 'max-content'),
8487
+ height: ref(cssVariableHeight, 'auto'),
8488
+ minWidth: ref(cssVariableMinWidth, '0px'),
8489
+ minHeight: ref(cssVariableMinHeight, 'auto'),
8490
+ maxWidth: ref(cssVariableMaxWidth, `min(calc(100dvw - ${POPOVER_SAFE_ZONE * 2}px), 48ch)`),
8491
+ maxHeight: ref(cssVariableMaxHeight, `calc(100dvh - ${POPOVER_SAFE_ZONE * 2}px)`),
8492
+ opacity: isOpen ? 1 : 0,
8493
+ transition,
8494
+ // keep the popover on the #top-layer while the fade-out runs (Chromium only; see `overlayTransitionSupportsQuery`)
8495
+ ...overlayTransitionSupportsQuery({
8496
+ transition: `${transition},${getTransition('overlay', 'short', isOpen ? 'in' : 'out')} allow-discrete,${getTransition('display', 'short', isOpen ? 'in' : 'out')} allow-discrete`,
8497
+ }),
8498
+ // Unlike `opacity` (driven by the `isOpen` render flag), `overlay` and `display` are toggled via the
8499
+ // `:popover-open` UA state instead of `isOpen`. Both are owned by the browser: they only flip once
8500
+ // `showPopover()` / `hidePopover()` actually promote/remove the element to/from the #top-layer. Driving them
8501
+ // from `isOpen` would desync from that native state — e.g. Safari/Firefox defer `hidePopover()` until the
8502
+ // fade-out ends (see `createTopLayerController`), so `display` must stay `grid` while `:popover-open` is still
8503
+ // truthy; an `isOpen`-based `display: none` would hide the panel instantly and kill the fade. Binding to
8504
+ // `:popover-open` keeps CSS in lockstep with the browser across all engines, while the Chromium-only
8505
+ // `allow-discrete` transition above animates the discrete `overlay`/`display` switch during the fade-out.
8506
+ overlay: 'none',
8507
+ display: 'none',
8508
+ '&:popover-open': {
8509
+ overlay: 'auto',
8510
+ display: 'grid',
8511
+ },
8512
+ ...forcedColorsMediaQuery({
8513
+ outline: '2px solid CanvasText',
8514
+ outlineOffset: '-2px',
8515
+ }),
8516
+ '&::backdrop': {
8517
+ display: 'none', // reset ua-style
8408
8518
  },
8409
8519
  },
8410
8520
  },
8411
- label: getHiddenTextJssStyle(),
8412
- icon: {
8413
- transform: 'translate3d(0,0,0)', // Fixes movement on hover in Safari
8414
- },
8415
8521
  arrow: {
8416
8522
  position: 'absolute',
8417
8523
  width: '24px',
8418
8524
  height: '12px',
8419
8525
  clipPath: 'polygon(50% 0, 100% 110%, 0 110%)',
8420
- background: ref(colorCanvas),
8526
+ background: 'inherit',
8421
8527
  ...forcedColorsMediaQuery({
8422
8528
  background: 'CanvasText',
8423
8529
  }),
8424
8530
  },
8425
- content: {
8426
- maxWidth: `min(calc(100dvw - ${POPOVER_SAFE_ZONE * 2}px), 48ch)`,
8427
- width: 'max-content', // ensures in older browsers correct width
8428
- boxSizing: 'border-box',
8429
- padding: `${ref(spacingStaticSm$1)} ${ref(spacingStaticMd)}`,
8430
- pointerEvents: 'auto',
8431
- borderRadius: ref(radiusXl),
8432
- background: ref(colorCanvas),
8433
- font: `${ref(fontWeightNormal$1)} ${ref(typescaleSm$1)} / ${ref(leadingNormal$1)} ${ref(fontPorscheNext$1)}`,
8434
- color: ref(colorPrimary),
8435
- ...forcedColorsMediaQuery({
8436
- outline: '2px solid CanvasText',
8437
- outlineOffset: '-2px',
8438
- }),
8439
- },
8440
8531
  });
8532
+ // Fade-IN: `@starting-style` supplies the opacity the browser transitions *from* on the first rendered frame, i.e. the
8533
+ // moment the panel leaves `display: none` via `:popover-open` (triggered by `showPopover()`). Without it the panel
8534
+ // snaps to full opacity, because its computed `opacity` is already `1` by the time it is promoted out of `display:
8535
+ // none`. The fade-OUT needs no starting style (a rendered prior state already exists). Appended as raw CSS because the
8536
+ // JSS conditional-rule plugin only supports `@media`/`@supports`/`@container`, not `@starting-style`. Unsupported
8537
+ // engines (< Chromium 117 / Safari 17.5 / Firefox 129) ignore the unknown at-rule and skip the entry fade (graceful
8538
+ // degradation). Formatting mirrors JSS output so the unit-test CSS parser can read it.
8539
+ //
8540
+ // ALTERNATIVE APPROACH (not implemented) — mirror the `dialog-base` (p-modal/p-flyout) pattern and drop `@starting-style`:
8541
+ // • Keep the panel permanently rendered (never `display: none`); collapse the closed state via `visibility: hidden`
8542
+ // + `width/height: 0` instead. Because the element stays rendered, `opacity` fades normally in BOTH directions with
8543
+ // no `@starting-style`, and an initial `open=true` computes straight to `opacity: 1` (appears instantly, no entry
8544
+ // fade) — which fixes the one downside of the current approach (initial `open=true` fades in on page load).
8545
+ // • Caveat: drive `visibility` + `width/height` from the `isOpen` flag with a CLOSE-ONLY delayed transition
8546
+ // (`… 0s linear ${isOpen ? '0s' : motionDurationMap.short}`), NOT from `:popover-open`. `:popover-open` drops
8547
+ // immediately on Chromium (only Safari/FF defer `hidePopover()`), so `:popover-open`-bound dimensions would collapse
8548
+ // to 0 at the START of the Chromium fade-out and clip the panel mid-fade. The delay keeps size/visibility through
8549
+ // the fade and collapses them only afterwards. `:popover-open` then remains solely for `overlay` + the Chromium
8550
+ // `allow-discrete` top-layer retention.
8551
+ // • `visibility: hidden` still occupies layout (can cause scrollbars), which is why it must be paired with
8552
+ // `width/height: 0`. `inert` is still required either way (visibility is delayed, so the panel stays visible/
8553
+ // tabbable during the fade-out).
8554
+ // • Trade-off: removes the `@starting-style` raw-CSS append + the initial-load fade, at the cost of reintroducing the
8555
+ // delayed `visibility` plus delayed `width/height` and tighter coupling to the motion duration.
8556
+ return isOpen ? `${css}\n@starting-style {\n [popover] {\n opacity: 0;\n }\n}` : css;
8441
8557
  };
8442
8558
 
8443
8559
  const cssVarInternalRadioGroupOptionScaling = '--_p-radio-group-option-a';
@@ -3482,7 +3482,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3482
3482
  'showPicker' in HTMLInputElement.prototype &&
3483
3483
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3484
3484
 
3485
- const prefix = `[Porsche Design System v${"4.3.0"}]` // this part isn't covered by unit tests
3485
+ const prefix = `[Porsche Design System v${"4.4.0-rc.0"}]` // this part isn't covered by unit tests
3486
3486
  ;
3487
3487
  const consoleError$1 = (...messages) => {
3488
3488
  console.error(prefix, ...messages);