1 | import * as React from 'react';
|
2 | import { OUIAProps } from '../../helpers';
|
3 | export declare type NavSelectClickHandler = (e: React.FormEvent<HTMLInputElement>, itemId: number | string, groupId: number | string, to: string) => void;
|
4 | export interface NavProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, 'onSelect'>, OUIAProps {
|
5 |
|
6 | children?: React.ReactNode;
|
7 |
|
8 | className?: string;
|
9 |
|
10 | onSelect?: (selectedItem: {
|
11 | groupId: number | string;
|
12 | itemId: number | string;
|
13 | to: string;
|
14 | event: React.FormEvent<HTMLInputElement>;
|
15 | }) => void;
|
16 |
|
17 | onToggle?: (toggledItem: {
|
18 | groupId: number | string;
|
19 | isExpanded: boolean;
|
20 | event: React.MouseEvent<HTMLButtonElement>;
|
21 | }) => void;
|
22 |
|
23 | 'aria-label'?: string;
|
24 |
|
25 | theme?: 'dark' | 'light';
|
26 |
|
27 | variant?: 'default' | 'horizontal' | 'tertiary' | 'horizontal-subnav';
|
28 | }
|
29 | export interface NavContextProps {
|
30 | onSelect?: (event: React.FormEvent<HTMLInputElement>, groupId: number | string, itemId: number | string, to: string, preventDefault: boolean, onClick: (e: React.FormEvent<HTMLInputElement>, itemId: number | string, groupId: number | string, to: string) => void) => void;
|
31 | onToggle?: (event: React.MouseEvent<HTMLButtonElement>, groupId: number | string, expanded: boolean) => void;
|
32 | updateIsScrollable?: (isScrollable: boolean) => void;
|
33 | isHorizontal?: boolean;
|
34 | flyoutRef?: React.Ref<HTMLLIElement>;
|
35 | setFlyoutRef?: (ref: React.Ref<HTMLLIElement>) => void;
|
36 | }
|
37 | export declare const navContextDefaults: {};
|
38 | export declare const NavContext: React.Context<NavContextProps>;
|
39 | export declare class Nav extends React.Component<NavProps, {
|
40 | isScrollable: boolean;
|
41 | ouiaStateId: string;
|
42 | flyoutRef: React.Ref<HTMLLIElement> | null;
|
43 | }> {
|
44 | static displayName: string;
|
45 | static defaultProps: NavProps;
|
46 | state: {
|
47 | isScrollable: boolean;
|
48 | ouiaStateId: string;
|
49 | flyoutRef: React.Ref<HTMLLIElement>;
|
50 | };
|
51 | onSelect(event: React.FormEvent<HTMLInputElement>, groupId: number | string, itemId: number | string, to: string, preventDefault: boolean, onClick: NavSelectClickHandler): void;
|
52 | onToggle(event: React.MouseEvent<HTMLButtonElement>, groupId: number | string, toggleValue: boolean): void;
|
53 | render(): JSX.Element;
|
54 | }
|
55 |
|
\ | No newline at end of file |