Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Update design to be inline with the Dropdown component

Blue Mouse6976a9317a2e
diff --git a/web/app/ui/Select.tsx b/web/app/ui/Select.tsx
index b5343ba86..f427899f5 100644
--- a/web/app/ui/Select.tsx
+++ b/web/app/ui/Select.tsx
@@ -56,7 +56,7 @@ function Select<T>({
<div className={cx('relative', className)}>
<ListboxButton
className={cx(
- 'relative w-full rounded-md border border-gray-300 bg-white py-2 pr-10 pl-3 text-left focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 focus:outline-hidden sm:text-sm dark:border-gray-800 dark:bg-slate-800 dark:text-gray-50',
+ 'relative w-full rounded-md border border-gray-300 bg-white py-2 pr-10 pl-3 text-left font-medium hover:bg-gray-50 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-gray-100 focus:outline-hidden sm:text-sm dark:border-gray-800 dark:bg-slate-800 dark:text-gray-50 dark:hover:bg-slate-700',
buttonClassName,
)}
>
@@ -81,20 +81,22 @@ function Select<T>({
>
<ListboxOptions
static
- className='absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base ring-1 ring-black/10 focus:outline-hidden sm:text-sm dark:bg-slate-800'
+ className='absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-gray-50 py-1 text-base ring-1 ring-black/10 focus:outline-hidden sm:text-sm dark:bg-slate-800'
>
{_map(items, (item, index) => (
<ListboxOption
key={keyExtractor ? keyExtractor(item, index) : (item as Key)}
- className={({ active }) =>
- cx('relative cursor-default py-2 pr-4 pl-8 select-none dark:text-white', {
- 'bg-indigo-600 text-white': active,
- 'text-gray-900': !active,
+ className={({ focus, selected }) =>
+ cx('relative mx-1 cursor-pointer rounded-md py-2 pr-4 pl-8 select-none', {
+ 'bg-gray-200 dark:bg-slate-700': focus && !selected,
+ 'bg-gray-300 dark:bg-slate-600': selected,
+ 'text-gray-700 dark:text-gray-50': !focus && !selected,
+ 'text-gray-900 dark:text-white': focus || selected,
})
}
value={item}
>
- {({ selected, active }) => (
+ {({ selected }) => (
<>
<span
className={cx(
@@ -118,10 +120,9 @@ function Select<T>({
{selected ? (
<span
- className={cx('absolute inset-y-0 left-0 flex items-center pl-1.5', {
- 'text-white': active,
- 'text-indigo-600': !active,
- })}
+ className={cx(
+ 'absolute inset-y-0 left-0 flex items-center pl-1.5 text-gray-600 dark:text-gray-300',
+ )}
>
<CheckIcon className='h-5 w-5' aria-hidden='true' />
</span>