@devtron-labs/devtron-fe-common-lib 0.0.51 → 0.0.52-beta-2

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.
Files changed (31) hide show
  1. package/dist/Common/Constants.d.ts +5 -0
  2. package/dist/Common/CustomInput/CustomInput.d.ts +1 -1
  3. package/dist/Common/CustomInput/Types.d.ts +1 -0
  4. package/dist/Common/DraggableWrapper/DraggableButton.d.ts +3 -0
  5. package/dist/Common/DraggableWrapper/DraggableWrapper.d.ts +9 -0
  6. package/dist/Common/DraggableWrapper/index.d.ts +3 -0
  7. package/dist/Common/DraggableWrapper/types.d.ts +23 -0
  8. package/dist/Common/EmptyState/GenericEmptyState.d.ts +1 -1
  9. package/dist/Common/Grid/Grid.d.ts +1 -1
  10. package/dist/Common/Grid/types.d.ts +2 -2
  11. package/dist/Common/Hooks/UseWindowSize/UseWindowSize.d.ts +4 -0
  12. package/dist/Common/Hooks/index.d.ts +1 -0
  13. package/dist/Common/Types.d.ts +1 -0
  14. package/dist/Common/index.d.ts +1 -0
  15. package/dist/index.js +286 -140
  16. package/package.json +3 -2
  17. package/src/Assets/Icon/ic-drag.svg +8 -0
  18. package/src/Common/Constants.ts +7 -1
  19. package/src/Common/CustomInput/CustomInput.tsx +3 -2
  20. package/src/Common/CustomInput/Types.ts +1 -0
  21. package/src/Common/DraggableWrapper/DraggableButton.tsx +14 -0
  22. package/src/Common/DraggableWrapper/DraggableWrapper.tsx +116 -0
  23. package/src/Common/DraggableWrapper/index.ts +3 -0
  24. package/src/Common/DraggableWrapper/types.ts +27 -0
  25. package/src/Common/EmptyState/GenericEmptyState.tsx +45 -13
  26. package/src/Common/Grid/Grid.tsx +7 -2
  27. package/src/Common/Grid/types.ts +3 -1
  28. package/src/Common/Hooks/UseWindowSize/UseWindowSize.tsx +31 -0
  29. package/src/Common/Hooks/index.ts +1 -0
  30. package/src/Common/Types.ts +1 -0
  31. package/src/Common/index.ts +1 -0
@@ -64,3 +64,8 @@ export declare const RepositoryAction: {
64
64
  CHART_PULL: string;
65
65
  CHART_PUSH: string;
66
66
  };
67
+ export declare enum APPROVAL_MODAL_TYPE {
68
+ CONFIG = "CONFIG",
69
+ DEPLOYMENT = "DEPLOYMENT"
70
+ }
71
+ export declare const MAX_Z_INDEX = 2147483647;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { CustomInputProps } from './Types';
3
- export declare function CustomInput({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, helperText, handleOnBlur, readOnly, noTrim, ref, onKeyPress, defaultValue, onKeyDown, required, additionalErrorInfo }: CustomInputProps): JSX.Element;
3
+ export declare function CustomInput({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, helperText, handleOnBlur, readOnly, noTrim, ref, onKeyPress, defaultValue, onKeyDown, required, additionalErrorInfo, inputWrapClassName, }: CustomInputProps): JSX.Element;
@@ -26,4 +26,5 @@ export interface CustomInputProps {
26
26
  onKeyDown?: (e: any) => void;
27
27
  required?: boolean;
28
28
  additionalErrorInfo?: React.ReactNode;
29
+ inputWrapClassName?: string;
29
30
  }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { DraggableButtonProps } from './types';
3
+ export default function DraggableButton({ dragClassName }: DraggableButtonProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { DraggableWrapperProps } from './types';
3
+ /**
4
+ * TODO: import it as lazy, after it is supported in common
5
+ * 1. If using react select please use menuPlacement='auto'
6
+ * 2. dragSelector will be used to identify the grabbable button that will grab the div to drag
7
+ * 3. parentRef is the reference point from which we will derive the base top:0 ,left: 0 position
8
+ */
9
+ export default function DraggableWrapper({ children, zIndex, positionVariant, dragSelector, parentRef, boundaryGap, childDivProps, }: DraggableWrapperProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { default as DraggableWrapper } from './DraggableWrapper';
2
+ export { default as DraggableButton } from './DraggableButton';
3
+ export * from './types';
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes, ReactNode, RefObject } from 'react';
2
+ export declare enum DraggablePositionVariant {
3
+ PARENT_BOTTOM_CENTER = "PARENT_BOTTOM_CENTER",
4
+ SCREEN_BOTTOM_CENTER = "SCREEN_BOTTOM_CENTER"
5
+ }
6
+ export interface DraggableWrapperProps {
7
+ children: ReactNode;
8
+ zIndex?: number;
9
+ positionVariant?: DraggablePositionVariant;
10
+ /**
11
+ * dragSelector (class - (append with .), id, etc) will be used to identify the grabbable button that will grab the div to drag
12
+ */
13
+ dragSelector: string;
14
+ parentRef?: RefObject<HTMLDivElement>;
15
+ boundaryGap?: number;
16
+ childDivProps?: HTMLAttributes<HTMLDivElement>;
17
+ }
18
+ /**
19
+ * dragClassName is the class that we feed to Draggable to identify dragging buttons
20
+ */
21
+ export interface DraggableButtonProps {
22
+ dragClassName: string;
23
+ }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { GenericEmptyStateType } from '../Types';
3
3
  import './emptyState.scss';
4
- declare function GenericEmptyState({ title, image, subTitle, isButtonAvailable, classname, styles, heightToDeduct, imageType, renderButton, imageClassName, children, SvgImage, noImage, layout, contentClassName }: GenericEmptyStateType): JSX.Element;
4
+ declare function GenericEmptyState({ title, image, subTitle, isButtonAvailable, classname, styles, heightToDeduct, imageType, renderButton, imageClassName, children, SvgImage, noImage, layout, contentClassName, imageStyles, }: GenericEmptyStateType): JSX.Element;
5
5
  export default GenericEmptyState;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { GridProps } from './types';
3
- export default function Grid({ container, spacing, item, xs, containerClass, itemClass, children, }: GridProps): JSX.Element;
3
+ export default function Grid({ container, spacing, item, xs, containerClass, itemClass, children, ...containerDivProps }: GridProps): JSX.Element;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
- export interface GridProps {
1
+ import { HTMLAttributes } from 'react';
2
+ export interface GridProps extends HTMLAttributes<HTMLDivElement> {
3
3
  container?: boolean;
4
4
  spacing?: number;
5
5
  item?: boolean;
@@ -0,0 +1,4 @@
1
+ export declare const useWindowSize: () => {
2
+ width: number;
3
+ height: number;
4
+ };
@@ -1,2 +1,3 @@
1
1
  export { useSuperAdmin } from './UseSuperAdmin/UseSuperAdmin';
2
2
  export { useClickOutside } from './UseClickOutside/UseClickOutside';
3
+ export { useWindowSize } from './UseWindowSize/UseWindowSize';
@@ -87,6 +87,7 @@ export interface GenericEmptyStateType {
87
87
  imageClassName?: string;
88
88
  children?: ReactNode;
89
89
  noImage?: boolean;
90
+ imageStyles?: CSSProperties;
90
91
  /**
91
92
  * @default 'column'
92
93
  */
@@ -45,3 +45,4 @@ export * from './DevtronProgressing';
45
45
  export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSelector';
46
46
  export * from './AddCDButton';
47
47
  export * from './CustomInput';
48
+ export * from './DraggableWrapper';