UNPKG

react-odyssey

Version:
42 lines (41 loc) 1.28 kB
import type { FunctionComponent, ReactElement, ReactText, ComponentPropsWithRef } from "react"; export interface Props { children: ReactElement[]; id: string; ariaLabel: string; selectedId?: string; onTabChange?: (newId: string) => void; } export interface PropsTabsContainer { children: ReactElement | ReactElement[]; id: string; ariaLabel: string; } export interface PropsTabsPanelContainer { children: ReactElement | ReactElement[]; } export interface PropsTabsPanel { children: ReactText | ReactElement | ReactElement[]; label: string; id?: string; selected?: boolean; } export interface PropsTabsList extends Omit<ComponentPropsWithRef<"div">, "style" | "className"> { children: ReactElement | ReactElement[]; } export interface PropsTab { children: ReactText; id: string; ariaControls: string; selected?: boolean; onClick: () => void; } export interface StaticComponents { Container: FunctionComponent<PropsTabsContainer>; PanelContainer: FunctionComponent<PropsTabsPanelContainer>; Panel: FunctionComponent<PropsTabsPanel>; List: FunctionComponent<PropsTabsList>; Tab: FunctionComponent<PropsTab>; } declare const Tabs: FunctionComponent<Props> & StaticComponents; export { Tabs };