@porsche-design-system/components-react 3.32.1-rc.0 → 3.33.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,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [3.33.0-rc.0] - 2026-03-04
18
+
19
+ ### Added
20
+
21
+ - `Tag`: new `variant` property to define background colors which complies now with PDS `v4`
22
+ ([#4227](https://github.com/porsche-design-system/porsche-design-system/pull/4227))
23
+
24
+ ### Changed
25
+
26
+ - `Tag`: deprecated `color` property, use `variant` property instead to define background colors which complies now with
27
+ PDS `v4` ([#4227](https://github.com/porsche-design-system/porsche-design-system/pull/4227))
28
+
29
+ ## [3.32.1] - 2026-02-24
30
+
17
31
  ## [3.32.1-rc.0] - 2026-02-20
18
32
 
19
33
  ### Fixed
@@ -6,13 +6,13 @@ var react = require('react');
6
6
  var hooks = require('../../hooks.cjs');
7
7
  var utils = require('../../utils.cjs');
8
8
 
9
- const PTag = /*#__PURE__*/ react.forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, className, ...rest }, ref) => {
9
+ const PTag = /*#__PURE__*/ react.forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, variant, className, ...rest }, ref) => {
10
10
  const elementRef = react.useRef(undefined);
11
11
  const WebComponentTag = hooks.usePrefix('p-tag');
12
- const propsToSync = [color, compact, icon, iconSource, theme || hooks.useTheme()];
12
+ const propsToSync = [color, compact, icon, iconSource, theme || hooks.useTheme(), variant];
13
13
  hooks.useBrowserLayoutEffect(() => {
14
14
  const { current } = elementRef;
15
- ['color', 'compact', 'icon', 'iconSource', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
15
+ ['color', 'compact', 'icon', 'iconSource', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
16
  }, propsToSync);
17
17
  const props = {
18
18
  ...rest,
@@ -1,8 +1,8 @@
1
1
  import type { BaseProps } from '../../BaseProps';
2
- import type { TagColor, TagIcon, Theme } from '../types';
2
+ import type { TagColor, TagIcon, Theme, TagVariant } from '../types';
3
3
  export type PTagProps = BaseProps & {
4
4
  /**
5
- * Background color variations depending on theme property.
5
+ * @deprecated since v3.33.0, will be removed with next major release. Use `variant` prop instead. Background color variations depending on theme property.
6
6
  */
7
7
  color?: TagColor;
8
8
  /**
@@ -21,10 +21,14 @@ export type PTagProps = BaseProps & {
21
21
  * Adapts the tag color depending on the theme.
22
22
  */
23
23
  theme?: Theme;
24
+ /**
25
+ * Background color variations.
26
+ */
27
+ variant?: TagVariant;
24
28
  };
25
29
  export declare const PTag: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
26
30
  /**
27
- * Background color variations depending on theme property.
31
+ * @deprecated since v3.33.0, will be removed with next major release. Use `variant` prop instead. Background color variations depending on theme property.
28
32
  */
29
33
  color?: TagColor;
30
34
  /**
@@ -43,6 +47,10 @@ export declare const PTag: import("react").ForwardRefExoticComponent<Omit<import
43
47
  * Adapts the tag color depending on the theme.
44
48
  */
45
49
  theme?: Theme;
50
+ /**
51
+ * Background color variations.
52
+ */
53
+ variant?: TagVariant;
46
54
  } & {
47
55
  children?: import("react").ReactNode | undefined;
48
56
  } & import("react").RefAttributes<HTMLElement>>;
@@ -4,13 +4,13 @@ import { forwardRef, useRef } from 'react';
4
4
  import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
5
5
  import { syncRef } from '../../utils.mjs';
6
6
 
7
- const PTag = /*#__PURE__*/ forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, className, ...rest }, ref) => {
7
+ const PTag = /*#__PURE__*/ forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, variant, className, ...rest }, ref) => {
8
8
  const elementRef = useRef(undefined);
9
9
  const WebComponentTag = usePrefix('p-tag');
10
- const propsToSync = [color, compact, icon, iconSource, theme || useTheme()];
10
+ const propsToSync = [color, compact, icon, iconSource, theme || useTheme(), variant];
11
11
  useBrowserLayoutEffect(() => {
12
12
  const { current } = elementRef;
13
- ['color', 'compact', 'icon', 'iconSource', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
13
+ ['color', 'compact', 'icon', 'iconSource', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
14
14
  }, propsToSync);
15
15
  const props = {
16
16
  ...rest,
@@ -1644,6 +1644,15 @@ declare const TAG_DISMISSIBLE_ARIA_ATTRIBUTES: readonly [
1644
1644
  ];
1645
1645
  export type TagDismissibleAriaAttribute = (typeof TAG_DISMISSIBLE_ARIA_ATTRIBUTES)[number];
1646
1646
  export type TagIcon = IconName;
1647
+ declare const TAG_VARIANTS: readonly [
1648
+ "primary",
1649
+ "secondary",
1650
+ "info",
1651
+ "warning",
1652
+ "success",
1653
+ "error"
1654
+ ];
1655
+ export type TagVariant = (typeof TAG_VARIANTS)[number];
1647
1656
  declare const TAG_COLORS: readonly [
1648
1657
  "background-base",
1649
1658
  "background-surface",
@@ -1660,6 +1669,7 @@ declare const TAG_COLORS: readonly [
1660
1669
  "notification-success",
1661
1670
  "notification-error"
1662
1671
  ];
1672
+ /** @deprecated */
1663
1673
  export type TagColor = (typeof TAG_COLORS)[number];
1664
1674
  declare const TEXT_TAGS: readonly [
1665
1675
  "p",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porsche-design-system/components-react",
3
- "version": "3.32.1-rc.0",
3
+ "version": "3.33.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",
@@ -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.32.1-rc.0"
20
+ "@porsche-design-system/components-js": "3.33.0-rc.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "ag-grid-community": ">= 35.0.0 <36.0.0",
@@ -3643,7 +3643,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3643
3643
  'showPicker' in HTMLInputElement.prototype &&
3644
3644
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3645
3645
 
3646
- const prefix = `[Porsche Design System v${"3.32.1-rc.0"}]` // this part isn't covered by unit tests
3646
+ const prefix = `[Porsche Design System v${"3.33.0-rc.0"}]` // this part isn't covered by unit tests
3647
3647
  ;
3648
3648
  const consoleError = (...messages) => {
3649
3649
  console.error(prefix, ...messages); // eslint-disable-line no-console
@@ -6277,6 +6277,7 @@ const getFunctionalComponentInputBaseStyles = (disabled, loading, hideLabel, sta
6277
6277
  [`${cssVarButtonPurePadding}`]: `calc(1px * ${buttonCompensation})`,
6278
6278
  [`${cssVarButtonPureMargin}`]: `calc(-1px * ${buttonCompensation})`,
6279
6279
  }),
6280
+ // Alignment and direction of placeholder is set always to the right in RTL mode, because it is expected to have rtl language as placeholder value
6280
6281
  '&(:dir(rtl)) input::placeholder': {
6281
6282
  direction: 'rtl',
6282
6283
  textAlign: 'end',
@@ -8231,7 +8232,11 @@ const getComponentCss$X = (disabled, loading, hideLabel, state, compact, readOnl
8231
8232
  '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
8232
8233
  WebkitAppearance: 'none',
8233
8234
  },
8234
- }, {
8235
+ },
8236
+ // Overwrites direction to ltr for rtl languages to prevent issues with the email input, e.g. cursor jumping to the
8237
+ // end of the input when typing in the middle of the text. This is necessary because email addresses are assumed
8238
+ // to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
8239
+ {
8235
8240
  '&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
8236
8241
  direction: 'ltr',
8237
8242
  },
@@ -8370,7 +8375,11 @@ const getComponentCss$S = (disabled, loading, hideLabel, state, compact, readOnl
8370
8375
  '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
8371
8376
  WebkitAppearance: 'none',
8372
8377
  },
8373
- }, {
8378
+ },
8379
+ // Overwrites direction to ltr for rtl languages to prevent issues with the tel input, e.g. cursor jumping to the
8380
+ // end of the input when typing in the middle of the text. This is necessary because tel values are assumed
8381
+ // to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
8382
+ {
8374
8383
  '&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
8375
8384
  direction: 'ltr',
8376
8385
  },
@@ -8455,7 +8464,11 @@ const getComponentCss$P = (disabled, loading, hideLabel, state, compact, readOnl
8455
8464
  '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
8456
8465
  WebkitAppearance: 'none',
8457
8466
  },
8458
- }, {
8467
+ },
8468
+ // Overwrites direction to ltr for rtl languages to prevent issues with the url input, e.g. cursor jumping to the
8469
+ // end of the input when typing in the middle of the text. This is necessary because url addresses are assumed
8470
+ // to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
8471
+ {
8459
8472
  '&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
8460
8473
  direction: 'ltr',
8461
8474
  },
@@ -3446,7 +3446,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3446
3446
  'showPicker' in HTMLInputElement.prototype &&
3447
3447
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3448
3448
 
3449
- const prefix = `[Porsche Design System v${"3.32.1-rc.0"}]` // this part isn't covered by unit tests
3449
+ const prefix = `[Porsche Design System v${"3.33.0-rc.0"}]` // this part isn't covered by unit tests
3450
3450
  ;
3451
3451
  const consoleError$1 = (...messages) => {
3452
3452
  console.error(prefix, ...messages); // eslint-disable-line no-console
@@ -3974,6 +3974,14 @@ const getSwitchButtonAriaAttributes = (isDisabled, isLoading, isChecked) => {
3974
3974
  const isSortable = (active, direction) => {
3975
3975
  return active !== undefined && direction !== undefined;
3976
3976
  };
3977
+ const VARIANT_TO_COLOR_MAP = {
3978
+ primary: 'primary',
3979
+ secondary: 'background-frosted',
3980
+ info: 'notification-info-soft',
3981
+ warning: 'notification-warning-soft',
3982
+ success: 'notification-success-soft',
3983
+ error: 'notification-error-soft',
3984
+ };
3977
3985
  const isType = (inputType, typeToValidate) => inputType === typeToValidate;
3978
3986
  const hasLocateAction = (icon) => icon === 'locate';
3979
3987
  const showCustomCalendarOrTimeIndicator = (isCalendar, isTime) => {
@@ -3993,6 +4001,7 @@ exports.DISPLAY_TAGS = DISPLAY_TAGS;
3993
4001
  exports.HEADING_TAGS = HEADING_TAGS;
3994
4002
  exports.HEADLINE_TAGS = HEADLINE_TAGS;
3995
4003
  exports.TEXT_TAGS = TEXT_TAGS;
4004
+ exports.VARIANT_TO_COLOR_MAP = VARIANT_TO_COLOR_MAP;
3996
4005
  exports.anchorSlot = anchorSlot;
3997
4006
  exports.attributeMutationMap = attributeMutationMap;
3998
4007
  exports.buildCrestImgSrc = buildCrestImgSrc;
@@ -7,20 +7,20 @@ var hooks = require('../../hooks.cjs');
7
7
  var utils = require('../../utils.cjs');
8
8
  var tag = require('../dsr-components/tag.cjs');
9
9
 
10
- const PTag = /*#__PURE__*/ react.forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, className, children, ...rest }, ref) => {
10
+ const PTag = /*#__PURE__*/ react.forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, variant, className, children, ...rest }, ref) => {
11
11
  const elementRef = react.useRef(undefined);
12
12
  const WebComponentTag = hooks.usePrefix('p-tag');
13
- const propsToSync = [color, compact, icon, iconSource, theme || hooks.useTheme()];
13
+ const propsToSync = [color, compact, icon, iconSource, theme || hooks.useTheme(), variant];
14
14
  hooks.useBrowserLayoutEffect(() => {
15
15
  const { current } = elementRef;
16
- ['color', 'compact', 'icon', 'iconSource', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
16
+ ['color', 'compact', 'icon', 'iconSource', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
17
17
  }, propsToSync);
18
18
  const props = {
19
19
  ...rest,
20
20
  // @ts-ignore
21
21
  ...(!process.browser
22
22
  ? {
23
- children: (jsxRuntime.jsx(tag.DSRTag, { color, compact, icon, iconSource, theme: theme || hooks.useTheme(), children })),
23
+ children: (jsxRuntime.jsx(tag.DSRTag, { color, compact, icon, iconSource, theme: theme || hooks.useTheme(), variant, children })),
24
24
  }
25
25
  : {
26
26
  children,
@@ -21,7 +21,8 @@ id, label: label$1, description, loading, initialLoading, required, disabled, st
21
21
  // refElement,
22
22
  start, end, }) => {
23
23
  const { namedSlotChildren } = splitChildren.splitChildren(children);
24
- return (jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.Label, { hasLabel: !!label$1 || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label$1, description: description, htmlFor: id, isRequired: required, isLoading: loading, isDisabled: disabled }), jsxRuntime.jsxs("div", { className: "wrapper", children: [jsxRuntime.jsx("slot", { name: "start" }), start, jsxRuntime.jsx("input", { "aria-describedby": loading ? loadingMessage.loadingId : `${utilsEntry.descriptionId} ${stateMessage.messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": disabled || loading ? 'true' : null, "aria-readonly": readOnly ? 'true' : null, id: id, name: name, form: form, type: type, required: required, placeholder: placeholder || null, maxLength: maxLength, minLength: minLength, spellCheck: spellCheck, max: max, min: min, step: step, defaultValue: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled, pattern: pattern, multiple: multiple, dir: "auto" }), end, jsxRuntime.jsx("slot", { name: "end" }), loading && jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", theme: theme, "aria-hidden": "true" })] }), jsxRuntime.jsx(stateMessage.StateMessage, { hasMessage: (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state), state: state, message: message, theme: theme, host: null }), jsxRuntime.jsx(loadingMessage.LoadingMessage, { loading: loading, initialLoading: initialLoading })] }));
24
+ return (jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.Label, { hasLabel: !!label$1 || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label$1, description: description, htmlFor: id, isRequired: required, isLoading: loading, isDisabled: disabled }), jsxRuntime.jsxs("div", { className: "wrapper", children: [jsxRuntime.jsx("slot", { name: "start" }), start, jsxRuntime.jsx("input", { "aria-describedby": loading ? loadingMessage.loadingId : `${utilsEntry.descriptionId} ${stateMessage.messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": disabled || loading ? 'true' : null, "aria-readonly": readOnly ? 'true' : null, id: id, name: name, form: form, type: type, required: required, placeholder: placeholder || null, maxLength: maxLength, minLength: minLength, spellCheck: spellCheck, max: max, min: min, step: step, defaultValue: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled, pattern: pattern, multiple: multiple, dir: "auto" // This is the default: let the browser decide in which direction the value should be placed.
25
+ }), end, jsxRuntime.jsx("slot", { name: "end" }), loading && jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", theme: theme, "aria-hidden": "true" })] }), jsxRuntime.jsx(stateMessage.StateMessage, { hasMessage: (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state), state: state, message: message, theme: theme, host: null }), jsxRuntime.jsx(loadingMessage.LoadingMessage, { loading: loading, initialLoading: initialLoading })] }));
25
26
  };
26
27
 
27
28
  exports.InputBase = InputBase;
@@ -25,7 +25,11 @@ class DSRTag extends react.Component {
25
25
  'notification-success': 'notification-success-soft',
26
26
  'notification-error': 'notification-error-soft',
27
27
  };
28
- const style = minifyCss.minifyCss(stylesEntry.getTagCss((deprecationMap[this.props.color] || this.props.color), this.props.compact, !!utilsEntry.getDirectChildHTMLElement(null, 'a,button'), hasIcon, this.props.theme));
28
+ // Resolve effective color: variant takes precedence over color
29
+ const resolvedColor = this.props.variant
30
+ ? utilsEntry.VARIANT_TO_COLOR_MAP[this.props.variant]
31
+ : (deprecationMap[this.props.color] || this.props.color);
32
+ const style = minifyCss.minifyCss(stylesEntry.getTagCss(resolvedColor, this.props.compact, !!utilsEntry.getDirectChildHTMLElement(null, 'a,button'), hasIcon, this.props.theme));
29
33
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("span", { children: [hasIcon && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: this.props.icon, source: this.props.iconSource, color: "primary", size: "x-small", theme: this.props.theme, "aria-hidden": "true" })), jsxRuntime.jsx("slot", {})] })] }), this.props.children] }));
30
34
  }
31
35
  }
@@ -3641,7 +3641,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3641
3641
  'showPicker' in HTMLInputElement.prototype &&
3642
3642
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3643
3643
 
3644
- const prefix = `[Porsche Design System v${"3.32.1-rc.0"}]` // this part isn't covered by unit tests
3644
+ const prefix = `[Porsche Design System v${"3.33.0-rc.0"}]` // this part isn't covered by unit tests
3645
3645
  ;
3646
3646
  const consoleError = (...messages) => {
3647
3647
  console.error(prefix, ...messages); // eslint-disable-line no-console
@@ -6275,6 +6275,7 @@ const getFunctionalComponentInputBaseStyles = (disabled, loading, hideLabel, sta
6275
6275
  [`${cssVarButtonPurePadding}`]: `calc(1px * ${buttonCompensation})`,
6276
6276
  [`${cssVarButtonPureMargin}`]: `calc(-1px * ${buttonCompensation})`,
6277
6277
  }),
6278
+ // Alignment and direction of placeholder is set always to the right in RTL mode, because it is expected to have rtl language as placeholder value
6278
6279
  '&(:dir(rtl)) input::placeholder': {
6279
6280
  direction: 'rtl',
6280
6281
  textAlign: 'end',
@@ -8229,7 +8230,11 @@ const getComponentCss$X = (disabled, loading, hideLabel, state, compact, readOnl
8229
8230
  '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
8230
8231
  WebkitAppearance: 'none',
8231
8232
  },
8232
- }, {
8233
+ },
8234
+ // Overwrites direction to ltr for rtl languages to prevent issues with the email input, e.g. cursor jumping to the
8235
+ // end of the input when typing in the middle of the text. This is necessary because email addresses are assumed
8236
+ // to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
8237
+ {
8233
8238
  '&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
8234
8239
  direction: 'ltr',
8235
8240
  },
@@ -8368,7 +8373,11 @@ const getComponentCss$S = (disabled, loading, hideLabel, state, compact, readOnl
8368
8373
  '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
8369
8374
  WebkitAppearance: 'none',
8370
8375
  },
8371
- }, {
8376
+ },
8377
+ // Overwrites direction to ltr for rtl languages to prevent issues with the tel input, e.g. cursor jumping to the
8378
+ // end of the input when typing in the middle of the text. This is necessary because tel values are assumed
8379
+ // to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
8380
+ {
8372
8381
  '&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
8373
8382
  direction: 'ltr',
8374
8383
  },
@@ -8453,7 +8462,11 @@ const getComponentCss$P = (disabled, loading, hideLabel, state, compact, readOnl
8453
8462
  '&::-webkit-inner-spin-button, &::-webkit-outer-spin-button': {
8454
8463
  WebkitAppearance: 'none',
8455
8464
  },
8456
- }, {
8465
+ },
8466
+ // Overwrites direction to ltr for rtl languages to prevent issues with the url input, e.g. cursor jumping to the
8467
+ // end of the input when typing in the middle of the text. This is necessary because url addresses are assumed
8468
+ // to be always written in ltr direction and the input needs to accommodate that, even in rtl contexts.
8469
+ {
8457
8470
  '&(:dir(rtl)) .wrapper, &(:dir(rtl)) input:placeholder-shown': {
8458
8471
  direction: 'ltr',
8459
8472
  },
@@ -3444,7 +3444,7 @@ const hasShowPickerSupport = () => (hasDocument &&
3444
3444
  'showPicker' in HTMLInputElement.prototype &&
3445
3445
  CSS.supports('selector(::-webkit-calendar-picker-indicator)'));
3446
3446
 
3447
- const prefix = `[Porsche Design System v${"3.32.1-rc.0"}]` // this part isn't covered by unit tests
3447
+ const prefix = `[Porsche Design System v${"3.33.0-rc.0"}]` // this part isn't covered by unit tests
3448
3448
  ;
3449
3449
  const consoleError$1 = (...messages) => {
3450
3450
  console.error(prefix, ...messages); // eslint-disable-line no-console
@@ -3972,6 +3972,14 @@ const getSwitchButtonAriaAttributes = (isDisabled, isLoading, isChecked) => {
3972
3972
  const isSortable = (active, direction) => {
3973
3973
  return active !== undefined && direction !== undefined;
3974
3974
  };
3975
+ const VARIANT_TO_COLOR_MAP = {
3976
+ primary: 'primary',
3977
+ secondary: 'background-frosted',
3978
+ info: 'notification-info-soft',
3979
+ warning: 'notification-warning-soft',
3980
+ success: 'notification-success-soft',
3981
+ error: 'notification-error-soft',
3982
+ };
3975
3983
  const isType = (inputType, typeToValidate) => inputType === typeToValidate;
3976
3984
  const hasLocateAction = (icon) => icon === 'locate';
3977
3985
  const showCustomCalendarOrTimeIndicator = (isCalendar, isTime) => {
@@ -3987,4 +3995,4 @@ const getTextTagType = (host, tag) => {
3987
3995
  return tag;
3988
3996
  };
3989
3997
 
3990
- export { DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, ItemType, TEXT_TAGS, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, buildImgSrc, buildSrcSet, consoleError$1 as consoleError, createPaginationItems, createRange, crestSize, descriptionId, displaySizeToTagMap, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getClosestHTMLElement, getComboboxAriaAttributes, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getHeadlineTagType, getIconColor, getInlineNotificationIconName, getInnerManifest, getSegmentedControlItemAriaAttributes, getSelectedOptionMap, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasLocateAction, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, internalDrilldown, isCurrentInput, isCustomDropdown, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isTouchDevice, isType, isUrl, isWithinForm, labelId, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, scrollAreaClass, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateDrilldownItemState };
3998
+ export { DISPLAY_TAGS, HEADING_TAGS, HEADLINE_TAGS, ItemType, TEXT_TAGS, VARIANT_TO_COLOR_MAP, anchorSlot, attributeMutationMap, buildCrestImgSrc, buildCrestSrcSet, buildFlagUrl, buildIconUrl, buildImgSrc, buildSrcSet, consoleError$1 as consoleError, createPaginationItems, createRange, crestSize, descriptionId, displaySizeToTagMap, getButtonAriaAttributes, getButtonBaseAriaAttributes, getButtonPureAriaAttributes, getCDNBaseURL, getClosestHTMLElement, getComboboxAriaAttributes, getContentAriaAttributes, getCurrentActivePage, getDirectChildHTMLElement, getDisplayTagType, getFieldsetAriaAttributes, getHTMLElement, getHasNativePopoverSupport, getHeadingTagType, getHeadlineTagType, getIconColor, getInlineNotificationIconName, getInnerManifest, getSegmentedControlItemAriaAttributes, getSelectedOptionMap, getStepperHorizontalIconName, getSvgUrl, getSwitchButtonAriaAttributes, getTagName, getTagNameWithoutPrefix, getTextTagType, getTotalPages, hasDocument, hasLocateAction, hasShowPickerSupport, hasSpecificDirectChildTag, hasVisibleIcon, hasWindow$1 as hasWindow, headerSlot, internalDrilldown, isCurrentInput, isCustomDropdown, isDisabledOrLoading, isElementOfKind, isInfinitePagination, isListTypeOrdered, isScrollable, isSortable, isStateCompleteOrWarning, isTouchDevice, isType, isUrl, isWithinForm, labelId, observedNodesMap, parseAndGetAriaAttributes, parseJSONAttribute, scrollAreaClass, showCustomCalendarOrTimeIndicator, supportsConstructableStylesheets, supportsNativePopover, tempDiv, tempIcon, tempLabel, traverseTreeAndUpdateState, updateDrilldownItemState };
@@ -5,20 +5,20 @@ import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../
5
5
  import { syncRef } from '../../utils.mjs';
6
6
  import { DSRTag } from '../dsr-components/tag.mjs';
7
7
 
8
- const PTag = /*#__PURE__*/ forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, className, children, ...rest }, ref) => {
8
+ const PTag = /*#__PURE__*/ forwardRef(({ color = 'background-surface', compact = false, icon, iconSource, theme, variant, className, children, ...rest }, ref) => {
9
9
  const elementRef = useRef(undefined);
10
10
  const WebComponentTag = usePrefix('p-tag');
11
- const propsToSync = [color, compact, icon, iconSource, theme || useTheme()];
11
+ const propsToSync = [color, compact, icon, iconSource, theme || useTheme(), variant];
12
12
  useBrowserLayoutEffect(() => {
13
13
  const { current } = elementRef;
14
- ['color', 'compact', 'icon', 'iconSource', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
14
+ ['color', 'compact', 'icon', 'iconSource', 'theme', 'variant'].forEach((propName, i) => (current[propName] = propsToSync[i]));
15
15
  }, propsToSync);
16
16
  const props = {
17
17
  ...rest,
18
18
  // @ts-ignore
19
19
  ...(!process.browser
20
20
  ? {
21
- children: (jsx(DSRTag, { color, compact, icon, iconSource, theme: theme || useTheme(), children })),
21
+ children: (jsx(DSRTag, { color, compact, icon, iconSource, theme: theme || useTheme(), variant, children })),
22
22
  }
23
23
  : {
24
24
  children,
@@ -19,7 +19,8 @@ id, label, description, loading, initialLoading, required, disabled, state, mess
19
19
  // refElement,
20
20
  start, end, }) => {
21
21
  const { namedSlotChildren } = splitChildren(children);
22
- return (jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: !!label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label, description: description, htmlFor: id, isRequired: required, isLoading: loading, isDisabled: disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", { name: "start" }), start, jsx("input", { "aria-describedby": loading ? loadingId : `${descriptionId} ${messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": disabled || loading ? 'true' : null, "aria-readonly": readOnly ? 'true' : null, id: id, name: name, form: form, type: type, required: required, placeholder: placeholder || null, maxLength: maxLength, minLength: minLength, spellCheck: spellCheck, max: max, min: min, step: step, defaultValue: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled, pattern: pattern, multiple: multiple, dir: "auto" }), end, jsx("slot", { name: "end" }), loading && jsx(PSpinner, { className: "spinner", size: "inherit", theme: theme, "aria-hidden": "true" })] }), jsx(StateMessage, { hasMessage: (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state), state: state, message: message, theme: theme, host: null }), jsx(LoadingMessage, { loading: loading, initialLoading: initialLoading })] }));
22
+ return (jsxs("div", { className: "root", children: [jsx(Label, { hasLabel: !!label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label, description: description, htmlFor: id, isRequired: required, isLoading: loading, isDisabled: disabled }), jsxs("div", { className: "wrapper", children: [jsx("slot", { name: "start" }), start, jsx("input", { "aria-describedby": loading ? loadingId : `${descriptionId} ${messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": disabled || loading ? 'true' : null, "aria-readonly": readOnly ? 'true' : null, id: id, name: name, form: form, type: type, required: required, placeholder: placeholder || null, maxLength: maxLength, minLength: minLength, spellCheck: spellCheck, max: max, min: min, step: step, defaultValue: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled, pattern: pattern, multiple: multiple, dir: "auto" // This is the default: let the browser decide in which direction the value should be placed.
23
+ }), end, jsx("slot", { name: "end" }), loading && jsx(PSpinner, { className: "spinner", size: "inherit", theme: theme, "aria-hidden": "true" })] }), jsx(StateMessage, { hasMessage: (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state), state: state, message: message, theme: theme, host: null }), jsx(LoadingMessage, { loading: loading, initialLoading: initialLoading })] }));
23
24
  };
24
25
 
25
26
  export { InputBase };
@@ -4,7 +4,7 @@ import '../../provider.mjs';
4
4
  import { splitChildren } from '../../splitChildren.mjs';
5
5
  import { minifyCss } from '../../minifyCss.mjs';
6
6
  import { getTagCss as getComponentCss$9 } from '../../../../../../components/dist/styles/esm/styles-entry.mjs';
7
- import { getDirectChildHTMLElement } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
7
+ import { VARIANT_TO_COLOR_MAP, getDirectChildHTMLElement } from '../../../../../../components/dist/utils/esm/utils-entry.mjs';
8
8
  import { PIcon } from '../components/icon.wrapper.mjs';
9
9
 
10
10
  /**
@@ -23,7 +23,11 @@ class DSRTag extends Component {
23
23
  'notification-success': 'notification-success-soft',
24
24
  'notification-error': 'notification-error-soft',
25
25
  };
26
- const style = minifyCss(getComponentCss$9((deprecationMap[this.props.color] || this.props.color), this.props.compact, !!getDirectChildHTMLElement(null, 'a,button'), hasIcon, this.props.theme));
26
+ // Resolve effective color: variant takes precedence over color
27
+ const resolvedColor = this.props.variant
28
+ ? VARIANT_TO_COLOR_MAP[this.props.variant]
29
+ : (deprecationMap[this.props.color] || this.props.color);
30
+ const style = minifyCss(getComponentCss$9(resolvedColor, this.props.compact, !!getDirectChildHTMLElement(null, 'a,button'), hasIcon, this.props.theme));
27
31
  return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("span", { children: [hasIcon && (jsx(PIcon, { className: "icon", name: this.props.icon, source: this.props.iconSource, color: "primary", size: "x-small", theme: this.props.theme, "aria-hidden": "true" })), jsx("slot", {})] })] }), this.props.children] }));
28
32
  }
29
33
  }
@@ -1,8 +1,8 @@
1
1
  import type { BaseProps } from '../../BaseProps';
2
- import type { TagColor, TagIcon, Theme } from '../types';
2
+ import type { TagColor, TagIcon, Theme, TagVariant } from '../types';
3
3
  export type PTagProps = BaseProps & {
4
4
  /**
5
- * Background color variations depending on theme property.
5
+ * @deprecated since v3.33.0, will be removed with next major release. Use `variant` prop instead. Background color variations depending on theme property.
6
6
  */
7
7
  color?: TagColor;
8
8
  /**
@@ -21,10 +21,14 @@ export type PTagProps = BaseProps & {
21
21
  * Adapts the tag color depending on the theme.
22
22
  */
23
23
  theme?: Theme;
24
+ /**
25
+ * Background color variations.
26
+ */
27
+ variant?: TagVariant;
24
28
  };
25
29
  export declare const PTag: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
26
30
  /**
27
- * Background color variations depending on theme property.
31
+ * @deprecated since v3.33.0, will be removed with next major release. Use `variant` prop instead. Background color variations depending on theme property.
28
32
  */
29
33
  color?: TagColor;
30
34
  /**
@@ -43,6 +47,10 @@ export declare const PTag: import("react").ForwardRefExoticComponent<Omit<import
43
47
  * Adapts the tag color depending on the theme.
44
48
  */
45
49
  theme?: Theme;
50
+ /**
51
+ * Background color variations.
52
+ */
53
+ variant?: TagVariant;
46
54
  } & {
47
55
  children?: import("react").ReactNode | undefined;
48
56
  } & import("react").RefAttributes<HTMLElement>>;
@@ -1644,6 +1644,15 @@ declare const TAG_DISMISSIBLE_ARIA_ATTRIBUTES: readonly [
1644
1644
  ];
1645
1645
  export type TagDismissibleAriaAttribute = (typeof TAG_DISMISSIBLE_ARIA_ATTRIBUTES)[number];
1646
1646
  export type TagIcon = IconName;
1647
+ declare const TAG_VARIANTS: readonly [
1648
+ "primary",
1649
+ "secondary",
1650
+ "info",
1651
+ "warning",
1652
+ "success",
1653
+ "error"
1654
+ ];
1655
+ export type TagVariant = (typeof TAG_VARIANTS)[number];
1647
1656
  declare const TAG_COLORS: readonly [
1648
1657
  "background-base",
1649
1658
  "background-surface",
@@ -1660,6 +1669,7 @@ declare const TAG_COLORS: readonly [
1660
1669
  "notification-success",
1661
1670
  "notification-error"
1662
1671
  ];
1672
+ /** @deprecated */
1663
1673
  export type TagColor = (typeof TAG_COLORS)[number];
1664
1674
  declare const TEXT_TAGS: readonly [
1665
1675
  "p",