@axa-fr/design-system-look-and-feel-react 0.2.0-beta.320 → 0.2.0-beta.322

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.
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/Radio/Radio.scss";
3
3
  import radioIcon from "@material-symbols/svg-400/outlined/radio_button_checked.svg";
4
4
  import radioOutlineBlankIcon from "@material-symbols/svg-400/outlined/radio_button_unchecked.svg";
5
- import errorOutline from "@material-symbols/svg-400/outlined/error.svg";
6
5
  import { forwardRef, useId } from "react";
7
6
  import { Svg } from "../../Svg";
7
+ import { InputError } from "../InputError";
8
8
  const Radio = forwardRef(({ label, errorMessage, ...inputProps }, ref) => {
9
9
  let inputId = useId();
10
10
  inputId = inputProps.id || inputId;
11
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "af-radio", role: "radiogroup", "aria-invalid": Boolean(errorMessage), children: _jsxs("label", { htmlFor: inputId, children: [_jsx("input", { ref: ref, ...inputProps, type: "radio", id: inputId }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), label] }, inputProps.name) }), errorMessage && (_jsxs("div", { className: "af-radio__error", "aria-live": "assertive", children: [_jsx(Svg, { src: errorOutline }), errorMessage] }))] }));
11
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "af-radio", role: "radiogroup", "aria-invalid": Boolean(errorMessage), children: _jsxs("label", { htmlFor: inputId, children: [_jsx("input", { ref: ref, ...inputProps, type: "radio", id: inputId }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), label] }, inputProps.name) }), errorMessage && _jsx(InputError, { message: errorMessage })] }));
12
12
  });
13
13
  Radio.displayName = "Radio";
14
14
  export { Radio };
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/Radio/Radio.scss";
3
3
  import radioIcon from "@material-symbols/svg-400/outlined/radio_button_checked.svg";
4
4
  import radioOutlineBlankIcon from "@material-symbols/svg-400/outlined/radio_button_unchecked.svg";
5
- import errorOutline from "@material-symbols/svg-400/outlined/error.svg";
6
5
  import { forwardRef, useId, } from "react";
7
6
  import { Svg } from "../../Svg";
7
+ import { InputError } from "../InputError";
8
8
  export const RadioSelect = forwardRef(({ id, label, options, errorMessage, onChange, type = "vertical", name, value, isDisabled, isRequired, ...rest }, ref) => {
9
9
  const generatedId = useId();
10
10
  const optionId = id || generatedId;
11
11
  return (_jsxs(_Fragment, { children: [label && (_jsxs("span", { className: "af-radio__label", id: optionId, children: [label, isRequired && _jsx("span", { "aria-hidden": "true", children: "\u00A0*" })] })), _jsx("div", { ref: ref, ...rest, role: "radiogroup", className: `af-radio af-radio-select af-radio-select--${type}`, "aria-invalid": Boolean(errorMessage), "aria-labelledby": optionId, children: options.map(({ label: inputLabel, description, subtitle, icon, disabled: inputDisabled, ...inputProps }) => (_jsxs("label", { htmlFor: `${optionId}-${inputLabel}`, children: [_jsx("input", { type: "radio", "aria-labelledby": optionId, ...(isDisabled || inputDisabled ? { disabled: true } : null), ...inputProps, name: name, id: `${optionId}-${inputLabel}`, onChange: onChange, ...(value && {
12
12
  "aria-checked": value === inputProps.value,
13
13
  checked: value === inputProps.value,
14
- }) }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), _jsxs("div", { className: "af-radio__content", children: [icon, _jsxs("div", { className: "af-radio__content-description", children: [_jsx("span", { children: inputLabel }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, inputLabel))) }), errorMessage && (_jsxs("div", { className: "af-radio__error", "aria-live": "assertive", children: [_jsx(Svg, { src: errorOutline }), errorMessage] }))] }));
14
+ }) }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), _jsxs("div", { className: "af-radio__content", children: [icon, _jsxs("div", { className: "af-radio__content-description", children: [_jsx("span", { children: inputLabel }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, inputLabel))) }), errorMessage && _jsx(InputError, { message: errorMessage })] }));
15
15
  });
16
16
  RadioSelect.displayName = "RadioSelect";
@@ -1,8 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import arrow from "@material-symbols/svg-400/outlined/arrow_right.svg";
3
- import trash from "@material-symbols/svg-400/outlined/delete.svg";
4
- import sync from "@material-symbols/svg-400/outlined/sync-fill.svg";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import trashIcon from "@material-symbols/svg-400/outlined/delete.svg";
3
+ import publishedWithChangesIcon from "@material-symbols/svg-400/outlined/published_with_changes-fill.svg";
5
4
  import { Svg } from "../Svg";
5
+ import { ClickItem } from "./ClickList";
6
+ import { ContentItemMono } from "./ContentItemMono";
6
7
  import { List } from "./List";
7
8
  const meta = {
8
9
  title: "Components/List",
@@ -14,41 +15,15 @@ export const Default = {
14
15
  render: ({ classModifier, ...args }) => (_jsx(List, { classModifier: classModifier.join(" "), ...args })),
15
16
  args: {
16
17
  children: [
17
- _jsx("div", { children: _jsx("span", { children: "Pr\u00E9nom NOM" }) }, "list-item-1"),
18
- _jsx("div", { children: _jsx("span", { children: "nom.pr\u00E9nom@mail.fr" }) }, "list-item-2"),
19
- _jsxs("div", { style: {
20
- display: "flex",
21
- flexDirection: "row",
22
- alignItems: "center",
23
- gap: "0.5rem",
24
- }, children: [_jsx(Svg, { src: sync }), _jsxs("div", { style: {
25
- display: "flex",
26
- flexDirection: "row",
27
- alignItems: "center",
28
- justifyContent: "space-between",
29
- width: "100%",
30
- }, children: [_jsx("span", { children: "Modifier le profil" }), _jsx(Svg, { src: arrow })] })] }, "list-item-3"),
31
- _jsx("div", { style: {
32
- display: "flex",
33
- flexDirection: "row",
34
- alignItems: "center",
35
- gap: "4rem",
36
- }, children: _jsxs("div", { style: {
37
- display: "flex",
38
- flexDirection: "row",
39
- alignItems: "center",
40
- gap: "0.5rem",
41
- }, children: [_jsx(Svg, { src: trash }), _jsx("span", { children: "Supprimer le profil" })] }) }, "list-element-3"),
18
+ _jsx(ContentItemMono, { secondaryText: "nom.pr\u00E9nom@mail.fr", children: "Pr\u00E9nom NOM" }, 0),
19
+ _jsx(ClickItem, { icon: _jsx(Svg, { src: publishedWithChangesIcon }), children: "Modifier le profil" }, 1),
20
+ _jsx(ClickItem, { icon: _jsx(Svg, { src: trashIcon }), children: "Supprimer le profil" }, 2),
42
21
  ],
43
- classModifier: [],
22
+ classModifier: ["first-separator-full-width"],
44
23
  },
45
24
  argTypes: {
46
25
  classModifier: {
47
- options: [
48
- "large",
49
- "first-separator-full-width",
50
- "first-separator-full-width",
51
- ],
26
+ options: ["large", "first-separator-full-width"],
52
27
  control: { type: "multi-select" },
53
28
  defaultValue: [],
54
29
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-look-and-feel-react",
3
- "version": "0.2.0-beta.320",
3
+ "version": "0.2.0-beta.322",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "homepage": "https://github.com/AxaFrance/design-system#readme",
43
43
  "peerDependencies": {
44
- "@axa-fr/design-system-look-and-feel-css": "0.2.0-beta.320",
44
+ "@axa-fr/design-system-look-and-feel-css": "0.2.0-beta.322",
45
45
  "@material-symbols/svg-400": ">= 0.19.0",
46
46
  "react": ">= 18"
47
47
  },