@axa-fr/design-system-apollo-react 1.0.3-alpha.206 → 1.0.3-alpha.208

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,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Link/LinkApollo.scss";
2
+ export { Link, type LinkVariants, linkVariants } from "./LinkCommon";
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Link/LinkApollo.scss";
2
+ export { Link, linkVariants } from "./LinkCommon";
@@ -0,0 +1,17 @@
1
+ import { ComponentPropsWithoutRef, PropsWithChildren, type ReactNode } from "react";
2
+ export declare const linkVariants: {
3
+ readonly default: "default";
4
+ readonly underline: "underline";
5
+ readonly inverse: "inverse";
6
+ };
7
+ export type LinkVariants = keyof typeof linkVariants;
8
+ type LinkProps = {
9
+ variant?: LinkVariants;
10
+ openInNewTab?: boolean;
11
+ leftIcon?: ReactNode;
12
+ rightIcon?: ReactNode;
13
+ className?: string;
14
+ classModifier?: string;
15
+ } & ComponentPropsWithoutRef<"a">;
16
+ export declare const Link: ({ href, variant, openInNewTab, leftIcon, rightIcon, children, className, classModifier, ...props }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import openInNew from "@material-symbols/svg-400/outlined/open_in_new.svg";
3
+ import { useMemo, } from "react";
4
+ import { Svg } from "../Svg/Svg";
5
+ import { getComponentClassName } from "../utilities/getComponentClassName";
6
+ export const linkVariants = {
7
+ default: "default",
8
+ underline: "underline",
9
+ inverse: "inverse",
10
+ };
11
+ export const Link = ({ href, variant = "underline", openInNewTab = false, leftIcon, rightIcon, children, className, classModifier = "", ...props }) => {
12
+ const newTabProps = openInNewTab && {
13
+ target: "_blank",
14
+ rel: "noopener noreferrer",
15
+ };
16
+ const componentClassName = useMemo(() => getComponentClassName("af-link", className, `${classModifier}${!className && openInNewTab ? " openInNewTab" : ""} ${variant}`), [classModifier, className, openInNewTab, variant]);
17
+ return (_jsxs("a", { className: componentClassName, href: href, ...newTabProps, ...props, children: [leftIcon, children, (openInNewTab || Boolean(rightIcon)) &&
18
+ (rightIcon ?? _jsx(Svg, { src: openInNew }))] }));
19
+ };
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Link/LinkLF.scss";
2
+ export { Link, type LinkVariants, linkVariants } from "./LinkCommon";
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Link/LinkLF.scss";
2
+ export { Link, linkVariants } from "./LinkCommon";
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import "@axa-fr/design-system-apollo-css/dist/common/reboot.scss";
3
3
  import "@axa-fr/design-system-apollo-css/dist/Grid/Grid.scss";
4
4
  import "@fontsource/source-sans-pro";
5
5
  export { Button, buttonVariants, type ButtonVariants, } from "./Button/ButtonApollo";
6
+ export { Link, linkVariants, type LinkVariants } from "./Link/LinkApollo";
6
7
  export { Svg } from "./Svg/Svg";
7
8
  export { Spinner, spinnerVariants, type SpinnerVariants, } from "./Spinner/SpinnerApollo";
8
9
  export { DebugGrid } from "./Grid/DebugGrid";
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import "@axa-fr/design-system-apollo-css/dist/common/reboot.scss";
3
3
  import "@axa-fr/design-system-apollo-css/dist/Grid/Grid.scss";
4
4
  import "@fontsource/source-sans-pro";
5
5
  export { Button, buttonVariants, } from "./Button/ButtonApollo";
6
+ export { Link, linkVariants } from "./Link/LinkApollo";
6
7
  export { Svg } from "./Svg/Svg";
7
8
  export { Spinner, spinnerVariants, } from "./Spinner/SpinnerApollo";
8
9
  export { DebugGrid } from "./Grid/DebugGrid";
package/dist/indexLF.d.ts CHANGED
@@ -2,6 +2,7 @@ import "@axa-fr/design-system-look-and-feel-css/dist/common/tokens.scss";
2
2
  import "@axa-fr/design-system-apollo-css/dist/Grid/Grid.scss";
3
3
  import "@fontsource/source-sans-pro";
4
4
  export { Button, buttonVariants, type ButtonVariants } from "./Button/ButtonLF";
5
+ export { Link, linkVariants, type LinkVariants } from "./Link/LinkLF";
5
6
  export { Svg } from "./Svg/Svg";
6
7
  export { Spinner, spinnerVariants, type SpinnerVariants, } from "./Spinner/SpinnerLF";
7
8
  export { DebugGrid } from "./Grid/DebugGrid";
package/dist/indexLF.js CHANGED
@@ -2,6 +2,7 @@ import "@axa-fr/design-system-look-and-feel-css/dist/common/tokens.scss";
2
2
  import "@axa-fr/design-system-apollo-css/dist/Grid/Grid.scss";
3
3
  import "@fontsource/source-sans-pro";
4
4
  export { Button, buttonVariants } from "./Button/ButtonLF";
5
+ export { Link, linkVariants } from "./Link/LinkLF";
5
6
  export { Svg } from "./Svg/Svg";
6
7
  export { Spinner, spinnerVariants, } from "./Spinner/SpinnerLF";
7
8
  export { DebugGrid } from "./Grid/DebugGrid";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-apollo-react",
3
- "version": "1.0.3-alpha.206",
3
+ "version": "1.0.3-alpha.208",
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.3-alpha.206",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.3-alpha.206",
49
+ "@axa-fr/design-system-apollo-css": "1.0.3-alpha.208",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.3-alpha.208",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },