@devtron-labs/devtron-fe-common-lib 1.1.5 → 1.1.6

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 (33) hide show
  1. package/dist/Common/Hooks/UseRegisterShortcut/types.d.ts +2 -1
  2. package/dist/Common/Hooks/UseRegisterShortcut/utils.d.ts +1 -1
  3. package/dist/Common/RJSF/Form.d.ts +1 -1
  4. package/dist/Shared/Components/Backdrop/Backdrop.d.ts +3 -0
  5. package/dist/Shared/Components/Backdrop/index.d.ts +1 -0
  6. package/dist/Shared/Components/Backdrop/types.d.ts +8 -0
  7. package/dist/Shared/Components/ConfirmationModal/ConfirmationModal.d.ts +3 -0
  8. package/dist/Shared/Components/ConfirmationModal/index.d.ts +2 -0
  9. package/dist/Shared/Components/ConfirmationModal/types.d.ts +50 -0
  10. package/dist/Shared/Components/ConfirmationModal/utils.d.ts +6 -0
  11. package/dist/Shared/Components/index.d.ts +1 -0
  12. package/dist/Shared/Helpers.d.ts +2 -1
  13. package/dist/Shared/constants.d.ts +1 -0
  14. package/dist/Shared/types.d.ts +4 -0
  15. package/dist/assets/index.css +1 -1
  16. package/dist/{cssMode-BsTjp5T1.js → cssMode-Cywx60WQ.js} +1 -1
  17. package/dist/{freemarker2-DJtqwgcS.js → freemarker2-CzZfJAkX.js} +1 -1
  18. package/dist/{handlebars-A27t-Ka7.js → handlebars-CdFn-eHm.js} +1 -1
  19. package/dist/{html-oZx5D2e1.js → html-Cwh4XeU8.js} +1 -1
  20. package/dist/{htmlMode-BbYfuAfq.js → htmlMode-DrL1oAbZ.js} +1 -1
  21. package/dist/{index-Bqp36Zxu.js → index-jPZQLd6G.js} +38502 -34296
  22. package/dist/index.js +530 -526
  23. package/dist/{javascript-7Ns1hZ1u.js → javascript-DlXgi9Zu.js} +1 -1
  24. package/dist/{jsonMode-CSHwDjDg.js → jsonMode-DEzFcWqt.js} +1 -1
  25. package/dist/{liquid-CJAHXY0w.js → liquid-CPnweO-U.js} +1 -1
  26. package/dist/{mdx-vt9h9Xpz.js → mdx-CUaMzuXo.js} +1 -1
  27. package/dist/{python-CnibeM_K.js → python-Bi5K3H4h.js} +1 -1
  28. package/dist/{razor-BWWjrM8Q.js → razor-DLqI_T6g.js} +1 -1
  29. package/dist/{tsMode-Ddl20Rd2.js → tsMode-BS3ALMDD.js} +1 -1
  30. package/dist/{typescript-DJik4e7z.js → typescript-Dddw9oJF.js} +1 -1
  31. package/dist/{xml-D3mR990w.js → xml-CTCG7vE0.js} +1 -1
  32. package/dist/{yaml-IjO78BY4.js → yaml-kznnmcwr.js} +1 -1
  33. package/package.json +2 -1
@@ -3,11 +3,12 @@ export declare const KEYBOARD_KEYS_MAP: {
3
3
  readonly Shift: "⇧";
4
4
  readonly Meta: "⌘" | "Win";
5
5
  readonly Alt: "⌥" | "Alt";
6
- readonly Escape: "Escape";
7
6
  readonly F: "F";
8
7
  readonly E: "E";
9
8
  readonly R: "R";
10
9
  readonly K: "K";
10
+ readonly Escape: "Escape";
11
+ readonly Enter: "Enter";
11
12
  };
12
13
  export type SupportedKeyboardKeysType = keyof typeof KEYBOARD_KEYS_MAP;
13
14
  export interface ShortcutType {
@@ -1,6 +1,6 @@
1
1
  import { ShortcutType } from './types';
2
2
  export declare const preprocessKeys: (keys: ShortcutType["keys"]) => {
3
- keys: ("Alt" | "Escape" | "F" | "E" | "R" | "K" | "Control" | "Shift" | "Meta")[];
3
+ keys: ("Alt" | "F" | "E" | "R" | "K" | "Escape" | "Enter" | "Control" | "Shift" | "Meta")[];
4
4
  id: string;
5
5
  };
6
6
  export declare const verifyCallbackStack: (stack: ShortcutType["callbackStack"]) => void;
@@ -1,3 +1,3 @@
1
1
  import { default as RJSF } from '@rjsf/core';
2
2
  import { FormProps } from './types';
3
- export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "children" | "className" | "disabled" | "id" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "tagName" | "autoComplete" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "method" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
3
+ export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "children" | "className" | "disabled" | "id" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "tagName" | "autoComplete" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
@@ -0,0 +1,3 @@
1
+ import { BackdropProps } from './types';
2
+ declare const Backdrop: ({ children, onEscape }: BackdropProps) => import('react').ReactPortal;
3
+ export default Backdrop;
@@ -0,0 +1 @@
1
+ export { default as Backdrop } from './Backdrop';
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ export interface BackdropProps {
3
+ children: ReactNode;
4
+ /**
5
+ * @param onEscape: please wrap in a useCallback, with respective dependencies or []
6
+ */
7
+ onEscape: () => void;
8
+ }
@@ -0,0 +1,3 @@
1
+ import { ConfirmationModalProps } from './types';
2
+ declare const WrapWithShortcutProvider: (props: ConfirmationModalProps) => JSX.Element;
3
+ export default WrapWithShortcutProvider;
@@ -0,0 +1,2 @@
1
+ export { default as ConfirmationModal } from './ConfirmationModal';
2
+ export { ConfirmationModalVariantType } from './types';
@@ -0,0 +1,50 @@
1
+ import { FunctionComponent, ReactNode, SVGProps, SyntheticEvent } from 'react';
2
+ import { ButtonProps } from '../Button';
3
+ export declare enum ConfirmationModalVariantType {
4
+ info = "info",
5
+ delete = "delete",
6
+ warning = "warning",
7
+ custom = "custom"
8
+ }
9
+ interface CommonButtonProps extends Pick<ButtonProps, 'text'>, Partial<Pick<ButtonProps, 'startIcon' | 'endIcon'>> {
10
+ onClick: (e?: SyntheticEvent) => void;
11
+ }
12
+ interface CustomInputConfig {
13
+ identifier: string;
14
+ confirmationKeyword: string;
15
+ }
16
+ type ButtonConfig<PrimaryButtonConfig, SecondaryButtonConfig> = {
17
+ primaryButtonConfig: PrimaryButtonConfig & CommonButtonProps;
18
+ secondaryButtonConfig: SecondaryButtonConfig & CommonButtonProps;
19
+ } | {
20
+ primaryButtonConfig: PrimaryButtonConfig & CommonButtonProps;
21
+ secondaryButtonConfig?: never;
22
+ } | {
23
+ primaryButtonConfig?: never;
24
+ secondaryButtonConfig?: SecondaryButtonConfig & CommonButtonProps;
25
+ };
26
+ type CustomInputConfigOrChildrenType = {
27
+ customInputConfig: CustomInputConfig;
28
+ children?: never;
29
+ } | {
30
+ customInputConfig?: never;
31
+ children: ReactNode;
32
+ } | {
33
+ customInputConfig?: never;
34
+ children?: never;
35
+ };
36
+ export type ConfirmationModalProps = {
37
+ title: string;
38
+ subtitle: ReactNode;
39
+ handleClose: (e?: SyntheticEvent) => void;
40
+ showConfirmationModal: boolean;
41
+ } & ({
42
+ variant: Exclude<ConfirmationModalVariantType, ConfirmationModalVariantType.custom>;
43
+ Icon?: never;
44
+ buttonConfig: ButtonConfig<Pick<ButtonProps, 'isLoading' | 'disabled'>, Pick<ButtonProps, 'disabled'>>;
45
+ } | {
46
+ variant: ConfirmationModalVariantType.custom;
47
+ Icon: FunctionComponent<SVGProps<SVGSVGElement>>;
48
+ buttonConfig: ButtonConfig<Pick<ButtonProps, 'isLoading' | 'disabled' | 'style'>, Pick<ButtonProps, 'disabled' | 'style'>>;
49
+ }) & CustomInputConfigOrChildrenType;
50
+ export {};
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent, ReactNode, SVGProps } from 'react';
2
+ import { ConfirmationModalVariantType } from './types';
3
+ import { ButtonStyleType } from '../Button';
4
+ export declare const getIconFromVariant: (variant: ConfirmationModalVariantType) => FunctionComponent<SVGProps<SVGSVGElement>>;
5
+ export declare const getConfirmationLabel: (confirmationKeyword: string) => ReactNode;
6
+ export declare const getPrimaryButtonStyleFromVariant: (variant: ConfirmationModalVariantType) => ButtonStyleType;
@@ -41,4 +41,5 @@ export * from './Collapse';
41
41
  export * from './Security';
42
42
  export * from './Button';
43
43
  export * from './InvalidYAMLTippy';
44
+ export * from './ConfirmationModal';
44
45
  export * from './DiffViewer';
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
2
2
  import { Pair } from 'yaml';
3
3
  import { MaterialHistoryType } from '@Shared/Services/app.types';
4
4
  import { MaterialInfo, SortingOrder, UserApprovalConfigType } from '../Common';
5
- import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, WebhookEventNameType } from './types';
5
+ import { GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, WebhookEventNameType } from './types';
6
6
  import { AggregatedNodes, DeploymentStatusDetailsBreakdownDataType, DeploymentStatusDetailsType, PodMetadatum } from './Components';
7
7
  interface HighlightSearchTextProps {
8
8
  /**
@@ -21,6 +21,7 @@ interface HighlightSearchTextProps {
21
21
  export declare const escapeRegExp: (text: string) => string;
22
22
  export declare const highlightSearchText: ({ searchText, text, highlightClasses }: HighlightSearchTextProps) => string;
23
23
  export declare const preventBodyScroll: (lock: boolean) => void;
24
+ export declare const preventOutsideFocus: ({ identifier, preventFocus }: PreventOutsideFocusProps) => void;
24
25
  export declare const getIsMaterialInfoAvailable: (materialInfo: MaterialInfo[]) => boolean;
25
26
  export declare const getGitCommitInfo: (materialInfo: MaterialInfo) => GitTriggers;
26
27
  export declare const stringComparatorBySortOrder: (a: string, b: string, sortOrder?: SortingOrder, isCaseSensitive?: boolean) => number;
@@ -417,3 +417,4 @@ export declare const ALL_RESOURCE_KIND_FILTER = "all";
417
417
  export declare const OPEN_NEW_TICKET = "https://enterprise.devtron.ai/portal/en/newticket";
418
418
  export declare const VIEW_ALL_TICKETS = "https://enterprise.devtron.ai/portal/en/myarea";
419
419
  export declare const RAISE_ISSUE = "https://github.com/devtron-labs/devtron/issues/new/choose";
420
+ export declare const DEVTRON_BASE_MAIN_ID = "devtron-base-main-identifier";
@@ -735,4 +735,8 @@ export interface DynamicTabType extends CommonTabArgsType {
735
735
  */
736
736
  lastActiveTabId: string | null;
737
737
  }
738
+ export interface PreventOutsideFocusProps {
739
+ identifier: string;
740
+ preventFocus: boolean;
741
+ }
738
742
  export {};