Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(ui): popover component (#50657)

Anthony Lioe7f0d3c04f7b
diff --git a/packages/ui-patterns/src/CommandMenu/api/CommandMenuInput.tsx b/packages/ui-patterns/src/CommandMenu/api/CommandMenuInput.tsx
index 79036c8894d..653c9f7d8ee 100644
--- a/packages/ui-patterns/src/CommandMenu/api/CommandMenuInput.tsx
+++ b/packages/ui-patterns/src/CommandMenu/api/CommandMenuInput.tsx
@@ -44,7 +44,7 @@ function useFocusInputOnWiderScreens(ref: React.ForwardedRef<HTMLInputElement>)
const CommandMenuInput = forwardRef<
React.ElementRef<typeof CommandInput>,
React.ComponentPropsWithoutRef<typeof CommandInput>
->(({ className, ...props }, ref) => {
+>(({ className, wrapperClassName, ...props }, ref) => {
const inputRef = useFocusInputOnWiderScreens(ref)
const query = useQuery()
@@ -123,6 +123,7 @@ const CommandMenuInput = forwardRef<
placeholder="Run a command or search..."
onCompositionStart={() => setImeComposing(true)}
onCompositionEnd={() => setImeComposing(false)}
+ wrapperClassName={cn('px-4', wrapperClassName)}
className={cn(
'flex h-11 w-full rounded-md bg-transparent px-2 y-4 md:py-7 outline-hidden',
'focus:shadow-none focus:ring-transparent',
diff --git a/packages/ui-patterns/src/CommandMenu/prepackaged/DocsAi/index.tsx b/packages/ui-patterns/src/CommandMenu/prepackaged/DocsAi/index.tsx
index 7211fa4aeb5..64fb024f6ab 100644
--- a/packages/ui-patterns/src/CommandMenu/prepackaged/DocsAi/index.tsx
+++ b/packages/ui-patterns/src/CommandMenu/prepackaged/DocsAi/index.tsx
@@ -30,7 +30,7 @@ const useDocsAiCommands = ({
action: () => {
setCommandPage(DOCS_AI_COMMANDS.PAGE_NAME, true)
},
- icon: () => <AiIconAnimation />,
+ icon: () => <AiIconAnimation size={20} />,
},
].map(modify),
options
diff --git a/packages/ui/src/components/shadcn/ui/command.tsx b/packages/ui/src/components/shadcn/ui/command.tsx
index 97b5c1825f5..a973f6db383 100644
--- a/packages/ui/src/components/shadcn/ui/command.tsx
+++ b/packages/ui/src/components/shadcn/ui/command.tsx
@@ -57,12 +57,12 @@ const CommandInput = React.forwardRef<
},
ref
) => (
- <div className={cn('flex items-center border-b px-4', wrapperClassName)} cmdk-input-wrapper="">
+ <div className={cn('flex items-center border-b px-3', wrapperClassName)} cmdk-input-wrapper="">
{showSearchIcon && <Search className="h-4 w-4 shrink-0 opacity-50" aria-hidden />}
<CommandPrimitive.Input
ref={ref}
className={cn(
- 'flex h-9 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50 border-none focus:ring-0',
+ 'flex h-9 w-full rounded-md bg-transparent py-3 pl-2 text-sm outline-hidden placeholder:text-muted disabled:cursor-not-allowed disabled:opacity-50 border-none focus:ring-0',
className
)}
{...props}
diff --git a/packages/ui/src/components/shadcn/ui/popover.tsx b/packages/ui/src/components/shadcn/ui/popover.tsx
index 55679902127..219d40c0398 100644
--- a/packages/ui/src/components/shadcn/ui/popover.tsx
+++ b/packages/ui/src/components/shadcn/ui/popover.tsx
@@ -46,7 +46,7 @@ const PopoverContent = React.forwardRef<
sideOffset={sideOffset}
className={cn(
sameWidthAsTrigger ? styles['popover-trigger-width'] : '',
- 'z-50 w-72 rounded-md border border-overlay bg-overlay p-4 text-popover-foreground shadow-md outline-hidden animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
+ 'z-50 w-72 rounded-md border border-overlay bg-overlay p-4 text-popover-foreground shadow-md outline-hidden origin-(--radix-popover-content-transform-origin) ease-enter data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
className
)}
{...props}