Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xelaint committed Dec 15, 2023
1 parent 487c8fd commit ec1f75b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 18 additions & 1 deletion libs/design/toast/src/interfaces/toast-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,41 @@ 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;

/**
* The size of the button, as defined in the {@link DaffButtonComponent}.
*/
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<string, any>;

/**
* Sets an EventEmitter on a DaffToastAction
*/
eventEmitter?: EventEmitter<DaffToastAction>;
}

Expand Down
6 changes: 6 additions & 0 deletions libs/design/toast/src/interfaces/toast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ec1f75b

Please sign in to comment.