@axa-fr/design-system-apollo-react 1.0.5-alpha.275 → 1.0.5-alpha.277
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/Form/InputDate/InputDate.helper.d.ts +1 -0
- package/dist/Form/InputDate/InputDate.helper.js +4 -0
- package/dist/Form/{DateInput/DateInputApollo.d.ts → InputDate/InputDateApollo.d.ts} +2 -3
- package/dist/Form/InputDate/InputDateApollo.js +8 -0
- package/dist/Form/{DateInput/DateInputCommon.d.ts → InputDate/InputDateCommon.d.ts} +3 -4
- package/dist/Form/InputDate/InputDateCommon.js +15 -0
- package/dist/Form/{DateInput/DateInputLF.d.ts → InputDate/InputDateLF.d.ts} +2 -3
- package/dist/Form/InputDate/InputDateLF.js +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/indexLF.d.ts +1 -1
- package/dist/indexLF.js +1 -1
- package/package.json +3 -3
- package/dist/Form/DateInput/DateInput.helper.d.ts +0 -1
- package/dist/Form/DateInput/DateInput.helper.js +0 -20
- package/dist/Form/DateInput/DateInputApollo.js +0 -8
- package/dist/Form/DateInput/DateInputCommon.js +0 -15
- package/dist/Form/DateInput/DateInputLF.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatInputDateValue: (value?: Date | string) => string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/InputDate/InputDateApollo.scss";
|
|
2
2
|
import { type ComponentProps } from "react";
|
|
3
3
|
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const InputDate: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "value"> & {
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
defaultValue?: Date | string;
|
|
7
7
|
value?: Date | string;
|
|
@@ -9,7 +9,6 @@ export declare const DateInput: import("react").ForwardRefExoticComponent<Omit<O
|
|
|
9
9
|
error?: string;
|
|
10
10
|
success?: string;
|
|
11
11
|
label: ComponentProps<typeof import("../ItemLabel/ItemLabelCommon").ItemLabel>["label"];
|
|
12
|
-
type?: "text" | "date";
|
|
13
12
|
ItemLabelComponent: import("react").ComponentType<Omit<ComponentProps<typeof import("../ItemLabel/ItemLabelCommon").ItemLabel>, "ButtonComponent">>;
|
|
14
13
|
ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
15
14
|
} & Partial<{
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/InputDate/InputDateApollo.scss";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
5
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
6
|
+
import { InputDate as InputDateCommon } from "./InputDateCommon";
|
|
7
|
+
export const InputDate = forwardRef((props, ref) => (_jsx(InputDateCommon, { ...props, ref: ref, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage })));
|
|
8
|
+
InputDate.displayName = "InputDate";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, ComponentPropsWithRef, ComponentType } from "react";
|
|
2
2
|
import { ItemLabel } from "../ItemLabel/ItemLabelCommon";
|
|
3
3
|
import { ItemMessage } from "../ItemMessage/ItemMessageCommon";
|
|
4
|
-
type
|
|
4
|
+
type InputDateProps = Omit<ComponentPropsWithRef<"input">, "value"> & {
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
defaultValue?: Date | string;
|
|
7
7
|
value?: Date | string;
|
|
@@ -9,9 +9,8 @@ type DateInputProps = Omit<ComponentPropsWithRef<"input">, "value"> & {
|
|
|
9
9
|
error?: string;
|
|
10
10
|
success?: string;
|
|
11
11
|
label: ComponentProps<typeof ItemLabel>["label"];
|
|
12
|
-
type?: "text" | "date";
|
|
13
12
|
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabel>, "ButtonComponent">>;
|
|
14
13
|
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
15
14
|
} & Partial<ComponentPropsWithRef<typeof ItemLabel>>;
|
|
16
|
-
declare const
|
|
17
|
-
export {
|
|
15
|
+
declare const InputDate: import("react").ForwardRefExoticComponent<Omit<InputDateProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export { InputDate };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId, } from "react";
|
|
3
|
+
import { getComponentClassName } from "../../utilities/getComponentClassName";
|
|
4
|
+
import { formatInputDateValue } from "./InputDate.helper";
|
|
5
|
+
const InputDate = forwardRef(({ className, classModifier = "", defaultValue, value, helper, error, success, label, description, buttonLabel, onButtonClick, ItemLabelComponent, ItemMessageComponent, required, "aria-errormessage": ariaErrormessage, ...otherProps }, inputRef) => {
|
|
6
|
+
const componentClassName = getComponentClassName("af-form__input-date", className ?? "", classModifier + (error || ariaErrormessage ? " error" : ""));
|
|
7
|
+
let inputId = useId();
|
|
8
|
+
inputId = otherProps.id ?? inputId;
|
|
9
|
+
const idMessage = useId();
|
|
10
|
+
const idHelp = useId();
|
|
11
|
+
const idLabel = useId();
|
|
12
|
+
return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, required: required, inputId: inputId, idLabel: idLabel }), _jsx("input", { ...otherProps, id: inputId, className: componentClassName, type: "date", ref: inputRef, defaultValue: formatInputDateValue(defaultValue), value: formatInputDateValue(value), "aria-labelledby": idLabel, "aria-errormessage": ariaErrormessage ?? idMessage, "aria-invalid": Boolean(error ?? ariaErrormessage), "aria-describedby": idHelp, required: required }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error ?? success, messageType: error ? "error" : "success" })] }));
|
|
13
|
+
});
|
|
14
|
+
InputDate.displayName = "InputDate";
|
|
15
|
+
export { InputDate };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/InputDate/InputDateLF.scss";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const InputDate: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "value"> & {
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
defaultValue?: Date | string;
|
|
7
7
|
value?: Date | string;
|
|
@@ -9,7 +9,6 @@ export declare const DateInput: import("react").ForwardRefExoticComponent<Omit<O
|
|
|
9
9
|
error?: string;
|
|
10
10
|
success?: string;
|
|
11
11
|
label: ComponentProps<typeof import("../ItemLabel/ItemLabelCommon").ItemLabel>["label"];
|
|
12
|
-
type?: "text" | "date";
|
|
13
12
|
ItemLabelComponent: import("react").ComponentType<Omit<ComponentProps<typeof import("../ItemLabel/ItemLabelCommon").ItemLabel>, "ButtonComponent">>;
|
|
14
13
|
ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
15
14
|
} & Partial<{
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/InputDate/InputDateLF.scss";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
5
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
6
|
+
import { InputDate as InputDateCommon } from "./InputDateCommon";
|
|
7
|
+
export const InputDate = forwardRef((props, ref) => (_jsx(InputDateCommon, { ...props, ref: ref, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage })));
|
|
8
|
+
InputDate.displayName = "InputDate";
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { Divider } from "./Divider/DividerApollo";
|
|
|
11
11
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxApollo";
|
|
12
12
|
export { CheckboxCard } from "./Form/Checkbox/CheckboxCard/CheckboxCardApollo";
|
|
13
13
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextApollo";
|
|
14
|
-
export {
|
|
14
|
+
export { InputDate } from "./Form/InputDate/InputDateApollo";
|
|
15
15
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
|
|
16
16
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
|
|
17
17
|
export { Select } from "./Form/Select/SelectApollo";
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { Divider } from "./Divider/DividerApollo";
|
|
|
11
11
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxApollo";
|
|
12
12
|
export { CheckboxCard } from "./Form/Checkbox/CheckboxCard/CheckboxCardApollo";
|
|
13
13
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextApollo";
|
|
14
|
-
export {
|
|
14
|
+
export { InputDate } from "./Form/InputDate/InputDateApollo";
|
|
15
15
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
|
|
16
16
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
|
|
17
17
|
export { Select } from "./Form/Select/SelectApollo";
|
package/dist/indexLF.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { Divider } from "./Divider/DividerLF";
|
|
|
10
10
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxLF";
|
|
11
11
|
export { CheckboxCard } from "./Form/Checkbox/CheckboxCard/CheckboxCardLF";
|
|
12
12
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextLF";
|
|
13
|
-
export {
|
|
13
|
+
export { InputDate } from "./Form/InputDate/InputDateLF";
|
|
14
14
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
|
|
15
15
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
|
|
16
16
|
export { Select } from "./Form/Select/SelectLF";
|
package/dist/indexLF.js
CHANGED
|
@@ -10,7 +10,7 @@ export { Divider } from "./Divider/DividerLF";
|
|
|
10
10
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxLF";
|
|
11
11
|
export { CheckboxCard } from "./Form/Checkbox/CheckboxCard/CheckboxCardLF";
|
|
12
12
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextLF";
|
|
13
|
-
export {
|
|
13
|
+
export { InputDate } from "./Form/InputDate/InputDateLF";
|
|
14
14
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
|
|
15
15
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
|
|
16
16
|
export { Select } from "./Form/Select/SelectLF";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-apollo-react",
|
|
3
|
-
"version": "1.0.5-alpha.
|
|
3
|
+
"version": "1.0.5-alpha.277",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@axa-fr/design-system-apollo-css": "1.0.5-alpha.
|
|
50
|
-
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.
|
|
49
|
+
"@axa-fr/design-system-apollo-css": "1.0.5-alpha.277",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.277",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const formatDateInputValue: (type: "date" | "text", value?: Date | string | undefined) => string | undefined;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const MAXIMUM_SIZE_DATE = 10;
|
|
2
|
-
export const formatDateInputValue = (type, value) => {
|
|
3
|
-
if (!value)
|
|
4
|
-
return undefined;
|
|
5
|
-
if (value instanceof Date) {
|
|
6
|
-
if (type === "date") {
|
|
7
|
-
return value.toISOString().slice(0, MAXIMUM_SIZE_DATE);
|
|
8
|
-
}
|
|
9
|
-
if (type === "text") {
|
|
10
|
-
const day = String(value.getDate()).padStart(2, "0");
|
|
11
|
-
const month = String(value.getMonth() + 1).padStart(2, "0");
|
|
12
|
-
const year = String(value.getFullYear()).padStart(4, "0");
|
|
13
|
-
return `${day}/${month}/${year}`;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (typeof value === "string") {
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
return undefined;
|
|
20
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/DateInput/DateInputApollo.scss";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
5
|
-
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
6
|
-
import { DateInput as DateInputCommon } from "./DateInputCommon";
|
|
7
|
-
export const DateInput = forwardRef((props, ref) => (_jsx(DateInputCommon, { ...props, ref: ref, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage })));
|
|
8
|
-
DateInput.displayName = "DateInput";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useId, } from "react";
|
|
3
|
-
import { getComponentClassName } from "../../utilities/getComponentClassName";
|
|
4
|
-
import { formatDateInputValue } from "./DateInput.helper";
|
|
5
|
-
const DateInput = forwardRef(({ className, classModifier = "", defaultValue, value, placeholder = "JJ/MM/AAAA", helper, error, success, label, description, buttonLabel, onButtonClick, ItemLabelComponent, ItemMessageComponent, required, "aria-errormessage": ariaErrormessage, type = "text", ...otherProps }, inputRef) => {
|
|
6
|
-
const componentClassName = getComponentClassName("af-form__input-date", className ?? "", classModifier + (error || ariaErrormessage ? " error" : ""));
|
|
7
|
-
let inputId = useId();
|
|
8
|
-
inputId = otherProps.id ?? inputId;
|
|
9
|
-
const idMessage = useId();
|
|
10
|
-
const idHelp = useId();
|
|
11
|
-
const idLabel = useId();
|
|
12
|
-
return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, required: required, inputId: inputId, idLabel: idLabel }), _jsx("input", { ...otherProps, id: inputId, className: componentClassName, type: type, placeholder: placeholder || "", ref: inputRef, defaultValue: formatDateInputValue(type, defaultValue), value: formatDateInputValue(type, value), "aria-labelledby": idLabel, "aria-errormessage": ariaErrormessage ?? idMessage, "aria-invalid": Boolean(error ?? ariaErrormessage), "aria-describedby": idHelp, required: required }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error ?? success, messageType: error ? "error" : "success" })] }));
|
|
13
|
-
});
|
|
14
|
-
DateInput.displayName = "DateInput";
|
|
15
|
-
export { DateInput };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/DateInput/DateInputLF.scss";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
5
|
-
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
6
|
-
import { DateInput as DateInputCommon } from "./DateInputCommon";
|
|
7
|
-
export const DateInput = forwardRef((props, ref) => (_jsx(DateInputCommon, { ...props, ref: ref, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage })));
|
|
8
|
-
DateInput.displayName = "DateInput";
|