import React, { RefObject } from "react"; import { PaddingProps, WidthProps } from "styled-system"; import type { ModalProps } from "../../__internal__/modal"; import { type TagProps } from "../../__internal__/utils/helpers/tags"; export interface SidebarProps extends PaddingProps, TagProps, WidthProps, Pick { /** Prop to specify the aria-describedby property of the component */ "aria-describedby"?: string; /** * Provides an explicit accessible name for the component, overriding the * automatic association with the header. */ "aria-label"?: string; /** * Identifies the element that provides an explicit accessible name for the * component, overriding the automatic association with the header. */ "aria-labelledby"?: string; /** Modal content */ children?: React.ReactNode; /** Data tag prop bag for close Button */ closeButtonDataProps?: Pick; /** Determines if the Esc Key closes the modal */ disableEscKey?: boolean; /** Set this prop to false to hide the translucent background when the dialog is open. */ enableBackgroundUI?: boolean; /** * Whether the Sidebar uses its full-screen presentation below the small-screen breakpoint. * @private * @internal * @ignore */ fullScreenOnSmallScreen?: boolean; /** * When true, header and footer become non-sticky and scroll with content * for accessibility on small screen devices. */ disableStickyOnSmallScreen?: boolean; /** Optional reference to an element meant to be focused on open */ focusFirstElement?: React.MutableRefObject; /** Footer content to be rendered at the bottom of the Sidebar. */ footer?: React.ReactNode; disableAutoFocus?: boolean; /** * Function to replace focus trap * @ignore * @private */ bespokeFocusTrap?: (ev: KeyboardEvent, firstElement?: HTMLElement, lastElement?: HTMLElement) => void; /** Node that will be used as sidebar header. */ header?: React.ReactNode; /** Node that will be used as sidebar subheader. */ subHeader?: React.ReactNode; /** * Header background variant for the sidebar. * `light` and `dark` are deprecated aliases - use `typical` and `inverse` instead. */ headerVariant?: "typical" | "inverse" | "light" | "dark"; /** Adds the Carbon AI gradient keyline to the header. */ gradientKeyLine?: boolean; /** A custom close event handler */ onCancel?: (ev: React.KeyboardEvent | KeyboardEvent | React.MouseEvent) => void; /** Sets the open state of the modal */ open: boolean; /** @deprecated This prop will be removed in a future release. * Sidebar will always be positioned on the right. * Update the layout to support a right-positioned Sidebar if it is set to * left, otherwise remove the prop. * */ position?: "left" | "right"; /** The ARIA role to be applied to the component container */ role?: string; /** @deprecated Use `width` to customise the Sidebar width. */ size?: "extra-small" | "small" | "medium-small" | "medium" | "medium-large" | "large" | "extra-large"; /** Enables width animation when the sidebar width changes. */ widthAnimation?: boolean; /** Makes the footer stick to the bottom of the Sidebar when content scrolls. */ stickyFooter?: boolean; /** an optional array of refs to containers whose content should also be reachable by tabbing from the sidebar */ focusableContainers?: RefObject[]; /** Optional selector to identify the focusable elements, if not provided a default selector is used */ focusableSelectors?: string; /** Padding to be set on the Sidebar header */ headerPadding?: PaddingProps; /** Padding to be set on the Sidebar subheader */ subHeaderPadding?: PaddingProps; /** * @private * @ignore * @internal * Sets className for component. INTERNAL USE ONLY. */ className?: string; /** * @private @ignore @internal * Whether the `Sidebar` is hidden from view when rendered in an `AdaptiveSidebar`. */ hidden?: boolean; /** @private @internal @ignore */ "data-component"?: string; } export declare const Sidebar: React.ForwardRefExoticComponent>; export default Sidebar;