import React from 'react';
export interface TabDescriptor {
id: string;
name: string;
[key: string]: unknown;
}
interface TabStripTabsProps {
className?: string;
/** Custom className for individual tab triggers. */
tabClassName?: string;
}
interface TabStripMenuItemProps {
children: React.ReactNode;
onClick?: () => void;
variant?: 'default' | 'destructive';
className?: string;
disabled?: boolean;
}
/**
* A menu item for the tab's dropdown menu.
*/
declare function TabStripMenuItem({ children, onClick, variant, className, disabled, }: TabStripMenuItemProps): import("react/jsx-runtime").JSX.Element;
interface TabStripMenuSeparatorProps {
className?: string;
}
/**
* A separator for the tab's dropdown menu.
*/
declare function TabStripMenuSeparator({ className }: TabStripMenuSeparatorProps): import("react/jsx-runtime").JSX.Element;
interface TabStripSearchItemActionProps {
icon: React.ReactNode;
onClick?: () => void;
'aria-label': string;
className?: string;
}
/**
* An action button for search dropdown items.
*/
declare function TabStripSearchItemAction({ icon, onClick, 'aria-label': ariaLabel, className, }: TabStripSearchItemActionProps): import("react/jsx-runtime").JSX.Element;
/**
* Renders the scrollable row of open tabs with drag-to-reorder support.
*/
declare function TabStripTabs({ className, tabClassName }: TabStripTabsProps): import("react/jsx-runtime").JSX.Element;
interface TabStripSearchDropdownProps {
className?: string;
triggerClassName?: string;
/** Whether to auto-focus the search input when dropdown opens. Defaults to true. */
autoFocus?: boolean;
/** Optional tooltip content for the trigger button. */
tooltip?: React.ReactNode;
/** Optional custom icon for the trigger button. */
triggerIcon?: React.ReactNode;
/** Message shown when there are no tabs at all. */
emptyMessage?: React.ReactNode;
/** Message shown when searching and there are no matching tabs. */
searchEmptyMessage?: React.ReactNode;
/** Label for the closed tabs group. */
closedTabsLabel?: React.ReactNode;
/** Sorting mode for search dropdown items. */
sortSearchItems?: 'none' | 'recent';
/** Optional accessor for tab recency timestamps. */
getTabLastOpenedAt?: (tab: TabDescriptor) => number | undefined;
}
/**
* Renders the dropdown with search for browsing tabs.
* Shows open tabs first and closed tabs second (dimmed). When searching, shows all matching tabs.
*/
declare function TabStripSearchDropdown({ className, triggerClassName, autoFocus, tooltip, triggerIcon, emptyMessage, searchEmptyMessage, closedTabsLabel, sortSearchItems, getTabLastOpenedAt, }: TabStripSearchDropdownProps): import("react/jsx-runtime").JSX.Element;
interface TabStripNewButtonProps {
className?: string;
/** Optional tooltip content for the button. */
tooltip?: React.ReactNode;
}
/**
* Renders a button to create a new tab.
*/
declare function TabStripNewButton({ className, tooltip }: TabStripNewButtonProps): import("react/jsx-runtime").JSX.Element | null;
export interface TabStripProps {
className?: string;
tabsListClassName?: string;
children?: React.ReactNode;
/** All available tabs. */
tabs: TabDescriptor[];
/** IDs of tabs that are currently open. */
openTabs?: string[];
/** ID of the currently selected tab. */
selectedTabId?: string | null;
/** If true, hides the close button when only one tab remains open. */
preventCloseLastTab?: boolean;
/** Called when a tab is closed (hidden, can be reopened). */
onClose?: (tabId: string) => void;
/** Called when the list of open tabs changes (open from dropdown or reorder). */
onOpenTabsChange?: (tabIds: string[]) => void;
/** Called when a tab is selected. */
onSelect?: (tabId: string) => void;
/** Called when a new tab should be created. */
onCreate?: () => void;
/** Called when a tab is renamed inline. */
onRename?: (tabId: string, newName: string) => void;
/** Render function for the tab's dropdown menu. Use TabStrip.MenuItem and TabStrip.MenuSeparator. */
renderTabMenu?: (tab: TabDescriptor) => React.ReactNode;
/** Render function for search dropdown item actions. Use TabStrip.SearchItemAction. */
renderSearchItemActions?: (tab: TabDescriptor) => React.ReactNode;
/** Render function for custom tab content. Receives the tab and returns the content to display. */
renderTabLabel?: (tab: TabDescriptor) => React.ReactNode;
}
/**
* A composable tab strip component with search dropdown and tab management.
*
* @example
* // Default layout
*
*
* @example
* // Custom layout with subcomponents
*
*
*
*
*
*/
declare function TabStripRoot({ className, tabsListClassName, children, tabs, openTabs, selectedTabId, preventCloseLastTab, onClose, onOpenTabsChange, onSelect, onCreate, onRename, renderTabMenu, renderSearchItemActions, renderTabLabel, }: TabStripProps): import("react/jsx-runtime").JSX.Element;
export declare const TabStrip: typeof TabStripRoot & {
Tabs: typeof TabStripTabs;
SearchDropdown: typeof TabStripSearchDropdown;
NewButton: typeof TabStripNewButton;
MenuItem: typeof TabStripMenuItem;
MenuSeparator: typeof TabStripMenuSeparator;
SearchItemAction: typeof TabStripSearchItemAction;
};
export type { TabStripMenuItemProps, TabStripMenuSeparatorProps, TabStripNewButtonProps, TabStripSearchDropdownProps, TabStripSearchItemActionProps, TabStripTabsProps, };
//# sourceMappingURL=tab-strip.d.ts.map