From 924c50df94048829ab66f0a3ac189bd2dd22a0db Mon Sep 17 00:00:00 2001 From: Michael Salzmann Date: Thu, 16 Jan 2025 12:43:16 +0100 Subject: [PATCH] refactor(async-select-and-search-select): refactor types in async-select-input & search-select-input --- .../src/search-select-field.tsx | 117 ++++++++--- .../src/async-select-input.tsx | 179 ++++++++++++----- .../src/search-select-input.stories.tsx | 20 +- .../src/search-select-input.tsx | 188 ++++++++++++------ .../custom-styled-select-options.tsx | 48 +++-- .../search-icon-dropdown-indicator.tsx | 22 +- .../inputs/select-utils/src/types.ts | 52 +++-- 7 files changed, 439 insertions(+), 187 deletions(-) diff --git a/packages/components/fields/search-select-field/src/search-select-field.tsx b/packages/components/fields/search-select-field/src/search-select-field.tsx index 53afe574c3..7f2142a483 100644 --- a/packages/components/fields/search-select-field/src/search-select-field.tsx +++ b/packages/components/fields/search-select-field/src/search-select-field.tsx @@ -20,13 +20,21 @@ import SearchSelectInput from '@commercetools-uikit/search-select-input'; import FieldErrors from '@commercetools-uikit/field-errors'; import FieldWarnings from '@commercetools-uikit/field-warnings'; -type ReactSelectAsyncProps = AsyncProps>; +type ReactSelectAsyncProps< + Option, + isMulti extends boolean, + Group extends GroupBase