From 3aee85cb8c5d045d47d45b0f9ebd0c58d4593c42 Mon Sep 17 00:00:00 2001 From: alex <44968616+nderkim@users.noreply.github.com> Date: Wed, 2 Nov 2022 09:08:39 +1100 Subject: [PATCH] Add unstyled prop --- packages/react-select/src/Select.tsx | 6 +- .../__snapshots__/Async.test.tsx.snap | 28 ++-- .../AsyncCreatable.test.tsx.snap | 28 ++-- .../__snapshots__/Creatable.test.tsx.snap | 28 ++-- .../__snapshots__/Select.test.tsx.snap | 28 ++-- .../__snapshots__/StateManaged.test.tsx.snap | 28 ++-- .../react-select/src/components/Control.tsx | 44 ++++--- .../react-select/src/components/Group.tsx | 31 +++-- .../react-select/src/components/Input.tsx | 25 ++-- packages/react-select/src/components/Menu.tsx | 72 ++++++---- .../src/components/MultiValue.tsx | 69 ++++++---- .../react-select/src/components/Option.tsx | 58 ++++---- .../src/components/Placeholder.tsx | 17 ++- .../src/components/SingleValue.tsx | 21 ++- .../src/components/containers.tsx | 21 ++- .../src/components/indicators.tsx | 90 ++++++++----- packages/react-select/src/styles.ts | 5 +- .../ClassNamesWithTailwind.stories.tsx | 67 ++++++++++ .../stories/UnstyledWithTailwind.stories.tsx | 124 ++++++++++++++++++ storybook/stories/WithTailwind.stories.tsx | 46 ------- 20 files changed, 548 insertions(+), 288 deletions(-) create mode 100644 storybook/stories/ClassNamesWithTailwind.stories.tsx create mode 100644 storybook/stories/UnstyledWithTailwind.stories.tsx delete mode 100644 storybook/stories/WithTailwind.stories.tsx diff --git a/packages/react-select/src/Select.tsx b/packages/react-select/src/Select.tsx index bae7541a37..5c6463ec4b 100644 --- a/packages/react-select/src/Select.tsx +++ b/packages/react-select/src/Select.tsx @@ -267,6 +267,8 @@ export interface Props< tabIndex: number; /** Select the currently focused option when the user presses tab */ tabSelectsValue: boolean; + /** Remove all non-essential styles */ + unstyled: boolean; /** The value of the select; reflected by the selected option */ value: PropsValue