import React from 'react'; import { PropGetterFn, UnknownProperties, Intergalactic } from 'intergalactic/core'; import { Box, BoxProps } from 'intergalactic/flex-box'; import { KeyboardFocusProps } from 'intergalactic/utils/lib/enhances/keyboardFocusEnhance'; export type TabPanelValue = string | number | boolean; /** @deprecated */ export interface ITabPanelProps extends TabPanelProps, UnknownProperties {} export type TabPanelProps = BoxProps & { /** Is invoked when changing the selection */ onChange?: | ((value: T, e?: React.SyntheticEvent) => void) | React.Dispatch>; /** Value of the selected tab */ value?: T; /** Default value of the selected tab * @default null * */ defaultValue?: T; /** * Behavior of tabs. * In `auto`, changes the tab immediately when press arrow. * In `manual`, needs to press `space` or `enter` for select a choice. * @default 'auto' */ behavior?: 'auto' | 'manual'; }; /** @deprecated */ export interface ITabPanelItemProps extends TabPanelItemProps, UnknownProperties {} export type TabPanelItemProps = BoxProps & KeyboardFocusProps & { /** Makes a tab selected. This property is determined automatically depending on the value. */ selected?: boolean; /** Disabled state */ disabled?: boolean; /** Tab value */ value?: TabPanelValue; /** Left addon tag */ addonLeft?: React.ElementType; /** Right addon tag */ addonRight?: React.ElementType; }; /** @deprecated */ export interface ITabPanelContext extends TabPanelContext, UnknownProperties {} export type TabPanelContext = { getItemProps: PropGetterFn; }; /** @deprecated */ export interface ITabPanelHandlers extends TabPanelHandlers, UnknownProperties {} export type TabPanelHandlers = { value: (value: TabPanelValue) => void; }; type IntergalacticTabPanelComponent = (< Value extends TabPanelValue, Tag extends Intergalactic.Tag = 'div', >( props: Intergalactic.InternalTypings.ComponentProps< Tag, 'div', TabPanelProps, TabPanelContext, [handlers: TabPanelHandlers] > & PropsExtending, ) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', TabPanelProps>; declare const TabPanel: IntergalacticTabPanelComponent & { Item: Intergalactic.Component<'div', TabPanelItemProps, {}, [handlers: TabPanelHandlers]> & { Text: typeof Box; Addon: typeof Box; }; }; declare const wrapTabPanel: ( wrapper: ( props: Intergalactic.InternalTypings.UntypeRefAndTag< Intergalactic.InternalTypings.ComponentPropsNesting > & PropsExtending, ) => React.ReactNode, ) => IntergalacticTabPanelComponent; export { wrapTabPanel }; export default TabPanel;