@axa-fr/design-system-slash-react 1.1.1-alpha.98 → 1.2.0-RC.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/Action/Action.js +1 -1
- package/dist/Alert/Alert.d.ts +2 -1
- package/dist/Alert/Alert.js +2 -2
- package/dist/Form/Checkbox/CheckboxInput.js +8 -3
- package/dist/Form/Choice/Choice.d.ts +2 -1
- package/dist/Form/Choice/Choice.js +11 -9
- package/dist/Form/Choice/ChoiceInput.js +12 -6
- package/dist/Form/Date/DateInput.d.ts +40 -6
- package/dist/Form/Date/DateInput.js +8 -4
- package/dist/Form/File/FileInput.js +4 -1
- package/dist/Form/MultiSelect/MultiSelectInput.js +4 -1
- package/dist/Form/Number/NumberInput.js +4 -1
- package/dist/Form/Pass/PassInput.js +6 -2
- package/dist/Form/Radio/RadioInput.d.ts +1 -0
- package/dist/Form/Radio/RadioInput.js +5 -2
- package/dist/Form/Select/Select.d.ts +310 -5
- package/dist/Form/Select/Select.js +7 -4
- package/dist/Form/Select/SelectBase.d.ts +1 -1
- package/dist/Form/Select/SelectBase.js +3 -2
- package/dist/Form/Select/SelectDefault.d.ts +3 -2
- package/dist/Form/Select/SelectDefault.js +6 -8
- package/dist/Form/Select/SelectDefaultWithOptions.d.ts +9 -0
- package/dist/Form/Select/SelectDefaultWithOptions.js +18 -0
- package/dist/Form/Select/SelectInput.d.ts +386 -6
- package/dist/Form/Select/SelectInput.js +4 -1
- package/dist/Form/Text/TextInput.js +7 -2
- package/dist/Form/Textarea/TextareaInput.js +4 -1
- package/dist/Form/core/Field.d.ts +2 -1
- package/dist/Form/core/Field.js +5 -2
- package/dist/Form/core/FieldError.d.ts +2 -1
- package/dist/Form/core/FieldError.js +2 -2
- package/dist/Form/core/LegacyField.d.ts +3 -2
- package/dist/Form/core/LegacyField.js +2 -2
- package/dist/Form/core/useAriaInvalid.d.ts +2 -0
- package/dist/Form/core/useAriaInvalid.js +2 -0
- package/dist/Link/CustomLink.d.ts +8 -0
- package/dist/Link/CustomLink.js +6 -0
- package/dist/Link/Link.d.ts +4 -9
- package/dist/Link/Link.js +9 -5
- package/dist/Link/LinkAnchor.d.ts +10 -0
- package/dist/Link/LinkAnchor.js +10 -0
- package/dist/Link/linkClassName.d.ts +1 -0
- package/dist/Link/linkClassName.js +1 -0
- package/dist/ModalAgent/Modal.js +1 -1
- package/dist/Restitution/HeaderRestitution.js +1 -1
- package/dist/Restitution/SectionRestitutionTitle.js +1 -1
- package/dist/Table/Pagination/Items.d.ts +2 -1
- package/dist/Table/Pagination/Items.js +9 -5
- package/dist/Table/Pagination/Paging.d.ts +1 -1
- package/dist/Table/Pagination/Paging.js +2 -2
- package/dist/Title/Title.d.ts +3 -1
- package/dist/Title/Title.js +6 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { linkClassName } from "./linkClassName";
|
|
5
|
+
const LinkAnchor = forwardRef(({ className, target, rel, leftIcon, children, rightIcon, disabled, ...restProps }, ref) => {
|
|
6
|
+
const finalClassName = classnames(linkClassName, className);
|
|
7
|
+
return (_jsxs("a", { className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"], ref: ref, ...restProps, children: [leftIcon, children, rightIcon] }));
|
|
8
|
+
});
|
|
9
|
+
LinkAnchor.displayName = "LinkAnchor";
|
|
10
|
+
export { LinkAnchor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkClassName = "af-slash-link";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const linkClassName = "af-slash-link";
|
package/dist/ModalAgent/Modal.js
CHANGED
|
@@ -3,7 +3,7 @@ import { forwardRef } from "react";
|
|
|
3
3
|
import { getComponentClassName } from "..";
|
|
4
4
|
const Modal = forwardRef(({ className, title = "", onOutsideTap, children, classModifier, ...props }, ref) => {
|
|
5
5
|
const componentClassName = getComponentClassName(className, classModifier, "af-modal");
|
|
6
|
-
return (_jsx("dialog", { "aria-
|
|
6
|
+
return (_jsx("dialog", { "aria-label": title, className: componentClassName, onClick: onOutsideTap, ref: ref, ...props, children: _jsx("div", { className: "af-modal__dialog", onClick: (event) => event.stopPropagation(), children: _jsx("div", { className: "af-modal__content", children: children }) }) }));
|
|
7
7
|
});
|
|
8
8
|
Modal.displayName = "Modal";
|
|
9
9
|
export { Modal };
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { getComponentClassName } from "../utilities";
|
|
3
3
|
export const HeaderRestitution = ({ title, subtitle, rightTitle, className, classModifier, }) => {
|
|
4
4
|
const componentClassName = getComponentClassName(className, classModifier, "af-restitution__header");
|
|
5
|
-
return (_jsxs("header", { className: componentClassName, children: [_jsx("div", { className: "af-restitution__header-left", children: _jsxs("
|
|
5
|
+
return (_jsxs("header", { className: componentClassName, children: [_jsx("div", { className: "af-restitution__header-left", children: _jsxs("h3", { className: "af-restitution__title", children: [_jsx("span", { className: "af-restitution__title-main", children: title }), subtitle ? (_jsx("span", { className: "af-restitution__title-subtitle", children: subtitle })) : null] }) }), rightTitle ? (_jsx("div", { className: "af-restitution__header-right", children: _jsx("span", { className: "af-restitution__title", children: rightTitle }) })) : null] }));
|
|
6
6
|
};
|
|
@@ -2,5 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { getComponentClassName } from "../utilities";
|
|
3
3
|
export const SectionRestitutionTitle = ({ title, className, classModifier, }) => {
|
|
4
4
|
const componentClassName = getComponentClassName(className, classModifier, "af-restitution__content-title");
|
|
5
|
-
return _jsx("
|
|
5
|
+
return _jsx("h4", { className: componentClassName, children: title });
|
|
6
6
|
};
|
|
@@ -6,9 +6,10 @@ export type Props = {
|
|
|
6
6
|
elementsLabel?: string;
|
|
7
7
|
items?: number[];
|
|
8
8
|
numberItems?: number;
|
|
9
|
+
selectAriaLabel?: string;
|
|
9
10
|
onChange: (e: {
|
|
10
11
|
value: number;
|
|
11
12
|
}) => void;
|
|
12
13
|
};
|
|
13
|
-
declare const Items: ({ className, classModifier, onChange, displayLabel, elementsLabel, id, items, numberItems, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const Items: ({ className, classModifier, onChange, displayLabel, elementsLabel, selectAriaLabel, id, items, numberItems, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export { Items };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import { getComponentClassName } from "../../utilities";
|
|
4
|
-
|
|
4
|
+
import { Select } from "../../Form/Select";
|
|
5
|
+
const Items = ({ className, classModifier, onChange, displayLabel = "Afficher", elementsLabel = "éléments", selectAriaLabel = "Modifier le nombre d'éléments à afficher dans le tableau", id, items = [5, 10, 25, 50, 100], numberItems = 10, }) => {
|
|
5
6
|
const defaultIdName = useId();
|
|
6
7
|
const newId = id ?? defaultIdName;
|
|
7
8
|
const componentClassName = getComponentClassName(className, classModifier, "af-paging__form");
|
|
8
|
-
return (_jsx("div", { className: "af-paging__limit", children: _jsx("form", { className: componentClassName, children: _jsxs("div", { className: "af-form__group", children: [_jsx("div", { className: "col col-sm-2 col-md-2 col-lg-2 col-xl-2", children: _jsx("label", { className: "af-form__group-label", htmlFor: newId, children: displayLabel }) }),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
return (_jsx("div", { className: "af-paging__limit", children: _jsx("form", { className: componentClassName, children: _jsxs("div", { className: "af-form__group", children: [_jsx("div", { className: "col col-sm-2 col-md-2 col-lg-2 col-xl-2", children: _jsx("label", { className: "af-form__group-label", htmlFor: newId, children: displayLabel }) }), _jsxs("div", { className: "col col-sm-10 col-md-10 col-lg-10 col-xl-10", children: [_jsx(Select, { id: newId, value: numberItems, mode: "base", options: items.map((item) => ({
|
|
10
|
+
label: item.toString(),
|
|
11
|
+
value: item.toString(),
|
|
12
|
+
})), onChange: (e) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
onChange({ value: Number(e.target.value) });
|
|
15
|
+
}, "aria-label": selectAriaLabel }), _jsx("span", { className: "af-form__input-cmplt", children: elementsLabel })] })] }) }) }));
|
|
12
16
|
};
|
|
13
17
|
export { Items };
|
|
@@ -10,5 +10,5 @@ type OnChangePager = (e: {
|
|
|
10
10
|
export type Props = Omit<PagingComponentProps, "onChange"> & {
|
|
11
11
|
onChange?: OnChangePager;
|
|
12
12
|
};
|
|
13
|
-
declare const Paging: ({ className, classModifier, currentPage, displayLabel, elementsLabel, id, mode, nextLabel, numberItems, numberPages, ofLabel, previousLabel, items, onChange, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const Paging: ({ className, classModifier, currentPage, displayLabel, selectAriaLabel, elementsLabel, id, mode, nextLabel, numberItems, numberPages, ofLabel, previousLabel, items, onChange, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export { Paging };
|
|
@@ -4,7 +4,7 @@ import { useCallback } from "react";
|
|
|
4
4
|
import { getComponentClassName } from "../..";
|
|
5
5
|
import { Items } from "./Items";
|
|
6
6
|
import { Pager } from "./Pager";
|
|
7
|
-
const Paging = ({ className, classModifier, currentPage = 1, displayLabel, elementsLabel, id, mode, nextLabel, numberItems = 10, numberPages, ofLabel, previousLabel, items, onChange, }) => {
|
|
7
|
+
const Paging = ({ className, classModifier, currentPage = 1, displayLabel, selectAriaLabel, elementsLabel, id, mode, nextLabel, numberItems = 10, numberPages, ofLabel, previousLabel, items, onChange, }) => {
|
|
8
8
|
const componentClassName = getComponentClassName(className, classModifier, "af-paging");
|
|
9
9
|
const handleChangeItems = useCallback((e) => onChange &&
|
|
10
10
|
onChange({
|
|
@@ -16,6 +16,6 @@ const Paging = ({ className, classModifier, currentPage = 1, displayLabel, eleme
|
|
|
16
16
|
numberItems,
|
|
17
17
|
page: e.value,
|
|
18
18
|
}), [numberItems, onChange]);
|
|
19
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-paging__limit", children: _jsx(Items, { onChange: handleChangeItems, numberItems: numberItems, id: id, displayLabel: displayLabel, elementsLabel: elementsLabel, items: items }) }), _jsx("div", { className: "af-paging__pager", children: _jsx(Pager, { onChange: handleChangePager, currentPage: currentPage, numberPages: numberPages, previousLabel: previousLabel, nextLabel: nextLabel, ofLabel: ofLabel, mode: mode }) })] }));
|
|
19
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-paging__limit", children: _jsx(Items, { onChange: handleChangeItems, numberItems: numberItems, id: id, displayLabel: displayLabel, selectAriaLabel: selectAriaLabel, elementsLabel: elementsLabel, items: items }) }), _jsx("div", { className: "af-paging__pager", children: _jsx(Pager, { onChange: handleChangePager, currentPage: currentPage, numberPages: numberPages, previousLabel: previousLabel, nextLabel: nextLabel, ofLabel: ofLabel, mode: mode }) })] }));
|
|
20
20
|
};
|
|
21
21
|
export { Paging };
|
package/dist/Title/Title.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/Title/Title.scss";
|
|
2
|
-
import { ComponentPropsWithRef, PropsWithChildren } from "react";
|
|
2
|
+
import { ComponentPropsWithRef, PropsWithChildren, ReactElement } from "react";
|
|
3
3
|
type Headings = "h2" | "h3" | "h4";
|
|
4
4
|
type TitleProps = ComponentPropsWithRef<"h2"> & {
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
heading?: Headings;
|
|
7
|
+
contentLeft?: ReactElement;
|
|
8
|
+
contentRight?: ReactElement;
|
|
7
9
|
};
|
|
8
10
|
export declare const Title: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<TitleProps>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
9
11
|
export {};
|
package/dist/Title/Title.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/Title/Title.scss";
|
|
3
|
-
import { forwardRef } from "react";
|
|
3
|
+
import { forwardRef, } from "react";
|
|
4
4
|
import { getComponentClassName } from "../utilities";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const baseClass = "af-title";
|
|
6
|
+
export const Title = forwardRef(({ className, classModifier, children, heading: Heading = "h2", contentLeft, contentRight, ...otherProps }, ref) => {
|
|
7
|
+
const componentClassName = getComponentClassName(className, classModifier, baseClass);
|
|
8
|
+
return (_jsxs("div", { className: `${baseClass}--container`, children: [_jsxs(Heading, { ref: ref, className: componentClassName, ...otherProps, children: [children, contentLeft] }), contentRight ? (_jsx("div", { className: "content-right", children: contentRight })) : null] }));
|
|
8
9
|
});
|
|
9
10
|
Title.displayName = "Title";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-slash-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-RC.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@axa-fr/design-system-slash-css": "1.
|
|
50
|
+
"@axa-fr/design-system-slash-css": "1.2.0-RC.1",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@floating-ui/react": "^0.27.
|
|
61
|
-
"@fontsource/source-sans-pro": "^5.
|
|
60
|
+
"@floating-ui/react": "^0.27.8",
|
|
61
|
+
"@fontsource/source-sans-pro": "^5.2.5",
|
|
62
62
|
"@tanem/svg-injector": "^10.1.68",
|
|
63
63
|
"classnames": "^2.5.1",
|
|
64
64
|
"dompurify": "^3.1.5",
|