import { j as jsxRuntimeExports } from '../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
import { cva } from '../node_modules/.pnpm/class-variance-authority@0.6.0_typescript@5.4.3/node_modules/class-variance-authority/dist/index.js';
import { Flex } from '../flex/flex.js';
import { Text } from '../text/text.js';
import styles from './sidebar.module.css.js';

const SidebarRoot = ({ children, ...props }) => {
    return (jsxRuntimeExports.jsx(Flex, { direction: "column", justify: "between", className: styles.sidebar, ...props, children: children }));
};
const SidebarLogo = ({ name = "Apsara", logo, onClick, ...props }) => {
    return (jsxRuntimeExports.jsxs(Flex, { align: "center", direction: "row", gap: "small", onClick: onClick, ...props, children: [jsxRuntimeExports.jsx(Flex, { gap: "small", children: logo }), jsxRuntimeExports.jsx(Text, { size: 2, className: styles.logo, children: name })] }));
};
const SidebarNavigations = ({ children, ...props }) => {
    return (jsxRuntimeExports.jsx(Flex, { direction: "column", gap: "extra-small", ...props, children: children }));
};
const SidebarNavigationsGroup = ({ icon, name, children, ...props }) => {
    return (jsxRuntimeExports.jsxs(Flex, { direction: "column", className: styles.navigationgroup, ...props, children: [jsxRuntimeExports.jsxs(Flex, { className: styles.navigationgroupheading, children: [icon && icon, jsxRuntimeExports.jsx(Text, { size: 2, style: { color: "var(--foreground-muted)" }, children: name })] }), jsxRuntimeExports.jsx(Flex, { direction: "column", className: styles.navigationgroupcontent, children: children })] }));
};
const cell = cva(styles.cell, {
    variants: {
        active: {
            true: styles.active,
        },
        disabled: {
            true: styles.disabled,
        },
    },
});
const SidebarNavigationCell = ({ leadingIcon, trailingIcon, active, disabled, children, asChild = false, ...props }) => {
    return (jsxRuntimeExports.jsx(Flex, { className: cell({ active, disabled }), ...props, children: asChild ? (children) : (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs(Flex, { gap: "small", children: [leadingIcon, jsxRuntimeExports.jsx(Text, { className: styles.cellText, children: children })] }), trailingIcon] })) }));
};
const SidebarFooter = ({ children, action }) => {
    return (jsxRuntimeExports.jsxs(Flex, { className: styles.footer, gap: "small", justify: "between", children: [jsxRuntimeExports.jsx(Text, { children: children }), action] }));
};
const Sidebar = Object.assign(SidebarRoot, {
    Logo: SidebarLogo,
    Navigations: SidebarNavigations,
    NavigationGroup: SidebarNavigationsGroup,
    NavigationCell: SidebarNavigationCell,
    Footer: SidebarFooter,
});

export { Sidebar };
//# sourceMappingURL=sidebar.js.map
