chore(components): improve props

This commit is contained in:
Benjamin Canac
2024-06-28 18:13:03 +02:00
parent c9f9a248b7
commit 673064dee5
38 changed files with 260 additions and 137 deletions

View File

@@ -31,10 +31,15 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'custom'>, Pick<Navi
type NavigationMenuVariants = VariantProps<typeof navigationMenu>
export interface NavigationMenuProps<T> extends Omit<NavigationMenuRootProps, 'asChild' | 'dir' | 'orientation'> {
export interface NavigationMenuProps<T> extends Pick<NavigationMenuRootProps, 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'modelValue' | 'skipDelayDuration'> {
/**
* The element or component this component should render as.
* @defaultValue `div`
*/
as?: any
/**
* The icon displayed to open the menu.
* @defaultValue `appConfig.ui.icons.chevronDown`
* @defaultValue appConfig.ui.icons.chevronDown
*/
trailingIcon?: string
items?: T[] | T[][]
@@ -42,7 +47,7 @@ export interface NavigationMenuProps<T> extends Omit<NavigationMenuRootProps, 'a
variant?: NavigationMenuVariants['variant']
/**
* The orientation of the menu.
* @defaultValue `'horizontal'`
* @defaultValue 'horizontal'
*/
orientation?: NavigationMenuRootProps['orientation']
/** Display a line next to the active item. */
@@ -52,7 +57,7 @@ export interface NavigationMenuProps<T> extends Omit<NavigationMenuRootProps, 'a
content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'>
/**
* Display an arrow alongside the menu.
* @defaultValue `false`
* @defaultValue false
*/
arrow?: boolean
class?: any