Skip to content

Commit

Permalink
fix toast props
Browse files Browse the repository at this point in the history
  • Loading branch information
jsladerman committed Oct 22, 2024
1 parent e603004 commit 5860e5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const BANNER_SEVERITIES = [
type BannerSeverity = Extract<SeverityExt, (typeof BANNER_SEVERITIES)[number]>
const DEFAULT_SEVERITY: BannerSeverity = 'success'

type BannerProps = FlexProps & {
export type BannerProps = FlexProps & {
severity?: BannerSeverity | 'error'
heading?: ReactNode
action?: ReactNode
Expand Down
7 changes: 3 additions & 4 deletions src/components/Toast.tsx
Original file line number Diff line number Diff line change
@@ -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<Severity, 'info' | 'success' | 'danger'>
Expand All @@ -16,7 +15,7 @@ type ToastProps = {
onCloseComplete?: () => void
show?: boolean
severity?: ToastSeverity
} & FlexProps
} & BannerProps

const defaults = {
closeTimeout: 10000, // 10 seconds
Expand Down Expand Up @@ -110,4 +109,4 @@ function GraphQLToast({
)
}

export { Toast, GraphQLToast }
export { GraphQLToast, Toast }

0 comments on commit 5860e5c

Please sign in to comment.