@axa-fr/design-system-slash-react 1.0.1-alpha.17 → 1.0.1-alpha.18

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.
@@ -6,5 +6,7 @@ export type CollapseProps = {
6
6
  open?: boolean;
7
7
  name?: string;
8
8
  onToggle?: React.DetailsHTMLAttributes<HTMLDetailsElement>["onToggle"];
9
+ className?: string;
10
+ classModifier?: string;
9
11
  };
10
- export declare const CollapseCard: ({ children, name, title, id, open, onToggle, }: CollapseProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const CollapseCard: ({ children, name, title, id, open, onToggle, className, classModifier, }: CollapseProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Body } from "./Body";
3
3
  import { Header } from "./Header";
4
- export const CollapseCard = ({ children, name, title, id, open, onToggle, }) => {
4
+ import { getComponentClassName } from "../utilities";
5
+ export const CollapseCard = ({ children, name, title, id, open, onToggle, className, classModifier = '', }) => {
5
6
  const headerId = id;
6
- return (_jsxs("details", { open: open, name: name, className: "af-accordion__details", onToggle: onToggle, children: [_jsx(Header, { id: headerId, children: title }), _jsx(Body, { children: children })] }));
7
+ let newClassModifier = open ? 'open' : '';
8
+ newClassModifier += ` ${classModifier}`;
9
+ const componentClassName = getComponentClassName(className, newClassModifier.trim(), "af-accordion__details");
10
+ return (_jsxs("details", { open: open, name: name, className: componentClassName, onToggle: onToggle, children: [_jsx(Header, { id: headerId, children: title }), _jsx(Body, { children: children })] }));
7
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-slash-react",
3
- "version": "1.0.1-alpha.17",
3
+ "version": "1.0.1-alpha.18",
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.0.1-alpha.17",
48
+ "@axa-fr/design-system-slash-css": "1.0.1-alpha.18",
49
49
  "@material-symbols/svg-400": ">= 0.19.0",
50
50
  "react": ">= 18"
51
51
  },