@porsche-design-system/components-react 2.13.0-rc.3 → 2.13.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 +16 -0
- package/esm/public-api.js +32 -1
- package/jsdom-polyfill/index.js +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/stepper-horizontal-item.wrapper.d.ts +24 -0
- package/lib/components/stepper-horizontal.wrapper.d.ts +24 -0
- package/lib/types.d.ts +10 -6
- package/package.json +2 -2
- package/public-api.js +33 -0
|
@@ -26,6 +26,8 @@ export * from './segmented-control.wrapper';
|
|
|
26
26
|
export * from './segmented-control-item.wrapper';
|
|
27
27
|
export * from './select-wrapper.wrapper';
|
|
28
28
|
export * from './spinner.wrapper';
|
|
29
|
+
export * from './stepper-horizontal.wrapper';
|
|
30
|
+
export * from './stepper-horizontal-item.wrapper';
|
|
29
31
|
export * from './switch.wrapper';
|
|
30
32
|
export * from './table.wrapper';
|
|
31
33
|
export * from './table-body.wrapper';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import type { StepperState } from '../types';
|
|
3
|
+
export declare type PStepperHorizontalItemProps = HTMLAttributes<{}> & {
|
|
4
|
+
/**
|
|
5
|
+
* Disables the stepper-horizontal-item. No events will be triggered while disabled state is active.
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The validation state.
|
|
10
|
+
*/
|
|
11
|
+
state?: StepperState;
|
|
12
|
+
};
|
|
13
|
+
export declare const PStepperHorizontalItem: import("react").ForwardRefExoticComponent<HTMLAttributes<{}> & {
|
|
14
|
+
/**
|
|
15
|
+
* Disables the stepper-horizontal-item. No events will be triggered while disabled state is active.
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The validation state.
|
|
20
|
+
*/
|
|
21
|
+
state?: StepperState;
|
|
22
|
+
} & {
|
|
23
|
+
children?: import("react").ReactNode;
|
|
24
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import type { StepChangeEvent, Theme } from '../types';
|
|
3
|
+
export declare type PStepperHorizontalProps = HTMLAttributes<{}> & {
|
|
4
|
+
/**
|
|
5
|
+
* Emitted when active step is changed.
|
|
6
|
+
*/
|
|
7
|
+
onStepChange?: (event: CustomEvent<StepChangeEvent>) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Adapts the tag color depending on the theme.
|
|
10
|
+
*/
|
|
11
|
+
theme?: Theme;
|
|
12
|
+
};
|
|
13
|
+
export declare const PStepperHorizontal: import("react").ForwardRefExoticComponent<HTMLAttributes<{}> & {
|
|
14
|
+
/**
|
|
15
|
+
* Emitted when active step is changed.
|
|
16
|
+
*/
|
|
17
|
+
onStepChange?: (event: CustomEvent<StepChangeEvent>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Adapts the tag color depending on the theme.
|
|
20
|
+
*/
|
|
21
|
+
theme?: Theme;
|
|
22
|
+
} & {
|
|
23
|
+
children?: import("react").ReactNode;
|
|
24
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
package/lib/types.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ export declare type BreakpointValues<T> = {
|
|
|
21
21
|
base: T;
|
|
22
22
|
};
|
|
23
23
|
export declare type BreakpointCustomizable<T> = T | BreakpointValues<T>;
|
|
24
|
+
export declare type GradientColorTheme = "default" | "surface";
|
|
25
|
+
export declare type ScrollToPosition = {
|
|
26
|
+
scrollPosition: number;
|
|
27
|
+
isSmooth?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare type PrevNextButtonJssStyle = any;
|
|
24
30
|
declare const TEXT_SIZES: readonly [
|
|
25
31
|
"x-small",
|
|
26
32
|
"small",
|
|
@@ -465,12 +471,6 @@ declare const POPOVER_DIRECTIONS: readonly [
|
|
|
465
471
|
"left"
|
|
466
472
|
];
|
|
467
473
|
export declare type PopoverDirection = typeof POPOVER_DIRECTIONS[number];
|
|
468
|
-
export declare type GradientColorTheme = "default" | "surface";
|
|
469
|
-
export declare type ScrollToPosition = {
|
|
470
|
-
scrollPosition: number;
|
|
471
|
-
isSmooth?: boolean;
|
|
472
|
-
};
|
|
473
|
-
export declare type PrevNextButtonJssStyle = any;
|
|
474
474
|
declare const SEGMENTED_CONTROL_BACKGROUND_COLORS: readonly [
|
|
475
475
|
"background-surface",
|
|
476
476
|
"background-default"
|
|
@@ -493,6 +493,10 @@ declare const SPINNER_ARIA_ATTRIBUTES: readonly [
|
|
|
493
493
|
"aria-label"
|
|
494
494
|
];
|
|
495
495
|
export declare type SpinnerAriaAttributes = typeof SPINNER_ARIA_ATTRIBUTES[number];
|
|
496
|
+
export declare type StepChangeEvent = {
|
|
497
|
+
activeStepIndex: number;
|
|
498
|
+
};
|
|
499
|
+
export declare type StepperState = "current" | "complete" | "warning";
|
|
496
500
|
export declare type SwitchChangeEvent = {
|
|
497
501
|
checked: boolean;
|
|
498
502
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "2.13.0
|
|
3
|
+
"version": "2.13.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": "2.13.0
|
|
20
|
+
"@porsche-design-system/components-js": "2.13.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": ">=17.0.0 <19.0.0",
|
package/public-api.js
CHANGED
|
@@ -556,6 +556,37 @@ const PSpinner = /*#__PURE__*/ react.forwardRef(({ aria, size = 'small', theme =
|
|
|
556
556
|
return jsxRuntime.jsx(Tag, { ...props });
|
|
557
557
|
});
|
|
558
558
|
|
|
559
|
+
const PStepperHorizontal = /*#__PURE__*/ react.forwardRef(({ onStepChange, theme = 'light', className, ...rest }, ref) => {
|
|
560
|
+
const elementRef = react.useRef();
|
|
561
|
+
useEventCallback(elementRef, 'stepChange', onStepChange);
|
|
562
|
+
const Tag = usePrefix('p-stepper-horizontal');
|
|
563
|
+
useBrowserLayoutEffect(() => {
|
|
564
|
+
elementRef.current.theme = theme;
|
|
565
|
+
}, [theme]);
|
|
566
|
+
const props = {
|
|
567
|
+
...rest,
|
|
568
|
+
class: useMergedClass(elementRef, className),
|
|
569
|
+
ref: syncRef(elementRef, ref)
|
|
570
|
+
};
|
|
571
|
+
return jsxRuntime.jsx(Tag, { ...props });
|
|
572
|
+
});
|
|
573
|
+
|
|
574
|
+
const PStepperHorizontalItem = /*#__PURE__*/ react.forwardRef(({ disabled = false, state, className, ...rest }, ref) => {
|
|
575
|
+
const elementRef = react.useRef();
|
|
576
|
+
const Tag = usePrefix('p-stepper-horizontal-item');
|
|
577
|
+
const propsToSync = [disabled, state];
|
|
578
|
+
useBrowserLayoutEffect(() => {
|
|
579
|
+
const { current } = elementRef;
|
|
580
|
+
['disabled', 'state'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
581
|
+
}, propsToSync);
|
|
582
|
+
const props = {
|
|
583
|
+
...rest,
|
|
584
|
+
class: useMergedClass(elementRef, className),
|
|
585
|
+
ref: syncRef(elementRef, ref)
|
|
586
|
+
};
|
|
587
|
+
return jsxRuntime.jsx(Tag, { ...props });
|
|
588
|
+
});
|
|
589
|
+
|
|
559
590
|
const PSwitch = /*#__PURE__*/ react.forwardRef(({ alignLabel = 'right', checked = false, disabled = false, hideLabel = false, loading = false, onSwitchChange, stretch = false, tabbable = true, theme = 'light', className, ...rest }, ref) => {
|
|
560
591
|
const elementRef = react.useRef();
|
|
561
592
|
useEventCallback(elementRef, 'switchChange', onSwitchChange);
|
|
@@ -863,6 +894,8 @@ exports.PSegmentedControl = PSegmentedControl;
|
|
|
863
894
|
exports.PSegmentedControlItem = PSegmentedControlItem;
|
|
864
895
|
exports.PSelectWrapper = PSelectWrapper;
|
|
865
896
|
exports.PSpinner = PSpinner;
|
|
897
|
+
exports.PStepperHorizontal = PStepperHorizontal;
|
|
898
|
+
exports.PStepperHorizontalItem = PStepperHorizontalItem;
|
|
866
899
|
exports.PSwitch = PSwitch;
|
|
867
900
|
exports.PTable = PTable;
|
|
868
901
|
exports.PTableBody = PTableBody;
|