From 5860e5c4b13386d64c52783580d985c25d26f128 Mon Sep 17 00:00:00 2001 From: Jake Laderman Date: Tue, 22 Oct 2024 12:14:54 -0400 Subject: [PATCH] fix toast props --- src/components/Banner.tsx | 2 +- src/components/Toast.tsx | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Banner.tsx b/src/components/Banner.tsx index 3d16e29f..983ef44b 100644 --- a/src/components/Banner.tsx +++ b/src/components/Banner.tsx @@ -23,7 +23,7 @@ export const BANNER_SEVERITIES = [ type BannerSeverity = Extract const DEFAULT_SEVERITY: BannerSeverity = 'success' -type BannerProps = FlexProps & { +export type BannerProps = FlexProps & { severity?: BannerSeverity | 'error' heading?: ReactNode action?: ReactNode diff --git a/src/components/Toast.tsx b/src/components/Toast.tsx index f317cb48..d59b4a9e 100644 --- a/src/components/Toast.tsx +++ b/src/components/Toast.tsx @@ -1,10 +1,9 @@ -import { type FlexProps } from 'honorable' import { type Ref, forwardRef, useCallback, useEffect, useState } from 'react' import { type Severity } from '../types' import { type Extends } from '../utils/ts-utils' -import Banner from './Banner' +import Banner, { type BannerProps } from './Banner' import Layer, { type LayerPositionType } from './Layer' export type ToastSeverity = Extends @@ -16,7 +15,7 @@ type ToastProps = { onCloseComplete?: () => void show?: boolean severity?: ToastSeverity -} & FlexProps +} & BannerProps const defaults = { closeTimeout: 10000, // 10 seconds @@ -110,4 +109,4 @@ function GraphQLToast({ ) } -export { Toast, GraphQLToast } +export { GraphQLToast, Toast }