@cloudwick/astral-ui 1.0.0 → 2.1.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 +22 -13
- 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 +12 -9
- package/dist/components/ctaGroup/index.d.ts +46 -0
- package/dist/components/dataTable/advancedFilters.d.ts +10 -0
- package/dist/components/dataTable/dataTableStoryHelpers.d.ts +1098 -0
- package/dist/components/dataTable/index.d.ts +147 -0
- package/dist/components/dataTable/pageSizeModal.d.ts +9 -0
- package/dist/components/dataTable/selectedFilterList.d.ts +20 -0
- package/dist/components/dataTable/settings.d.ts +10 -0
- package/dist/components/dataTable/table.d.ts +41 -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/radioGroup/index.d.ts +48 -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 +13 -2
- package/dist/index.d.ts +11 -0
- package/dist/index.esm.js +23 -2
- package/package.json +5 -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.1.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";
|
|
@@ -52,6 +53,7 @@ export declare const iconList: {
|
|
|
52
53
|
readonly bell: "bell";
|
|
53
54
|
readonly beta: "beta";
|
|
54
55
|
readonly bolt: "bolt";
|
|
56
|
+
readonly book: "book";
|
|
55
57
|
readonly bookmark: "bookmark";
|
|
56
58
|
readonly bookmarkRemove: "bookmark-remove";
|
|
57
59
|
readonly bug: "bug";
|
|
@@ -76,13 +78,13 @@ export declare const iconList: {
|
|
|
76
78
|
readonly customIcon: "custom-icon";
|
|
77
79
|
readonly customModel: "custom-model";
|
|
78
80
|
readonly dashboard: "dashboard";
|
|
81
|
+
readonly database: "database";
|
|
82
|
+
readonly databaseMaintenance: "database-maintenance";
|
|
79
83
|
readonly dataClassifications: "data-classifications";
|
|
80
84
|
readonly dataLake: "data-lake";
|
|
85
|
+
readonly dataset: "dataset";
|
|
81
86
|
readonly dataView: "data-view";
|
|
82
87
|
readonly dataWarehouse: "data-warehouse";
|
|
83
|
-
readonly database: "database";
|
|
84
|
-
readonly databaseMaintenance: "database-maintenance";
|
|
85
|
-
readonly dataset: "dataset";
|
|
86
88
|
readonly delete: "delete";
|
|
87
89
|
readonly deleteUser: "delete-user";
|
|
88
90
|
readonly disable: "disable";
|
|
@@ -94,6 +96,7 @@ export declare const iconList: {
|
|
|
94
96
|
readonly download: "download";
|
|
95
97
|
readonly drag: "drag";
|
|
96
98
|
readonly edit: "edit";
|
|
99
|
+
readonly editFilled: "edit-filled";
|
|
97
100
|
readonly editLayout: "edit-layout";
|
|
98
101
|
readonly email: "email";
|
|
99
102
|
readonly entityRecognizer: "entity-recognizer";
|
|
@@ -111,13 +114,13 @@ export declare const iconList: {
|
|
|
111
114
|
readonly file: "file";
|
|
112
115
|
readonly fileCode: "file-code";
|
|
113
116
|
readonly fileDownload: "file-download";
|
|
117
|
+
readonly fileEdit: "file-edit";
|
|
114
118
|
readonly fileInfo: "file-info";
|
|
119
|
+
readonly fileloadValidate: "fileload-validate";
|
|
115
120
|
readonly fileLog: "file-log";
|
|
116
121
|
readonly fileSuccess: "file-success";
|
|
117
|
-
readonly fileEdit: "file-edit";
|
|
118
122
|
readonly fileSync: "file-sync";
|
|
119
123
|
readonly fileWarning: "file-warning";
|
|
120
|
-
readonly fileloadValidate: "fileload-validate";
|
|
121
124
|
readonly filter: "filter";
|
|
122
125
|
readonly filterFunnel: "filter-funnel";
|
|
123
126
|
readonly flag: "flag";
|
|
@@ -125,6 +128,7 @@ export declare const iconList: {
|
|
|
125
128
|
readonly forecast: "forecast";
|
|
126
129
|
readonly forward: "forward";
|
|
127
130
|
readonly globe: "globe";
|
|
131
|
+
readonly glossaries: "glossaries";
|
|
128
132
|
readonly gridView: "grid-view";
|
|
129
133
|
readonly grip: "grip";
|
|
130
134
|
readonly group: "group";
|
|
@@ -142,6 +146,7 @@ export declare const iconList: {
|
|
|
142
146
|
readonly key: "key";
|
|
143
147
|
readonly language: "language";
|
|
144
148
|
readonly leftArrow: "left-arrow";
|
|
149
|
+
readonly leftArrowLong: "left-arrow-long";
|
|
145
150
|
readonly licenseInfo: "license-info";
|
|
146
151
|
readonly lineage: "lineage";
|
|
147
152
|
readonly link: "link";
|
|
@@ -150,6 +155,7 @@ export declare const iconList: {
|
|
|
150
155
|
readonly mailServer: "mail-server";
|
|
151
156
|
readonly management: "management";
|
|
152
157
|
readonly managementRole: "management-role";
|
|
158
|
+
readonly manager: "manager";
|
|
153
159
|
readonly media: "media";
|
|
154
160
|
readonly menu: "menu";
|
|
155
161
|
readonly metadata: "metadata";
|
|
@@ -157,7 +163,6 @@ export declare const iconList: {
|
|
|
157
163
|
readonly minusCircle: "minus-circle";
|
|
158
164
|
readonly mlModel: "ml-model";
|
|
159
165
|
readonly monthlyUsagePattern: "monthly-usage-pattern";
|
|
160
|
-
readonly more: "more";
|
|
161
166
|
readonly msg: "msg";
|
|
162
167
|
readonly mysql: "mysql";
|
|
163
168
|
readonly notebook: "notebook";
|
|
@@ -174,6 +179,7 @@ export declare const iconList: {
|
|
|
174
179
|
readonly pause: "pause";
|
|
175
180
|
readonly payload: "payload";
|
|
176
181
|
readonly pencil: "pencil";
|
|
182
|
+
readonly pipeline: "pipeline";
|
|
177
183
|
readonly postgres: "postgres";
|
|
178
184
|
readonly profile: "profile";
|
|
179
185
|
readonly qrCode: "qr-code";
|
|
@@ -182,6 +188,7 @@ export declare const iconList: {
|
|
|
182
188
|
readonly repair: "repair";
|
|
183
189
|
readonly restart: "restart";
|
|
184
190
|
readonly rightArrow: "right-arrow";
|
|
191
|
+
readonly rightArrowLong: "right-arrow-long";
|
|
185
192
|
readonly runs: "runs";
|
|
186
193
|
readonly save: "save";
|
|
187
194
|
readonly scheduled: "scheduled";
|
|
@@ -197,7 +204,6 @@ export declare const iconList: {
|
|
|
197
204
|
readonly shield: "shield";
|
|
198
205
|
readonly showPassword: "show-password";
|
|
199
206
|
readonly signature: "signature";
|
|
200
|
-
readonly signOut: "sign-out";
|
|
201
207
|
readonly slideLeft: "slide-left";
|
|
202
208
|
readonly slideRight: "slide-right";
|
|
203
209
|
readonly smtp: "smtp";
|
|
@@ -230,17 +236,20 @@ export declare const iconList: {
|
|
|
230
236
|
readonly usageByService: "usage-by-service";
|
|
231
237
|
readonly user: "user";
|
|
232
238
|
readonly userAgreements: "user-agreements";
|
|
233
|
-
readonly vMenu: "v-menu";
|
|
234
239
|
readonly video: "video";
|
|
235
|
-
readonly
|
|
240
|
+
readonly vMenu: "v-menu";
|
|
241
|
+
readonly vMenuFilled: "v-menu-filled";
|
|
236
242
|
readonly widgetGroup: "widget-group";
|
|
237
243
|
readonly workflow: "workflow";
|
|
238
244
|
readonly zoomIn: "zoom-in";
|
|
239
245
|
readonly zoomOut: "zoom-out";
|
|
240
|
-
readonly
|
|
241
|
-
readonly
|
|
246
|
+
readonly username: "username";
|
|
247
|
+
readonly logout: "logout";
|
|
248
|
+
readonly reload: "reload";
|
|
249
|
+
readonly downArrowLong: "down-arrow-long";
|
|
250
|
+
readonly upArrowLong: "up-arrow-long";
|
|
242
251
|
};
|
|
243
|
-
export type IconType = typeof iconList[keyof typeof iconList];
|
|
252
|
+
export type IconType = (typeof iconList)[keyof typeof iconList];
|
|
244
253
|
export declare const icons: {
|
|
245
254
|
[key in IconType]: IIconDetails;
|
|
246
255
|
};
|
|
@@ -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.
|
|
@@ -15,7 +13,7 @@ export interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
15
13
|
*/
|
|
16
14
|
size?: CheckboxGroupSize;
|
|
17
15
|
/**
|
|
18
|
-
*
|
|
16
|
+
* Pass space separated class names to override the CheckboxGroup styling
|
|
19
17
|
*/
|
|
20
18
|
className?: string;
|
|
21
19
|
/**
|
|
@@ -24,17 +22,22 @@ export interface Props extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
24
22
|
*/
|
|
25
23
|
disabled?: boolean;
|
|
26
24
|
/**
|
|
27
|
-
*
|
|
25
|
+
* Selected values
|
|
28
26
|
*/
|
|
29
27
|
selectedValues?: unknown[];
|
|
30
28
|
/**
|
|
31
|
-
* An array of checkbox
|
|
29
|
+
* An array of objects of checkbox props 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;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FilterItem } from ".";
|
|
2
|
+
interface AdvancedFilterProps {
|
|
3
|
+
advancedFilters?: FilterItem[];
|
|
4
|
+
basicFilters?: FilterItem[];
|
|
5
|
+
selectedFilters: any;
|
|
6
|
+
setSelectedFilters: (filters: any) => void;
|
|
7
|
+
handleClearFilter: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const AdvancedFilters: ({ advancedFilters, basicFilters, selectedFilters, setSelectedFilters, handleClearFilter }: AdvancedFilterProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export default AdvancedFilters;
|