@octopusdeploy/design-system-components
Version:
The design systems component library.
42 lines (41 loc) • 1.36 kB
TypeScript
import type * as React from "react";
import type { DesignSystemLinkHref } from "../../routing";
import type { ButtonBasicProps, ButtonLinkProps } from "../Button";
export declare const calloutTypes: readonly ["information", "success", "warning", "danger", "new-feature", "upsell"];
export type CalloutMessageState = (typeof calloutTypes)[number];
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"> | Pick<ButtonLinkProps, "label" | "onClick" | "href" | "external" | "disabled">;
type CalloutActionLinkProps = {
isExternal: true;
href: string;
label: string;
onClick?: () => void;
} | {
isExternal?: false;
href: DesignSystemLinkHref;
label: string;
onClick?: () => void;
};
export type CalloutProps = TitleProps & {
messageState: CalloutMessageState;
actions?: {
primary?: PrimaryActionProps;
link?: CalloutActionLinkProps;
};
canClose?: boolean;
onClose?: () => void;
children?: React.ReactNode;
};
export declare const Callout: {
(props: CalloutProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export {};