@axa-fr/canopee-react 1.3.1-alpha.14 → 1.3.1-alpha.16
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/client.d.ts +12 -10
- package/dist/client.js +12 -10
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo.js +6 -0
- package/dist/prospect-client/Form/Radio/{CardRadio/CardRadioCommon.d.ts → CardRadioGroup/CardRadioGroupCommon.d.ts} +11 -6
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +16 -0
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF.js +6 -0
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionCommon.d.ts +5 -1
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionCommon.js +12 -8
- package/dist/prospect.d.ts +12 -10
- package/dist/prospect.js +12 -10
- package/package.json +2 -2
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.js +0 -6
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +0 -16
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.js +0 -6
package/dist/client.d.ts
CHANGED
|
@@ -2,17 +2,19 @@ import "@axa-fr/canopee-css/client/common/rebootLF.css";
|
|
|
2
2
|
import "@axa-fr/canopee-css/client/common/tokens.css";
|
|
3
3
|
import "@axa-fr/canopee-css/client/Grid/Grid.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
|
-
export { AccordionContextual, accordionContextualVariants, type AccordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualLF";
|
|
6
5
|
export { Accordion, accordionVariants, type AccordionVariants, } from "./prospect-client/Accordion/AccordionLF";
|
|
6
|
+
export { AccordionContextual, accordionContextualVariants, type AccordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualLF";
|
|
7
7
|
export { AccordionCore } from "./prospect-client/AccordionCore/AccordionCoreLF";
|
|
8
8
|
export { BasePicture } from "./prospect-client/BasePicture/BasePicture";
|
|
9
9
|
export { Button, buttonVariants, type ButtonVariants, } from "./prospect-client/Button/ButtonLF";
|
|
10
|
+
export { Card, type CardProps } from "./prospect-client/Card/CardLF";
|
|
10
11
|
export { CardMessage, cardMessageVariants, type CardMessageVariants, } from "./prospect-client/CardMessage/CardMessageLF";
|
|
11
12
|
export { ClickIcon } from "./prospect-client/ClickIcon/ClickIconLF";
|
|
12
13
|
export { ContentItemDuoAction, type ContentItemDuoActionState, } from "./prospect-client/ContentItemDuoAction/ContentItemDuoActionLF";
|
|
13
14
|
export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMonoLF";
|
|
14
15
|
export { DataAgent } from "./prospect-client/DataAgent/DataAgentLF";
|
|
15
16
|
export { Divider } from "./prospect-client/Divider/DividerLF";
|
|
17
|
+
export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetLF";
|
|
16
18
|
export { CardCheckbox,
|
|
17
19
|
/** @deprecated Use `CardCheckbox` instead. */
|
|
18
20
|
CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF";
|
|
@@ -34,7 +36,9 @@ InputText as TextInput, } from "./prospect-client/Form/InputText/InputTextLF";
|
|
|
34
36
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomLF";
|
|
35
37
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelLF";
|
|
36
38
|
export { ItemMessage, itemMessageVariants, type ItemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageLF";
|
|
37
|
-
export {
|
|
39
|
+
export {
|
|
40
|
+
/** @deprecated Use `CardRadioGroup` instead. */
|
|
41
|
+
CardRadioGroup as CardRadio, CardRadioGroup, } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF";
|
|
38
42
|
export { CardRadioOption } from "./prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF";
|
|
39
43
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioLF";
|
|
40
44
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaLF";
|
|
@@ -43,13 +47,19 @@ export { Heading, type HeadingLevel, } from "./prospect-client/Heading/HeadingLF
|
|
|
43
47
|
export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconVariants, } from "./prospect-client/Icon/IconLF";
|
|
44
48
|
export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
|
|
45
49
|
export { Footer, type FooterProps, } from "./prospect-client/Layout/Footer/FooterLF";
|
|
50
|
+
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
46
51
|
export { Link, linkVariants, type LinkVariants, } from "./prospect-client/Link/LinkLF";
|
|
47
52
|
export { ClickItem, clickItemStates, clickItemVariants, type ClickItemStates, type ClickItemVariants, } from "./prospect-client/List/ClickItem/ClickItemLF";
|
|
48
53
|
export { ContentItemDuo } from "./prospect-client/List/ContentItemDuo/ContentItemDuoLF";
|
|
54
|
+
export { List, type ListProps } from "./prospect-client/List/List/ListLF";
|
|
49
55
|
export { Message, messageVariants, type MessageVariants, } from "./prospect-client/Message/MessageLF";
|
|
50
56
|
export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./prospect-client/Modal/ModalLF";
|
|
57
|
+
export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationLF";
|
|
58
|
+
export { Pagination } from "./prospect-client/Pagination/PaginationLF";
|
|
51
59
|
export { ProgressBar } from "./prospect-client/ProgressBar/ProgressBarLF";
|
|
52
60
|
export { ProgressBarGroup } from "./prospect-client/ProgressBarGroup/ProgressBarGroupLF";
|
|
61
|
+
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
62
|
+
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
|
53
63
|
export { Spinner, spinnerVariants, type SpinnerVariants, } from "./prospect-client/Spinner/SpinnerLF";
|
|
54
64
|
export { Stepper } from "./prospect-client/Stepper/StepperLF";
|
|
55
65
|
export { Svg } from "./prospect-client/Svg/Svg";
|
|
@@ -57,11 +67,3 @@ export { TabBar, tabBarDirection, type TabBarDirection, type TabBarProps, } from
|
|
|
57
67
|
export { Tag, tagVariants, type TagVariants, } from "./prospect-client/Tag/TagLF";
|
|
58
68
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalLF";
|
|
59
69
|
export { Toggle } from "./prospect-client/Toggle/ToggleLF";
|
|
60
|
-
export { Pagination } from "./prospect-client/Pagination/PaginationLF";
|
|
61
|
-
export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationLF";
|
|
62
|
-
export { Card, type CardProps } from "./prospect-client/Card/CardLF";
|
|
63
|
-
export { List, type ListProps } from "./prospect-client/List/List/ListLF";
|
|
64
|
-
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
65
|
-
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
66
|
-
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
|
67
|
-
export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetLF";
|
package/dist/client.js
CHANGED
|
@@ -2,17 +2,19 @@ import "@axa-fr/canopee-css/client/common/rebootLF.css";
|
|
|
2
2
|
import "@axa-fr/canopee-css/client/common/tokens.css";
|
|
3
3
|
import "@axa-fr/canopee-css/client/Grid/Grid.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
|
-
export { AccordionContextual, accordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualLF";
|
|
6
5
|
export { Accordion, accordionVariants, } from "./prospect-client/Accordion/AccordionLF";
|
|
6
|
+
export { AccordionContextual, accordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualLF";
|
|
7
7
|
export { AccordionCore } from "./prospect-client/AccordionCore/AccordionCoreLF";
|
|
8
8
|
export { BasePicture } from "./prospect-client/BasePicture/BasePicture";
|
|
9
9
|
export { Button, buttonVariants, } from "./prospect-client/Button/ButtonLF";
|
|
10
|
+
export { Card } from "./prospect-client/Card/CardLF";
|
|
10
11
|
export { CardMessage, cardMessageVariants, } from "./prospect-client/CardMessage/CardMessageLF";
|
|
11
12
|
export { ClickIcon } from "./prospect-client/ClickIcon/ClickIconLF";
|
|
12
13
|
export { ContentItemDuoAction, } from "./prospect-client/ContentItemDuoAction/ContentItemDuoActionLF";
|
|
13
14
|
export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMonoLF";
|
|
14
15
|
export { DataAgent } from "./prospect-client/DataAgent/DataAgentLF";
|
|
15
16
|
export { Divider } from "./prospect-client/Divider/DividerLF";
|
|
17
|
+
export { Fieldset, } from "./prospect-client/Fieldset/FieldsetLF";
|
|
16
18
|
export { CardCheckbox,
|
|
17
19
|
/** @deprecated Use `CardCheckbox` instead. */
|
|
18
20
|
CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF";
|
|
@@ -33,7 +35,9 @@ InputText as TextInput, } from "./prospect-client/Form/InputText/InputTextLF";
|
|
|
33
35
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomLF";
|
|
34
36
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelLF";
|
|
35
37
|
export { ItemMessage, itemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageLF";
|
|
36
|
-
export {
|
|
38
|
+
export {
|
|
39
|
+
/** @deprecated Use `CardRadioGroup` instead. */
|
|
40
|
+
CardRadioGroup as CardRadio, CardRadioGroup, } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF";
|
|
37
41
|
export { CardRadioOption } from "./prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF";
|
|
38
42
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioLF";
|
|
39
43
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaLF";
|
|
@@ -42,13 +46,19 @@ export { Heading, } from "./prospect-client/Heading/HeadingLF";
|
|
|
42
46
|
export { Icon, iconSizeVariants, iconVariants, } from "./prospect-client/Icon/IconLF";
|
|
43
47
|
export { ItemTabBar, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
|
|
44
48
|
export { Footer, } from "./prospect-client/Layout/Footer/FooterLF";
|
|
49
|
+
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
45
50
|
export { Link, linkVariants, } from "./prospect-client/Link/LinkLF";
|
|
46
51
|
export { ClickItem, clickItemStates, clickItemVariants, } from "./prospect-client/List/ClickItem/ClickItemLF";
|
|
47
52
|
export { ContentItemDuo } from "./prospect-client/List/ContentItemDuo/ContentItemDuoLF";
|
|
53
|
+
export { List } from "./prospect-client/List/List/ListLF";
|
|
48
54
|
export { Message, messageVariants, } from "./prospect-client/Message/MessageLF";
|
|
49
55
|
export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./prospect-client/Modal/ModalLF";
|
|
56
|
+
export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationLF";
|
|
57
|
+
export { Pagination } from "./prospect-client/Pagination/PaginationLF";
|
|
50
58
|
export { ProgressBar } from "./prospect-client/ProgressBar/ProgressBarLF";
|
|
51
59
|
export { ProgressBarGroup } from "./prospect-client/ProgressBarGroup/ProgressBarGroupLF";
|
|
60
|
+
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
61
|
+
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
|
52
62
|
export { Spinner, spinnerVariants, } from "./prospect-client/Spinner/SpinnerLF";
|
|
53
63
|
export { Stepper } from "./prospect-client/Stepper/StepperLF";
|
|
54
64
|
export { Svg } from "./prospect-client/Svg/Svg";
|
|
@@ -56,11 +66,3 @@ export { TabBar, tabBarDirection, } from "./prospect-client/TabBar/TabBarLF";
|
|
|
56
66
|
export { Tag, tagVariants, } from "./prospect-client/Tag/TagLF";
|
|
57
67
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalLF";
|
|
58
68
|
export { Toggle } from "./prospect-client/Toggle/ToggleLF";
|
|
59
|
-
export { Pagination } from "./prospect-client/Pagination/PaginationLF";
|
|
60
|
-
export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationLF";
|
|
61
|
-
export { Card } from "./prospect-client/Card/CardLF";
|
|
62
|
-
export { List } from "./prospect-client/List/List/ListLF";
|
|
63
|
-
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
64
|
-
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
65
|
-
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
|
66
|
-
export { Fieldset, } from "./prospect-client/Fieldset/FieldsetLF";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
|
|
3
|
+
import { CardRadioOption } from "../CardRadioOption/CardRadioOptionApollo";
|
|
4
|
+
import { CardRadioGroupCommon, } from "./CardRadioGroupCommon";
|
|
5
|
+
import "@axa-fr/canopee-css/prospect/Form/Radio/CardRadioGroup/CardRadioGroupApollo.css";
|
|
6
|
+
export const CardRadioGroup = (props) => (_jsx(CardRadioGroupCommon, { ...props, CardRadioOptionComponent: CardRadioOption, ItemMessageComponent: ItemMessage }));
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType, type PropsWithChildren, type ReactNode } from "react";
|
|
2
|
-
import { type CardRadioOptionProps } from "../CardRadioOption/CardRadioOptionCommon";
|
|
3
2
|
import { ItemMessage, type ItemMessageProps } from "../../ItemMessage/ItemMessageCommon";
|
|
3
|
+
import { type CardRadioOptionProps } from "../CardRadioOption/CardRadioOptionCommon";
|
|
4
4
|
type RadioOption = Omit<CardRadioOptionProps, "name" | "type" | "isInvalid">;
|
|
5
|
-
export type
|
|
5
|
+
export type CardRadioGroupProps = Omit<CardRadioOptionProps, "value" | "label" | "type" | "isInvalid" | "icon" | "src" | "basePictureProps" | "description" | "subtitle" | "children" | "position"> & {
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `position` and `cardStyle` instead.
|
|
8
|
+
*/
|
|
6
9
|
type?: "vertical" | "horizontal";
|
|
10
|
+
cardStyle?: CardRadioOptionProps["position"];
|
|
11
|
+
position?: "line" | "column";
|
|
7
12
|
/**
|
|
8
13
|
* @deprecated Use `label` instead.
|
|
9
14
|
*/
|
|
@@ -28,12 +33,12 @@ export type CardRadioProps = Omit<CardRadioOptionProps, "value" | "label" | "typ
|
|
|
28
33
|
*/
|
|
29
34
|
error?: ReactNode;
|
|
30
35
|
} & PropsWithChildren & Partial<ItemMessageProps>;
|
|
31
|
-
export type CardRadioCommonProps =
|
|
36
|
+
export type CardRadioCommonProps = CardRadioGroupProps & {
|
|
32
37
|
CardRadioOptionComponent: ComponentType<CardRadioOptionProps>;
|
|
33
38
|
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
34
39
|
};
|
|
35
|
-
declare const
|
|
36
|
-
({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type, error, message, messageType, name, value, id, CardRadioOptionComponent, ItemMessageComponent, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare const CardRadioGroupCommon: {
|
|
41
|
+
({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, cardStyle, type, position, error, message, messageType, name, value, id, CardRadioOptionComponent, ItemMessageComponent, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
37
42
|
displayName: string;
|
|
38
43
|
};
|
|
39
|
-
export {
|
|
44
|
+
export { CardRadioGroupCommon };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, } from "react";
|
|
3
|
+
const CardRadioGroupCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, cardStyle, type = "vertical", position = (cardStyle ?? type) === "vertical" ? "column" : "line", error, message, messageType = "error", name, value, id, CardRadioOptionComponent, ItemMessageComponent, ...inputProps }) => {
|
|
4
|
+
const generatedId = useId();
|
|
5
|
+
const cardRadioGroupId = id ?? generatedId;
|
|
6
|
+
const messageId = `${cardRadioGroupId}-error`;
|
|
7
|
+
const hasError = (Boolean(message) && messageType === "error") || Boolean(error);
|
|
8
|
+
return (_jsxs("fieldset", { className: ["af-card-radio-group", className].filter(Boolean).join(" "), role: "radiogroup", "aria-required": Boolean(required) || undefined, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, id: cardRadioGroupId, children: [_jsxs("legend", { className: "af-card-radio-group__legend", children: [_jsxs("p", { className: "af-card-radio-group__label", children: [label, labelGroup, required || isRequired ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description || descriptionGroup ? (_jsxs("p", { className: "af-card-radio-group__description", children: [description, descriptionGroup] })) : null] }), _jsx("div", { className: [
|
|
9
|
+
"af-card-radio-group__options",
|
|
10
|
+
`af-card-radio-group__options--${position}`,
|
|
11
|
+
].join(" "), children: options.map((cardRadioItemProps) => (_jsx(CardRadioOptionComponent, { id: `${cardRadioGroupId}-${cardRadioItemProps.value}`, checked: value !== undefined
|
|
12
|
+
? value === cardRadioItemProps.value
|
|
13
|
+
: undefined, required: required, position: cardStyle ?? type, ...inputProps, ...cardRadioItemProps, isInvalid: hasError, name: name }, `${name ?? cardRadioGroupId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message || error, messageType: messageType })] }));
|
|
14
|
+
};
|
|
15
|
+
CardRadioGroupCommon.displayName = "CardRadioGroupCommon";
|
|
16
|
+
export { CardRadioGroupCommon };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
3
|
+
import { CardRadioOption } from "../CardRadioOption/CardRadioOptionLF";
|
|
4
|
+
import { CardRadioGroupCommon, } from "./CardRadioGroupCommon";
|
|
5
|
+
import "@axa-fr/canopee-css/client/Form/Radio/CardRadioGroup/CardRadioGroupLF.css";
|
|
6
|
+
export const CardRadioGroup = (props) => (_jsx(CardRadioGroupCommon, { ...props, CardRadioOptionComponent: CardRadioOption, ItemMessageComponent: ItemMessage }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType, type ReactNode } from "react";
|
|
2
|
-
import type { Icon as IconCommon } from "../../../Icon/IconCommon";
|
|
3
2
|
import { BasePicture } from "../../../BasePicture/BasePicture";
|
|
3
|
+
import type { Icon as IconCommon } from "../../../Icon/IconCommon";
|
|
4
4
|
import type { Radio } from "../Radio/RadioCommon";
|
|
5
5
|
type BaseCardRadioOptionProps = Omit<ComponentProps<typeof Radio>, "size"> & {
|
|
6
6
|
label: ReactNode;
|
|
@@ -8,7 +8,11 @@ type BaseCardRadioOptionProps = Omit<ComponentProps<typeof Radio>, "size"> & {
|
|
|
8
8
|
subtitle?: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export type CardRadioOptionProps = BaseCardRadioOptionProps & {
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use `position` instead.
|
|
13
|
+
*/
|
|
11
14
|
type?: "vertical" | "horizontal";
|
|
15
|
+
position?: "vertical" | "horizontal";
|
|
12
16
|
icon?: ComponentProps<typeof IconCommon>["src"];
|
|
13
17
|
src?: ComponentProps<typeof BasePicture>["src"];
|
|
14
18
|
basePictureProps?: Omit<ComponentProps<typeof BasePicture>, "src">;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, } from "react";
|
|
3
3
|
import { BasePicture } from "../../../BasePicture/BasePicture";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { getClassName } from "../../../utilities/getClassName";
|
|
5
|
+
export const CardRadioOptionCommon = forwardRef(({ label, position, type, description, subtitle, icon, src, basePictureProps, isInvalid, className, RadioComponent, IconComponent, ...inputProps }, ref) => {
|
|
6
|
+
const isCardRadioOptionHorizontal = [position, type].includes("horizontal");
|
|
7
|
+
return (_jsxs("label", { className: getClassName({
|
|
8
|
+
baseClassName: "af-card-radio-option",
|
|
9
|
+
modifiers: [
|
|
10
|
+
isInvalid && "invalid",
|
|
11
|
+
isCardRadioOptionHorizontal && "horizontal",
|
|
12
|
+
],
|
|
13
|
+
className,
|
|
14
|
+
}), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, isCardRadioOptionHorizontal && src ? (_jsx(BasePicture, { src: src, ...basePictureProps })) : null, _jsxs("div", { className: "af-card-radio-option__content", children: [_jsx("p", { className: "af-card-radio-option__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-radio-option__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-radio-option__subtitle", children: subtitle }))] }), _jsx(RadioComponent, { ...inputProps, isInvalid: isInvalid, ref: ref })] }));
|
|
15
|
+
});
|
|
12
16
|
CardRadioOptionCommon.displayName = "CardRadioOptionCommon";
|
package/dist/prospect.d.ts
CHANGED
|
@@ -2,17 +2,19 @@ import "@axa-fr/canopee-css/prospect/common/reboot.css";
|
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/common/tokens.css";
|
|
3
3
|
import "@axa-fr/canopee-css/prospect/Grid/Grid.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
|
-
export { AccordionContextual, accordionContextualVariants, type AccordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualApollo";
|
|
6
5
|
export { Accordion, accordionVariants, type AccordionVariants, } from "./prospect-client/Accordion/AccordionApollo";
|
|
6
|
+
export { AccordionContextual, accordionContextualVariants, type AccordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualApollo";
|
|
7
7
|
export { AccordionCore } from "./prospect-client/AccordionCore/AccordionCoreApollo";
|
|
8
8
|
export { BasePicture } from "./prospect-client/BasePicture/BasePicture";
|
|
9
9
|
export { Button, buttonVariants, type ButtonVariants, } from "./prospect-client/Button/ButtonApollo";
|
|
10
|
+
export { Card, type CardProps } from "./prospect-client/Card/CardApollo";
|
|
10
11
|
export { CardMessage, cardMessageVariants, type CardMessageVariants, } from "./prospect-client/CardMessage/CardMessageApollo";
|
|
11
12
|
export { ClickIcon } from "./prospect-client/ClickIcon/ClickIconApollo";
|
|
12
13
|
export { ContentItemDuoAction, type ContentItemDuoActionState, } from "./prospect-client/ContentItemDuoAction/ContentItemDuoActionApollo";
|
|
13
14
|
export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMonoApollo";
|
|
14
15
|
export { DataAgent } from "./prospect-client/DataAgent/DataAgentApollo";
|
|
15
16
|
export { Divider } from "./prospect-client/Divider/DividerApollo";
|
|
17
|
+
export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetApollo";
|
|
16
18
|
export { CardCheckbox,
|
|
17
19
|
/** @deprecated Use `CardCheckbox` instead. */
|
|
18
20
|
CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
@@ -30,7 +32,9 @@ export { InputText } from "./prospect-client/Form/InputText/InputTextApollo";
|
|
|
30
32
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomApollo";
|
|
31
33
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelApollo";
|
|
32
34
|
export { ItemMessage, itemMessageVariants, type ItemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageApollo";
|
|
33
|
-
export {
|
|
35
|
+
export {
|
|
36
|
+
/** @deprecated Use `CardRadioGroup` instead. */
|
|
37
|
+
CardRadioGroup as CardRadio, CardRadioGroup, } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo";
|
|
34
38
|
export { CardRadioOption } from "./prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo";
|
|
35
39
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioApollo";
|
|
36
40
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaApollo";
|
|
@@ -39,13 +43,19 @@ export { Heading, type HeadingLevel, } from "./prospect-client/Heading/HeadingAp
|
|
|
39
43
|
export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconVariants, } from "./prospect-client/Icon/IconApollo";
|
|
40
44
|
export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarApollo";
|
|
41
45
|
export { Footer, type FooterProps, } from "./prospect-client/Layout/Footer/FooterApollo";
|
|
46
|
+
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
42
47
|
export { Link, linkVariants, type LinkVariants, } from "./prospect-client/Link/LinkApollo";
|
|
43
48
|
export { ClickItem, clickItemStates, clickItemVariants, type ClickItemStates, type ClickItemVariants, } from "./prospect-client/List/ClickItem/ClickItemApollo";
|
|
44
49
|
export { ContentItemDuo } from "./prospect-client/List/ContentItemDuo/ContentItemDuoApollo";
|
|
50
|
+
export { List, type ListProps } from "./prospect-client/List/List/ListApollo";
|
|
45
51
|
export { Message, messageVariants, type MessageVariants, } from "./prospect-client/Message/MessageApollo";
|
|
46
52
|
export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./prospect-client/Modal/ModalApollo";
|
|
53
|
+
export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationApollo";
|
|
54
|
+
export { Pagination } from "./prospect-client/Pagination/PaginationApollo";
|
|
47
55
|
export { ProgressBar } from "./prospect-client/ProgressBar/ProgressBarApollo";
|
|
48
56
|
export { ProgressBarGroup } from "./prospect-client/ProgressBarGroup/ProgressBarGroupApollo";
|
|
57
|
+
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
58
|
+
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
49
59
|
export { Spinner, spinnerVariants, type SpinnerVariants, } from "./prospect-client/Spinner/SpinnerApollo";
|
|
50
60
|
export { Stepper } from "./prospect-client/Stepper/StepperApollo";
|
|
51
61
|
export { Svg } from "./prospect-client/Svg/Svg";
|
|
@@ -53,11 +63,3 @@ export { TabBar, tabBarDirection, type TabBarDirection, type TabBarProps, } from
|
|
|
53
63
|
export { Tag, tagVariants, type TagVariants, } from "./prospect-client/Tag/TagApollo";
|
|
54
64
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalApollo";
|
|
55
65
|
export { Toggle } from "./prospect-client/Toggle/ToggleApollo";
|
|
56
|
-
export { Pagination } from "./prospect-client/Pagination/PaginationApollo";
|
|
57
|
-
export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationApollo";
|
|
58
|
-
export { Card, type CardProps } from "./prospect-client/Card/CardApollo";
|
|
59
|
-
export { List, type ListProps } from "./prospect-client/List/List/ListApollo";
|
|
60
|
-
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
61
|
-
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
62
|
-
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
63
|
-
export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetApollo";
|
package/dist/prospect.js
CHANGED
|
@@ -2,17 +2,19 @@ import "@axa-fr/canopee-css/prospect/common/reboot.css";
|
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/common/tokens.css";
|
|
3
3
|
import "@axa-fr/canopee-css/prospect/Grid/Grid.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
|
-
export { AccordionContextual, accordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualApollo";
|
|
6
5
|
export { Accordion, accordionVariants, } from "./prospect-client/Accordion/AccordionApollo";
|
|
6
|
+
export { AccordionContextual, accordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualApollo";
|
|
7
7
|
export { AccordionCore } from "./prospect-client/AccordionCore/AccordionCoreApollo";
|
|
8
8
|
export { BasePicture } from "./prospect-client/BasePicture/BasePicture";
|
|
9
9
|
export { Button, buttonVariants, } from "./prospect-client/Button/ButtonApollo";
|
|
10
|
+
export { Card } from "./prospect-client/Card/CardApollo";
|
|
10
11
|
export { CardMessage, cardMessageVariants, } from "./prospect-client/CardMessage/CardMessageApollo";
|
|
11
12
|
export { ClickIcon } from "./prospect-client/ClickIcon/ClickIconApollo";
|
|
12
13
|
export { ContentItemDuoAction, } from "./prospect-client/ContentItemDuoAction/ContentItemDuoActionApollo";
|
|
13
14
|
export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMonoApollo";
|
|
14
15
|
export { DataAgent } from "./prospect-client/DataAgent/DataAgentApollo";
|
|
15
16
|
export { Divider } from "./prospect-client/Divider/DividerApollo";
|
|
17
|
+
export { Fieldset, } from "./prospect-client/Fieldset/FieldsetApollo";
|
|
16
18
|
export { CardCheckbox,
|
|
17
19
|
/** @deprecated Use `CardCheckbox` instead. */
|
|
18
20
|
CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
@@ -29,7 +31,9 @@ export { InputText } from "./prospect-client/Form/InputText/InputTextApollo";
|
|
|
29
31
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomApollo";
|
|
30
32
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelApollo";
|
|
31
33
|
export { ItemMessage, itemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageApollo";
|
|
32
|
-
export {
|
|
34
|
+
export {
|
|
35
|
+
/** @deprecated Use `CardRadioGroup` instead. */
|
|
36
|
+
CardRadioGroup as CardRadio, CardRadioGroup, } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo";
|
|
33
37
|
export { CardRadioOption } from "./prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo";
|
|
34
38
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioApollo";
|
|
35
39
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaApollo";
|
|
@@ -38,13 +42,19 @@ export { Heading, } from "./prospect-client/Heading/HeadingApollo";
|
|
|
38
42
|
export { Icon, iconSizeVariants, iconVariants, } from "./prospect-client/Icon/IconApollo";
|
|
39
43
|
export { ItemTabBar, } from "./prospect-client/ItemTabBar/ItemTabBarApollo";
|
|
40
44
|
export { Footer, } from "./prospect-client/Layout/Footer/FooterApollo";
|
|
45
|
+
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
41
46
|
export { Link, linkVariants, } from "./prospect-client/Link/LinkApollo";
|
|
42
47
|
export { ClickItem, clickItemStates, clickItemVariants, } from "./prospect-client/List/ClickItem/ClickItemApollo";
|
|
43
48
|
export { ContentItemDuo } from "./prospect-client/List/ContentItemDuo/ContentItemDuoApollo";
|
|
49
|
+
export { List } from "./prospect-client/List/List/ListApollo";
|
|
44
50
|
export { Message, messageVariants, } from "./prospect-client/Message/MessageApollo";
|
|
45
51
|
export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./prospect-client/Modal/ModalApollo";
|
|
52
|
+
export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationApollo";
|
|
53
|
+
export { Pagination } from "./prospect-client/Pagination/PaginationApollo";
|
|
46
54
|
export { ProgressBar } from "./prospect-client/ProgressBar/ProgressBarApollo";
|
|
47
55
|
export { ProgressBarGroup } from "./prospect-client/ProgressBarGroup/ProgressBarGroupApollo";
|
|
56
|
+
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
57
|
+
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
48
58
|
export { Spinner, spinnerVariants, } from "./prospect-client/Spinner/SpinnerApollo";
|
|
49
59
|
export { Stepper } from "./prospect-client/Stepper/StepperApollo";
|
|
50
60
|
export { Svg } from "./prospect-client/Svg/Svg";
|
|
@@ -52,11 +62,3 @@ export { TabBar, tabBarDirection, } from "./prospect-client/TabBar/TabBarApollo"
|
|
|
52
62
|
export { Tag, tagVariants, } from "./prospect-client/Tag/TagApollo";
|
|
53
63
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalApollo";
|
|
54
64
|
export { Toggle } from "./prospect-client/Toggle/ToggleApollo";
|
|
55
|
-
export { Pagination } from "./prospect-client/Pagination/PaginationApollo";
|
|
56
|
-
export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationApollo";
|
|
57
|
-
export { Card } from "./prospect-client/Card/CardApollo";
|
|
58
|
-
export { List } from "./prospect-client/List/List/ListApollo";
|
|
59
|
-
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
60
|
-
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
61
|
-
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
62
|
-
export { Fieldset, } from "./prospect-client/Fieldset/FieldsetApollo";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "1.3.1-alpha.
|
|
3
|
+
"version": "1.3.1-alpha.16",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@axa-fr/canopee-css": "1.3.1-alpha.
|
|
48
|
+
"@axa-fr/canopee-css": "1.3.1-alpha.16",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
51
51
|
"react": ">= 18"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CardRadioOption } from "../CardRadioOption/CardRadioOptionApollo";
|
|
3
|
-
import { CardRadioCommon } from "./CardRadioCommon";
|
|
4
|
-
import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
|
|
5
|
-
import "@axa-fr/canopee-css/prospect/Form/Radio/CardRadio/CardRadioApollo.css";
|
|
6
|
-
export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, CardRadioOptionComponent: CardRadioOption, ItemMessageComponent: ItemMessage }));
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId, } from "react";
|
|
3
|
-
const CardRadioCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type = "vertical", error, message, messageType = "error", name, value, id, CardRadioOptionComponent, ItemMessageComponent, ...inputProps }) => {
|
|
4
|
-
const generatedId = useId();
|
|
5
|
-
const cardRadioId = id ?? generatedId;
|
|
6
|
-
const messageId = `${cardRadioId}-error`;
|
|
7
|
-
const hasError = (Boolean(message) && messageType === "error") || Boolean(error);
|
|
8
|
-
return (_jsxs("fieldset", { className: ["af-card-radio", className].filter(Boolean).join(" "), role: "radiogroup", "aria-required": Boolean(required) || undefined, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, id: cardRadioId, children: [_jsxs("legend", { className: "af-card-radio__legend", children: [_jsxs("p", { className: "af-card-radio__label", children: [label, labelGroup, required || isRequired ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description || descriptionGroup ? (_jsxs("p", { className: "af-card-radio__description", children: [description, descriptionGroup] })) : null] }), _jsx("div", { className: [
|
|
9
|
-
"af-card-radio__options",
|
|
10
|
-
`af-card-radio__options--${type}`,
|
|
11
|
-
].join(" "), children: options.map((cardRadioItemProps) => (_jsx(CardRadioOptionComponent, { id: `${cardRadioId}-${cardRadioItemProps.value}`, checked: value !== undefined
|
|
12
|
-
? value === cardRadioItemProps.value
|
|
13
|
-
: undefined, required: required, ...inputProps, ...cardRadioItemProps, type: type, isInvalid: hasError, name: name }, `${name ?? cardRadioId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message || error, messageType: messageType })] }));
|
|
14
|
-
};
|
|
15
|
-
CardRadioCommon.displayName = "CardRadioCommon";
|
|
16
|
-
export { CardRadioCommon };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CardRadioOption } from "../CardRadioOption/CardRadioOptionLF";
|
|
3
|
-
import { CardRadioCommon } from "./CardRadioCommon";
|
|
4
|
-
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
5
|
-
import "@axa-fr/canopee-css/client/Form/Radio/CardRadio/CardRadioLF.css";
|
|
6
|
-
export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, CardRadioOptionComponent: CardRadioOption, ItemMessageComponent: ItemMessage }));
|