import { ComponentPropsWithoutRef } from 'react';
import { IconElement } from '@servicetitan/anvil2-icons';
import { WindowDragHandleProps } from '../AppShell/appSurface/types';
/**
* Ghost icon-button action with tooltip and accessible name.
*/
export type AppHeaderAction = {
/** Icon-only glyph; {@link AppHeaderAction.label} is its accessible name. */
icon: IconElement;
/** Accessible name and tooltip. Use a short imperative. */
label: string;
/** Press handler. Omit when the control has no activation (e.g. a drag handle). */
onPress?: () => void;
/** Makes the action inert and removes it from the tab order. Defaults to `false`. */
disabled?: boolean;
/** Stable identity for the React key. Defaults to `label` when omitted. */
id?: string;
/**
* Turns the action into a docked {@link Window} drag handle. Inert elsewhere.
*
* @example
* const { dragHandleProps } = useAppSurface();
* , label: "Move window", dragHandleProps },
* ]} />
*/
dragHandleProps?: WindowDragHandleProps;
};
export type AppHeaderProps = Omit, "children" | "title" | "style"> & {
/**
* Primary `` title. Truncates to one line; omit for an action-only header.
*/
title?: string;
/** Icon actions at inline start. */
leadingActions?: AppHeaderAction[];
/** Icon actions at inline end. */
trailingActions?: AppHeaderAction[];
};