/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-127afd4
 * Released under the MIT license.
 */

import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { VisuallyHidden } from 'react-aria';
import { tasty } from '../../../../tasty/index.js';
import { ClearSlots } from '../../../../utils/react/index.js';
import { Title } from '../../../content/Title.js';
import { Flex } from '../../../layout/Flex.js';
import { Dialog, DialogTrigger, } from '../../Dialog/index.js';
import { useNotificationsObserver } from '../hooks/index.js';
import { NotificationsDialogProvider } from './NotificationsDialogContext.js';
export function NotificationsDialogTrigger(props) {
    const { onCloseNotificationInBar, ...dialogTriggerProps } = props;
    useNotificationsObserver((args) => onCloseNotificationInBar?.(args));
    return _jsx(DialogTrigger, { ...dialogTriggerProps, type: "popover" });
}
const StyledDialog = tasty(Dialog, { height: 'auto calc(100vh - 12x)' });
const StyledDialogContent = tasty(Flex, {
    styles: {
        flow: 'column',
        placeItems: 'start start',
        scrollbar: 'styled',
        height: '100%',
        radius: '0.5x',
        overflow: 'auto',
    },
});
export function NotificationsDialog(props) {
    const { children, title = 'Notifications', ...dialogProps } = props;
    return (_jsxs(StyledDialog, { ...dialogProps, children: [_jsx(VisuallyHidden, { children: _jsx(Title, { children: title }) }), _jsx(StyledDialogContent, { children: _jsx(NotificationsDialogProvider, { children: _jsx(ClearSlots, { children: children }) }) })] }));
}

        