From fe00ffdeaed39b3bb3d2d61ad0ba111b79cd1703 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 30 Jul 2025 12:08:21 -0500 Subject: [PATCH] Add some type docs --- src/components/Toast/types.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/Toast/types.ts b/src/components/Toast/types.ts index 2bd36b042c..9f1245fa22 100644 --- a/src/components/Toast/types.ts +++ b/src/components/Toast/types.ts @@ -2,9 +2,23 @@ export type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info' export type ToastApi = { show: (props: { + /** + * The type of toast to show. This determines the styling and icon used. + */ type: ToastType - content: React.ReactNode + /** + * A string, `Text`, or `Span` components to render inside the toast. This + * allows additional formatting of the content, but should not be used for + * interactive elements link links or buttons. + */ + content: React.ReactNode | string + /** + * Accessibility label for the toast, used for screen readers. + */ a11yLabel: string + /** + * Defaults to `DEFAULT_TOAST_DURATION` from `#components/Toast/const`. + */ duration?: number }) => void }