⌨️ style(a11y): kb access for LLM endpoint menu; refactor: style (#3714)

This commit is contained in:
Marco Beretta 2024-08-22 00:19:33 +02:00 committed by GitHub
parent 98b437edd5
commit 0c5568b80b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 48 additions and 50 deletions

View file

@ -4,7 +4,7 @@ import { Content, Portal, Root, Trigger } from '@radix-ui/react-popover';
import { EditPresetDialog, PresetItems } from './Presets';
import { useLocalize, usePresets } from '~/hooks';
import { useChatContext } from '~/Providers';
import { cn } from '~/utils';
import { Button } from '~/components/ui';
const PresetsMenu: FC = () => {
const localize = useLocalize();
@ -25,19 +25,17 @@ const PresetsMenu: FC = () => {
return (
<Root>
<Trigger asChild>
<button
className={cn(
'pointer-cursor relative flex flex-col rounded-md border border-gray-100 bg-white text-left focus:ring-0 focus:ring-offset-0 dark:border-gray-700 dark:bg-gray-800 sm:text-sm',
'hover:bg-gray-50 radix-state-open:bg-gray-50 dark:hover:bg-gray-700 dark:radix-state-open:bg-gray-700',
'z-50 flex h-[40px] min-w-4 flex-none items-center justify-center px-3',
)}
<Button
type="button"
variant="outline"
className="flex h-[40px] min-w-4 px-3 radix-state-open:bg-surface-hover"
id="presets-button"
data-testid="presets-button"
title={localize('com_endpoint_examples')}
aria-label={localize('com_endpoint_examples')}
>
<BookCopy className="icon-sm" id="presets-button" />
</button>
</Button>
</Trigger>
<Portal>
<div