From 422081485bf8e9646921f48d7b1f8d54b9854bd7 Mon Sep 17 00:00:00 2001 From: stanislavh Date: Thu, 2 May 2024 17:29:48 +0200 Subject: SONAR-22168 Align InputSelect --- .../input/DatePickerCustomCalendarNavigation.tsx | 2 +- .../src/components/input/DiscreetSelect.tsx | 46 ++-- .../src/components/input/InputSelect.tsx | 233 --------------------- .../src/components/input/SearchSelect.tsx | 26 +-- .../src/components/input/SearchSelectDropdown.tsx | 8 +- .../input/__tests__/DiscreetSelect-test.tsx | 33 ++- .../input/__tests__/InputSelect-test.tsx | 89 -------- .../input/__tests__/SearchSelectDropdown-test.tsx | 2 +- .../design-system/src/components/input/index.ts | 1 - .../src/sonar-aligned/components/index.ts | 1 + .../sonar-aligned/components/input/InputSelect.tsx | 110 ++++++++++ .../components/input/SelectCommon.tsx | 183 ++++++++++++++++ .../input/__tests__/InputSelect-test.tsx | 101 +++++++++ .../src/sonar-aligned/components/input/index.ts | 22 ++ .../background-tasks/components/StatusFilter.tsx | 4 +- .../background-tasks/components/TypesFilter.tsx | 4 +- .../components/CustomRuleFormModal.tsx | 2 +- .../create/project/Azure/AzureProjectCreate.tsx | 4 +- .../BitbucketCloud/BitbucketCloudProjectCreate.tsx | 5 +- .../create/project/Github/GitHubProjectCreate.tsx | 2 +- .../create/project/Gitlab/GitlabProjectCreate.tsx | 2 +- .../js/apps/issues/components/AssigneeSelect.tsx | 4 +- .../js/apps/issues/components/BulkChangeModal.tsx | 4 +- .../project/components/ApplyTemplate.tsx | 2 +- .../components/ProjectActivityPageFilters.tsx | 4 +- .../apps/projects/components/PerspectiveSelect.tsx | 2 +- .../projectsManagement/BulkApplyTemplateModal.tsx | 2 +- .../QualityGatePermissionsAddModalRenderer.tsx | 4 +- 28 files changed, 486 insertions(+), 416 deletions(-) delete mode 100644 server/sonar-web/design-system/src/components/input/InputSelect.tsx delete mode 100644 server/sonar-web/design-system/src/components/input/__tests__/InputSelect-test.tsx create mode 100644 server/sonar-web/design-system/src/sonar-aligned/components/input/InputSelect.tsx create mode 100644 server/sonar-web/design-system/src/sonar-aligned/components/input/SelectCommon.tsx create mode 100644 server/sonar-web/design-system/src/sonar-aligned/components/input/__tests__/InputSelect-test.tsx create mode 100644 server/sonar-web/design-system/src/sonar-aligned/components/input/index.ts (limited to 'server') diff --git a/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx b/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx index ac651e16c34..467fdab81a4 100644 --- a/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx +++ b/server/sonar-web/design-system/src/components/input/DatePickerCustomCalendarNavigation.tsx @@ -33,9 +33,9 @@ import { useDayPicker, } from 'react-day-picker'; import { useIntl } from 'react-intl'; +import { InputSelect } from '../../sonar-aligned/components/input'; import { InteractiveIcon } from '../InteractiveIcon'; import { ChevronLeftIcon, ChevronRightIcon } from '../icons'; -import { InputSelect } from './InputSelect'; const YEARS_TO_DISPLAY = 10; const MONTHS_IN_A_YEAR = 12; diff --git a/server/sonar-web/design-system/src/components/input/DiscreetSelect.tsx b/server/sonar-web/design-system/src/components/input/DiscreetSelect.tsx index 13b6068c3fa..6981cefffc5 100644 --- a/server/sonar-web/design-system/src/components/input/DiscreetSelect.tsx +++ b/server/sonar-web/design-system/src/components/input/DiscreetSelect.tsx @@ -18,44 +18,30 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import styled from '@emotion/styled'; +import { GroupBase, OnChangeValue } from 'react-select'; import tw from 'twin.macro'; import { themeBorder, themeColor, themeContrast } from '../../helpers/theme'; -import { InputSizeKeys } from '../../types/theme'; -import { InputSelect, LabelValueSelectOption } from './InputSelect'; +import { InputSelect, SelectProps } from '../../sonar-aligned/components/input'; -interface Props { - className?: string; - components?: Parameters[0]['components']; +type DiscreetProps< + Option, + IsMulti extends boolean = false, + Group extends GroupBase