@axa-fr/design-system-apollo-react 1.0.5-alpha.379 → 1.0.5-alpha.380

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.
@@ -7,14 +7,15 @@ import { CardRadioItem } from "./CardRadioItem";
7
7
  const CardRadioCommon = ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type = "vertical", error, name, value, onChange, ItemMessageComponent, ...inputProps }) => {
8
8
  const componentClassName = getComponentClassName("af-card-radio__container", className);
9
9
  const RadioGroupClassName = getComponentClassName("af-card-radio-group", className, type);
10
- const errorId = useId();
10
+ const cardRadioId = useId();
11
+ const errorId = `${cardRadioId}:error`;
11
12
  const isMobile = useIsSmallScreen(BREAKPOINT.SM);
12
13
  const size = isMobile
13
14
  ? "M"
14
15
  : "L";
15
16
  return (_jsxs("fieldset", { className: componentClassName, "aria-invalid": Boolean(error), "aria-errormessage": error ? errorId : undefined, 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((cardRadioItemProps) => (_jsx(CardRadioItem, { name: name, onChange: onChange, size: size, RadioComponent: RadioComponent, IconComponent: IconComponent, checked: value !== undefined
16
17
  ? value === cardRadioItemProps.value
17
- : undefined, ...inputProps, ...cardRadioItemProps }, `${name}-${crypto.randomUUID()}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
18
+ : undefined, ...inputProps, ...cardRadioItemProps }, `${name ?? cardRadioId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
18
19
  };
19
20
  CardRadioCommon.displayName = "CardRadioCommon";
20
21
  export { CardRadioCommon };
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.379",
3
+ "version": "1.0.5-alpha.380",
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.379",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.379",
49
+ "@axa-fr/design-system-apollo-css": "1.0.5-alpha.380",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.380",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },