import React__default from 'react';
import classnames from 'classnames';
import { H as Heading } from './Heading-es.js';
import { B as ButtonDismiss } from './ButtonDismiss-es.js';

var styles$1 = {"container":"LNIwHwCs8gQ-","drawer":"iDSQR4mxUvM-","open":"y9lAhWPltyg-","header":"s830oNhRdZE-","heading":"MZuJ7od4r-o-","contentScroll":"I4XEGwkvw74-","content":"jZzp04L7Gao-","spinning":"dzsdJUdmmt8-"};

function Drawer({ title, children, open = true, onRequestClose, id, }) {
    const drawerClassNames = classnames(styles$1.container, open && styles$1.open);
    return (React__default.createElement("aside", { className: drawerClassNames, "data-testid": "drawer-container", "aria-label": title, "aria-hidden": !open, id: id },
        React__default.createElement("div", { className: styles$1.drawer },
            React__default.createElement(Header, { title: title, onRequestClose: onRequestClose }),
            React__default.createElement("div", { className: styles$1.contentScroll },
                React__default.createElement("div", { className: styles$1.content }, children)))));
}
function Header({ title, onRequestClose }) {
    return (React__default.createElement("div", { className: styles$1.header, "data-testid": "drawer-header" },
        React__default.createElement("div", { className: styles$1.heading },
            React__default.createElement(Heading, { level: 2 }, title)),
        React__default.createElement(ButtonDismiss, { onClick: onRequestClose, ariaLabel: `Close ${title || "drawer"}` })));
}

var styles = {"drawerGrid":"_50Jq09W07gg-","spinning":"GqOdr2k9PX8-"};

function DrawerGrid({ children }) {
    return React__default.createElement("div", { className: styles.drawerGrid }, children);
}

export { Drawer as D, DrawerGrid as a };
