@axa-fr/design-system-slash-react 1.1.1-alpha.239 → 1.1.1-alpha.241
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/Link/CustomLink.d.ts +8 -0
- package/dist/Link/CustomLink.js +6 -0
- package/dist/Link/Link.d.ts +4 -9
- package/dist/Link/Link.js +9 -5
- package/dist/Link/LinkAnchor.d.ts +10 -0
- package/dist/Link/LinkAnchor.js +10 -0
- package/dist/Link/linkClassName.d.ts +1 -0
- package/dist/Link/linkClassName.js +1 -0
- package/package.json +2 -2
package/dist/Link/Link.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { type ComponentProps, type ElementType, type ReactNode } from "react";
|
|
2
1
|
import "@axa-fr/design-system-slash-css/dist/Link/Link.scss";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
className?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
} & ComponentProps<C>;
|
|
10
|
-
export declare const Link: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
2
|
+
import { type CustomLinkProps } from "./CustomLink";
|
|
3
|
+
import { type LinkComponentProps } from "./LinkAnchor";
|
|
4
|
+
export type LinkProps = LinkComponentProps | CustomLinkProps;
|
|
5
|
+
export declare const Link: import("react").ForwardRefExoticComponent<(CustomLinkProps | Omit<LinkComponentProps, "ref">) & import("react").RefAttributes<HTMLAnchorElement>>;
|
package/dist/Link/Link.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { forwardRef, } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
2
|
import "@axa-fr/design-system-slash-css/dist/Link/Link.scss";
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { CustomLink } from "./CustomLink";
|
|
5
|
+
import { LinkAnchor } from "./LinkAnchor";
|
|
6
|
+
export const Link = forwardRef((props, ref) => {
|
|
7
|
+
if ("render" in props) {
|
|
8
|
+
return _jsx(CustomLink, { ...props });
|
|
9
|
+
}
|
|
10
|
+
return _jsx(LinkAnchor, { ...props, ref: ref });
|
|
7
11
|
});
|
|
8
12
|
Link.displayName = "Link";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
type AnchorLinkProps = {
|
|
3
|
+
leftIcon?: ReactNode;
|
|
4
|
+
rightIcon?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type LinkComponentProps = ComponentPropsWithRef<"a"> & AnchorLinkProps;
|
|
9
|
+
declare const LinkAnchor: import("react").ForwardRefExoticComponent<Omit<LinkComponentProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
export { LinkAnchor, type LinkComponentProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classnames from "classnames";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { linkClassName } from "./linkClassName";
|
|
5
|
+
const LinkAnchor = forwardRef(({ className, target, rel, leftIcon, children, rightIcon, disabled, ...restProps }, ref) => {
|
|
6
|
+
const finalClassName = classnames(linkClassName, className);
|
|
7
|
+
return (_jsxs("a", { className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"], ref: ref, ...restProps, children: [leftIcon, children, rightIcon] }));
|
|
8
|
+
});
|
|
9
|
+
LinkAnchor.displayName = "LinkAnchor";
|
|
10
|
+
export { LinkAnchor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const linkClassName = "af-slash-link";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const linkClassName = "af-slash-link";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-slash-react",
|
|
3
|
-
"version": "1.1.1-alpha.
|
|
3
|
+
"version": "1.1.1-alpha.241",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@axa-fr/design-system-slash-css": "1.1.1-alpha.
|
|
50
|
+
"@axa-fr/design-system-slash-css": "1.1.1-alpha.241",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|