/** * Copyright IBM Corp. 2024, 2026 * * 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 { FC, ForwardRefExoticComponent, ReactNode, RefAttributes, RefObject } from 'react'; import { CoachmarkContentProps } from './CoachmarkContent'; import { NewPopoverAlignment } from '../Popover'; import { CoachmarkContentHeaderProps } from './CoachmarkContentHeader'; import { CoachmarkContentBodyProps } from './CoachmarkContentBody'; export interface CoachmarkProps { /** * Where to render the Coachmark relative to its target. */ align?: NewPopoverAlignment; /** * Specify whether a caret should be rendered on the popover. This is intended to use only for coachmark patterns. */ caret?: boolean; /** * Provide the contents of the Coachmark. */ children: ReactNode; /** * Provide an optional class to be applied to the containing node. */ className?: string; /** * Specify whether a drop shadow should be rendered on the popover. */ dropShadow?: boolean; /** * Specifies whether the component is floating or not. */ floating?: boolean; /** * Specify whether the component should be rendered on high-contrast. */ highContrast?: boolean; /** * A ref to the trigger element that launched the Coachmark. When provided, * focus returns to this element when the Coachmark closes, and `aria-expanded` * is automatically managed on that element — do not set `aria-expanded` * directly on the trigger when using this prop. */ launcherButtonRef?: RefObject; /** * Function to call when the close button is clicked. */ onClose?: () => void; /** * Specifies whether the component is currently open. */ open?: boolean; /** * Fine tune the position of the target in pixels. Applies only to Beacons. */ position?: { x: number; y: number; }; /** * Prevents the Coachmark from closing when clicking outside of it. */ preventCloseOnClickOutside?: boolean; /** * CSS selector for the element that should receive focus when the coachmark opens. */ selectorPrimaryFocus?: string; } export type CoachmarkComponent = ForwardRefExoticComponent> & { Content: FC; ContentHeader: FC; ContentBody: FC; }; /** * Coachmarks are used to call out specific functionality or concepts * within the UI that may not be intuitive but are important for the * user to gain understanding of the product's main value and discover new use cases. */ export declare const Coachmark: CoachmarkComponent;