import { type ComponentProps, type RefObject } from 'react';
/**
* Unstyled Carbon `Tabs` (APG tabs), the behaviour of the styled Tabs without a single class: one
* Tab stop (roving tabindex), ← / → move with wrap (↑ / ↓ with `orientation="vertical"`, mirrored
* right-to-left), Home / End jump; `activation="automatic"` selects as focus moves, `manual` selects
* on Enter / Space. `dismissable` tabs close on Delete or their `Close` button through
* `onTabCloseRequest`; focus then moves to the tab in the closed one's place. A `Panel` is a Tab
* stop only when nothing inside it can take focus.
*
* State shows as data attributes to style on: `data-selected` and `data-disabled` on a `Tab`,
* `data-selected` on its `Panel`, `data-orientation` on `Root` and `List`.
*
* ```tsx
*
* AB
* …
* …
*
* ```
*/
export type TabsActivation = 'automatic' | 'manual';
export type TabsOrientation = 'horizontal' | 'vertical';
export interface RootProps extends Omit, 'defaultValue'> {
/** The selected tab's value (controlled). */
value?: string;
/** Defaults to the first enabled `Tab` among the children. */
defaultValue?: string;
/** After the user selects another tab (keep `value` to cancel, e.g. unsaved changes). */
onValueChange?: (value: string) => void;
activation?: TabsActivation;
orientation?: TabsOrientation;
/** Delete and `Close` ask to close a tab (Carbon `dismissable`). */
dismissable?: boolean;
/**
* A tab's `Close` or Delete asked to close it (Carbon `onTabCloseRequest`): drop it from the
* children to close it. A closed selected tab passes the selection to the first enabled tab
* (`onValueChange`) unless you chose another; focus moves to the tab now in its place, else the one before.
*/
onTabCloseRequest?: (value: string) => void;
}
interface TabsContextValue {
id: string;
value: string;
select: (value: string) => void;
/** The tab that carries the roving tab stop (the focused one, else the selected one). */
stop: string;
setStop: (value: string) => void;
activation: TabsActivation;
orientation: TabsOrientation;
dismissable: boolean;
list: RefObject;
/** The tab with this value asks to close. */
requestClose: (value: string) => void;
}
/** The state of the enclosing `Tabs.Root` (selected value, orientation …). */
export declare function useTabsContext(part?: string): TabsContextValue;
/** The ids of a tab and its panel. */
export declare const tabIds: (id: string, value: string) => {
tab: string;
panel: string;
};
export declare function Root({ value, defaultValue, onValueChange, activation, orientation, dismissable, onTabCloseRequest, children, ...rest }: Readonly): import("react").JSX.Element;
/** The strip of tabs (`role="tablist"`): the arrow keys, Enter / Space, Delete and clicks. */
export declare function List({ ref, ...rest }: Readonly>): import("react").JSX.Element;
export interface TabProps extends Omit, 'value' | 'disabled' | 'type' | 'role'> {
/** Matches the `value` of its `Panel`. */
value: string;
/** Stays visible and announced, but can't be selected or focused with the arrows. */
disabled?: boolean;
}
export declare function Tab({ value, disabled, ...rest }: Readonly): import("react").JSX.Element;
export interface CloseProps extends Omit, 'value' | 'type'> {
/** The tab it closes. */
value: string;
}
/** Asks to close the tab `value` (no Tab stop and hidden from assistive tech: Delete on the tab does the same). */
export declare function Close({ value, ...rest }: Readonly): import("react").JSX.Element;
export interface PanelProps extends Omit, 'value'> {
/** Matches the `value` of its `Tab`. */
value: string;
}
export declare function Panel({ value, ref, ...rest }: Readonly): import("react").JSX.Element;
export {};