import "./button.css"; import type * as React from "react"; import { Button as Base } from "@base-ui/react/button"; import { type IconName } from "./icon"; import { type StyleProps, type TriggerProps } from "./style_props"; import { type UseTooltipOptions } from "./tooltip"; export type ButtonColor = "primary" | "secondary" | "danger" | "muted" | "danger-secondary"; interface ButtonPropsBase extends StyleProps, TriggerProps { ref?: React.Ref; testID?: string; icon?: IconName; alignSelf?: "flex-start" | "flex-end" | "center" | "stretch" | "auto"; color?: ButtonColor; /** * An action whose DESTINATION carries a brand of its own — an export that * produces a spreadsheet, a sign-in with a named provider, a share into a * service. Pass that brand's colour and the button wears it: the colour as the * ground, white on the label and the mark. * * A named CATEGORY with a colour slot rather than a `style` escape hatch: * `ButtonColor` is a closed set on purpose, and an outside brand is not on that * ladder — not a status, not a valence, not a palette family. It renders SOLID, * which is what a brand action looks like everywhere it appears. * * The cost is real: a screen with several of these is a screen with no primary. * Ignored on `primary` and `danger`, whose own colours are load-bearing. */ brandColor?: string; loading?: boolean; disabled?: boolean; tooltip?: string | UseTooltipOptions; onPress?: (event: React.MouseEvent) => void; render?: Base.Props["render"]; } /** * A `Button` is a LABELLED action — `title` is MANDATORY and is its accessible * name. For an icon-only affordance use `IconButton` (circular); the compiler * blocks a title-less Button so icon-only actions never render as a rounded box. */ export type ButtonProps = ButtonPropsBase & { title: string; accessibilityLabel?: string; tooltip?: string | UseTooltipOptions; }; export declare function Button(props: ButtonProps): React.JSX.Element; export {};