@ambuj.bhaskar/react-component-library 0.24.21-alpha → 0.25.1-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,7 +1,9 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { default as default_2 } from 'react';
3
3
  import { Dispatch } from 'react';
4
+ import { DropdownProps as DropdownProps_2 } from 'antd';
4
5
  import { JSX as JSX_2 } from 'react/jsx-runtime';
6
+ import { MenuProps as MenuProps_2 } from 'antd';
5
7
  import { PopoverProps as PopoverProps_2 } from 'antd';
6
8
  import { RangePickerProps } from 'antd/es/date-picker';
7
9
  import * as React_2 from 'react';
@@ -138,44 +140,6 @@ export declare type AnnotationType = "rectangle" | "circle" | "polygon" | "dot";
138
140
 
139
141
  declare function areAllValuesEmpty(obj: any): boolean;
140
142
 
141
- export declare const AWI_ALL_GLOBALS: {
142
- MAX_TOASTS_COUNT: number;
143
- DISPLAY_SEARCH_MINIMUM_RECORDS: number;
144
- SAM_MODEL_NAME: string;
145
- SAM_MODEL_CONFIDENCE: number;
146
- SAM_MODEL_MAX_RESULTS: number;
147
- SAM_MODEL_MAX_RESULTS_MIN: number;
148
- SAM_MODEL_MAX_RESULTS_MAX: number;
149
- SAM_MODEL_DATA: {
150
- awi_id: string;
151
- awi_label: string;
152
- value: string;
153
- }[];
154
- INITIAL_ZOOM_PROPERTIES: {
155
- scale: number;
156
- x: number;
157
- y: number;
158
- };
159
- INITIAL_ZOOM_LEVEL: number;
160
- HOVER_TO_SELECT_ON_ALREADY_SELECTED: boolean;
161
- DEFAULT_CANVAS_RATION: {
162
- w: number;
163
- h: number;
164
- };
165
- MAX_ANNOTATIONS_TO_HOVER: number;
166
- TWO_PIE: number;
167
- POLYGON_POINT_REMOVE_CONFIRM_PROMPT: boolean;
168
- MAX_ANNOTATIONS_TO_RUN_FAST: number;
169
- STATUS_COLOR_MAP: Record<string, string>;
170
- };
171
-
172
- /**
173
- * File for handling and returning background images
174
- */
175
- export declare const AWI_IMAGE_VALIDITY_HELPER: {
176
- checkImageValidity: (url: string, setBackgroundImage: any, contentKey: string | undefined, annotationViewType: string | undefined, fallbackImageUrl: any, defaultImage?: string) => Promise<void>;
177
- };
178
-
179
143
  export declare const AwiAnnotationHotkeys: default_2.FC<AwiAnnotationHotkeysProps>;
180
144
 
181
145
  export declare type AwiAnnotationHotkeysProps = {
@@ -330,14 +294,6 @@ export declare type AwiEmptyStateProps = {
330
294
  stateTitle?: string;
331
295
  };
332
296
 
333
- export declare const AwiGenerateHeader: default_2.FC<AwiGenerateHeaderProps>;
334
-
335
- declare type AwiGenerateHeaderProps = {
336
- list: string[];
337
- headerClass?: string;
338
- type?: string;
339
- };
340
-
341
297
  export declare const AwiHelperMethods: {
342
298
  getStatusDisplayText: (status: string, user: any) => any;
343
299
  displayVersion: (branch: any, commitId: any, buildDate: any, buildNumber: any) => void;
@@ -702,13 +658,6 @@ export declare type ButtonProps = HTMLButtonProps & {
702
658
 
703
659
  declare type ButtonVariant = "primary" | "secondary" | "tertiary" | "nav";
704
660
 
705
- declare function calculateCentroid(coordinates: any): {
706
- x: number;
707
- y: number;
708
- }[];
709
-
710
- declare function calculateCircleFromCoordinates(coordinates: any): any;
711
-
712
661
  declare function capitalizeFirstChar(str: any): any;
713
662
 
714
663
  export declare const Chart: React.FC<ChartProps>;
@@ -746,10 +695,14 @@ declare type ChartType = "line" | "bar" | "doughnut" | "pie";
746
695
  */
747
696
  declare function chunkArray<T>(arr: T[], chunkSize?: number): T[][];
748
697
 
749
- declare function clampValue(value: any, min: any, max: any): number;
750
-
751
698
  declare type Color = string;
752
699
 
700
+ declare type ColorStatesType = {
701
+ default: Color;
702
+ hover?: Color;
703
+ active?: Color;
704
+ };
705
+
753
706
  export declare const CompactEventCard: React.FC<CompactEventCardPropsType>;
754
707
 
755
708
  export declare type CompactEventCardPropsType = {
@@ -854,6 +807,63 @@ export declare type DetectionCarouselProps = {
854
807
  data: BlobType[];
855
808
  };
856
809
 
810
+ export declare const Dropdown: default_2.FC<DropdownProps>;
811
+
812
+ export declare interface DropdownProps extends Omit<DropdownProps_2, "style" | "className"> {
813
+ /**
814
+ * Custom CSS class name
815
+ */
816
+ className?: string;
817
+ /**
818
+ * Custom style object
819
+ */
820
+ style?: React.CSSProperties;
821
+ /**
822
+ * The content to trigger the dropdown
823
+ */
824
+ children?: ReactNode;
825
+ /**
826
+ * Theme configuration for the dropdown
827
+ * Pass simple color and style properties, component handles the rest internally
828
+ */
829
+ theme?: DropdownTheme;
830
+ }
831
+
832
+ export declare interface DropdownTheme {
833
+ /**
834
+ * Button styling
835
+ */
836
+ button?: {
837
+ backgroundColor?: string;
838
+ borderColor?: string;
839
+ color?: string;
840
+ hoverBackgroundColor?: string;
841
+ hoverBorderColor?: string;
842
+ hoverColor?: string;
843
+ };
844
+ /**
845
+ * Menu styling
846
+ */
847
+ menu?: {
848
+ backgroundColor?: string;
849
+ borderColor?: string;
850
+ borderRadius?: string;
851
+ boxShadow?: string;
852
+ /**
853
+ * Menu items styling
854
+ */
855
+ item?: {
856
+ color?: string;
857
+ backgroundColor?: string;
858
+ hoverColor?: string;
859
+ hoverBackgroundColor?: string;
860
+ selectedColor?: string;
861
+ selectedBackgroundColor?: string;
862
+ disabledColor?: string;
863
+ };
864
+ };
865
+ }
866
+
857
867
  declare type EventElement = "app" | "source" | "severity" | "date" | "time";
858
868
 
859
869
  export declare const EventPreview: React.FC<EventPreviewProps>;
@@ -1085,74 +1095,18 @@ export declare type MapViewProps = {
1085
1095
  onFocusedIndexChange?: (index: number) => void;
1086
1096
  };
1087
1097
 
1088
- export declare const MathAnnotationHelper: {
1089
- gcd: any;
1090
- getDistance: (x1: number, y1: number, x2: number, y2: number) => number;
1091
- isLeft: (P0: any, P1: any, P2: any) => number;
1092
- windingNumber: (P: any, polygon: any, sensitivity?: number) => number;
1093
- getDiameter: (coords: {
1094
- x: number;
1095
- y: number;
1096
- }[]) => number;
1097
- checkPointInsidePolygon: (x: number, y: number, polygon: any, pos_sensitivity: number, neg_sensitivity: number, request: any, scale?: number) => boolean;
1098
- isAnnotationCoordinatesValid: (request: any, coords: {
1099
- x: number;
1100
- y: number;
1101
- }[], usingSamFunction?: boolean, scale?: number) => boolean;
1102
- distanceToSegment: (px: any, py: any, x1: any, y1: any, x2: any, y2: any) => number;
1103
- findClosestSegment: (polygon: any, px: any, py: any) => {
1104
- insertIndex: number;
1105
- minDistance: number;
1106
- };
1107
- transformCoordinatesCheck: (newXTransform: any, newYTransform: any, widthIncreased: any, heightIncreased: any) => {
1108
- newXTransform: any;
1109
- newYTransform: any;
1110
- };
1111
- getBoundingBox: (points: any) => {
1112
- x: number;
1113
- y: number;
1114
- }[];
1115
- translateCoordinatesWithFixedWidth: typeof translateCoordinatesWithFixedWidth;
1116
- clampValue: typeof clampValue;
1117
- calculateCircleFromCoordinates: typeof calculateCircleFromCoordinates;
1118
- calculateCentroid: typeof calculateCentroid;
1119
- minDistanceToPolygon: (point: Point, polygon: Polygon) => number;
1120
- closestCoordinates: (point: Point, polygon: Polygon) => {
1121
- minDistance: number;
1122
- insertIndex: number;
1123
- };
1124
- fineTuneCoordinates: (coordinateList: any) => any;
1125
- zoomLevelValue: (value: any, scale: any) => number;
1126
- createPolygonLoop: (outline: {
1127
- x: number;
1128
- y: number;
1129
- }[]) => {
1130
- x: number;
1131
- y: number;
1132
- }[];
1133
- breakPointCount: (coordinate: any) => number;
1134
- getBoundingBoxValues: (points: Point[]) => {
1135
- minX: number;
1136
- minY: number;
1137
- maxX: number;
1138
- maxY: number;
1139
- };
1140
- shiftPolygon: typeof shiftPolygon;
1141
- getPerfectPointValue: (coordinatePoint?: number) => number;
1142
- adjustToCircle: (coords: any) => any;
1143
- getMousePos: (canvas: any, evt: any) => {
1144
- x: number;
1145
- y: number;
1146
- };
1147
- getMousePosAbsolute: (canvas: any, evt: any) => {
1148
- x: number;
1149
- y: number;
1150
- };
1151
- getUpdatedCoordinates: (canvasRef: any, event: any, initialCoords: any) => {
1152
- x: number;
1153
- y: number;
1154
- }[];
1155
- };
1098
+ export declare const Menu: default_2.FC<MenuProps>;
1099
+
1100
+ export declare interface MenuProps extends Omit<MenuProps_2, "style" | "className"> {
1101
+ /**
1102
+ * Custom CSS class name
1103
+ */
1104
+ className?: string;
1105
+ /**
1106
+ * Custom style object
1107
+ */
1108
+ style?: React.CSSProperties;
1109
+ }
1156
1110
 
1157
1111
  export declare interface MiniData {
1158
1112
  awi_id: number;
@@ -1161,15 +1115,6 @@ export declare interface MiniData {
1161
1115
  awi_creation?: Date;
1162
1116
  }
1163
1117
 
1164
- export declare const MockImageGenerationHelper: {
1165
- HARDCODED_FALL_BACK_IMAGE: string;
1166
- HARDCODED_FALL_BACK_BIG_IMAGE: string;
1167
- DEFAULT_AVATAR_IMAGE: string;
1168
- generateImageUrl: (url: string | undefined | null, _serverLink?: boolean) => string;
1169
- getImageKitUrl: (url: string, _width?: number, _height?: number, _q?: number) => string;
1170
- getUserAvatar: (user: any) => string;
1171
- };
1172
-
1173
1118
  export declare const Modal: default_2.FC<ModalProps>;
1174
1119
 
1175
1120
  export declare interface ModalButtonProps {
@@ -1242,16 +1187,6 @@ export declare type PaginationProps = {
1242
1187
  className?: string;
1243
1188
  };
1244
1189
 
1245
- /**
1246
- * Mathematics helpers for our system, majorly for annotations
1247
- */
1248
- declare type Point = {
1249
- x: number;
1250
- y: number;
1251
- };
1252
-
1253
- declare type Polygon = Point[];
1254
-
1255
1190
  export declare const Popover: React.FC<PopoverProps>;
1256
1191
 
1257
1192
  export declare type PopoverProps = PopoverProps_2 & {
@@ -1322,18 +1257,8 @@ export declare type SelectProps = {
1322
1257
  textSize?: "xs" | "s" | "m" | "l" | "xl";
1323
1258
  };
1324
1259
 
1325
- declare function shiftPolygon(polygon: any): any;
1326
-
1327
1260
  export declare type ShowAnnotationStatus = "approved" | "rejected" | "pending" | "corrected" | "all";
1328
1261
 
1329
- export declare const showToast: ({ type, title, body, }: ShowToastType) => void;
1330
-
1331
- declare type ShowToastType = {
1332
- type: ToastType;
1333
- title?: string;
1334
- body?: string;
1335
- };
1336
-
1337
1262
  export declare const Sidebar: React.FC<SidebarProps>;
1338
1263
 
1339
1264
  export declare type SidebarConfig = {
@@ -1487,17 +1412,23 @@ declare type ToastProps = {
1487
1412
  onClose?: () => void;
1488
1413
  };
1489
1414
 
1490
- export declare const ToastProvider: () => JSX_2.Element;
1491
-
1492
1415
  declare type ToastType = "success" | "error" | "info" | "warning";
1493
1416
 
1417
+ export declare const Topbar: React.FC<TopbarProps>;
1418
+
1419
+ export declare type TopbarProps = {
1420
+ title?: string;
1421
+ width?: CSSstring;
1422
+ height?: CSSstring;
1423
+ style?: React.CSSProperties;
1424
+ className?: string;
1425
+ };
1426
+
1494
1427
  export declare type TPositionType = {
1495
1428
  lat: number;
1496
1429
  lng: number;
1497
1430
  };
1498
1431
 
1499
- declare function translateCoordinatesWithFixedWidth(coordinates: any, shiftAmount?: number, targetCoordinate?: any): any;
1500
-
1501
1432
  export declare function usePagination(initialPage?: number, initialTotalPages?: number): {
1502
1433
  currentPage: number;
1503
1434
  setPage: (newPage: number) => void;
@@ -1507,6 +1438,14 @@ export declare function usePagination(initialPage?: number, initialTotalPages?:
1507
1438
  setTotalPages: Dispatch<SetStateAction<number>>;
1508
1439
  };
1509
1440
 
1441
+ export declare const usePointerState: () => {
1442
+ pointerState: keyof ColorStatesType;
1443
+ pointerEnter: () => void;
1444
+ pointerLeave: () => void;
1445
+ pointerDown: () => void;
1446
+ pointerUp: () => void;
1447
+ };
1448
+
1510
1449
  export declare const useResize: () => {
1511
1450
  width: number;
1512
1451
  height: number;