import { type ReactNode } from "react"; import { type GestureResponderEvent, type Insets, type MouseEvent, type NativeSyntheticEvent, type TargetedEvent } from "react-native"; import { type StyleProp, type ViewStyle } from "../../style/index.js"; import { type ButtonSkin } from "./button.styles.js"; export interface ButtonProps { children?: ReactNode; /** * An icon element rendered before the label (e.g. a lucide or Canvas `Icon`). * It renders directly (not wrapped in the label `Text`, which cannot host an * SVG), spaced from the label by the skin's gap. Pass `iconLeft` alone with * the `icon` size prop for an icon-only square button. The caller sizes and * colors the icon (use the intent's foreground for non-ghost intents). */ iconLeft?: ReactNode; /** An icon element rendered after the label (e.g. a trailing chevron/arrow). */ iconRight?: ReactNode; /** Accessibility label, required for an icon-only button (no text to read). */ accessibilityLabel?: string; onPress?: (event: GestureResponderEvent) => void; /** * Called when a pointer starts hovering the button. Fires on pointer devices * only (web via react-native-web, pointer-equipped iPads/desktops natively); * touch never triggers it. For hover-driven disclosure such as Tooltip. */ onHoverIn?: (event: MouseEvent) => void; /** Called when the pointer stops hovering the button (see `onHoverIn`). */ onHoverOut?: (event: MouseEvent) => void; /** Called when the button gains focus (keyboard tab, or click on web). */ onFocus?: (event: NativeSyntheticEvent) => void; /** Called when the button loses focus. */ onBlur?: (event: NativeSyntheticEvent) => void; primary?: boolean; secondary?: boolean; destructive?: boolean; outline?: boolean; ghost?: boolean; link?: boolean; small?: boolean; large?: boolean; icon?: boolean; block?: boolean; loading?: boolean; disabled?: boolean; /** * Marks the Button as a disclosure/menu trigger and announces its open state to * assistive tech (aria-expanded, which react-native-web forwards and RN maps back * to the native expanded state). Pass the live open boolean; omit for a plain * button. So a Button that toggles a Dropdown/Popover stays accessible. */ expanded?: boolean; /** * Announces that the button opens a popup of this kind (aria-haspopup), for a * menu / dialog / listbox trigger. Pair it with `expanded` so assistive tech * reads both the popup relationship and its open state. Web-only; a no-op natively. */ haspopup?: "menu" | "dialog" | "listbox" | "grid" | "tree" | true; /** E2E hook forwarded to the root element. */ testID?: string; /** Outer layout composition only (width/flex within a parent), never a restyle hook. */ style?: StyleProp; } /** * Insets that grow a `width` x `height` box to a `minTarget` square touch area * (half the shortfall per side, per axis), or undefined when the box already * meets the minimum. Internal: exported for the shell and its tests only. */ export declare function minTargetSlop(minTarget: number, width: number, height: number): Insets | undefined; /** Build a Button component from a platform skin. */ export declare function createButton(skin: ButtonSkin): (props: ButtonProps) => import("react").JSX.Element; //# sourceMappingURL=button.shared.d.ts.map