@axa-fr/design-system-look-and-feel-react 0.3.0-ci.290 → 0.3.0-ci.292

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.
@@ -1,7 +1,10 @@
1
- import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
2
- import "@axa-fr/design-system-look-and-feel-css/dist/Link/Link.scss";
1
+ import { ComponentPropsWithoutRef, PropsWithChildren, type ReactNode } from "react";
3
2
  type LinkProps = {
4
3
  openInNewTab?: boolean;
4
+ leftIcon?: ReactNode;
5
+ rightIcon?: ReactNode;
6
+ className?: string;
7
+ classModifier?: string;
5
8
  } & ComponentPropsWithoutRef<"a">;
6
- export declare const Link: ({ href, openInNewTab, children, ...props }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Link: ({ href, openInNewTab, leftIcon, rightIcon, children, className, classModifier, ...props }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
7
10
  export {};
package/dist/Link/Link.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-look-and-feel-css/dist/Link/Link.scss";
3
2
  import openInNew from "@material-symbols/svg-400/outlined/open_in_new.svg";
3
+ import { useMemo, } from "react";
4
4
  import { Svg } from "../Svg";
5
- export const Link = ({ href, openInNewTab, children, ...props }) => {
5
+ import { getComponentClassName } from "../utilities";
6
+ export const Link = ({ href, openInNewTab = false, leftIcon, rightIcon, children, className, classModifier = "", ...props }) => {
6
7
  const newTabProps = openInNewTab && {
7
8
  target: "_blank",
8
9
  rel: "noopener noreferrer",
9
10
  };
10
- return (_jsxs("a", { className: `af-link ${openInNewTab ? " af-link--openInNewTab" : ""}`, href: href, ...newTabProps, ...props, children: [children, newTabProps && _jsx(Svg, { src: openInNew })] }));
11
+ const componentClassName = useMemo(() => getComponentClassName(className, `${classModifier}${!className && openInNewTab ? " openInNewTab" : ""}`, "af-link"), [classModifier, className, openInNewTab]);
12
+ return (_jsxs("a", { className: componentClassName, href: href, ...newTabProps, ...props, children: [leftIcon, children, (openInNewTab || Boolean(rightIcon)) &&
13
+ (rightIcon ?? _jsx(Svg, { src: openInNew }))] }));
11
14
  };
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-look-and-feel-css/dist/Link/Link.scss";
2
+ export { Link } from "./Link";
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-look-and-feel-css/dist/Link/Link.scss";
2
+ export { Link } from "./Link";
@@ -2,5 +2,5 @@ import type { TContentTabItem } from "./types";
2
2
  type TContentTabItemProps = TContentTabItem & {
3
3
  isMobile?: boolean;
4
4
  };
5
- export declare const ContentTabItem: ({ title, subtitle, tag, tagProps, date, buttons, value, isMobile, }: TContentTabItemProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ContentTabItem: ({ title, subtitle, tag, tagProps, date, actions, value, isMobile, }: TContentTabItemProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button, Tag } from "../../..";
3
- export const ContentTabItem = ({ title, subtitle, tag, tagProps, date, buttons = [], value, isMobile = false, }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "af-list-item__left-container", children: [Boolean(value) && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] })), _jsxs("div", { className: "af-list-item__label", children: [_jsx("span", { className: "af-list-item-label__title", children: title }), Boolean(subtitle) && (_jsx("span", { className: "af-list-item-label__subtitle", children: subtitle }))] }), !value && isMobile && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] }))] }), (buttons.length > 0 ||
2
+ import { Tag } from "../../..";
3
+ export const ContentTabItem = ({ title, subtitle, tag, tagProps, date, actions = [], value, isMobile = false, }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "af-list-item__left-container", children: [Boolean(value) && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] })), _jsxs("div", { className: "af-list-item__label", children: [_jsx("span", { className: "af-list-item-label__title", children: title }), Boolean(subtitle) && (_jsx("span", { className: "af-list-item-label__subtitle", children: subtitle }))] }), !value && isMobile && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] }))] }), (actions.length > 0 ||
4
4
  Boolean(tag) ||
5
5
  Boolean(date) ||
6
- Boolean(value)) && (_jsxs("div", { className: "af-list-item__right-container", children: [!value && (Boolean(tag) || Boolean(date)) && !isMobile && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && (_jsx("span", { className: "af-list-item__date", children: date }))] })), buttons.map((button) => (_jsx("div", { className: "af-list-item__button-container", children: _jsx(Button, { ...button }) }, button?.id))), Boolean(value) && _jsx("span", { className: "af-list-item__value", children: value })] }))] }));
6
+ Boolean(value)) && (_jsxs("div", { className: "af-list-item__right-container", children: [!value && (Boolean(tag) || Boolean(date)) && !isMobile && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && (_jsx("span", { className: "af-list-item__date", children: date }))] })), actions.map(({ id, component }) => (_jsx("div", { className: "af-list-item__action-container", children: component }, id))), Boolean(value) && _jsx("span", { className: "af-list-item__value", children: value })] }))] }));
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { Text as TextInput } from "./Form/Text";
14
14
  export { IconBg } from "./IconBg";
15
15
  export { Footer } from "./Layout/Footer/Footer";
16
16
  export { Header } from "./Layout/Header";
17
- export { Link } from "./Link/Link";
17
+ export { Link } from "./Link";
18
18
  export { List } from "./List";
19
19
  export { ClickItem, ClickList } from "./List/ClickList";
20
20
  export { ContentItemDuo } from "./List/ContentItemDuo";
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ export { Text as TextInput } from "./Form/Text";
13
13
  export { IconBg } from "./IconBg";
14
14
  export { Footer } from "./Layout/Footer/Footer";
15
15
  export { Header } from "./Layout/Header";
16
- export { Link } from "./Link/Link";
16
+ export { Link } from "./Link";
17
17
  export { List } from "./List";
18
18
  export { ClickItem, ClickList } from "./List/ClickList";
19
19
  export { ContentItemDuo } from "./List/ContentItemDuo";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-look-and-feel-react",
3
- "version": "0.3.0-ci.290",
3
+ "version": "0.3.0-ci.292",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "homepage": "https://github.com/AxaFrance/design-system#readme",
47
47
  "peerDependencies": {
48
- "@axa-fr/design-system-look-and-feel-css": "0.3.0-ci.290",
48
+ "@axa-fr/design-system-look-and-feel-css": "0.3.0-ci.292",
49
49
  "@material-symbols/svg-400": ">= 0.19.0",
50
50
  "react": ">= 18"
51
51
  },