@ambuj.bhaskar/react-component-library 0.25.0-alpha → 0.25.2-alpha

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/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { default as default_2 } from 'react';
3
+ import { Dispatch } from 'react';
3
4
  import { DropdownProps as DropdownProps_2 } from 'antd';
4
5
  import { JSX as JSX_2 } from 'react/jsx-runtime';
5
6
  import { MenuProps as MenuProps_2 } from 'antd';
@@ -7,7 +8,9 @@ import { PopoverProps as PopoverProps_2 } from 'antd';
7
8
  import { RangePickerProps } from 'antd/es/date-picker';
8
9
  import * as React_2 from 'react';
9
10
  import { ReactNode } from 'react';
11
+ import { RefObject } from 'react';
10
12
  import { Resolver } from 'react-hook-form';
13
+ import { SetStateAction } from 'react';
11
14
  import { TableProps as TableProps_2 } from 'antd';
12
15
  import { TimeRangePickerProps } from 'antd';
13
16
 
@@ -135,6 +138,8 @@ export declare type AnnotationStatus = "approved" | "rejected" | "pending" | "co
135
138
 
136
139
  export declare type AnnotationType = "rectangle" | "circle" | "polygon" | "dot";
137
140
 
141
+ declare function areAllValuesEmpty(obj: any): boolean;
142
+
138
143
  export declare const AwiAnnotationHotkeys: default_2.FC<AwiAnnotationHotkeysProps>;
139
144
 
140
145
  export declare type AwiAnnotationHotkeysProps = {
@@ -289,6 +294,31 @@ export declare type AwiEmptyStateProps = {
289
294
  stateTitle?: string;
290
295
  };
291
296
 
297
+ export declare const AwiHelperMethods: {
298
+ getStatusDisplayText: (status: string, user: any) => any;
299
+ displayVersion: (branch: any, commitId: any, buildDate: any, buildNumber: any) => void;
300
+ toAPIQueryString: (params: any) => string;
301
+ isSAMAllowed: (type: string | undefined, requestFor?: string) => boolean;
302
+ checkValidPassword: (val: any) => boolean;
303
+ getRelativeTime: (inputDate: Date) => string;
304
+ randomVibrantColor: () => string;
305
+ chunkArray: typeof chunkArray;
306
+ isValidMobileNumber: (val: any) => boolean;
307
+ sleepSystem: (time: number) => Promise<void>;
308
+ secondDelayDisplayMessage: (time: number) => string;
309
+ areAllValuesEmpty: typeof areAllValuesEmpty;
310
+ isEighteenOrOlder: typeof isEighteenOrOlder;
311
+ displayTimeAndDateInfo: (date?: any) => string;
312
+ hasMoreRecords: (allPages: any) => any;
313
+ checkOnboardingComplete: (myDetails: any) => boolean;
314
+ checkBillingAvailable: (myDetails: any) => boolean;
315
+ capitalizeFirstChar: typeof capitalizeFirstChar;
316
+ sendEmptyLabelStatus: (labels: any) => any;
317
+ isImageKitURL: (src?: string) => boolean;
318
+ byteToSize: (bytes: number) => string;
319
+ useThrottle: (func: any, limit: any) => (...args: any) => void;
320
+ };
321
+
292
322
  export declare const AwiInput: React.FC<AwiInputProps>;
293
323
 
294
324
  export declare type AwiInputProps = {
@@ -410,6 +440,15 @@ export declare type AwiPaginationProps = {
410
440
  isLoading: boolean;
411
441
  };
412
442
 
443
+ export declare const AwiSafeLocalStorage: {
444
+ getItem: (key: any) => string | null;
445
+ setItem: (key: any, value: any) => void;
446
+ removeItem: (key: any) => void;
447
+ getToken: () => string;
448
+ removeToken: () => void;
449
+ removeLogout: () => void;
450
+ };
451
+
413
452
  export declare const AwiSamModal: React.FC<AwiSamModalProps>;
414
453
 
415
454
  export declare type AwiSamModalProps = {
@@ -531,6 +570,11 @@ export declare const AwiToastMessage: {
531
570
  }) => void;
532
571
  };
533
572
 
573
+ export declare const AwiUseKeyChecker: () => {
574
+ isCtrlPressedFunc: () => boolean;
575
+ isAltPressedFunc: () => boolean;
576
+ };
577
+
534
578
  export declare const Backdrop: default_2.FC<BackdropProps>;
535
579
 
536
580
  export declare interface BackdropProps extends ComponentProps<"div"> {
@@ -614,6 +658,8 @@ export declare type ButtonProps = HTMLButtonProps & {
614
658
 
615
659
  declare type ButtonVariant = "primary" | "secondary" | "tertiary" | "nav";
616
660
 
661
+ declare function capitalizeFirstChar(str: any): any;
662
+
617
663
  export declare const Chart: React.FC<ChartProps>;
618
664
 
619
665
  declare type ChartData = {
@@ -644,8 +690,19 @@ export declare type ChartProps = {
644
690
 
645
691
  declare type ChartType = "line" | "bar" | "doughnut" | "pie";
646
692
 
693
+ /**
694
+ * All Helper methods will be defined here
695
+ */
696
+ declare function chunkArray<T>(arr: T[], chunkSize?: number): T[][];
697
+
647
698
  declare type Color = string;
648
699
 
700
+ declare type ColorStatesType = {
701
+ default: Color;
702
+ hover?: Color;
703
+ active?: Color;
704
+ };
705
+
649
706
  export declare const CompactEventCard: React.FC<CompactEventCardPropsType>;
650
707
 
651
708
  export declare type CompactEventCardPropsType = {
@@ -739,6 +796,8 @@ export declare type DateRangePickerProps = {
739
796
 
740
797
  declare type DateTimeFormat = string;
741
798
 
799
+ export declare const DEFAULT_THEME: ThemeObject;
800
+
742
801
  export declare const DetectionCarousel: React.FC<DetectionCarouselProps>;
743
802
 
744
803
  export declare type DetectionCarouselProps = {
@@ -770,7 +829,7 @@ export declare interface DropdownProps extends Omit<DropdownProps_2, "style" | "
770
829
  theme?: DropdownTheme;
771
830
  }
772
831
 
773
- declare interface DropdownTheme {
832
+ export declare interface DropdownTheme {
774
833
  /**
775
834
  * Button styling
776
835
  */
@@ -937,6 +996,8 @@ export declare type InputProps = HTMLInputProps & {
937
996
  borderColor?: Color;
938
997
  };
939
998
 
999
+ declare function isEighteenOrOlder(birthDate: any): boolean;
1000
+
940
1001
  declare type JustifyContent = "center" | "start" | "end" | "flex-start" | "flex-end" | "left" | "right" | "baseline" | "first baseline" | "last baseline" | "space-between" | "space-around" | "space-evenly" | "stretch";
941
1002
 
942
1003
  declare type LineVariant = "fill" | "line";
@@ -1198,6 +1259,14 @@ export declare type SelectProps = {
1198
1259
 
1199
1260
  export declare type ShowAnnotationStatus = "approved" | "rejected" | "pending" | "corrected" | "all";
1200
1261
 
1262
+ export declare const showToast: ({ type, title, body, }: ShowToastType) => void;
1263
+
1264
+ declare type ShowToastType = {
1265
+ type: ToastType;
1266
+ title?: string;
1267
+ body?: string;
1268
+ };
1269
+
1201
1270
  export declare const Sidebar: React.FC<SidebarProps>;
1202
1271
 
1203
1272
  export declare type SidebarConfig = {
@@ -1316,6 +1385,29 @@ export declare type TCoordinateType = {
1316
1385
 
1317
1386
  declare type TextSize = "xs" | "s" | "m" | "l" | "xl";
1318
1387
 
1388
+ export declare type ThemeObject = {
1389
+ name?: string;
1390
+ colors?: ThemeSection;
1391
+ sizes?: ThemeSection;
1392
+ weights?: ThemeSection;
1393
+ };
1394
+
1395
+ export declare const ThemeProvider: ({ theme, log, children, }: {
1396
+ theme?: ThemeObject;
1397
+ log?: boolean;
1398
+ children: ReactNode;
1399
+ }) => JSX_2.Element;
1400
+
1401
+ export declare type ThemeProviderProps = {
1402
+ theme: ThemeObject;
1403
+ log?: boolean;
1404
+ children: ReactNode;
1405
+ };
1406
+
1407
+ export declare type ThemeSection = {
1408
+ [key: string]: string | ThemeSection;
1409
+ };
1410
+
1319
1411
  export declare const Toast: default_2.FC<ToastProps>;
1320
1412
 
1321
1413
  declare type ToastProps = {
@@ -1345,6 +1437,38 @@ export declare type TPositionType = {
1345
1437
  lng: number;
1346
1438
  };
1347
1439
 
1440
+ export declare function usePagination(initialPage?: number, initialTotalPages?: number): {
1441
+ currentPage: number;
1442
+ setPage: (newPage: number) => void;
1443
+ nextPage: () => void;
1444
+ prevPage: () => void;
1445
+ totalPages: number;
1446
+ setTotalPages: Dispatch<SetStateAction<number>>;
1447
+ };
1448
+
1449
+ export declare const usePointerState: () => {
1450
+ pointerState: keyof ColorStatesType;
1451
+ pointerEnter: () => void;
1452
+ pointerLeave: () => void;
1453
+ pointerDown: () => void;
1454
+ pointerUp: () => void;
1455
+ };
1456
+
1457
+ export declare const useResize: () => {
1458
+ width: number;
1459
+ height: number;
1460
+ containerRef: RefObject<HTMLDivElement>;
1461
+ };
1462
+
1348
1463
  export declare type userLevel = "awi_root" | "awi_admin" | "awi_manager" | "awi_developer" | "awi_supervisor" | "awi_verifier" | "awi_annotator";
1349
1464
 
1465
+ export declare const useTheme: () => Record<string, string>;
1466
+
1467
+ export declare const useToast: () => {
1468
+ success: (body: string) => void;
1469
+ error: (body: string) => void;
1470
+ info: (body: string) => void;
1471
+ warning: (body: string) => void;
1472
+ };
1473
+
1350
1474
  export { }