import { ComponentPropsWithoutRef } from 'react'; import { OpenCloseTransitionStateEffects } from '../../internal/hooks'; import { FocusableElement, DisableCloseOnEscapeOrClickProps, Size } from '../../types'; import { DrillDownContextProps } from '../DrillDown/internal/DrillDownContext'; /** * Props for the Drawer component * @extends ComponentPropsWithoutRef<"dialog"> * @extends DialogTransitionStateEffects * @extends DisableCloseOnEscapeOrClickProps */ export type DrawerProps = ComponentPropsWithoutRef<"dialog"> & OpenCloseTransitionStateEffects & DisableCloseOnEscapeOrClickProps & { /** * The size of the drawer. * @default "medium" */ size?: Extract; /** * Controls whether the drawer is open or closed. * @default false */ open?: boolean; /** * Callback function called after the drawer is animated closed. */ onClose?: () => void; /** * Callback when clicking outside the drawer */ onClickOutside?: (e: globalThis.MouseEvent) => void; /** * Enables scroll chaining behavior. * @link https://developer.mozilla.org/en-US/docs/Glossary/Scroll_chaining */ enableScrollChaining?: boolean; /** * Given an array of focusable elements, return the initial focus target. * @param focusables - The focusable elements to pick from * @returns The initial focus target */ initialFocusResolver?: (focusables: FocusableElement[]) => FocusableElement; /** * Sets the default DrillDown index when used in an uncontrolled way */ defaultDrillDownIndex?: DrillDownContextProps["index"]; /** * Callback to pass context to useDrillDown hook */ onDrillDownContextChange?: (context: DrillDownContextProps) => void; }; /** * A slide-out drawer component that provides a modal-like experience from the side of the screen. * * Features: * - Slide-in animation from the side of the screen * - Keyboard navigation with focus trapping * - Escape key and click outside to close * - Configurable size variants (medium, large) * - Built-in toast support for notifications * - Automatic scroll locking when open * - Accessible with proper ARIA attributes * - Compound component structure with Header, Footer, Content, and CancelButton * - Transition state callbacks for animation control * - Optional scroll chaining support * - Automatic tracking ID generation for analytics * * @example * * Settings * Drawer content goes here * * * Cancel * * */ export declare const Drawer: import('react').ForwardRefExoticComponent, HTMLDialogElement>, "ref"> & OpenCloseTransitionStateEffects & DisableCloseOnEscapeOrClickProps & { /** * The size of the drawer. * @default "medium" */ size?: Extract; /** * Controls whether the drawer is open or closed. * @default false */ open?: boolean; /** * Callback function called after the drawer is animated closed. */ onClose?: () => void; /** * Callback when clicking outside the drawer */ onClickOutside?: (e: globalThis.MouseEvent) => void; /** * Enables scroll chaining behavior. * @link https://developer.mozilla.org/en-US/docs/Glossary/Scroll_chaining */ enableScrollChaining?: boolean; /** * Given an array of focusable elements, return the initial focus target. * @param focusables - The focusable elements to pick from * @returns The initial focus target */ initialFocusResolver?: (focusables: FocusableElement[]) => FocusableElement; /** * Sets the default DrillDown index when used in an uncontrolled way */ defaultDrillDownIndex?: DrillDownContextProps["index"]; /** * Callback to pass context to useDrillDown hook */ onDrillDownContextChange?: (context: DrillDownContextProps) => void; } & import('react').RefAttributes> & { /** * Header component for the drawer that displays a title and close button. * * Features: * - Displays the drawer title as a headline * - Includes an accessible close button * - Sticky positioning at the top of the drawer * - Proper semantic HTML structure * - Accessible with proper ARIA attributes * - Consistent styling with the design system * - Automatic close functionality * - Automatic tracking ID generation for analytics * * @example * Settings */ Header: import('react').ForwardRefExoticComponent, HTMLElement>, "ref"> & import('../..').DataTrackingId & import('react').RefAttributes>; /** * Footer component for the drawer that displays action buttons and controls. * * Features: * - Flexible layout for action buttons and controls * - Optional sticky positioning at the bottom * - Proper semantic HTML structure * - Accessible with proper ARIA attributes * - Consistent styling with the design system * - Supports all standard footer element props * - Responsive design that adapts to content * * @example * * * Cancel * */ Footer: import('react').ForwardRefExoticComponent, HTMLElement>, "ref"> & { sticky?: boolean; } & import('react').RefAttributes>; /** * Content container for the drawer that holds the main content area. * * Features: * - Flexible content area with proper spacing * - Scrollable content when needed * - Proper semantic HTML structure * - Accessible with proper ARIA attributes * - Consistent styling with the design system * - Supports all standard div element props * - Responsive design that adapts to content * - Proper focus management * * @example * *

This is the main content of the drawer.

*

It can contain any type of content.

*
*/ Content: import('react').ForwardRefExoticComponent, HTMLDivElement>, "ref"> & { sticky?: boolean; } & import('react').RefAttributes>; /** * A button component that automatically closes the drawer when clicked. * * Features: * - Automatically closes the drawer when clicked * - Extends Button component functionality * - Accessible with proper ARIA attributes * - Consistent styling with the design system * - Supports all standard button props * - Proper focus management * - Can be used anywhere within the drawer context * - Automatic tracking ID generation for analytics * * @example * * Cancel * */ CancelButton: import('react').ForwardRefExoticComponent>; };