import "./icon_button.css"; import type * as React from "react"; import { Button as Base } from "@base-ui/react/button"; import { type IconName } from "./icon"; import { type ButtonColor } from "./button"; import { type StyleProps, type TriggerProps } from "./style_props"; import { type TooltipSide } from "./tooltip"; import { type InkColor } from "./text_ink"; export type IconButtonColor = ButtonColor | "none" | "white"; export type IconButtonSize = "lg" | "md" | "sm"; interface IconButtonBase extends StyleProps, TriggerProps { ref?: React.Ref; testID?: string; icon: IconName; /** * `Button`'s palette: filled for primary/secondary/danger, ghost for muted/danger-secondary/none. */ color?: IconButtonColor; /** * `lg` (40px) at the control height; `md` (28px) for toolbars and row actions; `sm` (24px) beside * body text. All keep a 40px touch target. */ size?: IconButtonSize; /** Where the variant's ink is not the meaning (a destructive verb on a neutral disc). */ iconColor?: InkColor; /** Card fill, hairline and shadow, to sit on imagery. */ elevated?: boolean; tooltipSide?: TooltipSide; onPress?: (event: React.MouseEvent) => void; disabled?: boolean; /** * `aria-disabled` and a tab stop for a control the reader's press disables (a pager's last step); * otherwise focus drops out of the overlay. */ focusableWhenDisabled?: boolean; /** Blocks press too. */ loading?: boolean; render?: Base.Props["render"]; } /** * The compiler requires `tooltip` or `accessibilityLabel`; with both, `accessibilityLabel` is * announced. */ export type IconButtonProps = IconButtonBase & ({ tooltip: string; accessibilityLabel?: string; } | { tooltip?: string; accessibilityLabel: string; }); export declare function IconButton(props: IconButtonProps): React.JSX.Element; export {};