@axa-fr/design-system-slash-react 1.2.1-alpha.52 → 1.2.1-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.
@@ -0,0 +1,16 @@
1
+ import { ReactNode } from "react";
2
+ import type { VerticalStepMode } from "./types";
3
+ import "@axa-fr/design-system-slash-css/dist/Steps/VerticalStep.css";
4
+ type Props = {
5
+ title: string;
6
+ id: string;
7
+ stepMode: VerticalStepMode;
8
+ onEdit: React.MouseEventHandler<HTMLButtonElement>;
9
+ form: ReactNode;
10
+ restitution: ReactNode;
11
+ editButtonLabel?: string;
12
+ editButtonAriaLabel?: string;
13
+ showRestitution?: boolean;
14
+ };
15
+ export declare const VerticalStep: ({ title, id, stepMode, editButtonLabel, editButtonAriaLabel, onEdit, form, restitution, showRestitution, }: Props) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ import edit from "@material-symbols/svg-400/sharp/edit-fill.svg";
4
+ import check from "@material-symbols/svg-400/sharp/check.svg";
5
+ import lock from "@material-symbols/svg-400/sharp/lock-fill.svg";
6
+ import { Title } from "../Title/Title";
7
+ import { Svg } from "../Svg";
8
+ import "@axa-fr/design-system-slash-css/dist/Steps/VerticalStep.css";
9
+ import { Button } from "../Button/Button";
10
+ const defaultClassName = "af-vertical-step";
11
+ export const VerticalStep = ({ title, id, stepMode, editButtonLabel = "Modifier", editButtonAriaLabel = `Modifier l'étape ${title}`, onEdit, form, restitution, showRestitution = true, }) => {
12
+ const isStepInEdition = stepMode === "edited";
13
+ const isStepValidated = stepMode === "validated";
14
+ const isStepLocked = stepMode === "locked";
15
+ return (_jsxs("div", { className: classNames(defaultClassName, {
16
+ [`${defaultClassName}--edition`]: isStepInEdition,
17
+ }), children: [_jsxs("div", { className: classNames("af-vertical-step-icon", {
18
+ [`${defaultClassName}-icon--validated`]: isStepValidated,
19
+ [`${defaultClassName}-icon--locked`]: isStepLocked,
20
+ [`${defaultClassName}-icon--edited`]: isStepInEdition,
21
+ }), children: [isStepValidated ? _jsx(Svg, { role: "presentation", src: check }) : null, isStepLocked ? _jsx(Svg, { role: "presentation", src: lock }) : null, isStepInEdition ? _jsx(Svg, { role: "presentation", src: edit }) : null] }), _jsxs(Title, { className: classNames("af-title", `${defaultClassName}-title`), id: id, children: [title, isStepValidated ? (_jsxs(Button, { "aria-label": editButtonAriaLabel, onClick: onEdit, className: "af-vertical-step-title-button", children: [_jsx(Svg, { role: "presentation", src: edit }), editButtonLabel] })) : null] }), isStepInEdition ? _jsx("section", { children: form }) : null, isStepValidated && showRestitution ? (_jsx("section", { children: restitution })) : null, isStepInEdition ? (_jsx("div", { className: classNames(`${defaultClassName}-icon ${defaultClassName}-icon--lastIcon`), children: _jsx(Svg, { role: "presentation", src: check }) })) : null] }));
22
+ };
@@ -2,3 +2,4 @@ import "@axa-fr/design-system-slash-css/dist/Steps/Steps.scss";
2
2
  export { Step } from "./Step";
3
3
  export { StepBase } from "./StepBase";
4
4
  export { Steps } from "./Steps";
5
+ export { VerticalStep } from "./VerticalStep";
@@ -2,3 +2,4 @@ import "@axa-fr/design-system-slash-css/dist/Steps/Steps.scss";
2
2
  export { Step } from "./Step";
3
3
  export { StepBase } from "./StepBase";
4
4
  export { Steps } from "./Steps";
5
+ export { VerticalStep } from "./VerticalStep";
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ export type CustomClickEvent = {
3
+ href: string;
4
+ number?: ReactNode;
5
+ id: string;
6
+ title: string;
7
+ };
8
+ export type VerticalStepMode = "edited" | "locked" | "validated";
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ export { Header, HeaderTitle, Infos, MenuTitleWrapper, Name, NavBar, NavBarBase,
26
26
  export { Link, type LinkProps } from "./Link/Link";
27
27
  export { BooleanModal, Modal, ModalBody, ModalFooter, ModalHeader, ModalHeaderBase, } from "./ModalAgent";
28
28
  export { ArticleRestitution, HeaderRestitution, Restitution, RestitutionList, SectionRestitution, SectionRestitutionColumn, SectionRestitutionRow, SectionRestitutionTitle, } from "./Restitution";
29
- export { Step, StepBase, Steps } from "./Steps";
29
+ export { Step, StepBase, Steps, VerticalStep } from "./Steps";
30
30
  export { Summary } from "./Summary";
31
31
  export { Svg } from "./Svg";
32
32
  export { Tabs } from "./Tabs/Tabs";
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ export { Header, HeaderTitle, Infos, MenuTitleWrapper, Name, NavBar, NavBarBase,
26
26
  export { Link } from "./Link/Link";
27
27
  export { BooleanModal, Modal, ModalBody, ModalFooter, ModalHeader, ModalHeaderBase, } from "./ModalAgent";
28
28
  export { ArticleRestitution, HeaderRestitution, Restitution, RestitutionList, SectionRestitution, SectionRestitutionColumn, SectionRestitutionRow, SectionRestitutionTitle, } from "./Restitution";
29
- export { Step, StepBase, Steps } from "./Steps";
29
+ export { Step, StepBase, Steps, VerticalStep } from "./Steps";
30
30
  export { Summary } from "./Summary";
31
31
  export { Svg } from "./Svg";
32
32
  export { Tabs } from "./Tabs/Tabs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-slash-react",
3
- "version": "1.2.1-alpha.52",
3
+ "version": "1.2.1-alpha.54",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "homepage": "https://github.com/AxaFrance/design-system#readme",
49
49
  "peerDependencies": {
50
- "@axa-fr/design-system-slash-css": "1.2.1-alpha.52",
50
+ "@axa-fr/design-system-slash-css": "1.2.1-alpha.54",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },