@amboss/design-system 1.2.11 → 1.3.1

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,20 +1,19 @@
1
1
  import React from "react";
2
+ import { Box } from "../Box/Box";
2
3
  export declare type CollapsibleProps = {
3
- /** always visible header */
4
- header: string;
5
- /** content visible after spreading the component */
6
- children?: React.ReactElement | React.ReactNode[];
4
+ /** the first element of the array of children has to be `<CollapsibleHeader/>`. The rest of the children is the content visible after spreading the component */
5
+ children: [
6
+ React.ReactElement<CollapsibleHeaderProps>,
7
+ ...React.ReactElement[]
8
+ ];
7
9
  isExpanded: boolean | undefined;
8
- onClick?: (e: React.FormEvent<HTMLButtonElement>) => void;
9
10
  };
10
- export declare const CollapsibleContainer: import("@emotion/styled").StyledComponent<{
11
- /** always visible header */
12
- theme?: import("@emotion/react").Theme;
13
- as?: React.ElementType<any>;
14
- }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
15
- export declare const StyledContainer: import("@emotion/styled").StyledComponent<{
16
- /** always visible header */
11
+ export declare type CollapsibleHeaderProps = {
12
+ onClick?: (e: React.FormEvent<HTMLButtonElement>) => void;
13
+ } & React.ComponentProps<typeof Box>;
14
+ export declare const StyledChildrenContainer: import("@emotion/styled").StyledComponent<{
17
15
  theme?: import("@emotion/react").Theme;
18
16
  as?: React.ElementType<any>;
19
17
  }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
20
- export declare function Collapsible({ header, isExpanded, onClick, children, }: CollapsibleProps): React.ReactElement;
18
+ export declare function CollapsibleHeader({ space, vSpace, rSpace, lSpace, tSpace, bSpace, onClick, children, }: CollapsibleHeaderProps): React.ReactElement;
19
+ export declare function Collapsible({ isExpanded, children, }: CollapsibleProps): React.ReactElement;
@@ -35,4 +35,4 @@ export { SegmentedProgressBar } from "./components/SegmentedProgressBar/Segmente
35
35
  export { ProgressBar } from "./components/ProgressBar/ProgressBar";
36
36
  export { Container } from "./components/Container/Container";
37
37
  export { PasswordInput } from "./components/Form/PasswordInput/PasswordInput";
38
- export { Collapsible } from "./components/Collapsible/Collapsible";
38
+ export { Collapsible, CollapsibleHeader } from "./components/Collapsible/Collapsible";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amboss/design-system",
3
- "version": "1.2.11",
3
+ "version": "1.3.1",
4
4
  "description": "the design system for AMBOSS products",
5
5
  "author": "Bagrat Gobedashvili",
6
6
  "license": "ISC",