[docs] Autocomplete styling tweaks (#2732)

This PR tweaks the styling in the autocomplete. It removes icons and
matches styles to the sidebar. It improves the mobile design to hide the
search bar on mobile.

### Change Type

- [ ] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [x] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know
This commit is contained in:
Steve Ruiz 2024-02-05 20:46:07 +00:00 committed by GitHub
parent e6e4e7f6cb
commit 538734782c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 81819 additions and 81820 deletions

View file

@ -11,7 +11,7 @@ import {
import { ComponentType, ForwardedRef, forwardRef, startTransition, useState } from 'react'
import './Autocomplete.css'
import { Icon } from './Icon'
import Spinner from './Spinner'
import { Spinner } from './Spinner'
export type DropdownOption = {
label: string
@ -59,10 +59,10 @@ const Autocomplete = forwardRef(function Autocomplete(
if (filteredOptions.length === 0) return null
return (
<ComboboxGroup>
<ComboboxGroup key={group}>
{groupsToLabel?.[group] && (
<ComboboxGroupLabel className="autocomplete__group">
{groupsToLabel?.[group]}
<ComboboxGroupLabel key={`${group}-group`} className="autocomplete__group">
{groupsToLabel[group]}
</ComboboxGroupLabel>
)}
{filteredOptions.map(({ label, value }) => {
@ -111,7 +111,7 @@ const Autocomplete = forwardRef(function Autocomplete(
{value && (
<ComboboxPopover className="autocomplete__popover">
{customUI}
{options.length === 0 && <span>No results found.</span>}
{options.length === 0 && <span className="autocomplete__empty">No results found.</span>}
{options.length !== 0 && renderedGroups}
</ComboboxPopover>
)}
@ -120,4 +120,4 @@ const Autocomplete = forwardRef(function Autocomplete(
)
})
export default Autocomplete
export { Autocomplete }