import type { ReactNode } from 'react'; import type { Styles, TextStyle } from '@cleartrip/ct-design-types'; import { AlertCalloutVariants } from './constants'; export type AlertCalloutVariant = `${AlertCalloutVariants}`; export interface IAlertCalloutStyleConfig { /** * Styles for the root container of the alert callout. Applied on top of * the variant's default background + padding. */ root?: Styles[]; /** * Styles for the flex wrapper that holds the prefix icon + text node. */ rootContainer?: Styles[]; /** * Styles for the container wrapping the prefix icon. */ prefixIconContainer?: Styles[]; /** * Styles for the immediate wrapper around the text node. */ textNodeContainerWrapper?: Styles[]; /** * Styles applied to the text node (when it is rendered as a Typography — * i.e. when `textNode` is a string). */ textNodeContainer?: TextStyle[]; /** * Styles for the container wrapping the right action node. */ rightActionContainer?: Styles[]; } export interface IAlertCalloutProps { /** * The variant of the alert callout. */ variant?: AlertCalloutVariant; /** * Prefix icon rendered on the leading edge of the callout. */ prefixIconNode?: ReactNode; /** * Main content of the callout. When a string is provided, it is rendered * inside a Typography variant="P3"; when a ReactNode is provided, it is * rendered as-is. */ textNode: ReactNode; /** * Action node rendered on the trailing edge of the callout. */ rightActionNode?: ReactNode; /** * Optional description content rendered below the main callout row. */ description?: ReactNode; /** * Callback fired when the root container is clicked. */ onClick?: () => void; /** * Style configuration overrides for each internal container. */ styleConfig?: IAlertCalloutStyleConfig; } /** * @deprecated Kept for backward compatibility with the previous * emotion-styled implementation; use the variant + styleConfig API instead. */ export interface IStyledAlertCallout { variant: AlertCalloutVariant; css?: Styles; }