'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var index = require('../../node_modules/.pnpm/@radix-ui_react-collapsible@1.1.2_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18._hjslo7xm5vmo3b4sx344jkbtcq/node_modules/@radix-ui/react-collapsible/dist/index.cjs');
var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var tooltip = require('../tooltip/tooltip.cjs');
var sidepanel_module = require('./sidepanel.module.css.cjs');

const root = index$1.cva(sidepanel_module.default.root);
const SidepanelRoot = ({ className, position = 'left', open, onOpenChange, children, profile, ref, ...props }) => (jsxRuntime.jsxRuntimeExports.jsx(tooltip.TooltipProvider, { children: jsxRuntime.jsxRuntimeExports.jsxs(index.Root, { ref: ref, className: root({ className }), "data-position": position, "data-state": open ? 'expanded' : 'collapsed', open: open, onOpenChange: onOpenChange, "aria-label": "Navigation Sidebar", "aria-expanded": open, role: "navigation", ...props, children: [jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: open ? "Click to collapse" : "Click to expand", side: position === 'left' ? 'right' : 'left', children: jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidepanel_module.default.resizeHandle, onClick: () => onOpenChange?.(!open), role: "button", tabIndex: 0, "aria-label": open ? "Collapse sidebar" : "Expand sidebar", onKeyDown: (e) => {
                        if (e.key === 'Enter' || e.key === ' ') {
                            e.preventDefault();
                            onOpenChange?.(!open);
                        }
                    } }) }), children, profile && (jsxRuntime.jsxRuntimeExports.jsxs("a", { href: profile.href, className: sidepanel_module.default.account, role: "button", "aria-label": `Profile: ${profile.label}`, onClick: (e) => {
                    if (profile.onIconClick) {
                        e.preventDefault();
                        profile.onIconClick();
                    }
                }, children: [jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidepanel_module.default['nav-icon'], "aria-hidden": "true", style: { cursor: profile.onIconClick ? 'pointer' : undefined }, children: profile.icon }), jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidepanel_module.default['nav-text'], children: profile.label })] }))] }) }));
const SidepanelHeader = ({ className, logo, title, onLogoClick, ref, ...props }) => (jsxRuntime.jsxRuntimeExports.jsxs("div", { ref: ref, className: sidepanel_module.default.header, role: "banner", ...props, children: [jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidepanel_module.default.logo, "aria-hidden": "true", onClick: onLogoClick, role: onLogoClick ? "button" : undefined, tabIndex: onLogoClick ? 0 : undefined, onKeyDown: (e) => {
                if (onLogoClick && (e.key === 'Enter' || e.key === ' ')) {
                    e.preventDefault();
                    onLogoClick();
                }
            }, style: { cursor: onLogoClick ? 'pointer' : undefined }, children: logo }), jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidepanel_module.default.title, role: "heading", "aria-level": 1, children: title })] }));
const SidepanelMain = ({ className, children, ref, ...props }) => (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: sidepanel_module.default.main, role: "group", "aria-label": "Main navigation", ...props, children: children }));
const SidepanelFooter = ({ className, children, ref, ...props }) => (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: sidepanel_module.default.footer, role: "group", "aria-label": "Footer navigation", ...props, children: children }));
const SidepanelItem = ({ className, icon, children, active, ref, ...props }) => (jsxRuntime.jsxRuntimeExports.jsxs("a", { ref: ref, className: sidepanel_module.default['nav-item'], "data-active": active, role: "menuitem", "aria-current": active ? "page" : undefined, ...props, children: [jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidepanel_module.default['nav-icon'], "aria-hidden": "true", children: icon }), jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidepanel_module.default['nav-text'], children: children })] }));
SidepanelRoot.displayName = "Sidepanel.Root";
SidepanelHeader.displayName = "Sidepanel.Header";
SidepanelMain.displayName = "Sidepanel.Main";
SidepanelFooter.displayName = "Sidepanel.Footer";
SidepanelItem.displayName = "Sidepanel.Item";
const Sidepanel = {
    Root: SidepanelRoot,
    Header: SidepanelHeader,
    Main: SidepanelMain,
    Footer: SidepanelFooter,
    Item: SidepanelItem,
};

exports.Sidepanel = Sidepanel;
//# sourceMappingURL=sidepanel.cjs.map
