"use client" import React, { ComponentPropsWithoutRef, forwardRef, useState } from "react" import { tv, type VariantProps } from "tailwind-variants" import { overlayVariants } from "../../styles/utils/overlay" import { classNames } from "../../utils" import { SidebarContext } from "./SidebarContext" import { SidebarCollapsibleItem, SidebarItem } from "./SidebarItem" import { SidebarOpen } from "./SidebarOpen" export type SidebarProps = { containerClassName?: string className?: string children?: React.ReactNode /** * If true, then when the sidebar expands, it will fill up the space it expands into. * This means that content on either side will be pushed to accomodate it. */ fillExpandedSpace?: boolean } & VariantProps & Pick, "aria-label"> const sidebarVariants = tv({ variants: { side: { left: "left-0", right: "right-0", }, }, }) const hoverWidthClassName = classNames("hover:w-[225px]") const SidebarBase = forwardRef(function Sidebar( { className, containerClassName, children, side = "left", fillExpandedSpace = false, ...rest }, ref, ) { const [disableExpand, setDisableExpand] = useState(false) return (
) }) /** * A sidebar is a vertical navigation component that is used to display a list of links and actions. */ export const Sidebar = Object.assign(SidebarBase, { Item: SidebarItem, Open: SidebarOpen, CollapsibleItem: SidebarCollapsibleItem, })