@axa-fr/design-system-apollo-react 1.0.5-alpha.385 → 1.0.5-alpha.387
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/DataAgent/DataAgentApollo.d.ts +3 -0
- package/dist/DataAgent/DataAgentApollo.js +7 -0
- package/dist/DataAgent/DataAgentCommon.d.ts +20 -0
- package/dist/DataAgent/DataAgentCommon.js +15 -0
- package/dist/DataAgent/DataAgentLF.d.ts +3 -0
- package/dist/DataAgent/DataAgentLF.js +7 -0
- package/dist/List/ClickItem/ClickItemApollo.js +1 -1
- package/dist/List/ClickItem/ClickItemCommon.js +9 -3
- package/dist/List/ClickItem/ClickItemWrapper.d.ts +6 -0
- package/dist/List/ClickItem/ClickItemWrapper.js +7 -0
- package/dist/List/ClickItem/components/ClickItemPrefixCommon.js +4 -4
- package/dist/List/ClickItem/components/{ClickItemSuffixAppollo.js → ClickItemSuffixApollo.js} +1 -2
- package/dist/List/ClickItem/components/ClickItemSuffixCommon.d.ts +2 -6
- package/dist/List/ClickItem/components/ClickItemSuffixCommon.js +8 -8
- package/dist/List/ClickItem/components/ClickItemSuffixLF.js +1 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/indexLF.d.ts +1 -0
- package/dist/indexLF.js +1 -0
- package/package.json +3 -3
- /package/dist/List/ClickItem/components/{ClickItemSuffixAppollo.d.ts → ClickItemSuffixApollo.d.ts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DataAgentCommon } from "./DataAgentCommon";
|
|
3
|
+
import { ClickItem } from "../List/ClickItem/ClickItemApollo";
|
|
4
|
+
import { ContentItemMono } from "../ContentItemMono/ContentItemMonoApollo";
|
|
5
|
+
import { Divider } from "../Divider/DividerApollo";
|
|
6
|
+
import "@axa-fr/design-system-apollo-css/dist/DataAgent/DataAgentApollo.scss";
|
|
7
|
+
export const DataAgent = (props) => (_jsx(DataAgentCommon, { ...props, DividerComponent: Divider, ClickItemComponent: ClickItem, ContentItemMonoComponent: ContentItemMono }));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentProps, ComponentType } from "react";
|
|
2
|
+
import { Divider } from "../Divider/DividerCommon";
|
|
3
|
+
import type { ContentItemProps, ContentMonoItemIconProps, ContentMonoItemPictureProps, ContentMonoItemStickProps } from "../ContentItemMono/ContentItemMonoCommon";
|
|
4
|
+
import type { ClickItemProps } from "../List/ClickItem/types";
|
|
5
|
+
export type TupleMax3<T> = [T] | [T, T] | [T, T, T];
|
|
6
|
+
export type DataAgentProps = {
|
|
7
|
+
className?: string;
|
|
8
|
+
agentProps: ContentMonoItemPictureProps;
|
|
9
|
+
agentContractProps?: ContentMonoItemStickProps;
|
|
10
|
+
contents?: TupleMax3<ContentMonoItemIconProps>;
|
|
11
|
+
clickContents?: TupleMax3<ClickItemProps>;
|
|
12
|
+
texteOrias?: string;
|
|
13
|
+
};
|
|
14
|
+
type DataAgentCommonProps = DataAgentProps & {
|
|
15
|
+
DividerComponent: ComponentType<ComponentProps<typeof Divider>>;
|
|
16
|
+
ContentItemMonoComponent: ComponentType<ContentItemProps>;
|
|
17
|
+
ClickItemComponent: ComponentType<ClickItemProps>;
|
|
18
|
+
};
|
|
19
|
+
export declare const DataAgentCommon: ({ className, agentProps, agentContractProps, contents, clickContents, texteOrias, DividerComponent, ContentItemMonoComponent, ClickItemComponent, }: DataAgentCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, useMemo } from "react";
|
|
3
|
+
import { getComponentClassName } from "../utilities/getComponentClassName";
|
|
4
|
+
import { useIsSmallScreen } from "../utilities/hook/useIsSmallScreen";
|
|
5
|
+
import { BREAKPOINT } from "../utilities/constants";
|
|
6
|
+
export const DataAgentCommon = ({ className, agentProps, agentContractProps, contents, clickContents, texteOrias, DividerComponent, ContentItemMonoComponent, ClickItemComponent, }) => {
|
|
7
|
+
const componentClassName = useMemo(() => getComponentClassName("af-data-agent", className), [className]);
|
|
8
|
+
const isMobile = useIsSmallScreen(BREAKPOINT.SM);
|
|
9
|
+
const renderForDefaultLayout = () => (_jsxs(_Fragment, { children: [_jsxs("section", { className: "af-data-agent__intro", children: [_jsx(ContentItemMonoComponent, { ...agentProps, type: "picture" }), agentContractProps && (_jsx(ContentItemMonoComponent, { ...agentContractProps, type: "stick" }))] }), _jsx(DividerComponent, {}), contents && contents?.length > 0 && (_jsx("section", { className: "af-data-agent__info-content", children: contents.map((content) => (_jsxs(Fragment, { children: [_jsx(ContentItemMonoComponent, { ...content, type: "icon" }), _jsx(DividerComponent, { className: "af-data-agent__line" })] }, `content--${crypto.randomUUID()}`))) })), clickContents && clickContents?.length > 0 && (_jsx("section", { className: "af-data-agent__info-click-content", children: clickContents.map((clickContent) => (_jsxs(Fragment, { children: [_jsx(ClickItemComponent, { ...clickContent, variant: "small" }), _jsx(DividerComponent, { className: "af-data-agent__line" })] }, `clickContent--${crypto.randomUUID()}`))) })), Boolean(texteOrias) && (_jsx("p", { className: "af-data-agent__text-orias", children: texteOrias }))] }));
|
|
10
|
+
const renderForMobileLayout = () => (_jsx("section", { className: "af-data-agent__intro", children: _jsx(ClickItemComponent, { ...agentProps, basePictureProps: {
|
|
11
|
+
src: agentProps.picture,
|
|
12
|
+
alt: agentProps.title,
|
|
13
|
+
}, variant: "agent" }) }));
|
|
14
|
+
return (_jsx("section", { className: componentClassName, children: isMobile ? renderForMobileLayout() : renderForDefaultLayout() }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DataAgentCommon } from "./DataAgentCommon";
|
|
3
|
+
import { ClickItem } from "../List/ClickItem/ClickItemLF";
|
|
4
|
+
import { ContentItemMono } from "../ContentItemMono/ContentItemMonoLF";
|
|
5
|
+
import { Divider } from "../Divider/DividerLF";
|
|
6
|
+
import "@axa-fr/design-system-apollo-css/dist/DataAgent/DataAgentLF.scss";
|
|
7
|
+
export const DataAgent = (props) => (_jsx(DataAgentCommon, { ...props, DividerComponent: Divider, ClickItemComponent: ClickItem, ContentItemMonoComponent: ContentItemMono }));
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "@axa-fr/design-system-apollo-css/dist/List/ClickItem/ClickItemApollo.scss";
|
|
3
3
|
import { ClickItemCommon } from "./ClickItemCommon";
|
|
4
4
|
import { ClickItemContent } from "./components/ClickItemContentApollo";
|
|
5
|
-
import { ClickItemSuffix } from "./components/
|
|
5
|
+
import { ClickItemSuffix } from "./components/ClickItemSuffixApollo";
|
|
6
6
|
import { ClickItemPrefix } from "./components/ClickItemPrefixApollo";
|
|
7
7
|
export const ClickItem = (props) => (_jsx(ClickItemCommon, { ClickItemContentComponent: ClickItemContent, ClickItemSuffixComponent: ClickItemSuffix, ClickItemPrefixComponent: ClickItemPrefix, ...props }));
|
|
8
8
|
export { clickItemStates, clickItemVariants, } from "./ClickItemCommon";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ClickItemWrapper } from "./ClickItemWrapper";
|
|
2
3
|
export const clickItemVariants = {
|
|
3
4
|
small: "small",
|
|
4
5
|
medium: "medium",
|
|
@@ -11,15 +12,20 @@ export const clickItemStates = {
|
|
|
11
12
|
loading: "loading",
|
|
12
13
|
};
|
|
13
14
|
export const ClickItemCommon = ({ className = "", state = "default", variant = "large", icon, title, subtitle, textSecondary, textTertiary, tagLabel, tagProps, basePictureProps, onClick, ariaLabelForActionIcon, ClickItemContentComponent, ClickItemSuffixComponent, ClickItemPrefixComponent, }) => {
|
|
14
|
-
|
|
15
|
+
const clickableProps = onClick && {
|
|
16
|
+
"aria-label": ariaLabelForActionIcon,
|
|
17
|
+
onClick,
|
|
18
|
+
disabled: state === "disabled" || state === "loading",
|
|
19
|
+
};
|
|
20
|
+
return (_jsxs(ClickItemWrapper, { isClickable: Boolean(onClick), className: [
|
|
15
21
|
"af-apollo-click-item",
|
|
16
22
|
`af-apollo-click-item--${variant}`,
|
|
17
23
|
`af-apollo-click-item--${state}`,
|
|
18
24
|
className,
|
|
19
25
|
]
|
|
20
26
|
.filter(Boolean)
|
|
21
|
-
.join(" "), children: [_jsx("div", { className: "af-apollo-click-item__leading", children: _jsx(ClickItemPrefixComponent, { variant: variant, state: state, basePictureProps: basePictureProps, icon: icon }) }), _jsx("div", { className: "af-apollo-click-item__content", children: _jsx(ClickItemContentComponent, { title: title, subtitle: subtitle, textSecondary: textSecondary, textTertiary: textTertiary, tagLabel: tagLabel, tagProps: {
|
|
27
|
+
.join(" "), ...clickableProps, children: [_jsx("div", { className: "af-apollo-click-item__leading", children: _jsx(ClickItemPrefixComponent, { variant: variant, state: state, basePictureProps: basePictureProps, icon: icon }) }), _jsx("div", { className: "af-apollo-click-item__content", children: _jsx(ClickItemContentComponent, { title: title, subtitle: subtitle, textSecondary: textSecondary, textTertiary: textTertiary, tagLabel: tagLabel, tagProps: {
|
|
22
28
|
...(tagProps ?? {}),
|
|
23
29
|
variant: state === "disabled" ? "neutral" : tagProps?.variant,
|
|
24
|
-
} }) }), _jsx("div", { className: "af-apollo-click-item__trailing", children: _jsx(ClickItemSuffixComponent, { variant: variant, state: state
|
|
30
|
+
} }) }), _jsx("div", { className: "af-apollo-click-item__trailing", children: _jsx(ClickItemSuffixComponent, { variant: variant, state: state }) })] }));
|
|
25
31
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
type ClickItemWrapperProps = HTMLAttributes<HTMLElement> & {
|
|
3
|
+
isClickable?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const ClickItemWrapper: ({ isClickable, children, ...props }: ClickItemWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const ClickItemWrapper = ({ isClickable = true, children, ...props }) => {
|
|
3
|
+
if (isClickable) {
|
|
4
|
+
return (_jsx("button", { type: "button", ...props, children: children }));
|
|
5
|
+
}
|
|
6
|
+
return _jsx("div", { ...props, children: children });
|
|
7
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
export const ClickItemPrefixCommon = ({ state, variant, icon, basePictureProps, IconComponent, BasePictureComponent, }) => {
|
|
3
|
+
if (!(Boolean(basePictureProps) && variant === "agent") && !icon) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
3
6
|
if (Boolean(basePictureProps) && variant === "agent") {
|
|
4
7
|
return _jsx(BasePictureComponent, { ...basePictureProps });
|
|
5
8
|
}
|
|
6
|
-
|
|
7
|
-
return (_jsx(IconComponent, { role: "presentation", src: icon, variant: state === "disabled" && variant !== "small" ? "disabled" : "primary" }));
|
|
8
|
-
}
|
|
9
|
-
return null;
|
|
9
|
+
return (_jsx(IconComponent, { role: "presentation", src: icon ?? "", variant: state === "disabled" && variant !== "small" ? "disabled" : "primary" }));
|
|
10
10
|
};
|
package/dist/List/ClickItem/components/{ClickItemSuffixAppollo.js → ClickItemSuffixApollo.js}
RENAMED
|
@@ -2,6 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import arrowForward from "@material-symbols/svg-400/rounded/arrow_forward-fill.svg";
|
|
3
3
|
import { Icon } from "../../../Icon/IconApollo";
|
|
4
4
|
import { Spinner } from "../../../Spinner/SpinnerApollo";
|
|
5
|
-
import { ClickIcon } from "../../../ClickIcon/ClickIconApollo";
|
|
6
5
|
import { ClickItemSuffixCommon, } from "./ClickItemSuffixCommon";
|
|
7
|
-
export const ClickItemSuffix = (props) => (_jsx(ClickItemSuffixCommon, { trailingClickIcon: arrowForward, IconComponent: Icon, SpinnerComponent: Spinner,
|
|
6
|
+
export const ClickItemSuffix = (props) => (_jsx(ClickItemSuffixCommon, { trailingClickIcon: arrowForward, IconComponent: Icon, SpinnerComponent: Spinner, ...props }));
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { ComponentProps, ComponentType
|
|
1
|
+
import { ComponentProps, ComponentType } from "react";
|
|
2
2
|
import type { IconProps } from "../../../Icon/IconCommon";
|
|
3
3
|
import { ClickItemStates, ClickItemVariants } from "../ClickItemCommon";
|
|
4
4
|
import { Spinner } from "../../../Spinner/SpinnerCommon";
|
|
5
|
-
import type { ClickIconProps } from "../../../ClickIcon/ClickIconCommon";
|
|
6
5
|
export type ClickItemSuffixProps = {
|
|
7
6
|
state: ClickItemStates;
|
|
8
7
|
variant: ClickItemVariants;
|
|
9
|
-
ariaLabelForActionIcon?: string;
|
|
10
|
-
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
11
8
|
};
|
|
12
9
|
export type ClickItemSuffixCommonProps = ClickItemSuffixProps & {
|
|
13
10
|
trailingClickIcon: string;
|
|
14
11
|
IconComponent: ComponentType<IconProps>;
|
|
15
12
|
SpinnerComponent: ComponentType<ComponentProps<typeof Spinner>>;
|
|
16
|
-
ClickIconComponent: ComponentType<ClickIconProps>;
|
|
17
13
|
};
|
|
18
|
-
export declare const ClickItemSuffixCommon: ({ state, variant, trailingClickIcon,
|
|
14
|
+
export declare const ClickItemSuffixCommon: ({ state, variant, trailingClickIcon, IconComponent, SpinnerComponent, }: ClickItemSuffixCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import keyboardArrowRight from "@material-symbols/svg-400/rounded/keyboard_arrow_right-fill.svg";
|
|
3
|
-
export const ClickItemSuffixCommon = ({ state, variant, trailingClickIcon,
|
|
4
|
-
if (variant === "large") {
|
|
5
|
-
return
|
|
3
|
+
export const ClickItemSuffixCommon = ({ state, variant, trailingClickIcon, IconComponent, SpinnerComponent, }) => {
|
|
4
|
+
if (variant === "large" && state === "loading") {
|
|
5
|
+
return _jsx(SpinnerComponent, { size: 32 });
|
|
6
6
|
}
|
|
7
7
|
if (variant === "small") {
|
|
8
|
-
return
|
|
8
|
+
return _jsx(IconComponent, { src: keyboardArrowRight, role: "presentation" });
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const isDisabled = variant === "large" && state === "disabled";
|
|
11
|
+
return (_jsx("div", { className: ["af-click-icon", isDisabled && "af-click-icon--disabled"]
|
|
12
|
+
.filter(Boolean)
|
|
13
|
+
.join(" "), children: _jsx(IconComponent, { src: trailingClickIcon, role: "presentation", variant: isDisabled ? "disabled" : "primary" }) }));
|
|
14
14
|
};
|
|
@@ -2,6 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import keyboardArrowRight from "@material-symbols/svg-400/rounded/keyboard_arrow_right-fill.svg";
|
|
3
3
|
import { Icon } from "../../../Icon/IconLF";
|
|
4
4
|
import { Spinner } from "../../../Spinner/SpinnerLF";
|
|
5
|
-
import { ClickIcon } from "../../../ClickIcon/ClickIconLF";
|
|
6
5
|
import { ClickItemSuffixCommon, } from "./ClickItemSuffixCommon";
|
|
7
|
-
export const ClickItemSuffix = (props) => (_jsx(ClickItemSuffixCommon, { trailingClickIcon: keyboardArrowRight, IconComponent: Icon, SpinnerComponent: Spinner,
|
|
6
|
+
export const ClickItemSuffix = (props) => (_jsx(ClickItemSuffixCommon, { trailingClickIcon: keyboardArrowRight, IconComponent: Icon, SpinnerComponent: Spinner, ...props }));
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { CardMessage, cardMessageVariants, type CardMessageVariants, } from "./C
|
|
|
10
10
|
export { ClickIcon } from "./ClickIcon/ClickIconApollo";
|
|
11
11
|
export { ClickItem, clickItemStates, clickItemVariants, type ClickItemStates, type ClickItemVariants, } from "./List/ClickItem/ClickItemApollo";
|
|
12
12
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoApollo";
|
|
13
|
+
export { DataAgent } from "./DataAgent/DataAgentApollo";
|
|
13
14
|
export { Divider } from "./Divider/DividerApollo";
|
|
14
15
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxApollo";
|
|
15
16
|
export { CardCheckbox,
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export { CardMessage, cardMessageVariants, } from "./CardMessage/CardMessageApol
|
|
|
10
10
|
export { ClickIcon } from "./ClickIcon/ClickIconApollo";
|
|
11
11
|
export { ClickItem, clickItemStates, clickItemVariants, } from "./List/ClickItem/ClickItemApollo";
|
|
12
12
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoApollo";
|
|
13
|
+
export { DataAgent } from "./DataAgent/DataAgentApollo";
|
|
13
14
|
export { Divider } from "./Divider/DividerApollo";
|
|
14
15
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxApollo";
|
|
15
16
|
export { CardCheckbox,
|
package/dist/indexLF.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { CardMessage, cardMessageVariants, type CardMessageVariants, } from "./C
|
|
|
10
10
|
export { ClickIcon } from "./ClickIcon/ClickIconLF";
|
|
11
11
|
export { ClickItem, clickItemStates, clickItemVariants, type ClickItemStates, type ClickItemVariants, } from "./List/ClickItem/ClickItemLF";
|
|
12
12
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoLF";
|
|
13
|
+
export { DataAgent } from "./DataAgent/DataAgentLF";
|
|
13
14
|
export { Divider } from "./Divider/DividerLF";
|
|
14
15
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxLF";
|
|
15
16
|
export { CardCheckbox,
|
package/dist/indexLF.js
CHANGED
|
@@ -10,6 +10,7 @@ export { CardMessage, cardMessageVariants, } from "./CardMessage/CardMessageLF";
|
|
|
10
10
|
export { ClickIcon } from "./ClickIcon/ClickIconLF";
|
|
11
11
|
export { ClickItem, clickItemStates, clickItemVariants, } from "./List/ClickItem/ClickItemLF";
|
|
12
12
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoLF";
|
|
13
|
+
export { DataAgent } from "./DataAgent/DataAgentLF";
|
|
13
14
|
export { Divider } from "./Divider/DividerLF";
|
|
14
15
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxLF";
|
|
15
16
|
export { CardCheckbox,
|
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.387",
|
|
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.387",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.387",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|
/package/dist/List/ClickItem/components/{ClickItemSuffixAppollo.d.ts → ClickItemSuffixApollo.d.ts}
RENAMED
|
File without changes
|