@porsche-design-system/components-react 3.4.0 → 3.5.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 +14 -0
- package/esm/lib/components/button-tile.wrapper.js +3 -3
- package/esm/lib/components/link-tile.wrapper.js +3 -3
- package/esm/lib/components/segmented-control.wrapper.js +3 -3
- package/lib/components/button-tile.wrapper.d.ts +9 -1
- package/lib/components/button-tile.wrapper.js +3 -3
- package/lib/components/grid-item.wrapper.d.ts +2 -2
- package/lib/components/link-tile.wrapper.d.ts +9 -1
- package/lib/components/link-tile.wrapper.js +3 -3
- package/lib/components/segmented-control.wrapper.d.ts +9 -1
- package/lib/components/segmented-control.wrapper.js +3 -3
- package/lib/types.d.ts +10 -5
- package/package.json +2 -2
- package/ssr/components/dist/styles/esm/styles-entry.js +11 -4
- package/ssr/components/dist/utils/esm/utils-entry.js +1 -0
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/button-tile.wrapper.js +4 -4
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile.wrapper.js +4 -4
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.js +4 -4
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -2
- package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +1 -1
- package/ssr/esm/components/dist/styles/esm/styles-entry.js +11 -4
- package/ssr/esm/components/dist/utils/esm/utils-entry.js +1 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/button-tile.wrapper.js +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile.wrapper.js +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.js +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +1 -1
- package/ssr/lib/components/button-tile.wrapper.d.ts +9 -1
- package/ssr/lib/components/link-tile.wrapper.d.ts +9 -1
- package/ssr/lib/components/segmented-control.wrapper.d.ts +9 -1
- package/ssr/lib/types.d.ts +10 -5
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.5.0-rc.0] - 2023-07-21
|
|
18
|
+
|
|
19
|
+
#### Added
|
|
20
|
+
|
|
21
|
+
- `background` property to `Button Tile` and `Link Tile` component to adapt the description and link/button theme when
|
|
22
|
+
used on light background image ([#2669](https://github.com/porsche-design-system/porsche-design-system/pull/2669))
|
|
23
|
+
- Breakpoint customizable property `columns` to `Segmented Control` to set the amount of columns
|
|
24
|
+
([#2652](https://github.com/porsche-design-system/porsche-design-system/pull/2652))
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Alignment of `Icon` inside `Accordion` header
|
|
29
|
+
([#2673](https://github.com/porsche-design-system/porsche-design-system/pull/2673))
|
|
30
|
+
|
|
17
31
|
### [3.4.0] - 2023-07-14
|
|
18
32
|
|
|
19
33
|
### [3.4.0-rc.0] - 2023-07-13
|
|
@@ -4,13 +4,13 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.js';
|
|
5
5
|
import { syncRef } from '../../utils.js';
|
|
6
6
|
|
|
7
|
-
const PButtonTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
7
|
+
const PButtonTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
const WebComponentTag = usePrefix('p-button-tile');
|
|
10
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
10
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
11
11
|
useBrowserLayoutEffect(() => {
|
|
12
12
|
const { current } = elementRef;
|
|
13
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
13
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
14
|
}, propsToSync);
|
|
15
15
|
const props = {
|
|
16
16
|
...rest,
|
|
@@ -4,13 +4,13 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.js';
|
|
5
5
|
import { syncRef } from '../../utils.js';
|
|
6
6
|
|
|
7
|
-
const PLinkTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
7
|
+
const PLinkTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
const WebComponentTag = usePrefix('p-link-tile');
|
|
10
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
10
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
11
11
|
useBrowserLayoutEffect(() => {
|
|
12
12
|
const { current } = elementRef;
|
|
13
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
13
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
14
|
}, propsToSync);
|
|
15
15
|
const props = {
|
|
16
16
|
...rest,
|
|
@@ -4,15 +4,15 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.js';
|
|
5
5
|
import { syncRef } from '../../utils.js';
|
|
6
6
|
|
|
7
|
-
const PSegmentedControl = forwardRef(({ backgroundColor, onSegmentedControlChange, onUpdate, theme = 'light', value, className, ...rest }, ref) => {
|
|
7
|
+
const PSegmentedControl = forwardRef(({ backgroundColor, columns = 'auto', onSegmentedControlChange, onUpdate, theme = 'light', value, className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef();
|
|
9
9
|
useEventCallback(elementRef, 'segmentedControlChange', onSegmentedControlChange);
|
|
10
10
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
11
11
|
const WebComponentTag = usePrefix('p-segmented-control');
|
|
12
|
-
const propsToSync = [backgroundColor, theme, value];
|
|
12
|
+
const propsToSync = [backgroundColor, columns, theme, value];
|
|
13
13
|
useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['backgroundColor', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['backgroundColor', 'columns', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { ButtonTileAlign, SelectedAriaAttributes, ButtonTileAriaAttribute, BreakpointCustomizable, ButtonTileAspectRatio, ButtonTileIcon, ButtonTileSize, ButtonTileType, ButtonTileWeight } from '../types';
|
|
2
|
+
import type { ButtonTileAlign, SelectedAriaAttributes, ButtonTileAriaAttribute, BreakpointCustomizable, ButtonTileAspectRatio, ButtonTileBackground, ButtonTileIcon, ButtonTileSize, ButtonTileType, ButtonTileWeight } from '../types';
|
|
3
3
|
export type PButtonTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Alignment of button and description.
|
|
@@ -13,6 +13,10 @@ export type PButtonTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
13
13
|
* Aspect ratio of the button-tile.
|
|
14
14
|
*/
|
|
15
15
|
aspectRatio?: BreakpointCustomizable<ButtonTileAspectRatio>;
|
|
16
|
+
/**
|
|
17
|
+
* Adapts the description and button theme when used on light background image.
|
|
18
|
+
*/
|
|
19
|
+
background?: ButtonTileBackground;
|
|
16
20
|
/**
|
|
17
21
|
* Displays the button-tile as compact version with description and button icon only.
|
|
18
22
|
*/
|
|
@@ -71,6 +75,10 @@ export declare const PButtonTile: import("react").ForwardRefExoticComponent<Omit
|
|
|
71
75
|
* Aspect ratio of the button-tile.
|
|
72
76
|
*/
|
|
73
77
|
aspectRatio?: BreakpointCustomizable<"1:1" | "4:3" | "3:4" | "16:9" | "9:16"> | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Adapts the description and button theme when used on light background image.
|
|
80
|
+
*/
|
|
81
|
+
background?: "light" | "dark" | undefined;
|
|
74
82
|
/**
|
|
75
83
|
* Displays the button-tile as compact version with description and button icon only.
|
|
76
84
|
*/
|
|
@@ -6,13 +6,13 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.js');
|
|
7
7
|
var utils = require('../../utils.js');
|
|
8
8
|
|
|
9
|
-
const PButtonTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
9
|
+
const PButtonTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
const WebComponentTag = hooks.usePrefix('p-button-tile');
|
|
12
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
12
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
13
13
|
hooks.useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -15,11 +15,11 @@ export declare const PGridItem: import("react").ForwardRefExoticComponent<Omit<H
|
|
|
15
15
|
/**
|
|
16
16
|
* The offset of the column. Can be between 0 and 11. Also defines the offset of the column for specific breakpoints, like {base: 6, l: 3}. You always need to provide a base value when doing this.
|
|
17
17
|
*/
|
|
18
|
-
offset?: BreakpointCustomizable<0 | 3 | 4 | 7 |
|
|
18
|
+
offset?: BreakpointCustomizable<0 | 3 | 4 | 7 | 2 | 5 | 1 | 6 | 8 | 9 | 10 | 11> | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* The size of the column. Can be between 1 and 12. Also defines the size of the column for specific breakpoints, like {base: 6, l: 3}. You always need to provide a base value when doing this.
|
|
21
21
|
*/
|
|
22
|
-
size?: BreakpointCustomizable<3 | 4 | 7 |
|
|
22
|
+
size?: BreakpointCustomizable<3 | 4 | 7 | 2 | 5 | 1 | 6 | 12 | 8 | 9 | 10 | 11> | undefined;
|
|
23
23
|
} & {
|
|
24
24
|
children?: import("react").ReactNode;
|
|
25
25
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { LinkTileAlign, SelectedAriaAttributes, LinkTileAriaAttribute, BreakpointCustomizable, LinkTileAspectRatio, LinkTileSize, LinkTileTarget, LinkTileWeight } from '../types';
|
|
2
|
+
import type { LinkTileAlign, SelectedAriaAttributes, LinkTileAriaAttribute, BreakpointCustomizable, LinkTileAspectRatio, LinkTileBackground, LinkTileSize, LinkTileTarget, LinkTileWeight } from '../types';
|
|
3
3
|
export type PLinkTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Alignment of link and description.
|
|
@@ -13,6 +13,10 @@ export type PLinkTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
13
13
|
* Aspect ratio of the link-tile.
|
|
14
14
|
*/
|
|
15
15
|
aspectRatio?: BreakpointCustomizable<LinkTileAspectRatio>;
|
|
16
|
+
/**
|
|
17
|
+
* Adapts the description and link theme when used on light background image.
|
|
18
|
+
*/
|
|
19
|
+
background?: LinkTileBackground;
|
|
16
20
|
/**
|
|
17
21
|
* Displays the link-tile as compact version with description and link icon only.
|
|
18
22
|
*/
|
|
@@ -67,6 +71,10 @@ export declare const PLinkTile: import("react").ForwardRefExoticComponent<Omit<H
|
|
|
67
71
|
* Aspect ratio of the link-tile.
|
|
68
72
|
*/
|
|
69
73
|
aspectRatio?: BreakpointCustomizable<"1:1" | "4:3" | "3:4" | "16:9" | "9:16"> | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Adapts the description and link theme when used on light background image.
|
|
76
|
+
*/
|
|
77
|
+
background?: "light" | "dark" | undefined;
|
|
70
78
|
/**
|
|
71
79
|
* Displays the link-tile as compact version with description and link icon only.
|
|
72
80
|
*/
|
|
@@ -6,13 +6,13 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.js');
|
|
7
7
|
var utils = require('../../utils.js');
|
|
8
8
|
|
|
9
|
-
const PLinkTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
9
|
+
const PLinkTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
const WebComponentTag = hooks.usePrefix('p-link-tile');
|
|
12
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
12
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
13
13
|
hooks.useBrowserLayoutEffect(() => {
|
|
14
14
|
const { current } = elementRef;
|
|
15
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
16
|
}, propsToSync);
|
|
17
17
|
const props = {
|
|
18
18
|
...rest,
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { SegmentedControlBackgroundColor, SegmentedControlUpdateEvent, Theme } from '../types';
|
|
2
|
+
import type { SegmentedControlBackgroundColor, BreakpointCustomizable, SegmentedControlColumns, SegmentedControlUpdateEvent, Theme } from '../types';
|
|
3
3
|
export type PSegmentedControlProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated since v3.0.0, will be removed with next major release. Background color variations
|
|
6
6
|
*/
|
|
7
7
|
backgroundColor?: SegmentedControlBackgroundColor;
|
|
8
|
+
/**
|
|
9
|
+
* Sets the amount of columns.
|
|
10
|
+
*/
|
|
11
|
+
columns?: BreakpointCustomizable<SegmentedControlColumns>;
|
|
8
12
|
/**
|
|
9
13
|
* @deprecated since v3.0.0, will be removed with next major release, use `update` event instead. Emitted when selected element changes.
|
|
10
14
|
*/
|
|
@@ -27,6 +31,10 @@ export declare const PSegmentedControl: import("react").ForwardRefExoticComponen
|
|
|
27
31
|
* @deprecated since v3.0.0, will be removed with next major release. Background color variations
|
|
28
32
|
*/
|
|
29
33
|
backgroundColor?: "background-surface" | "background-default" | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Sets the amount of columns.
|
|
36
|
+
*/
|
|
37
|
+
columns?: BreakpointCustomizable<string | number> | undefined;
|
|
30
38
|
/**
|
|
31
39
|
* @deprecated since v3.0.0, will be removed with next major release, use `update` event instead. Emitted when selected element changes.
|
|
32
40
|
*/
|
|
@@ -6,15 +6,15 @@ var react = require('react');
|
|
|
6
6
|
var hooks = require('../../hooks.js');
|
|
7
7
|
var utils = require('../../utils.js');
|
|
8
8
|
|
|
9
|
-
const PSegmentedControl = react.forwardRef(({ backgroundColor, onSegmentedControlChange, onUpdate, theme = 'light', value, className, ...rest }, ref) => {
|
|
9
|
+
const PSegmentedControl = react.forwardRef(({ backgroundColor, columns = 'auto', onSegmentedControlChange, onUpdate, theme = 'light', value, className, ...rest }, ref) => {
|
|
10
10
|
const elementRef = react.useRef();
|
|
11
11
|
hooks.useEventCallback(elementRef, 'segmentedControlChange', onSegmentedControlChange);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-segmented-control');
|
|
14
|
-
const propsToSync = [backgroundColor, theme, value];
|
|
14
|
+
const propsToSync = [backgroundColor, columns, theme, value];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['backgroundColor', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['backgroundColor', 'columns', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
18
|
}, propsToSync);
|
|
19
19
|
const props = {
|
|
20
20
|
...rest,
|
package/lib/types.d.ts
CHANGED
|
@@ -441,6 +441,11 @@ export type BreakpointValues<T> = {
|
|
|
441
441
|
base: T;
|
|
442
442
|
};
|
|
443
443
|
export type BreakpointCustomizable<T> = T | BreakpointValues<T> | string;
|
|
444
|
+
declare const THEMES: readonly [
|
|
445
|
+
"light",
|
|
446
|
+
"dark"
|
|
447
|
+
];
|
|
448
|
+
export type Theme = typeof THEMES[number];
|
|
444
449
|
declare const TILE_ASPECT_RATIOS: readonly [
|
|
445
450
|
"1:1",
|
|
446
451
|
"4:3",
|
|
@@ -459,6 +464,7 @@ declare const TILE_WEIGHTS: readonly [
|
|
|
459
464
|
"semi-bold"
|
|
460
465
|
];
|
|
461
466
|
export type TileWeight = (typeof TILE_WEIGHTS)[number];
|
|
467
|
+
export type TileBackground = (typeof THEMES)[number];
|
|
462
468
|
declare const TILE_ALIGNS: readonly [
|
|
463
469
|
"top",
|
|
464
470
|
"bottom"
|
|
@@ -490,11 +496,6 @@ declare const SCROLL_INDICATOR_POSITIONS: readonly [
|
|
|
490
496
|
/** @deprecated */
|
|
491
497
|
export type ScrollerScrollIndicatorPosition = (typeof SCROLL_INDICATOR_POSITIONS)[number];
|
|
492
498
|
export type ScrollerAlignScrollIndicator = ScrollerScrollIndicatorPosition;
|
|
493
|
-
declare const THEMES: readonly [
|
|
494
|
-
"light",
|
|
495
|
-
"dark"
|
|
496
|
-
];
|
|
497
|
-
export type Theme = typeof THEMES[number];
|
|
498
499
|
declare const ALIGN_LABELS: readonly [
|
|
499
500
|
"left",
|
|
500
501
|
"right"
|
|
@@ -615,6 +616,7 @@ export type ButtonTileIcon = LinkButtonIconName;
|
|
|
615
616
|
export type ButtonTileType = ButtonType;
|
|
616
617
|
export type ButtonTileAspectRatio = TileAspectRatio;
|
|
617
618
|
export type ButtonTileSize = TileSize;
|
|
619
|
+
export type ButtonTileBackground = TileBackground;
|
|
618
620
|
export type ButtonTileWeight = TileWeight;
|
|
619
621
|
export type ButtonTileAlign = TileAlign;
|
|
620
622
|
declare const CAROUSEL_WIDTHS: readonly [
|
|
@@ -931,6 +933,7 @@ export type LinkTileTarget = LinkTarget;
|
|
|
931
933
|
export type LinkTileAriaAttribute = LinkAriaAttribute;
|
|
932
934
|
export type LinkTileAspectRatio = TileAspectRatio;
|
|
933
935
|
export type LinkTileSize = TileSize;
|
|
936
|
+
export type LinkTileBackground = TileBackground;
|
|
934
937
|
export type LinkTileAlign = TileAlign;
|
|
935
938
|
declare const LINK_TILE_WEIGHTS: readonly [
|
|
936
939
|
"regular",
|
|
@@ -1038,6 +1041,8 @@ export type SegmentedControlBackgroundColor = (typeof SEGMENTED_CONTROL_BACKGROU
|
|
|
1038
1041
|
export type SegmentedControlUpdateEvent = {
|
|
1039
1042
|
value: string | number;
|
|
1040
1043
|
};
|
|
1044
|
+
declare const SEGMENTED_CONTROL_COLUMNS: (string | number)[];
|
|
1045
|
+
export type SegmentedControlColumns = (typeof SEGMENTED_CONTROL_COLUMNS)[number];
|
|
1041
1046
|
export type SegmentedControlItemIcon = LinkButtonIconName;
|
|
1042
1047
|
declare const DROPDOWN_DIRECTIONS: readonly [
|
|
1043
1048
|
"down",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.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.
|
|
20
|
+
"@porsche-design-system/components-js": "3.5.0-rc.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=17.0.0 <19.0.0",
|
|
@@ -4042,8 +4042,10 @@ const getComponentCss$Z = (size, compact, open, theme) => {
|
|
|
4042
4042
|
},
|
|
4043
4043
|
'icon-container': {
|
|
4044
4044
|
height: fontLineHeight,
|
|
4045
|
+
width: fontLineHeight,
|
|
4045
4046
|
display: 'flex',
|
|
4046
4047
|
alignItems: 'center',
|
|
4048
|
+
justifyContent: 'center',
|
|
4047
4049
|
},
|
|
4048
4050
|
icon: {
|
|
4049
4051
|
width: fontLineHeight,
|
|
@@ -4412,7 +4414,7 @@ const sizeMap$5 = {
|
|
|
4412
4414
|
default: { fontSize: fontSizeTextMedium },
|
|
4413
4415
|
};
|
|
4414
4416
|
const getButtonLinkTileStyles = (aspectRatio, size, weight, // to get deprecated semibold typed
|
|
4415
|
-
align, compact, hasGradient, isDisabled) => {
|
|
4417
|
+
background, align, compact, hasGradient, isDisabled) => {
|
|
4416
4418
|
const isTopAligned = align === 'top';
|
|
4417
4419
|
return {
|
|
4418
4420
|
...mergeDeep(getTileBaseStyles(aspectRatio, isDisabled), {
|
|
@@ -4424,6 +4426,9 @@ align, compact, hasGradient, isDisabled) => {
|
|
|
4424
4426
|
...mergeDeep(buildResponsiveStyles(size, (s) => sizeMap$5[s]), buildResponsiveStyles(weight, (w) => ({
|
|
4425
4427
|
fontWeight: getFontWeight(w === 'semibold' ? 'semi-bold' : w), // mapping of the deprecated weight semibold
|
|
4426
4428
|
}))),
|
|
4429
|
+
...buildResponsiveStyles(background, (b) => ({
|
|
4430
|
+
color: getThemedColors(b).primaryColor,
|
|
4431
|
+
})),
|
|
4427
4432
|
},
|
|
4428
4433
|
},
|
|
4429
4434
|
content: {
|
|
@@ -4433,6 +4438,7 @@ align, compact, hasGradient, isDisabled) => {
|
|
|
4433
4438
|
? `${spacingFluidMedium} ${spacingFluidMedium} ${spacingFluidLarge}`
|
|
4434
4439
|
: `${spacingFluidLarge} ${spacingFluidMedium} ${spacingFluidMedium}`,
|
|
4435
4440
|
...mergeDeep(hasGradient &&
|
|
4441
|
+
isThemeDark(background) &&
|
|
4436
4442
|
buildResponsiveStyles(compact, (isCompact) => isCompact && isTopAligned ? gradientToBottomStyle : gradientToTopStyle), buildResponsiveStyles(compact, (isCompact) => isCompact // TODO: use flex
|
|
4437
4443
|
? {
|
|
4438
4444
|
alignItems: 'center',
|
|
@@ -6575,7 +6581,6 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
6575
6581
|
background: 'transparent',
|
|
6576
6582
|
color: buttonColor,
|
|
6577
6583
|
...textSmallStyle,
|
|
6578
|
-
overflowWrap: 'normal',
|
|
6579
6584
|
position: 'relative',
|
|
6580
6585
|
'&::before': {
|
|
6581
6586
|
content: '""',
|
|
@@ -6627,14 +6632,16 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
6627
6632
|
|
|
6628
6633
|
const MIN_ITEM_WIDTH = 46;
|
|
6629
6634
|
const MAX_ITEM_WIDTH = 220;
|
|
6630
|
-
const getComponentCss$q = (maxWidth) => {
|
|
6635
|
+
const getComponentCss$q = (maxWidth, columns) => {
|
|
6631
6636
|
maxWidth = (maxWidth > MAX_ITEM_WIDTH && MAX_ITEM_WIDTH) || (maxWidth < MIN_ITEM_WIDTH && MIN_ITEM_WIDTH) || maxWidth;
|
|
6632
6637
|
return getCss({
|
|
6633
6638
|
'@global': {
|
|
6634
6639
|
':host': addImportantToEachRule({
|
|
6635
6640
|
display: 'grid',
|
|
6636
6641
|
gridAutoRows: '1fr',
|
|
6637
|
-
|
|
6642
|
+
...buildResponsiveStyles(columns, (col) => ({
|
|
6643
|
+
gridTemplateColumns: col === 'auto' ? `repeat(auto-fit, ${maxWidth}px)` : `repeat(${col}, minmax(0, 1fr))`,
|
|
6644
|
+
})),
|
|
6638
6645
|
gap: '6px',
|
|
6639
6646
|
...hostHiddenStyles,
|
|
6640
6647
|
}),
|
|
@@ -3962,6 +3962,7 @@ const { font: BUTTON_FONT } = textSmallStyle;
|
|
|
3962
3962
|
const { font: LABEL_FONT } = textXSmallStyle;
|
|
3963
3963
|
const ICON_SIZE = pxToRemWithUnit(24);
|
|
3964
3964
|
const ICON_MARGIN = pxToRemWithUnit(4);
|
|
3965
|
+
['auto', ...Array.from({ length: 25 }, (_, i) => i + 1)];
|
|
3965
3966
|
// Expect Porsche Next to be available and use sans-serif (wide font for safety buffer) as fallback
|
|
3966
3967
|
const tempFont = 'Porsche Next, sans-serif';
|
|
3967
3968
|
// temporary dom node to measure max-width of children content
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/button-tile.wrapper.js
CHANGED
|
@@ -7,13 +7,13 @@ var hooks = require('../../hooks.js');
|
|
|
7
7
|
var utils = require('../../utils.js');
|
|
8
8
|
var buttonTile = require('../dsr-components/button-tile.js');
|
|
9
9
|
|
|
10
|
-
const PButtonTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
10
|
+
const PButtonTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-button-tile');
|
|
13
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
13
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PButtonTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsxRuntime.jsx(buttonTile.DSRButtonTile, { align, aria, aspectRatio, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight, children })),
|
|
27
|
+
children: (jsxRuntime.jsx(buttonTile.DSRButtonTile, { align, aria, aspectRatio, background, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight, children })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile.wrapper.js
CHANGED
|
@@ -7,13 +7,13 @@ var hooks = require('../../hooks.js');
|
|
|
7
7
|
var utils = require('../../utils.js');
|
|
8
8
|
var linkTile = require('../dsr-components/link-tile.js');
|
|
9
9
|
|
|
10
|
-
const PLinkTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
10
|
+
const PLinkTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
const WebComponentTag = hooks.usePrefix('p-link-tile');
|
|
13
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
13
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
14
14
|
hooks.useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -24,7 +24,7 @@ const PLinkTile = react.forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
|
-
children: (jsxRuntime.jsx(linkTile.DSRLinkTile, { align, aria, aspectRatio, compact, description, download, gradient, href, label, rel, size, target, weight, children })),
|
|
27
|
+
children: (jsxRuntime.jsx(linkTile.DSRLinkTile, { align, aria, aspectRatio, background, compact, description, download, gradient, href, label, rel, size, target, weight, children })),
|
|
28
28
|
}
|
|
29
29
|
: {
|
|
30
30
|
children,
|
|
@@ -7,15 +7,15 @@ var hooks = require('../../hooks.js');
|
|
|
7
7
|
var utils = require('../../utils.js');
|
|
8
8
|
var segmentedControl = require('../dsr-components/segmented-control.js');
|
|
9
9
|
|
|
10
|
-
const PSegmentedControl = react.forwardRef(({ backgroundColor, onSegmentedControlChange, onUpdate, theme = 'light', value, className, children, ...rest }, ref) => {
|
|
10
|
+
const PSegmentedControl = react.forwardRef(({ backgroundColor, columns = 'auto', onSegmentedControlChange, onUpdate, theme = 'light', value, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef();
|
|
12
12
|
hooks.useEventCallback(elementRef, 'segmentedControlChange', onSegmentedControlChange);
|
|
13
13
|
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
14
14
|
const WebComponentTag = hooks.usePrefix('p-segmented-control');
|
|
15
|
-
const propsToSync = [backgroundColor, theme, value];
|
|
15
|
+
const propsToSync = [backgroundColor, columns, theme, value];
|
|
16
16
|
hooks.useBrowserLayoutEffect(() => {
|
|
17
17
|
const { current } = elementRef;
|
|
18
|
-
['backgroundColor', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
|
+
['backgroundColor', 'columns', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
19
19
|
}, propsToSync);
|
|
20
20
|
// @ts-ignore
|
|
21
21
|
if (!process.browser) {
|
|
@@ -27,7 +27,7 @@ const PSegmentedControl = react.forwardRef(({ backgroundColor, onSegmentedContro
|
|
|
27
27
|
...(!process.browser
|
|
28
28
|
? {
|
|
29
29
|
...{ "role": "group" },
|
|
30
|
-
children: (jsxRuntime.jsx(segmentedControl.DSRSegmentedControl, { backgroundColor, theme, value, children })),
|
|
30
|
+
children: (jsxRuntime.jsx(segmentedControl.DSRSegmentedControl, { backgroundColor, columns, theme, value, children })),
|
|
31
31
|
}
|
|
32
32
|
: {
|
|
33
33
|
children,
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.js
CHANGED
|
@@ -74,7 +74,7 @@ class DSRButtonTile extends react.Component {
|
|
|
74
74
|
render() {
|
|
75
75
|
splitChildren.splitChildren(this.props.children);
|
|
76
76
|
const buttonProps = {
|
|
77
|
-
theme:
|
|
77
|
+
theme: this.props.background,
|
|
78
78
|
variant: 'secondary',
|
|
79
79
|
iconSource: this.props.iconSource,
|
|
80
80
|
type: this.props.type,
|
|
@@ -84,7 +84,7 @@ class DSRButtonTile extends react.Component {
|
|
|
84
84
|
};
|
|
85
85
|
const button = (react.createElement(button_wrapper.PButton, { ...buttonProps, icon: this.props.icon, key: "link-or-button", className: "link-or-button" }, this.props.label));
|
|
86
86
|
const buttonPure = (react.createElement(buttonPure_wrapper.PButtonPure, { ...buttonProps, key: "link-or-button-pure", className: "link-or-button-pure", hideLabel: true, icon: this.props.icon === 'none' ? 'arrow-right' : this.props.icon }, this.props.label));
|
|
87
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getButtonTileCss(utilsEntry.isDisabledOrLoading(this.props.disabled, this.props.loading), this.props.aspectRatio, this.props.size, this.props.weight, this.props.align, this.props.compact, this.props.gradient, this.props.disabled)));
|
|
87
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getButtonTileCss(utilsEntry.isDisabledOrLoading(this.props.disabled, this.props.loading), this.props.aspectRatio, this.props.size, this.props.weight, this.props.background, this.props.align, this.props.compact, this.props.gradient, this.props.disabled)));
|
|
88
88
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx("div", { className: "image-container", children: jsxRuntime.jsx("slot", {}) }), jsxRuntime.jsxs("div", { className: "content", children: [jsxRuntime.jsx("p", { children: this.props.description }), typeof this.props.compact === 'boolean' ? (this.props.compact ? buttonPure : button) : [buttonPure, button]] })] })] }), this.props.children] }));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -73,7 +73,7 @@ class DSRLinkTile extends react.Component {
|
|
|
73
73
|
render() {
|
|
74
74
|
splitChildren.splitChildren(this.props.children);
|
|
75
75
|
const linkProps = {
|
|
76
|
-
theme:
|
|
76
|
+
theme: this.props.background,
|
|
77
77
|
variant: 'secondary',
|
|
78
78
|
aria: this.props.aria,
|
|
79
79
|
};
|
|
@@ -86,7 +86,7 @@ class DSRLinkTile extends react.Component {
|
|
|
86
86
|
const link = (react.createElement(link_wrapper.PLink, { ...sharedLinkProps, ...linkProps, key: "link-or-button", className: "link-or-button" }, this.props.label));
|
|
87
87
|
const linkPure = (react.createElement(linkPure_wrapper.PLinkPure, { ...sharedLinkProps, ...linkProps, key: "link-or-button-pure", className: "link-or-button-pure", hideLabel: true, icon: "arrow-right" }, this.props.label));
|
|
88
88
|
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getLinkTileCss(this.props.aspectRatio, this.props.size, this.props.weight, // potentially breakpoint customizable, so we can't easily access the deprecation map
|
|
89
|
-
this.props.align, this.props.compact, this.props.gradient)));
|
|
89
|
+
this.props.background, this.props.align, this.props.compact, this.props.gradient)));
|
|
90
90
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx("div", { className: "image-container", children: jsxRuntime.jsx("slot", {}) }), jsxRuntime.jsxs("div", { className: "content", children: [jsxRuntime.jsx("a", { ...sharedLinkProps, className: "link-overlay", tabIndex: -1, "aria-hidden": "true" }), jsxRuntime.jsx("p", { children: this.props.description }), typeof this.props.compact === 'boolean' ? (this.props.compact ? linkPure : link) : [linkPure, link]] })] })] }), this.props.children] }));
|
|
91
91
|
}
|
|
92
92
|
}
|
package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js
CHANGED
|
@@ -14,7 +14,7 @@ class DSRSegmentedControl extends react.Component {
|
|
|
14
14
|
const manipulatedChildren = children.map((child) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
15
15
|
? { ...child, props: { ...child.props, selected: child.props?.value === this.props.value, backgroundColor: this.props.backgroundColor, theme: this.props.theme } }
|
|
16
16
|
: child);
|
|
17
|
-
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSegmentedControlCss(100)));
|
|
17
|
+
const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getSegmentedControlCss(100, this.props.columns)));
|
|
18
18
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("slot", {}) })] }), manipulatedChildren] }));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -4040,8 +4040,10 @@ const getComponentCss$Z = (size, compact, open, theme) => {
|
|
|
4040
4040
|
},
|
|
4041
4041
|
'icon-container': {
|
|
4042
4042
|
height: fontLineHeight,
|
|
4043
|
+
width: fontLineHeight,
|
|
4043
4044
|
display: 'flex',
|
|
4044
4045
|
alignItems: 'center',
|
|
4046
|
+
justifyContent: 'center',
|
|
4045
4047
|
},
|
|
4046
4048
|
icon: {
|
|
4047
4049
|
width: fontLineHeight,
|
|
@@ -4410,7 +4412,7 @@ const sizeMap$5 = {
|
|
|
4410
4412
|
default: { fontSize: fontSizeTextMedium },
|
|
4411
4413
|
};
|
|
4412
4414
|
const getButtonLinkTileStyles = (aspectRatio, size, weight, // to get deprecated semibold typed
|
|
4413
|
-
align, compact, hasGradient, isDisabled) => {
|
|
4415
|
+
background, align, compact, hasGradient, isDisabled) => {
|
|
4414
4416
|
const isTopAligned = align === 'top';
|
|
4415
4417
|
return {
|
|
4416
4418
|
...mergeDeep(getTileBaseStyles(aspectRatio, isDisabled), {
|
|
@@ -4422,6 +4424,9 @@ align, compact, hasGradient, isDisabled) => {
|
|
|
4422
4424
|
...mergeDeep(buildResponsiveStyles(size, (s) => sizeMap$5[s]), buildResponsiveStyles(weight, (w) => ({
|
|
4423
4425
|
fontWeight: getFontWeight(w === 'semibold' ? 'semi-bold' : w), // mapping of the deprecated weight semibold
|
|
4424
4426
|
}))),
|
|
4427
|
+
...buildResponsiveStyles(background, (b) => ({
|
|
4428
|
+
color: getThemedColors(b).primaryColor,
|
|
4429
|
+
})),
|
|
4425
4430
|
},
|
|
4426
4431
|
},
|
|
4427
4432
|
content: {
|
|
@@ -4431,6 +4436,7 @@ align, compact, hasGradient, isDisabled) => {
|
|
|
4431
4436
|
? `${spacingFluidMedium} ${spacingFluidMedium} ${spacingFluidLarge}`
|
|
4432
4437
|
: `${spacingFluidLarge} ${spacingFluidMedium} ${spacingFluidMedium}`,
|
|
4433
4438
|
...mergeDeep(hasGradient &&
|
|
4439
|
+
isThemeDark(background) &&
|
|
4434
4440
|
buildResponsiveStyles(compact, (isCompact) => isCompact && isTopAligned ? gradientToBottomStyle : gradientToTopStyle), buildResponsiveStyles(compact, (isCompact) => isCompact // TODO: use flex
|
|
4435
4441
|
? {
|
|
4436
4442
|
alignItems: 'center',
|
|
@@ -6573,7 +6579,6 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
6573
6579
|
background: 'transparent',
|
|
6574
6580
|
color: buttonColor,
|
|
6575
6581
|
...textSmallStyle,
|
|
6576
|
-
overflowWrap: 'normal',
|
|
6577
6582
|
position: 'relative',
|
|
6578
6583
|
'&::before': {
|
|
6579
6584
|
content: '""',
|
|
@@ -6625,14 +6630,16 @@ const getComponentCss$r = (isDisabled, isSelected, hasIcon, hasSlottedContent, t
|
|
|
6625
6630
|
|
|
6626
6631
|
const MIN_ITEM_WIDTH = 46;
|
|
6627
6632
|
const MAX_ITEM_WIDTH = 220;
|
|
6628
|
-
const getComponentCss$q = (maxWidth) => {
|
|
6633
|
+
const getComponentCss$q = (maxWidth, columns) => {
|
|
6629
6634
|
maxWidth = (maxWidth > MAX_ITEM_WIDTH && MAX_ITEM_WIDTH) || (maxWidth < MIN_ITEM_WIDTH && MIN_ITEM_WIDTH) || maxWidth;
|
|
6630
6635
|
return getCss({
|
|
6631
6636
|
'@global': {
|
|
6632
6637
|
':host': addImportantToEachRule({
|
|
6633
6638
|
display: 'grid',
|
|
6634
6639
|
gridAutoRows: '1fr',
|
|
6635
|
-
|
|
6640
|
+
...buildResponsiveStyles(columns, (col) => ({
|
|
6641
|
+
gridTemplateColumns: col === 'auto' ? `repeat(auto-fit, ${maxWidth}px)` : `repeat(${col}, minmax(0, 1fr))`,
|
|
6642
|
+
})),
|
|
6636
6643
|
gap: '6px',
|
|
6637
6644
|
...hostHiddenStyles,
|
|
6638
6645
|
}),
|
|
@@ -3960,6 +3960,7 @@ const { font: BUTTON_FONT } = textSmallStyle;
|
|
|
3960
3960
|
const { font: LABEL_FONT } = textXSmallStyle;
|
|
3961
3961
|
const ICON_SIZE = pxToRemWithUnit(24);
|
|
3962
3962
|
const ICON_MARGIN = pxToRemWithUnit(4);
|
|
3963
|
+
['auto', ...Array.from({ length: 25 }, (_, i) => i + 1)];
|
|
3963
3964
|
// Expect Porsche Next to be available and use sans-serif (wide font for safety buffer) as fallback
|
|
3964
3965
|
const tempFont = 'Porsche Next, sans-serif';
|
|
3965
3966
|
// temporary dom node to measure max-width of children content
|
|
@@ -5,13 +5,13 @@ import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.j
|
|
|
5
5
|
import { syncRef } from '../../utils.js';
|
|
6
6
|
import { DSRButtonTile } from '../dsr-components/button-tile.js';
|
|
7
7
|
|
|
8
|
-
const PButtonTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
8
|
+
const PButtonTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, disabled = false, gradient = true, icon = 'none', iconSource, label, loading = false, size = 'default', type = 'submit', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
const WebComponentTag = usePrefix('p-button-tile');
|
|
11
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
11
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'disabled', 'gradient', 'icon', 'iconSource', 'label', 'loading', 'size', 'type', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
if (!process.browser) {
|
|
@@ -22,7 +22,7 @@ const PButtonTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', c
|
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
...(!process.browser
|
|
24
24
|
? {
|
|
25
|
-
children: (jsx(DSRButtonTile, { align, aria, aspectRatio, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight, children })),
|
|
25
|
+
children: (jsx(DSRButtonTile, { align, aria, aspectRatio, background, compact, description, disabled, gradient, icon, iconSource, label, loading, size, type, weight, children })),
|
|
26
26
|
}
|
|
27
27
|
: {
|
|
28
28
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile.wrapper.js
CHANGED
|
@@ -5,13 +5,13 @@ import { usePrefix, useBrowserLayoutEffect, useMergedClass } from '../../hooks.j
|
|
|
5
5
|
import { syncRef } from '../../utils.js';
|
|
6
6
|
import { DSRLinkTile } from '../dsr-components/link-tile.js';
|
|
7
7
|
|
|
8
|
-
const PLinkTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
8
|
+
const PLinkTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', background = 'dark', compact = false, description, download, gradient = true, href, label, rel, size = 'default', target = '_self', weight = 'semi-bold', className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
const WebComponentTag = usePrefix('p-link-tile');
|
|
11
|
-
const propsToSync = [align, aria, aspectRatio, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
11
|
+
const propsToSync = [align, aria, aspectRatio, background, compact, description, download, gradient, href, label, rel, size, target, weight];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['align', 'aria', 'aspectRatio', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['align', 'aria', 'aspectRatio', 'background', 'compact', 'description', 'download', 'gradient', 'href', 'label', 'rel', 'size', 'target', 'weight'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
if (!process.browser) {
|
|
@@ -22,7 +22,7 @@ const PLinkTile = forwardRef(({ align = 'bottom', aria, aspectRatio = '4:3', com
|
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
...(!process.browser
|
|
24
24
|
? {
|
|
25
|
-
children: (jsx(DSRLinkTile, { align, aria, aspectRatio, compact, description, download, gradient, href, label, rel, size, target, weight, children })),
|
|
25
|
+
children: (jsx(DSRLinkTile, { align, aria, aspectRatio, background, compact, description, download, gradient, href, label, rel, size, target, weight, children })),
|
|
26
26
|
}
|
|
27
27
|
: {
|
|
28
28
|
children,
|
|
@@ -5,15 +5,15 @@ import { useEventCallback, usePrefix, useBrowserLayoutEffect, useMergedClass } f
|
|
|
5
5
|
import { syncRef } from '../../utils.js';
|
|
6
6
|
import { DSRSegmentedControl } from '../dsr-components/segmented-control.js';
|
|
7
7
|
|
|
8
|
-
const PSegmentedControl = forwardRef(({ backgroundColor, onSegmentedControlChange, onUpdate, theme = 'light', value, className, children, ...rest }, ref) => {
|
|
8
|
+
const PSegmentedControl = forwardRef(({ backgroundColor, columns = 'auto', onSegmentedControlChange, onUpdate, theme = 'light', value, className, children, ...rest }, ref) => {
|
|
9
9
|
const elementRef = useRef();
|
|
10
10
|
useEventCallback(elementRef, 'segmentedControlChange', onSegmentedControlChange);
|
|
11
11
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
12
12
|
const WebComponentTag = usePrefix('p-segmented-control');
|
|
13
|
-
const propsToSync = [backgroundColor, theme, value];
|
|
13
|
+
const propsToSync = [backgroundColor, columns, theme, value];
|
|
14
14
|
useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['backgroundColor', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
16
|
+
['backgroundColor', 'columns', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
// @ts-ignore
|
|
19
19
|
if (!process.browser) {
|
|
@@ -25,7 +25,7 @@ const PSegmentedControl = forwardRef(({ backgroundColor, onSegmentedControlChang
|
|
|
25
25
|
...(!process.browser
|
|
26
26
|
? {
|
|
27
27
|
...{ "role": "group" },
|
|
28
|
-
children: (jsx(DSRSegmentedControl, { backgroundColor, theme, value, children })),
|
|
28
|
+
children: (jsx(DSRSegmentedControl, { backgroundColor, columns, theme, value, children })),
|
|
29
29
|
}
|
|
30
30
|
: {
|
|
31
31
|
children,
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.js
CHANGED
|
@@ -72,7 +72,7 @@ class DSRButtonTile extends Component {
|
|
|
72
72
|
render() {
|
|
73
73
|
splitChildren(this.props.children);
|
|
74
74
|
const buttonProps = {
|
|
75
|
-
theme:
|
|
75
|
+
theme: this.props.background,
|
|
76
76
|
variant: 'secondary',
|
|
77
77
|
iconSource: this.props.iconSource,
|
|
78
78
|
type: this.props.type,
|
|
@@ -82,7 +82,7 @@ class DSRButtonTile extends Component {
|
|
|
82
82
|
};
|
|
83
83
|
const button = (createElement(PButton, { ...buttonProps, icon: this.props.icon, key: "link-or-button", className: "link-or-button" }, this.props.label));
|
|
84
84
|
const buttonPure = (createElement(PButtonPure, { ...buttonProps, key: "link-or-button-pure", className: "link-or-button-pure", hideLabel: true, icon: this.props.icon === 'none' ? 'arrow-right' : this.props.icon }, this.props.label));
|
|
85
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$V(isDisabledOrLoading(this.props.disabled, this.props.loading), this.props.aspectRatio, this.props.size, this.props.weight, this.props.align, this.props.compact, this.props.gradient, this.props.disabled)));
|
|
85
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$V(isDisabledOrLoading(this.props.disabled, this.props.loading), this.props.aspectRatio, this.props.size, this.props.weight, this.props.background, this.props.align, this.props.compact, this.props.gradient, this.props.disabled)));
|
|
86
86
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx("div", { className: "image-container", children: jsx("slot", {}) }), jsxs("div", { className: "content", children: [jsx("p", { children: this.props.description }), typeof this.props.compact === 'boolean' ? (this.props.compact ? buttonPure : button) : [buttonPure, button]] })] })] }), this.props.children] }));
|
|
87
87
|
}
|
|
88
88
|
}
|
package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js
CHANGED
|
@@ -71,7 +71,7 @@ class DSRLinkTile extends Component {
|
|
|
71
71
|
render() {
|
|
72
72
|
splitChildren(this.props.children);
|
|
73
73
|
const linkProps = {
|
|
74
|
-
theme:
|
|
74
|
+
theme: this.props.background,
|
|
75
75
|
variant: 'secondary',
|
|
76
76
|
aria: this.props.aria,
|
|
77
77
|
};
|
|
@@ -84,7 +84,7 @@ class DSRLinkTile extends Component {
|
|
|
84
84
|
const link = (createElement(PLink, { ...sharedLinkProps, ...linkProps, key: "link-or-button", className: "link-or-button" }, this.props.label));
|
|
85
85
|
const linkPure = (createElement(PLinkPure, { ...sharedLinkProps, ...linkProps, key: "link-or-button-pure", className: "link-or-button-pure", hideLabel: true, icon: "arrow-right" }, this.props.label));
|
|
86
86
|
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$z(this.props.aspectRatio, this.props.size, this.props.weight, // potentially breakpoint customizable, so we can't easily access the deprecation map
|
|
87
|
-
this.props.align, this.props.compact, this.props.gradient)));
|
|
87
|
+
this.props.background, this.props.align, this.props.compact, this.props.gradient)));
|
|
88
88
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxs("div", { className: "root", children: [jsx("div", { className: "image-container", children: jsx("slot", {}) }), jsxs("div", { className: "content", children: [jsx("a", { ...sharedLinkProps, className: "link-overlay", tabIndex: -1, "aria-hidden": "true" }), jsx("p", { children: this.props.description }), typeof this.props.compact === 'boolean' ? (this.props.compact ? linkPure : link) : [linkPure, link]] })] })] }), this.props.children] }));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -12,7 +12,7 @@ class DSRSegmentedControl extends Component {
|
|
|
12
12
|
const manipulatedChildren = children.map((child) => typeof child === 'object' && 'props' in child && otherChildren.includes(child)
|
|
13
13
|
? { ...child, props: { ...child.props, selected: child.props?.value === this.props.value, backgroundColor: this.props.backgroundColor, theme: this.props.theme } }
|
|
14
14
|
: child);
|
|
15
|
-
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$q(100)));
|
|
15
|
+
const style = minifyCss(stripFocusAndHoverStyles(getComponentCss$q(100, this.props.columns)));
|
|
16
16
|
return (jsxs(Fragment, { children: [jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsx(Fragment, { children: jsx("slot", {}) })] }), manipulatedChildren] }));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { ButtonTileAlign, SelectedAriaAttributes, ButtonTileAriaAttribute, BreakpointCustomizable, ButtonTileAspectRatio, ButtonTileIcon, ButtonTileSize, ButtonTileType, ButtonTileWeight } from '../types';
|
|
2
|
+
import type { ButtonTileAlign, SelectedAriaAttributes, ButtonTileAriaAttribute, BreakpointCustomizable, ButtonTileAspectRatio, ButtonTileBackground, ButtonTileIcon, ButtonTileSize, ButtonTileType, ButtonTileWeight } from '../types';
|
|
3
3
|
export type PButtonTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Alignment of button and description.
|
|
@@ -13,6 +13,10 @@ export type PButtonTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
13
13
|
* Aspect ratio of the button-tile.
|
|
14
14
|
*/
|
|
15
15
|
aspectRatio?: BreakpointCustomizable<ButtonTileAspectRatio>;
|
|
16
|
+
/**
|
|
17
|
+
* Adapts the description and button theme when used on light background image.
|
|
18
|
+
*/
|
|
19
|
+
background?: ButtonTileBackground;
|
|
16
20
|
/**
|
|
17
21
|
* Displays the button-tile as compact version with description and button icon only.
|
|
18
22
|
*/
|
|
@@ -71,6 +75,10 @@ export declare const PButtonTile: import("react").ForwardRefExoticComponent<Omit
|
|
|
71
75
|
* Aspect ratio of the button-tile.
|
|
72
76
|
*/
|
|
73
77
|
aspectRatio?: BreakpointCustomizable<ButtonTileAspectRatio>;
|
|
78
|
+
/**
|
|
79
|
+
* Adapts the description and button theme when used on light background image.
|
|
80
|
+
*/
|
|
81
|
+
background?: ButtonTileBackground;
|
|
74
82
|
/**
|
|
75
83
|
* Displays the button-tile as compact version with description and button icon only.
|
|
76
84
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { LinkTileAlign, SelectedAriaAttributes, LinkTileAriaAttribute, BreakpointCustomizable, LinkTileAspectRatio, LinkTileSize, LinkTileTarget, LinkTileWeight } from '../types';
|
|
2
|
+
import type { LinkTileAlign, SelectedAriaAttributes, LinkTileAriaAttribute, BreakpointCustomizable, LinkTileAspectRatio, LinkTileBackground, LinkTileSize, LinkTileTarget, LinkTileWeight } from '../types';
|
|
3
3
|
export type PLinkTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Alignment of link and description.
|
|
@@ -13,6 +13,10 @@ export type PLinkTileProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
|
13
13
|
* Aspect ratio of the link-tile.
|
|
14
14
|
*/
|
|
15
15
|
aspectRatio?: BreakpointCustomizable<LinkTileAspectRatio>;
|
|
16
|
+
/**
|
|
17
|
+
* Adapts the description and link theme when used on light background image.
|
|
18
|
+
*/
|
|
19
|
+
background?: LinkTileBackground;
|
|
16
20
|
/**
|
|
17
21
|
* Displays the link-tile as compact version with description and link icon only.
|
|
18
22
|
*/
|
|
@@ -67,6 +71,10 @@ export declare const PLinkTile: import("react").ForwardRefExoticComponent<Omit<H
|
|
|
67
71
|
* Aspect ratio of the link-tile.
|
|
68
72
|
*/
|
|
69
73
|
aspectRatio?: BreakpointCustomizable<LinkTileAspectRatio>;
|
|
74
|
+
/**
|
|
75
|
+
* Adapts the description and link theme when used on light background image.
|
|
76
|
+
*/
|
|
77
|
+
background?: LinkTileBackground;
|
|
70
78
|
/**
|
|
71
79
|
* Displays the link-tile as compact version with description and link icon only.
|
|
72
80
|
*/
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
|
-
import type { SegmentedControlBackgroundColor, SegmentedControlUpdateEvent, Theme } from '../types';
|
|
2
|
+
import type { SegmentedControlBackgroundColor, BreakpointCustomizable, SegmentedControlColumns, SegmentedControlUpdateEvent, Theme } from '../types';
|
|
3
3
|
export type PSegmentedControlProps = Omit<HTMLAttributes<{}>, 'color'> & {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated since v3.0.0, will be removed with next major release. Background color variations
|
|
6
6
|
*/
|
|
7
7
|
backgroundColor?: SegmentedControlBackgroundColor;
|
|
8
|
+
/**
|
|
9
|
+
* Sets the amount of columns.
|
|
10
|
+
*/
|
|
11
|
+
columns?: BreakpointCustomizable<SegmentedControlColumns>;
|
|
8
12
|
/**
|
|
9
13
|
* @deprecated since v3.0.0, will be removed with next major release, use `update` event instead. Emitted when selected element changes.
|
|
10
14
|
*/
|
|
@@ -27,6 +31,10 @@ export declare const PSegmentedControl: import("react").ForwardRefExoticComponen
|
|
|
27
31
|
* @deprecated since v3.0.0, will be removed with next major release. Background color variations
|
|
28
32
|
*/
|
|
29
33
|
backgroundColor?: SegmentedControlBackgroundColor;
|
|
34
|
+
/**
|
|
35
|
+
* Sets the amount of columns.
|
|
36
|
+
*/
|
|
37
|
+
columns?: BreakpointCustomizable<SegmentedControlColumns>;
|
|
30
38
|
/**
|
|
31
39
|
* @deprecated since v3.0.0, will be removed with next major release, use `update` event instead. Emitted when selected element changes.
|
|
32
40
|
*/
|
package/ssr/lib/types.d.ts
CHANGED
|
@@ -441,6 +441,11 @@ export type BreakpointValues<T> = {
|
|
|
441
441
|
base: T;
|
|
442
442
|
};
|
|
443
443
|
export type BreakpointCustomizable<T> = T | BreakpointValues<T> | string;
|
|
444
|
+
declare const THEMES: readonly [
|
|
445
|
+
"light",
|
|
446
|
+
"dark"
|
|
447
|
+
];
|
|
448
|
+
export type Theme = typeof THEMES[number];
|
|
444
449
|
declare const TILE_ASPECT_RATIOS: readonly [
|
|
445
450
|
"1:1",
|
|
446
451
|
"4:3",
|
|
@@ -459,6 +464,7 @@ declare const TILE_WEIGHTS: readonly [
|
|
|
459
464
|
"semi-bold"
|
|
460
465
|
];
|
|
461
466
|
export type TileWeight = (typeof TILE_WEIGHTS)[number];
|
|
467
|
+
export type TileBackground = (typeof THEMES)[number];
|
|
462
468
|
declare const TILE_ALIGNS: readonly [
|
|
463
469
|
"top",
|
|
464
470
|
"bottom"
|
|
@@ -490,11 +496,6 @@ declare const SCROLL_INDICATOR_POSITIONS: readonly [
|
|
|
490
496
|
/** @deprecated */
|
|
491
497
|
export type ScrollerScrollIndicatorPosition = (typeof SCROLL_INDICATOR_POSITIONS)[number];
|
|
492
498
|
export type ScrollerAlignScrollIndicator = ScrollerScrollIndicatorPosition;
|
|
493
|
-
declare const THEMES: readonly [
|
|
494
|
-
"light",
|
|
495
|
-
"dark"
|
|
496
|
-
];
|
|
497
|
-
export type Theme = typeof THEMES[number];
|
|
498
499
|
declare const ALIGN_LABELS: readonly [
|
|
499
500
|
"left",
|
|
500
501
|
"right"
|
|
@@ -615,6 +616,7 @@ export type ButtonTileIcon = LinkButtonIconName;
|
|
|
615
616
|
export type ButtonTileType = ButtonType;
|
|
616
617
|
export type ButtonTileAspectRatio = TileAspectRatio;
|
|
617
618
|
export type ButtonTileSize = TileSize;
|
|
619
|
+
export type ButtonTileBackground = TileBackground;
|
|
618
620
|
export type ButtonTileWeight = TileWeight;
|
|
619
621
|
export type ButtonTileAlign = TileAlign;
|
|
620
622
|
declare const CAROUSEL_WIDTHS: readonly [
|
|
@@ -931,6 +933,7 @@ export type LinkTileTarget = LinkTarget;
|
|
|
931
933
|
export type LinkTileAriaAttribute = LinkAriaAttribute;
|
|
932
934
|
export type LinkTileAspectRatio = TileAspectRatio;
|
|
933
935
|
export type LinkTileSize = TileSize;
|
|
936
|
+
export type LinkTileBackground = TileBackground;
|
|
934
937
|
export type LinkTileAlign = TileAlign;
|
|
935
938
|
declare const LINK_TILE_WEIGHTS: readonly [
|
|
936
939
|
"regular",
|
|
@@ -1038,6 +1041,8 @@ export type SegmentedControlBackgroundColor = (typeof SEGMENTED_CONTROL_BACKGROU
|
|
|
1038
1041
|
export type SegmentedControlUpdateEvent = {
|
|
1039
1042
|
value: string | number;
|
|
1040
1043
|
};
|
|
1044
|
+
declare const SEGMENTED_CONTROL_COLUMNS: (string | number)[];
|
|
1045
|
+
export type SegmentedControlColumns = (typeof SEGMENTED_CONTROL_COLUMNS)[number];
|
|
1041
1046
|
export type SegmentedControlItemIcon = LinkButtonIconName;
|
|
1042
1047
|
declare const DROPDOWN_DIRECTIONS: readonly [
|
|
1043
1048
|
"down",
|