UNPKG

@carbon/ibm-products

Version:

Carbon for IBM Products

78 lines (77 loc) 2.85 kB
/** * Copyright IBM Corp. 2024, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import React, { ReactNode, RefObject } from 'react'; import { InterstitialScreenHeaderProps } from './InterstitialScreenHeader'; import { InterstitialScreenBodyProps } from './InterstitialScreenBody'; import { InterstitialScreenFooterProps } from './InterstitialScreenFooter'; export type ActionType = 'close' | 'start' | 'skip' | 'back' | 'next'; export interface InterstitialScreenProps { /** * Provide the contents of the InterstitialScreen. */ children: ReactNode; /** * Provide an optional class to be applied to the containing node. */ className?: string; /** * The aria label applied to the Interstitial Screen component */ interstitialAriaLabel?: string; /** * Specifies whether the component is shown as a full-screen * experience, else it is shown as a modal by default. */ isFullScreen?: boolean; /** * Specifies whether the component is currently open. */ isOpen?: boolean; /** * Function to call when the close button is clicked. */ onClose?: (value: ActionType) => void; /** * Provide a ref to return focus to once the interstitial is closed. */ launcherButtonRef?: RefObject<HTMLElement>; } type InterstitialScreenComponent = React.ForwardRefExoticComponent<InterstitialScreenProps & React.RefAttributes<HTMLDivElement>> & { Header: React.FC<InterstitialScreenHeaderProps>; Body: React.FC<InterstitialScreenBodyProps>; Footer: React.FC<InterstitialScreenFooterProps>; }; export type disableButtonConfigType = { skip?: boolean; back?: boolean; next?: boolean; start?: boolean; }; interface InterstitialScreenContextType { bodyChildrenData?: ReactNode; setBodyChildrenData?: (value: ReactNode) => void; isFullScreen?: boolean; handleClose?: (value: ActionType) => void; progStep: number; setProgStep?: (value: number) => void; bodyScrollRef?: RefObject<HTMLDivElement | null>; scrollRef?: RefObject<HTMLDivElement>; handleGotoStep?: (value: number) => void; stepCount: number; setStepCount?: (value: number) => void; disableButtonConfig?: disableButtonConfigType; setDisableButtonConfig?: (value: disableButtonConfigType) => void; } export declare const InterstitialScreenContext: React.Context<InterstitialScreenContextType>; /** * InterstitialScreen can be a full page or an overlay, and are * shown on the first time a user accesses a new experience * (e.g. upon first login or first time opening a page where a * newly purchased capability is presented). */ export declare let InterstitialScreen: InterstitialScreenComponent; export {};