@cloudwick/astral-ui 1.0.0 → 2.0.0
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 +4 -4
- package/dist/components/adpIcon/svgObjects.d.ts +4 -4
- package/dist/components/avatar/index.d.ts +27 -0
- package/dist/components/avatarGroup/index.d.ts +32 -0
- package/dist/components/badge/index.d.ts +20 -16
- package/dist/components/button/index.d.ts +42 -16
- package/dist/components/card/cardBody.d.ts +13 -0
- package/dist/components/card/cardFooter.d.ts +13 -0
- package/dist/components/card/cardHeader.d.ts +22 -0
- package/dist/components/card/index.d.ts +14 -4
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkboxGroup/index.d.ts +9 -6
- package/dist/components/ctaGroup/index.d.ts +46 -0
- package/dist/components/dropdown/dropdownItem.d.ts +1 -3
- package/dist/components/dropdown/index.d.ts +1 -1
- package/dist/components/emptyState/index.d.ts +2 -1
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/modalBody.d.ts +1 -5
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/panel/index.d.ts +30 -0
- package/dist/components/panel/panelBody.d.ts +13 -0
- package/dist/components/panel/panelFooter.d.ts +13 -0
- package/dist/components/panel/panelHeader.d.ts +39 -0
- package/dist/components/panel/panelStoryHelpers.d.ts +7 -0
- package/dist/components/panelGroup/index.d.ts +23 -0
- package/dist/components/passwordField/index.d.ts +4 -0
- package/dist/components/scrollbar/index.d.ts +34 -0
- package/dist/components/scrollbar/storyUtils.d.ts +8 -0
- package/dist/components/select/index.d.ts +35 -8
- package/dist/components/select/utils.d.ts +3 -0
- package/dist/components/tabs/tab.d.ts +17 -10
- package/dist/components/textCopy/index.d.ts +29 -0
- package/dist/components/textField/index.d.ts +17 -13
- package/dist/components/toast/index.d.ts +4 -2
- package/dist/components/toggle/index.d.ts +1 -1
- package/dist/components/truncate/index.d.ts +21 -0
- package/dist/css/index.min.css +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.esm.js +2 -2
- package/package.json +3 -10
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Astral UI
|
|
2
2
|
|
|
3
|
-
UI
|
|
3
|
+
UI Library for Cloudwick
|
|
4
4
|
|
|
5
|
-
Version - 2.
|
|
5
|
+
Version - 2.0.0
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -21,4 +21,4 @@ yarn add @cloudwick/astral-ui
|
|
|
21
21
|
|
|
22
22
|
## Documentation
|
|
23
23
|
|
|
24
|
-
[The documentation](https://www.ui.
|
|
24
|
+
[The documentation](https://www.astral-ui.amorphic.link/)
|
|
@@ -21,14 +21,15 @@ export declare const iconList: {
|
|
|
21
21
|
readonly alertFilled: "alert-filled";
|
|
22
22
|
readonly amorphicConnect: "amorphic-connect";
|
|
23
23
|
readonly api: "api";
|
|
24
|
+
readonly app: "app";
|
|
24
25
|
readonly appAccessService: "app-access-service";
|
|
25
26
|
readonly appDatabase: "app-database";
|
|
26
27
|
readonly appFlow: "app-flow";
|
|
27
28
|
readonly appManagement: "app-management";
|
|
28
29
|
readonly appNavigator: "app-navigator";
|
|
29
30
|
readonly approve: "approve";
|
|
30
|
-
readonly app: "app";
|
|
31
31
|
readonly apps: "apps";
|
|
32
|
+
readonly arrowTurnLeft: "arrow-turn-left";
|
|
32
33
|
readonly attachment: "attachment";
|
|
33
34
|
readonly aura: "aura";
|
|
34
35
|
readonly authorisedGroups: "authorised-groups";
|
|
@@ -157,7 +158,6 @@ export declare const iconList: {
|
|
|
157
158
|
readonly minusCircle: "minus-circle";
|
|
158
159
|
readonly mlModel: "ml-model";
|
|
159
160
|
readonly monthlyUsagePattern: "monthly-usage-pattern";
|
|
160
|
-
readonly more: "more";
|
|
161
161
|
readonly msg: "msg";
|
|
162
162
|
readonly mysql: "mysql";
|
|
163
163
|
readonly notebook: "notebook";
|
|
@@ -182,6 +182,7 @@ export declare const iconList: {
|
|
|
182
182
|
readonly repair: "repair";
|
|
183
183
|
readonly restart: "restart";
|
|
184
184
|
readonly rightArrow: "right-arrow";
|
|
185
|
+
readonly rightArrowLong: "right-arrow-long";
|
|
185
186
|
readonly runs: "runs";
|
|
186
187
|
readonly save: "save";
|
|
187
188
|
readonly scheduled: "scheduled";
|
|
@@ -231,14 +232,13 @@ export declare const iconList: {
|
|
|
231
232
|
readonly user: "user";
|
|
232
233
|
readonly userAgreements: "user-agreements";
|
|
233
234
|
readonly vMenu: "v-menu";
|
|
235
|
+
readonly vMenuFilled: "v-menu-filled";
|
|
234
236
|
readonly video: "video";
|
|
235
|
-
readonly warning: "warning";
|
|
236
237
|
readonly widgetGroup: "widget-group";
|
|
237
238
|
readonly workflow: "workflow";
|
|
238
239
|
readonly zoomIn: "zoom-in";
|
|
239
240
|
readonly zoomOut: "zoom-out";
|
|
240
241
|
readonly leftArrowLong: "left-arrow-long";
|
|
241
|
-
readonly rightArrowLong: "right-arrow-long";
|
|
242
242
|
};
|
|
243
243
|
export type IconType = typeof iconList[keyof typeof iconList];
|
|
244
244
|
export declare const icons: {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export type AvatarSize = "sm" | "md" | "lg" | "xl";
|
|
3
|
+
export type AvatarProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Label for the Avatar
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* If true, the label will be abbreviated to its initials
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
abbreviate?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* If defined, an image is displayed instead of the label.
|
|
15
|
+
*/
|
|
16
|
+
img?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Size of the Avatar
|
|
19
|
+
* @default md
|
|
20
|
+
*/
|
|
21
|
+
size?: AvatarSize;
|
|
22
|
+
/**
|
|
23
|
+
* Overwrite the styles for the Avatar by passing space separated class names
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const Avatar: ({ label, abbreviate, img, size, className }: AvatarProps) => ReactElement | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { AvatarProps as AvatarCompProps } from "../avatar";
|
|
3
|
+
type AvatarProps = Omit<AvatarCompProps, "size">;
|
|
4
|
+
export interface AvatarGroupProps {
|
|
5
|
+
/**
|
|
6
|
+
* Accept children
|
|
7
|
+
*/
|
|
8
|
+
children: ReactElement<AvatarProps> | Array<ReactElement<AvatarProps>>;
|
|
9
|
+
/**
|
|
10
|
+
* Callback to be called when the AvatarGroup is clicked
|
|
11
|
+
*/
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Maximum items to display in the group before the custom avatar is shown
|
|
15
|
+
* @default 4
|
|
16
|
+
*/
|
|
17
|
+
maxItems?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Size of the Avatars
|
|
20
|
+
* @default md
|
|
21
|
+
*/
|
|
22
|
+
size?: AvatarCompProps["size"];
|
|
23
|
+
/**
|
|
24
|
+
* Overwrite the styles for the AvatarGroup by passing space separated class names
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const AvatarGroup: {
|
|
29
|
+
({ size, maxItems, className, children, onClick }: AvatarGroupProps): ReactElement | null;
|
|
30
|
+
Item: ({ label, abbreviate, img, size, className }: AvatarCompProps) => ReactElement | null;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IconType } from "../adpIcon";
|
|
1
|
+
import { HTMLAttributes, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { type IconType } from "../adpIcon";
|
|
3
3
|
type IBadgeSize = "sm" | "md" | "lg";
|
|
4
|
-
export interface IBadgeProps extends
|
|
4
|
+
export interface IBadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
6
6
|
* Size of the badge
|
|
7
7
|
* @default md
|
|
@@ -18,25 +18,29 @@ export interface IBadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
18
18
|
*/
|
|
19
19
|
color?: "primary" | "secondary" | "success" | "warning" | "error";
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
icon?: IconType;
|
|
24
|
-
/**
|
|
25
|
-
* Placement of the icon
|
|
21
|
+
* Accepts children of ReactNode type
|
|
26
22
|
*/
|
|
27
|
-
|
|
23
|
+
label?: ReactNode;
|
|
28
24
|
/**
|
|
29
|
-
*
|
|
25
|
+
* Pass space separated class names to override the Badge styling
|
|
30
26
|
*/
|
|
31
|
-
|
|
27
|
+
className?: string;
|
|
32
28
|
/**
|
|
33
|
-
*
|
|
29
|
+
* Icon to be displayed before the Badge's content.
|
|
30
|
+
* @description
|
|
31
|
+
* This prop accepts either an IconType (string) or a ReactNode.
|
|
32
|
+
* - If an IconType is provided, it will render an ADPIcon component.
|
|
33
|
+
* - If a ReactNode is provided, it will be rendered as-is.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
prefixIcon?: IconType | ReactNode;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Icon to be displayed after the Badge's content.
|
|
38
|
+
* @description
|
|
39
|
+
* This prop accepts either an IconType (string) or a ReactNode.
|
|
40
|
+
* - If an IconType is provided, it will render an ADPIcon component.
|
|
41
|
+
* - If a ReactNode is provided, it will be rendered as-is.
|
|
38
42
|
*/
|
|
39
|
-
|
|
43
|
+
suffixIcon?: IconType | ReactNode;
|
|
40
44
|
}
|
|
41
|
-
export declare const Badge: ({ size, variant, color, label,
|
|
45
|
+
export declare const Badge: ({ size, variant, color, label, className, prefixIcon, suffixIcon, ...restProps }: IBadgeProps) => ReactElement | null;
|
|
42
46
|
export {};
|
|
@@ -1,37 +1,33 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { IconType } from "../adpIcon";
|
|
3
|
-
export declare
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { type IconType } from "../adpIcon";
|
|
3
|
+
export declare const colors: readonly ["primary", "secondary", "success", "warning", "error"];
|
|
4
|
+
export declare const variants: readonly ["filled", "outline", "shade", "text"];
|
|
5
|
+
export declare enum Sizes {
|
|
4
6
|
XS = "xs",
|
|
5
7
|
SM = "sm",
|
|
6
8
|
MD = "md",
|
|
7
9
|
LG = "lg",
|
|
8
10
|
XL = "xl"
|
|
9
11
|
}
|
|
10
|
-
|
|
12
|
+
type Color = (typeof colors)[number];
|
|
13
|
+
type Variant = (typeof variants)[number];
|
|
14
|
+
type Size = `${Sizes}`;
|
|
11
15
|
export interface Props extends Omit<React.ComponentPropsWithoutRef<"button">, "css"> {
|
|
12
16
|
/**
|
|
13
17
|
* Size of the button.
|
|
14
18
|
* @default md
|
|
15
19
|
*/
|
|
16
|
-
size?:
|
|
20
|
+
size?: Size;
|
|
17
21
|
/**
|
|
18
22
|
* Color of the button.
|
|
19
23
|
* @default primary
|
|
20
24
|
*/
|
|
21
|
-
color?:
|
|
25
|
+
color?: Color;
|
|
22
26
|
/**
|
|
23
27
|
* Variant of the button.
|
|
24
28
|
* @default filled
|
|
25
29
|
*/
|
|
26
|
-
variant?:
|
|
27
|
-
/**
|
|
28
|
-
* Optional icon.
|
|
29
|
-
*/
|
|
30
|
-
icon?: IconType;
|
|
31
|
-
/**
|
|
32
|
-
* Placement of the icon
|
|
33
|
-
*/
|
|
34
|
-
iconPlacement?: "start" | "end";
|
|
30
|
+
variant?: Variant;
|
|
35
31
|
children?: React.ReactNode;
|
|
36
32
|
/**
|
|
37
33
|
* Shows loading animation instead of the button content
|
|
@@ -41,6 +37,36 @@ export interface Props extends Omit<React.ComponentPropsWithoutRef<"button">, "c
|
|
|
41
37
|
* Type of the button
|
|
42
38
|
*/
|
|
43
39
|
type?: "button" | "submit" | "reset";
|
|
40
|
+
/**
|
|
41
|
+
* Prop to disable the Button
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Pass space separated class names to override the Button styling
|
|
47
|
+
*/
|
|
48
|
+
className?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Icon to be displayed before the button's content.
|
|
51
|
+
* @description
|
|
52
|
+
* This prop accepts either an IconType (string) or a ReactNode.
|
|
53
|
+
* - If an IconType is provided, it will render an ADPIcon component.
|
|
54
|
+
* - If a ReactNode is provided, it will be rendered as-is.
|
|
55
|
+
*/
|
|
56
|
+
prefixIcon?: IconType | ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Icon to be displayed after the button's content.
|
|
59
|
+
* @description
|
|
60
|
+
* This prop accepts either an IconType (string) or a ReactNode.
|
|
61
|
+
* - If an IconType is provided, it will render an ADPIcon component.
|
|
62
|
+
* - If a ReactNode is provided, it will be rendered as-is.
|
|
63
|
+
*/
|
|
64
|
+
suffixIcon?: IconType | ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* Callback function to be called when the button is clicked
|
|
67
|
+
*/
|
|
68
|
+
onClick?: (event?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
44
69
|
}
|
|
45
|
-
export declare const ButtonSizeToSpinnerMap: Record<
|
|
70
|
+
export declare const ButtonSizeToSpinnerMap: Record<Size, "xxs" | "xs" | "sm" | "md" | "lg" | "xl">;
|
|
46
71
|
export declare const Button: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type ReactElement } from "react";
|
|
2
|
+
export interface CardBodyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Override the styles for the Card.Body by passing space separated class names
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Accepts children of ReactNode type
|
|
9
|
+
*/
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const CardBody: ({ className, children }: CardBodyProps) => ReactElement | null;
|
|
13
|
+
export default CardBody;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type ReactElement } from "react";
|
|
2
|
+
export interface CardFooterProps {
|
|
3
|
+
/**
|
|
4
|
+
* Override the styles for the Card.Footer by passing space separated class names
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Accepts children of ReactNode type
|
|
9
|
+
*/
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const CardFooter: ({ className, children }: CardFooterProps) => ReactElement | null;
|
|
13
|
+
export default CardFooter;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { CTAGroupProps } from "../ctaGroup";
|
|
3
|
+
export interface CardHeaderProps {
|
|
4
|
+
/**
|
|
5
|
+
* Override the styles for the Card.Header by passing space separated class names
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Title of the card
|
|
10
|
+
*/
|
|
11
|
+
title?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Custom content that can be shown between the Card title and the CTAGroup
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Props for the CTAGroup component. Pass an object with the props for the CTAGroup.
|
|
18
|
+
*/
|
|
19
|
+
ctaGroupProps?: CTAGroupProps;
|
|
20
|
+
}
|
|
21
|
+
export declare const CardHeader: ({ className, title, children, ctaGroupProps }: CardHeaderProps) => ReactElement | null;
|
|
22
|
+
export default CardHeader;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { CardHeader, type CardHeaderProps } from "./cardHeader";
|
|
3
|
+
import { CardBody, type CardBodyProps } from "./cardBody";
|
|
4
|
+
import { CardFooter, type CardFooterProps } from "./cardFooter";
|
|
2
5
|
export interface Props {
|
|
3
6
|
/**
|
|
4
7
|
* Pass space separated class names to override the Card styling
|
|
5
8
|
*/
|
|
6
9
|
className?: string;
|
|
7
10
|
/**
|
|
8
|
-
* Accepts
|
|
11
|
+
* Accepts Card.Body or [Card.Header, Card.Body]
|
|
12
|
+
* or [Card.Header, Card.Body, Card.Footer]
|
|
13
|
+
* or [Card.Body, Card.Footer]
|
|
9
14
|
*/
|
|
10
|
-
children:
|
|
15
|
+
children: ReactElement<CardBodyProps, typeof CardBody> | [ReactElement<CardHeaderProps, typeof CardHeader>, ReactElement<CardBodyProps, typeof CardBody>] | [ReactElement<CardHeaderProps, typeof CardHeader>, ReactElement<CardBodyProps, typeof CardBody>, ReactElement<CardFooterProps, typeof CardFooter>] | [ReactElement<CardBodyProps, typeof CardBody>, ReactElement<CardFooterProps>];
|
|
11
16
|
}
|
|
12
|
-
export declare const Card:
|
|
17
|
+
export declare const Card: {
|
|
18
|
+
({ className, children }: Props): ReactElement | null;
|
|
19
|
+
Header: ({ className, title, children, ctaGroupProps }: CardHeaderProps) => ReactElement | null;
|
|
20
|
+
Body: ({ className, children }: CardBodyProps) => ReactElement | null;
|
|
21
|
+
Footer: ({ className, children }: CardFooterProps) => ReactElement | null;
|
|
22
|
+
};
|
|
13
23
|
export default Card;
|
|
@@ -8,9 +8,9 @@ export interface CheckboxProps extends Omit<React.HTMLProps<HTMLInputElement>, "
|
|
|
8
8
|
size?: "sm" | "md" | "lg";
|
|
9
9
|
/**
|
|
10
10
|
* Variant of the Checkbox
|
|
11
|
-
* @default
|
|
11
|
+
* @default filled
|
|
12
12
|
*/
|
|
13
|
-
variant?: "
|
|
13
|
+
variant?: "filled" | "outline" | "filled-circle" | "outline-circle";
|
|
14
14
|
/**
|
|
15
15
|
* Pass a ref to the inner input element
|
|
16
16
|
*/
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React, { ReactElement
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import { CheckboxProps } from "../checkbox";
|
|
2
3
|
export declare enum CheckboxGroupSizes {
|
|
3
4
|
SM = "sm",
|
|
4
5
|
MD = "md",
|
|
5
6
|
LG = "lg"
|
|
6
7
|
}
|
|
7
8
|
export type CheckboxGroupSize = `${CheckboxGroupSizes}`;
|
|
8
|
-
export interface CheckboxOptionProps extends Omit<React.HTMLProps<HTMLInputElement>, "label" | "size"> {
|
|
9
|
-
label: ReactNode;
|
|
10
|
-
}
|
|
11
9
|
export interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "onChange"> {
|
|
12
10
|
/**
|
|
13
11
|
* Size of the Checkbox group.
|
|
@@ -30,11 +28,16 @@ export interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
30
28
|
/**
|
|
31
29
|
* An array of checkbox prop type.
|
|
32
30
|
*/
|
|
33
|
-
options?:
|
|
31
|
+
options?: CheckboxProps[];
|
|
34
32
|
/**
|
|
35
33
|
* Callback function that is called when the checkbox group selection changes.
|
|
36
34
|
* An array of selected values is passed as an argument to the function.
|
|
37
35
|
*/
|
|
38
36
|
onChange?: (arg: unknown[]) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Placement of the checkbox
|
|
39
|
+
* @default "end"
|
|
40
|
+
*/
|
|
41
|
+
checkboxPlacement?: "start" | "end";
|
|
39
42
|
}
|
|
40
|
-
export declare const CheckboxGroup: ({ size, options, onChange, className, selectedValues, disabled }: Props) => ReactElement;
|
|
43
|
+
export declare const CheckboxGroup: ({ size, options, onChange, className, selectedValues, disabled, checkboxPlacement }: Props) => ReactElement;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface CTAGroupProps {
|
|
3
|
+
/**
|
|
4
|
+
* List of CTAs which render as icons or as dropdown items in case of mobile view
|
|
5
|
+
*/
|
|
6
|
+
ctaList: {
|
|
7
|
+
/**
|
|
8
|
+
* Callback to execute when the CTA is clicked
|
|
9
|
+
*/
|
|
10
|
+
callback: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Icon to render inside the CTA
|
|
13
|
+
*/
|
|
14
|
+
icon: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Label for the CTA. The label is also displayed as a tooltip when shrink is set to false.
|
|
17
|
+
*/
|
|
18
|
+
label: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Determines whether the CTA should be disabled or not
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
/**
|
|
25
|
+
* Determines whether to show the CTAGroup as a dropdown
|
|
26
|
+
*/
|
|
27
|
+
shrink?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Overwrite the CTAGroup styles by passing space separated class names
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Pass a reference to the element where the dropdown needs to be rendered
|
|
34
|
+
*/
|
|
35
|
+
dropdownPortalTarget?: Element;
|
|
36
|
+
/**
|
|
37
|
+
* If the number of CTAs is greater than the threshold, then the extra CTAs are rendered in a dropdown
|
|
38
|
+
*/
|
|
39
|
+
threshold?: number;
|
|
40
|
+
/**
|
|
41
|
+
* If true, the label will always be shown next to the icon
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
showLabels?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const CTAGroup: ({ ctaList, shrink, className, dropdownPortalTarget, threshold, showLabels }: CTAGroupProps) => JSX.Element;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { IconType } from "../adpIcon";
|
|
3
2
|
export type DropDownItemProps = {
|
|
4
3
|
children?: React.ReactNode;
|
|
5
|
-
icon?: IconType;
|
|
6
4
|
dropdownShow?: boolean;
|
|
7
5
|
index?: number;
|
|
8
6
|
disabled?: boolean;
|
|
@@ -10,4 +8,4 @@ export type DropDownItemProps = {
|
|
|
10
8
|
onClickHandler?: (e?: React.SyntheticEvent) => void;
|
|
11
9
|
className?: string;
|
|
12
10
|
};
|
|
13
|
-
export declare const DropdownItem: ({ children,
|
|
11
|
+
export declare const DropdownItem: ({ children, dropdownShow, index, className, disabled, setShowDropdown, onClickHandler }: DropDownItemProps) => JSX.Element | null;
|
|
@@ -31,5 +31,5 @@ export type Props = {
|
|
|
31
31
|
};
|
|
32
32
|
export declare const Dropdown: {
|
|
33
33
|
({ size, children, header, ctaContent, portalTarget, disabled, ctaClassName }: Props): ReactElement | null;
|
|
34
|
-
Item: ({ children,
|
|
34
|
+
Item: ({ children, dropdownShow, index, className, disabled, setShowDropdown, onClickHandler }: DropDownItemProps) => JSX.Element | null;
|
|
35
35
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
2
|
import { EmptyStateContentProps } from "./emptyStateContent";
|
|
3
3
|
import { EmptyStateCTAProps } from "./emptyStateCta";
|
|
4
|
-
|
|
4
|
+
export declare const imageVariants: readonly ["notifications", "no-access", "forgot-password", "otp", "login", "analytics", "file-upload", "searching", "dashboard", "workspaces", "favorite", "empty-data", "data-upload", "no-connection"];
|
|
5
|
+
type ImageVariantType = typeof imageVariants[number];
|
|
5
6
|
export interface EmptyStateProps {
|
|
6
7
|
/**
|
|
7
8
|
* Set a supported Empty State Image variant
|
|
@@ -36,5 +36,5 @@ export interface Props {
|
|
|
36
36
|
export declare function Modal({ className, rtl, children, showModal, escKeyClose, closeButton, onHide }: Props): ReactElement | null;
|
|
37
37
|
export declare namespace Modal {
|
|
38
38
|
var Header: ({ children, className }: ModalHeaderProps) => ReactElement | null;
|
|
39
|
-
var Body: ({ className,
|
|
39
|
+
var Body: ({ className, children }: ModalBodyProps) => ReactElement | null;
|
|
40
40
|
}
|
|
@@ -8,10 +8,6 @@ export interface ModalBodyProps {
|
|
|
8
8
|
* Dynamically updates the classes applied to the component
|
|
9
9
|
*/
|
|
10
10
|
className?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Modal Body Scrolable
|
|
13
|
-
*/
|
|
14
|
-
scrollable?: boolean;
|
|
15
11
|
}
|
|
16
|
-
export declare const ModalBody: ({ className,
|
|
12
|
+
export declare const ModalBody: ({ className, children }: ModalBodyProps) => ReactElement | null;
|
|
17
13
|
export default ModalBody;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { PanelBodyProps } from "./panelBody";
|
|
3
|
+
import { PanelFooterProps } from "./panelFooter";
|
|
4
|
+
import { PanelHeaderProps } from "./panelHeader";
|
|
5
|
+
export interface Props {
|
|
6
|
+
/**
|
|
7
|
+
* Variant of the Panel
|
|
8
|
+
* @default compact
|
|
9
|
+
*/
|
|
10
|
+
variant?: "extended" | "compact";
|
|
11
|
+
/**
|
|
12
|
+
* Control Panel's visibility
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
showPanel?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Overwrite the Panel styles by passing space separated class names
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Panel content
|
|
22
|
+
*/
|
|
23
|
+
children?: (ReactElement<PanelBodyProps> | [ReactElement<PanelHeaderProps>, ReactElement<PanelBodyProps>] | [ReactElement<PanelBodyProps>, ReactElement<PanelFooterProps>] | [ReactElement<PanelHeaderProps>, ReactElement<PanelBodyProps>, ReactElement<PanelFooterProps>]);
|
|
24
|
+
}
|
|
25
|
+
export declare function Panel({ variant, showPanel, children, className }: Props): ReactElement | null;
|
|
26
|
+
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;
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export interface PanelBodyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Panel Body
|
|
5
|
+
*/
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Overwrite the Panel body styles by passing space separated class names
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const PanelBody: ({ className, children }: PanelBodyProps) => ReactElement | null;
|
|
13
|
+
export default PanelBody;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export interface PanelFooterProps {
|
|
3
|
+
/**
|
|
4
|
+
* Panel Footer
|
|
5
|
+
*/
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Overwrite the Panel footer styles by passing space separated class names
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const PanelFooter: ({ className, children }: PanelFooterProps) => ReactElement | null;
|
|
13
|
+
export default PanelFooter;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
export interface PanelHeaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Overwrite the Panel Header styles by passing space separated class names
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Control panel's back button visibility
|
|
9
|
+
* @default false
|
|
10
|
+
*/
|
|
11
|
+
showBackButton?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Callback function for back button
|
|
14
|
+
*/
|
|
15
|
+
onBackHandler?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Control panel's close button visibility
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
showCloseButton?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Callback function for close button
|
|
23
|
+
*/
|
|
24
|
+
onCloseHandler?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Header of Panel
|
|
27
|
+
*/
|
|
28
|
+
header?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Sub header of Panel
|
|
31
|
+
*/
|
|
32
|
+
subHeader?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Pass custom CTA that will appear close to header
|
|
35
|
+
*/
|
|
36
|
+
customCTA?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare const PanelHeader: ({ className, showBackButton, onBackHandler, showCloseButton, onCloseHandler, customCTA, header, subHeader }: PanelHeaderProps) => ReactElement | null;
|
|
39
|
+
export default PanelHeader;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface PanelFooterProps {
|
|
3
|
+
onClick?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const CustomCTA: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const PanelFooter: ({ onClick }: PanelFooterProps) => React.ReactElement;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { Panel } from "../panel";
|
|
3
|
+
export interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* Overwrite the styles for PanelGroup by passing space separated class names
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* PanelGroup children. The component accepts one or more Panels as its children.
|
|
10
|
+
*/
|
|
11
|
+
children?: ReactElement<typeof Panel> | ReactElement<typeof Panel>[];
|
|
12
|
+
/**
|
|
13
|
+
* Use the prop to set the active panel index. The value for the active index needs to start from 0.
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
16
|
+
activeIndex?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Control PanelGroup's visibility
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
showPanels?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function PanelGroup({ children, className, activeIndex, showPanels }: Props): ReactElement | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type Props as TextFieldProps } from "../textField";
|
|
3
|
+
export type PasswordFieldProps = Omit<TextFieldProps, "type">;
|
|
4
|
+
export declare const PasswordField: React.ForwardRefExoticComponent<Omit<PasswordFieldProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|