From 5860e5c4b13386d64c52783580d985c25d26f128 Mon Sep 17 00:00:00 2001 From: Jake Laderman Date: Tue, 22 Oct 2024 12:14:54 -0400 Subject: [PATCH 1/2] 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 } From 39d025acd7c7636a03f09136afd7a48d419045d6 Mon Sep 17 00:00:00 2001 From: Jake Laderman Date: Tue, 22 Oct 2024 12:33:50 -0400 Subject: [PATCH 2/2] add sparkle icon --- src/components/icons/AiSparkleFilledIcon.tsx | 19 +++++++++++++++++++ src/components/icons/AiSparkleOutlineIcon.tsx | 17 +++++++++++++++++ src/icons.ts | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 src/components/icons/AiSparkleFilledIcon.tsx create mode 100644 src/components/icons/AiSparkleOutlineIcon.tsx diff --git a/src/components/icons/AiSparkleFilledIcon.tsx b/src/components/icons/AiSparkleFilledIcon.tsx new file mode 100644 index 00000000..51f5c363 --- /dev/null +++ b/src/components/icons/AiSparkleFilledIcon.tsx @@ -0,0 +1,19 @@ +import createIcon from './createIcon' + +export default createIcon(({ size, color }) => ( + + + +)) diff --git a/src/components/icons/AiSparkleOutlineIcon.tsx b/src/components/icons/AiSparkleOutlineIcon.tsx new file mode 100644 index 00000000..d43fb650 --- /dev/null +++ b/src/components/icons/AiSparkleOutlineIcon.tsx @@ -0,0 +1,17 @@ +import createIcon from './createIcon' + +export default createIcon(({ size, color }) => ( + + + +)) diff --git a/src/icons.ts b/src/icons.ts index 1a06e741..9965b392 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -1,3 +1,5 @@ +export { default as AiSparkleFilledIcon } from './components/icons/AiSparkleFilledIcon' +export { default as AiSparkleOutlineIcon } from './components/icons/AiSparkleOutlineIcon' export { default as AmazonLogoIcon } from './components/icons/AmazonLogoIcon' export { default as AnsibleIcon } from './components/icons/AnsibleIcon' export { default as ApiIcon } from './components/icons/ApiIcon'