import { ComponentPropsWithoutRef, ReactNode } from 'react'; /** * Tab arrangement. Split modes require exactly two tabs and at least 720px; * otherwise the layout uses `stacked`. */ export type TabbedLayoutMode = "stacked" | "vertical-split" | "horizontal-split"; export type TabbedLayoutTab = { /** Selection and panel identity within `tabs`. */ key: string; /** Localized tab label and split-pane heading. */ label: string; /** Kept mounted across selection changes; split modes show both panels. */ content: ReactNode; }; export type TabbedLayoutProps = Omit, "children" | "style"> & { /** Ordered panels; `key` values must be unique within the list. */ tabs: TabbedLayoutTab[]; /** * Initial uncontrolled mode. Invalid split modes fall back to `stacked`. * Defaults to `stacked`. */ defaultMode?: TabbedLayoutMode; /** Initial uncontrolled `tabs[].key`. Defaults to the first tab. */ defaultSelectedKey?: string; /** Controlled `tabs[].key`. Omit for internal selection state. */ selectedKey?: string; /** Reports the selected `tabs[].key` in controlled and uncontrolled modes. */ onSelectionChange?: (key: string) => void; className?: string; };