@devtron-labs/devtron-fe-common-lib 1.14.2 → 1.15.0-pre-1
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/{@code-editor-CVEmKqGD.js → @code-editor-DvZpSk1w.js} +10620 -10502
- package/dist/{@common-rjsf-C9V3H0_L.js → @common-rjsf-CU7Pvd3W.js} +222 -230
- package/dist/{@framer-motion-eB9Rj-_8.js → @framer-motion-Dchiw-Rb.js} +3 -3
- package/dist/{@react-dates-CJpoumtu.js → @react-dates-D5kydtW-.js} +1 -1
- package/dist/{@react-select-CUbAbK6L.js → @react-select-Cmser7OI.js} +6 -6
- package/dist/{@react-virtualized-sticky-tree-Ckb5S1RC.js → @react-virtualized-sticky-tree-DMnFy9PE.js} +1 -1
- package/dist/{@vendor-4cEd9dja.js → @vendor-STJ9h0oI.js} +14016 -15910
- package/dist/Common/Constants.d.ts +4 -11
- package/dist/Common/RJSF/widgets/Checkbox.d.ts +1 -1
- package/dist/Common/SegmentedControl/Segment.d.ts +1 -1
- package/dist/Common/SegmentedControl/types.d.ts +3 -2
- package/dist/Common/TippyCustomized.d.ts +1 -1
- package/dist/Common/Types.d.ts +8 -48
- package/dist/Common/index.d.ts +0 -2
- package/dist/Shared/Components/ActionMenu/types.d.ts +31 -4
- package/dist/Shared/Components/ActionMenu/useActionMenu.hook.d.ts +4 -2
- package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
- package/dist/Shared/Components/Button/constants.d.ts +1 -0
- package/dist/Shared/Components/Button/types.d.ts +14 -1
- package/dist/Shared/Components/Button/utils.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/types.d.ts +0 -1
- package/dist/Shared/Components/CodeEditor/CodeEditor.d.ts +1 -1
- package/dist/Shared/Components/CodeEditor/CodeEditorRenderer.d.ts +1 -1
- package/dist/Shared/Components/CodeEditor/Extensions/findAndReplace.d.ts +2 -1
- package/dist/Shared/Components/CodeEditor/types.d.ts +14 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +0 -2
- package/dist/Shared/Components/DocLink/DocLink.d.ts +2 -0
- package/dist/Shared/Components/DocLink/constants.d.ts +94 -0
- package/dist/Shared/Components/DocLink/index.d.ts +4 -0
- package/dist/Shared/Components/DocLink/types.d.ts +18 -0
- package/dist/Shared/Components/DocLink/utils.d.ts +2 -0
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTable.d.ts +1 -1
- package/dist/Shared/Components/DynamicDataTable/DynamicDataTableRow.d.ts +1 -1
- package/dist/Shared/Components/DynamicDataTable/types.d.ts +8 -4
- package/dist/Shared/Components/FeatureDescription/types.d.ts +2 -1
- package/dist/Shared/Components/FramerComponents/index.d.ts +2 -3
- package/dist/Shared/Components/GenericInfoCard/GenericInfoCardListing.d.ts +2 -0
- package/dist/Shared/Components/GenericInfoCard/GenericInfoListSkeleton.d.ts +2 -0
- package/dist/Shared/Components/GenericInfoCard/index.d.ts +3 -1
- package/dist/Shared/Components/GenericInfoCard/types.d.ts +13 -0
- package/dist/Shared/Components/Header/ProfileMenu.d.ts +2 -0
- package/dist/Shared/Components/Header/types.d.ts +8 -8
- package/dist/Shared/Components/Header/utils.d.ts +0 -2
- package/dist/Shared/Components/Icon/Icon.d.ts +9 -0
- package/dist/Shared/Components/InfoIconTippy/InfoIconTippy.d.ts +1 -1
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.component.d.ts +1 -1
- package/dist/Shared/Components/KeyValueTable/KeyValueTable.types.d.ts +1 -1
- package/dist/Shared/Components/ModalSidebarPanel/types.d.ts +2 -1
- package/dist/Shared/Components/NumbersCount/index.d.ts +1 -0
- package/dist/Shared/Components/Popover/Popover.component.d.ts +1 -1
- package/dist/Shared/Components/Popover/types.d.ts +5 -3
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
- package/dist/Shared/Components/Switch/Switch.component.d.ts +3 -0
- package/dist/Shared/Components/Switch/constants.d.ts +14 -0
- package/dist/Shared/Components/Switch/index.d.ts +2 -0
- package/dist/Shared/Components/Switch/types.d.ts +111 -0
- package/dist/Shared/Components/Switch/utils.d.ts +12 -0
- package/dist/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.d.ts +1 -1
- package/dist/Shared/Components/ThemeSwitcher/index.d.ts +0 -1
- package/dist/Shared/Components/ThemeSwitcher/types.d.ts +1 -1
- package/dist/Shared/Components/ToggleResolveScopedVariables/ToggleResolveScopedVariables.component.d.ts +1 -1
- package/dist/Shared/Components/ToggleResolveScopedVariables/types.d.ts +1 -1
- package/dist/Shared/Components/index.d.ts +2 -1
- package/dist/Shared/Helpers.d.ts +1 -0
- package/dist/Shared/Providers/index.d.ts +1 -1
- package/dist/Shared/Providers/types.d.ts +20 -0
- package/dist/Shared/constants.d.ts +1 -0
- package/dist/Shared/types.d.ts +25 -0
- package/dist/Shared/validations.d.ts +1 -0
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/empty-create.661d9355.png +0 -0
- package/dist/assets/ic-app-template.82736707.svg +23 -0
- package/dist/assets/ic-asterisk.ab224e72.svg +3 -0
- package/dist/assets/ic-devtron-app.a8b688d3.svg +23 -0
- package/dist/assets/ic-devtron-job.1b216232.svg +10 -0
- package/dist/assets/ic-email.78fed574.svg +3 -0
- package/dist/assets/ic-key-enter.59d23056.svg +3 -0
- package/dist/assets/ic-spray-can.624b202a.svg +3 -0
- package/dist/assets/ic-world-globe.877fa6a0.svg +3 -0
- package/dist/index.js +794 -787
- package/package.json +1 -2
- package/dist/Common/InfoColorBar/InfoColourbar.d.ts +0 -6
- package/dist/Common/Toggle/Toggle.d.ts +0 -18
- package/dist/Shared/Components/DiffViewer/DiffViewer.component.d.ts +0 -41
- package/dist/Shared/Components/DiffViewer/constants.d.ts +0 -2
- package/dist/Shared/Components/DiffViewer/index.d.ts +0 -1
- package/dist/Shared/Components/DiffViewer/types.d.ts +0 -9
- package/dist/Shared/Components/FramerComponents/MotionDiv.d.ts +0 -2
- package/dist/Shared/Components/LogoutCard.d.ts +0 -10
- package/dist/assets/ic-arrow-square-out.3d1a0d41.svg +0 -19
@@ -1,5 +1,8 @@
|
|
1
1
|
import { MouseEventHandler, ReactElement } from 'react';
|
2
2
|
import { LinkProps } from 'react-router-dom';
|
3
|
+
import { GenericFilterEmptyStateProps } from '@Common/EmptyState/types';
|
4
|
+
import { GenericEmptyStateType } from '../../../Common/Types';
|
5
|
+
import { APIResponseHandlerProps } from '../APIResponseHandler';
|
3
6
|
type BaseGenericInfoCardProps = {
|
4
7
|
title: string;
|
5
8
|
description: string;
|
@@ -23,4 +26,14 @@ export type GenericInfoCardProps = {
|
|
23
26
|
} & Partial<Record<keyof BaseGenericInfoCardProps, never>>) | ({
|
24
27
|
isLoading?: boolean;
|
25
28
|
} & BaseGenericInfoCardProps));
|
29
|
+
export interface GenericInfoCardListingProps extends Pick<GenericInfoCardProps, 'borderVariant'>, Pick<GenericFilterEmptyStateProps, 'handleClearFilters'> {
|
30
|
+
list: (Pick<GenericInfoCardProps, 'Icon' | 'author' | 'description' | 'linkProps' | 'onClick' | 'title'> & Record<'id', string>)[];
|
31
|
+
emptyStateConfig: Pick<GenericEmptyStateType, 'title' | 'subTitle' | 'image' | 'renderButton' | 'renderButton'>;
|
32
|
+
searchKey?: string;
|
33
|
+
reloadList: () => void;
|
34
|
+
error?: APIResponseHandlerProps['error'];
|
35
|
+
isLoading?: boolean;
|
36
|
+
}
|
37
|
+
export interface GenericInfoListSkeletonProps extends Partial<Pick<GenericInfoCardProps, 'borderVariant'>> {
|
38
|
+
}
|
26
39
|
export {};
|
@@ -1,11 +1,7 @@
|
|
1
|
-
import { ModuleStatus } from '../../types';
|
1
|
+
import { InstallationType, ModuleStatus } from '../../types';
|
2
2
|
import { ResponseType, TippyCustomizedProps } from '../../../Common';
|
3
3
|
import { ActionMenuProps } from '../ActionMenu';
|
4
|
-
|
5
|
-
OSS_KUBECTL = "oss_kubectl",
|
6
|
-
OSS_HELM = "oss_helm",
|
7
|
-
ENTERPRISE = "enterprise"
|
8
|
-
}
|
4
|
+
import { DOCUMENTATION } from '../DocLink';
|
9
5
|
export interface PageHeaderType {
|
10
6
|
headerName?: string;
|
11
7
|
showTabs?: boolean;
|
@@ -17,9 +13,9 @@ export interface PageHeaderType {
|
|
17
13
|
showCloseButton?: boolean;
|
18
14
|
onClose?: () => void;
|
19
15
|
markAsBeta?: boolean;
|
20
|
-
tippyProps?: Pick<TippyCustomizedProps
|
16
|
+
tippyProps?: Pick<TippyCustomizedProps<false>, 'additionalContent'> & {
|
21
17
|
isTippyCustomized?: boolean;
|
22
|
-
tippyRedirectLink?:
|
18
|
+
tippyRedirectLink?: keyof typeof DOCUMENTATION;
|
23
19
|
TippyIcon?: React.FunctionComponent<any>;
|
24
20
|
tippyMessage?: string;
|
25
21
|
onClickTippyButton?: () => void;
|
@@ -52,3 +48,7 @@ export declare enum HelpMenuItems {
|
|
52
48
|
RAISE_ISSUE_REQUEST = "raise-issue-request"
|
53
49
|
}
|
54
50
|
export type HelpButtonActionMenuProps = ActionMenuProps<HelpMenuItems>;
|
51
|
+
export interface ProfileMenuProps {
|
52
|
+
user: string;
|
53
|
+
onClick?: () => void;
|
54
|
+
}
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import { DevtronLicenseInfo } from '../License';
|
2
1
|
import { HelpButtonActionMenuProps } from './types';
|
3
2
|
export declare const getDateInMilliseconds: (days: any) => number;
|
4
3
|
export declare const handlePostHogEventUpdate: (eventName: string) => Promise<void>;
|
5
4
|
export declare const setActionWithExpiry: (key: string, days: number) => void;
|
6
|
-
export declare const getIsShowingLicenseData: (licenseData: DevtronLicenseInfo) => boolean;
|
7
5
|
export declare const getHelpActionMenuOptions: ({ isEnterprise, isTrial, }: {
|
8
6
|
isEnterprise: boolean;
|
9
7
|
isTrial: boolean;
|
@@ -6,11 +6,13 @@ export declare const iconMap: {
|
|
6
6
|
'ic-amazon-eks': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
7
7
|
'ic-apica': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
8
8
|
'ic-app-group': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
9
|
+
'ic-app-template': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
9
10
|
'ic-arrow-clockwise': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
10
11
|
'ic-arrow-right': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
11
12
|
'ic-arrow-square-out': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
12
13
|
'ic-arrows-clockwise': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
13
14
|
'ic-arrows-left-right': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
15
|
+
'ic-asterisk': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
14
16
|
'ic-ather': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
15
17
|
'ic-azure-aks': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
16
18
|
'ic-azure': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
@@ -50,13 +52,16 @@ export declare const iconMap: {
|
|
50
52
|
'ic-delete-lightning': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
51
53
|
'ic-delete': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
52
54
|
'ic-delhivery': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
55
|
+
'ic-devtron-app': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
53
56
|
'ic-devtron-header-logo': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
57
|
+
'ic-devtron-job': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
54
58
|
'ic-devtron': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
55
59
|
'ic-disconnect': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
56
60
|
'ic-discord-fill': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
57
61
|
'ic-dockerhub': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
58
62
|
'ic-ecr': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
59
63
|
'ic-edit': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
64
|
+
'ic-email': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
60
65
|
'ic-enterprise-feat': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
61
66
|
'ic-enterprise-tag': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
62
67
|
'ic-env': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
@@ -100,6 +105,7 @@ export declare const iconMap: {
|
|
100
105
|
'ic-job-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
101
106
|
'ic-k3s': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
102
107
|
'ic-k8s-job': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
108
|
+
'ic-key-enter': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
103
109
|
'ic-key': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
104
110
|
'ic-kind': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
105
111
|
'ic-laptop': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
@@ -144,6 +150,7 @@ export declare const iconMap: {
|
|
144
150
|
'ic-sortable': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
145
151
|
'ic-sparkle-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
146
152
|
'ic-spinny': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
153
|
+
'ic-spray-can': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
147
154
|
'ic-stack': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
148
155
|
'ic-stamp': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
149
156
|
'ic-strategy-blue-green-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
@@ -172,8 +179,10 @@ export declare const iconMap: {
|
|
172
179
|
'ic-user-circle': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
173
180
|
'ic-user-key': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
174
181
|
'ic-users': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
182
|
+
'ic-view-variable-toggle': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
175
183
|
'ic-warning': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
176
184
|
'ic-wifi-slash': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
185
|
+
'ic-world-globe': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
177
186
|
};
|
178
187
|
export type IconName = keyof typeof iconMap;
|
179
188
|
export interface IconsProps extends Omit<IconBaseProps, 'name' | 'iconMap'> {
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { InfoIconTippyProps } from '../../../Common/Types';
|
2
|
-
declare const InfoIconTippy: ({ heading, infoText, iconClass, documentationLink, documentationLinkText, additionalContent, iconClassName, placement, dataTestid, children, headingInfo, buttonPadding, }: InfoIconTippyProps) => JSX.Element;
|
2
|
+
declare const InfoIconTippy: <T extends boolean = false>({ heading, infoText, iconClass, documentationLink, documentationLinkText, additionalContent, iconClassName, placement, dataTestid, children, headingInfo, buttonPadding, isExternalLink, openInNewTab, }: InfoIconTippyProps<T>) => JSX.Element;
|
3
3
|
export default InfoIconTippy;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { KeyValueTableProps } from './KeyValueTable.types';
|
2
|
-
export declare const KeyValueTable: ({ headerLabel, rows: initialRows, placeholder, maskValue, isSortable, headerComponent, onChange, isAdditionNotAllowed, readOnly, showError, validationSchema: parentValidationSchema, onError, validateDuplicateKeys, validateEmptyKeys, }: KeyValueTableProps) => JSX.Element;
|
2
|
+
export declare const KeyValueTable: ({ headerLabel, rows: initialRows, placeholder, maskValue, isSortable, headerComponent, onChange, isAdditionNotAllowed, shouldAutoFocusOnMount, readOnly, showError, validationSchema: parentValidationSchema, onError, validateDuplicateKeys, validateEmptyKeys, }: KeyValueTableProps) => JSX.Element;
|
@@ -55,7 +55,7 @@ export interface KeyValueTableData extends Pick<KeyValueTableRowType, 'id'> {
|
|
55
55
|
/**
|
56
56
|
* Props for the KeyValueTable component.
|
57
57
|
*/
|
58
|
-
export type KeyValueTableProps = Pick<DynamicDataTableProps<KeyValueTableDataType>, 'isAdditionNotAllowed' | 'readOnly' | 'headerComponent'> & {
|
58
|
+
export type KeyValueTableProps = Pick<DynamicDataTableProps<KeyValueTableDataType>, 'isAdditionNotAllowed' | 'readOnly' | 'headerComponent' | 'shouldAutoFocusOnMount'> & {
|
59
59
|
/**
|
60
60
|
* The label for the table header.
|
61
61
|
*/
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import { DocLinkProps } from '../DocLink';
|
2
3
|
export interface ModalSidebarPanelProps {
|
3
4
|
rootClassName?: string;
|
4
5
|
heading: string | null;
|
5
6
|
icon?: JSX.Element;
|
6
7
|
children?: ReactNode;
|
7
|
-
documentationLink:
|
8
|
+
documentationLink: DocLinkProps['docLinkKey'];
|
8
9
|
}
|
@@ -5,4 +5,4 @@ import { PopoverProps } from './types';
|
|
5
5
|
* @note Use this component in conjunction with the `usePopover` hook to create a custom popover component. \
|
6
6
|
* For example, see the `ActionMenu` component for reference.
|
7
7
|
*/
|
8
|
-
export declare const Popover: ({ open, popoverProps, overlayProps, triggerProps, buttonProps, triggerElement, children, }: PopoverProps) => JSX.Element;
|
8
|
+
export declare const Popover: ({ open, popoverProps, overlayProps, triggerProps: { bounds, ...triggerProps }, buttonProps, triggerElement, children, }: PopoverProps) => JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DetailedHTMLProps, KeyboardEvent, MutableRefObject, ReactElement } from 'react';
|
1
|
+
import { DetailedHTMLProps, KeyboardEvent, LegacyRef, MutableRefObject, ReactElement } from 'react';
|
2
2
|
import { HTMLMotionProps } from 'framer-motion';
|
3
3
|
import { ButtonProps } from '../Button';
|
4
4
|
export interface UsePopoverProps {
|
@@ -64,7 +64,9 @@ export interface UsePopoverReturnType {
|
|
64
64
|
* Props to be spread onto the trigger element that opens the popover.
|
65
65
|
* These props include standard HTML attributes for a `div` element.
|
66
66
|
*/
|
67
|
-
triggerProps: DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement
|
67
|
+
triggerProps: DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
68
|
+
bounds: Pick<DOMRect, 'left' | 'top' | 'height' | 'width'>;
|
69
|
+
};
|
68
70
|
/**
|
69
71
|
* Props to be spread onto the overlay element of the popover.
|
70
72
|
* These props include standard HTML attributes for a `div` element.
|
@@ -81,7 +83,7 @@ export interface UsePopoverReturnType {
|
|
81
83
|
* A mutable reference to the scrollable element inside the popover. \
|
82
84
|
* This reference should be assigned to the element that is scrollable.
|
83
85
|
*/
|
84
|
-
scrollableRef: MutableRefObject<
|
86
|
+
scrollableRef: MutableRefObject<any> | LegacyRef<any>;
|
85
87
|
/**
|
86
88
|
* A function to close the popover.
|
87
89
|
*/
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { SEVERITIES } from './constants';
|
2
2
|
import { GetResourceScanDetailsResponseType, ImageScanVulnerabilityType, ImageVulnerabilityType, ScanResultDTO, SeveritiesDTO, VulnerabilityCountType } from './types';
|
3
3
|
export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => {
|
4
|
-
color: "var(--R500)" | "var(--N300)" | "var(--
|
4
|
+
color: "var(--R500)" | "var(--N300)" | "var(--G500)" | "var(--Y500)" | "var(--R700)" | "var(--O500)";
|
5
5
|
label: "Unknown" | "Critical" | "High" | "Medium" | "Low" | "Failures" | "Successes" | "Exceptions";
|
6
6
|
value: number;
|
7
7
|
}[];
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { DTSwitchProps } from './types';
|
2
|
+
declare const Switch: ({ ariaLabel, isDisabled, isLoading, isChecked, tooltipContent, shape, variant, iconColor, iconName, indeterminate, size, name, dataTestId, onChange, autoFocus, }: DTSwitchProps) => JSX.Element;
|
3
|
+
export default Switch;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { IconBaseColorType } from '../../types';
|
2
|
+
import { DTSwitchProps } from './types';
|
3
|
+
export declare const ROUNDED_SWITCH_SIZE_MAP: Readonly<Record<DTSwitchProps['size'], string>>;
|
4
|
+
export declare const SQUARE_SWITCH_SIZE_MAP: typeof ROUNDED_SWITCH_SIZE_MAP;
|
5
|
+
export declare const SWITCH_HEIGHT_MAP: Readonly<Record<DTSwitchProps['size'], string>>;
|
6
|
+
export declare const LOADING_COLOR_MAP: Record<DTSwitchProps['variant'], IconBaseColorType>;
|
7
|
+
export declare const ROUNDED_SWITCH_TRACK_COLOR_MAP: Record<DTSwitchProps['variant'], string>;
|
8
|
+
export declare const ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP: Record<DTSwitchProps['variant'], `var(--${IconBaseColorType})`>;
|
9
|
+
export declare const SQUARE_SWITCH_TRACK_COLOR_MAP: typeof ROUNDED_SWITCH_TRACK_COLOR_MAP;
|
10
|
+
export declare const SQUARE_SWITCH_TRACK_HOVER_COLOR_MAP: typeof ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP;
|
11
|
+
export declare const ROUNDED_SWITCH_THUMB_SIZE_MAP: Record<DTSwitchProps['size'], string>;
|
12
|
+
export declare const INDETERMINATE_ICON_WIDTH_MAP: Record<DTSwitchProps['size'], string>;
|
13
|
+
export declare const SWITCH_THUMB_PADDING_MAP: Record<DTSwitchProps['size'], string>;
|
14
|
+
export declare const THUMB_OUTER_PADDING_MAP: Record<DTSwitchProps['shape'], string>;
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
2
|
+
import { ComponentSizeType } from '../../constants';
|
3
|
+
import { IconBaseColorType } from '../../types';
|
4
|
+
import { IconName } from '../Icon';
|
5
|
+
/**
|
6
|
+
* Represents the properties for configuring the shape and behavior of a switch component.
|
7
|
+
*
|
8
|
+
* - When `shape` is `rounded`:
|
9
|
+
* - The switch will have a rounded appearance.
|
10
|
+
* - `iconName`, `iconColor`, and `indeterminate` are not applicable.
|
11
|
+
*
|
12
|
+
* - When `shape` is `square`:
|
13
|
+
* - The switch will have a square appearance.
|
14
|
+
* - `iconName` specifies the name of the icon to display.
|
15
|
+
* - `iconColor` allows customization of the icon's color in the active state.
|
16
|
+
* - `indeterminate` indicates whether the switch is in an indeterminate state, typically used for checkboxes to represent a mixed state.
|
17
|
+
* If `indeterminate` is true, the switch will not be fully checked or unchecked.
|
18
|
+
*/
|
19
|
+
type SwitchShapeProps = {
|
20
|
+
/**
|
21
|
+
* The shape of the switch. Defaults to `rounded` if not specified.
|
22
|
+
*/
|
23
|
+
shape?: 'rounded';
|
24
|
+
/**
|
25
|
+
* Icon name is not applicable for the `rounded` shape.
|
26
|
+
*/
|
27
|
+
iconName?: never;
|
28
|
+
/**
|
29
|
+
* Icon color is not applicable for the `rounded` shape.
|
30
|
+
*/
|
31
|
+
iconColor?: never;
|
32
|
+
/**
|
33
|
+
* Indicates whether the switch is in an indeterminate state.
|
34
|
+
* This state is typically used for checkboxes to indicate a mixed state.
|
35
|
+
* If true, the switch will not be fully checked or unchecked. Due this state alone we are keeping role as `checkbox` instead of `switch`.
|
36
|
+
* This property is not applicable for the `square` shape.
|
37
|
+
* @default false
|
38
|
+
*/
|
39
|
+
indeterminate?: boolean;
|
40
|
+
} | {
|
41
|
+
/**
|
42
|
+
* The shape of the switch. Must be `square` to enable icon-related properties.
|
43
|
+
*/
|
44
|
+
shape: 'square';
|
45
|
+
/**
|
46
|
+
* The name of the icon to display when the shape is `square`.
|
47
|
+
*/
|
48
|
+
iconName: IconName;
|
49
|
+
/**
|
50
|
+
* The color of the icon. If provided, this will override the default color in the active state.
|
51
|
+
*/
|
52
|
+
iconColor?: IconBaseColorType;
|
53
|
+
indeterminate?: never;
|
54
|
+
};
|
55
|
+
/**
|
56
|
+
* Represents the properties for the `Switch` component.
|
57
|
+
*/
|
58
|
+
export type DTSwitchProps = {
|
59
|
+
/**
|
60
|
+
* The ARIA label for the switch, used for accessibility purposes.
|
61
|
+
*/
|
62
|
+
ariaLabel: string;
|
63
|
+
/**
|
64
|
+
* Used in forms to identify the switch.
|
65
|
+
*/
|
66
|
+
name: string;
|
67
|
+
/**
|
68
|
+
* Provide if name generated through `getUniqueId`.
|
69
|
+
*/
|
70
|
+
dataTestId?: string;
|
71
|
+
/**
|
72
|
+
* The visual variant of the switch.
|
73
|
+
*
|
74
|
+
* @default `positive`
|
75
|
+
*/
|
76
|
+
variant?: 'theme' | 'positive';
|
77
|
+
/**
|
78
|
+
* The size of the switch.
|
79
|
+
* @default `ComponentSizeType.medium`
|
80
|
+
*/
|
81
|
+
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.small>;
|
82
|
+
/**
|
83
|
+
* Callback function that is called when the switch state changes.
|
84
|
+
* This function should handle the logic for toggling the switch.
|
85
|
+
*/
|
86
|
+
onChange: ButtonHTMLAttributes<HTMLButtonElement>['onClick'];
|
87
|
+
/**
|
88
|
+
* Indicates whether the switch is disabled.
|
89
|
+
*/
|
90
|
+
isDisabled?: boolean;
|
91
|
+
/**
|
92
|
+
* Indicates whether the switch is in a loading state.
|
93
|
+
*/
|
94
|
+
isLoading?: boolean;
|
95
|
+
/**
|
96
|
+
* Indicates whether the switch is currently checked (on).
|
97
|
+
*/
|
98
|
+
isChecked: boolean;
|
99
|
+
/**
|
100
|
+
* Optional tooltip content to display when hovering over the switch.
|
101
|
+
*
|
102
|
+
* @default undefined
|
103
|
+
*/
|
104
|
+
tooltipContent?: ReactNode;
|
105
|
+
/**
|
106
|
+
* Indicates whether the switch should be focused automatically when rendered.
|
107
|
+
* @default false
|
108
|
+
*/
|
109
|
+
autoFocus?: boolean;
|
110
|
+
} & SwitchShapeProps;
|
111
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { IconBaseColorType } from '../../types';
|
2
|
+
import { ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP } from './constants';
|
3
|
+
import { DTSwitchProps } from './types';
|
4
|
+
export declare const getSwitchContainerClass: ({ shape, size }: Required<Pick<DTSwitchProps, "shape" | "size">>) => string;
|
5
|
+
export declare const getSwitchTrackColor: ({ shape, variant, isChecked, isLoading, }: Required<Pick<DTSwitchProps, "shape" | "variant" | "isChecked" | "isLoading">>) => string;
|
6
|
+
export declare const getSwitchTrackHoverColor: ({ shape, variant, isChecked, isLoading, }: Required<Pick<DTSwitchProps, "shape" | "variant" | "isChecked" | "isLoading">>) => (typeof ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP)[DTSwitchProps["variant"]] | "transparent";
|
7
|
+
export declare const getSwitchThumbClass: ({ shape, size, showIndeterminateIcon, }: Pick<DTSwitchProps, "shape" | "size"> & {
|
8
|
+
showIndeterminateIcon: boolean;
|
9
|
+
}) => string;
|
10
|
+
export declare const getSwitchIconColor: ({ iconColor, isChecked, variant, }: Pick<DTSwitchProps, "iconColor" | "isChecked" | "variant">) => IconBaseColorType;
|
11
|
+
export declare const getThumbPosition: ({ isChecked, size, shape, indeterminate, isLoading, }: Required<Pick<DTSwitchProps, "isChecked" | "size" | "shape" | "indeterminate" | "isLoading">>) => number;
|
12
|
+
export declare const getThumbPadding: ({ shape, isLoading }: Pick<DTSwitchProps, "shape" | "isLoading">) => string;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { ToggleResolveScopedVariablesProps } from './types';
|
2
|
-
declare const ToggleResolveScopedVariables: ({ resolveScopedVariables, handleToggleScopedVariablesView, isDisabled, showTooltip,
|
2
|
+
declare const ToggleResolveScopedVariables: ({ name, resolveScopedVariables, handleToggleScopedVariablesView, isDisabled, showTooltip, }: ToggleResolveScopedVariablesProps) => JSX.Element;
|
3
3
|
export default ToggleResolveScopedVariables;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export interface ToggleResolveScopedVariablesProps {
|
2
|
+
name: string;
|
2
3
|
resolveScopedVariables: boolean;
|
3
4
|
handleToggleScopedVariablesView: () => void;
|
4
5
|
isDisabled?: boolean;
|
@@ -6,5 +7,4 @@ export interface ToggleResolveScopedVariablesProps {
|
|
6
7
|
* @default true
|
7
8
|
*/
|
8
9
|
showTooltip?: boolean;
|
9
|
-
throttleOnChange?: boolean;
|
10
10
|
}
|
@@ -26,7 +26,7 @@ export * from './DatePicker';
|
|
26
26
|
export * from './DeploymentConfigDiff';
|
27
27
|
export * from './DeploymentStatusBreakdown';
|
28
28
|
export * from './DetectBottom';
|
29
|
-
export * from './
|
29
|
+
export * from './DocLink';
|
30
30
|
export * from './DynamicDataTable';
|
31
31
|
export * from './EditableTextArea';
|
32
32
|
export * from './EditImageFormField';
|
@@ -72,6 +72,7 @@ export * from './SelectPicker';
|
|
72
72
|
export * from './ShowMoreText';
|
73
73
|
export * from './SSOProviderIcon';
|
74
74
|
export * from './StatusComponent';
|
75
|
+
export * from './Switch';
|
75
76
|
export * from './TabGroup';
|
76
77
|
export * from './Table';
|
77
78
|
export * from './TagsKeyValueTable';
|
package/dist/Shared/Helpers.d.ts
CHANGED
@@ -101,4 +101,5 @@ export declare const deriveBorderRadiusAndBorderClassFromConfig: ({ borderConfig
|
|
101
101
|
export declare const getClassNameForStickyHeaderWithShadow: (isStuck: boolean, topClassName?: string) => string;
|
102
102
|
export declare const clearCookieOnLogout: () => void;
|
103
103
|
export declare const getAppDetailsURL: (appId: number | string, envId?: number | string) => string;
|
104
|
+
export declare const smoothScrollToTop: (scrollContainer: HTMLElement, targetPosition: number) => import('framer-motion').AnimationPlaybackControls;
|
104
105
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export * from './ImageSelectionUtility';
|
2
2
|
export * from './MainContextProvider';
|
3
3
|
export * from './ThemeProvider';
|
4
|
-
export type { MainContext, ReloadVersionConfigTypes } from './types';
|
4
|
+
export type { MainContext, ReloadVersionConfigTypes, SidePanelConfig } from './types';
|
5
5
|
export * from './UserEmailProvider';
|
@@ -11,6 +11,14 @@ export interface ReloadVersionConfigTypes {
|
|
11
11
|
updateToastRef: MutableRefObject<ReturnType<typeof ToastManager.showToast>> | null;
|
12
12
|
isRefreshing: boolean;
|
13
13
|
}
|
14
|
+
export interface SidePanelConfig {
|
15
|
+
/** Determines whether the side panel is visible */
|
16
|
+
open: boolean;
|
17
|
+
/** Optional flag to reset/reinitialize the side panel state */
|
18
|
+
reinitialize?: boolean;
|
19
|
+
/** URL to documentation that should be displayed in the panel */
|
20
|
+
docLink: string | null;
|
21
|
+
}
|
14
22
|
export interface MainContext {
|
15
23
|
serverMode: SERVER_MODE;
|
16
24
|
setServerMode: (serverMode: SERVER_MODE) => void;
|
@@ -58,6 +66,18 @@ export interface MainContext {
|
|
58
66
|
reloadVersionConfig: ReloadVersionConfigTypes;
|
59
67
|
intelligenceConfig: IntelligenceConfig;
|
60
68
|
setIntelligenceConfig: Dispatch<SetStateAction<IntelligenceConfig>>;
|
69
|
+
sidePanelConfig: SidePanelConfig;
|
70
|
+
setSidePanelConfig: Dispatch<SetStateAction<SidePanelConfig>>;
|
71
|
+
/**
|
72
|
+
* Indicates whether the current Devtron instance is running as an Enterprise edition. \
|
73
|
+
* This flag is determined based on server-side configuration.
|
74
|
+
*/
|
75
|
+
isEnterprise: boolean;
|
76
|
+
/**
|
77
|
+
* Indicates whether the fe-lib modules are available in the current instance. \
|
78
|
+
* Used to conditionally render or enable features that depend on fe-lib
|
79
|
+
*/
|
80
|
+
isFELibAvailable: boolean;
|
61
81
|
}
|
62
82
|
export interface MainContextProviderProps {
|
63
83
|
children: ReactNode;
|
@@ -429,3 +429,4 @@ export declare const VARIANT_TO_BORDER_MAP: Record<InfoBlockProps['variant'], st
|
|
429
429
|
export declare const DEPLOYMENT_STAGE_TO_NODE_MAP: Readonly<Record<DeploymentStageType, DeploymentNodeType>>;
|
430
430
|
export declare const APP_DETAILS_FALLBACK_POLLING_INTERVAL = 30000;
|
431
431
|
export declare const PROGRESSING_DEPLOYMENT_STATUS_POLLING_INTERVAL = 10000;
|
432
|
+
export declare const CUBIC_BEZIER_CURVE: [number, number, number, number];
|
package/dist/Shared/types.d.ts
CHANGED
@@ -6,6 +6,11 @@ import { ReleaseMode } from '../Pages/index';
|
|
6
6
|
import { CommonNodeAttr, DeploymentAppTypes, OptionType, PluginType, RefVariableType, SegmentedControlProps, ServerErrors, SortingParams, TriggerBlockType, ValueConstraintType, VariableType, VulnerabilityType } from '../Common';
|
7
7
|
import { SelectPickerOptionType, WorkflowRunnerStatusDTO } from './Components';
|
8
8
|
import { BASE_CONFIGURATION_ENV_ID, DEPLOYMENT_STATUS, EnvironmentTypeEnum, PatchOperationType } from './constants';
|
9
|
+
export declare enum InstallationType {
|
10
|
+
OSS_KUBECTL = "oss_kubectl",
|
11
|
+
OSS_HELM = "oss_helm",
|
12
|
+
ENTERPRISE = "enterprise"
|
13
|
+
}
|
9
14
|
export declare enum EnvType {
|
10
15
|
CHART = "helm_charts",
|
11
16
|
APPLICATION = "apps"
|
@@ -829,6 +834,26 @@ export interface UploadFileProps {
|
|
829
834
|
export type Never<T> = {
|
830
835
|
[K in keyof T]?: never;
|
831
836
|
};
|
837
|
+
/**
|
838
|
+
* A utility type that filters out properties from type `T` that are of type `never`. \
|
839
|
+
* This is useful when you want to remove properties that have been marked as `never` from a type,
|
840
|
+
* effectively creating a new type without those properties.
|
841
|
+
*
|
842
|
+
* @template T - The input type from which to filter out `never` properties.
|
843
|
+
* @example
|
844
|
+
* ```typescript
|
845
|
+
* type User = {
|
846
|
+
* id: number;
|
847
|
+
* name: string;
|
848
|
+
* deleted: never;
|
849
|
+
* }
|
850
|
+
*
|
851
|
+
* type ActiveUser = OmitNever<User>; // { id: number; name: string; }
|
852
|
+
* ```
|
853
|
+
*/
|
854
|
+
export type OmitNever<T> = {
|
855
|
+
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
856
|
+
};
|
832
857
|
export interface TargetPlatformItemDTO {
|
833
858
|
name: string;
|
834
859
|
}
|
@@ -59,3 +59,4 @@ export declare const validateCMVolumeMountPath: (value: string) => {
|
|
59
59
|
message: string;
|
60
60
|
};
|
61
61
|
export declare const validateYAML: (yamlString: string, isRequired?: boolean) => ValidationResponseType;
|
62
|
+
export declare const validateEmail: (email: string) => ValidationResponseType;
|