From b4a5d056ee31f56f736d4df34b9cdaa884daa8e5 Mon Sep 17 00:00:00 2001 From: Marcin Lewandowski Date: Tue, 31 Oct 2023 22:07:03 +0100 Subject: [PATCH] fix(Notification): allow undefined props in TypeScript (#15068) Co-authored-by: Taylor Jones --- .../src/components/Notification/Notification.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/react/src/components/Notification/Notification.tsx b/packages/react/src/components/Notification/Notification.tsx index 39f11dc5fc94..b6b2a4368ee3 100644 --- a/packages/react/src/components/Notification/Notification.tsx +++ b/packages/react/src/components/Notification/Notification.tsx @@ -336,7 +336,7 @@ export interface ToastNotificationProps extends HTMLAttributes { /** * Specify what state the notification represents */ - kind: + kind?: | 'error' | 'info' | 'info-square' @@ -357,13 +357,13 @@ export interface ToastNotificationProps extends HTMLAttributes { /** * Provide a function that is called when the close button is clicked */ - onCloseButtonClick(event: MouseEvent): void; + onCloseButtonClick?(event: MouseEvent): void; /** * By default, this value is "status". You can also provide an alternate * role if it makes sense from the accessibility-side */ - role: 'alert' | 'log' | 'status'; + role?: 'alert' | 'log' | 'status'; /** * Provide a description for "status" icon that can be read by screen readers @@ -612,7 +612,7 @@ export interface InlineNotificationProps /** * Specify what state the notification represents */ - kind: + kind?: | 'error' | 'info' | 'info-square' @@ -633,13 +633,13 @@ export interface InlineNotificationProps /** * Provide a function that is called when the close button is clicked */ - onCloseButtonClick(event: MouseEvent): void; + onCloseButtonClick?(event: MouseEvent): void; /** * By default, this value is "status". You can also provide an alternate * role if it makes sense from the accessibility-side. */ - role: 'alert' | 'log' | 'status'; + role?: 'alert' | 'log' | 'status'; /** * Provide a description for "status" icon that can be read by screen readers @@ -859,7 +859,7 @@ export interface ActionableNotificationProps /** * Specify what state the notification represents */ - kind: + kind?: | 'error' | 'info' | 'info-square' @@ -886,7 +886,7 @@ export interface ActionableNotificationProps /** * Provide a function that is called when the close button is clicked */ - onCloseButtonClick(event: MouseEvent): void; + onCloseButtonClick?(event: MouseEvent): void; /** * By default, this value is "alertdialog". You can also provide an alternate