@axa-fr/design-system-slash-react 2.0.0-tags-slash-2-0-0-RC-4.1 → 2.0.0-tags-client-2-0-2.1
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/Header.d.ts +2 -2
- package/dist/Card/Card.d.ts +1 -2
- 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 +5 -8
- 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 +1 -0
- package/dist/Layout/MainContainer/MainContainer.js +1 -0
- package/dist/Steps/VerticalStep.d.ts +32 -13
- package/dist/Steps/VerticalStep.js +7 -7
- package/dist/Summary/index.js +1 -1
- package/dist/Tag/Tag.d.ts +12 -15
- package/dist/Tag/Tag.js +10 -15
- package/dist/index.d.ts +7 -9
- package/dist/index.js +4 -4
- package/package.json +4 -7
|
@@ -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 {
|
|
4
|
+
import { 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?: string;
|
|
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
|
|
8
|
+
const Accordion = ({ className, classModifier, variant, children, onlyOne = false, }) => {
|
|
9
9
|
const componentClassName = getComponentClassNameWithUserClassname({
|
|
10
10
|
componentClassName: defaultClassName,
|
|
11
11
|
userClassName: className,
|
|
12
|
-
classModifier: classModifier ||
|
|
12
|
+
classModifier: classModifier || 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
|
|
2
|
+
import type { AccordionActions } 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?: string;
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { AccordionActions
|
|
2
|
+
import type { AccordionActions } 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?: string;
|
|
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/Card/Card.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ 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;
|
|
12
11
|
};
|
|
13
|
-
export declare const Card: ({ children, className, iconSrc, orientation, error,
|
|
12
|
+
export declare const Card: ({ children, className, iconSrc, orientation, error, ...otherProps }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
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,
|
|
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] }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, 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(_Fragment, { 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, "placeholder">;
|
|
4
|
+
type Props = Omit<ComponentProps<typeof Checkbox> & ConsumerFieldProps, "children" | "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
|
|
1
|
+
import { jsx as _jsx } 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,
|
|
6
|
+
const CheckboxInput = forwardRef(({ label, mode = "default", options, ...otherProps }, inputRef) => {
|
|
7
7
|
const newOptions = useOptionsWithId(options);
|
|
8
|
-
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", ...otherProps, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...props }) => {
|
|
9
|
-
return (
|
|
8
|
+
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", classNameSuffix: "checkbox-container", ...otherProps, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...props }) => {
|
|
9
|
+
return (_jsx(Checkbox, { id: id, mode: mode, options: newOptions, classModifier: ariaInvalid ? `${classModifier} error` : classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }));
|
|
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-400/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> & ConsumerFieldProps
|
|
4
|
+
type Props = ComponentProps<typeof Choice> & Omit<ConsumerFieldProps, "children">;
|
|
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
|
|
1
|
+
import { jsx as _jsx } 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,
|
|
10
|
-
return (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ classModifier, id, errorId, ariaInvalid, ...props }) => (
|
|
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 })) }));
|
|
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 = ConsumerFieldProps & ComponentProps<typeof Date> & {
|
|
4
|
+
type Props = Omit<ConsumerFieldProps & ComponentProps<typeof Date> & {
|
|
5
5
|
helpMessage?: ReactNode;
|
|
6
|
-
}
|
|
6
|
+
}, "renderInput" | "children">;
|
|
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(({ rightElement, ...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 }), rightElement] })) }));
|
|
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 = ConsumerFieldProps & FileProps & Pick<FileTableProps, "values" | "errors"> & {
|
|
8
|
+
type Props = Omit<ConsumerFieldProps & FileProps & Pick<FileTableProps, "values" | "errors"> & {
|
|
9
9
|
fileLabel?: string;
|
|
10
10
|
helpMessage?: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
declare const FileInput: ({ values, id, name, onChange, label, errors, fileLabel, classModifier,
|
|
11
|
+
}, "children">;
|
|
12
|
+
declare const FileInput: ({ values, id, name, onChange, rightElement, label, errors, fileLabel, classModifier, ...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, label, errors, fileLabel, classModifier,
|
|
7
|
+
const FileInput = ({ values = [], id, name = "", onChange, rightElement, label, errors, fileLabel, classModifier, ...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, label, errors, fileLa
|
|
|
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 }), rightElement] })), 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,
|
|
6
|
+
declare const MultiSelectInput: ({ label, ...multiSelectProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export { MultiSelectInput };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } 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,
|
|
5
|
+
const MultiSelectInput = ({ label, ...multiSelectProps }) => {
|
|
6
6
|
return (_jsx(Field, { label: label, ...multiSelectProps, classNameSuffix: "select", renderInput: ({ id, ariaInvalid, errorId, ...props }) => {
|
|
7
|
-
return (
|
|
7
|
+
return (_jsx(MultiSelect, { id: id, "aria-invalid": ariaInvalid, "aria-describedby": errorId, ...props }));
|
|
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 = ConsumerFieldProps & ComponentPropsWithRef<typeof Number>;
|
|
8
|
-
export declare const NumberInput: ({
|
|
7
|
+
type Props = Omit<ConsumerFieldProps & ComponentPropsWithRef<typeof Number>, "children">;
|
|
8
|
+
export declare const NumberInput: ({ rightElement, ...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 = ({ rightElement, ...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 }), rightElement] })) }));
|
|
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" | "children">;
|
|
9
|
+
declare const PassInput: ({ rightElement, 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 = ({ rightElement, 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") }), rightElement] })) }));
|
|
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
|
+
card = "card"
|
|
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: "card";
|
|
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,15 +1,14 @@
|
|
|
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 classNames from "classnames";
|
|
5
|
-
import { RadioCardGroup } from "./RadioCardGroup";
|
|
6
4
|
import { RadioItem } from "./RadioItem";
|
|
5
|
+
import { RadioCardGroup } from "./RadioCardGroup";
|
|
7
6
|
export var RadioModes;
|
|
8
7
|
(function (RadioModes) {
|
|
9
8
|
RadioModes["classic"] = "classic";
|
|
10
9
|
RadioModes["default"] = "default";
|
|
11
10
|
RadioModes["inline"] = "inline";
|
|
12
|
-
RadioModes["
|
|
11
|
+
RadioModes["card"] = "card";
|
|
13
12
|
})(RadioModes || (RadioModes = {}));
|
|
14
13
|
const getClassNameMode = (mode) => {
|
|
15
14
|
switch (mode) {
|
|
@@ -17,7 +16,7 @@ const getClassNameMode = (mode) => {
|
|
|
17
16
|
return "af-form__radio";
|
|
18
17
|
case RadioModes.inline:
|
|
19
18
|
return "af-form__radio-inline";
|
|
20
|
-
case RadioModes.
|
|
19
|
+
case RadioModes.card:
|
|
21
20
|
return "af-form__radio-card";
|
|
22
21
|
default:
|
|
23
22
|
return "af-form__radio-custom";
|
|
@@ -26,12 +25,10 @@ const getClassNameMode = (mode) => {
|
|
|
26
25
|
const Radio = forwardRef(({ options, value = "", children, disabled, ...otherProps }, inputRef) => {
|
|
27
26
|
const { mode, ...onlyNecessaryProps } = otherProps;
|
|
28
27
|
const classNameMode = getClassNameMode(mode ?? "default");
|
|
29
|
-
if (mode === "
|
|
28
|
+
if (mode === "card") {
|
|
30
29
|
return (_jsx(RadioCardGroup, { ...onlyNecessaryProps, options: options, disabled: disabled, value: value, children: children }));
|
|
31
30
|
}
|
|
32
|
-
return (
|
|
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))) }));
|
|
31
|
+
return options.map((option) => (_createElement(RadioItem, { ...onlyNecessaryProps, key: option.value, isChecked: option.value === value, disabled: option.disabled || disabled, className: classNameMode, ref: inputRef, ...option }, children)));
|
|
35
32
|
});
|
|
36
33
|
Radio.displayName = "EnhancedInputRadio";
|
|
37
34
|
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 = ConsumerFieldProps & ComponentPropsWithoutRef<typeof Radio>;
|
|
4
|
+
type RadioInputProps = Omit<ConsumerFieldProps & ComponentPropsWithoutRef<typeof Radio>, "children">;
|
|
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, rightElement, ...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 !== "card" ? "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 }), rightElement] })) }));
|
|
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
|
+
rightElement?: 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
|
+
rightElement?: 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
|
|
1
|
+
import { jsx as _jsx } 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,
|
|
6
|
-
return (_jsx(Field, { label: label, classNameSuffix: "select", ...props, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...otherSelectProps }) => (
|
|
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 })) }));
|
|
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 = ConsumerFieldProps & ComponentProps<typeof Slider>;
|
|
4
|
+
type Props = Omit<ConsumerFieldProps & ComponentProps<typeof Slider>, "children">;
|
|
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: ({ rightElement, 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 = ({ rightElement, 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 }), rightElement] })) }));
|
|
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 = ConsumerFieldProps & ComponentProps<typeof Text>;
|
|
4
|
+
export type TextInputProps = Omit<ConsumerFieldProps & ComponentProps<typeof Text>, "children">;
|
|
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(({ rightElement, ...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 }), rightElement] })) }));
|
|
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 = ConsumerFieldProps & ComponentProps<typeof Textarea>;
|
|
7
|
+
type Props = Omit<ConsumerFieldProps & ComponentProps<typeof Textarea>, "children">;
|
|
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, rightElement, ...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 }), rightElement] })) }));
|
|
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
|
+
rightElement?: 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,4 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/MainContainer/MainContainer.css";
|
|
2
3
|
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
3
4
|
type MainContainerProps = ComponentPropsWithoutRef<"main"> & PropsWithChildren;
|
|
4
5
|
export declare const MainContainer: ({ children, ...othersProps }: MainContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/MainContainer/MainContainer.css";
|
|
2
3
|
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
3
4
|
export const MainContainer = ({ children, ...othersProps }) => (_jsx("main", { className: "af-container", ...othersProps, children: children }));
|
|
@@ -2,28 +2,47 @@ 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
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* title - The title of the step.
|
|
7
|
+
*/
|
|
6
8
|
title: string;
|
|
7
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* id - The id of the step, used for accessibility.
|
|
11
|
+
* It should be unique within the document.
|
|
12
|
+
*/
|
|
8
13
|
id: string;
|
|
9
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* stepMode - The mode of the step, can be "edited", "validated", or "locked".
|
|
16
|
+
*/
|
|
10
17
|
stepMode: VerticalStepMode;
|
|
11
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* onEdit - The function to call when the edit button is clicked.
|
|
20
|
+
*/
|
|
12
21
|
onEdit: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* form - The content of the form to display when the step is in "edited" mode.
|
|
24
|
+
*/
|
|
14
25
|
form: ReactNode;
|
|
15
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* restitution - The content to display when the step is in "validated" mode.
|
|
28
|
+
*/
|
|
16
29
|
restitution: ReactNode;
|
|
17
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* editButtonLabel - The label of the edit button.
|
|
32
|
+
*/
|
|
18
33
|
editButtonLabel?: string;
|
|
19
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* editButtonAriaLabel - The aria-label of the edit button.
|
|
36
|
+
*/
|
|
20
37
|
editButtonAriaLabel?: string;
|
|
21
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* showRestitution - Whether to show the restitution content when the step is validated.
|
|
40
|
+
*/
|
|
22
41
|
showRestitution?: boolean;
|
|
23
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* contentRight - Additional content to display on the right side of the title.
|
|
44
|
+
*/
|
|
24
45
|
contentRight?: string;
|
|
25
|
-
/** The aria-label for the additional content on the right side of the title. */
|
|
26
|
-
contentRightAriaLabel?: string;
|
|
27
46
|
};
|
|
28
|
-
export declare const VerticalStep: ({ title, id, stepMode, editButtonLabel, editButtonAriaLabel,
|
|
47
|
+
export declare const VerticalStep: ({ title, id, stepMode, editButtonLabel, editButtonAriaLabel, onEdit, form, restitution, showRestitution, contentRight, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
29
48
|
export {};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import classNames from "classnames";
|
|
3
3
|
import edit from "@material-symbols/svg-400/sharp/edit-fill.svg";
|
|
4
|
+
import check from "@material-symbols/svg-400/sharp/check.svg";
|
|
4
5
|
import lock from "@material-symbols/svg-400/sharp/lock-fill.svg";
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import { Svg } from "../Svg";
|
|
7
6
|
import { Title } from "../Title/Title";
|
|
7
|
+
import { Svg } from "../Svg";
|
|
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}`,
|
|
11
|
+
export const VerticalStep = ({ title, id, stepMode, editButtonLabel = "Modifier", editButtonAriaLabel = `Modifier l'étape ${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("div", { className: classNames(defaultClassName, {
|
|
16
16
|
[`${defaultClassName}--edition`]: isStepInEdition,
|
|
17
|
-
}),
|
|
17
|
+
}), 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 ? (_jsxs(Button, { "aria-label": editButtonAriaLabel, onClick: onEdit, className: "af-vertical-step-title-button", children: [_jsx(Svg, { role: "presentation", src: edit }), editButtonLabel] })) : undefined, contentRight: 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, { 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 })}`))) }) }));
|
|
10
|
+
return (_jsx(Message, { icon: "glyphicon glyphicon-warning-sign", 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,19 +1,12 @@
|
|
|
1
|
-
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
2
1
|
import { ComponentPropsWithRef, PropsWithChildren } from "react";
|
|
3
|
-
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
3
|
+
type TagModifier = "success" | "information" | "warning" | "error" | "default" | "dark" | "purple" | "gray";
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated instead use warning
|
|
6
|
+
*/
|
|
7
|
+
type TagModifierDecrepated = "danger" | "info";
|
|
4
8
|
type TagProps = ComponentPropsWithRef<"span"> & {
|
|
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;
|
|
9
|
+
classModifier?: `${TagModifier | TagModifierDecrepated}` | string;
|
|
17
10
|
disabled?: boolean;
|
|
18
11
|
};
|
|
19
12
|
/**
|
|
@@ -22,9 +15,13 @@ type TagProps = ComponentPropsWithRef<"span"> & {
|
|
|
22
15
|
* @component
|
|
23
16
|
* @example
|
|
24
17
|
* // Basic usage
|
|
25
|
-
* <Tag
|
|
18
|
+
* <Tag classModifier="success">Success Tag</Tag>
|
|
26
19
|
*
|
|
20
|
+
* @param {object} props - The properties object.
|
|
27
21
|
* @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.
|
|
28
25
|
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
29
26
|
* @returns {JSX.Element} The rendered Tag component.
|
|
30
27
|
*/
|
package/dist/Tag/Tag.js
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
|
-
import {
|
|
3
|
+
import { getComponentClassName } from "../utilities";
|
|
4
|
+
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
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 classModifier="success">Success Tag</Tag>
|
|
12
12
|
*
|
|
13
|
+
* @param {object} props - The properties object.
|
|
13
14
|
* @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.
|
|
14
18
|
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
15
19
|
* @returns {JSX.Element} The rendered Tag component.
|
|
16
20
|
*/
|
|
17
|
-
export const Tag = forwardRef(({ children, className, classModifier
|
|
18
|
-
const
|
|
19
|
-
const componentClassName = getComponentClassNameWithUserClassname({
|
|
20
|
-
userClassName: className,
|
|
21
|
-
classModifier: actualModifier,
|
|
22
|
-
componentClassName: "af-tag",
|
|
23
|
-
});
|
|
21
|
+
export const Tag = forwardRef(({ children, className, classModifier = "default", ...otherProps }, ref) => {
|
|
22
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-tag");
|
|
24
23
|
// Kept for backward compatibility. May be removed in a future version
|
|
25
|
-
const badgeClassName =
|
|
26
|
-
userClassName: className,
|
|
27
|
-
classModifier: actualModifier,
|
|
28
|
-
componentClassName: "af-badge",
|
|
29
|
-
});
|
|
24
|
+
const badgeClassName = getComponentClassName(className, classModifier, "af-badge");
|
|
30
25
|
return (_jsx("span", { ref: ref, className: `${componentClassName} ${badgeClassName}`, ...otherProps, children: children }));
|
|
31
26
|
});
|
|
32
27
|
Tag.displayName = "Tag";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
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";
|
|
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 };
|
|
9
15
|
export { Button } from "./Button/Button";
|
|
10
16
|
export type { ButtonVariant } from "./Button/Button";
|
|
11
17
|
export { Card } from "./Card/Card";
|
|
@@ -36,14 +42,6 @@ export { Svg } from "./Svg";
|
|
|
36
42
|
export { Tabs } from "./Tabs/Tabs";
|
|
37
43
|
export { Title } from "./Title/Title";
|
|
38
44
|
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 };
|
|
47
45
|
/**
|
|
48
46
|
* @deprecated `Alert` has been renamed `Message` in order to comply with UX naming of components. Use `Message` instead.
|
|
49
47
|
* @see {@link Message}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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";
|
|
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 };
|
|
9
12
|
export { Button } from "./Button/Button";
|
|
10
13
|
export { Card } from "./Card/Card";
|
|
11
14
|
export { Divider } from "./Divider/Divider";
|
|
@@ -35,9 +38,6 @@ export { Svg } from "./Svg";
|
|
|
35
38
|
export { Tabs } from "./Tabs/Tabs";
|
|
36
39
|
export { Title } from "./Title/Title";
|
|
37
40
|
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-tags-
|
|
3
|
+
"version": "2.0.0-tags-client-2-0-2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -47,22 +47,19 @@
|
|
|
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-tags-
|
|
50
|
+
"@axa-fr/design-system-slash-css": "2.0.0-tags-client-2-0-2.1",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
|
-
"@material-symbols/svg-700": ">= 0.19.0",
|
|
53
52
|
"react": ">= 18"
|
|
54
53
|
},
|
|
55
54
|
"peerDependenciesMeta": {
|
|
56
55
|
"@material-symbols/svg-400": {
|
|
57
|
-
"optional":
|
|
58
|
-
},
|
|
59
|
-
"@material-symbols/svg-700": {
|
|
60
|
-
"optional": false
|
|
56
|
+
"optional": true
|
|
61
57
|
}
|
|
62
58
|
},
|
|
63
59
|
"dependencies": {
|
|
64
60
|
"@floating-ui/react": "^0.27.8",
|
|
65
61
|
"@fontsource/source-sans-pro": "^5.2.5",
|
|
62
|
+
"@material-symbols/svg-700": ">= 0.19.0",
|
|
66
63
|
"@tanem/svg-injector": "^10.1.68",
|
|
67
64
|
"classnames": "^2.5.1",
|
|
68
65
|
"dompurify": "^3.1.5",
|