import * as React from 'react'; import { TabButtonProps } from '../TabButton'; import { TabScrollButtonProps } from '../TabScrollButton'; import { TabsClasses } from './tabsClasses'; import type { TabValue, TabsVariant, ChangeHandler, TabsOrientation, ClassesWithClassValue } from '../types'; export interface TabsRefAttributes { updateIndicator: () => void; updateScrollButtons: () => void; } type BaseTabsProps = Omit, 'onChange'>; export interface TabsProps extends BaseTabsProps { /** * The value of the currently selected `Tab`. * If you don't want any selected `Tab`, you can set this prop to `false`. */ value?: Value; /** * Callback fired when the value changes. */ onChange?: ChangeHandler; /** * Callback fired when the tab pressed. */ onTabClick?: React.MouseEventHandler; /** * If `true`, the tabs are centered. * This prop is intended for large views. * @default false */ centered?: boolean; /** * The component used to render the tabs. */ TabComponent?: React.ComponentType; /** * The component used to render the scroll buttons. */ ScrollButtonComponent?: React.ComponentType; /** * Override or extend the styles applied to the component. */ classes?: ClassesWithClassValue; /** * The component orientation (layout flow direction). * @default 'horizontal' */ orientation?: TabsOrientation; /** * Determines additional display behavior of the tabs: * * - `scrollable` will invoke scrolling properties and allow for horizontally * scrolling (or swiping) of the tab bar. * - `fullWidth` will make the tabs grow to use all the available space, * which should be used for small views, like on mobile. * - `standard` will render the default state. * @default 'standard' */ variant?: TabsVariant; /** * If `true`, the scrollbar is visible. It can be useful when displaying * a long vertical list of tabs. * @default false */ visibleScrollbar?: boolean; /** * Determine behavior of scroll buttons when tabs are set to scroll: * * - `auto` will only present them when not all the items are visible. * - `true` will always present them. * - `false` will never present them. * * By default, the scroll buttons are hidden on mobile. * This behavior can be disabled with `allowScrollButtonsMobile`. * @default 'auto' */ scrollButtons?: 'auto' | boolean; /** * If `true` the selected tab changes on focus. Otherwise, it only * changes on activation. */ selectionFollowsFocus?: boolean; /** * If `true`, the scroll buttons aren't forced hidden on mobile. * By default, the scroll buttons are hidden on mobile and takes precedence over `scrollButtons`. * @default false */ allowScrollButtonsMobile?: boolean; /** * Props applied to the tab indicator element. * @default {} */ indicatorProps?: Partial>; /** * Props applied to the TabScrollButton element. * @default {} */ scrollButtonsProps?: Partial>; } interface TabsComponent extends React.ForwardRefExoticComponent { (props: TabsProps & React.RefAttributes): ReturnType>>; } declare const Tabs: TabsComponent; export default Tabs;