import type { ComponentPropsWithoutRef, ReactNode, Ref } from 'react'; import { type DetailsControlBarProps } from './DetailsControlBar.js'; import type { LayoutMode } from './DetailsLayoutContext.js'; import type { ResizablePanelProps, ContentProps as SplitLayoutContentProps } from '../../split-layout/slots.js'; import type { PanelWidth } from '../../split-layout/width-utils.js'; import type { CollapsiblePanel } from '../shared/collapsible.js'; export type { DetailsControlBarProps }; /** @public */ export interface DetailsProps extends ResizablePanelProps, CollapsiblePanel { /** The current layout mode of the details panel (controlled). */ layout?: LayoutMode; /** * Default layout mode of the details panel (uncontrolled). * @defaultValue 'split' */ defaultLayout?: LayoutMode; /** Fired when the layout mode changes or should change. */ onLayoutChange?: (value: LayoutMode) => void; /** * Container width in pixels below which the details panel renders as an overlay instead of a split layout. * @defaultValue 600 */ breakpoint?: number; } /** @internal */ export type ContentProps = SplitLayoutContentProps; /** @internal */ export interface ExtractedDetailsSlot { children?: ReactNode; config: { minWidth: PanelWidth; maxWidth: PanelWidth; defaultWidth: PanelWidth; resizable: boolean; collapsed?: boolean; defaultCollapsed: boolean; onCollapsedChange?: (value: boolean) => void; layout?: LayoutMode; defaultLayout: LayoutMode; onLayoutChange?: (value: LayoutMode) => void; breakpoint: number; onResize?: (value: number) => void; }; domProps: ComponentPropsWithoutRef<'div'>; ref?: Ref; } /** @internal */ export interface ExtractedContentSlot { children?: ReactNode; config: { minWidth: PanelWidth; }; domProps: ComponentPropsWithoutRef<'div'>; ref?: Ref; }