@axa-fr/design-system-apollo-react 1.0.5-alpha.386 → 1.0.5-alpha.388
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/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/ClickItemContentCommon.js +1 -1
- 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/package.json +3 -3
- /package/dist/List/ClickItem/components/{ClickItemSuffixAppollo.d.ts → ClickItemSuffixApollo.d.ts} +0 -0
|
@@ -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,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
export const ClickItemContentCommon = ({ title, subtitle, textSecondary, textTertiary, tagLabel, tagProps, TagComponent, }) => {
|
|
3
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "af-apollo-click-item__title", children:
|
|
3
|
+
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "af-apollo-click-item__title", children: title }), subtitle && _jsx("p", { className: "af-apollo-click-item__subtitle", children: subtitle }), textSecondary && (_jsx("p", { className: "af-apollo-click-item__secondary", children: textSecondary })), textTertiary && (_jsx("p", { className: "af-apollo-click-item__tertiary", children: textTertiary })), tagLabel && (_jsx("div", { className: "af-apollo-click-item__tag-container", children: _jsx(TagComponent, { ...tagProps, children: tagLabel }) }))] }));
|
|
4
4
|
};
|
|
@@ -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/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.388",
|
|
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.388",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.388",
|
|
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
|