@axa-fr/design-system-apollo-react 1.0.5-alpha.304 → 1.0.5-alpha.305

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.
@@ -0,0 +1,6 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioApollo.scss";
2
+ import { type CardRadioProps } from "./CardRadioCommon";
3
+ export declare const CardRadio: {
4
+ (props: CardRadioProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/RadioCard/RadioCardApollo.scss";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioApollo.scss";
3
3
  import { Icon } from "../../../Icon/IconApollo";
4
- import { RadioCardCommon } from "./RadioCardCommon";
4
+ import { CardRadioCommon } from "./CardRadioCommon";
5
5
  import { Radio } from "../Radio/RadioApollo";
6
6
  import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
7
- export const RadioCard = (props) => (_jsx(RadioCardCommon, { ...props, IconComponent: Icon, RadioComponent: Radio, ItemMessageComponent: ItemMessage }));
8
- RadioCard.displayName = "RadioCard";
7
+ export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, IconComponent: Icon, RadioComponent: Radio, ItemMessageComponent: ItemMessage }));
8
+ CardRadio.displayName = "CardRadio";
@@ -8,7 +8,7 @@ type RadioComponent = {
8
8
  type IconComponent = {
9
9
  IconComponent: ComponentType<ComponentProps<typeof Icon>>;
10
10
  };
11
- export type RadioCardProps = ComponentPropsWithRef<"input"> & {
11
+ export type CardRadioProps = ComponentPropsWithRef<"input"> & {
12
12
  type: "vertical" | "horizontal";
13
13
  labelGroup?: string;
14
14
  descriptionGroup?: string;
@@ -24,11 +24,11 @@ export type RadioCardProps = ComponentPropsWithRef<"input"> & {
24
24
  onChange?: React.ChangeEventHandler;
25
25
  error?: string;
26
26
  };
27
- export type RadioCardCommonProps = RadioCardProps & RadioComponent & IconComponent & {
27
+ export type CardRadioCommonProps = CardRadioProps & RadioComponent & IconComponent & {
28
28
  ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
29
29
  };
30
- declare const RadioCardCommon: {
31
- ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type, error, name, onChange, ItemMessageComponent, }: RadioCardCommonProps): import("react/jsx-runtime").JSX.Element;
30
+ declare const CardRadioCommon: {
31
+ ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type, error, name, onChange, ItemMessageComponent, }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
32
32
  displayName: string;
33
33
  };
34
- export { RadioCardCommon };
34
+ export { CardRadioCommon };
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, } from "react";
3
+ import { getComponentClassName } from "../../../utilities/getComponentClassName";
4
+ import { useIsSmallScreen } from "../../../utilities/hook/useIsSmallScreen";
5
+ import { BREAKPOINT } from "../../../utilities/constants";
6
+ const CardRadioCommon = ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type = "vertical", error, name, onChange, ItemMessageComponent, }) => {
7
+ const componentClassName = getComponentClassName("af-card-radio__container", className);
8
+ const RadioGroupClassName = getComponentClassName("af-card-radio-group", className, type);
9
+ const errorId = useId();
10
+ const isMobile = useIsSmallScreen(BREAKPOINT.SM);
11
+ const size = isMobile ? "M" : "L";
12
+ return (_jsxs("fieldset", { className: componentClassName, children: [labelGroup && (_jsxs("legend", { className: "af-card-radio__legend", children: [_jsxs("p", { children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": true, children: "\u00A0*" })] }), descriptionGroup && (_jsx("p", { className: "af-card-radio__description", children: descriptionGroup }))] })), _jsx("div", { className: RadioGroupClassName, children: options.map(({ label, description, subtitle, icon, hasError, ...inputProps }, index) => (_jsxs("label", { "aria-invalid": Boolean(error) || hasError, htmlFor: `id-${name ?? inputProps.name}-${index}`, className: "af-card-radio-label", children: [_jsx(RadioComponent, { id: `id-${name ?? inputProps.name}-${index}`, errorId: errorId, hasError: Boolean(error) || hasError, ...inputProps, name: name ?? inputProps.name, onChange: onChange }), _jsxs("div", { className: "af-card-radio-content", children: [icon && _jsx(IconComponent, { src: icon, size: size }), _jsxs("div", { className: "af-card-radio-content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, `${name ?? inputProps.name}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
13
+ };
14
+ CardRadioCommon.displayName = "CardRadioCommon";
15
+ export { CardRadioCommon };
@@ -0,0 +1,6 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioLF.scss";
2
+ import { type CardRadioProps } from "./CardRadioCommon";
3
+ export declare const CardRadio: {
4
+ (props: CardRadioProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/RadioCard/RadioCardLF.scss";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioLF.scss";
3
3
  import { Icon } from "../../../Icon/IconLF";
4
- import { RadioCardCommon } from "./RadioCardCommon";
4
+ import { CardRadioCommon } from "./CardRadioCommon";
5
5
  import { Radio } from "../Radio/RadioLF";
6
6
  import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
7
- export const RadioCard = (props) => (_jsx(RadioCardCommon, { ...props, IconComponent: Icon, RadioComponent: Radio, ItemMessageComponent: ItemMessage }));
8
- RadioCard.displayName = "RadioCard";
7
+ export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, IconComponent: Icon, RadioComponent: Radio, ItemMessageComponent: ItemMessage }));
8
+ CardRadio.displayName = "CardRadio";
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
16
16
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
17
17
  export { TextArea } from "./Form/TextArea/TextAreaApollo";
18
18
  export { Radio } from "./Form/Radio/Radio/RadioApollo";
19
- export { RadioCard } from "./Form/Radio/RadioCard/RadioCardApollo";
19
+ export { CardRadio } from "./Form/Radio/CardRadio/CardRadioApollo";
20
20
  export { InputText } from "./Form/InputText/InputTextApollo";
21
21
  export { DebugGrid } from "./Grid/DebugGridApollo";
22
22
  export { Heading, type HeadingLevel } from "./Heading/HeadingApollo";
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
16
16
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
17
17
  export { TextArea } from "./Form/TextArea/TextAreaApollo";
18
18
  export { Radio } from "./Form/Radio/Radio/RadioApollo";
19
- export { RadioCard } from "./Form/Radio/RadioCard/RadioCardApollo";
19
+ export { CardRadio } from "./Form/Radio/CardRadio/CardRadioApollo";
20
20
  export { InputText } from "./Form/InputText/InputTextApollo";
21
21
  export { DebugGrid } from "./Grid/DebugGridApollo";
22
22
  export { Heading } from "./Heading/HeadingApollo";
package/dist/indexLF.d.ts CHANGED
@@ -15,7 +15,7 @@ export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
15
15
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
16
16
  export { TextArea } from "./Form/TextArea/TextAreaLF";
17
17
  export { Radio } from "./Form/Radio/Radio/RadioLF";
18
- export { RadioCard } from "./Form/Radio/RadioCard/RadioCardLF";
18
+ export { CardRadio } from "./Form/Radio/CardRadio/CardRadioLF";
19
19
  export { InputText, InputText as TextInput, } from "./Form/InputText/InputTextLF";
20
20
  export { DebugGrid } from "./Grid/DebugGridLF";
21
21
  export { Heading, type HeadingLevel } from "./Heading/HeadingLF";
package/dist/indexLF.js CHANGED
@@ -15,7 +15,7 @@ export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
15
15
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
16
16
  export { TextArea } from "./Form/TextArea/TextAreaLF";
17
17
  export { Radio } from "./Form/Radio/Radio/RadioLF";
18
- export { RadioCard } from "./Form/Radio/RadioCard/RadioCardLF";
18
+ export { CardRadio } from "./Form/Radio/CardRadio/CardRadioLF";
19
19
  export { InputText, InputText as TextInput, } from "./Form/InputText/InputTextLF";
20
20
  export { DebugGrid } from "./Grid/DebugGridLF";
21
21
  export { Heading } from "./Heading/HeadingLF";
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.304",
3
+ "version": "1.0.5-alpha.305",
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.304",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.304",
49
+ "@axa-fr/design-system-apollo-css": "1.0.5-alpha.305",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.305",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },
@@ -1,6 +0,0 @@
1
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/RadioCard/RadioCardApollo.scss";
2
- import { RadioCardProps } from "./RadioCardCommon";
3
- export declare const RadioCard: {
4
- (props: RadioCardProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId, } from "react";
3
- import { getComponentClassName } from "../../../utilities/getComponentClassName";
4
- import { useIsSmallScreen } from "../../../utilities/hook/useIsSmallScreen";
5
- import { BREAKPOINT } from "../../../utilities/constants";
6
- const RadioCardCommon = ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type = "vertical", error, name, onChange, ItemMessageComponent, }) => {
7
- const componentClassName = getComponentClassName("af-radio-card__container", className);
8
- const RadioGroupClassName = getComponentClassName("af-radio-card-group", className, type);
9
- const errorId = useId();
10
- const isMobile = useIsSmallScreen(BREAKPOINT.SM);
11
- const size = isMobile ? "M" : "L";
12
- return (_jsxs("fieldset", { className: componentClassName, children: [_jsx("div", { className: "af-radio-card__label-container", children: _jsxs("legend", { children: [labelGroup && (_jsxs("span", { className: "af-radio-card__label", children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": true, children: "\u00A0*" })] })), descriptionGroup && (_jsx("p", { className: "af-radio-card__description", children: descriptionGroup }))] }) }), _jsx("div", { className: RadioGroupClassName, children: options.map(({ label, description, subtitle, icon, hasError, ...inputProps }, index) => (_jsxs("label", { "aria-invalid": Boolean(error) || hasError, htmlFor: `id-${name ?? inputProps.name}-${index}`, className: "af-radio-card-label", children: [_jsx(RadioComponent, { id: `id-${name ?? inputProps.name}-${index}`, errorId: errorId, hasError: Boolean(error) || hasError, ...inputProps, name: name ?? inputProps.name, onChange: onChange }), _jsxs("div", { className: "af-radio-card-content", children: [icon && _jsx(IconComponent, { src: icon, size: size }), _jsxs("div", { className: "af-radio-card-content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, `${name ?? inputProps.name}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
13
- };
14
- RadioCardCommon.displayName = "RadioCardCommon";
15
- export { RadioCardCommon };
@@ -1,6 +0,0 @@
1
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/RadioCard/RadioCardLF.scss";
2
- import { RadioCardProps } from "./RadioCardCommon";
3
- export declare const RadioCard: {
4
- (props: RadioCardProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };