From ec1f75b69a2d0d06ada02f274ea114f9348aedcb Mon Sep 17 00:00:00 2001 From: xelaint Date: Fri, 15 Dec 2023 12:05:27 -0600 Subject: [PATCH] add docs --- .../toast/src/interfaces/toast-action.ts | 19 ++++++++++++++++++- libs/design/toast/src/interfaces/toast.ts | 6 ++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/libs/design/toast/src/interfaces/toast-action.ts b/libs/design/toast/src/interfaces/toast-action.ts index 23a24c9bf5..4546dd9444 100644 --- a/libs/design/toast/src/interfaces/toast-action.ts +++ b/libs/design/toast/src/interfaces/toast-action.ts @@ -6,11 +6,17 @@ import { } from '@daffodil/design'; /** - * An interface for properties of actions, specifically the DaffButtonComponent, placed inside of a toast. + * An interface for properties of actions, specifically the DaffButtonComponent, placed inside of the toast. */ export interface DaffToastAction { + /** + * The types of buttons available to be used, as defined in the {@link DaffButtonComponent}. + */ type?: 'raised' | 'underline' | 'stroked' | 'flat' | undefined; + /** + * The text for the button + */ content: string; /** @@ -18,12 +24,23 @@ export interface DaffToastAction { */ size?: 'sm' | 'md' | 'lg' | undefined; + /** + * The color of the button, as defined in the {@link DaffButtonComponent}. + * Color and status should not be used simultaneously. + */ color?: DaffPalette; + /** + * The status of the button, as defined in the {@link DaffButtonComponent}. + * Color and status should not be used simultaneously. + */ status?: DaffStatus; data?: Record; + /** + * Sets an EventEmitter on a DaffToastAction + */ eventEmitter?: EventEmitter; } diff --git a/libs/design/toast/src/interfaces/toast.ts b/libs/design/toast/src/interfaces/toast.ts index 3a0d7c41ed..b92b132a8c 100644 --- a/libs/design/toast/src/interfaces/toast.ts +++ b/libs/design/toast/src/interfaces/toast.ts @@ -4,15 +4,21 @@ import { DaffStatus } from '@daffodil/design'; import { DaffToastAction } from './toast-action'; +/** Possible data that can be shown on a toast */ export interface DaffToastData { + /** A title that provides a quick oveview of the toast */ title: string; + /** A short message used to provide additional details about the toast */ message?: string; + /** Sets a status on the toast */ status?: DaffStatus; + /** Used to display actions in the toast */ actions?: DaffToastAction[]; + /** Whether or not the toast is dismissible */ dismissible?: boolean; }