/*! * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved. * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") * * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and limitations under the License. */ import { DrawerProps as MuiDrawerProps } from "@mui/material"; import { ReactElement, ReactNode } from "react"; import type { HtmlProps } from "./HtmlProps.js"; import { Button } from "./Buttons/Button.js"; type MuiOnCloseEvent = Parameters["onClose"]>[0]; type MuiOnCloseReason = Parameters["onClose"]>[1]; export type DrawerOnCloseReason = MuiOnCloseReason | "closeButtonClick"; export declare const variantValues: readonly ["temporary", "persistent"]; export type DrawerProps = { /** * The content of the Drawer. May be a `string` or any other `ReactNode` or array of `ReactNode`s. */ children?: ReactNode; /** * If `true`, the drawer is visible. */ isOpen?: boolean; /** * Called when the drawer is dismissed. Receives the event and the reason for closing. */ onClose: (event: MuiOnCloseEvent, reason: DrawerOnCloseReason) => void; /** * An optional Button object to be situated in the Drawer footer. Should almost always be of variant `primary`. */ primaryCallToActionComponent?: ReactElement; /** * An optional Button object to be situated in the Drawer footer, alongside the `callToActionPrimaryComponent`. */ secondaryCallToActionComponent?: ReactElement; /** * An optional Button object to be situated in the Drawer footer, alongside the other two `callToAction` components. */ tertiaryCallToActionComponent?: ReactElement; /** * Heading text displayed at the top of the drawer. */ title?: string; /** * Controls how the Drawer positions relative to page content. * - If `'temporary'`, overlays content and dismisses when the user clicks the backdrop. * - If `'persistent'`, pushes the page layout to the side and stays open until explicitly closed. * * A `'temporary'` Drawer spans the full viewport width at 400 pixels and below. A `'persistent'` Drawer keeps its width of about 360 pixels at every viewport size. * @default "temporary" */ variant?: (typeof variantValues)[number]; } & Pick & ({ /** * If `true`, renders divider lines separating the header, content, and footer sections. * @default false */ hasDividers?: never; /** * @deprecated use `hasDividers` instead. * * If `true`, shows divider lines separating header, content, and footer. Use `hasDividers` instead. * @default false */ showDividers: boolean; } | { /** * If `true`, renders divider lines separating the header, content, and footer sections. * @default false */ hasDividers: boolean; /** * @deprecated use `hasDividers` instead. * * If `true`, shows divider lines separating header, content, and footer. Use `hasDividers` instead. * @default false */ showDividers?: never; }); declare const MemoizedDrawer: import("react").MemoExoticComponent<({ ariaLabel, children, hasDividers: hasDividersProp, isOpen, onClose, primaryCallToActionComponent, secondaryCallToActionComponent, showDividers, tertiaryCallToActionComponent, testId, title, translate, variant, }: DrawerProps) => import("@emotion/react/jsx-runtime").JSX.Element>; export { MemoizedDrawer as Drawer }; //# sourceMappingURL=Drawer.d.ts.map