diff --git a/src/components/combobox/index.module.css b/src/components/combobox/index.module.css index 2592a1f..e49f9eb 100644 --- a/src/components/combobox/index.module.css +++ b/src/components/combobox/index.module.css @@ -10,6 +10,7 @@ } .button { + position: relative; display: grid; grid-template-columns: inherit; place-items: center start; @@ -23,6 +24,22 @@ font-size: 1rem; cursor: pointer; + + &:hover { + background-color: var(--surface-700); + } + + &:has(> .caret) { + padding-inline-end: calc(1em + (2 * var(--padding-m))); + } + + & > .caret { + position: absolute; + inset-inline-end: var(--padding-m); + inset-block-start: 50%; + translate: 0 -50%; + inline-size: 1em; + } } .dialog { diff --git a/src/components/combobox/index.tsx b/src/components/combobox/index.tsx index 9fae438..1b1aca1 100644 --- a/src/components/combobox/index.tsx +++ b/src/components/combobox/index.tsx @@ -1,5 +1,6 @@ import { createMemo, createSignal, For, JSX, Setter, createEffect, Show } from "solid-js"; import css from './index.module.css'; +import { FaSolidAngleDown } from "solid-icons/fa"; interface ComboBoxProps { id: string; @@ -8,6 +9,7 @@ interface ComboBoxProps { setValue?: Setter; values: Record; open?: boolean; + showCaret?: boolean; children: (key: K, value: T) => JSX.Element; filter?: (query: string, key: K, value: T) => boolean; } @@ -30,6 +32,8 @@ export function ComboBox(props: ComboBoxProps) { return entries; }); + const showCaret = createMemo(() => props.showCaret ?? true); + createEffect(() => { props.setValue?.(() => value()); }); @@ -41,6 +45,10 @@ export function ComboBox(props: ComboBoxProps) { return
setOpen(e.newState === 'open')}> diff --git a/src/features/i18n/picker.tsx b/src/features/i18n/picker.tsx index bb811aa..3a9f71c 100644 --- a/src/features/i18n/picker.tsx +++ b/src/features/i18n/picker.tsx @@ -16,6 +16,7 @@ export const LocalePicker: Component = (props) => { value={locale()} setValue={setLocale} values={locales} + showCaret={false} > {(locale, { flag, label }) => }