@axa-fr/canopee-react 2.0.0-alpha.86 → 2.0.0-alpha.89

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.
package/dist/client.d.ts CHANGED
@@ -41,7 +41,7 @@ export { TextArea } from "./prospect-client/Form/TextArea/TextAreaLF";
41
41
  export { DebugGrid } from "./prospect-client/Grid/DebugGridLF";
42
42
  export { Header, type HeaderProps } from "./prospect-client/Header/HeaderLF";
43
43
  export { Heading, type HeadingLevel, type HeadingProps, } from "./prospect-client/Heading/HeadingLF";
44
- export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconVariants, } from "./prospect-client/Icon/IconLF";
44
+ export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconProps, type IconVariants, } from "./prospect-client/Icon/IconLF";
45
45
  export { ItemMenu, type ItemMenuProps, } from "./prospect-client/ItemMenu/ItemMenuLF";
46
46
  export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
47
47
  export { ExitLayout, type ExitLayoutProps, type ExitLayoutWithSubComponents, ExitLayoutSkeleton, type ExitLayoutSkeletonProps, } from "./prospect-client/Layout/ExitLayout/ExitLayoutLF";
@@ -1,2 +1,2 @@
1
1
  import "@axa-fr/canopee-css/prospect/Icon/IconApollo.css";
2
- export { Icon, iconVariants, type IconVariants, iconSizeVariants, type IconSizeVariants, } from "./IconCommon";
2
+ export { Icon, iconVariants, type IconVariants, iconSizeVariants, type IconProps, type IconSizeVariants, } from "./IconCommon";
@@ -1,2 +1,2 @@
1
1
  import "@axa-fr/canopee-css/client/Icon/IconLF.css";
2
- export { Icon, iconVariants, type IconVariants, iconSizeVariants, type IconSizeVariants, } from "./IconCommon";
2
+ export { Icon, iconVariants, type IconVariants, iconSizeVariants, type IconProps, type IconSizeVariants, } from "./IconCommon";
@@ -1,13 +1,15 @@
1
- import type { ComponentPropsWithoutRef, PropsWithChildren, ReactNode } from "react";
1
+ import type { ElementType, ReactNode } from "react";
2
+ import type { PolymorphicComponent } from "../utilities/types/PolymorphicComponent";
2
3
  export declare const linkVariants: {
3
4
  readonly inverse: "inverse";
4
5
  };
5
6
  export type LinkVariants = keyof typeof linkVariants;
6
- export type LinkProps = {
7
+ export type LinkProps<T extends ElementType = "a"> = PolymorphicComponent<T, {
7
8
  variant?: LinkVariants;
8
9
  openInNewTab?: boolean;
9
10
  leftIcon?: ReactNode;
10
11
  rightIcon?: ReactNode;
11
12
  className?: string;
12
- } & ComponentPropsWithoutRef<"a">;
13
- export declare const Link: ({ href, variant, openInNewTab, leftIcon, rightIcon, children, className, ...props }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
13
+ children?: ReactNode;
14
+ }>;
15
+ export declare const Link: <T extends ElementType = "a">({ as, variant, openInNewTab, leftIcon, rightIcon, children, className, ...props }: LinkProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -5,16 +5,17 @@ import { getClassName } from "../utilities/getClassName";
5
5
  export const linkVariants = {
6
6
  inverse: "inverse",
7
7
  };
8
- export const Link = ({ href, variant, openInNewTab = false, leftIcon, rightIcon, children, className, ...props }) => {
8
+ export const Link = ({ as, variant, openInNewTab = false, leftIcon, rightIcon, children, className, ...props }) => {
9
+ const Component = as ?? "a";
9
10
  const newTabProps = openInNewTab && {
10
11
  target: "_blank",
11
12
  rel: "noopener noreferrer",
12
13
  };
13
- return (_jsxs("a", { className: getClassName({
14
+ return (_jsxs(Component, { className: getClassName({
14
15
  baseClassName: "af-link",
15
16
  modifiers: [variant, openInNewTab && "openInNewTab"],
16
17
  className,
17
- }), href: href, ...newTabProps, ...props, children: [leftIcon, children, openInNewTab || Boolean(rightIcon)
18
+ }), ...newTabProps, ...props, children: [leftIcon, children, openInNewTab || Boolean(rightIcon)
18
19
  ? (rightIcon ?? _jsx(Svg, { src: openInNew }))
19
20
  : null] }));
20
21
  };
@@ -41,7 +41,7 @@ export { TextArea } from "./prospect-client/Form/TextArea/TextAreaApollo";
41
41
  export { DebugGrid } from "./prospect-client/Grid/DebugGridApollo";
42
42
  export { Heading, type HeadingLevel, type HeadingProps, } from "./prospect-client/Heading/HeadingApollo";
43
43
  export { Header, type HeaderProps, } from "./prospect-client/Header/HeaderApollo";
44
- export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconVariants, } from "./prospect-client/Icon/IconApollo";
44
+ export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconProps, type IconVariants, } from "./prospect-client/Icon/IconApollo";
45
45
  export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarApollo";
46
46
  export { ItemMenu, type ItemMenuProps, } from "./prospect-client/ItemMenu/ItemMenuApollo";
47
47
  export { MenuBurger, type MenuBurgerProps, } from "./prospect-client/MenuBurger/MenuBurgerApollo";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/canopee-react",
3
- "version": "2.0.0-alpha.86",
3
+ "version": "2.0.0-alpha.89",
4
4
  "description": "Package React - Design System Canopée",
5
5
  "exports": {
6
6
  "./distributeur": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "homepage": "https://github.com/AxaFrance/design-system#readme",
55
55
  "peerDependencies": {
56
- "@axa-fr/canopee-css": "2.0.0-alpha.86",
56
+ "@axa-fr/canopee-css": "2.0.0-alpha.89",
57
57
  "@material-symbols/svg-400": ">= 0.19.0",
58
58
  "@material-symbols/svg-700": ">= 0.19.0",
59
59
  "react": ">= 19"