@octopusdeploy/design-system-components
Version:
The design systems component library.
64 lines (63 loc) • 1.83 kB
TypeScript
import type { DesignSystemLinkHref } from "../../routing";
import type { ButtonBasicProps } from "../Button";
import { type CalloutMessageState } from "./Callout.constants";
import type { CalloutContent } from "./calloutContent";
export interface OptionalTitleProps {
title?: string;
hideTitle: true;
}
export interface RequiredTitleProps {
title: string;
hideTitle?: false;
}
type TitleProps = OptionalTitleProps | RequiredTitleProps;
type PrimaryActionProps = Pick<ButtonBasicProps, "label" | "onClick" | "disabled">;
type CalloutActionLinkProps = {
isExternal: true;
href: string;
label: string;
onClick?: () => void;
} | {
isExternal?: false;
href: DesignSystemLinkHref;
label: string;
onClick?: () => void;
};
type OutlinedMessageState = Exclude<CalloutMessageState, "upsell">;
export type StandardCalloutActions = {
primary: PrimaryActionProps;
link?: never;
} | {
link: CalloutActionLinkProps;
primary?: never;
};
export type UpsellCalloutActions = {
primary: PrimaryActionProps;
link?: CalloutActionLinkProps;
} | {
primary?: PrimaryActionProps;
link: CalloutActionLinkProps;
};
type CalloutVariantProps = {
type: "outlined";
messageState: OutlinedMessageState;
actions?: never;
} | {
type?: "standard";
messageState: "upsell";
actions: UpsellCalloutActions;
} | {
type?: "standard";
messageState: Exclude<CalloutMessageState, "upsell">;
actions?: StandardCalloutActions;
};
export type CalloutProps = TitleProps & CalloutVariantProps & {
canClose?: boolean;
onClose?: () => void;
content?: CalloutContent | string;
};
export declare function Callout(props: CalloutProps): import("react/jsx-runtime").JSX.Element;
export declare namespace Callout {
var displayName: string;
}
export {};