This is an automated email from the ASF dual-hosted git repository.
enzomartellucci pushed a commit to branch enxdev/refactor/antd5/create-wrappers
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to
refs/heads/enxdev/refactor/antd5/create-wrappers by this push:
new d10606db98 refactor(imports): remove direct imports of antd components
from src/components/index and create wrappers for missing components
d10606db98 is described below
commit d10606db9890c9f93cd94c8cb56cf8714e351646
Author: Enzo Martellucci <[email protected]>
AuthorDate: Tue Mar 25 16:35:57 2025 +0100
refactor(imports): remove direct imports of antd components from
src/components/index and create wrappers for missing components
---
.../SqlLab/components/SaveDatasetModal/index.tsx | 2 +-
.../src/SqlLab/components/TablePreview/index.tsx | 3 +-
.../AsyncSelect.stories.tsx | 4 +-
.../{Select => AsyncSelect}/AsyncSelect.test.tsx | 2 +-
.../{Select => AsyncSelect}/AsyncSelect.tsx | 8 +-
.../src/components/AsyncSelect/constants.ts | 53 ++++++++++++
.../AsyncSelect/index.tsx} | 19 +----
.../AutoComplete/AutoComplete.stories.tsx | 2 +-
.../src/components/DatabaseSelector/index.tsx | 3 +-
.../DropdownContainer.stories.tsx | 2 +-
.../src/components/ImportModal/index.tsx | 2 +-
.../src/components/ListView/CardSortSelect.tsx | 2 +-
.../src/components/ListView/Filters/Select.tsx | 4 +-
.../src/components/ListViewCard/index.tsx | 2 +-
.../src/components/Select/CustomTag.tsx | 2 +-
.../src/components/Select/Select.stories.tsx | 2 +-
.../src/components/Select/Select.test.tsx | 2 +-
superset-frontend/src/components/Select/Select.tsx | 6 +-
.../controls.ts => components/Select/index.tsx} | 19 +----
superset-frontend/src/components/Select/utils.tsx | 7 +-
.../src/components/TableSelector/index.tsx | 2 +-
.../src/components/TimezoneSelector/index.tsx | 2 +-
.../src/components/Upload/Upload.stories.tsx | 99 ++++++++++++++++++++++
.../controls.ts => components/Upload/index.tsx} | 25 ++----
superset-frontend/src/components/index.ts | 14 ---
.../dashboard/components/PropertiesModal/index.tsx | 3 +-
.../dashboard/components/RefreshIntervalModal.tsx | 2 +-
.../src/dashboard/components/SliceAdder.tsx | 2 +-
.../CrossFilters/ScopingModal/ScopingTreePanel.tsx | 4 +-
.../FilterBar/FilterBarSettings/index.tsx | 2 +-
.../FiltersConfigModal/FilterTitlePane.tsx | 2 +-
.../FiltersConfigForm/ColumnSelect.tsx | 3 +-
.../FiltersConfigForm/DatasetSelect.tsx | 2 +-
.../FiltersConfigForm/DependencyList.tsx | 2 +-
.../FiltersConfigForm/FiltersConfigForm.tsx | 3 +-
.../explore/components/PropertiesModal/index.tsx | 3 +-
.../src/explore/components/SaveModal.tsx | 2 +-
.../controls/ColorSchemeControl/index.tsx | 2 +-
.../ColumnConfigControl/ControlForm/controls.ts | 2 +-
.../FormattingPopoverContent.tsx | 2 +-
.../controls/CurrencyControl/CurrencyControl.tsx | 4 +-
.../controls/DateFilterControl/DateFilterLabel.tsx | 2 +-
.../DateFilterControl/components/CustomFrame.tsx | 2 +-
.../DndColumnSelectControl/ColumnSelectPopover.tsx | 2 +-
.../index.tsx | 2 +-
.../AdhocFilterEditPopoverSqlTabContent/index.tsx | 2 +-
.../MetricControl/AdhocMetricEditPopover/index.jsx | 2 +-
.../controls/SelectAsyncControl/index.tsx | 4 +-
.../explore/components/controls/SelectControl.jsx | 2 +-
.../controls/TimeSeriesColumnControl/index.jsx | 2 +-
.../src/features/alerts/AlertReportModal.tsx | 4 +-
.../alerts/components/AlertReportCronScheduler.tsx | 2 +-
.../alerts/components/NotificationMethod.tsx | 2 +-
.../src/features/dashboards/DashboardCard.tsx | 2 +-
.../DatabaseConnectionForm/EncryptedField.tsx | 3 +-
.../src/features/databases/DatabaseModal/index.tsx | 3 +-
.../features/databases/UploadDataModel/index.tsx | 5 +-
.../src/features/home/SavedQueries.tsx | 2 +-
.../src/features/rls/RowLevelSecurityModal.tsx | 4 +-
.../src/features/tags/BulkTagModal.tsx | 2 +-
superset-frontend/src/features/tags/TagCard.tsx | 2 +-
superset-frontend/src/features/tags/TagModal.tsx | 2 +-
.../components/Select/SelectFilterPlugin.tsx | 2 +-
.../TimeColumn/TimeColumnFilterPlugin.tsx | 2 +-
.../components/TimeGrain/TimeGrainFilterPlugin.tsx | 2 +-
.../src/pages/ChartCreation/index.tsx | 2 +-
.../Select/types.ts => types/SelectType.ts} | 0
67 files changed, 255 insertions(+), 134 deletions(-)
diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
index 3554668aba..b55999a5d7 100644
--- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx
@@ -20,7 +20,7 @@
import { useCallback, useState, FormEvent } from 'react';
import { Radio, RadioChangeEvent } from 'src/components/Radio';
-import { AsyncSelect } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
import { Input } from 'src/components/Input';
import StyledModal from 'src/components/Modal';
import Button from 'src/components/Button';
diff --git a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx
b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx
index 46a5f60494..12da211879 100644
--- a/superset-frontend/src/SqlLab/components/TablePreview/index.tsx
+++ b/superset-frontend/src/SqlLab/components/TablePreview/index.tsx
@@ -32,7 +32,8 @@ import {
import AutoSizer from 'react-virtualized-auto-sizer';
import Icons from 'src/components/Icons';
import type { SqlLabRootState } from 'src/SqlLab/types';
-import { AntdBreadcrumb as Breadcrumb, Button } from 'src/components';
+import { AntdBreadcrumb as Breadcrumb } from 'src/components';
+import Button from 'src/components/Button';
import Skeleton from 'src/components/Skeleton';
import { Dropdown } from 'src/components/Dropdown';
import FilterableTable from 'src/components/FilterableTable';
diff --git a/superset-frontend/src/components/Select/AsyncSelect.stories.tsx
b/superset-frontend/src/components/AsyncSelect/AsyncSelect.stories.tsx
similarity index 99%
rename from superset-frontend/src/components/Select/AsyncSelect.stories.tsx
rename to superset-frontend/src/components/AsyncSelect/AsyncSelect.stories.tsx
index b4caa0fde2..899e2d96d2 100644
--- a/superset-frontend/src/components/Select/AsyncSelect.stories.tsx
+++ b/superset-frontend/src/components/AsyncSelect/AsyncSelect.stories.tsx
@@ -18,12 +18,12 @@
*/
import { ReactNode, useState, useCallback, useRef, useMemo } from 'react';
import Button from 'src/components/Button';
-import AsyncSelect from './AsyncSelect';
import {
AsyncSelectProps,
AsyncSelectRef,
SelectOptionsTypePage,
-} from './types';
+} from 'src/types/SelectType';
+import AsyncSelect from './AsyncSelect';
export default {
title: 'AsyncSelect',
diff --git a/superset-frontend/src/components/Select/AsyncSelect.test.tsx
b/superset-frontend/src/components/AsyncSelect/AsyncSelect.test.tsx
similarity index 99%
rename from superset-frontend/src/components/Select/AsyncSelect.test.tsx
rename to superset-frontend/src/components/AsyncSelect/AsyncSelect.test.tsx
index bfc05a5d27..c969120030 100644
--- a/superset-frontend/src/components/Select/AsyncSelect.test.tsx
+++ b/superset-frontend/src/components/AsyncSelect/AsyncSelect.test.tsx
@@ -25,7 +25,7 @@ import {
waitFor,
within,
} from 'spec/helpers/testing-library';
-import { AsyncSelect } from 'src/components';
+import AsyncSelect from '.';
const ARIA_LABEL = 'Test';
const NEW_OPTION = 'Kyle';
diff --git a/superset-frontend/src/components/Select/AsyncSelect.tsx
b/superset-frontend/src/components/AsyncSelect/AsyncSelect.tsx
similarity index 99%
rename from superset-frontend/src/components/Select/AsyncSelect.tsx
rename to superset-frontend/src/components/AsyncSelect/AsyncSelect.tsx
index 29c6fd1283..bcddb4d996 100644
--- a/superset-frontend/src/components/Select/AsyncSelect.tsx
+++ b/superset-frontend/src/components/AsyncSelect/AsyncSelect.tsx
@@ -58,7 +58,7 @@ import {
getOption,
isObject,
isEqual as utilsIsEqual,
-} from './utils';
+} from '../Select/utils';
import {
AsyncSelectProps,
AsyncSelectRef,
@@ -67,7 +67,7 @@ import {
SelectOptionsType,
SelectOptionsTypePage,
SelectProps,
-} from './types';
+} from '../../types/SelectType';
import {
StyledCheckOutlined,
StyledContainer,
@@ -76,7 +76,7 @@ import {
StyledHeader,
StyledSelect,
StyledStopOutlined,
-} from './styles';
+} from '../Select/styles';
import {
DEFAULT_PAGE_SIZE,
EMPTY_OPTIONS,
@@ -84,7 +84,7 @@ import {
TOKEN_SEPARATORS,
DEFAULT_SORT_COMPARATOR,
} from './constants';
-import { customTagRender } from './CustomTag';
+import { customTagRender } from '../Select/CustomTag';
const Error = ({ error }: { error: string }) => (
<StyledError>
diff --git a/superset-frontend/src/components/AsyncSelect/constants.ts
b/superset-frontend/src/components/AsyncSelect/constants.ts
new file mode 100644
index 0000000000..248f881df1
--- /dev/null
+++ b/superset-frontend/src/components/AsyncSelect/constants.ts
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+// eslint-disable-next-line no-restricted-imports
+import { LabeledValue as AntdLabeledValue } from 'antd/lib/select'; // TODO:
Remove antd
+import { rankedSearchCompare } from 'src/utils/rankedSearchCompare';
+
+export const MAX_TAG_COUNT = 4;
+
+export const TOKEN_SEPARATORS = [',', '\r\n', '\n', '\t', ';'];
+
+export const EMPTY_OPTIONS = [];
+
+export const DEFAULT_PAGE_SIZE = 100;
+
+export const DEFAULT_SORT_COMPARATOR = (
+ a: AntdLabeledValue,
+ b: AntdLabeledValue,
+ search?: string,
+) => {
+ let aText: string | undefined;
+ let bText: string | undefined;
+ if (typeof a.label === 'string' && typeof b.label === 'string') {
+ aText = a.label;
+ bText = b.label;
+ } else if (typeof a.value === 'string' && typeof b.value === 'string') {
+ aText = a.value;
+ bText = b.value;
+ }
+ // sort selected options first
+ if (typeof aText === 'string' && typeof bText === 'string') {
+ if (search) {
+ return rankedSearchCompare(aText, bText, search);
+ }
+ return aText.localeCompare(bText);
+ }
+ return (a.value as number) - (b.value as number);
+};
diff --git
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
b/superset-frontend/src/components/AsyncSelect/index.tsx
similarity index 52%
copy from
superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
copy to superset-frontend/src/components/AsyncSelect/index.tsx
index beded787bd..131830ae1b 100644
---
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
+++ b/superset-frontend/src/components/AsyncSelect/index.tsx
@@ -16,21 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { sharedControlComponents } from '@superset-ui/chart-controls';
-import { Select } from 'src/components';
-import { Input, InputNumber } from 'src/components/Input';
-import Slider from 'src/components/Slider';
-import CurrencyControl from '../../CurrencyControl';
-import CheckboxControl from '../../CheckboxControl';
+import AsyncSelect from './AsyncSelect';
-export const ControlFormItemComponents = {
- Slider,
- InputNumber,
- Input,
- Select,
- // Directly export Checkbox will result in "using name from external module"
error
- // ref:
https://stackoverflow.com/questions/43900035/ts4023-exported-variable-x-has-or-is-using-name-y-from-external-module-but
- Checkbox: CheckboxControl,
- RadioButtonControl: sharedControlComponents.RadioButtonControl,
- CurrencyControl,
-};
+export default AsyncSelect;
diff --git
a/superset-frontend/src/components/AutoComplete/AutoComplete.stories.tsx
b/superset-frontend/src/components/AutoComplete/AutoComplete.stories.tsx
index 7598654522..dfbeb1ce94 100644
--- a/superset-frontend/src/components/AutoComplete/AutoComplete.stories.tsx
+++ b/superset-frontend/src/components/AutoComplete/AutoComplete.stories.tsx
@@ -188,7 +188,7 @@ export const AutoCompleteStory: Story = {
placeholder: 'Type to search...',
disabled: false,
allowClear: true,
- autoFocus: false,
+ autoFocus: true,
backfill: false,
defaultActiveFirstOption: true,
defaultOpen: false,
diff --git a/superset-frontend/src/components/DatabaseSelector/index.tsx
b/superset-frontend/src/components/DatabaseSelector/index.tsx
index 6b1976c603..b430d0ccc2 100644
--- a/superset-frontend/src/components/DatabaseSelector/index.tsx
+++ b/superset-frontend/src/components/DatabaseSelector/index.tsx
@@ -27,7 +27,8 @@ import {
import { styled, SupersetClient, SupersetError, t } from '@superset-ui/core';
import type { LabeledValue as AntdLabeledValue } from 'antd-v5/es/select';
import rison from 'rison';
-import { AsyncSelect, Select } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
+import Select from 'src/components/Select';
import ErrorMessageWithStackTrace from
'src/components/ErrorMessage/ErrorMessageWithStackTrace';
import Label from 'src/components/Label';
import { FormLabel } from 'src/components/Form';
diff --git
a/superset-frontend/src/components/DropdownContainer/DropdownContainer.stories.tsx
b/superset-frontend/src/components/DropdownContainer/DropdownContainer.stories.tsx
index ed37b488b6..d6eee45ecb 100644
---
a/superset-frontend/src/components/DropdownContainer/DropdownContainer.stories.tsx
+++
b/superset-frontend/src/components/DropdownContainer/DropdownContainer.stories.tsx
@@ -19,7 +19,7 @@
import { useRef, useCallback, useState } from 'react';
import { isEqual } from 'lodash';
import { css } from '@superset-ui/core';
-import Select from '../Select/Select';
+import Select from 'src/components/Select';
import Button from '../Button';
import DropdownContainer, { DropdownContainerProps, Ref } from '.';
diff --git a/superset-frontend/src/components/ImportModal/index.tsx
b/superset-frontend/src/components/ImportModal/index.tsx
index 829c9bc9da..3cf634663e 100644
--- a/superset-frontend/src/components/ImportModal/index.tsx
+++ b/superset-frontend/src/components/ImportModal/index.tsx
@@ -24,7 +24,7 @@ import { styled, t } from '@superset-ui/core';
import Button from 'src/components/Button';
import Modal from 'src/components/Modal';
-import { Upload } from 'src/components';
+import Upload from 'src/components/Upload';
import { useImportResource } from 'src/views/CRUD/hooks';
import { ImportResourceName } from 'src/views/CRUD/types';
import ImportErrorAlert from './ImportErrorAlert';
diff --git a/superset-frontend/src/components/ListView/CardSortSelect.tsx
b/superset-frontend/src/components/ListView/CardSortSelect.tsx
index 1c9edb4e19..f64dd467aa 100644
--- a/superset-frontend/src/components/ListView/CardSortSelect.tsx
+++ b/superset-frontend/src/components/ListView/CardSortSelect.tsx
@@ -18,7 +18,7 @@
*/
import { useState, useMemo } from 'react';
import { styled, t } from '@superset-ui/core';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { FormLabel } from 'src/components/Form';
import { SELECT_WIDTH } from './utils';
import { CardSortSelectOption, SortColumn } from './types';
diff --git a/superset-frontend/src/components/ListView/Filters/Select.tsx
b/superset-frontend/src/components/ListView/Filters/Select.tsx
index edbc5ad452..988d1b1f1e 100644
--- a/superset-frontend/src/components/ListView/Filters/Select.tsx
+++ b/superset-frontend/src/components/ListView/Filters/Select.tsx
@@ -25,10 +25,10 @@ import {
} from 'react';
import { t } from '@superset-ui/core';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { Filter, SelectOption } from 'src/components/ListView/types';
import { FormLabel } from 'src/components/Form';
-import AsyncSelect from 'src/components/Select/AsyncSelect';
+import AsyncSelect from 'src/components/AsyncSelect';
import { FilterContainer, BaseFilter, FilterHandler } from './Base';
interface SelectFilterProps extends BaseFilter {
diff --git a/superset-frontend/src/components/ListViewCard/index.tsx
b/superset-frontend/src/components/ListViewCard/index.tsx
index 7a687d76ea..1d17f50696 100644
--- a/superset-frontend/src/components/ListViewCard/index.tsx
+++ b/superset-frontend/src/components/ListViewCard/index.tsx
@@ -18,7 +18,7 @@
*/
import { ReactNode, ComponentType, ReactElement, FC } from 'react';
import { styled, useTheme } from '@superset-ui/core';
-import { Card } from 'src/components';
+import Card from 'src/components/Card';
import Skeleton from 'src/components/Skeleton';
import { Tooltip } from 'src/components/Tooltip';
import ImageLoader, { BackgroundPosition } from './ImageLoader';
diff --git a/superset-frontend/src/components/Select/CustomTag.tsx
b/superset-frontend/src/components/Select/CustomTag.tsx
index 3f0bc12e4b..bb8876eeb4 100644
--- a/superset-frontend/src/components/Select/CustomTag.tsx
+++ b/superset-frontend/src/components/Select/CustomTag.tsx
@@ -22,7 +22,7 @@ import { Tag as AntdTag } from 'antd'; // TODO: Remove antd
import { styled, useCSSTextTruncation } from '@superset-ui/core';
import Icons from 'src/components/Icons';
import { Tooltip } from '../Tooltip';
-import { CustomTagProps } from './types';
+import { CustomTagProps } from '../../types/SelectType';
import { SELECT_ALL_VALUE } from './utils';
import { NoElement } from './styles';
diff --git a/superset-frontend/src/components/Select/Select.stories.tsx
b/superset-frontend/src/components/Select/Select.stories.tsx
index 7f4dc851af..5fa05891ae 100644
--- a/superset-frontend/src/components/Select/Select.stories.tsx
+++ b/superset-frontend/src/components/Select/Select.stories.tsx
@@ -18,7 +18,7 @@
*/
import { StoryObj } from '@storybook/react';
import ControlHeader from 'src/explore/components/ControlHeader';
-import { SelectOptionsType, SelectProps } from './types';
+import { SelectOptionsType, SelectProps } from '../../types/SelectType';
import Select from './Select';
export default {
diff --git a/superset-frontend/src/components/Select/Select.test.tsx
b/superset-frontend/src/components/Select/Select.test.tsx
index 9e561ffd7f..2b9ca1c0c7 100644
--- a/superset-frontend/src/components/Select/Select.test.tsx
+++ b/superset-frontend/src/components/Select/Select.test.tsx
@@ -25,7 +25,7 @@ import {
waitFor,
within,
} from 'spec/helpers/testing-library';
-import Select from 'src/components/Select/Select';
+import Select from 'src/components/Select';
import { SELECT_ALL_VALUE } from './utils';
type Option = {
diff --git a/superset-frontend/src/components/Select/Select.tsx
b/superset-frontend/src/components/Select/Select.tsx
index 9e06d683df..18e2cbd262 100644
--- a/superset-frontend/src/components/Select/Select.tsx
+++ b/superset-frontend/src/components/Select/Select.tsx
@@ -58,7 +58,11 @@ import {
isObject,
isEqual as utilsIsEqual,
} from './utils';
-import { RawValue, SelectOptionsType, SelectProps } from './types';
+import {
+ RawValue,
+ SelectOptionsType,
+ SelectProps,
+} from '../../types/SelectType';
import {
StyledCheckOutlined,
StyledContainer,
diff --git
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
b/superset-frontend/src/components/Select/index.tsx
similarity index 52%
copy from
superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
copy to superset-frontend/src/components/Select/index.tsx
index beded787bd..c3e843ac07 100644
---
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
+++ b/superset-frontend/src/components/Select/index.tsx
@@ -16,21 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { sharedControlComponents } from '@superset-ui/chart-controls';
-import { Select } from 'src/components';
-import { Input, InputNumber } from 'src/components/Input';
-import Slider from 'src/components/Slider';
-import CurrencyControl from '../../CurrencyControl';
-import CheckboxControl from '../../CheckboxControl';
+import Select from './Select';
-export const ControlFormItemComponents = {
- Slider,
- InputNumber,
- Input,
- Select,
- // Directly export Checkbox will result in "using name from external module"
error
- // ref:
https://stackoverflow.com/questions/43900035/ts4023-exported-variable-x-has-or-is-using-name-y-from-external-module-but
- Checkbox: CheckboxControl,
- RadioButtonControl: sharedControlComponents.RadioButtonControl,
- CurrencyControl,
-};
+export default Select;
diff --git a/superset-frontend/src/components/Select/utils.tsx
b/superset-frontend/src/components/Select/utils.tsx
index 0c21ec228e..a6c1af02c9 100644
--- a/superset-frontend/src/components/Select/utils.tsx
+++ b/superset-frontend/src/components/Select/utils.tsx
@@ -22,7 +22,12 @@ import AntdSelect, { LabeledValue as AntdLabeledValue } from
'antd/lib/select';
import { ReactElement, RefObject } from 'react';
import Icons from 'src/components/Icons';
import { StyledHelperText, StyledLoadingText, StyledSpin } from './styles';
-import { LabeledValue, RawValue, SelectOptionsType, V } from './types';
+import {
+ LabeledValue,
+ RawValue,
+ SelectOptionsType,
+ V,
+} from '../../types/SelectType';
const { Option } = AntdSelect;
diff --git a/superset-frontend/src/components/TableSelector/index.tsx
b/superset-frontend/src/components/TableSelector/index.tsx
index 9d4f916032..69acf9edc9 100644
--- a/superset-frontend/src/components/TableSelector/index.tsx
+++ b/superset-frontend/src/components/TableSelector/index.tsx
@@ -32,7 +32,7 @@ import {
getClientErrorMessage,
getClientErrorObject,
} from '@superset-ui/core';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { FormLabel } from 'src/components/Form';
import Icons from 'src/components/Icons';
import DatabaseSelector, {
diff --git a/superset-frontend/src/components/TimezoneSelector/index.tsx
b/superset-frontend/src/components/TimezoneSelector/index.tsx
index 9d6ea4479c..8cadaaf075 100644
--- a/superset-frontend/src/components/TimezoneSelector/index.tsx
+++ b/superset-frontend/src/components/TimezoneSelector/index.tsx
@@ -19,7 +19,7 @@
import { useEffect, useMemo } from 'react';
import { t } from '@superset-ui/core';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { isDST, extendedDayjs } from 'src/utils/dates';
const DEFAULT_TIMEZONE = {
diff --git a/superset-frontend/src/components/Upload/Upload.stories.tsx
b/superset-frontend/src/components/Upload/Upload.stories.tsx
new file mode 100644
index 0000000000..50e60fe9aa
--- /dev/null
+++ b/superset-frontend/src/components/Upload/Upload.stories.tsx
@@ -0,0 +1,99 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import type { Meta, StoryObj } from '@storybook/react';
+import Icons from 'src/components/Icons';
+import Button from 'src/components/Button';
+import Upload from '.';
+
+const meta: Meta<typeof Upload> = {
+ title: 'Upload',
+ component: Upload,
+ argTypes: {
+ accept: { control: 'text', description: 'File types that can be accepted'
},
+ action: { control: 'text', description: 'Uploading URL' },
+ data: { control: 'object', description: 'Uploading extra params' },
+ defaultFileList: {
+ control: 'object',
+ description: 'Default list of uploaded files',
+ },
+ directory: {
+ control: 'boolean',
+ description: 'Support whole directory upload',
+ },
+ disabled: { control: 'boolean', description: 'Disable upload button' },
+ fileList: {
+ control: 'object',
+ description: 'List of uploaded files (controlled)',
+ },
+ headers: { control: 'object', description: 'Set request headers' },
+ listType: {
+ control: 'text',
+ description: 'Built-in stylesheets (text, picture, etc.)',
+ },
+ maxCount: {
+ control: 'number',
+ description: 'Limit number of uploaded files',
+ },
+ method: {
+ control: 'text',
+ description: 'The HTTP method of upload request',
+ },
+ multiple: {
+ control: 'boolean',
+ description: 'Support multiple file selection',
+ },
+ name: { control: 'text', description: 'The name of uploading file' },
+ openFileDialogOnClick: {
+ control: 'boolean',
+ description: 'Click open file dialog',
+ },
+ progress: { control: 'object', description: 'Custom progress bar' },
+ showUploadList: {
+ control: 'object',
+ description: 'Customize upload list display',
+ },
+ withCredentials: {
+ control: 'boolean',
+ description: 'Send cookies with ajax upload',
+ },
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof Upload>;
+
+export const Default: Story = {
+ render: args => (
+ <Upload {...args}>
+ <Button icon={<Icons.UploadOutlined iconColor="light" iconSize="l" />}>
+ Click to Upload
+ </Button>
+ </Upload>
+ ),
+ args: {
+ name: 'file',
+ multiple: true,
+ action: '',
+ disabled: false,
+ listType: 'text',
+ showUploadList: true,
+ method: 'post',
+ withCredentials: false,
+ },
+};
diff --git
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
b/superset-frontend/src/components/Upload/index.tsx
similarity index 52%
copy from
superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
copy to superset-frontend/src/components/Upload/index.tsx
index beded787bd..b0f5b1f1de 100644
---
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
+++ b/superset-frontend/src/components/Upload/index.tsx
@@ -16,21 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { sharedControlComponents } from '@superset-ui/chart-controls';
-import { Select } from 'src/components';
-import { Input, InputNumber } from 'src/components/Input';
-import Slider from 'src/components/Slider';
-import CurrencyControl from '../../CurrencyControl';
-import CheckboxControl from '../../CheckboxControl';
+// Vanilla Ant Design components from v4 that require migration
+// eslint-disable-next-line no-restricted-imports
+import { Upload } from 'antd'; // TODO: Remove antd
+// Vanilla Ant Design components from v4 that require migration
+// eslint-disable-next-line no-restricted-imports
+import { UploadChangeParam, UploadFile } from 'antd/lib/upload/interface'; //
TODO: Remove antd NB: in this case use lib to avoid to encounter empty export
-export const ControlFormItemComponents = {
- Slider,
- InputNumber,
- Input,
- Select,
- // Directly export Checkbox will result in "using name from external module"
error
- // ref:
https://stackoverflow.com/questions/43900035/ts4023-exported-variable-x-has-or-is-using-name-y-from-external-module-but
- Checkbox: CheckboxControl,
- RadioButtonControl: sharedControlComponents.RadioButtonControl,
- CurrencyControl,
-};
+export default Upload;
+export { UploadChangeParam, UploadFile };
diff --git a/superset-frontend/src/components/index.ts
b/superset-frontend/src/components/index.ts
index 95bfaff829..995b594184 100644
--- a/superset-frontend/src/components/index.ts
+++ b/superset-frontend/src/components/index.ts
@@ -16,20 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-/*
- * Re-exporting of components in src/components to facilitate
- * their imports by other components.
- * E.g. import { Select } from 'src/components'
- */
-export { default as Select } from './Select/Select';
-export { default as AsyncSelect } from './Select/AsyncSelect';
-export { default as Button } from './Button';
-export { default as Card } from './Card';
-// Vanilla Ant Design components from v4 that require migration
-// eslint-disable-next-line no-restricted-imports
-export { Upload } from 'antd'; // TODO: Remove antd
-
/*
* Components that conflict with the ones in src/components.
* We should try to avoid using Ant Design directly. The components
diff --git
a/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
b/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
index a027b4dfcb..13c04a9f32 100644
--- a/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
+++ b/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
@@ -22,7 +22,8 @@ import { Input } from 'src/components/Input';
import { FormItem } from 'src/components/Form';
import jsonStringify from 'json-stringify-pretty-compact';
import Button from 'src/components/Button';
-import { AntdForm, AsyncSelect } from 'src/components';
+import { AntdForm } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
import { Row, Col } from 'src/components/Grid';
import rison from 'rison';
import {
diff --git
a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
index 48fbaadd91..5062fb4121 100644
--- a/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
+++ b/superset-frontend/src/dashboard/components/RefreshIntervalModal.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import { createRef, PureComponent } from 'react';
-import Select from 'src/components/Select/Select';
+import Select from 'src/components/Select';
import { t, styled } from '@superset-ui/core';
import Alert from 'src/components/Alert';
import Button from 'src/components/Button';
diff --git a/superset-frontend/src/dashboard/components/SliceAdder.tsx
b/superset-frontend/src/dashboard/components/SliceAdder.tsx
index cad502f14f..1752cc8cd3 100644
--- a/superset-frontend/src/dashboard/components/SliceAdder.tsx
+++ b/superset-frontend/src/dashboard/components/SliceAdder.tsx
@@ -24,7 +24,7 @@ import { FixedSizeList as List } from 'react-window';
import { createFilter } from 'react-search-input';
import { t, styled, css } from '@superset-ui/core';
import { Input } from 'src/components/Input';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import Loading from 'src/components/Loading';
import Button from 'src/components/Button';
import Icons from 'src/components/Icons';
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx
index ea3dee7553..43137e4dda 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/CrossFilters/ScopingModal/ScopingTreePanel.tsx
@@ -26,7 +26,7 @@ import {
t,
useTheme,
} from '@superset-ui/core';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { noOp } from 'src/utils/common';
import ScopingTree from
'src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree';
import {
@@ -36,7 +36,7 @@ import {
RootState,
} from 'src/dashboard/types';
import { CHART_TYPE } from 'src/dashboard/util/componentTypes';
-import { SelectOptionsType } from 'src/components/Select/types';
+import { SelectOptionsType } from 'src/types/SelectType';
import Icons from 'src/components/Icons';
import { Tooltip } from 'src/components/Tooltip';
import Alert from 'src/components/Alert';
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx
index 7db981d69a..aa83d1c02e 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarSettings/index.tsx
@@ -29,7 +29,7 @@ import {
import Icons from 'src/components/Icons';
import Checkbox from 'src/components/Checkbox';
import { Dropdown } from 'src/components/Dropdown';
-import { Button } from 'src/components';
+import Button from 'src/components/Button';
import { Space } from 'src/components/Space';
import { clearDataMaskState } from 'src/dataMask/actions';
import { useFilters } from
'src/dashboard/components/nativeFilters/FilterBar/state';
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
index 7ef44bc8a0..339f8946b5 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitlePane.tsx
@@ -19,7 +19,7 @@
import { useRef, FC } from 'react';
import { NativeFilterType, styled, t, useTheme } from '@superset-ui/core';
-import { Button } from 'src/components';
+import Button from 'src/components/Button';
import Icons from 'src/components/Icons';
import FilterTitleContainer from './FilterTitleContainer';
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
index 72d4197acc..a90f81cd30 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/ColumnSelect.tsx
@@ -25,7 +25,8 @@ import {
useChangeEffect,
getClientErrorObject,
} from '@superset-ui/core';
-import { Select, FormInstance } from 'src/components';
+import Select from 'src/components/Select';
+import { FormInstance } from 'src/components';
import { useToasts } from 'src/components/MessageToasts/withToasts';
import { cachedSupersetGet } from 'src/utils/cachedSupersetGet';
import { NativeFiltersForm } from '../types';
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx
index 4683a69ec5..1415fc313d 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx
@@ -24,7 +24,7 @@ import {
ClientErrorObject,
getClientErrorObject,
} from '@superset-ui/core';
-import { AsyncSelect } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
import { cachedSupersetGet } from 'src/utils/cachedSupersetGet';
import {
Dataset,
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx
index 5b1c39b096..f5e75ddcdd 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx
@@ -19,7 +19,7 @@
import { useState } from 'react';
import { styled, t } from '@superset-ui/core';
import Icons from 'src/components/Icons';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { CollapsibleControl } from './CollapsibleControl';
import { INPUT_WIDTH } from './constants';
diff --git
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
index 912dccb214..ef17b2a682 100644
---
a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
+++
b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
@@ -59,7 +59,8 @@ import { PluginFilterSelectCustomizeProps } from
'src/filters/components/Select/
import { useSelector } from 'react-redux';
import { getChartDataRequest } from 'src/components/Chart/chartAction';
import { Input } from 'src/components/Input';
-import { Select, FormInstance } from 'src/components';
+import { FormInstance } from 'src/components';
+import Select from 'src/components/Select';
import Collapse from 'src/components/Collapse';
import BasicErrorAlert from 'src/components/ErrorMessage/BasicErrorAlert';
import ErrorMessageWithStackTrace from
'src/components/ErrorMessage/ErrorMessageWithStackTrace';
diff --git a/superset-frontend/src/explore/components/PropertiesModal/index.tsx
b/superset-frontend/src/explore/components/PropertiesModal/index.tsx
index a6debc9053..3eac7f0cc1 100644
--- a/superset-frontend/src/explore/components/PropertiesModal/index.tsx
+++ b/superset-frontend/src/explore/components/PropertiesModal/index.tsx
@@ -21,7 +21,8 @@ import { ChangeEvent, useMemo, useState, useCallback,
useEffect } from 'react';
import Modal from 'src/components/Modal';
import { Input } from 'src/components/Input';
import Button from 'src/components/Button';
-import { AsyncSelect, AntdForm } from 'src/components';
+import { AntdForm } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
import { Row, Col } from 'src/components/Grid';
// eslint-disable-next-line no-restricted-imports
import { SelectValue } from 'antd/lib/select'; // TODO: Remove antd
diff --git a/superset-frontend/src/explore/components/SaveModal.tsx
b/superset-frontend/src/explore/components/SaveModal.tsx
index 3357bffd65..be21d5f9a2 100644
--- a/superset-frontend/src/explore/components/SaveModal.tsx
+++ b/superset-frontend/src/explore/components/SaveModal.tsx
@@ -38,7 +38,7 @@ import Alert from 'src/components/Alert';
import Modal from 'src/components/Modal';
import { Radio } from 'src/components/Radio';
import Button from 'src/components/Button';
-import { AsyncSelect } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
import Loading from 'src/components/Loading';
import { canUserEditDashboard } from 'src/dashboard/util/permissionUtils';
import { setSaveChartModalVisibility } from
'src/explore/actions/saveModalActions';
diff --git
a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx
b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx
index c87031c7e7..719d01c924 100644
---
a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx
+++
b/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx
@@ -34,7 +34,7 @@ import { sortBy } from 'lodash';
import ControlHeader from 'src/explore/components/ControlHeader';
import { Tooltip } from 'src/components/Tooltip';
import Icons from 'src/components/Icons';
-import { SelectOptionsType } from 'src/components/Select/types';
+import { SelectOptionsType } from 'src/types/SelectType';
import { StyledSelect } from 'src/components/Select/styles';
import { handleFilterOptionHelper } from 'src/components/Select/utils';
import { getColorNamespace } from 'src/utils/colorScheme';
diff --git
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
index beded787bd..1fba44a534 100644
---
a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
+++
b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ControlForm/controls.ts
@@ -17,7 +17,7 @@
* under the License.
*/
import { sharedControlComponents } from '@superset-ui/chart-controls';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { Input, InputNumber } from 'src/components/Input';
import Slider from 'src/components/Slider';
import CurrencyControl from '../../CurrencyControl';
diff --git
a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx
b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx
index 820b213f6c..87bb77945b 100644
---
a/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx
+++
b/superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx
@@ -24,7 +24,7 @@ import {
MultipleValueComparators,
} from '@superset-ui/chart-controls';
import { Form, FormItem, FormProps } from 'src/components/Form';
-import Select from 'src/components/Select/Select';
+import Select from 'src/components/Select';
import { Col, Row } from 'src/components/Grid';
import { InputNumber } from 'src/components/Input';
import Button from 'src/components/Button';
diff --git
a/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx
b/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx
index 5517141261..47661dca74 100644
---
a/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx
+++
b/superset-frontend/src/explore/components/controls/CurrencyControl/CurrencyControl.tsx
@@ -27,9 +27,9 @@ import {
t,
} from '@superset-ui/core';
import { CSSObject } from '@emotion/react';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { ViewState } from 'src/views/types';
-import { SelectProps } from 'src/components/Select/types';
+import { SelectProps } from 'src/types/SelectType';
import ControlHeader from '../../ControlHeader';
export interface CurrencyControlProps {
diff --git
a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
index 187ae89927..6c5434f5dd 100644
---
a/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
+++
b/superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
@@ -32,7 +32,7 @@ import ControlHeader from
'src/explore/components/ControlHeader';
import Modal from 'src/components/Modal';
import { Divider } from 'src/components/Divider';
import Icons from 'src/components/Icons';
-import Select from 'src/components/Select/Select';
+import Select from 'src/components/Select';
import { Tooltip } from 'src/components/Tooltip';
import { useDebouncedEffect } from 'src/explore/exploreUtils';
import { SLOW_DEBOUNCE } from 'src/constants';
diff --git
a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx
b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx
index 1164d246fd..6970b27496 100644
---
a/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx
+++
b/superset-frontend/src/explore/components/controls/DateFilterControl/components/CustomFrame.tsx
@@ -22,7 +22,7 @@ import { Col, Row } from 'src/components/Grid';
import { InputNumber } from 'src/components/Input';
import { DatePicker } from 'src/components/DatePicker';
import { Radio } from 'src/components/Radio';
-import Select from 'src/components/Select/Select';
+import Select from 'src/components/Select';
import {
SINCE_GRAIN_OPTIONS,
SINCE_MODE_OPTIONS,
diff --git
a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx
b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx
index 31acf69dfa..45aa6cd786 100644
---
a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx
+++
b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx
@@ -38,7 +38,7 @@ import {
import { ColumnMeta, isSavedExpression } from '@superset-ui/chart-controls';
import Tabs from 'src/components/Tabs';
import Button from 'src/components/Button';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { Form, FormItem } from 'src/components/Form';
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
diff --git
a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx
b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx
index 2c1ff822ac..3e48830677 100644
---
a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx
+++
b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx
@@ -18,7 +18,7 @@
*/
import { FC, ChangeEvent, useEffect, useState } from 'react';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import {
isFeatureEnabled,
FeatureFlag,
diff --git
a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx
b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx
index 72efb3c521..2fed0eda2f 100644
---
a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx
+++
b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent/index.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import { useEffect, useRef, useMemo } from 'react';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { css, styled, t, useTheme } from '@superset-ui/core';
import { SQLEditor } from 'src/components/AsyncAceEditor';
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
diff --git
a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx
b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx
index d7aaf31242..6bf3d04aa0 100644
---
a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx
+++
b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx
@@ -28,7 +28,7 @@ import {
} from '@superset-ui/core';
import Tabs from 'src/components/Tabs';
import Button from 'src/components/Button';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { Tooltip } from 'src/components/Tooltip';
import { EmptyState } from 'src/components/EmptyState';
import { Form, FormItem } from 'src/components/Form';
diff --git
a/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
b/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
index 2ce48f8cc2..6c69b9b1cb 100644
---
a/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
+++
b/superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
@@ -19,8 +19,8 @@
import { useEffect, useState } from 'react';
import { t, SupersetClient, getClientErrorObject } from '@superset-ui/core';
import ControlHeader from 'src/explore/components/ControlHeader';
-import { Select } from 'src/components';
-import { SelectOptionsType, SelectProps } from 'src/components/Select/types';
+import Select from 'src/components/Select';
+import { SelectOptionsType, SelectProps } from 'src/types/SelectType';
// eslint-disable-next-line no-restricted-imports
import { SelectValue, LabeledValue } from 'antd/lib/select'; // TODO: Remove
antd
import withToasts from 'src/components/MessageToasts/withToasts';
diff --git
a/superset-frontend/src/explore/components/controls/SelectControl.jsx
b/superset-frontend/src/explore/components/controls/SelectControl.jsx
index 284c72c8ed..41f4f671ab 100644
--- a/superset-frontend/src/explore/components/controls/SelectControl.jsx
+++ b/superset-frontend/src/explore/components/controls/SelectControl.jsx
@@ -19,7 +19,7 @@
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { css, isEqualArray, t } from '@superset-ui/core';
-import Select from 'src/components/Select/Select';
+import Select from 'src/components/Select';
import ControlHeader from 'src/explore/components/ControlHeader';
const propTypes = {
diff --git
a/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx
b/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx
index 9bf5da50a1..e9825f4fea 100644
---
a/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx
+++
b/superset-frontend/src/explore/components/controls/TimeSeriesColumnControl/index.jsx
@@ -20,7 +20,7 @@ import { Component } from 'react';
import PropTypes from 'prop-types';
import { Input } from 'src/components/Input';
import Button from 'src/components/Button';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { Row, Col } from 'src/components/Grid';
import { t, styled } from '@superset-ui/core';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx
b/superset-frontend/src/features/alerts/AlertReportModal.tsx
index f9e0026a5e..51d4c7eeae 100644
--- a/superset-frontend/src/features/alerts/AlertReportModal.tsx
+++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx
@@ -47,7 +47,9 @@ import TimezoneSelector from
'src/components/TimezoneSelector';
import { propertyComparator } from 'src/components/Select/utils';
import withToasts from 'src/components/MessageToasts/withToasts';
import Owner from 'src/types/Owner';
-import { AntdCheckbox, AsyncSelect, Select } from 'src/components';
+import { AntdCheckbox } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
+import Select from 'src/components/Select';
import TreeSelect from 'src/components/TreeSelect';
import TextAreaControl from 'src/explore/components/controls/TextAreaControl';
import { useCommonConf } from 'src/features/databases/state';
diff --git
a/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx
b/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx
index 27b4c625df..c10718c537 100644
---
a/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx
+++
b/superset-frontend/src/features/alerts/components/AlertReportCronScheduler.tsx
@@ -20,7 +20,7 @@ import { useState, useCallback, FocusEvent, FC } from 'react';
import { t, useTheme } from '@superset-ui/core';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { Input } from 'src/components/Input';
import { CronPicker, CronError } from 'src/components/CronPicker';
import { StyledInputContainer } from '../AlertReportModal';
diff --git
a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx
b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx
index ac18ceb47b..98bee3309a 100644
--- a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx
+++ b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx
@@ -34,7 +34,7 @@ import {
t,
useTheme,
} from '@superset-ui/core';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import Icons from 'src/components/Icons';
import RefreshLabel from 'src/components/RefreshLabel';
import {
diff --git a/superset-frontend/src/features/dashboards/DashboardCard.tsx
b/superset-frontend/src/features/dashboards/DashboardCard.tsx
index f3b586b269..37bf026f37 100644
--- a/superset-frontend/src/features/dashboards/DashboardCard.tsx
+++ b/superset-frontend/src/features/dashboards/DashboardCard.tsx
@@ -33,7 +33,7 @@ import { PublishedLabel } from 'src/components/Label';
import FacePile from 'src/components/FacePile';
import FaveStar from 'src/components/FaveStar';
import { Dashboard } from 'src/views/CRUD/types';
-import { Button } from 'src/components';
+import Button from 'src/components/Button';
interface DashboardCardProps {
isChart?: boolean;
diff --git
a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx
b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx
index 93b9ce7cb3..996401f58d 100644
---
a/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx
+++
b/superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx
@@ -18,7 +18,8 @@
*/
import { useRef, useState } from 'react';
import { SupersetTheme, t } from '@superset-ui/core';
-import { Button, AntdSelect } from 'src/components';
+import { AntdSelect } from 'src/components';
+import Button from 'src/components/Button';
import FormLabel from 'src/components/Form/FormLabel';
import Icons from 'src/components/Icons';
import { DatabaseParameters, FieldPropTypes } from '../../types';
diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.tsx
b/superset-frontend/src/features/databases/DatabaseModal/index.tsx
index 61c087c72b..e85e311528 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/index.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/index.tsx
@@ -41,7 +41,8 @@ import { setItem, LocalStorageKeys } from
'src/utils/localStorageHelpers';
// eslint-disable-next-line no-restricted-imports
import { UploadChangeParam, UploadFile } from 'antd/lib/upload/interface'; //
TODO: Remove antd
import Tabs from 'src/components/Tabs';
-import { AntdSelect, Upload } from 'src/components';
+import { AntdSelect } from 'src/components';
+import Upload from 'src/components/Upload';
import Alert from 'src/components/Alert';
import Modal from 'src/components/Modal';
import Button from 'src/components/Button';
diff --git a/superset-frontend/src/features/databases/UploadDataModel/index.tsx
b/superset-frontend/src/features/databases/UploadDataModel/index.tsx
index b95565bfc0..a26bfc696f 100644
--- a/superset-frontend/src/features/databases/UploadDataModel/index.tsx
+++ b/superset-frontend/src/features/databases/UploadDataModel/index.tsx
@@ -35,7 +35,10 @@ import Modal from 'src/components/Modal';
import Button from 'src/components/Button';
import { Switch, SwitchProps } from 'src/components/Switch';
import Collapse from 'src/components/Collapse';
-import { AntdForm, AsyncSelect, Select, Upload } from 'src/components';
+import { AntdForm } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
+import Upload from 'src/components/Upload';
+import Select from 'src/components/Select';
import { Row, Col } from 'src/components/Grid';
import Icons from 'src/components/Icons';
import { Input, InputNumber } from 'src/components/Input';
diff --git a/superset-frontend/src/features/home/SavedQueries.tsx
b/superset-frontend/src/features/home/SavedQueries.tsx
index ee1f7363ab..f8e0ad7c30 100644
--- a/superset-frontend/src/features/home/SavedQueries.tsx
+++ b/superset-frontend/src/features/home/SavedQueries.tsx
@@ -39,7 +39,7 @@ import {
PAGE_SIZE,
shortenSQL,
} from 'src/views/CRUD/utils';
-import { Button } from 'src/components';
+import Button from 'src/components/Button';
import SubMenu from './SubMenu';
import EmptyState from './EmptyState';
import { WelcomeTable } from './types';
diff --git a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
index db7a976e68..915b9aeeae 100644
--- a/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
+++ b/superset-frontend/src/features/rls/RowLevelSecurityModal.tsx
@@ -21,9 +21,9 @@ import { css, styled, SupersetClient, useTheme, t } from
'@superset-ui/core';
import Modal from 'src/components/Modal';
import { useCallback, useEffect, useMemo, useState } from 'react';
import Icons from 'src/components/Icons';
-import Select from 'src/components/Select/Select';
+import Select from 'src/components/Select';
import { Input } from 'src/components/Input';
-import AsyncSelect from 'src/components/Select/AsyncSelect';
+import AsyncSelect from 'src/components/AsyncSelect';
import rison from 'rison';
import { LabeledErrorBoundInput } from 'src/components/Form';
import InfoTooltip from 'src/components/InfoTooltip';
diff --git a/superset-frontend/src/features/tags/BulkTagModal.tsx
b/superset-frontend/src/features/tags/BulkTagModal.tsx
index 185113f43f..e033067557 100644
--- a/superset-frontend/src/features/tags/BulkTagModal.tsx
+++ b/superset-frontend/src/features/tags/BulkTagModal.tsx
@@ -21,7 +21,7 @@ import { useState, useEffect, FC } from 'react';
import { t, styled, SupersetClient } from '@superset-ui/core';
import { FormLabel } from 'src/components/Form';
import Modal from 'src/components/Modal';
-import AsyncSelect from 'src/components/Select/AsyncSelect';
+import AsyncSelect from 'src/components/AsyncSelect';
import Button from 'src/components/Button';
import { loadTags } from 'src/components/Tag/utils';
import { TaggableResourceOption } from 'src/features/tags/TagModal';
diff --git a/superset-frontend/src/features/tags/TagCard.tsx
b/superset-frontend/src/features/tags/TagCard.tsx
index 5ffd3bcd5d..d19f2ea7ad 100644
--- a/superset-frontend/src/features/tags/TagCard.tsx
+++ b/superset-frontend/src/features/tags/TagCard.tsx
@@ -26,7 +26,7 @@ import ListViewCard from 'src/components/ListViewCard';
import Icons from 'src/components/Icons';
import { Tag } from 'src/views/CRUD/types';
import { deleteTags } from 'src/features/tags/tags';
-import { Button } from 'src/components';
+import Button from 'src/components/Button';
interface TagCardProps {
tag: Tag;
diff --git a/superset-frontend/src/features/tags/TagModal.tsx
b/superset-frontend/src/features/tags/TagModal.tsx
index bc4d33ea92..ccb19411a5 100644
--- a/superset-frontend/src/features/tags/TagModal.tsx
+++ b/superset-frontend/src/features/tags/TagModal.tsx
@@ -20,7 +20,7 @@ import { ChangeEvent, useState, useEffect, FC } from 'react';
import rison from 'rison';
import Modal from 'src/components/Modal';
-import AsyncSelect from 'src/components/Select/AsyncSelect';
+import AsyncSelect from 'src/components/AsyncSelect';
import { FormLabel } from 'src/components/Form';
import { t, styled, SupersetClient } from '@superset-ui/core';
// eslint-disable-next-line no-restricted-imports
diff --git
a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
index 23447fb295..44449f0425 100644
--- a/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
+++ b/superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx
@@ -34,7 +34,7 @@ import {
import { LabeledValue as AntdLabeledValue } from 'antd/lib/select'; // TODO:
Remove antd
import { debounce } from 'lodash';
import { useImmerReducer } from 'use-immer';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
import { SLOW_DEBOUNCE } from 'src/constants';
import { hasOption, propertyComparator } from 'src/components/Select/utils';
import { FilterBarOrientation } from 'src/dashboard/types';
diff --git
a/superset-frontend/src/filters/components/TimeColumn/TimeColumnFilterPlugin.tsx
b/superset-frontend/src/filters/components/TimeColumn/TimeColumnFilterPlugin.tsx
index 0e456b35c0..39007cf717 100644
---
a/superset-frontend/src/filters/components/TimeColumn/TimeColumnFilterPlugin.tsx
+++
b/superset-frontend/src/filters/components/TimeColumn/TimeColumnFilterPlugin.tsx
@@ -24,7 +24,7 @@ import {
tn,
} from '@superset-ui/core';
import { useEffect, useState } from 'react';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
// eslint-disable-next-line no-restricted-imports
import { FormItemProps } from 'antd/lib/form'; // TODO: Remove antd
import { FilterPluginStyle, StyledFormItem, StatusMessage } from '../common';
diff --git
a/superset-frontend/src/filters/components/TimeGrain/TimeGrainFilterPlugin.tsx
b/superset-frontend/src/filters/components/TimeGrain/TimeGrainFilterPlugin.tsx
index e8381f53e5..be560e6a54 100644
---
a/superset-frontend/src/filters/components/TimeGrain/TimeGrainFilterPlugin.tsx
+++
b/superset-frontend/src/filters/components/TimeGrain/TimeGrainFilterPlugin.tsx
@@ -24,7 +24,7 @@ import {
tn,
} from '@superset-ui/core';
import { useEffect, useMemo, useState } from 'react';
-import { Select } from 'src/components';
+import Select from 'src/components/Select';
// eslint-disable-next-line no-restricted-imports
import { FormItemProps } from 'antd/lib/form'; // TODO: Remove antd
import { FilterPluginStyle, StyledFormItem, StatusMessage } from '../common';
diff --git a/superset-frontend/src/pages/ChartCreation/index.tsx
b/superset-frontend/src/pages/ChartCreation/index.tsx
index 6ae872c5e1..f3b76638a9 100644
--- a/superset-frontend/src/pages/ChartCreation/index.tsx
+++ b/superset-frontend/src/pages/ChartCreation/index.tsx
@@ -31,7 +31,7 @@ import { getUrlParam } from 'src/utils/urlUtils';
import { FilterPlugins, URL_PARAMS } from 'src/constants';
import { Link, withRouter, RouteComponentProps } from 'react-router-dom';
import Button from 'src/components/Button';
-import { AsyncSelect } from 'src/components';
+import AsyncSelect from 'src/components/AsyncSelect';
import { Steps } from 'src/components/Steps';
import withToasts from 'src/components/MessageToasts/withToasts';
diff --git a/superset-frontend/src/components/Select/types.ts
b/superset-frontend/src/types/SelectType.ts
similarity index 100%
rename from superset-frontend/src/components/Select/types.ts
rename to superset-frontend/src/types/SelectType.ts