From 9181cfb865ed886788e331a5787f67c021c85166 Mon Sep 17 00:00:00 2001 From: Arthur Geron <3487334+arthurgeron@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:18:37 -0300 Subject: [PATCH] feat: remove trigger component --- .../components/ComboBox/ComboBox.stories.tsx | 1 - .../ui/src/components/ComboBox/ComboBox.tsx | 59 ++++++++----------- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/packages/ui/src/components/ComboBox/ComboBox.stories.tsx b/packages/ui/src/components/ComboBox/ComboBox.stories.tsx index 7f084355f..f5b6c66f9 100644 --- a/packages/ui/src/components/ComboBox/ComboBox.stories.tsx +++ b/packages/ui/src/components/ComboBox/ComboBox.stories.tsx @@ -33,7 +33,6 @@ function ComboBoxStory(args: Pick) { - ); diff --git a/packages/ui/src/components/ComboBox/ComboBox.tsx b/packages/ui/src/components/ComboBox/ComboBox.tsx index 6d813dc45..b02dd0b66 100644 --- a/packages/ui/src/components/ComboBox/ComboBox.tsx +++ b/packages/ui/src/components/ComboBox/ComboBox.tsx @@ -191,18 +191,6 @@ export const ComboBoxInput = createComponent({ baseElement: Input, }); -export const ComboBoxTrigger = createComponent<{}, typeof Popover.Trigger>({ - id: 'ComboBoxTrigger', - baseElement: Popover.Trigger, - render: (Root, { ...props }) => { - return ( - -
- - ); - }, -}); - export const ComboBoxInputField = createComponent< ComboBoxInputFieldProps, typeof Input.Field @@ -268,27 +256,33 @@ export const ComboBoxContent = createComponent< useComboBoxContext(); return ( - e.preventDefault()} - > - + {/* Popover uses the trigger's position and container to determine the position and size of the content window. */} + +
+ + e.preventDefault()} > - {filteredSuggestions.map((suggestion: string) => ( - - ))} - - + + {filteredSuggestions.map((suggestion: string) => ( + + ))} + + + ); }, }); @@ -300,6 +294,5 @@ export const ComboBox = withNamespace( Content: ComboBoxContent, Input: ComboBoxInput, InputField: ComboBoxInputField, - Trigger: ComboBoxTrigger, }, );