@axa-fr/design-system-slash-react 2.0.0-alpha.48 → 2.0.0-alpha.49
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/dist/Accordion/Accordion.d.ts +2 -2
- package/dist/Accordion/Accordion.js +2 -2
- package/dist/Accordion/CollapseCard.d.ts +2 -2
- package/dist/Accordion/CollapseCard.js +1 -1
- package/dist/Accordion/Header.d.ts +2 -2
- package/dist/Accordion/Header.js +1 -1
- package/dist/Card/Card.d.ts +2 -1
- package/dist/Card/Card.js +1 -1
- package/dist/Form/Checkbox/Checkbox.js +2 -2
- package/dist/Form/Checkbox/CheckboxInput.d.ts +1 -1
- package/dist/Form/Checkbox/CheckboxInput.js +4 -4
- package/dist/Form/Checkbox/CheckboxItem.js +1 -1
- package/dist/Form/Choice/ChoiceInput.d.ts +1 -1
- package/dist/Form/Choice/ChoiceInput.js +3 -3
- package/dist/Form/Date/DateInput.d.ts +2 -2
- package/dist/Form/Date/DateInput.js +2 -2
- package/dist/Form/File/FileInput.d.ts +3 -3
- package/dist/Form/File/FileInput.js +2 -2
- package/dist/Form/MultiSelect/MultiSelectInput.d.ts +1 -1
- package/dist/Form/MultiSelect/MultiSelectInput.js +3 -3
- package/dist/Form/Number/NumberInput.d.ts +2 -2
- package/dist/Form/Number/NumberInput.js +2 -2
- package/dist/Form/Pass/PassInput.d.ts +2 -2
- package/dist/Form/Pass/PassInput.js +2 -2
- package/dist/Form/Radio/Radio.d.ts +2 -2
- package/dist/Form/Radio/Radio.js +8 -5
- package/dist/Form/Radio/RadioInput.d.ts +1 -1
- package/dist/Form/Radio/RadioInput.js +2 -2
- package/dist/Form/Select/SelectInput.d.ts +2 -2
- package/dist/Form/Select/SelectInput.js +3 -3
- package/dist/Form/Slider/SliderInput.d.ts +2 -2
- package/dist/Form/Slider/SliderInput.js +2 -2
- package/dist/Form/Text/TextInput.d.ts +1 -1
- package/dist/Form/Text/TextInput.js +2 -2
- package/dist/Form/Textarea/TextareaInput.d.ts +1 -1
- package/dist/Form/Textarea/TextareaInput.js +2 -2
- package/dist/Form/core/Field.d.ts +1 -1
- package/dist/Layout/MainContainer/MainContainer.d.ts +0 -1
- package/dist/Layout/MainContainer/MainContainer.js +0 -1
- package/dist/Steps/VerticalStep.d.ts +13 -32
- package/dist/Steps/VerticalStep.js +7 -7
- package/dist/Summary/index.js +1 -1
- package/dist/Tag/Tag.d.ts +15 -12
- package/dist/Tag/Tag.js +15 -10
- package/dist/index.d.ts +9 -7
- package/dist/index.js +4 -4
- package/package.json +7 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/Accordion/Accordion.scss";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { CollapseProps } from "./CollapseCard";
|
|
4
|
-
import { TDefaultProps } from "./types";
|
|
4
|
+
import { AccordionVariant, TDefaultProps } from "./types";
|
|
5
5
|
export type EnhancedProps = Partial<TDefaultProps> & {
|
|
6
6
|
onlyOne?: boolean;
|
|
7
7
|
className?: string;
|
|
8
8
|
/** @deprecated Use `variant` instead. */
|
|
9
9
|
classModifier?: string;
|
|
10
|
-
variant?:
|
|
10
|
+
variant?: AccordionVariant;
|
|
11
11
|
children: React.ReactElement<CollapseProps>[] | React.ReactElement<CollapseProps>;
|
|
12
12
|
};
|
|
13
13
|
declare const Accordion: ({ className, classModifier, variant, children, onlyOne, }: EnhancedProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,11 +5,11 @@ import { useId } from "react";
|
|
|
5
5
|
import { getComponentClassNameWithUserClassname } from "../utilities/helpers/getComponentClassName";
|
|
6
6
|
import { CollapseCard } from "./CollapseCard";
|
|
7
7
|
const defaultClassName = "af-accordion";
|
|
8
|
-
const Accordion = ({ className, classModifier, variant, children, onlyOne = false, }) => {
|
|
8
|
+
const Accordion = ({ className, classModifier, variant = "default", children, onlyOne = false, }) => {
|
|
9
9
|
const componentClassName = getComponentClassNameWithUserClassname({
|
|
10
10
|
componentClassName: defaultClassName,
|
|
11
11
|
userClassName: className,
|
|
12
|
-
classModifier: classModifier || variant || "",
|
|
12
|
+
classModifier: classModifier || (variant !== "default" && variant) || "",
|
|
13
13
|
});
|
|
14
14
|
const id = useId();
|
|
15
15
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DetailsHTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import type { AccordionActions } from "./types";
|
|
2
|
+
import type { AccordionActions, AccordionVariant } from "./types";
|
|
3
3
|
export type CollapseProps = {
|
|
4
4
|
id: string;
|
|
5
5
|
title: ReactNode;
|
|
@@ -10,6 +10,6 @@ export type CollapseProps = {
|
|
|
10
10
|
className?: string;
|
|
11
11
|
classModifier?: string;
|
|
12
12
|
actions?: AccordionActions;
|
|
13
|
-
variant?:
|
|
13
|
+
variant?: AccordionVariant;
|
|
14
14
|
};
|
|
15
15
|
export declare const CollapseCard: ({ children, name, title, id, open, onToggle, className, classModifier, actions, variant, }: CollapseProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../utilities";
|
|
2
3
|
import { Body } from "./Body";
|
|
3
4
|
import { Header } from "./Header";
|
|
4
|
-
import { getComponentClassName } from "../utilities";
|
|
5
5
|
export const CollapseCard = ({ children, name, title, id, open, onToggle, className, classModifier = "", actions, variant, }) => {
|
|
6
6
|
const headerId = id;
|
|
7
7
|
let newClassModifier = open ? "open" : "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { AccordionActions } from "./types";
|
|
2
|
+
import type { AccordionActions, AccordionVariant } from "./types";
|
|
3
3
|
export type HeaderToggleElement = {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
index: number;
|
|
@@ -11,7 +11,7 @@ export type HeaderProps = {
|
|
|
11
11
|
classModifier?: string;
|
|
12
12
|
id?: string;
|
|
13
13
|
actions?: AccordionActions;
|
|
14
|
-
variant?:
|
|
14
|
+
variant?: AccordionVariant;
|
|
15
15
|
};
|
|
16
16
|
declare const Header: ({ children, className, classModifier, id, actions, variant, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export { Header };
|
package/dist/Accordion/Header.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import arrow from "@material-symbols/svg-400/rounded/keyboard_arrow_down.svg";
|
|
3
|
-
import { Title } from "../Title/Title";
|
|
4
3
|
import { Button } from "../Button/Button";
|
|
5
4
|
import { Svg } from "../Svg/Svg";
|
|
5
|
+
import { Title } from "../Title/Title";
|
|
6
6
|
import { getComponentClassName } from "../utilities";
|
|
7
7
|
const defaultClassName = "af-accordion__item-header";
|
|
8
8
|
const Header = ({ children, className, classModifier, id, actions, variant, }) => {
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ type CardProps = ComponentProps<"button"> & {
|
|
|
8
8
|
* import villaIcon from "@material-symbols/svg-400/outlined/villa.svg"; */
|
|
9
9
|
iconSrc?: string;
|
|
10
10
|
error?: boolean;
|
|
11
|
+
active?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const Card: ({ children, className, iconSrc, orientation, error, ...otherProps }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const Card: ({ children, className, iconSrc, orientation, error, active, ...otherProps }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
package/dist/Card/Card.js
CHANGED
|
@@ -3,4 +3,4 @@ import classNames from "classnames";
|
|
|
3
3
|
import { Svg } from "../Svg";
|
|
4
4
|
import "@axa-fr/design-system-slash-css/dist/Card/Card.css";
|
|
5
5
|
const DEFAULT_CLASS_NAME = "af-card";
|
|
6
|
-
export const Card = ({ children, className, iconSrc, orientation = "vertical", error = false, ...otherProps }) => (_jsxs("button", { type: "button", className: classNames(DEFAULT_CLASS_NAME, error && `${DEFAULT_CLASS_NAME}--error`, orientation === "horizontal" && `${DEFAULT_CLASS_NAME}--${orientation}`, className), ...otherProps, children: [iconSrc ? _jsx(Svg, { src: iconSrc }) : null, children] }));
|
|
6
|
+
export const Card = ({ children, className, iconSrc, orientation = "vertical", error = false, active = false, ...otherProps }) => (_jsxs("button", { type: "button", className: classNames(DEFAULT_CLASS_NAME, active && `${DEFAULT_CLASS_NAME}--active`, error && `${DEFAULT_CLASS_NAME}--error`, orientation === "horizontal" && `${DEFAULT_CLASS_NAME}--${orientation}`, className), ...otherProps, children: [iconSrc ? _jsx(Svg, { src: iconSrc }) : null, children] }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { CheckboxItem } from "./CheckboxItem";
|
|
@@ -21,7 +21,7 @@ const CheckboxInner = forwardRef(({ id, name, options, disabled, children, value
|
|
|
21
21
|
: values.filter((v) => v !== value);
|
|
22
22
|
onChange({ values: newValues, target: { value, checked }, id, name });
|
|
23
23
|
};
|
|
24
|
-
return (_jsx(
|
|
24
|
+
return (_jsx("div", { className: "af-form__checkbox-container", children: options.map((option) => {
|
|
25
25
|
const isChecked = values ? values.indexOf(option.value) >= 0 : false;
|
|
26
26
|
return (_createElement(CheckboxItem, { ...otherProps, onChange: handleOnChange, key: option.value, className: className, isChecked: isChecked, name: name, disabled: option.disabled || disabled, ref: inputRef, ...option }, children));
|
|
27
27
|
}) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Checkbox } from "./Checkbox";
|
|
4
|
-
type Props = Omit<ComponentProps<typeof Checkbox> & ConsumerFieldProps, "
|
|
4
|
+
type Props = Omit<ComponentProps<typeof Checkbox> & ConsumerFieldProps, "placeholder">;
|
|
5
5
|
declare const CheckboxInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { CheckboxInput };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Field, useOptionsWithId } from "../core";
|
|
4
4
|
import { Checkbox } from "./Checkbox";
|
|
5
5
|
import { CheckboxModes } from "./CheckboxModes";
|
|
6
|
-
const CheckboxInput = forwardRef(({ label, mode = "default", options, ...otherProps }, inputRef) => {
|
|
6
|
+
const CheckboxInput = forwardRef(({ label, mode = "default", options, children, ...otherProps }, inputRef) => {
|
|
7
7
|
const newOptions = useOptionsWithId(options);
|
|
8
|
-
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group",
|
|
9
|
-
return (_jsx(Checkbox, { id: id, mode: mode, options: newOptions, classModifier: ariaInvalid ? `${classModifier} error` : classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }));
|
|
8
|
+
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", ...otherProps, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...props }) => {
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(Checkbox, { id: id, mode: mode, options: newOptions, classModifier: ariaInvalid ? `${classModifier} error` : classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] }));
|
|
10
10
|
} }));
|
|
11
11
|
});
|
|
12
12
|
CheckboxInput.displayName = "CheckboxInput";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import check from "@material-symbols/svg-
|
|
2
|
+
import check from "@material-symbols/svg-700/sharp/check.svg";
|
|
3
3
|
import { forwardRef, useId } from "react";
|
|
4
4
|
import { getOptionClassName } from "../core";
|
|
5
5
|
import "@axa-fr/design-system-slash-css/dist/Form/Checkbox/Checkbox.scss";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Choice } from "./Choice";
|
|
4
|
-
type Props = ComponentProps<typeof Choice> &
|
|
4
|
+
type Props = ComponentProps<typeof Choice> & ConsumerFieldProps;
|
|
5
5
|
declare const ChoiceInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { ChoiceInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Choice } from "./Choice";
|
|
@@ -6,8 +6,8 @@ const defaultOptions = [
|
|
|
6
6
|
{ label: "Oui", value: true },
|
|
7
7
|
{ label: "Non", value: false },
|
|
8
8
|
];
|
|
9
|
-
const ChoiceInput = forwardRef(({ label, options = defaultOptions, ...otherProps }, inputRef) => {
|
|
10
|
-
return (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ classModifier, id, errorId, ariaInvalid, ...props }) => (_jsx(Choice, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...props })) }));
|
|
9
|
+
const ChoiceInput = forwardRef(({ label, options = defaultOptions, children, ...otherProps }, inputRef) => {
|
|
10
|
+
return (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ classModifier, id, errorId, ariaInvalid, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Choice, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...props }), children] })) }));
|
|
11
11
|
});
|
|
12
12
|
ChoiceInput.displayName = "ChoiceInput";
|
|
13
13
|
export { ChoiceInput };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from "react";
|
|
2
2
|
import { ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Date } from "./Date";
|
|
4
|
-
type Props =
|
|
4
|
+
type Props = ConsumerFieldProps & ComponentProps<typeof Date> & {
|
|
5
5
|
helpMessage?: ReactNode;
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
declare const DateInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
8
8
|
export { DateInput };
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Date } from "./Date";
|
|
5
|
-
const DateInput = forwardRef(({
|
|
6
|
-
return (_jsx(Field, { ...otherProps, renderInput: ({ id, classModifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Date, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...otherProps }),
|
|
5
|
+
const DateInput = forwardRef(({ children, ...otherProps }, inputRef) => {
|
|
6
|
+
return (_jsx(Field, { ...otherProps, renderInput: ({ id, classModifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Date, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...otherProps }), children] })) }));
|
|
7
7
|
});
|
|
8
8
|
DateInput.displayName = "DateInput";
|
|
9
9
|
export { DateInput };
|
|
@@ -5,9 +5,9 @@ import { File } from "./File";
|
|
|
5
5
|
import { FileTable } from "./FileTable";
|
|
6
6
|
type FileProps = ComponentPropsWithoutRef<typeof File>;
|
|
7
7
|
type FileTableProps = ComponentPropsWithoutRef<typeof FileTable>;
|
|
8
|
-
type Props =
|
|
8
|
+
type Props = ConsumerFieldProps & FileProps & Pick<FileTableProps, "values" | "errors"> & {
|
|
9
9
|
fileLabel?: string;
|
|
10
10
|
helpMessage?: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
declare const FileInput: ({ values, id, name, onChange,
|
|
11
|
+
};
|
|
12
|
+
declare const FileInput: ({ values, id, name, onChange, label, errors, fileLabel, classModifier, children, ...otherFileProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export { FileInput };
|
|
@@ -4,7 +4,7 @@ import { useId } from "react";
|
|
|
4
4
|
import { Field } from "../core";
|
|
5
5
|
import { File } from "./File";
|
|
6
6
|
import { FileTable } from "./FileTable";
|
|
7
|
-
const FileInput = ({ values = [], id, name = "", onChange,
|
|
7
|
+
const FileInput = ({ values = [], id, name = "", onChange, label, errors, fileLabel, classModifier, children, ...otherFileProps }) => {
|
|
8
8
|
const onDeleteClick = (selectedId, selectInputId) => {
|
|
9
9
|
const newValues = values.filter((element) => element.id !== selectedId);
|
|
10
10
|
onChange({
|
|
@@ -16,6 +16,6 @@ const FileInput = ({ values = [], id, name = "", onChange, rightElement, label,
|
|
|
16
16
|
};
|
|
17
17
|
const generatedId = useId();
|
|
18
18
|
const actualId = id ?? generatedId;
|
|
19
|
-
return (_jsx(Field, { label: label, labelPosition: "top", id: actualId, classNameSuffix: "file", ...otherFileProps, renderInput: ({ classModifier: inputClassModifiers, id: inputId, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(File, { id: inputId, name: name, onChange: onChange, classModifier: inputClassModifiers, label: fileLabel, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }),
|
|
19
|
+
return (_jsx(Field, { label: label, labelPosition: "top", id: actualId, classNameSuffix: "file", ...otherFileProps, renderInput: ({ classModifier: inputClassModifiers, id: inputId, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(File, { id: inputId, name: name, onChange: onChange, classModifier: inputClassModifiers, label: fileLabel, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }), children] })), appendChildren: _jsx(FileTable, { errors: errors, values: values, onClick: (selectedId) => onDeleteClick(selectedId, actualId), classModifier: classModifier }) }));
|
|
20
20
|
};
|
|
21
21
|
export { FileInput };
|
|
@@ -3,5 +3,5 @@ import { type ComponentProps } from "react";
|
|
|
3
3
|
import { ConsumerFieldProps } from "../core";
|
|
4
4
|
import { MultiSelect } from "./MultiSelect";
|
|
5
5
|
type Props = ConsumerFieldProps & ComponentProps<typeof MultiSelect>;
|
|
6
|
-
declare const MultiSelectInput: ({ label, ...multiSelectProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const MultiSelectInput: ({ label, children, ...multiSelectProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { MultiSelectInput };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/Form/MultiSelect/MultiSelect.scss";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { MultiSelect } from "./MultiSelect";
|
|
5
|
-
const MultiSelectInput = ({ label, ...multiSelectProps }) => {
|
|
5
|
+
const MultiSelectInput = ({ label, children, ...multiSelectProps }) => {
|
|
6
6
|
return (_jsx(Field, { label: label, ...multiSelectProps, classNameSuffix: "select", renderInput: ({ id, ariaInvalid, errorId, ...props }) => {
|
|
7
|
-
return (_jsx(MultiSelect, { id: id, "aria-invalid": ariaInvalid, "aria-describedby": errorId, ...props }));
|
|
7
|
+
return (_jsxs(_Fragment, { children: [_jsx(MultiSelect, { id: id, "aria-invalid": ariaInvalid, "aria-describedby": errorId, ...props }), children] }));
|
|
8
8
|
} }));
|
|
9
9
|
};
|
|
10
10
|
export { MultiSelectInput };
|
|
@@ -4,6 +4,6 @@ import "@axa-fr/design-system-slash-css/dist/Form/core/FormCore.scss";
|
|
|
4
4
|
import { ComponentPropsWithRef } from "react";
|
|
5
5
|
import { type ConsumerFieldProps } from "../core";
|
|
6
6
|
import { Number } from "./Number";
|
|
7
|
-
type Props =
|
|
8
|
-
export declare const NumberInput: ({
|
|
7
|
+
type Props = ConsumerFieldProps & ComponentPropsWithRef<typeof Number>;
|
|
8
|
+
export declare const NumberInput: ({ children, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -4,6 +4,6 @@ import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
|
4
4
|
import "@axa-fr/design-system-slash-css/dist/Form/core/FormCore.scss";
|
|
5
5
|
import { Field } from "../core";
|
|
6
6
|
import { Number } from "./Number";
|
|
7
|
-
export const NumberInput = ({
|
|
8
|
-
return (_jsx(Field, { ...props, renderInput: ({ id, classModifier, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(Number, { id: id, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }),
|
|
7
|
+
export const NumberInput = ({ children, ...props }) => {
|
|
8
|
+
return (_jsx(Field, { ...props, renderInput: ({ id, classModifier, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(Number, { id: id, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }), children] })) }));
|
|
9
9
|
};
|
|
@@ -5,6 +5,6 @@ type PassProps = ComponentProps<typeof Pass>;
|
|
|
5
5
|
type Props = Omit<ConsumerFieldProps & PassProps & {
|
|
6
6
|
helpMessage?: ReactNode;
|
|
7
7
|
score?: string;
|
|
8
|
-
}, "onToggleType" | "type"
|
|
9
|
-
declare const PassInput: ({
|
|
8
|
+
}, "onToggleType" | "type">;
|
|
9
|
+
declare const PassInput: ({ children, score, classModifier, disabled, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export { PassInput };
|
|
@@ -23,9 +23,9 @@ const calculateStrength = (score) => {
|
|
|
23
23
|
}
|
|
24
24
|
return strengthList[strength];
|
|
25
25
|
};
|
|
26
|
-
const PassInput = ({
|
|
26
|
+
const PassInput = ({ children, score, classModifier, disabled, ...props }) => {
|
|
27
27
|
const strength = calculateStrength(score);
|
|
28
28
|
const [type, setType] = useState("password");
|
|
29
|
-
return (_jsx(Field, { ...props, classModifier: classModifier, renderInput: ({ id, classModifier: modifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Pass, { ...props, type: type, id: id, disabled: disabled, classModifier: `${modifier} ${strength}`, "aria-describedby": errorId, "aria-invalid": ariaInvalid, onToggleType: () => setType(type === "password" ? "text" : "password") }),
|
|
29
|
+
return (_jsx(Field, { ...props, classModifier: classModifier, renderInput: ({ id, classModifier: modifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Pass, { ...props, type: type, id: id, disabled: disabled, classModifier: `${modifier} ${strength}`, "aria-describedby": errorId, "aria-invalid": ariaInvalid, onToggleType: () => setType(type === "password" ? "text" : "password") }), children] })) }));
|
|
30
30
|
};
|
|
31
31
|
export { PassInput };
|
|
@@ -3,7 +3,7 @@ export declare enum RadioModes {
|
|
|
3
3
|
classic = "classic",
|
|
4
4
|
default = "default",
|
|
5
5
|
inline = "inline",
|
|
6
|
-
|
|
6
|
+
cardRadio = "cardRadio"
|
|
7
7
|
}
|
|
8
8
|
declare const Radio: import("react").ForwardRefExoticComponent<(({
|
|
9
9
|
options: Option[];
|
|
@@ -12,7 +12,7 @@ declare const Radio: import("react").ForwardRefExoticComponent<(({
|
|
|
12
12
|
orientation?: "horizontal" | "vertical";
|
|
13
13
|
error?: boolean;
|
|
14
14
|
}, "ref"> & {
|
|
15
|
-
mode: "
|
|
15
|
+
mode: "cardRadio";
|
|
16
16
|
}) | Omit<{
|
|
17
17
|
options: Option[];
|
|
18
18
|
} & Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "type" | "checked"> & {
|
package/dist/Form/Radio/Radio.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, } from "react";
|
|
4
|
-
import
|
|
4
|
+
import classNames from "classnames";
|
|
5
5
|
import { RadioCardGroup } from "./RadioCardGroup";
|
|
6
|
+
import { RadioItem } from "./RadioItem";
|
|
6
7
|
export var RadioModes;
|
|
7
8
|
(function (RadioModes) {
|
|
8
9
|
RadioModes["classic"] = "classic";
|
|
9
10
|
RadioModes["default"] = "default";
|
|
10
11
|
RadioModes["inline"] = "inline";
|
|
11
|
-
RadioModes["
|
|
12
|
+
RadioModes["cardRadio"] = "cardRadio";
|
|
12
13
|
})(RadioModes || (RadioModes = {}));
|
|
13
14
|
const getClassNameMode = (mode) => {
|
|
14
15
|
switch (mode) {
|
|
@@ -16,7 +17,7 @@ const getClassNameMode = (mode) => {
|
|
|
16
17
|
return "af-form__radio";
|
|
17
18
|
case RadioModes.inline:
|
|
18
19
|
return "af-form__radio-inline";
|
|
19
|
-
case RadioModes.
|
|
20
|
+
case RadioModes.cardRadio:
|
|
20
21
|
return "af-form__radio-card";
|
|
21
22
|
default:
|
|
22
23
|
return "af-form__radio-custom";
|
|
@@ -25,10 +26,12 @@ const getClassNameMode = (mode) => {
|
|
|
25
26
|
const Radio = forwardRef(({ options, value = "", children, disabled, ...otherProps }, inputRef) => {
|
|
26
27
|
const { mode, ...onlyNecessaryProps } = otherProps;
|
|
27
28
|
const classNameMode = getClassNameMode(mode ?? "default");
|
|
28
|
-
if (mode === "
|
|
29
|
+
if (mode === "cardRadio") {
|
|
29
30
|
return (_jsx(RadioCardGroup, { ...onlyNecessaryProps, options: options, disabled: disabled, value: value, children: children }));
|
|
30
31
|
}
|
|
31
|
-
return
|
|
32
|
+
return (_jsx("div", { className: classNames("af-form__radio-group", [
|
|
33
|
+
{ "af-form__radio-group-classic": mode === RadioModes.classic },
|
|
34
|
+
]), children: options.map((option) => (_createElement(RadioItem, { ...onlyNecessaryProps, key: option.value, isChecked: option.value === value, disabled: option.disabled || disabled, className: classNameMode, ref: inputRef, ...option }, children))) }));
|
|
32
35
|
});
|
|
33
36
|
Radio.displayName = "EnhancedInputRadio";
|
|
34
37
|
export { Radio };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Radio } from "./Radio";
|
|
4
|
-
type RadioInputProps =
|
|
4
|
+
type RadioInputProps = ConsumerFieldProps & ComponentPropsWithoutRef<typeof Radio>;
|
|
5
5
|
declare const RadioInput: import("react").ForwardRefExoticComponent<RadioInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { RadioInput };
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Field, useOptionsWithId } from "../core";
|
|
4
4
|
import { Radio, RadioModes } from "./Radio";
|
|
5
|
-
const RadioInput = forwardRef(({ label, mode = "default", options,
|
|
5
|
+
const RadioInput = forwardRef(({ label, mode = "default", options, children, ...props }, inputRef) => {
|
|
6
6
|
const labelPosition = mode === RadioModes.classic ? "top" : "center";
|
|
7
7
|
const newOptions = useOptionsWithId(options);
|
|
8
|
-
return (_jsx(Field, { label: label, labelPosition: labelPosition, roleContainer: mode !== "
|
|
8
|
+
return (_jsx(Field, { label: label, labelPosition: labelPosition, roleContainer: mode !== "cardRadio" ? "radiogroup" : undefined, ...props, renderInput: ({ classModifier, ariaInvalid, errorId, ...radioProps }) => (_jsxs(_Fragment, { children: [_jsx(Radio, { options: newOptions, mode: mode, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...radioProps }), children] })) }));
|
|
9
9
|
});
|
|
10
10
|
RadioInput.displayName = "EnhancedInputRadio";
|
|
11
11
|
export { RadioInput };
|
|
@@ -26,7 +26,7 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
26
26
|
} & Record<string, unknown>) => import("react").ReactNode;
|
|
27
27
|
appendChildren?: import("react").ReactNode;
|
|
28
28
|
}, "children" | "renderInput" | "classNameSuffix"> & {
|
|
29
|
-
|
|
29
|
+
children?: import("react").ReactNode;
|
|
30
30
|
} & Omit<Omit<{
|
|
31
31
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
32
32
|
className?: string | undefined | undefined;
|
|
@@ -355,7 +355,7 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
355
355
|
} & Record<string, unknown>) => import("react").ReactNode;
|
|
356
356
|
appendChildren?: import("react").ReactNode;
|
|
357
357
|
}, "children" | "renderInput" | "classNameSuffix"> & {
|
|
358
|
-
|
|
358
|
+
children?: import("react").ReactNode;
|
|
359
359
|
} & Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & {
|
|
360
360
|
options?: OptionHTMLAttributes<HTMLOptionElement>[];
|
|
361
361
|
classModifier?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, } from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Select } from "./Select";
|
|
5
|
-
const SelectInput = forwardRef(({ label, options, ...props }, inputRef) => {
|
|
6
|
-
return (_jsx(Field, { label: label, classNameSuffix: "select", ...props, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...otherSelectProps }) => (_jsx(Select, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...otherSelectProps })) }));
|
|
5
|
+
const SelectInput = forwardRef(({ label, options, children, ...props }, inputRef) => {
|
|
6
|
+
return (_jsx(Field, { label: label, classNameSuffix: "select", ...props, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...otherSelectProps }) => (_jsxs(_Fragment, { children: [_jsx(Select, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...otherSelectProps }), children] })) }));
|
|
7
7
|
});
|
|
8
8
|
SelectInput.displayName = "SelectInput";
|
|
9
9
|
export { SelectInput };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentProps } from "react";
|
|
2
2
|
import { ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Slider } from "./Slider";
|
|
4
|
-
type Props =
|
|
4
|
+
type Props = ConsumerFieldProps & ComponentProps<typeof Slider>;
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated This component is deprecated and will be removed in a future major release.
|
|
7
7
|
*/
|
|
8
|
-
declare const SliderInput: ({
|
|
8
|
+
declare const SliderInput: ({ children, name, options, label, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export { SliderInput };
|
|
@@ -4,7 +4,7 @@ import { Slider } from "./Slider";
|
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This component is deprecated and will be removed in a future major release.
|
|
6
6
|
*/
|
|
7
|
-
const SliderInput = ({
|
|
8
|
-
return (_jsx(Field, { label: label, ...props, renderInput: ({ id, classModifier, ...sliderProps }) => (_jsxs(_Fragment, { children: [_jsx(Slider, { id: id, classModifier: classModifier, name: name, options: options, ...sliderProps }),
|
|
7
|
+
const SliderInput = ({ children, name, options, label, ...props }) => {
|
|
8
|
+
return (_jsx(Field, { label: label, ...props, renderInput: ({ id, classModifier, ...sliderProps }) => (_jsxs(_Fragment, { children: [_jsx(Slider, { id: id, classModifier: classModifier, name: name, options: options, ...sliderProps }), children] })) }));
|
|
9
9
|
};
|
|
10
10
|
export { SliderInput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
2
|
import { ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Text } from "./Text";
|
|
4
|
-
export type TextInputProps =
|
|
4
|
+
export type TextInputProps = ConsumerFieldProps & ComponentProps<typeof Text>;
|
|
5
5
|
declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { TextInput };
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Text } from "./Text";
|
|
5
|
-
const TextInput = forwardRef(({
|
|
6
|
-
return (_jsx(Field, { ...props, renderInput: ({ id, classModifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Text, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }),
|
|
5
|
+
const TextInput = forwardRef(({ children, ...props }, inputRef) => {
|
|
6
|
+
return (_jsx(Field, { ...props, renderInput: ({ id, classModifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Text, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] })) }));
|
|
7
7
|
});
|
|
8
8
|
TextInput.displayName = "TextInput";
|
|
9
9
|
export { TextInput };
|
|
@@ -4,6 +4,6 @@ import "@axa-fr/design-system-slash-css/dist/Form/core/FormCore.scss";
|
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
5
|
import { type ConsumerFieldProps } from "../core";
|
|
6
6
|
import { Textarea } from "./Textarea";
|
|
7
|
-
type Props =
|
|
7
|
+
type Props = ConsumerFieldProps & ComponentProps<typeof Textarea>;
|
|
8
8
|
declare const TextareaInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
9
9
|
export { TextareaInput };
|
|
@@ -5,8 +5,8 @@ import "@axa-fr/design-system-slash-css/dist/Form/core/FormCore.scss";
|
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
6
|
import { Field } from "../core";
|
|
7
7
|
import { Textarea } from "./Textarea";
|
|
8
|
-
const TextareaInput = forwardRef(({ label,
|
|
9
|
-
return (_jsx(Field, { label: label, labelPosition: "top", classNameSuffix: "textarea", ...props, renderInput: ({ id, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(Textarea, { id: id, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }),
|
|
8
|
+
const TextareaInput = forwardRef(({ label, children, ...props }, inputRef) => {
|
|
9
|
+
return (_jsx(Field, { label: label, labelPosition: "top", classNameSuffix: "textarea", ...props, renderInput: ({ id, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(Textarea, { id: id, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }), children] })) }));
|
|
10
10
|
});
|
|
11
11
|
TextareaInput.displayName = "TextareaInput";
|
|
12
12
|
export { TextareaInput };
|
|
@@ -74,7 +74,7 @@ export type ConsumerFieldProps = Omit<InputProps, "renderInput" | "classNameSuff
|
|
|
74
74
|
/**
|
|
75
75
|
* Element appended right to the input
|
|
76
76
|
*/
|
|
77
|
-
|
|
77
|
+
children?: ReactNode;
|
|
78
78
|
};
|
|
79
79
|
export declare const Field: ({ classNameContainerInput, classNameContainerLabel, className, label, forceDisplayMessage, message, messageType, required, classModifier, disabled, helpMessage, id, isVisible, roleContainer, ariaLabelContainer, isLabelContainerLinkedToInput, labelPosition, classNameSuffix, renderInput, appendChildren, ...otherProps }: InputProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
80
80
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
|
|
2
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/MainContainer/MainContainer.css";
|
|
3
2
|
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
4
3
|
type MainContainerProps = ComponentPropsWithoutRef<"main"> & PropsWithChildren;
|
|
5
4
|
export declare const MainContainer: ({ children, ...othersProps }: MainContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/MainContainer/MainContainer.css";
|
|
3
2
|
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
4
3
|
export const MainContainer = ({ children, ...othersProps }) => (_jsx("main", { className: "af-container", ...othersProps, children: children }));
|
|
@@ -2,47 +2,28 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import type { VerticalStepMode } from "./types";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/Steps/VerticalStep.css";
|
|
4
4
|
type Props = {
|
|
5
|
-
/**
|
|
6
|
-
* title - The title of the step.
|
|
7
|
-
*/
|
|
5
|
+
/** The title of the step. */
|
|
8
6
|
title: string;
|
|
9
|
-
/**
|
|
10
|
-
* id - The id of the step, used for accessibility.
|
|
11
|
-
* It should be unique within the document.
|
|
12
|
-
*/
|
|
7
|
+
/** The id of the step, used for accessibility. It should be unique within the document. */
|
|
13
8
|
id: string;
|
|
14
|
-
/**
|
|
15
|
-
* stepMode - The mode of the step, can be "edited", "validated", or "locked".
|
|
16
|
-
*/
|
|
9
|
+
/** The mode of the step, can be "edited", "validated", or "locked". */
|
|
17
10
|
stepMode: VerticalStepMode;
|
|
18
|
-
/**
|
|
19
|
-
* onEdit - The function to call when the edit button is clicked.
|
|
20
|
-
*/
|
|
11
|
+
/** The function to call when the edit button is clicked. */
|
|
21
12
|
onEdit: React.MouseEventHandler<HTMLButtonElement>;
|
|
22
|
-
/**
|
|
23
|
-
* form - The content of the form to display when the step is in "edited" mode.
|
|
24
|
-
*/
|
|
13
|
+
/** The content of the form to display when the step is in "edited" mode. */
|
|
25
14
|
form: ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* restitution - The content to display when the step is in "validated" mode.
|
|
28
|
-
*/
|
|
15
|
+
/** The content to display when the step is in "validated" mode. */
|
|
29
16
|
restitution: ReactNode;
|
|
30
|
-
/**
|
|
31
|
-
* editButtonLabel - The label of the edit button.
|
|
32
|
-
*/
|
|
17
|
+
/** The label of the edit button. */
|
|
33
18
|
editButtonLabel?: string;
|
|
34
|
-
/**
|
|
35
|
-
* editButtonAriaLabel - The aria-label of the edit button.
|
|
36
|
-
*/
|
|
19
|
+
/** The aria-label of the edit button. */
|
|
37
20
|
editButtonAriaLabel?: string;
|
|
38
|
-
/**
|
|
39
|
-
* showRestitution - Whether to show the restitution content when the step is validated.
|
|
40
|
-
*/
|
|
21
|
+
/** Whether to show the restitution content when the step is validated. */
|
|
41
22
|
showRestitution?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* contentRight - Additional content to display on the right side of the title.
|
|
44
|
-
*/
|
|
23
|
+
/** Additional content to display on the right side of the title. */
|
|
45
24
|
contentRight?: string;
|
|
25
|
+
/** The aria-label for the additional content on the right side of the title. */
|
|
26
|
+
contentRightAriaLabel?: string;
|
|
46
27
|
};
|
|
47
|
-
export declare const VerticalStep: ({ title, id, stepMode, editButtonLabel, editButtonAriaLabel, onEdit, form, restitution, showRestitution, contentRight, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const VerticalStep: ({ title, id, stepMode, editButtonLabel, editButtonAriaLabel, contentRightAriaLabel, onEdit, form, restitution, showRestitution, contentRight, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
48
29
|
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
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
2
|
import check from "@material-symbols/svg-400/sharp/check.svg";
|
|
3
|
+
import edit from "@material-symbols/svg-400/sharp/edit-fill.svg";
|
|
5
4
|
import lock from "@material-symbols/svg-400/sharp/lock-fill.svg";
|
|
6
|
-
import
|
|
5
|
+
import classNames from "classnames";
|
|
7
6
|
import { Svg } from "../Svg";
|
|
7
|
+
import { Title } from "../Title/Title";
|
|
8
8
|
import "@axa-fr/design-system-slash-css/dist/Steps/VerticalStep.css";
|
|
9
9
|
import { Button } from "../Button/Button";
|
|
10
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, contentRight, }) => {
|
|
11
|
+
export const VerticalStep = ({ title, id, stepMode, editButtonLabel = "Modifier", editButtonAriaLabel = `Modifier l'étape ${title}`, contentRightAriaLabel = `Contenu supplémentaire étape verticale ${title}`, onEdit, form, restitution, showRestitution = true, contentRight, }) => {
|
|
12
12
|
const isStepInEdition = stepMode === "edited";
|
|
13
13
|
const isStepValidated = stepMode === "validated";
|
|
14
14
|
const isStepLocked = stepMode === "locked";
|
|
15
|
-
return (_jsxs("
|
|
15
|
+
return (_jsxs("section", { className: classNames(defaultClassName, {
|
|
16
16
|
[`${defaultClassName}--edition`]: isStepInEdition,
|
|
17
|
-
}), children: [_jsxs("div", { className: classNames("af-vertical-step-icon", {
|
|
17
|
+
}), "aria-label": `Étape verticale ${title}`, children: [_jsxs("div", { className: classNames("af-vertical-step-icon", {
|
|
18
18
|
[`${defaultClassName}-icon--validated`]: isStepValidated,
|
|
19
19
|
[`${defaultClassName}-icon--locked`]: isStepLocked,
|
|
20
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] }), _jsx(Title, { id: id, contentLeft: isStepValidated ? (
|
|
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] }), _jsx(Title, { id: id, contentLeft: isStepValidated ? (_jsx(Button, { "aria-label": editButtonAriaLabel, onClick: onEdit, variant: "ghost", leftIcon: _jsx(Svg, { role: "presentation", src: edit }), children: editButtonLabel })) : undefined, contentRight: _jsx("section", { "aria-label": contentRightAriaLabel, children: contentRight }), children: title }), 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
22
|
};
|
package/dist/Summary/index.js
CHANGED
|
@@ -7,5 +7,5 @@ export const Summary = ({ messages = [], isVisible = true, title = "Invalid form
|
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
9
|
const variant = classModifier === "danger" ? "warning" : classModifier;
|
|
10
|
-
return (_jsx(Message, {
|
|
10
|
+
return (_jsx(Message, { title: title, variant: variant, ...args, children: _jsx("ul", { className: "af-summary__message-list", children: messages.map((message) => (_jsx("li", { className: "af-summary__message-item", children: message }, `message_${generateId({ message })}`))) }) }));
|
|
11
11
|
};
|
package/dist/Tag/Tag.d.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, PropsWithChildren } from "react";
|
|
2
1
|
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @deprecated instead use warning
|
|
6
|
-
*/
|
|
7
|
-
type TagModifierDecrepated = "danger" | "info";
|
|
2
|
+
import { ComponentPropsWithRef, PropsWithChildren } from "react";
|
|
3
|
+
export type TagVariants = "success" | "information" | "warning" | "error" | "default" | "dark" | "purple" | "gray" | "white";
|
|
8
4
|
type TagProps = ComponentPropsWithRef<"span"> & {
|
|
9
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Modifier class to apply specific styles. Note: "danger" is deprecated, use "warning" instead. "info" is deprecated, use "information" instead
|
|
7
|
+
* @deprecated Use `variant` instead
|
|
8
|
+
*/
|
|
9
|
+
classModifier?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Variant of the tag to apply specific styles.
|
|
12
|
+
* "warning" replaces the deprecated "danger
|
|
13
|
+
* "information" replaces the deprecated "info"
|
|
14
|
+
* @default "default"
|
|
15
|
+
*/
|
|
16
|
+
variant?: TagVariants;
|
|
10
17
|
disabled?: boolean;
|
|
11
18
|
};
|
|
12
19
|
/**
|
|
@@ -15,13 +22,9 @@ type TagProps = ComponentPropsWithRef<"span"> & {
|
|
|
15
22
|
* @component
|
|
16
23
|
* @example
|
|
17
24
|
* // Basic usage
|
|
18
|
-
* <Tag
|
|
25
|
+
* <Tag variant="success">Success Tag</Tag>
|
|
19
26
|
*
|
|
20
|
-
* @param {object} props - The properties object.
|
|
21
27
|
* @param {React.ReactNode} props.children - The content to be displayed inside the tag.
|
|
22
|
-
* @param {string} [props.className] - Additional class names to apply to the tag.
|
|
23
|
-
* @param {string} [props.classModifier] - Modifier class to apply specific styles. Note: "danger" is deprecated, use "warning" instead. "info" is deprecated, use "information" instead
|
|
24
|
-
* @param {boolean} [props.disabled] - If true, the tag will be disabled.
|
|
25
28
|
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
26
29
|
* @returns {JSX.Element} The rendered Tag component.
|
|
27
30
|
*/
|
package/dist/Tag/Tag.js
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { getComponentClassName } from "../utilities";
|
|
4
2
|
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { getComponentClassNameWithUserClassname } from "../utilities/helpers/getComponentClassName";
|
|
5
5
|
/**
|
|
6
6
|
* Tag component to display a label with various styles.
|
|
7
7
|
*
|
|
8
8
|
* @component
|
|
9
9
|
* @example
|
|
10
10
|
* // Basic usage
|
|
11
|
-
* <Tag
|
|
11
|
+
* <Tag variant="success">Success Tag</Tag>
|
|
12
12
|
*
|
|
13
|
-
* @param {object} props - The properties object.
|
|
14
13
|
* @param {React.ReactNode} props.children - The content to be displayed inside the tag.
|
|
15
|
-
* @param {string} [props.className] - Additional class names to apply to the tag.
|
|
16
|
-
* @param {string} [props.classModifier] - Modifier class to apply specific styles. Note: "danger" is deprecated, use "warning" instead. "info" is deprecated, use "information" instead
|
|
17
|
-
* @param {boolean} [props.disabled] - If true, the tag will be disabled.
|
|
18
14
|
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
19
15
|
* @returns {JSX.Element} The rendered Tag component.
|
|
20
16
|
*/
|
|
21
|
-
export const Tag = forwardRef(({ children, className, classModifier
|
|
22
|
-
const
|
|
17
|
+
export const Tag = forwardRef(({ children, className, classModifier, variant, ...otherProps }, ref) => {
|
|
18
|
+
const actualModifier = variant || classModifier || "default";
|
|
19
|
+
const componentClassName = getComponentClassNameWithUserClassname({
|
|
20
|
+
userClassName: className,
|
|
21
|
+
classModifier: actualModifier,
|
|
22
|
+
componentClassName: "af-tag",
|
|
23
|
+
});
|
|
23
24
|
// Kept for backward compatibility. May be removed in a future version
|
|
24
|
-
const badgeClassName =
|
|
25
|
+
const badgeClassName = getComponentClassNameWithUserClassname({
|
|
26
|
+
userClassName: className,
|
|
27
|
+
classModifier: actualModifier,
|
|
28
|
+
componentClassName: "af-badge",
|
|
29
|
+
});
|
|
25
30
|
return (_jsx("span", { ref: ref, className: `${componentClassName} ${badgeClassName}`, ...otherProps, children: children }));
|
|
26
31
|
});
|
|
27
32
|
Tag.displayName = "Tag";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/common/icons.scss";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/common/tokens.css";
|
|
4
|
-
import "@fontsource/source-sans-pro";
|
|
4
|
+
import "@fontsource/source-sans-pro/400.css";
|
|
5
5
|
import "@fontsource/source-sans-pro/700.css";
|
|
6
6
|
import { Message } from "./Messages/Message";
|
|
7
7
|
import { Tag } from "./Tag/Tag";
|
|
8
8
|
export { Action } from "./Action/Action";
|
|
9
|
-
/** @deprecated Use `Tag` instead. */
|
|
10
|
-
declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("react").PropsWithChildren<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
11
|
-
classModifier?: `${("error" | "warning" | "success" | "information" | "default" | "dark" | "purple" | "gray") | ("info" | "danger")}` | string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
}>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
14
|
-
export { Badge, Tag };
|
|
15
9
|
export { Button } from "./Button/Button";
|
|
16
10
|
export type { ButtonVariant } from "./Button/Button";
|
|
17
11
|
export { Card } from "./Card/Card";
|
|
@@ -42,6 +36,14 @@ export { Svg } from "./Svg";
|
|
|
42
36
|
export { Tabs } from "./Tabs/Tabs";
|
|
43
37
|
export { Title } from "./Title/Title";
|
|
44
38
|
export { getComponentClassName } from "./utilities";
|
|
39
|
+
/** @deprecated Use `Tag` instead. */
|
|
40
|
+
declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("react").PropsWithChildren<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
41
|
+
classModifier?: string;
|
|
42
|
+
variant?: import("./Tag/Tag").TagVariants;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
45
|
+
export type { TagVariants } from "./Tag/Tag";
|
|
46
|
+
export { Badge, Tag };
|
|
45
47
|
/**
|
|
46
48
|
* @deprecated `Alert` has been renamed `Message` in order to comply with UX naming of components. Use `Message` instead.
|
|
47
49
|
* @see {@link Message}
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/common/icons.scss";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/common/tokens.css";
|
|
4
|
-
import "@fontsource/source-sans-pro";
|
|
4
|
+
import "@fontsource/source-sans-pro/400.css";
|
|
5
5
|
import "@fontsource/source-sans-pro/700.css";
|
|
6
6
|
import { Message } from "./Messages/Message";
|
|
7
7
|
import { Tag } from "./Tag/Tag";
|
|
8
8
|
export { Action } from "./Action/Action";
|
|
9
|
-
/** @deprecated Use `Tag` instead. */
|
|
10
|
-
const Badge = Tag;
|
|
11
|
-
export { Badge, Tag };
|
|
12
9
|
export { Button } from "./Button/Button";
|
|
13
10
|
export { Card } from "./Card/Card";
|
|
14
11
|
export { Divider } from "./Divider/Divider";
|
|
@@ -38,6 +35,9 @@ export { Svg } from "./Svg";
|
|
|
38
35
|
export { Tabs } from "./Tabs/Tabs";
|
|
39
36
|
export { Title } from "./Title/Title";
|
|
40
37
|
export { getComponentClassName } from "./utilities";
|
|
38
|
+
/** @deprecated Use `Tag` instead. */
|
|
39
|
+
const Badge = Tag;
|
|
40
|
+
export { Badge, Tag };
|
|
41
41
|
/**
|
|
42
42
|
* @deprecated `Alert` has been renamed `Message` in order to comply with UX naming of components. Use `Message` instead.
|
|
43
43
|
* @see {@link Message}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-slash-react",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -47,19 +47,22 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@axa-fr/design-system-slash-css": "2.0.0-alpha.
|
|
50
|
+
"@axa-fr/design-system-slash-css": "2.0.0-alpha.49",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
|
+
"@material-symbols/svg-700": ">= 0.19.0",
|
|
52
53
|
"react": ">= 18"
|
|
53
54
|
},
|
|
54
55
|
"peerDependenciesMeta": {
|
|
55
56
|
"@material-symbols/svg-400": {
|
|
56
|
-
"optional":
|
|
57
|
+
"optional": false
|
|
58
|
+
},
|
|
59
|
+
"@material-symbols/svg-700": {
|
|
60
|
+
"optional": false
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
"dependencies": {
|
|
60
64
|
"@floating-ui/react": "^0.27.8",
|
|
61
65
|
"@fontsource/source-sans-pro": "^5.2.5",
|
|
62
|
-
"@material-symbols/svg-700": ">= 0.19.0",
|
|
63
66
|
"@tanem/svg-injector": "^10.1.68",
|
|
64
67
|
"classnames": "^2.5.1",
|
|
65
68
|
"dompurify": "^3.1.5",
|