import * as React from "react"; import { cx } from "@emotion/css"; import { ThemeProvider, useTheme } from "@emotion/react"; import { sidebar, sidebarAnimator, sidebarContainer } from "../style"; import { greyLightLighten1, greyLightLighten4 } from "../../design-tokens/build/js/designTokens"; import { getResponsiveStyle } from "../../shared/styles/styleUtils"; import { AppChromeTheme } from "../types"; export interface SidebarProps { /** * Whether a sidebar items contents are visible */ isOpen: boolean; /** Function that gets called when a sidebar item opens */ onOpen?: () => void; /** Function that gets called when a sidebar item closes */ onClose?: () => void; /** Children to render inside of the sidebar */ children?: React.ReactNode; /** * Changes the background color for the entire sidebar */ bgColor?: string; /** * Changes the color for sidebar items on hover */ hoverColor?: string; /** * Changes the color for sidebar items in an active selected state */ activeColor?: string; } const defaultSidebarWidths = { default: "240px", large: "280px" }; const StyledSidebar = ({ children, isOpen }: SidebarProps) => { const theme: AppChromeTheme = useTheme(); return (