@devtron-labs/devtron-fe-common-lib 1.14.2 → 1.15.0-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.
- package/dist/{@code-editor-CVEmKqGD.js → @code-editor-BOA86Jx7.js} +11052 -10723
- package/dist/{@common-rjsf-C9V3H0_L.js → @common-rjsf-CGZ8FKPl.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/Dialogs/Types.d.ts +0 -17
- package/dist/Common/Dialogs/index.d.ts +0 -1
- 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/DeploymentHistoryConfigDiff/utils.d.ts +2 -1
- package/dist/Shared/Components/CICDHistory/service.d.ts +1 -7
- package/dist/Shared/Components/CICDHistory/types.d.ts +2 -19
- 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.types.d.ts +18 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +0 -2
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.d.ts +7 -0
- package/dist/Shared/Components/DeploymentConfigDiff/index.d.ts +1 -0
- 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 +19 -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 +10 -3
- package/dist/Shared/Components/Popover/usePopover.hook.d.ts +1 -1
- 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/SwitchThemeDialog/SwitchThemeDialog.component.d.ts +3 -0
- package/dist/Shared/Components/SwitchThemeDialog/index.d.ts +2 -0
- package/dist/Shared/Components/SwitchThemeDialog/types.d.ts +35 -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 +3 -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 +47 -9
- package/dist/Shared/Services/app.types.d.ts +7 -2
- package/dist/Shared/constants.d.ts +3 -1
- package/dist/Shared/types.d.ts +32 -2
- 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 +727 -724
- package/package.json +3 -4
- package/dist/Common/Dialogs/ConfirmationDialog.d.ts +0 -11
- 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
@@ -0,0 +1,94 @@
|
|
1
|
+
export declare const DOCUMENTATION: {
|
2
|
+
readonly ADMIN_PASSWORD: "install/install-devtron#devtron-admin-credentials";
|
3
|
+
readonly APP_CI_CONFIG_BUILD_WITHOUT_DOCKER: "usage/applications/creating-application/docker-build-configuration#build-docker-image-without-dockerfile";
|
4
|
+
readonly APP_CREATE: "usage/applications/create-application";
|
5
|
+
readonly APP_CREATE_CI_CONFIG: "usage/applications/creating-application/docker-build-configuration";
|
6
|
+
readonly APP_CREATE_CONFIG_MAP: "usage/applications/creating-application/config-maps";
|
7
|
+
readonly APP_CREATE_ENVIRONMENT_OVERRIDE: "usage/applications/creating-application/environment-overrides";
|
8
|
+
readonly APP_CREATE_MATERIAL: "usage/applications/creating-application/git-material";
|
9
|
+
readonly APP_CREATE_SECRET: "usage/applications/creating-application/secrets";
|
10
|
+
readonly APP_CREATE_WORKFLOW: "usage/applications/creating-application/workflow";
|
11
|
+
readonly APP_DEPLOYMENT_TEMPLATE: "usage/applications/creating-application/deployment-template";
|
12
|
+
readonly APP_EPHEMERAL_CONTAINER: "usage/applications/app-details/ephemeral-containers";
|
13
|
+
readonly APP_METRICS: "usage/applications/app-details/app-metrics";
|
14
|
+
readonly APP_OVERVIEW_TAGS: "usage/applications/overview#manage-tags";
|
15
|
+
readonly APP_ROLLOUT_DEPLOYMENT_TEMPLATE: "usage/applications/creating-application/deployment-template/rollout-deployment";
|
16
|
+
readonly BUILD_STAGE: "usage/applications/creating-application/workflow/ci-pipeline#build-stage";
|
17
|
+
readonly APP_TAGS: "usage/applications/create-application#tags";
|
18
|
+
readonly BLOB_STORAGE: "configurations-overview/installation-configuration#configuration-of-blob-storage";
|
19
|
+
readonly BULK_UPDATE: "usage/bulk-update";
|
20
|
+
readonly CHART_GROUP: "usage/deploy-chart/chart-group";
|
21
|
+
readonly CHART_LIST: "usage/deploy-chart/overview-of-charts";
|
22
|
+
readonly CHART_STORE_METRICS_SERVER: "dashboard//chart-store/discover?appStoreName=metrics-server";
|
23
|
+
readonly CUSTOM_VALUES: "usage/deploy-chart/overview-of-charts#custom-values";
|
24
|
+
readonly DEPLOYMENT: "usage/applications/creating-application/deployment-template/deployment";
|
25
|
+
readonly DEPLOYMENT_TEMPLATE: "usage/applications/creating-application/deployment-template";
|
26
|
+
readonly DEVTRON_UPGRADE: "getting-started/upgrade";
|
27
|
+
readonly CONFIGURING_WEBHOOK: "usage/applications/creating-application/workflow/ci-pipeline#configuring-webhook";
|
28
|
+
readonly ENTERPRISE_LICENSE: "enterprise-license";
|
29
|
+
readonly EXECUTE_CUSTOM_SCRIPT: "usage/applications/creating-application/workflow/ci-pipeline/ci-build-pre-post-plugins#execute-custom-script";
|
30
|
+
readonly EXTERNAL_LINKS: "getting-started/global-configurations/external-links";
|
31
|
+
readonly EXTERNAL_SECRET: "usage/applications/creating-application/secrets#external-secrets";
|
32
|
+
readonly HOME_PAGE: "https://devtron.ai";
|
33
|
+
readonly DOC_HOME_PAGE: "https://docs.devtron.ai";
|
34
|
+
readonly KUBE_CONFIG: "usage/resource-browser#running-kubectl-commands-locally";
|
35
|
+
readonly JOBS: "usage/jobs";
|
36
|
+
readonly TAINT: "usage/resource-browser#taint-a-node";
|
37
|
+
readonly GLOBAL_CONFIG_API_TOKEN: "getting-started/global-configurations/authorization/api-tokens";
|
38
|
+
readonly GLOBAL_CONFIG_BUILD_INFRA: "global-configurations/build-infra";
|
39
|
+
readonly GLOBAL_CONFIG_CHART: "getting-started/global-configurations/chart-repo";
|
40
|
+
readonly GLOBAL_CONFIG_CLUSTER: "getting-started/global-configurations/cluster-and-environments";
|
41
|
+
readonly GLOBAL_CONFIG_CUSTOM_CHART: "getting-started/global-configurations/custom-charts";
|
42
|
+
readonly GLOBAL_CONFIG_CUSTOM_CHART_PRE_REQUISITES: "global-configurations/deployment-charts#preparing-a-deployment-chart";
|
43
|
+
readonly GLOBAL_CONFIG_DOCKER: "getting-started/global-configurations/container-registries";
|
44
|
+
readonly GLOBAL_CONFIG_GIT: "getting-started/global-configurations/git-accounts";
|
45
|
+
readonly GLOBAL_CONFIG_GITOPS: "global-configurations/gitops";
|
46
|
+
readonly GLOBAL_CONFIG_GITOPS_GITHUB: "global-configurations/gitops#github";
|
47
|
+
readonly GLOBAL_CONFIG_GITOPS_GITLAB: "global-configurations/gitops#gitlab";
|
48
|
+
readonly GLOBAL_CONFIG_GITOPS_AZURE: "global-configurations/gitops#azure";
|
49
|
+
readonly GLOBAL_CONFIG_GITOPS_BITBUCKET: "global-configurations/gitops#bitbucket";
|
50
|
+
readonly GLOBAL_CONFIG_GROUPS: "getting-started/global-configurations/authorization/permission-groups";
|
51
|
+
readonly GLOBAL_CONFIG_HOST_URL: "global-configurations/host-url";
|
52
|
+
readonly GLOBAL_CONFIG_NOTIFICATION: "getting-started/global-configurations/manage-notification";
|
53
|
+
readonly GLOBAL_CONFIG_PERMISSION: "global-configurations/authorization/user-access#devtron-apps-permissions";
|
54
|
+
readonly GLOBAL_CONFIG_PROJECT: "global-configurations/projects";
|
55
|
+
readonly GLOBAL_CONFIG_SSO: "getting-started/global-configurations/sso-login";
|
56
|
+
readonly GLOBAL_CONFIG_SCOPED_VARIABLES: "getting-started/global-configurations/scoped-variables";
|
57
|
+
readonly GLOBAL_CONFIG_USER: "getting-started/global-configurations/authorization/user-access";
|
58
|
+
readonly HYPERION: "usage/applications#view-external-helm-app-listing";
|
59
|
+
readonly JOB_CRONJOB: "usage/applications/creating-application/deployment-template/job-and-cronjob";
|
60
|
+
readonly JOB_SOURCE_CODE: "usage/jobs/configuration-job";
|
61
|
+
readonly JOB_WORKFLOW_EDITOR: "usage/jobs/workflow-editor-job";
|
62
|
+
readonly K8S_RESOURCES_PERMISSIONS: "global-configurations/authorization/user-access#kubernetes-resources-permissions";
|
63
|
+
readonly PRE_POST_BUILD_STAGE: "usage/applications/creating-application/ci-pipeline/ci-build-pre-post-plugins";
|
64
|
+
readonly ROLLOUT: "usage/applications/creating-application/deployment-template/rollout-deployment";
|
65
|
+
readonly SECURITY: "usage/security-features";
|
66
|
+
readonly SPECIFY_IMAGE_PULL_SECRET: "getting-started/global-configurations/container-registries#specify-image-pull-secret";
|
67
|
+
readonly TENANT_INSTALLATION: "usage/software-distribution-hub/tenants";
|
68
|
+
readonly CEL: "https://github.com/google/cel-spec/blob/master/doc/langdef.md";
|
69
|
+
readonly KUBERNETES_LABELS: "https://kubernetes.io/docs/concepts/overview/working-with-objects/labels";
|
70
|
+
readonly IMAGE_PROMOTION: "global-configurations/image-promotion-policy";
|
71
|
+
readonly IMAGE_PROMOTION_ASSIGN_TO: "global-configurations/image-promotion-policy#applying-an-image-promotion-policy";
|
72
|
+
readonly TAGS: "usage/applications/create-application#tags";
|
73
|
+
readonly TAGS_POLICY: "global-configurations/tags-policy";
|
74
|
+
readonly RESOURCE_WATCHER: "usage/resource-watcher";
|
75
|
+
readonly GITOPS_BITBUCKET: "global-configurations/gitops#bitbucket";
|
76
|
+
readonly DEPLOYMENT_CONFIGS: "resources/glossary#base-deployment-template";
|
77
|
+
readonly RJSF_PLAYGROUND: "https://rjsf-team.github.io/react-jsonschema-form/";
|
78
|
+
readonly GLOBAL_CONFIG_DEPLOYMENT_WINDOW: "global-configurations/deployment-window";
|
79
|
+
readonly GLOBAL_CONFIG_CATALOG_FRAMEWORK: "global-configurations/catalog-framework";
|
80
|
+
readonly GLOBAL_CONFIG_DEVTRON_APP_TEMPLATES: "global-configurations";
|
81
|
+
readonly GLOBAL_CONFIG_FILTER_CONDITION: "global-configurations/filter-condition";
|
82
|
+
readonly GLOBAL_CONFIG_LOCK_DEPLOYMENT_CONFIG: "global-configurations/lock-deployment-config";
|
83
|
+
readonly GLOBAL_CONFIG_PLUGINS_POLICY: "global-configurations/plugins-policy";
|
84
|
+
readonly GLOBAL_CONFIG_APPROVAL_POLICY: "global-configurations/approval-policy";
|
85
|
+
readonly GLOBAL_CONFIG_SSO_LOGIN_LDAP: "global-configurations/authorization/sso-login/ldap";
|
86
|
+
readonly GLOBAL_CONFIG_SSO_LOGIN_MICROSOFT: "global-configurations/authorization/sso-login/microsoft";
|
87
|
+
readonly GLOBAL_CONFIG_PULL_IMAGE_DIGEST: "global-configurations/pull-image-digest";
|
88
|
+
readonly GLOBAL_CONFIG_TAGS: "getting-started/global-configurations/tags-policy";
|
89
|
+
readonly SOFTWARE_DISTRIBUTION_HUB: "usage/software-distribution-hub";
|
90
|
+
readonly RELEASE_TRACKS: "usage/software-distribution-hub/release-hub#creating-release-tracks-and-versions";
|
91
|
+
readonly RELEASES: "usage/software-distribution-hub/release-hub#creating-release-tracks-and-versions";
|
92
|
+
readonly TENANTS: "usage/software-distribution-hub/tenants#adding-installation";
|
93
|
+
readonly TENANTS_INSTALLATION: "usage/software-distribution-hub/tenants";
|
94
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { MouseEvent } from 'react';
|
2
|
+
import { ButtonComponentType, ButtonProps } from '..';
|
3
|
+
import { DOCUMENTATION } from './constants';
|
4
|
+
export type BaseDocLink<T extends boolean> = {
|
5
|
+
isExternalLink?: T;
|
6
|
+
isEnterprise?: boolean;
|
7
|
+
isLicenseDashboard?: boolean;
|
8
|
+
docLinkKey: T extends true ? string : keyof typeof DOCUMENTATION;
|
9
|
+
};
|
10
|
+
export type DocLinkProps<T extends boolean = false> = Pick<ButtonProps<ButtonComponentType.anchor>, 'dataTestId' | 'size' | 'variant' | 'fullWidth' | 'fontWeight' | 'startIcon'> & Omit<BaseDocLink<T>, 'isEnterprise'> & {
|
11
|
+
text?: string;
|
12
|
+
showExternalIcon?: boolean;
|
13
|
+
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
14
|
+
/**
|
15
|
+
* If `true`, the documentation will open in a new browser tab instead of the side panel.
|
16
|
+
* @default false
|
17
|
+
*/
|
18
|
+
openInNewTab?: boolean;
|
19
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { DynamicDataTableProps } from './types';
|
2
|
-
export declare const DynamicDataTable: <K extends string, CustomStateType = Record<string, unknown>>({ headers,
|
2
|
+
export declare const DynamicDataTable: <K extends string, CustomStateType = Record<string, unknown>>({ headers, ...props }: DynamicDataTableProps<K, CustomStateType>) => JSX.Element;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { DynamicDataTableRowProps } from './types';
|
2
|
-
export declare const DynamicDataTableRow: <K extends string, CustomStateType = Record<string, unknown>>({ rows, headers, readOnly, isDeletionNotAllowed, cellError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, focusableFieldKey,
|
2
|
+
export declare const DynamicDataTableRow: <K extends string, CustomStateType = Record<string, unknown>>({ rows, headers, readOnly, isDeletionNotAllowed, cellError, actionButtonConfig, onRowEdit, onRowDelete, leadingCellIcon, trailingCellIcon, buttonCellWrapComponent, focusableFieldKey, shouldAutoFocusOnMount, }: DynamicDataTableRowProps<K, CustomStateType>) => JSX.Element;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { DetailedHTMLProps,
|
1
|
+
import { DetailedHTMLProps, ReactElement, ReactNode } from 'react';
|
2
2
|
import { ResizableTagTextAreaProps } from '../../../Common/CustomTagSelector';
|
3
3
|
import { UseStateFiltersReturnType } from '../../../Common/Hooks';
|
4
4
|
import { TooltipProps } from '@Common/Tooltip/types';
|
@@ -166,11 +166,15 @@ export type DynamicDataTableProps<K extends string, CustomStateType = Record<str
|
|
166
166
|
* @default 'first column key'
|
167
167
|
*/
|
168
168
|
focusableFieldKey?: K;
|
169
|
+
/**
|
170
|
+
* When true, the table will automatically focus the first focusable cell
|
171
|
+
* or cell key denoted by `focusableFieldKey` when the component mounts.
|
172
|
+
* @default false
|
173
|
+
*/
|
174
|
+
shouldAutoFocusOnMount?: boolean;
|
169
175
|
};
|
170
176
|
export interface DynamicDataTableHeaderProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'headers' | 'rows' | 'headerComponent' | 'sortingConfig' | 'addBtnTooltip' | 'onRowAdd' | 'readOnly' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'actionButtonConfig'> {
|
171
177
|
}
|
172
|
-
export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'cellError' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent' | 'focusableFieldKey'> {
|
173
|
-
isAddRowButtonClicked: boolean;
|
174
|
-
setIsAddRowButtonClicked: Dispatch<SetStateAction<boolean>>;
|
178
|
+
export interface DynamicDataTableRowProps<K extends string, CustomStateType = Record<string, unknown>> extends Pick<DynamicDataTableProps<K, CustomStateType>, 'rows' | 'headers' | 'isAdditionNotAllowed' | 'isDeletionNotAllowed' | 'readOnly' | 'onRowEdit' | 'onRowDelete' | 'actionButtonConfig' | 'cellError' | 'leadingCellIcon' | 'trailingCellIcon' | 'buttonCellWrapComponent' | 'focusableFieldKey' | 'shouldAutoFocusOnMount'> {
|
175
179
|
}
|
176
180
|
export {};
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
2
2
|
import { ImageType } from '../../../Common';
|
3
3
|
import { Breadcrumb } from '../../../Common/BreadCrumb/Types';
|
4
|
+
import { DocLinkProps } from '../DocLink';
|
4
5
|
interface BaseFeatureDescriptionModalProps {
|
5
6
|
renderDescriptionContent?: () => ReactNode;
|
6
|
-
docLink?:
|
7
|
+
docLink?: DocLinkProps['docLinkKey'];
|
7
8
|
imageVariant?: ImageType;
|
8
9
|
SVGImage?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
9
10
|
imageStyles?: React.CSSProperties;
|
@@ -1,3 +1,2 @@
|
|
1
|
-
import { AnimatePresence, motion } from 'framer-motion';
|
2
|
-
export
|
3
|
-
export { AnimatePresence, motion };
|
1
|
+
import { animate, AnimatePresence, motion, useMotionTemplate, useMotionValue } from 'framer-motion';
|
2
|
+
export { animate, AnimatePresence, motion, useMotionTemplate, useMotionValue };
|
@@ -1,2 +1,4 @@
|
|
1
1
|
export { default as GenericInfoCard } from './GenericInfoCard.component';
|
2
|
-
export
|
2
|
+
export * from './GenericInfoCardListing';
|
3
|
+
export { GenericInfoListSkeleton } from './GenericInfoListSkeleton';
|
4
|
+
export { GenericInfoCardBorderVariant, type GenericInfoCardListingProps, type GenericInfoCardProps } from './types';
|
@@ -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 {
|
@@ -50,6 +50,11 @@ export interface UsePopoverProps {
|
|
50
50
|
* @param closePopover - A function to close the popover.
|
51
51
|
*/
|
52
52
|
onPopoverKeyDown?: (e: KeyboardEvent, openState: boolean, closePopover: () => void) => void;
|
53
|
+
/**
|
54
|
+
* Variant of the popover (bg, shadow and styles changes based on variant)
|
55
|
+
* @default 'menu'
|
56
|
+
*/
|
57
|
+
variant?: 'menu' | 'overlay';
|
53
58
|
}
|
54
59
|
/**
|
55
60
|
* Represents the return type of the `usePopover` hook, providing properties and methods
|
@@ -64,7 +69,9 @@ export interface UsePopoverReturnType {
|
|
64
69
|
* Props to be spread onto the trigger element that opens the popover.
|
65
70
|
* These props include standard HTML attributes for a `div` element.
|
66
71
|
*/
|
67
|
-
triggerProps: DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement
|
72
|
+
triggerProps: DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
73
|
+
bounds: Pick<DOMRect, 'left' | 'top' | 'height' | 'width'>;
|
74
|
+
};
|
68
75
|
/**
|
69
76
|
* Props to be spread onto the overlay element of the popover.
|
70
77
|
* These props include standard HTML attributes for a `div` element.
|
@@ -81,7 +88,7 @@ export interface UsePopoverReturnType {
|
|
81
88
|
* A mutable reference to the scrollable element inside the popover. \
|
82
89
|
* This reference should be assigned to the element that is scrollable.
|
83
90
|
*/
|
84
|
-
scrollableRef: MutableRefObject<
|
91
|
+
scrollableRef: MutableRefObject<any> | LegacyRef<any>;
|
85
92
|
/**
|
86
93
|
* A function to close the popover.
|
87
94
|
*/
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { UsePopoverProps, UsePopoverReturnType } from './types';
|
2
|
-
export declare const usePopover: ({ id, position, alignment, width, onOpen, onPopoverKeyDown, onTriggerKeyDown, }: UsePopoverProps) => UsePopoverReturnType;
|
2
|
+
export declare const usePopover: ({ id, position, alignment, width, variant, onOpen, onPopoverKeyDown, onTriggerKeyDown, }: UsePopoverProps) => UsePopoverReturnType;
|
@@ -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;
|