@cloudwick/astral-ui 1.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/CONTRIBUTING.md +57 -0
- package/README.md +24 -0
- package/dist/components/accordion/accordionBody.d.ts +9 -0
- package/dist/components/accordion/accordionHeader.d.ts +9 -0
- package/dist/components/accordion/index.d.ts +37 -0
- package/dist/components/adpIcon/index.d.ts +61 -0
- package/dist/components/adpIcon/svgObjects.d.ts +246 -0
- package/dist/components/badge/index.d.ts +42 -0
- package/dist/components/breadcrumbs/breadcrumbItem.d.ts +28 -0
- package/dist/components/breadcrumbs/index.d.ts +27 -0
- package/dist/components/button/index.d.ts +46 -0
- package/dist/components/card/index.d.ts +13 -0
- package/dist/components/checkbox/index.d.ts +19 -0
- package/dist/components/checkboxGroup/index.d.ts +40 -0
- package/dist/components/datePicker/index.d.ts +10 -0
- package/dist/components/dropdown/dropdownItem.d.ts +13 -0
- package/dist/components/dropdown/dropdownToggle.d.ts +9 -0
- package/dist/components/dropdown/index.d.ts +35 -0
- package/dist/components/emptyState/emptyStateContent.d.ts +11 -0
- package/dist/components/emptyState/emptyStateCta.d.ts +11 -0
- package/dist/components/emptyState/index.d.ts +27 -0
- package/dist/components/loader/index.d.ts +28 -0
- package/dist/components/modal/index.d.ts +40 -0
- package/dist/components/modal/modalBody.d.ts +17 -0
- package/dist/components/modal/modalHeader.d.ts +13 -0
- package/dist/components/otp/index.d.ts +41 -0
- package/dist/components/otp/input.d.ts +12 -0
- package/dist/components/pagination/index.d.ts +32 -0
- package/dist/components/progress/index.d.ts +61 -0
- package/dist/components/radio/index.d.ts +15 -0
- package/dist/components/select/index.d.ts +72 -0
- package/dist/components/tabs/index.d.ts +69 -0
- package/dist/components/tabs/tab.d.ts +46 -0
- package/dist/components/textField/index.d.ts +43 -0
- package/dist/components/textarea/index.d.ts +24 -0
- package/dist/components/toast/index.d.ts +41 -0
- package/dist/components/toggle/index.d.ts +39 -0
- package/dist/components/tooltip/index.d.ts +59 -0
- package/dist/css/fonts.min.css +1 -0
- package/dist/css/index.min.css +2 -0
- package/dist/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/dist/fonts/Inter/Inter_18pt-BoldItalic.ttf +0 -0
- package/dist/fonts/Inter/Inter_18pt-Italic.ttf +0 -0
- package/dist/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/dist/fonts/Inter/Inter_18pt-MediumItalic.ttf +0 -0
- package/dist/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/dist/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/dist/fonts/Inter/Inter_18pt-SemiBoldItalic.ttf +0 -0
- package/dist/index.cjs.js +5 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.esm.js +5 -0
- package/package.json +131 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconType } from "../adpIcon";
|
|
3
|
+
export type DropDownItemProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
icon?: IconType;
|
|
6
|
+
dropdownShow?: boolean;
|
|
7
|
+
index?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
setShowDropdown?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
+
onClickHandler?: (e?: React.SyntheticEvent) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const DropdownItem: ({ children, icon, dropdownShow, index, className, disabled, setShowDropdown, onClickHandler }: DropDownItemProps) => JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type DropDownTogglerProps = {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
onClick?: (e: React.SyntheticEvent) => void;
|
|
5
|
+
ref?: React.MutableRefObject<HTMLButtonElement | null>;
|
|
6
|
+
ctaClassName?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const Toggler: React.ForwardRefExoticComponent<Omit<DropDownTogglerProps, "ref"> & React.RefAttributes<HTMLButtonElement | null>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNode } from "react";
|
|
2
|
+
import { DropDownItemProps } from "./dropdownItem";
|
|
3
|
+
export declare enum DropdownSizes {
|
|
4
|
+
MD = "md",
|
|
5
|
+
LG = "lg"
|
|
6
|
+
}
|
|
7
|
+
export type DropdownSize = `${DropdownSizes}`;
|
|
8
|
+
export type Props = {
|
|
9
|
+
/**
|
|
10
|
+
* Size of the dropdown.
|
|
11
|
+
* @default md
|
|
12
|
+
*/
|
|
13
|
+
size?: DropdownSize;
|
|
14
|
+
/**
|
|
15
|
+
* Use to show the title or header
|
|
16
|
+
*/
|
|
17
|
+
header?: ReactNode | string;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/** JSX to be rendered inside of dropdown button */
|
|
20
|
+
ctaContent?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Pass a reference to the element where the dropdown needs to be rendered
|
|
23
|
+
*/
|
|
24
|
+
portalTarget?: Element;
|
|
25
|
+
/** Pass space separated class names to style the CTA */
|
|
26
|
+
ctaClassName?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Determines whether the CTA should be disabled or not
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
};
|
|
32
|
+
export declare const Dropdown: {
|
|
33
|
+
({ size, children, header, ctaContent, portalTarget, disabled, ctaClassName }: Props): ReactElement | null;
|
|
34
|
+
Item: ({ children, icon, dropdownShow, index, className, disabled, setShowDropdown, onClickHandler }: DropDownItemProps) => JSX.Element | null;
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export interface EmptyStateContentProps {
|
|
3
|
+
/**
|
|
4
|
+
* Provide custom classes for the component
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const EmptyStateContent: ({ className, title, children }: EmptyStateContentProps) => ReactElement | null;
|
|
11
|
+
export default EmptyStateContent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { Props as ButtonProps } from "../button";
|
|
3
|
+
export interface EmptyStateCTAProps {
|
|
4
|
+
/**
|
|
5
|
+
* Provide custom classes for the component
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ReactElement<ButtonProps> | Array<ReactElement<ButtonProps>>;
|
|
9
|
+
}
|
|
10
|
+
export declare const EmptyStateCTA: ({ className, children }: EmptyStateCTAProps) => ReactElement | null;
|
|
11
|
+
export default EmptyStateCTA;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { EmptyStateContentProps } from "./emptyStateContent";
|
|
3
|
+
import { EmptyStateCTAProps } from "./emptyStateCta";
|
|
4
|
+
type ImageVariantType = "notifications" | "no-access" | "forgot-password" | "otp" | "login" | "analytics" | "file-upload" | "searching" | "dashboard" | "workspaces" | "favorite" | "empty-data" | "data-upload" | "no-connection";
|
|
5
|
+
export interface EmptyStateProps {
|
|
6
|
+
/**
|
|
7
|
+
* Set a supported Empty State Image variant
|
|
8
|
+
*/
|
|
9
|
+
imageVariant: ImageVariantType;
|
|
10
|
+
/**
|
|
11
|
+
* The alt text for the EmptyState component image.
|
|
12
|
+
* The alt text will on be applied if there is no EmptyStateContent.
|
|
13
|
+
* @default ""
|
|
14
|
+
*/
|
|
15
|
+
imageAltText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Override the default classes by providing a custom class
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: ReactElement<EmptyStateContentProps> | ReactElement<EmptyStateCTAProps> | [ReactElement<EmptyStateContentProps>, ReactElement<EmptyStateCTAProps>];
|
|
21
|
+
}
|
|
22
|
+
export declare const EmptyState: {
|
|
23
|
+
({ className, imageVariant, imageAltText, children }: EmptyStateProps): ReactElement | null;
|
|
24
|
+
Content: ({ className, title, children }: EmptyStateContentProps) => ReactElement | null;
|
|
25
|
+
CTA: ({ className, children }: EmptyStateCTAProps) => ReactElement | null;
|
|
26
|
+
};
|
|
27
|
+
export default EmptyState;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
export declare enum LoaderSizes {
|
|
3
|
+
SM = "sm",
|
|
4
|
+
MD = "md",
|
|
5
|
+
LG = "lg"
|
|
6
|
+
}
|
|
7
|
+
export type LoaderSize = `${LoaderSizes}`;
|
|
8
|
+
export interface Props {
|
|
9
|
+
/**
|
|
10
|
+
* Variant of the Loader.
|
|
11
|
+
* @default filled
|
|
12
|
+
*/
|
|
13
|
+
variant?: "filled" | "stroked";
|
|
14
|
+
/**
|
|
15
|
+
* Size of the Loader.
|
|
16
|
+
* @default md
|
|
17
|
+
*/
|
|
18
|
+
size?: LoaderSize;
|
|
19
|
+
/**
|
|
20
|
+
* Regular static label.
|
|
21
|
+
*/
|
|
22
|
+
label?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Overwrite the styles for the SVG by passing space separated class names.
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const Loader: ({ variant, label, size, className }: Props) => ReactElement;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { ModalHeaderProps } from "./modalHeader";
|
|
3
|
+
import { ModalBodyProps } from "./modalBody";
|
|
4
|
+
export interface Props {
|
|
5
|
+
/**
|
|
6
|
+
* Control modal’s visibility
|
|
7
|
+
*/
|
|
8
|
+
showModal: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Modal content
|
|
11
|
+
*/
|
|
12
|
+
children: ReactElement<ModalBodyProps> | [ReactElement<ModalHeaderProps>, ReactElement<ModalBodyProps>];
|
|
13
|
+
/**
|
|
14
|
+
* Callback function for onHide
|
|
15
|
+
*/
|
|
16
|
+
onHide?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Overwrite the Modal styles by passing space separated class names
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Sets the modal content to right-to-left
|
|
23
|
+
*/
|
|
24
|
+
rtl?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Hide the modal on esc key press
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
escKeyClose?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Show/hide the close button within the modal
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
closeButton?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare function Modal({ className, rtl, children, showModal, escKeyClose, closeButton, onHide }: Props): ReactElement | null;
|
|
37
|
+
export declare namespace Modal {
|
|
38
|
+
var Header: ({ children, className }: ModalHeaderProps) => ReactElement | null;
|
|
39
|
+
var Body: ({ className, scrollable, children }: ModalBodyProps) => ReactElement | null;
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export interface ModalBodyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Modal Body
|
|
5
|
+
*/
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Dynamically updates the classes applied to the component
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Modal Body Scrolable
|
|
13
|
+
*/
|
|
14
|
+
scrollable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const ModalBody: ({ className, scrollable, children }: ModalBodyProps) => ReactElement | null;
|
|
17
|
+
export default ModalBody;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export interface ModalHeaderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Header of the Modal
|
|
5
|
+
*/
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Dynamically updates the classes applied to the component
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const ModalHeader: ({ children, className }: ModalHeaderProps) => ReactElement | null;
|
|
13
|
+
export default ModalHeader;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* Value of the OTP input.
|
|
5
|
+
*/
|
|
6
|
+
initialValue?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Pass a regex to restrict what can be entered in the OTP input.
|
|
9
|
+
*/
|
|
10
|
+
regexValidation?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Callback triggered when the OTP input value changes.
|
|
13
|
+
*/
|
|
14
|
+
onChange?: (val: string) => void;
|
|
15
|
+
onBlur?: React.FocusEventHandler<HTMLDivElement>;
|
|
16
|
+
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
17
|
+
/**
|
|
18
|
+
* Regular static label.
|
|
19
|
+
*/
|
|
20
|
+
label?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Pass OTP length.
|
|
23
|
+
* @default 6
|
|
24
|
+
*/
|
|
25
|
+
otpLength?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Overwrite the style by passing space separated class names.
|
|
28
|
+
*/
|
|
29
|
+
className?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Additional information or guidance displayed below the OTP input.
|
|
32
|
+
*/
|
|
33
|
+
helperText?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Pass a boolean value to indicate if the OTP input is in an error state.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
error?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare const OtpInput: ({ initialValue, regexValidation, onChange, onBlur, onFocus, label, helperText, error, otpLength, className, disabled }: Props) => JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { KeyboardEventHandler, ChangeEventHandler } from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
value: string;
|
|
4
|
+
handleChange: ChangeEventHandler<HTMLInputElement>;
|
|
5
|
+
handleKeyDown: KeyboardEventHandler<HTMLInputElement>;
|
|
6
|
+
focused: boolean;
|
|
7
|
+
index: number;
|
|
8
|
+
id: string;
|
|
9
|
+
error: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const Input: ({ value, focused, handleChange, handleKeyDown, index, id, error }: Props) => JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* The total number of pages.
|
|
5
|
+
*/
|
|
6
|
+
totalPages?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Use the prop to set the active page number. The value for activePageNo needs to start from 1.
|
|
9
|
+
*/
|
|
10
|
+
activePageNo?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Layout of the pagination.
|
|
13
|
+
* @default detailed
|
|
14
|
+
*/
|
|
15
|
+
layout?: "detailed" | "basic" | "minimal";
|
|
16
|
+
/**
|
|
17
|
+
* Pagination variant.
|
|
18
|
+
* @default filled
|
|
19
|
+
*/
|
|
20
|
+
variant?: "filled" | "outline" | "text";
|
|
21
|
+
/**
|
|
22
|
+
* Use the prop to hide the labels “Next“ & “Previous“
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
showLabels?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Callback function triggered when the active page changes.
|
|
28
|
+
* @param activePageNo - The new page number that was selected
|
|
29
|
+
*/
|
|
30
|
+
onPageChange?: (activePageNo: number) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const Pagination: ({ totalPages, activePageNo, layout, variant, showLabels, onPageChange }: Props) => React.ReactElement;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
export declare enum Colors {
|
|
3
|
+
PRIMARY = "primary",
|
|
4
|
+
SECONDARY = "secondary",
|
|
5
|
+
SUCCESS = "success",
|
|
6
|
+
WARNING = "warning",
|
|
7
|
+
ERROR = "error"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ValuePositions {
|
|
10
|
+
TOP = "top",
|
|
11
|
+
RIGHT = "right",
|
|
12
|
+
BOTTOM = "bottom",
|
|
13
|
+
INLINE = "inline"
|
|
14
|
+
}
|
|
15
|
+
export type ColorType = `${Colors}`;
|
|
16
|
+
export type valuePositionType = `${ValuePositions}`;
|
|
17
|
+
export interface Props {
|
|
18
|
+
/**
|
|
19
|
+
* Controls the colors of Progress
|
|
20
|
+
* Only For linear progress
|
|
21
|
+
* @default primary
|
|
22
|
+
*/
|
|
23
|
+
color?: ColorType;
|
|
24
|
+
/**
|
|
25
|
+
* Variant of the Progress
|
|
26
|
+
* @default linear
|
|
27
|
+
*/
|
|
28
|
+
variant?: "linear" | "circular";
|
|
29
|
+
/**
|
|
30
|
+
* Use the prop to change the size of the Circular Progress
|
|
31
|
+
* @default "md"
|
|
32
|
+
*/
|
|
33
|
+
size?: "md" | "lg";
|
|
34
|
+
/**
|
|
35
|
+
* Value is used to display the percentage of the progress
|
|
36
|
+
* @default 0
|
|
37
|
+
* @range 0 to 100
|
|
38
|
+
*/
|
|
39
|
+
value: number;
|
|
40
|
+
/**
|
|
41
|
+
* Prop controlling the position of the value of the Progress
|
|
42
|
+
* @default inline
|
|
43
|
+
*/
|
|
44
|
+
valuePosition?: valuePositionType;
|
|
45
|
+
/**
|
|
46
|
+
* Set to true to display the percentage of progress.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
showPercentage?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Prop to set striped background
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
striped?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Prop to set animated background, use in conjunction with striped property
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
animate?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare const Progress: ({ color, variant, size, value, valuePosition, showPercentage, striped, animate }: Props) => ReactElement | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type RadioSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface RadioProps extends Omit<React.HTMLProps<HTMLInputElement>, "label" | "size"> {
|
|
4
|
+
/**
|
|
5
|
+
* Size of the Radio button
|
|
6
|
+
* @default sm
|
|
7
|
+
*/
|
|
8
|
+
size?: RadioSize;
|
|
9
|
+
/**
|
|
10
|
+
* Label for the Radio button
|
|
11
|
+
*/
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Props as SelectProps } from "react-select";
|
|
3
|
+
export declare enum SelectSizes {
|
|
4
|
+
MD = "md",
|
|
5
|
+
LG = "lg"
|
|
6
|
+
}
|
|
7
|
+
export type SelectSize = `${SelectSizes}`;
|
|
8
|
+
export type Option = {
|
|
9
|
+
label: ReactNode;
|
|
10
|
+
value: any;
|
|
11
|
+
isFixed?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export interface Props extends Omit<SelectProps, "options" | "value" | "isDisabled"> {
|
|
14
|
+
/**
|
|
15
|
+
* Accepts id for the select
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Overwrite the style by passing space separated class names
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the Label for the select field
|
|
24
|
+
*/
|
|
25
|
+
label?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Size of the Selct field.
|
|
28
|
+
* @default md
|
|
29
|
+
*/
|
|
30
|
+
size?: SelectSize;
|
|
31
|
+
/**
|
|
32
|
+
* Selction option for the select field
|
|
33
|
+
*/
|
|
34
|
+
options?: readonly (Option | {
|
|
35
|
+
label: ReactNode;
|
|
36
|
+
options: Option[];
|
|
37
|
+
})[];
|
|
38
|
+
/**
|
|
39
|
+
* Set the selected values of the field
|
|
40
|
+
*/
|
|
41
|
+
value?: {
|
|
42
|
+
label: ReactNode | string;
|
|
43
|
+
value: string;
|
|
44
|
+
isFixed?: boolean;
|
|
45
|
+
} | readonly {
|
|
46
|
+
label: ReactNode | string;
|
|
47
|
+
value: string;
|
|
48
|
+
isFixed?: boolean;
|
|
49
|
+
}[] | null;
|
|
50
|
+
/**
|
|
51
|
+
* Additional information or guidance displayed below the text field.
|
|
52
|
+
*/
|
|
53
|
+
helperText?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Error state for showing error message.
|
|
56
|
+
*/
|
|
57
|
+
error?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Disable.
|
|
60
|
+
*/
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Enables users to create new options along with choosing existing options.
|
|
64
|
+
*/
|
|
65
|
+
creatable?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Enables multi-select
|
|
68
|
+
*/
|
|
69
|
+
multiSelect?: boolean;
|
|
70
|
+
touched?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export declare function Select({ id, className, label, size, options, value, helperText, error, multiSelect, creatable, disabled, ...restProps }: Props): JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import { TabProps } from "./tab";
|
|
3
|
+
export declare enum TabSizes {
|
|
4
|
+
XS = "xs",
|
|
5
|
+
SM = "sm",
|
|
6
|
+
MD = "md",
|
|
7
|
+
LG = "lg"
|
|
8
|
+
}
|
|
9
|
+
export type TabSize = `${TabSizes}`;
|
|
10
|
+
/**
|
|
11
|
+
* Props for the Tabs component.
|
|
12
|
+
*/
|
|
13
|
+
export interface TabsProps {
|
|
14
|
+
/**
|
|
15
|
+
* Active tab index. Tab index starts from 0.
|
|
16
|
+
*/
|
|
17
|
+
activeIndex?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Default active tab index, to be used with the uncontrolled version of the Tabs component.
|
|
20
|
+
* @default 0
|
|
21
|
+
*/
|
|
22
|
+
defaultActiveIndex?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Dynamically updates the className applied to the component.
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Renders all the tabs at once and switches between them using CSS.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
switchUsingCss?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Called on click of a tab header.
|
|
34
|
+
* @param selectedTabId {number} Selected tab id.
|
|
35
|
+
*/
|
|
36
|
+
onSelect?: (selectedTabId: number) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Array of items to be displayed in the Tabs,
|
|
39
|
+
* each item should be wrapped in Tabs.Tab component
|
|
40
|
+
* @required
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Tabs>
|
|
44
|
+
* <Tabs.Tab title="Tab 1">
|
|
45
|
+
* Content of Tab 1
|
|
46
|
+
* </Tabs.Tab>
|
|
47
|
+
* </Tabs>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
children: ReactElement<TabProps> | Array<ReactElement<TabProps> | boolean> | boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Size of the tab.
|
|
53
|
+
* @default md
|
|
54
|
+
*/
|
|
55
|
+
size?: TabSize;
|
|
56
|
+
/**
|
|
57
|
+
* Variant of the tab.
|
|
58
|
+
* @default filled
|
|
59
|
+
*/
|
|
60
|
+
variant?: "filled" | "text";
|
|
61
|
+
/**
|
|
62
|
+
* Color of the tab. Only applicable for filled variant.
|
|
63
|
+
*/
|
|
64
|
+
color?: "primary" | "secondary";
|
|
65
|
+
}
|
|
66
|
+
export declare const Tabs: {
|
|
67
|
+
({ className, children, activeIndex, defaultActiveIndex, switchUsingCss, onSelect, size, variant, color }: TabsProps): ReactElement | null;
|
|
68
|
+
Tab: ({ children, className }: TabProps) => React.ReactElement;
|
|
69
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconType } from "../adpIcon";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Tab component.
|
|
5
|
+
*/
|
|
6
|
+
export interface TabProps {
|
|
7
|
+
/**
|
|
8
|
+
* Id of the tab.
|
|
9
|
+
*/
|
|
10
|
+
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Name of the tab.
|
|
13
|
+
*/
|
|
14
|
+
title: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Function to call when the tab is displayed.
|
|
17
|
+
*/
|
|
18
|
+
onEnter?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Function to call when the tab is exited.
|
|
21
|
+
*/
|
|
22
|
+
onExit?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Dynamically updates the className applied to the component.
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Content to be displayed within the tab.
|
|
29
|
+
*/
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Optional icon to be displayed in the tab.
|
|
33
|
+
*/
|
|
34
|
+
icon?: IconType;
|
|
35
|
+
/**
|
|
36
|
+
* Placement of the icon within the tab.
|
|
37
|
+
* Can be either "start" or "end".
|
|
38
|
+
*/
|
|
39
|
+
iconPlacement?: "start" | "end";
|
|
40
|
+
/**
|
|
41
|
+
* Indicates whether the tab is disabled.
|
|
42
|
+
*/
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare const Tab: ({ children, className }: TabProps) => React.ReactElement;
|
|
46
|
+
export default Tab;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { IconType } from "../adpIcon";
|
|
3
|
+
export declare enum sizes {
|
|
4
|
+
MD = "md",
|
|
5
|
+
LG = "lg"
|
|
6
|
+
}
|
|
7
|
+
export type Size = `${sizes}`;
|
|
8
|
+
export interface Props extends Omit<React.ComponentPropsWithoutRef<"input">, "css" | "size"> {
|
|
9
|
+
/**
|
|
10
|
+
* Regular static label.
|
|
11
|
+
*/
|
|
12
|
+
label?: string | ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Icon click handler
|
|
15
|
+
*/
|
|
16
|
+
onIconClick?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Placement of the icon
|
|
19
|
+
*/
|
|
20
|
+
iconPlacement?: "start" | "end";
|
|
21
|
+
/**
|
|
22
|
+
* Size of the Textfield.
|
|
23
|
+
* @default md
|
|
24
|
+
*/
|
|
25
|
+
size?: Size;
|
|
26
|
+
/**
|
|
27
|
+
* Prefix the input with an icon.
|
|
28
|
+
*/
|
|
29
|
+
icon?: IconType;
|
|
30
|
+
/**
|
|
31
|
+
* Pass a ref to the inner input element
|
|
32
|
+
*/
|
|
33
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
34
|
+
/**
|
|
35
|
+
* Additional information or guidance displayed below the text field.
|
|
36
|
+
*/
|
|
37
|
+
helperText?: string | ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Pass a boolean value to indicate if the text field is in an error state.
|
|
40
|
+
*/
|
|
41
|
+
error?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare const TextField: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TextareaProps extends Omit<React.ComponentPropsWithoutRef<"textarea">, "label"> {
|
|
3
|
+
/**
|
|
4
|
+
* Regular static label.
|
|
5
|
+
*/
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Pass a ref to the inner input element
|
|
9
|
+
*/
|
|
10
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
11
|
+
/**
|
|
12
|
+
* Additional information or guidance displayed below the textarea.
|
|
13
|
+
*/
|
|
14
|
+
helperText?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Additional information shown inside the textarea.
|
|
17
|
+
*/
|
|
18
|
+
infoText?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Pass a boolean value to indicate if the textarea is in an error state.
|
|
21
|
+
*/
|
|
22
|
+
error?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
export type TToastVariant = "success" | "info" | "warning" | "error";
|
|
3
|
+
export interface IToastProps {
|
|
4
|
+
/**
|
|
5
|
+
* Accepts a variant value
|
|
6
|
+
* @default info
|
|
7
|
+
*/
|
|
8
|
+
variant: TToastVariant;
|
|
9
|
+
/**
|
|
10
|
+
* Show/hide the toast component
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
display?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Accepts children of ReactNode type
|
|
16
|
+
*/
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Hide the Toast components automatically in x milliseconds
|
|
20
|
+
*/
|
|
21
|
+
autoHideDelay?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Hide the close button on the toast
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
hideCloseButton?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A callback that is fired once the Toast closes
|
|
29
|
+
*/
|
|
30
|
+
onClose?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Show a condensed form of the Toast
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
condensed?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Overwrite the style by passing space separated class names
|
|
38
|
+
*/
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const Toast: ({ variant, display, children, autoHideDelay, hideCloseButton, onClose, condensed, className }: IToastProps) => ReactElement | null;
|