react-frontend-common-components 0.0.89 → 0.0.90

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-frontend-common-components",
3
- "version": "0.0.89",
3
+ "version": "0.0.90",
4
4
  "description": "Reusable frontend library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/dist/index.d.ts DELETED
@@ -1,449 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { InputProps, TabsProps, BadgeProps, AvatarProps, SelectProps, ListProps, DividerProps, BreadcrumbProps, CarouselProps, TableProps, FloatButtonProps } from 'antd';
3
- import React$1, { ChangeEventHandler, MouseEventHandler, KeyboardEventHandler } from 'react';
4
- import { ChartData, ChartOptions } from 'chart.js';
5
- import { CheckboxChangeEvent } from 'antd/es/checkbox';
6
- import { CollapseProps, CollapsePanelProps } from 'antd/lib/collapse';
7
- import { PaginationProps } from 'antd/lib/pagination';
8
- import { CardProps } from 'antd/lib/card';
9
- import { ColumnsType } from 'antd/lib/table';
10
- import { PopoverProps } from 'antd/lib/popover';
11
-
12
- interface AppInputProps extends InputProps {
13
- className?: string;
14
- label?: string;
15
- name?: string;
16
- value?: string;
17
- dataTestId?: string;
18
- id?: string;
19
- disabled?: boolean;
20
- handleChange?: ChangeEventHandler<HTMLInputElement>;
21
- onClick?: MouseEventHandler<HTMLElement>;
22
- onPressEnter?: KeyboardEventHandler<HTMLInputElement>;
23
- defaultValue?: string;
24
- isAutoFocus?: boolean;
25
- triggerFocus?: boolean;
26
- type?: string;
27
- isOptional?: boolean;
28
- errorMessage?: string;
29
- suffixIcon?: React.ReactNode;
30
- prefixIcon?: React.ReactNode;
31
- required?: boolean;
32
- }
33
- declare const AppInput: ({ className, label, name, value, dataTestId, type, id, disabled, handleChange, onClick, defaultValue, onPressEnter, isAutoFocus, triggerFocus, isOptional, errorMessage, suffixIcon, prefixIcon, required, ...props }: AppInputProps) => react_jsx_runtime.JSX.Element;
34
-
35
- interface AppButtonProps {
36
- size?: "small" | "middle" | "large" | "default" | undefined;
37
- className?: string;
38
- handleClick?: MouseEventHandler<HTMLElement>;
39
- icon?: React$1.ReactNode;
40
- text?: string;
41
- disabled?: boolean;
42
- iconPosition?: string;
43
- isLoading?: boolean;
44
- type?: "default" | "text" | "link" | "primary" | "dashed" | undefined;
45
- }
46
- declare const AppButton: ({ type, size, className, handleClick, icon, text, disabled, iconPosition, isLoading, }: AppButtonProps) => react_jsx_runtime.JSX.Element;
47
-
48
- interface SidebarProps {
49
- links: {
50
- onClick?: () => void;
51
- label: string;
52
- path: string;
53
- icon: React$1.ReactNode;
54
- activeIcon?: React$1.ReactNode;
55
- tag?: React$1.ReactNode;
56
- }[];
57
- sideBarHead?: React$1.ReactNode;
58
- footerLinks?: {
59
- label: string;
60
- path: string;
61
- icon: React$1.ReactNode;
62
- activeIcon?: React$1.ReactNode;
63
- }[];
64
- className?: string;
65
- activeLink?: string;
66
- }
67
- declare const Sidebar: ({ links, sideBarHead, footerLinks, className, activeLink, }: SidebarProps) => react_jsx_runtime.JSX.Element;
68
-
69
- interface textAreaProps {
70
- id?: string;
71
- label?: string;
72
- name?: string;
73
- value?: string;
74
- dataTestId?: string;
75
- defaultValue?: string;
76
- onPressEnter?: KeyboardEventHandler<HTMLTextAreaElement>;
77
- handleChange?: ChangeEventHandler<HTMLTextAreaElement>;
78
- autoSize?: {
79
- minRows?: number;
80
- maxRows?: number;
81
- };
82
- rows?: number;
83
- cols?: number;
84
- placeholder?: string;
85
- className?: string;
86
- error?: string;
87
- }
88
- declare const AppTextarea: ({ id, placeholder, name, value, dataTestId, defaultValue, onPressEnter, handleChange, rows, cols, className, error, }: textAreaProps) => react_jsx_runtime.JSX.Element;
89
-
90
- interface AppTabProps {
91
- className?: string;
92
- items?: TabsProps["items"];
93
- handleChange?: (activeKey: string) => void;
94
- defaultActiveKey?: string;
95
- activeKey?: string;
96
- }
97
- declare const AppTab: ({ className, items, handleChange, defaultActiveKey, activeKey, }: AppTabProps) => react_jsx_runtime.JSX.Element;
98
-
99
- interface BackArrowProps {
100
- text?: string;
101
- href?: string;
102
- className?: string;
103
- backIcon?: React$1.ReactNode;
104
- onClick?: MouseEventHandler<HTMLElement>;
105
- }
106
- declare const AppBackArrow: ({ text, href, className, backIcon, onClick, }: BackArrowProps) => react_jsx_runtime.JSX.Element;
107
-
108
- interface AppBadgeProps extends Omit<BadgeProps, "content"> {
109
- content?: React$1.ReactNode;
110
- children: React$1.ReactNode;
111
- className?: string;
112
- ribbon?: {
113
- text: React$1.ReactNode;
114
- color?: string;
115
- placement?: "start" | "end";
116
- };
117
- }
118
- declare const AppBadge: ({ content, children, className, ribbon, ...props }: AppBadgeProps) => react_jsx_runtime.JSX.Element;
119
-
120
- interface OverViewCardProps {
121
- className?: string;
122
- text?: string;
123
- number?: number | string;
124
- }
125
- declare const OverViewCard: ({ className, text, number }: OverViewCardProps) => react_jsx_runtime.JSX.Element;
126
-
127
- type ChartType = "bar" | "line" | "pie" | "doughnut";
128
- interface AppChartProps {
129
- type: ChartType;
130
- data: ChartData<"bar" | "line" | "pie" | "doughnut">;
131
- options?: ChartOptions<"bar" | "line" | "pie" | "doughnut">;
132
- className?: string;
133
- height?: number;
134
- width?: number;
135
- }
136
- declare const AppChart: ({ type, data, options, className, height, width, ...props }: AppChartProps) => react_jsx_runtime.JSX.Element;
137
-
138
- interface ImageType {
139
- src: string;
140
- }
141
- interface AppImageBoxProps {
142
- width?: number;
143
- height?: number;
144
- text?: string;
145
- image: ImageType;
146
- className?: string;
147
- handleClick?: MouseEventHandler<HTMLElement>;
148
- }
149
- declare const AppImageBox: ({ width, height, text, image, className, handleClick, }: AppImageBoxProps) => react_jsx_runtime.JSX.Element;
150
-
151
- interface AppAvatarProps extends AvatarProps {
152
- fallbackIcon?: React$1.ReactNode;
153
- className?: string;
154
- }
155
- declare const AppAvatar: ({ src, fallbackIcon, className, ...props }: AppAvatarProps) => react_jsx_runtime.JSX.Element;
156
-
157
- interface AppCheckboxTextProps {
158
- text: string;
159
- checked?: boolean;
160
- handleChange?: (e: CheckboxChangeEvent) => void;
161
- className?: string;
162
- }
163
- declare const AppCheckboxText: ({ text, checked, handleChange, className, }: AppCheckboxTextProps) => react_jsx_runtime.JSX.Element;
164
-
165
- interface AppCollapseProps extends CollapseProps {
166
- panels?: {
167
- key: string;
168
- header: React$1.ReactNode;
169
- content: React$1.ReactNode;
170
- collapsible?: CollapsePanelProps["collapsible"];
171
- }[];
172
- className?: string;
173
- }
174
- declare const AppCollapse: ({ panels, defaultActiveKey, onChange, expandIconPosition, ghost, accordion, expandIcon, size, bordered, activeKey, className, ...restProps }: AppCollapseProps) => react_jsx_runtime.JSX.Element;
175
-
176
- interface AppCustomLoaderProps {
177
- className?: string;
178
- }
179
- declare const AppCustomLoader: ({ className }: AppCustomLoaderProps) => react_jsx_runtime.JSX.Element;
180
-
181
- interface LatLng {
182
- lat: number;
183
- lng: number;
184
- }
185
- interface LocationMapProps {
186
- cityId?: LatLng;
187
- className?: string;
188
- containerStyle?: React$1.CSSProperties;
189
- clickableIcons?: boolean;
190
- zoom?: number;
191
- mapKey: string;
192
- }
193
- declare const AppLocationMap: ({ cityId, className, containerStyle, clickableIcons, zoom, mapKey, }: LocationMapProps) => react_jsx_runtime.JSX.Element;
194
-
195
- interface AppModalProps {
196
- visible: boolean;
197
- onClose: () => void;
198
- title?: string;
199
- description?: string;
200
- children: React$1.ReactNode;
201
- footerButtons?: React$1.ReactNode;
202
- alignTitleLeft?: boolean;
203
- className?: string;
204
- closeIcon?: React$1.ReactNode;
205
- width?: number;
206
- }
207
- declare const AppModal: ({ visible, onClose, title, description, children, footerButtons, alignTitleLeft, className, closeIcon, width, }: AppModalProps) => react_jsx_runtime.JSX.Element;
208
-
209
- interface AppOtpFieldProps {
210
- otp: string;
211
- onChange: (otp: string) => void;
212
- numInputs?: number;
213
- otpError?: string;
214
- resendTimeout?: number;
215
- onResendOtp?: () => void;
216
- setResendTimeout: (timeout: number) => void;
217
- className?: string;
218
- resendTxt?: React$1.ReactNode;
219
- resendTime: string;
220
- }
221
- declare const AppOtpField: ({ otp, onChange, numInputs, otpError, resendTimeout, onResendOtp, setResendTimeout, className, resendTxt, resendTime, }: AppOtpFieldProps) => react_jsx_runtime.JSX.Element;
222
-
223
- interface AppPaginationProps extends PaginationProps {
224
- total: number;
225
- currentPage: number;
226
- pageSize?: number;
227
- onPageChange: (page: number, pageSize: number) => void;
228
- showGotoBox: boolean;
229
- sizeChanger: boolean;
230
- className?: string;
231
- }
232
- declare const AppPagination: ({ total, currentPage, pageSize, onPageChange, showGotoBox, sizeChanger, className, ...rest }: AppPaginationProps) => react_jsx_runtime.JSX.Element;
233
-
234
- interface AppPasswordInputProps {
235
- className?: string;
236
- label?: string;
237
- name?: string;
238
- value?: string;
239
- dataTestId?: string;
240
- id?: string;
241
- disabled?: boolean;
242
- handleChange?: ChangeEventHandler<HTMLInputElement>;
243
- onClick?: MouseEventHandler<HTMLElement>;
244
- onPressEnter?: KeyboardEventHandler<HTMLInputElement>;
245
- defaultValue?: string;
246
- isAutoFocus?: boolean;
247
- triggerFocus?: boolean;
248
- errorMessage?: string;
249
- autoComplete?: string;
250
- icon?: React$1.ReactNode;
251
- hiddenIcon?: React$1.ReactNode;
252
- showIcon?: boolean;
253
- }
254
- declare const AppPasswordInput: ({ label, name, value, dataTestId, id, disabled, handleChange, onClick, defaultValue, onPressEnter, className, errorMessage, isAutoFocus, triggerFocus, autoComplete, icon, hiddenIcon, showIcon, }: AppPasswordInputProps) => react_jsx_runtime.JSX.Element;
255
-
256
- interface TitleProps {
257
- mainText: React$1.ReactNode;
258
- className?: string;
259
- subText?: string;
260
- level?: 1 | 2 | 3 | 4 | 5;
261
- }
262
- declare const AppTitle: ({ mainText, className, subText, level, }: TitleProps) => react_jsx_runtime.JSX.Element;
263
-
264
- interface AppToggleButtonProps {
265
- initialChecked?: boolean;
266
- onChange?: (checked: boolean) => void;
267
- checkedLabel?: string;
268
- uncheckedLabel?: string;
269
- className?: string;
270
- }
271
- declare const AppToggleButton: ({ initialChecked, onChange, checkedLabel, uncheckedLabel, className, }: AppToggleButtonProps) => react_jsx_runtime.JSX.Element;
272
-
273
- interface AppUploadImageProps {
274
- className?: string;
275
- uploadIcon?: React$1.ReactNode;
276
- value?: string;
277
- text?: string;
278
- onFileChange?: (file: File | null) => void;
279
- alertMessages?: {
280
- invalidType?: string;
281
- sizeExceed?: string;
282
- };
283
- acceptedFormats?: string[];
284
- maxSizeMb?: number;
285
- altText?: string;
286
- }
287
- declare const AppUploadImage: ({ className, uploadIcon, value, text, onFileChange, alertMessages, acceptedFormats, maxSizeMb, altText, }: AppUploadImageProps) => react_jsx_runtime.JSX.Element;
288
-
289
- interface Option {
290
- value: number;
291
- text: string;
292
- }
293
- interface AppRadioGroupProps {
294
- options: Option[];
295
- selectedValue: number | null;
296
- onChange: (value: number) => void;
297
- className?: string;
298
- }
299
- declare const AppRadioGroup: ({ options, selectedValue, onChange, className, }: AppRadioGroupProps) => react_jsx_runtime.JSX.Element;
300
-
301
- interface Options {
302
- value: string;
303
- label: string;
304
- flag?: string;
305
- }
306
- interface AppSelectProps extends SelectProps {
307
- className?: string;
308
- value?: string | null;
309
- dataTestId?: string;
310
- id?: string;
311
- disabled?: boolean;
312
- handleChange?: (value: string | string[]) => void;
313
- onClick?: MouseEventHandler<HTMLElement>;
314
- options?: Options[];
315
- onSelectChange?: (value: string) => void;
316
- required?: boolean;
317
- placeholder?: string;
318
- errorMessage?: string;
319
- showSearch?: boolean;
320
- }
321
- declare const AppSelect: ({ value, handleChange, options, disabled, placeholder, className, errorMessage, showSearch, required, ...props }: AppSelectProps) => react_jsx_runtime.JSX.Element;
322
-
323
- interface AppSelectAddProps extends SelectProps {
324
- options?: SelectProps["options"];
325
- placeholder?: string;
326
- onChange?: (value: string) => void;
327
- className?: string;
328
- }
329
- declare const AppSelectAdd: ({ options, placeholder, onChange, className, ...rest }: AppSelectAddProps) => react_jsx_runtime.JSX.Element;
330
-
331
- interface AppTagProps {
332
- color?: string;
333
- closable?: boolean;
334
- onClick?: (e: React$1.MouseEvent<HTMLElement, MouseEvent>) => void;
335
- style?: React$1.CSSProperties;
336
- className?: string;
337
- children: React$1.ReactNode;
338
- closeIcon?: React$1.ReactNode;
339
- }
340
- declare const AppTag: ({ color, closable, onClick, style, className, children, closeIcon, }: AppTagProps) => react_jsx_runtime.JSX.Element | null;
341
-
342
- interface AppListProps<T> extends ListProps<T> {
343
- renderItem: (item: T, index: number) => React$1.ReactNode;
344
- className?: string;
345
- }
346
- declare const AppList: <T extends unknown>({ renderItem, dataSource, className, ...props }: AppListProps<T>) => react_jsx_runtime.JSX.Element;
347
-
348
- type LoaderType = "spinner" | "skeleton" | "custom";
349
- interface AppLoaderProps {
350
- type?: LoaderType;
351
- customLoader?: React$1.ReactNode;
352
- className?: string;
353
- }
354
- declare const AppLoader: ({ type, customLoader, className }: AppLoaderProps) => string | number | true | Iterable<React$1.ReactNode> | react_jsx_runtime.JSX.Element;
355
-
356
- interface AppDividerProps extends DividerProps {
357
- className?: string;
358
- }
359
- declare const AppDivider: ({ className, ...props }: AppDividerProps) => react_jsx_runtime.JSX.Element;
360
-
361
- interface AppLabelProps {
362
- text: string;
363
- htmlFor?: string;
364
- color?: string;
365
- fontSize?: string;
366
- className?: string;
367
- }
368
- declare const AppLabel: ({ text, htmlFor, color, fontSize, className, }: AppLabelProps) => react_jsx_runtime.JSX.Element;
369
-
370
- interface AppBreadcrumbProps extends BreadcrumbProps {
371
- className?: string;
372
- }
373
- declare const AppBreadcrumb: ({ className, ...props }: AppBreadcrumbProps) => react_jsx_runtime.JSX.Element;
374
-
375
- interface AppCardProps extends CardProps {
376
- title?: React$1.ReactNode;
377
- extra?: React$1.ReactNode;
378
- cover?: React$1.ReactNode;
379
- hoverable?: boolean;
380
- actions?: React$1.ReactNode[];
381
- className?: string;
382
- borderless?: boolean;
383
- }
384
- declare const AppCard: ({ title, extra, cover, hoverable, actions, className, borderless, ...cardProps }: AppCardProps) => react_jsx_runtime.JSX.Element;
385
-
386
- interface AppCarouselProps extends CarouselProps {
387
- items: React$1.ReactNode[];
388
- className?: string;
389
- nxtIcon?: React$1.ReactNode;
390
- prevIcon?: React$1.ReactNode;
391
- showIcon?: boolean;
392
- showDots?: boolean;
393
- showLines?: boolean;
394
- autoplay?: boolean;
395
- }
396
- declare const AppCarousel: ({ items, className, nxtIcon, prevIcon, showIcon, showDots, autoplay, ...rest }: AppCarouselProps) => react_jsx_runtime.JSX.Element;
397
-
398
- interface AppTableProps<T> extends TableProps<T> {
399
- columns: ColumnsType<T>;
400
- dataSource: T[];
401
- rowKey?: string;
402
- bordered?: boolean;
403
- pagination?: TableProps<T>["pagination"];
404
- size?: "small" | "middle" | "large";
405
- scroll?: TableProps<T>["scroll"];
406
- className?: string;
407
- }
408
- declare const AppTable: <T extends object>({ columns, dataSource, rowKey, bordered, pagination, size, scroll, className, ...tableProps }: AppTableProps<T>) => react_jsx_runtime.JSX.Element;
409
-
410
- interface AppProgressProps {
411
- percent: number;
412
- type?: "line" | "circle" | "dashboard";
413
- strokeColor?: string;
414
- trailColor?: string;
415
- size?: "default" | "small";
416
- status?: "success" | "exception" | "normal" | "active";
417
- showInfo?: boolean;
418
- className?: string;
419
- }
420
- declare const AppProgress: ({ percent, type, strokeColor, trailColor, size, status, showInfo, className, }: AppProgressProps) => react_jsx_runtime.JSX.Element;
421
-
422
- interface AppPopoverProps extends PopoverProps {
423
- content: React.ReactNode;
424
- title?: React.ReactNode;
425
- children: React.ReactNode;
426
- bgColor?: string;
427
- triggerType?: "hover" | "click";
428
- color?: string;
429
- className?: string;
430
- }
431
- declare const AppPopover: ({ content, title, children, bgColor, color, triggerType, className, ...popoverProps }: AppPopoverProps) => react_jsx_runtime.JSX.Element;
432
-
433
- interface AppFloatButtonProps extends FloatButtonProps {
434
- className?: string;
435
- onClick?: React$1.MouseEventHandler<HTMLButtonElement>;
436
- onMouseEnter?: React$1.MouseEventHandler<HTMLButtonElement>;
437
- }
438
- declare const AppFloatButton: ({ className, onClick, onMouseEnter, ...props }: AppFloatButtonProps) => react_jsx_runtime.JSX.Element;
439
-
440
- interface AppPhoneInputProps {
441
- countryCode?: string;
442
- phone: string;
443
- handleChange: (phone: string, countryCode: string, uniCode: string) => void;
444
- className: string;
445
- id: string;
446
- }
447
- declare const AppPhoneInput: ({ handleChange, countryCode, phone, className, id, }: AppPhoneInputProps) => react_jsx_runtime.JSX.Element;
448
-
449
- export { AppAvatar, AppBackArrow, AppBadge, AppBreadcrumb, AppButton, AppCard, AppCarousel, AppChart, AppCheckboxText, AppCollapse, AppCustomLoader, AppDivider, AppFloatButton, AppImageBox, AppInput, AppLabel, AppList, AppLoader, AppLocationMap, AppModal, AppOtpField, AppPagination, AppPasswordInput, AppPhoneInput, AppPopover, AppProgress, AppRadioGroup, AppSelect, AppSelectAdd, Sidebar as AppSidebar, AppTab, AppTable, AppTag, AppTextarea, AppTitle, AppToggleButton, AppUploadImage, OverViewCard };