From 2698b0d069d01e6ec103ae7ff0fd28712226b94c Mon Sep 17 00:00:00 2001 From: Sam Bocharov Date: Mon, 20 Nov 2023 17:38:46 +0000 Subject: [PATCH] changed typing declarations to match `common-types.ts` file --- .../src/common-types.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/bpk-component-info-banner/src/common-types.d.ts b/packages/bpk-component-info-banner/src/common-types.d.ts index 465e55e538..ae5212ebc7 100644 --- a/packages/bpk-component-info-banner/src/common-types.d.ts +++ b/packages/bpk-component-info-banner/src/common-types.d.ts @@ -19,26 +19,32 @@ import type { FunctionComponent, ReactNode } from 'react'; export declare const ALERT_TYPES: { - readonly PRIMARY: 'primary'; - readonly SUCCESS: 'success'; - readonly WARN: 'warn'; - readonly ERROR: 'error'; - readonly NEUTRAL: 'neutral'; + readonly SUCCESS: 'success', + readonly WARNING: 'warning', + readonly ERROR: 'error', + readonly INFO: 'info', +}; +export declare const STYLE_TYPES: { + readonly DEFAULT: 'default', + readonly ON_CONTRAST: 'onContrast', }; export type AlertTypeValue = (typeof ALERT_TYPES)[keyof typeof ALERT_TYPES]; +export type StyleTypeValue = (typeof STYLE_TYPES)[keyof typeof STYLE_TYPES]; export type CommonProps = { - type: AlertTypeValue; + type?: AlertTypeValue; message: ReactNode | string; animateOnEnter?: boolean; animateOnLeave?: boolean; show?: boolean; bannerClassName?: string | null; icon?: FunctionComponent | null; + style?: StyleTypeValue; [rest: string]: any; }; export type OnExpandToggleHandler = | ((expanded: boolean) => void) | null | undefined; +export type ExpandableBannerAction = { title: string, callback: () => void } | null | undefined; export type OnDismissHandler = (() => void) | null | undefined; export type OnHideHandler = (() => void) | null | undefined;