import { getAlertDialogProps, getAlertDialogHeaderProps, getAlertDialogBodyProps, getAlertDialogFooterProps, getIconProps, } from '@pluralsight/headless-styles' import type { AlertDialogOptions } from '@pluralsight/headless-styles/types' import { DangerDiamondFilledIcon } from '@pluralsight/icons' import { useFocusTrap } from '@pluralsight/react-utils' import { forwardRef, useId, type ForwardedRef, type SyntheticEvent, type HTMLAttributes, type MutableRefObject, } from 'react' import { Show } from '../../index.ts' // export interface AlertDialogProps extends AlertDialogOptions, HTMLAttributes { onClose?: (e: SyntheticEvent) => void } function AlertDialogEl( props: AlertDialogProps, ref: ForwardedRef, ) { const { kind, bodyId, headingId, usage, ...nativeProps } = props const defaultHeadingId = useId() const pandoProps = getAlertDialogProps({ bodyId: bodyId, headingId: headingId ?? defaultHeadingId, kind, usage, }) const { onKeyDown } = useFocusTrap(ref as MutableRefObject) return ( ) } // export interface AlertDialogHeaderProps extends Pick, HTMLAttributes {} function AlertDialogHeaderEl( props: AlertDialogHeaderProps, ref: ForwardedRef, ) { const { kind, ...nativeProps } = props const pandoProps = getAlertDialogHeaderProps(kind ?? 'non-destructive') return (
{props.children}
) } // export interface AlertDialogBodyProps extends Omit, 'id'> { id: string } function AlertDialogBodyEl( props: AlertDialogBodyProps, ref: ForwardedRef, ) { const pandoProps = getAlertDialogBodyProps(props.id) return
} // export type AlertDialogFooterProps = HTMLAttributes function AlertDialogFooterEl( props: AlertDialogFooterProps, ref: ForwardedRef, ) { const pandoProps = getAlertDialogFooterProps() return