@primer/react
Version:
An implementation of GitHub's Primer Design System using React
54 lines • 2.88 kB
TypeScript
import { type Icon } from '@primer/octicons-react';
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
import React from 'react';
import type { ActionListTrailingActionProps, ActionListDividerProps, ActionListLeadingVisualProps, ActionListTrailingVisualProps, ActionListGroupHeadingProps } from '../ActionList';
export type NavListProps = {
children: React.ReactNode;
} & React.ComponentProps<'nav'>;
export type NavListItemProps = {
children: React.ReactNode;
defaultOpen?: boolean;
href?: string;
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false' | boolean;
inactiveText?: string;
};
export type NavListSubNavProps = {
children: React.ReactNode;
};
export type NavListLeadingVisualProps = ActionListLeadingVisualProps;
export type NavListTrailingVisualProps = ActionListTrailingVisualProps;
export type NavListDividerProps = ActionListDividerProps;
export type NavListTrailingActionProps = ActionListTrailingActionProps;
export type NavListGroupProps = React.HTMLAttributes<HTMLLIElement> & {
children: React.ReactNode;
title?: string;
};
type GroupItem = {
text: string;
trailingVisual?: Icon | string;
leadingVisual?: Icon;
trailingAction?: ActionListTrailingActionProps;
'data-expand-focus-target'?: string;
} & Omit<NavListItemProps, 'children'>;
export type NavListGroupExpandProps = {
label?: string;
pages?: number;
items: GroupItem[];
renderItem?: (item: GroupItem) => React.ReactNode;
};
export declare const GroupExpand: React.ForwardRefExoticComponent<NavListGroupExpandProps & React.RefAttributes<HTMLButtonElement>>;
export type NavListGroupHeadingProps = ActionListGroupHeadingProps;
export declare const NavList: React.ForwardRefExoticComponent<Omit<NavListProps, "ref"> & React.RefAttributes<HTMLElement>> & {
Description: import("../utils/types").FCWithSlotMarker<React.PropsWithChildren<import("..").ActionListDescriptionProps>>;
Item: PolymorphicForwardRefComponent<"a", NavListItemProps>;
SubNav: PolymorphicForwardRefComponent<"ul", NavListSubNavProps>;
LeadingVisual: import("../utils/types").FCWithSlotMarker<React.PropsWithChildren<import("../ActionList/Visuals").VisualProps>>;
TrailingVisual: import("../utils/types").FCWithSlotMarker<React.PropsWithChildren<import("../ActionList/Visuals").VisualProps>>;
TrailingAction: PolymorphicForwardRefComponent<"a" | "button", ActionListTrailingActionProps>;
Divider: import("../utils/types").FCWithSlotMarker<React.PropsWithChildren<ActionListDividerProps>>;
Group: React.FC<NavListGroupProps>;
GroupExpand: React.ForwardRefExoticComponent<NavListGroupExpandProps & React.RefAttributes<HTMLButtonElement>>;
GroupHeading: React.FC<ActionListGroupHeadingProps>;
};
export {};
//# sourceMappingURL=NavList.d.ts.map