import { type ReactNode } from "react";
import { Button as WebButton } from "../../atoms/button/button.js";
import { type LayoutStyle, type ViewStyle, type TextStyle } from "../../style/index.js";
export type Tone = "info" | "success" | "warning" | "error" | "neutral";
/** The component an Alert draws with that looks different per platform: the link Button
* its `action` takes outside the announcement bar. */
export interface AlertParts {
Button?: typeof WebButton;
}
export interface AlertSkin {
/** Banner shape + density (border-radius, padding, gap). */
container: ViewStyle;
/** The leading glyph's size (an `` element and the default tone glyph). */
iconSize: number;
/** The leading glyph's box (its offset on the title's first line). */
iconSlot: ViewStyle;
/** A text-character glyph's type (size / line-height). */
iconType: TextStyle;
/** Title type (size / line-height / weight / tracking). */
titleType: TextStyle;
/** Description / body type (size / line-height / tracking). */
bodyType: TextStyle;
/** The gap between the title, the description, the children and the actions. */
contentGap: number;
/** Dismiss control shape (size, radius). */
dismissButton: ViewStyle;
/** The dismiss glyph's size. */
dismissIconSize: number;
/** Pressed opacity for the dismiss control (iOS/web dim; Android stays opaque under ripple). */
dismissPressedOpacity: number;
/**
* Hit-area inset per side (pt/dp) padding the 24px dismiss box out to the platform
* minimum touch target (HIG 44x44pt on iOS, M3 48x48dp on Android) without changing
* the rendered size. null (web) keeps pointer targets visual.
*/
dismissHitSlop: number | null;
/** Footer action region: the row layout + gap between action buttons, plus the
* top separation dividing them from the body above. */
actions: ViewStyle;
/** The `announcement` bar: its one-line row (shape, padding, gap), its glow, its message
* and inline action type, its glyph size and its dismiss box. */
announcement: {
container: ViewStyle;
glow: (glow: string) => ViewStyle;
iconSize: number;
message: TextStyle;
action: TextStyle;
dismissButton: ViewStyle;
dismissIconSize: number;
};
}
export interface AlertProps {
title?: string;
description?: string;
/**
* The leading glyph: an element (an ``, tinted to the tone's color unless it
* sets its own, and sized to the banner's glyph) or a single text character. Omitted,
* the banner draws its tone's own glyph (an info circle on info and neutral, a check
* on success, an alert circle on warning, a cross on destructive); `null` draws none.
*/
icon?: ReactNode;
info?: boolean;
success?: boolean;
warning?: boolean;
/** The danger tone. This is the name the intent axis uses across the kit (Button,
* AlertDialog, and every chart) and the one the design hand-off uses here too. */
destructive?: boolean;
/**
* The announcement bar: one line on the accent gradient (the accent running into the
* cyan series hue) in the accent's own ink, under its glow, with its `action` inline at
* the end. For page-wide news ("v4 is live"), not for a status. It is its own look, so
* it ignores the tone axis.
*/
announcement?: boolean;
/**
* One action, as a label and a handler. On the announcement bar it sits inline at the
* end of the line, in the bar's ink; on the other looks it is a link Button in the
* actions region, before any `actions`.
*/
action?: {
label: string;
onPress?: () => void;
};
/** Shows a trailing dismiss control. Pressing it hides the banner out of the box
* (uncontrolled); pass `dismissed` to own that state instead. */
dismissible?: boolean;
/** Controlled dismissal: `true` hides the banner. Omit to let the Alert manage it. */
dismissed?: boolean;
/** Uncontrolled seed: start hidden. Rarely useful; defaults to false. */
defaultDismissed?: boolean;
/** Fired when the dismiss control is pressed (both modes). */
onDismiss?: () => void;
children?: ReactNode;
/** E2E hook forwarded to the root element. */
testID?: string;
/**
* A footer action region rendered under the body. The Alert owns the layout: it
* separates the actions from the description above and lays the buttons out in a
* row, so a call site passes the buttons directly
* (`actions={}`) with no wrapper.
* Pass a fragment for more than one action.
*/
actions?: ReactNode;
/** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */
style?: LayoutStyle;
}
export declare function toneOf(p: AlertProps): Tone;
export declare function createAlert(skin: AlertSkin, parts?: AlertParts): (props: AlertProps) => import("react").JSX.Element | null;
//# sourceMappingURL=alert.shared.d.ts.map