@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
55 lines (54 loc) • 2.16 kB
TypeScript
import type { IconProp } from "@fortawesome/fontawesome-svg-core";
import type { PropsFor } from "../../types.js";
export type MessageState = MessageProps["state"];
export type MessageProps = PropsFor<"div", {
/** Message title, displayed with an icon */
header?: React.ReactNode;
/** Available states: `default`, `success`, `warning`, `brand`, `chill`,`alert`, `attn`, and `neutral` */
state?: "default" | "success" | "warning" | "alert" | "brand" | "attn" | "chill" | "neutral";
/** Font Awesome icon reference (or string if using library) */
icon?: IconProp;
/** Prevents default icon from being displayed */
noIcon?: boolean;
/** Attention-grabbing one-line message */
statusBar?: boolean;
/** Removes padding from expandable content */
noPadding?: boolean;
/** Close button event handler, the close button is only rendered when this is supplied */
onClose?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
/** If true places children inside dropdown, requires header to be present */
expandable?: boolean;
/** Function triggered when clicking on header */
onHeaderClick?: () => void;
/** Boolean indicating if message is open or not */
isOpen?: boolean;
/** Render children even when `<Message expandable>` is closed. (default `false`) */
eager?: boolean;
/**
* Control the degree of rounded corner-ness
* @example
* `"none"` = no border radius
* `"xs"` = `4px`
* `"s"` = `8px`
* `"m"` (or `undefined`) = `12px` (default)
* `"l"` = `16px`
* `"xl"` = `24px`
* */
radius?: "none" | "xs" | "s" | "m" | "l" | "xl";
}>;
/**
* Display a highlighted message
*
* @see https://bifrost.intility.com/react/message
*
* @example
* <Message>Text</Message>
* <Message state="warning">Yellow box</Message>
*
* @example
* <Message expandable header="Header text will be the clickable button">
* Content inside will be toggleable
* </Message>
*/
declare const Message: import("react").ForwardRefExoticComponent<MessageProps & import("react").RefAttributes<HTMLDivElement>>;
export default Message;