/*! * Copyright (c) 2022-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 { DialogProps as MuiDialogProps } 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 DialogOnCloseReason = MuiOnCloseReason | "closeButtonClick"; export type DialogProps = { /** * @deprecated `aria-label` for close button comes from translation file */ ariaLabel?: string; /** * @deprecated Will be removed in a future Odyssey version. Use `primaryCallToActionComponent` instead. */ callToActionFirstComponent?: ReactElement; /** * @deprecated Will be removed in a future Odyssey version. Use `tertiaryCallToActionComponent` instead. */ callToActionLastComponent?: ReactElement; /** * @deprecated Will be removed in a future Odyssey version. Use `secondaryCallToActionComponent` instead. */ callToActionSecondComponent?: ReactElement; /** * The content of the Dialog. May be a `string` or any other `ReactNode` or array of `ReactNode`s. */ children: ReactNode; /** * If `true`, the dialog is visible. */ isOpen: boolean; /** * Called when the dialog is dismissed. Receives the event and the reason for closing. */ onClose: (event: MuiOnCloseEvent, reason: DialogOnCloseReason) => void; /** * An optional Button object to be situated in the Dialog footer as the primary call to action. */ primaryCallToActionComponent?: ReactElement; /** * An optional Button object to be situated in the Dialog footer as the secondary call to action, alongside the `primaryCallToActionComponent`. */ secondaryCallToActionComponent?: ReactElement; /** * An optional Button object to be situated in the Dialog footer as the tertiary call to action, alongside the other `callToAction` components. */ tertiaryCallToActionComponent?: ReactElement; /** * The title of the Dialog. */ title: string; /** * Controls the opacity of the Dialog backdrop. * - If `'default'`, semi-transparent backdrop. * - If `'security'`, fully opaque backdrop, used for security-sensitive dialogs. * @default "default" */ variant?: "default" | "security"; } & Pick; declare const MemoizedDialog: import("react").MemoExoticComponent<({ primaryCallToActionComponent, secondaryCallToActionComponent, tertiaryCallToActionComponent, callToActionFirstComponent, callToActionSecondComponent, callToActionLastComponent, children, isOpen, onClose, testId, title, translate, variant, }: DialogProps) => import("@emotion/react/jsx-runtime").JSX.Element>; export { MemoizedDialog as Dialog }; //# sourceMappingURL=Dialog.d.ts.map