@axa-fr/canopee-react 2.0.0-alpha.53 → 2.0.0-alpha.54

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.
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "@axa-fr/canopee-css/prospect/Stepper/StepperApollo.css";
3
+ import { Heading } from "../Heading/HeadingApollo";
3
4
  import { ProgressBarGroup } from "../ProgressBarGroup/ProgressBarGroupApollo";
4
5
  import { StepperCommon } from "./StepperCommon";
5
- export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup }));
6
+ export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup, HeadingComponent: Heading }));
@@ -1,18 +1,23 @@
1
- import { type ComponentType, type HTMLAttributes } from "react";
1
+ import { type ComponentType, type HTMLAttributes, type ReactNode } from "react";
2
2
  import { type ItemMessageProps } from "../Form/ItemMessage/ItemMessageCommon";
3
3
  import { type ProgressBarGroupProps } from "../ProgressBarGroup/ProgressBarGroupCommon";
4
+ import type { HeadingCommonProps } from "../Heading/HeadingCommon";
5
+ import type { HeadingLevel } from "../Heading/types";
4
6
  export type StepperProps = {
5
7
  currentStepProgress?: number;
6
8
  currentStep: number;
7
- currentSubtitle?: string;
8
- currentTitle?: string;
9
+ currentSubtitle?: ReactNode;
10
+ currentTitle?: ReactNode;
9
11
  nbSteps?: 2 | 3 | 4 | 5 | 6 | 7 | 8;
10
12
  helper?: string;
13
+ icon?: string;
14
+ iconProps?: HeadingCommonProps["iconProps"];
11
15
  message?: string;
12
16
  messageType?: ItemMessageProps["messageType"];
13
- titleLevel?: 1 | 2 | 3;
14
- } & Omit<HTMLAttributes<HTMLDivElement>, "role">;
17
+ titleLevel?: HeadingLevel;
18
+ } & Omit<HTMLAttributes<HTMLDivElement>, "role" | "title">;
15
19
  export type StepperCommonProps = StepperProps & {
16
20
  ProgressBarGroupComponent: ComponentType<ProgressBarGroupProps>;
21
+ HeadingComponent: ComponentType<HeadingCommonProps>;
17
22
  };
18
- export declare const StepperCommon: ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, helper, message, messageType, titleLevel, ...props }: StepperCommonProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const StepperCommon: ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, HeadingComponent, helper, icon, iconProps, message, messageType, titleLevel, ...props }: StepperCommonProps) => import("react/jsx-runtime").JSX.Element;
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId, } from "react";
3
3
  import { ItemMessage, } from "../Form/ItemMessage/ItemMessageCommon";
4
4
  import {} from "../ProgressBarGroup/ProgressBarGroupCommon";
5
- export const StepperCommon = ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, helper, message, messageType = "success", titleLevel = 2, ...props }) => {
5
+ export const StepperCommon = ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, HeadingComponent, helper, icon, iconProps, message, messageType = "success", titleLevel = 2, ...props }) => {
6
6
  const titleId = useId();
7
- const Title = `h${titleLevel}`;
8
- return (_jsxs("div", { className: "af-stepper", ...props, tabIndex: undefined, children: [_jsxs("div", { className: "af-stepper__header", children: [_jsx(Title, { id: titleId, className: "af-stepper__title", children: currentTitle }), Boolean(currentSubtitle) && (_jsx("p", { className: "af-stepper__subtitle", children: currentSubtitle }))] }), _jsx(ProgressBarGroupComponent, { className: className, currentStep: currentStep, stepsCount: nbSteps, currentStepProgress: currentStepProgress, "aria-labelledby": titleId }), Boolean(helper) && _jsx("span", { className: "af-stepper__helper", children: helper }), _jsx(ItemMessage, { message: message, messageType: messageType })] }));
7
+ return (_jsxs("div", { className: "af-stepper", ...props, tabIndex: undefined, children: [_jsx("div", { className: "af-stepper__header", id: titleId, children: _jsx(HeadingComponent, { level: titleLevel, icon: icon, iconProps: iconProps, firstSubtitle: currentSubtitle, children: currentTitle }) }), _jsx(ProgressBarGroupComponent, { className: className, currentStep: currentStep, stepsCount: nbSteps, currentStepProgress: currentStepProgress, "aria-labelledby": titleId }), Boolean(helper) && _jsx("span", { className: "af-stepper__helper", children: helper }), _jsx(ItemMessage, { message: message, messageType: messageType })] }));
9
8
  };
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "@axa-fr/canopee-css/client/Stepper/StepperLF.css";
3
+ import { Heading } from "../Heading/HeadingLF";
3
4
  import { ProgressBarGroup } from "../ProgressBarGroup/ProgressBarGroupLF";
4
5
  import { StepperCommon } from "./StepperCommon";
5
- export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup }));
6
+ export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup, HeadingComponent: Heading }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/canopee-react",
3
- "version": "2.0.0-alpha.53",
3
+ "version": "2.0.0-alpha.54",
4
4
  "description": "Package React - Design System Canopée",
5
5
  "exports": {
6
6
  "./distributeur": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "homepage": "https://github.com/AxaFrance/design-system#readme",
55
55
  "peerDependencies": {
56
- "@axa-fr/canopee-css": "2.0.0-alpha.53",
56
+ "@axa-fr/canopee-css": "2.0.0-alpha.54",
57
57
  "@material-symbols/svg-400": ">= 0.19.0",
58
58
  "@material-symbols/svg-700": ">= 0.19.0",
59
59
  "react": ">= 19"