fix(command menu): minor styling issues with scrollbar (#29403)

This commit is contained in:
Charis authored and GitHub committed 2024-09-20 10:13:57 -04:00
1 parent cd4b057ef5
commit f8f37cf038
3 files changed
+4 -12

No files matched your search

+1 -7
View File
@@ -1,10 +1,4 @@
import {
Breadcrumb,
CommandHeader,
CommandInput,
CommandList,
CommandMenu,
} from 'ui-patterns/CommandMenu'
import { CommandHeader, CommandInput, CommandList, CommandMenu } from 'ui-patterns/CommandMenu'
import { useChangelogCommand } from 'ui-patterns/CommandMenu/prepackaged/Changelog'
import { useDocsAiCommands } from 'ui-patterns/CommandMenu/prepackaged/DocsAi'
import { useDocsSearchCommands } from 'ui-patterns/CommandMenu/prepackaged/DocsSearch'
@@ -179,7 +179,7 @@ function CommandMenu({ children, trigger }: CommandMenuProps) {
}}
size={size}
className={cn(
'relative flex flex-col my-0 mx-auto rounded-t-lg overflow-y-scroll',
'relative flex flex-col my-0 mx-auto rounded-t-lg overflow-hidden',
'h-[85dvh] mt-[15vh] md:max-h-[500px] md:mt-0 left-0 bottom-0 md:bottom-auto',
'!animate-in !slide-in-from-bottom-[85%] !duration-300',
'data-[state=closed]:!animate-out data-[state=closed]:!slide-out-to-bottom',
@@ -88,7 +88,7 @@ const DocsAiPage = () => {
/>
)}
</CommandHeader>
<div className={cn('flex-grow min-h-0 overflow-auto p-4')}>
<div className={cn('flex-grow min-h-0 overflow-auto')}>
{!hasError && messages.length > 0 && <AiMessages messages={messages} />}
{!hasError && messages.length === 0 && <EmptyState handleSubmit={handleSubmit} />}
{hasError && <ErrorState handleReset={handleReset} />}
@@ -270,12 +270,10 @@ function EmptyState({ handleSubmit }: { handleSubmit: (message: string) => void
const query = useQuery()
return (
<CommandList_Shadcn_>
<CommandList_Shadcn_ className="max-h-[unset]">
<CommandGroup_Shadcn_
heading="Examples"
className={cn(
// Double padding from command group primitive and container, remove the primitive one
'!p-0',
'text-border-strong',
'[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pb-1.5',
'[&_[cmdk-group-heading]]:text-sm [&_[cmdk-group-heading]]:font-normal [&_[cmdk-group-heading]]:text-foreground-muted'