-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UXIT-1428 - Headless UI v2 component refactor (#701)
* refactor headless ui component v2 * replace headless with headlessUI and fix active to focus * remove aria label and implement data selectors * upgrade headless version and remove aria lables * fixup! refactor headless ui component v2 * Remove Transition component from Popover --------- Co-authored-by: Mirha Masala <[email protected]> Co-authored-by: Charly MARTIN <[email protected]>
- Loading branch information
1 parent
91daf65
commit c620db6
Showing
9 changed files
with
101 additions
and
124 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
import React from 'react' | ||
|
||
import { Listbox } from '@headlessui/react' | ||
import { ListboxButton as HeadlessUIListboxButton } from '@headlessui/react' | ||
|
||
type ListboxButtonProps = { | ||
ariaLabel: string | ||
open: boolean | ||
children: React.ReactNode | ||
} | ||
|
||
export function ListboxButton({ | ||
ariaLabel, | ||
open, | ||
children, | ||
}: ListboxButtonProps) { | ||
export function ListboxButton({ children }: ListboxButtonProps) { | ||
return ( | ||
<Listbox.Button | ||
aria-haspopup="listbox" | ||
aria-expanded={open} | ||
aria-label={ariaLabel} | ||
className="focus:brand-outline inline-flex w-full items-center justify-between gap-2 rounded-lg border border-brand-300 p-3 text-brand-300 hover:border-current hover:text-brand-400 md:min-w-40" | ||
> | ||
<HeadlessUIListboxButton className="inline-flex w-full items-center justify-between gap-2 rounded-lg border border-brand-300 p-3 text-brand-300 focus:brand-outline hover:border-current hover:text-brand-400 md:min-w-40"> | ||
{children} | ||
</Listbox.Button> | ||
</HeadlessUIListboxButton> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters