
import { CubeMenuProps } from "../../actions/Menu/Menu.js";
import "../../content/Item/index.js";
import { CubeItemProps } from "../../content/Item/Item.js";
import { CubeItemActionProps } from "../../actions/ItemAction/ItemAction.js";
import "../../actions/ItemAction/index.js";
import "../../actions/Menu/index.js";
import { BaseProps, OuterStyleProps, Styles } from "@tenphi/tasty";
import { ReactNode } from "react";

//#region src/components/navigation/Tabs/types.d.ts
/** Visual appearance type for tabs */
type TabType = 'default' | 'narrow' | 'file' | 'radio';
/** Position for TabPicker and scroll arrows */
type TabsActionPosition = 'prefix' | 'suffix';
/**
 * Tab size options.
 * Radio type only supports 'medium' | 'large' (mapped to smaller Item sizes).
 */
type TabSize = 'xsmall' | 'small' | 'medium' | 'large';
/** How the tab `menu` is exposed alongside or instead of the overflow trigger. */
type TabContextMenu = boolean | 'context-only';
/** Common props for panel rendering behavior */
interface PanelBehaviorProps {
  /** If true, panel is rendered but hidden when not active. */
  prerender?: boolean;
  /** If true, once visited the panel stays in DOM. */
  keepMounted?: boolean;
}
/** Common props for QA attributes */
interface QAProps {
  /** QA selector attribute. */
  qa?: string;
  /** Additional QA value attribute. */
  qaVal?: string;
}
/** Props from CubeItemProps that don't apply to Tab */
type OmittedItemProps = 'id' | 'type' | 'size' | 'theme' | 'shape' | 'description' | 'descriptionPlacement' | 'descriptionProps' | 'hotkeys' | 'keyboardShortcutProps' | 'labelProps' | 'labelRef' | 'level' | 'highlight' | 'highlightCaseSensitive' | 'highlightStyles' | 'variant' | 'htmlType' | 'isSelected' | 'preserveActionsSpace' | 'disableActionsFocus' | 'actions' | 'autoHideActions' | 'insideWrapper' | 'showActions';
/** Common styling props for tabs - inherits style props from CubeItemProps */
interface TabStyleProps extends Omit<CubeItemProps, OmittedItemProps> {
  /**
   * Tab size. Supports 'xsmall', 'small', 'medium', 'large'.
   * Radio type supports 'large' (default, 40px) and 'medium' (32px),
   * mapped to Item button sizes medium (32px) and xsmall (24px).
   */
  size?: TabSize;
  /** Visual appearance type. */
  type?: TabType;
  /** Whether to show actions only on hover. */
  autoHideActions?: boolean;
}
/** Cache key type - primitives only for reliable comparison */
type CacheKeyValue = string | number | boolean | null | undefined;
interface CubeTabsProps extends BaseProps, OuterStyleProps, PanelBehaviorProps {
  /** Controlled active tab key. When provided, component is controlled. */
  activeKey?: string;
  /** Initial active tab key for uncontrolled mode. */
  defaultActiveKey?: string;
  /**
   * Visual appearance type for tabs.
   * - `default` - Standard tabs with selection indicator below (default)
   * - `narrow` - Same as default but with collapsed vertical padding on labels
   * - `file` - File-style tabs with border bottom highlight on selection, delimiter between tabs
   * - `radio` - Radio button style for tab selection
   * @default 'default'
   */
  type?: TabType;
  /**
   * Tab size. Supports 'xsmall', 'small', 'medium', 'large'.
   * Radio type supports 'large' (default, 40px) and 'medium' (32px),
   * mapped to Item button sizes medium (32px) and xsmall (24px).
   * @default 'medium'
   */
  size?: TabSize;
  /** Accessible label for the tab list. */
  label?: string;
  /** Content rendered before the tab list. */
  prefix?: ReactNode;
  /** Content rendered after the tab list. */
  suffix?: ReactNode;
  /** Callback when active tab changes. */
  onChange?: (key: string) => void;
  /** Callback when tab delete button is clicked. Presence enables delete buttons. */
  onDelete?: (key: string) => void;
  /** Callback when a tab title is changed. Enables title editing on tabs with isEditable. */
  onTitleChange?: (key: string, newTitle: string) => void;
  /** Whether to show tab actions only on hover. Can be overridden per-tab. */
  autoHideActions?: boolean;
  /**
   * Whether tabs are editable by default.
   * Can be overridden per-tab via Tab's isEditable prop.
   * @default false
   */
  isEditable?: boolean;
  /**
   * Default menu items for all tabs.
   * Can be overridden per-tab via Tab's menu prop.
   * Set to `null` on individual Tab to disable menu for that tab.
   */
  menu?: ReactNode;
  /**
   * Default props for the menu trigger button.
   * Can be overridden per-tab via Tab's menuTriggerProps prop.
   * @default { icon: <MoreIcon /> }
   */
  menuTriggerProps?: Partial<CubeItemActionProps>;
  /**
   * Default props passed to the Menu component.
   * Can be overridden per-tab via Tab's menuProps prop.
   */
  menuProps?: Partial<CubeMenuProps<object>>;
  /**
   * Context menu / overflow behavior for tab `menu` items.
   * - `false` (default) — overflow trigger only; no right-click menu
   * - `true` — overflow trigger and right-click menu
   * - `'context-only'` — right-click menu only; no overflow trigger. Inline close
   *   (`onDelete`) shows even when `menu` is non-empty, like tabs without a menu.
   * Can be overridden per-tab via Tab's contextMenu prop.
   * @default false
   */
  contextMenu?: TabContextMenu;
  /**
   * Callback when a menu action is triggered on any tab.
   * Called with the action key and the tab key.
   * Tab-level onAction is called first, then this.
   */
  onAction?: (action: string, tabKey: string) => void;
  /** Custom tasty styles for the tab bar container. */
  styles?: Styles;
  /** QA selector attribute. */
  qa?: string;
  /** Tab components or Tabs.List with Tabs.Panel. */
  children?: ReactNode;
  /**
   * Functional content renderer for optimized lazy evaluation.
   * When provided, panel content is only evaluated for the active tab,
   * while inactive tabs use cached content.
   */
  renderPanel?: (key: string) => ReactNode;
  /**
   * Cache keys for individual panels. Enables caching for specified panels.
   */
  panelCacheKeys?: Record<string | number, CacheKeyValue>;
  /**
   * Enable drag-and-drop tab reordering.
   * @default false
   */
  isReorderable?: boolean;
  /**
   * Controlled order of tab keys.
   * When provided, tabs are displayed in this order.
   */
  keyOrder?: string[];
  /**
   * Callback when tabs are reordered via drag-and-drop.
   */
  onReorder?: (newOrder: string[]) => void;
  /**
   * Whether to show a tab picker dropdown in the suffix area.
   * - `true` - always show the tab picker
   * - `false` - never show the tab picker (default)
   * - `'auto'` - show only when tabs overflow (has horizontal scroll)
   * @default false
   */
  showTabPicker?: boolean | 'auto';
  /**
   * Whether to show scroll arrow buttons in the suffix area.
   * - `true` - always show scroll arrows
   * - `false` - never show scroll arrows (default)
   * - `'auto'` - show only when tabs overflow (has horizontal scroll)
   * @default false
   */
  showScrollArrows?: boolean | 'auto';
  /**
   * Position of the tab picker dropdown.
   * - `'prefix'` - render in the prefix slot (before tab list)
   * - `'suffix'` - render in the suffix slot (after tab list)
   * @default 'suffix'
   */
  tabPickerPosition?: TabsActionPosition;
  /**
   * Position of the scroll arrow buttons.
   * - `'prefix'` - render in the prefix slot (before tab list)
   * - `'suffix'` - render in the suffix slot (after tab list)
   * @default 'suffix'
   */
  scrollArrowsPosition?: TabsActionPosition;
  /**
   * Visually hide the custom horizontal scrollbar in the tab list
   * and skip its tracking logic. Does not affect tab picker, scroll arrows,
   * or fade indicators — only the tiny scrollbar visual.
   * @default false
   */
  hideTabListScroll?: boolean;
  /**
   * Inline padding for the tab list container.
   * Sets horizontal padding only (e.g., "2x" → padding: "0 2x").
   */
  tabListPadding?: string;
  /** Custom tasty styles for the TabList sub-element. */
  tabListStyles?: Styles;
  /** Custom tasty styles for the Prefix sub-element. */
  prefixStyles?: Styles;
  /** Custom tasty styles for the Suffix sub-element. */
  suffixStyles?: Styles;
}
interface CubeTabProps extends TabStyleProps, PanelBehaviorProps {
  /**
   * Unique identifier for the tab.
   * Auto-injected from the React `key` prop (converted to string).
   */
  id?: string;
  /** Content displayed in the tab button. */
  title: ReactNode;
  /** Panel content rendered when tab is active. */
  children?: ReactNode;
  /** Disables the tab (cannot be selected). */
  isDisabled?: boolean;
  /** Actions to render in the tab. Rendered before menu trigger if tab has menu. */
  actions?: ReactNode;
  /** Whether the tab title can be edited. Overrides the Tabs-level isEditable default. */
  isEditable?: boolean;
  /** Callback when this tab's title is changed. Overrides parent's onTitleChange. */
  onTitleChange?: (newTitle: string) => void;
  /**
   * Menu items to display in a dropdown menu on the tab.
   * Pass Menu.Item elements directly - they will be wrapped in a Menu internally.
   * Overrides the Tabs-level menu default. Set to `null` to disable menu.
   */
  menu?: ReactNode | null;
  /**
   * Props to customize the menu trigger button.
   * Overrides the Tabs-level menuTriggerProps default.
   */
  menuTriggerProps?: Partial<CubeItemActionProps>;
  /**
   * Props passed to the Menu component.
   * Overrides the Tabs-level menuProps default.
   */
  menuProps?: Partial<CubeMenuProps<object>>;
  /**
   * Context menu / overflow behavior. Same values as Tabs `contextMenu`.
   * Uses the same menu items as `menu` prop.
   * @default false
   */
  contextMenu?: TabContextMenu;
  /**
   * Callback when a menu action is triggered.
   * Called with the action key from Menu.Item.
   */
  onAction?: (action: string) => void;
}
interface CubeTabPanelProps extends PanelBehaviorProps, QAProps {
  /**
   * Panel identifier. Must match a Tab's id.
   * Auto-injected from the React `key` prop (converted to string).
   */
  id?: string;
  /** Panel content. */
  children?: ReactNode;
  /** Custom tasty styles for the panel container. */
  styles?: Styles;
}
interface CubeTabListProps {
  /** Tab components. */
  children?: ReactNode;
}
//#endregion
export { CubeTabListProps, CubeTabPanelProps, CubeTabProps, CubeTabsProps, TabContextMenu, TabSize, TabType, TabsActionPosition };
//# sourceMappingURL=types.d.ts.map