@cloudwick/astral-ui 3.0.2 → 3.0.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  UI Library for Cloudwick
4
4
 
5
- Version - 3.0.2
5
+ Version - 3.0.4
6
6
 
7
7
  ## Installation
8
8
 
@@ -1,4 +1,4 @@
1
- import { ReactElement } from "react";
1
+ import { ReactElement, RefObject } from "react";
2
2
  import { ModalHeaderProps } from "./modalHeader";
3
3
  import { ModalBodyProps } from "./modalBody";
4
4
  export interface Props {
@@ -10,10 +10,6 @@ export interface Props {
10
10
  * Modal content
11
11
  */
12
12
  children: ReactElement<ModalBodyProps> | [ReactElement<ModalHeaderProps>, ReactElement<ModalBodyProps>];
13
- /**
14
- * Callback function for onHide
15
- */
16
- onHide?: () => void;
17
13
  /**
18
14
  * Overwrite the Modal styles by passing space separated class names
19
15
  */
@@ -32,8 +28,21 @@ export interface Props {
32
28
  * @default true
33
29
  */
34
30
  closeButton?: boolean;
31
+ /**
32
+ * Pass a reference to the element where the Modal needs to be rendered
33
+ * @default document.body
34
+ */
35
+ portalTarget?: HTMLElement;
36
+ /**
37
+ * A list of Refs to be considered as a part of the Lock. The html elements in the list will be accessible while the Modal is open.
38
+ */
39
+ shards?: (HTMLElement | RefObject<any>)[];
40
+ /**
41
+ * Callback function for onHide
42
+ */
43
+ onHide?: () => void;
35
44
  }
36
- export declare function Modal({ className, rtl, children, showModal, escKeyClose, closeButton, onHide }: Props): ReactElement | null;
45
+ export declare function Modal({ className, rtl, children, showModal, escKeyClose, closeButton, portalTarget, shards, onHide }: Props): ReactElement | null;
37
46
  export declare namespace Modal {
38
47
  var Header: ({ children, className }: ModalHeaderProps) => ReactElement | null;
39
48
  var Body: ({ className, children }: ModalBodyProps) => ReactElement | null;
@@ -1,7 +1,4 @@
1
- import { ReactElement } from "react";
2
- import { PanelBodyProps } from "./panelBody";
3
- import { PanelFooterProps } from "./panelFooter";
4
- import { PanelHeaderProps } from "./panelHeader";
1
+ import React, { RefObject } from "react";
5
2
  export interface Props {
6
3
  /**
7
4
  * Variant of the Panel
@@ -9,22 +6,42 @@ export interface Props {
9
6
  */
10
7
  variant?: "extended" | "compact";
11
8
  /**
12
- * Control Panel's visibility
9
+ * Prop to control the panel display
13
10
  * @default false
14
11
  */
15
12
  showPanel?: boolean;
16
13
  /**
17
- * Overwrite the Panel styles by passing space separated class names
14
+ * Toggle the visibility of the Panel without unmounting it
15
+ * @default false
16
+ */
17
+ toggleVisibilityUsingCss?: boolean;
18
+ /**
19
+ * Overwrite the Panel styles by passing space separated class names
18
20
  */
19
21
  className?: string;
20
22
  /**
21
- * Panel content
23
+ * Accepts children of ReactNode type
24
+ */
25
+ children: React.ReactNode;
26
+ /** If set to true, the panel will open from left and sets dir="rtl" */
27
+ rtl?: boolean;
28
+ /**
29
+ * Pass a reference to the element where the Panel needs to be rendered
30
+ * @default document.body
31
+ */
32
+ portalTarget?: HTMLElement;
33
+ /**
34
+ * A list of Refs to be considered as a part of the Lock. The html elements in the list will be accessible while the Panel is open.
35
+ */
36
+ shards?: (HTMLElement | RefObject<any>)[];
37
+ /**
38
+ * Optional callback function to call when panel is closed
22
39
  */
23
- children?: (ReactElement<PanelBodyProps> | [ReactElement<PanelHeaderProps>, ReactElement<PanelBodyProps>] | [ReactElement<PanelBodyProps>, ReactElement<PanelFooterProps>] | [ReactElement<PanelHeaderProps>, ReactElement<PanelBodyProps>, ReactElement<PanelFooterProps>]);
40
+ onClose?: () => void;
24
41
  }
25
- export declare function Panel({ variant, showPanel, children, className }: Props): ReactElement | null;
42
+ export declare function Panel({ variant, showPanel, toggleVisibilityUsingCss, className, children, rtl, portalTarget, shards, onClose }: Props): React.ReactElement | null;
26
43
  export declare namespace Panel {
27
- var Header: ({ className, showBackButton, onBackHandler, showCloseButton, onCloseHandler, customCTA, header, subHeader }: PanelHeaderProps) => ReactElement | null;
28
- var Body: ({ className, children }: PanelBodyProps) => ReactElement | null;
29
- var Footer: ({ className, children }: PanelFooterProps) => ReactElement | null;
44
+ var Header: ({ className, showBackButton, onBackHandler, showCloseButton, onCloseHandler, customCTA, header, subHeader }: import("./panelHeader").PanelHeaderProps) => React.ReactElement | null;
45
+ var Body: ({ className, children }: import("./panelBody").PanelBodyProps) => React.ReactElement | null;
46
+ var Footer: ({ className, children }: import("./panelFooter").PanelFooterProps) => React.ReactElement | null;
30
47
  }
@@ -9,5 +9,5 @@ export interface PanelFooterProps {
9
9
  */
10
10
  className?: string;
11
11
  }
12
- export declare const PanelFooter: ({ className, children }: PanelFooterProps) => ReactElement | null;
12
+ declare const PanelFooter: ({ className, children }: PanelFooterProps) => ReactElement | null;
13
13
  export default PanelFooter;
@@ -1,14 +1,13 @@
1
- import { ReactElement } from "react";
2
- import { Panel } from "../panel";
1
+ import { ReactElement, ReactNode } from "react";
3
2
  export interface Props {
4
3
  /**
5
4
  * Overwrite the styles for PanelGroup by passing space separated class names
6
5
  */
7
6
  className?: string;
8
7
  /**
9
- * PanelGroup children. The component accepts one or more Panels as its children.
8
+ * Pass one or more Panels as the children
10
9
  */
11
- children?: ReactElement<typeof Panel> | ReactElement<typeof Panel>[];
10
+ children?: ReactNode;
12
11
  /**
13
12
  * Use the prop to set the active panel index. The value for the active index needs to start from 0.
14
13
  * @default 0