@axa-fr/design-system-slash-react 1.1.1-alpha.2 → 1.1.1-alpha.4

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,11 +1,11 @@
1
- import { ReactNode } from "react";
1
+ import type { DetailsHTMLAttributes, ReactNode } from "react";
2
2
  export type CollapseProps = {
3
3
  id: string;
4
4
  title: ReactNode;
5
- children?: React.ReactNode;
5
+ children?: ReactNode;
6
6
  open?: boolean;
7
7
  name?: string;
8
- onToggle?: React.DetailsHTMLAttributes<HTMLDetailsElement>["onToggle"];
8
+ onToggle?: DetailsHTMLAttributes<HTMLDetailsElement>["onToggle"];
9
9
  className?: string;
10
10
  classModifier?: string;
11
11
  };
@@ -0,0 +1,10 @@
1
+ import { type ComponentProps, type ElementType, type ReactNode } from "react";
2
+ import "@axa-fr/design-system-slash-css/dist/Link/Link.scss";
3
+ export type LinkProps<C extends ElementType> = {
4
+ component?: C;
5
+ leftIcon?: ReactNode;
6
+ rightIcon?: ReactNode;
7
+ className?: string;
8
+ disabled?: boolean;
9
+ } & ComponentProps<C>;
10
+ export declare const Link: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,8 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import { forwardRef, } from "react";
4
+ import "@axa-fr/design-system-slash-css/dist/Link/Link.scss";
5
+ export const Link = forwardRef(({ className, component: Component = "a", leftIcon, rightIcon, target, rel, disabled, children, ...props }, ref) => {
6
+ return (_jsxs(Component, { className: classnames("af-slash-link", className), target: target, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? props["aria-disabled"], ...props, ref: ref, children: [leftIcon, children, rightIcon] }));
7
+ });
8
+ Link.displayName = "Link";
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export { Svg } from "./Svg";
27
27
  export { Tabs } from "./Tabs/Tabs";
28
28
  export { Title } from "./Title/Title";
29
29
  export { getComponentClassName } from "./utilities";
30
+ export { Link, type LinkProps } from "./Link/Link";
30
31
  export * from "./Accordion";
31
32
  export * from "./Popover";
32
33
  export * from "./Table";
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ export { Svg } from "./Svg";
27
27
  export { Tabs } from "./Tabs/Tabs";
28
28
  export { Title } from "./Title/Title";
29
29
  export { getComponentClassName } from "./utilities";
30
+ export { Link } from "./Link/Link";
30
31
  export * from "./Accordion";
31
32
  export * from "./Popover";
32
33
  export * from "./Table";
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.2",
3
+ "version": "1.1.1-alpha.4",
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-slash-css": "1.1.1-alpha.2",
48
+ "@axa-fr/design-system-slash-css": "1.1.1-alpha.4",
49
49
  "@material-symbols/svg-400": ">= 0.19.0",
50
50
  "react": ">= 18"
51
51
  },