@devtron-labs/devtron-fe-common-lib 1.14.2-beta-0 → 1.14.2-beta-3
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-BuYqYK_U.js → @code-editor-BFAjlLLM.js} +10603 -10793
- package/dist/{@common-rjsf-C-srMZXE.js → @common-rjsf-BXCRwIYr.js} +2 -2
- package/dist/{@framer-motion-62wGf8yQ.js → @framer-motion-eB9Rj-_8.js} +3 -3
- package/dist/{@react-dates-CYMJp3U9.js → @react-dates-CJpoumtu.js} +1 -1
- package/dist/{@react-select-DwgZP5FJ.js → @react-select-CUbAbK6L.js} +6 -6
- package/dist/{@react-virtualized-sticky-tree-fnroedPy.js → @react-virtualized-sticky-tree-Ckb5S1RC.js} +1 -1
- package/dist/{@vendor-CShVblFI.js → @vendor-4cEd9dja.js} +18690 -18509
- package/dist/Common/API/index.d.ts +0 -2
- package/dist/Common/Constants.d.ts +11 -4
- package/dist/Common/SegmentedControl/Segment.d.ts +1 -1
- package/dist/Common/SegmentedControl/types.d.ts +2 -3
- package/dist/Common/TippyCustomized.d.ts +1 -1
- package/dist/Common/Types.d.ts +6 -8
- package/dist/Shared/Components/ActionMenu/types.d.ts +4 -31
- package/dist/Shared/Components/ActionMenu/useActionMenu.hook.d.ts +2 -4
- package/dist/Shared/Components/Button/Button.component.d.ts +1 -1
- package/dist/Shared/Components/Button/constants.d.ts +0 -1
- package/dist/Shared/Components/Button/types.d.ts +1 -14
- 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 +3 -18
- 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 +1 -2
- package/dist/Shared/Components/CodeEditor/types.d.ts +1 -14
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.d.ts +18 -1
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +2 -0
- package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffRadioSelect.d.ts +7 -0
- package/dist/Shared/Components/DeploymentConfigDiff/index.d.ts +1 -0
- package/dist/Shared/Components/DiffViewer/DiffViewer.component.d.ts +41 -0
- package/dist/Shared/Components/DiffViewer/constants.d.ts +2 -0
- package/dist/Shared/Components/DiffViewer/index.d.ts +1 -0
- package/dist/Shared/Components/DiffViewer/types.d.ts +9 -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 +4 -8
- package/dist/Shared/Components/FeatureDescription/types.d.ts +1 -2
- package/dist/Shared/Components/FramerComponents/MotionDiv.d.ts +2 -0
- package/dist/Shared/Components/FramerComponents/index.d.ts +3 -2
- package/dist/Shared/Components/GenericInfoCard/index.d.ts +1 -3
- package/dist/Shared/Components/GenericInfoCard/types.d.ts +0 -13
- package/dist/Shared/Components/Header/types.d.ts +8 -8
- package/dist/Shared/Components/Header/utils.d.ts +2 -0
- package/dist/Shared/Components/Icon/Icon.d.ts +0 -6
- 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/LogoutCard.d.ts +10 -0
- package/dist/Shared/Components/ModalSidebarPanel/types.d.ts +1 -2
- package/dist/Shared/Components/NumbersCount/index.d.ts +0 -1
- package/dist/Shared/Components/Popover/Popover.component.d.ts +1 -1
- package/dist/Shared/Components/Popover/types.d.ts +8 -5
- 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/ThemeSwitcher/ThemeSwitcher.component.d.ts +1 -1
- package/dist/Shared/Components/ThemeSwitcher/index.d.ts +1 -0
- package/dist/Shared/Components/ThemeSwitcher/types.d.ts +1 -1
- package/dist/Shared/Components/index.d.ts +1 -2
- package/dist/Shared/Helpers.d.ts +0 -1
- package/dist/Shared/Providers/index.d.ts +1 -1
- package/dist/Shared/Providers/types.d.ts +0 -20
- package/dist/Shared/Services/app.types.d.ts +7 -2
- package/dist/Shared/constants.d.ts +2 -2
- package/dist/Shared/types.d.ts +7 -27
- package/dist/Shared/validations.d.ts +0 -1
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-arrow-square-out.3d1a0d41.svg +19 -0
- package/dist/index.d.ts +0 -16
- package/dist/index.js +782 -800
- package/package.json +3 -3
- package/dist/Common/API/QueryClientProvider.d.ts +0 -2
- package/dist/Common/API/useQueryClient.d.ts +0 -6
- package/dist/Shared/Components/DocLink/DocLink.d.ts +0 -2
- package/dist/Shared/Components/DocLink/constants.d.ts +0 -94
- package/dist/Shared/Components/DocLink/index.d.ts +0 -4
- package/dist/Shared/Components/DocLink/types.d.ts +0 -18
- package/dist/Shared/Components/DocLink/utils.d.ts +0 -2
- package/dist/Shared/Components/GenericInfoCard/GenericInfoCardListing.d.ts +0 -2
- package/dist/Shared/Components/GenericInfoCard/GenericInfoListSkeleton.d.ts +0 -2
- package/dist/Shared/Components/Header/ProfileMenu.d.ts +0 -2
- package/dist/Shared/Components/Switch/Switch.component.d.ts +0 -3
- package/dist/Shared/Components/Switch/constants.d.ts +0 -14
- package/dist/Shared/Components/Switch/index.d.ts +0 -2
- package/dist/Shared/Components/Switch/types.d.ts +0 -102
- package/dist/Shared/Components/Switch/utils.d.ts +0 -12
- package/dist/assets/empty-create.661d9355.png +0 -0
- package/dist/assets/ic-app-template.82736707.svg +0 -23
- package/dist/assets/ic-devtron-app.a8b688d3.svg +0 -23
- package/dist/assets/ic-devtron-job.1b216232.svg +0 -10
- package/dist/assets/ic-email.78fed574.svg +0 -3
- package/dist/assets/ic-key-enter.59d23056.svg +0 -3
- package/dist/assets/ic-spray-can.624b202a.svg +0 -3
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@devtron-labs/devtron-fe-common-lib",
|
3
|
-
"version": "1.14.2-beta-
|
3
|
+
"version": "1.14.2-beta-3",
|
4
4
|
"description": "Supporting common component library",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/index.js",
|
@@ -46,7 +46,6 @@
|
|
46
46
|
"@types/dompurify": "^3.0.5",
|
47
47
|
"@types/json-schema": "^7.0.15",
|
48
48
|
"@types/react": "17.0.39",
|
49
|
-
"@types/react-dates": "^21.8.6",
|
50
49
|
"@types/react-dom": "17.0.13",
|
51
50
|
"@types/react-router-dom": "^5.3.3",
|
52
51
|
"@typescript-eslint/eslint-plugin": "8.3.0",
|
@@ -107,7 +106,7 @@
|
|
107
106
|
"@lezer/highlight": "1.2.1",
|
108
107
|
"@replit/codemirror-indentation-markers": "6.5.3",
|
109
108
|
"@replit/codemirror-vscode-keymap": "6.0.2",
|
110
|
-
"@
|
109
|
+
"@types/react-dates": "^21.8.6",
|
111
110
|
"@uiw/codemirror-extensions-hyper-link": "4.23.10",
|
112
111
|
"@uiw/codemirror-theme-github": "4.23.7",
|
113
112
|
"@uiw/react-codemirror": "4.23.7",
|
@@ -123,6 +122,7 @@
|
|
123
122
|
"qrcode.react": "^4.2.0",
|
124
123
|
"react-canvas-confetti": "^2.0.7",
|
125
124
|
"react-dates": "^21.8.0",
|
125
|
+
"react-diff-viewer-continued": "^3.4.0",
|
126
126
|
"react-draggable": "^4.4.5",
|
127
127
|
"react-international-phone": "^4.5.0",
|
128
128
|
"react-virtualized-sticky-tree": "^3.0.0-beta18",
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { QueryKey, UseMutationOptions, UseMutationResult, useQueryClient, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
2
|
-
import { ServerErrors } from '../ServerError';
|
3
|
-
import { ResponseType } from '../Types';
|
4
|
-
export declare const useQuery: <TQueryFnData = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<ResponseType<TQueryFnData>, ServerErrors, TData, TQueryKey>) => UseQueryResult<TData, ServerErrors>;
|
5
|
-
export declare const useMutation: <TData = unknown, TVariables = void, TContext = unknown>(options: UseMutationOptions<ResponseType<TData>, ServerErrors, TVariables, TContext>) => UseMutationResult<ResponseType<TData>, ServerErrors, TVariables, TContext>;
|
6
|
-
export { useQueryClient };
|
@@ -1,94 +0,0 @@
|
|
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
|
-
};
|
@@ -1,18 +0,0 @@
|
|
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
|
-
docLinkKey: T extends true ? string : keyof typeof DOCUMENTATION;
|
8
|
-
};
|
9
|
-
export type DocLinkProps<T extends boolean = false> = Pick<ButtonProps<ButtonComponentType.anchor>, 'dataTestId' | 'size' | 'variant' | 'fullWidth' | 'fontWeight' | 'startIcon'> & Omit<BaseDocLink<T>, 'isEnterprise'> & {
|
10
|
-
text?: string;
|
11
|
-
showExternalIcon?: boolean;
|
12
|
-
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
13
|
-
/**
|
14
|
-
* If `true`, the documentation will open in a new browser tab instead of the side panel.
|
15
|
-
* @default false
|
16
|
-
*/
|
17
|
-
openInNewTab?: boolean;
|
18
|
-
};
|
@@ -1,14 +0,0 @@
|
|
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>;
|
@@ -1,102 +0,0 @@
|
|
1
|
-
import { ButtonHTMLAttributes } 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
|
-
* The visual variant of the switch.
|
69
|
-
*
|
70
|
-
* @default `positive`
|
71
|
-
*/
|
72
|
-
variant?: 'theme' | 'positive';
|
73
|
-
/**
|
74
|
-
* The size of the switch.
|
75
|
-
* @default `ComponentSizeType.medium`
|
76
|
-
*/
|
77
|
-
size?: Extract<ComponentSizeType, ComponentSizeType.medium | ComponentSizeType.small>;
|
78
|
-
/**
|
79
|
-
* Callback function that is called when the switch state changes.
|
80
|
-
* This function should handle the logic for toggling the switch.
|
81
|
-
*/
|
82
|
-
onChange: ButtonHTMLAttributes<HTMLButtonElement>['onClick'];
|
83
|
-
/**
|
84
|
-
* Indicates whether the switch is disabled.
|
85
|
-
*/
|
86
|
-
isDisabled?: boolean;
|
87
|
-
/**
|
88
|
-
* Indicates whether the switch is in a loading state.
|
89
|
-
*/
|
90
|
-
isLoading?: boolean;
|
91
|
-
/**
|
92
|
-
* Indicates whether the switch is currently checked (on).
|
93
|
-
*/
|
94
|
-
isChecked: boolean;
|
95
|
-
/**
|
96
|
-
* Optional tooltip content to display when hovering over the switch.
|
97
|
-
*
|
98
|
-
* @default undefined
|
99
|
-
*/
|
100
|
-
tooltipContent?: string;
|
101
|
-
} & SwitchShapeProps;
|
102
|
-
export {};
|
@@ -1,12 +0,0 @@
|
|
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, }: Required<Pick<DTSwitchProps, "shape" | "variant" | "isChecked">>) => (typeof ROUNDED_SWITCH_TRACK_HOVER_COLOR_MAP)[DTSwitchProps["variant"]];
|
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: ({ isLoading, isChecked, }: Pick<DTSwitchProps, "isLoading" | "isChecked">) => "left" | "right" | "center";
|
12
|
-
export declare const getThumbPadding: ({ shape, isLoading }: Pick<DTSwitchProps, "shape" | "isLoading">) => string;
|
Binary file
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
- Copyright (c) 2024. Devtron Inc.
|
3
|
-
-
|
4
|
-
- Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
- you may not use this file except in compliance with the License.
|
6
|
-
- You may obtain a copy of the License at
|
7
|
-
-
|
8
|
-
- http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
-
|
10
|
-
- Unless required by applicable law or agreed to in writing, software
|
11
|
-
- distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
- See the License for the specific language governing permissions and
|
14
|
-
- limitations under the License.
|
15
|
-
-->
|
16
|
-
|
17
|
-
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg" vector-effect="non-scaling-effect">
|
18
|
-
<rect width="48" height="48" rx="6" fill="#FFF8ED"/>
|
19
|
-
<path d="M9 11.5001C9 10.1193 10.1193 9 11.5001 9H36.5007C37.8814 9 39.0007 10.1193 39.0007 11.5001V14.0001C39.0007 15.3809 37.8814 16.5002 36.5007 16.5002H11.5001C10.1193 16.5002 9 15.3809 9 14.0001V11.5001Z" fill="#FFC266"/>
|
20
|
-
<path d="M9 21.4981C9 20.1174 10.1193 18.998 11.5001 18.998H20.2503C21.631 18.998 22.7503 20.1174 22.7503 21.4981V25.2482C22.7503 26.6289 21.631 27.7483 20.2503 27.7483H11.5001C10.1193 27.7483 9 26.6289 9 25.2482V21.4981Z" fill="#FFE5BE"/>
|
21
|
-
<path d="M9 32.7501C9 31.3693 10.1193 30.25 11.5001 30.25H20.2503C21.631 30.25 22.7503 31.3693 22.7503 32.7501V36.5002C22.7503 37.8809 21.631 39.0002 20.2503 39.0002H11.5001C10.1193 39.0002 9 37.8809 9 36.5002V32.7501Z" fill="#FFE5BE"/>
|
22
|
-
<path d="M25.25 21.4981C25.25 20.1174 26.3693 18.998 27.7501 18.998H36.5003C37.881 18.998 39.0003 20.1174 39.0003 21.4981V36.4985C39.0003 37.8792 37.881 38.9986 36.5003 38.9986H27.7501C26.3693 38.9986 25.25 37.8792 25.25 36.4985V21.4981Z" fill="#FFC266"/>
|
23
|
-
</svg>
|
@@ -1,23 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
- Copyright (c) 2024. Devtron Inc.
|
3
|
-
-
|
4
|
-
- Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
- you may not use this file except in compliance with the License.
|
6
|
-
- You may obtain a copy of the License at
|
7
|
-
-
|
8
|
-
- http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
-
|
10
|
-
- Unless required by applicable law or agreed to in writing, software
|
11
|
-
- distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
- See the License for the specific language governing permissions and
|
14
|
-
- limitations under the License.
|
15
|
-
-->
|
16
|
-
|
17
|
-
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
18
|
-
<g fill-rule="nonzero" fill="none">
|
19
|
-
<!-- Using variables for consistent theming -->
|
20
|
-
<rect fill="var(--B100)" width="24" height="24" rx="5.333"/>
|
21
|
-
<path d="M15.707 6.297a.789.789 0 0 1 .852.44l2.758 4.359c.239.375.244.855.015 1.235l-3.507 5.811a1.24 1.24 0 0 1-1.06.603l-5.1.005a.64.64 0 0 1-.034 0c-.497-.024-.772-.6-.5-1.023l3.515-5.452a.685.685 0 0 1 1.288.139.71.71 0 0 1-.057.478v.001a.716.716 0 0 1-.075.117l-.535.837a.388.388 0 0 0 .276.6l1.296.094a.87.87 0 0 0 .655-.232c.13-.155.506-.75.896-1.387l.234-.383c.232-.382.451-.75.609-1.016a.758.758 0 0 0-.04-.824l.005-.003-1.661-2.618-.311-.497a.806.806 0 0 1-.085-.135l-.012-.018a.84.84 0 0 1-.065-.453.8.8 0 0 1 .643-.678zM9.266 5.25l5.1.018a.64.64 0 0 1 .034.001c.497.026.77.603.495 1.025l-3.539 5.436a.685.685 0 0 1-1.287-.145.71.71 0 0 1 .06-.478v-.001a.728.728 0 0 1 .074-.116l.54-.835a.388.388 0 0 0-.274-.6l-1.295-.1a.87.87 0 0 0-.657.228c-.234.278-1.275 1.98-1.75 2.778a.758.758 0 0 0 .036.825l-.006.003 1.65 2.625.31.498c.031.042.06.087.083.135l.012.02a.84.84 0 0 1 .063.452.8.8 0 0 1-.646.675.789.789 0 0 1-.85-.443l-2.74-4.372a1.175 1.175 0 0 1-.008-1.235l3.532-5.796c.228-.373.63-.6 1.063-.598z" fill="var(--B400)"/>
|
22
|
-
</g>
|
23
|
-
</svg>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<rect width="40" height="40" rx="8" fill="#E6FBFF"/>
|
3
|
-
<rect x="10.8333" y="23.0559" width="6.11111" height="6.11111" fill="#023E8A"/>
|
4
|
-
<rect x="10.8333" y="16.9442" width="6.11111" height="6.11111" fill="#0077B6"/>
|
5
|
-
<rect x="16.9443" y="23.0559" width="6.11111" height="6.11111" fill="#0077B6"/>
|
6
|
-
<rect x="16.9443" y="16.9442" width="6.11111" height="6.11111" fill="#0096C7"/>
|
7
|
-
<rect x="23.0557" y="23.0559" width="6.11111" height="6.11111" fill="#0096C7"/>
|
8
|
-
<rect x="23.0557" y="16.9442" width="6.11111" height="6.11111" fill="#00B4D8"/>
|
9
|
-
<rect x="23.0557" y="10.8334" width="6.11111" height="6.11111" fill="#48CAE4"/>
|
10
|
-
</svg>
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
2
|
-
<path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M3 5.25h18m-18 0V18a.75.75 0 0 0 .75.75h16.5A.75.75 0 0 0 21 18V5.25m-18 0 9 8.25 9-8.25" vector-effect="non-scaling-stroke"/>
|
3
|
-
</svg>
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
2
|
-
<path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8.643 9.714 3.5 14.857m0 0L8.643 20M3.5 14.857h10.857a4.571 4.571 0 0 0 4.572-4.571V4" vector-effect="non-scaling-stroke"/>
|
3
|
-
</svg>
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
2
|
-
<path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m11.322 6.826.61-1.046c.735-1.113 1.802-1.291 2.773-.736a2.001 2.001 0 0 1 .744 2.748l-.61 1.045m-.743 5.025-6.498-3.62M21 7.021h-2.11M20.565 3l-1.898 1m1.898 7.046L18.667 10m-8.45 11 4.848-8.318a3.202 3.202 0 0 0-1.189-4.396l-1.59-.91c-1.554-.888-3.541-.36-4.438 1.179L3 16.872 10.218 21Z" vector-effect="non-scaling-stroke"/>
|
3
|
-
</svg>
|