@asgardeo/react
Version:
React implementation of Asgardeo JavaScript SDK.
62 lines (61 loc) • 2.95 kB
TypeScript
/**
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with 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 { UseFloatingReturn, UseInteractionsReturn } from '@floating-ui/react';
import React from 'react';
interface DialogOptions {
initialOpen?: boolean;
onOpenChange?: (open: boolean) => void;
open?: boolean;
}
interface DialogHookReturn extends UseFloatingReturn, UseInteractionsReturn {
descriptionId: string | undefined;
labelId: string | undefined;
open: boolean;
setDescriptionId: React.Dispatch<React.SetStateAction<string | undefined>>;
setLabelId: React.Dispatch<React.SetStateAction<string | undefined>>;
setOpen: (open: boolean) => void;
}
export declare function useDialog({ initialOpen, open: controlledOpen, onOpenChange: setControlledOpen, }?: DialogOptions): DialogHookReturn;
export declare const useDialogContext: () => DialogHookReturn;
export declare function Dialog({ children, ...options }: {
children: React.ReactNode;
} & DialogOptions): import("react/jsx-runtime").JSX.Element;
interface DialogTriggerProps {
asChild?: boolean;
children: React.ReactNode;
}
export declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & DialogTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
export declare const DialogContent: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
export declare const DialogHeading: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
export declare const DialogDescription: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
interface DialogCloseProps {
asChild?: boolean;
children?: React.ReactNode;
}
export declare const DialogClose: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
export interface DialogComponent extends React.FC<{
children: React.ReactNode;
} & DialogOptions> {
Trigger: typeof DialogTrigger;
Content: typeof DialogContent;
Heading: typeof DialogHeading;
Description: typeof DialogDescription;
Close: typeof DialogClose;
}
declare const _default: DialogComponent;
export default _default;