import React, { type PropsWithChildren, type ReactElement, type ReactNode, type Ref } from 'react'; import { type Icon } from '@primer/octicons-react'; import type { BaseProps } from '../component-helpers'; import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css'; export type NavListRootProps = { /** * Accessible label for the navigation landmark. */ 'aria-label': string; /** * ID of an element that labels the navigation landmark. */ 'aria-labelledby'?: string; children: ReactNode; 'data-testid'?: string; } & BaseProps & Omit, 'aria-label' | 'aria-labelledby'>; type Visual = ReactElement | React.ElementType | Icon; type NavListItemAs = 'a' | 'button'; type NavListItemBaseProps = { /** * Leading visual rendered before the item label. */ leadingVisual?: Visual; /** * Trailing visual rendered after the item label. */ trailingVisual?: Visual; /** * Whether nested items should be expanded by default. */ defaultExpanded?: boolean; /** * Controls the nested item expanded state. */ expanded?: boolean; /** * Called when a nested item is expanded or collapsed. */ onExpandedChange?: (expanded: boolean) => void; /** * Marks the item as disabled. Disabled link items receive `aria-disabled`. */ disabled?: boolean; 'data-testid'?: string; }; export type NavListItemProps = { as?: C; } & NavListItemBaseProps & PropsWithChildren> & Omit, keyof NavListItemBaseProps | keyof BaseProps | 'as' | 'children'>; export type NavListSubNavProps = { children: ReactNode; 'data-testid'?: string; } & BaseProps & React.HTMLAttributes; export type NavListGroupProps = { /** * Heading text for the group. */ title?: ReactNode; children: ReactNode; 'data-testid'?: string; } & BaseProps & Omit, 'title'>; /** * Use NavList to render vertical navigation links with groups and expandable nested lists. * @see https://primer.style/brand/components/NavList */ export declare const NavList: React.ForwardRefExoticComponent & React.RefAttributes> & { Item: (props: NavListItemProps & { ref?: Ref; }) => ReactElement | null; SubNav: React.ForwardRefExoticComponent & React.RefAttributes>; Group: React.ForwardRefExoticComponent & React.RefAttributes>; testIds: { root: string; readonly list: string; readonly item: string; readonly link: string; readonly leadingVisual: string; readonly trailingVisual: string; readonly subNav: string; readonly group: string; readonly groupTitle: string; readonly groupList: string; readonly toggle: string; }; }; export {};