{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sidebar",
  "type": "registry:item",
  "title": "Sidebar Overview",
  "description": "A complete sidebar component system with collapsible container, menu items, groups, icons, text, tooltips, and rail",
  "dependencies": [
    "@base-ui/react",
    "@mui/material",
    "@emotion/react",
    "@emotion/styled"
  ],
  "registryDependencies": [
    "https://www.mui-treasury.com/r/shared.json"
  ],
  "files": [
    {
      "path": "components/sidebar/index.ts",
      "target": "src/mui-treasury/components/sidebar/index.ts",
      "content": "export * from './sidebar-classes';\nexport * from './sidebar-container';\nexport * from './sidebar-group';\nexport * from './sidebar-group-label';\nexport * from './sidebar-group-text';\nexport * from './sidebar-menu-list';\nexport * from './sidebar-menu-item';\nexport * from './sidebar-menu-button';\nexport * from './sidebar-menu-action';\nexport * from './sidebar-text';\nexport * from './sidebar-icon';\nexport * from './sidebar-tooltip';\nexport * from './sidebar-rail';\nexport * from './popup-menu';\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/popup-menu.tsx",
      "target": "src/mui-treasury/components/sidebar/popup-menu.tsx",
      "content": "import React from 'react';\n\nimport { NavigationMenu } from '@base-ui/react/navigation-menu';\nimport { SxProps, Theme, styled } from '@mui/material/styles';\n\nimport {\n  SidebarMenuButton,\n  SidebarMenuItem,\n  SidebarMenuList,\n  SidebarTooltip,\n} from './index';\n\ninterface PopupMenuItemProps {\n  children?: React.ReactNode;\n  render: NavigationMenu.Trigger.Props['render'];\n  tooltip?: React.ReactNode;\n  sx?: SxProps<Theme>;\n}\n\nconst StyledPortal = styled(NavigationMenu.Portal)({\n  display: 'var(--_collapsed, block) var(--_uncollapsed, none)',\n  zIndex: 1300,\n});\n\nexport function PopupMenuList({\n  children,\n  sidebarSide = 'left',\n  ...props\n}: React.ComponentProps<typeof NavigationMenu.Root> & {\n  sidebarSide?: 'left' | 'right';\n}) {\n  const [container, setContainer] = React.useState<HTMLElement | null>(null);\n  const triggerCallbackRef = React.useCallback((node: HTMLElement | null) => {\n    if (node) {\n      setContainer(\n        (node.closest('.EdgeSidebar-R') ||\n          node.closest('.EdgeSidebar')) as HTMLElement,\n      );\n    }\n  }, []);\n  return (\n    <NavigationMenu.Root orientation=\"vertical\" {...props}>\n      <NavigationMenu.List\n        ref={triggerCallbackRef as React.Ref<HTMLUListElement>}\n        render={\n          <SidebarMenuList\n            sx={{\n              '& .PopupMenuItem:has(+ :not(.PopupMenuItem))': {\n                // to hide the popup item when uncollapsed, preventing gaps between items\n                display: 'var(--_collapsed, flex) var(--_uncollapsed, none)',\n              },\n              '& .PopupMenuItem + :not(.PopupMenuItem)': {\n                // to hide the uncollapsed sibling when in collapsed mode, preventing gaps between items\n                display: 'var(--_collapsed, none) var(--_uncollapsed, flex)',\n              },\n            }}\n          />\n        }\n      >\n        {children}\n      </NavigationMenu.List>\n\n      <StyledPortal container={container || undefined}>\n        <NavigationMenu.Positioner\n          side={sidebarSide === 'left' ? 'right' : 'left'}\n          align=\"start\"\n        >\n          <NavigationMenu.Popup render={<MenuPopup />}>\n            <NavigationMenu.Viewport />\n          </NavigationMenu.Popup>\n        </NavigationMenu.Positioner>\n      </StyledPortal>\n    </NavigationMenu.Root>\n  );\n}\n\nexport const PopupMenuItem = function PopupMenuItem({\n  render,\n  children,\n  tooltip,\n  sx,\n}: PopupMenuItemProps) {\n  return (\n    <NavigationMenu.Item\n      render={<SidebarMenuItem className=\"PopupMenuItem\" sx={sx} />}\n    >\n      {tooltip ? (\n        <SidebarTooltip\n          title={tooltip}\n          placement=\"right\"\n          disableTouchListener\n          disableHoverListener={!!children}\n          slotProps={{\n            popper: {\n              sx: {\n                '[data-base-ui-portal] ~ &, &:has(~ [data-base-ui-portal])': {\n                  display: 'none !important',\n                },\n              },\n            },\n          }}\n        >\n          <NavigationMenu.Trigger render={render} />\n        </SidebarTooltip>\n      ) : (\n        <NavigationMenu.Trigger render={render} />\n      )}\n      {children}\n    </NavigationMenu.Item>\n  );\n};\n\nexport function PopupMenuContent({\n  children,\n  ...props\n}: NavigationMenu.Content.Props) {\n  return (\n    <NavigationMenu.Content className=\"PopupMenuContent\" {...props}>\n      {children}\n    </NavigationMenu.Content>\n  );\n}\n\nconst MenuPopup = styled(SidebarMenuList)(({ theme }) => ({\n  '--_collapsed': 'var(--__,)',\n  '--_uncollapsed': 'var(--__)',\n  minWidth: 160,\n  padding: theme.spacing(0.5),\n  border: '1px solid',\n  borderColor: (theme.vars || theme).palette.divider,\n  borderRadius: `calc(4px + ${(theme.vars || theme).shape.borderRadius})`,\n  backgroundColor: (theme.vars || theme).palette.background.paper,\n  boxShadow: (theme.vars || theme).shadows[1],\n  '&:has(.PopupMenuContent:empty)': {\n    display: 'none',\n  },\n}));\n\nexport function PopupMenuLink({\n  children,\n  component,\n  ...props\n}: NavigationMenu.Link.Props & {\n  children: React.ReactNode;\n  component?: React.ElementType;\n}) {\n  return (\n    <NavigationMenu.Link\n      render={<SidebarMenuButton component={component} />}\n      {...props}\n    >\n      {children}\n    </NavigationMenu.Link>\n  );\n}\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-classes.ts",
      "target": "src/mui-treasury/components/sidebar/sidebar-classes.ts",
      "content": "export const sidebarClasses = {\n  container: 'SidebarContainer',\n  group: 'SidebarGroup',\n  groupLabel: 'SidebarGroupLabel',\n  groupText: 'SidebarGroupText',\n  menu: 'SidebarMenuList',\n  menuItem: 'SidebarMenuItem',\n  menuButton: 'SidebarMenuButton',\n  menuAction: 'SidebarMenuAction',\n  text: 'SidebarText',\n  icon: 'SidebarIcon',\n  tooltip: 'SidebarTooltip',\n  rail: 'SidebarRail',\n  popupMenu: 'PopupMenu',\n};\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-container.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-container.tsx",
      "content": "'use client';\n\nimport React, { useMemo } from 'react';\n\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarContainerProps = ForwardStyledProps<{\n  shrink?: string;\n  component?: React.ElementType;\n}>;\n\nconst StyledSidebarContainer = styled('div', {\n  name: 'SidebarContainer',\n  slot: 'root',\n})<{ ownerState: Required<Pick<SidebarContainerProps, 'shrink'>> }>(\n  memoTheme(() => ({\n    containerType: 'inline-size',\n    display: 'flex',\n    flexDirection: 'column',\n    flex: 1,\n    minHeight: 0,\n    overflowY: 'auto',\n    '--_collapsed': 'var(--_)',\n    '--_uncollapsed': 'var(--__,)',\n    variants: [\n      {\n        props: () => true,\n        style: ({\n          shrink,\n        }: Required<Pick<SidebarContainerProps, 'shrink'>>) => ({\n          '& > *': {\n            [`@container (min-width: ${shrink})`]: {\n              '--_collapsed': 'var(--__,)',\n              '--_uncollapsed': 'var(--_)',\n            },\n          },\n        }),\n      },\n    ],\n  })),\n);\n\nexport const SidebarContainer = React.forwardRef<\n  HTMLDivElement,\n  SidebarContainerProps & React.ComponentPropsWithoutRef<'div'>\n>(function SidebarContainer(\n  { className, shrink = '100px', component, ...props },\n  ref,\n) {\n  const ownerState = useMemo(() => ({ shrink }), [shrink]);\n  return (\n    <StyledSidebarContainer\n      ref={ref}\n      className={`${sidebarClasses.container} ${className || ''}`}\n      ownerState={ownerState}\n      as={component}\n      {...props}\n    />\n  );\n}) as OverridableComponent<SidebarContainerProps, 'div'>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-group-label.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-group-label.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarGroupLabelProps = ForwardStyledProps<{\n  component?: React.ElementType;\n}>;\n\nconst StyledSidebarGroupLabel = styled('div', {\n  name: 'SidebarGroupLabel',\n  slot: 'root',\n})(\n  memoTheme(({ theme }) => ({\n    position: 'relative',\n    textOverflow: 'ellipsis',\n    transition: 'var(--tsn, var(--_uncollapsed, opacity 0.4s))',\n    opacity: 'var(--_uncollapsed, 1) var(--_collapsed, 0)',\n    overflow: 'hidden',\n    fontSize: 'var(--item-fs, 0.75rem)',\n    lineHeight: 'var(--item-lh, 1.125rem)',\n    minHeight: 'var(--item-h, 2rem)',\n    display: 'flex',\n    alignItems: 'center',\n    color: (theme.vars || theme).palette.text.secondary,\n    paddingInline: 'var(--item-px, 0.5rem)',\n    paddingBlock: 'var(--item-py, 0.25rem)',\n  })),\n);\n\nexport const SidebarGroupLabel = React.forwardRef<\n  HTMLDivElement,\n  SidebarGroupLabelProps & React.ComponentPropsWithoutRef<'div'>\n>(function SidebarGroupLabel({ className, component, ...props }, ref) {\n  return (\n    <StyledSidebarGroupLabel\n      ref={ref}\n      className={`${sidebarClasses.groupLabel} ${className || ''}`}\n      as={component}\n      {...props}\n    />\n  );\n}) as OverridableComponent<SidebarGroupLabelProps, 'div'>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-group-text.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-group-text.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport type { ForwardStyledProps } from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarGroupTextProps = ForwardStyledProps;\n\nconst StyledSidebarGroupText = styled('div', {\n  name: 'SidebarGroupText',\n  slot: 'root',\n})({\n  transition:\n    'var(--tsn, grid-template-rows 0.4s, opacity 0.4s var(--_uncollapsed, 0.2s))',\n  opacity: 'var(--_collapsed, 0) var(--_uncollapsed, 1)',\n  display: 'grid',\n  whiteSpace: 'nowrap',\n  gridTemplateRows: 'var(--_collapsed, 0fr) var(--_uncollapsed, 1fr)',\n  '& > *': {\n    overflow: 'hidden',\n  },\n});\n\nexport const SidebarGroupText = React.forwardRef<\n  HTMLDivElement,\n  SidebarGroupTextProps & React.ComponentPropsWithoutRef<'div'>\n>(function SidebarGroupText({ className, ...props }, ref) {\n  return (\n    <StyledSidebarGroupText\n      ref={ref}\n      className={`${sidebarClasses.groupText} ${className || ''}`}\n      {...props}\n    />\n  );\n});\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-group.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-group.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarGroupProps = ForwardStyledProps<{\n  component?: React.ElementType;\n}>;\n\nconst StyledSidebarGroup = styled('div', {\n  name: 'SidebarGroup',\n  slot: 'root',\n})(\n  memoTheme(({ theme }) => ({\n    display: 'flex',\n    flexDirection: 'column',\n    padding: theme.spacing(1),\n  })),\n);\n\nexport const SidebarGroup = React.forwardRef<\n  HTMLDivElement,\n  SidebarGroupProps & React.ComponentPropsWithoutRef<'div'>\n>(function SidebarGroup({ className, component, ...props }, ref) {\n  return (\n    <StyledSidebarGroup\n      ref={ref}\n      className={`${sidebarClasses.group} ${className || ''}`}\n      as={component}\n      {...props}\n    />\n  );\n}) as OverridableComponent<SidebarGroupProps, 'div'>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-icon.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-icon.tsx",
      "content": "'use client';\n\nimport React, { useMemo } from 'react';\n\nimport { Breakpoint, styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type { ForwardStyledProps } from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarIconProps = ForwardStyledProps<{\n  size?: string | Partial<Record<Breakpoint, string>>;\n  shrinkSize?: string | Partial<Record<Breakpoint, string>>;\n}>;\n\nconst StyledSidebarIcon = styled('span', {\n  name: 'SidebarIcon',\n  slot: 'root',\n})<{ ownerState: SidebarIconProps }>(\n  {\n    '--_mt': '0px',\n    height: 'var(--icon-size, 1rem)',\n    width: 'var(--icon-size, 1rem)',\n    transition: 'var(--tsn, cubic-bezier(0.4, 0, 0.2, 1) 0.15s)',\n    flex: 'none',\n    display: 'inline-flex',\n    alignItems: 'center',\n    justifyContent: 'center',\n    marginTop: 'var(--_mt)',\n    '& svg': {\n      width: '100%',\n      height: '100%',\n    },\n    '&:has(+ .SidebarGroupText)': {\n      '--_mt': 'max(18px - var(--icon-size, 1rem), 0px)',\n    },\n  },\n  memoTheme(({ theme }) => ({\n    variants: [\n      {\n        props: ({ size }: SidebarIconProps) => !!size,\n        style: ({ size }: Required<SidebarIconProps>) => {\n          const toSize = (v: string) => ({\n            '--icon-size': v,\n            height: v,\n            width: v,\n            [`.${sidebarClasses.menuItem}:has(&)`]: {\n              '--icon-w': v,\n            },\n          });\n          if (typeof size === 'string') {\n            return toSize(size);\n          }\n          const result: Record<string, unknown> = {};\n          for (const bp of Object.keys(size) as Breakpoint[]) {\n            const val = size[bp];\n            if (!val) continue;\n            if (bp === 'xs') {\n              Object.assign(result, toSize(val));\n            } else {\n              result[theme.breakpoints.up(bp)] = toSize(val);\n            }\n          }\n          return result;\n        },\n      },\n      {\n        props: ({ shrinkSize }: SidebarIconProps) => !!shrinkSize,\n        style: ({ shrinkSize }: Required<SidebarIconProps>) => {\n          const toCollapsible = (v: string) => ({\n            width: `var(--_collapsed, ${v}) var(--_uncollapsed, var(--icon-size, 1rem))`,\n            height: `var(--_collapsed, ${v}) var(--_uncollapsed, var(--icon-size, 1rem))`,\n          });\n          if (typeof shrinkSize === 'string') {\n            return toCollapsible(shrinkSize);\n          }\n          const result: Record<string, unknown> = {};\n          for (const bp of Object.keys(shrinkSize) as Breakpoint[]) {\n            const val = shrinkSize[bp];\n            if (!val) continue;\n            if (bp === 'xs') {\n              Object.assign(result, toCollapsible(val));\n            } else {\n              result[theme.breakpoints.up(bp)] = toCollapsible(val);\n            }\n          }\n          return result;\n        },\n      },\n    ],\n  })),\n);\n\nexport const SidebarIcon = React.forwardRef<\n  HTMLSpanElement,\n  SidebarIconProps & React.ComponentPropsWithoutRef<'span'>\n>(function SidebarIcon({ className, size, shrinkSize, ...props }, ref) {\n  const ownerState = useMemo(() => ({ size, shrinkSize }), [size, shrinkSize]);\n  return (\n    <StyledSidebarIcon\n      ref={ref}\n      className={`${sidebarClasses.icon} ${className || ''}`}\n      ownerState={ownerState}\n      {...props}\n    />\n  );\n});\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-menu-action.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-menu-action.tsx",
      "content": "'use client';\n\nimport React, { useMemo } from 'react';\n\nimport ButtonBase, { ButtonBaseProps } from '@mui/material/ButtonBase';\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarMenuActionProps = ForwardStyledProps<{\n  hoverAppear?: boolean;\n  _before?: React.ReactNode;\n  component?: React.ElementType;\n}>;\n\nconst StyledSidebarMenuAction = styled(ButtonBase, {\n  name: 'SidebarMenuAction',\n  slot: 'root',\n})<{ ownerState: SidebarMenuActionProps }>(\n  memoTheme(({ theme }) => ({\n    '--_ms': 'initial',\n    flex: 'none', // prevent action from shrinking when the text is long and the sidebar is collapsing.\n    marginInlineStart: 'var(--_ms)',\n    width: 'var(--action-size, 1.5rem)',\n    height: 'var(--action-size, 1.5rem)',\n    display: 'inline-flex',\n    visibility:\n      'var(--_collapsed, hidden) var(--_uncollapsed, visible)' as never,\n    justifyContent: 'center',\n    alignItems: 'center',\n    alignSelf: 'center',\n    color: (theme.vars || theme).palette.text.secondary,\n    transition: 'var(--tsn, right 0.4s)',\n    borderRadius: (theme.vars || theme).shape.borderRadius,\n    '&:first-of-type': {\n      '--_ms': 'auto',\n    },\n    '&:focus-visible, &:has(:focus-visible )': {\n      outline: '2px solid',\n      outlineColor: (theme.vars || theme).palette.text.primary,\n      outlineOffset: '2px',\n    },\n    '@media (hover: hover)': {\n      '&:hover': {\n        backgroundColor: (theme.vars || theme).palette.action.hover,\n      },\n    },\n    '& svg': {\n      width: 'var(--icon-size, 1rem)',\n      height: 'var(--icon-size, 1rem)',\n    },\n    variants: [\n      {\n        props: { hoverAppear: true },\n        style: {\n          opacity: 0,\n          '&:hover, &:focus-visible': {\n            opacity: 1,\n          },\n          [`.${sidebarClasses.menuButton}:hover ~ &, .${sidebarClasses.groupLabel} > &`]:\n            {\n              opacity: 1,\n            },\n        },\n      },\n    ],\n  })),\n);\n\nexport const SidebarMenuAction = React.forwardRef<\n  HTMLButtonElement,\n  SidebarMenuActionProps & ButtonBaseProps\n>(function SidebarMenuAction(\n  { className, hoverAppear, _before, component, children, ...props },\n  ref,\n) {\n  const ownerState = useMemo(() => ({ hoverAppear }), [hoverAppear]);\n  return (\n    <StyledSidebarMenuAction\n      ref={ref}\n      className={`${sidebarClasses.menuAction} ${className || ''}`}\n      ownerState={ownerState}\n      as={\n        component ??\n        (className?.includes('CollapsibleTrigger') ? 'label' : undefined)\n      }\n      {...props}\n    >\n      {_before}\n      {children}\n    </StyledSidebarMenuAction>\n  );\n}) as OverridableComponent<SidebarMenuActionProps, typeof ButtonBase>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-menu-button.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-menu-button.tsx",
      "content": "'use client';\n\nimport React, { useMemo } from 'react';\n\nimport ButtonBase, { ButtonBaseProps } from '@mui/material/ButtonBase';\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarMenuButtonProps = ForwardStyledProps<{\n  active?: boolean;\n  hideWhen?: 'collapsed' | 'uncollapsed';\n  _before?: React.ReactNode;\n  component?: React.ElementType;\n}>;\n\nconst StyledSidebarMenuButton = styled(ButtonBase, {\n  name: 'SidebarMenuButton',\n  slot: 'root',\n})<{ ownerState: Pick<SidebarMenuButtonProps, 'active' | 'hideWhen'> }>(\n  memoTheme(({ theme }) => ({\n    '--_items': 'center',\n    minWidth: 0,\n    textAlign: 'left',\n    alignItems: 'var(--_items)',\n    justifyContent: 'initial',\n    flex: 1,\n    fontSize: 'var(--item-fs, 0.875rem)',\n    lineHeight: 'var(--item-lh, 1.25rem)',\n    minHeight: 'var(--item-h, 2rem)',\n    borderRadius: (theme.vars || theme).shape.borderRadius,\n    color: (theme.vars || theme).palette.text.secondary,\n    cursor: 'pointer',\n    userSelect: 'none', // prevent text highlighting when clicking rapidly or from collapsible trigger\n    transition:\n      'var(--tsn, min-height var(--_collapsed, 0.2s) var(--_uncollapsed, 0.3s), padding var(--_collapsed, 0.2s) var(--_uncollapsed, 0.3s), gap var(--_collapsed, 0s 0.4s) var(--_uncollapsed, 0s))',\n    '--item-gap': 'var(--_collapsed, 0px) var(--_uncollapsed, 0.5rem)',\n    display: 'flex',\n    gap: 'var(--item-gap)',\n    whiteSpace: 'nowrap', // required to prevent text jumping when collapsing/uncollapsing\n    paddingInline:\n      'var(--_collapsed, var(--shrink-px, var(--item-px, 0.5rem))) var(--_uncollapsed, var(--item-px, 0.5rem))',\n    paddingBlock:\n      'var(--_collapsed, var(--shrink-py, var(--item-py, 0.375rem))) var(--_uncollapsed, var(--item-py, 0.375rem))',\n    '&:focus-visible': {\n      outline: '2px solid',\n      outlineColor: (theme.vars || theme).palette.text.primary,\n    },\n    '&:is(label)': {\n      userSelect: 'none',\n      '&:has(input:focus-visible)': {\n        outline: `2px solid ${(theme.vars || theme).palette.primary.main}`,\n      },\n    },\n    '@media (hover: hover)': {\n      '&:hover': {\n        color: (theme.vars || theme).palette.text.primary,\n        backgroundColor: (theme.vars || theme).palette.action.hover,\n      },\n    },\n    '&:has(.SidebarIcon + .SidebarGroupText)': {\n      '--_items': 'flex-start',\n    },\n    variants: [\n      {\n        props: { active: true },\n        style: {\n          color: (theme.vars || theme).palette.text.primary,\n          backgroundColor: (theme.vars || theme).palette.action.hover,\n        },\n      },\n      {\n        props: { hideWhen: 'collapsed' },\n        style: {\n          display: 'var(--_collapsed, none) var(--_uncollapsed, flex)',\n        },\n      },\n      {\n        props: { hideWhen: 'uncollapsed' },\n        style: {\n          display: 'var(--_collapsed, flex) var(--_uncollapsed, none)',\n        },\n      },\n    ],\n  })),\n);\n\nexport const SidebarMenuButton = React.forwardRef<\n  HTMLButtonElement,\n  SidebarMenuButtonProps & ButtonBaseProps\n>(function SidebarMenuButton(\n  { className, active, hideWhen, _before, component, children, ...props },\n  ref,\n) {\n  const ownerState = useMemo(() => ({ active, hideWhen }), [active, hideWhen]);\n  return (\n    <StyledSidebarMenuButton\n      ref={ref}\n      className={`${sidebarClasses.menuButton} ${className || ''}`}\n      ownerState={ownerState}\n      as={\n        component ??\n        (className?.includes('CollapsibleTrigger') ? 'label' : undefined)\n      }\n      {...props}\n    >\n      {_before}\n      {children}\n    </StyledSidebarMenuButton>\n  );\n}) as OverridableComponent<SidebarMenuButtonProps, typeof ButtonBase>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-menu-item.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-menu-item.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarMenuItemProps = ForwardStyledProps<{\n  component?: React.ElementType;\n}>;\n\nconst StyledSidebarMenuItem = styled('div', {\n  name: 'SidebarMenuItem',\n  slot: 'root',\n})({\n  display: 'flex',\n  flexDirection: 'column',\n  position: 'relative',\n  '&:has(.SidebarMenuAction)': {\n    flexDirection: 'row',\n  },\n});\n\nexport const SidebarMenuItem = React.forwardRef<\n  HTMLDivElement,\n  SidebarMenuItemProps & React.ComponentPropsWithoutRef<'div'>\n>(function SidebarMenuItem({ className, component, ...props }, ref) {\n  return (\n    <StyledSidebarMenuItem\n      ref={ref}\n      className={`${sidebarClasses.menuItem} ${className || ''}`}\n      as={component}\n      {...props}\n    />\n  );\n}) as OverridableComponent<SidebarMenuItemProps, 'div'>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-menu-list.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-menu-list.tsx",
      "content": "'use client';\n\nimport React, { useMemo } from 'react';\n\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\nimport { SidebarMenuButton } from './sidebar-menu-button';\n\nexport { SidebarMenuButton };\n\nexport type SidebarMenuProps = ForwardStyledProps<{\n  nested?: boolean;\n  noLine?: boolean;\n  component?: React.ElementType;\n}>;\n\nexport const sidebarMenuListRelaxedStyles = {\n  gap: '0.5rem',\n  '--item-gap': '0.75rem',\n  '--item-h': '2.5rem',\n  '--item-fs': '1rem',\n  '--item-lh': '1.5rem',\n  '--item-px': '0.75rem',\n  '--item-py': '0.5rem',\n  '--action-size': '2rem',\n  '--icon-size': '1.25rem',\n};\n\nconst StyledSidebarMenuList = styled('div', {\n  name: 'SidebarMenuList',\n  slot: 'root',\n})<{ ownerState: SidebarMenuProps }>(\n  {\n    display: 'flex',\n    flexDirection: 'column',\n    gap: '0.25rem',\n  },\n  memoTheme(({ theme }) => ({\n    variants: [\n      {\n        props: { nested: true },\n        style: {\n          '--item-py': '0.1875rem', // 3px sweet spot for >1 line of text to have some padding.\n          '--item-h': 'calc(var(--item-lh, 1.25rem) + 0.5rem)',\n          paddingBlock: '0.25rem',\n          position: 'relative',\n          marginLeft:\n            'calc(var(--icon-w, 1rem) + 2*var(--item-gap, 0.5rem) - 0.5rem)',\n          marginRight: 0,\n          '&::before': {\n            content: '\"\"',\n            display: 'block',\n            position: 'absolute',\n            width: '1px',\n            top: '2px',\n            bottom: '2px',\n            left: 'calc(var(--icon-w, 1rem)/-2 - var(--item-gap, 0.5rem) + 0.5rem)',\n            background: (theme.vars || theme).palette.divider,\n          },\n        },\n      },\n      {\n        props: { nested: true, noLine: true },\n        style: {\n          '&::before': {\n            display: 'none',\n          },\n        },\n      },\n    ],\n  })),\n);\n\nexport const SidebarMenuList = React.forwardRef<\n  HTMLDivElement,\n  SidebarMenuProps & React.ComponentPropsWithoutRef<'div'>\n>(function SidebarMenuList(\n  { className, nested, noLine, component, ...props },\n  ref,\n) {\n  const ownerState = useMemo(() => ({ nested, noLine }), [nested, noLine]);\n  return (\n    <StyledSidebarMenuList\n      ref={ref}\n      className={`${sidebarClasses.menu} ${className || ''}`}\n      ownerState={ownerState}\n      as={component}\n      {...props}\n    />\n  );\n}) as OverridableComponent<SidebarMenuProps, 'div'>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-rail.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-rail.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  ForwardStyledProps,\n  OverridableComponent,\n} from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarRailProps = ForwardStyledProps<{\n  component?: React.ElementType;\n}>;\n\nconst StyledSidebarRail = styled('button', {\n  name: 'SidebarRail',\n  slot: 'root',\n})(\n  memoTheme(({ theme }) => ({\n    '--indicator-w': '6px',\n    '--touch-size': '20px',\n    '--offset': 'calc(-1 * var(--touch-size)/2)',\n    position: 'absolute',\n    top: 0,\n    bottom: 0,\n    right: 'var(--anchorLeft, var(--offset)) var(--anchorRight, unset)',\n    left: 'var(--anchorLeft, unset) var(--anchorRight, var(--offset))',\n    zIndex: 20,\n    width: 'var(--touch-size)',\n    textAlign: 'center',\n    cursor:\n      'var(--_collapsed, e-resize) var(--_uncollapsed, w-resize)' as never,\n    display: 'inline-flex',\n    justifyContent: 'center',\n    border: 'none',\n    padding: 0,\n    background: 'transparent',\n    '&::after': {\n      content: '\"\"',\n      width: 'var(--indicator-w)',\n      height: '100px',\n      borderRadius: '10px',\n      display: 'block',\n      position: 'absolute',\n      top: '50%',\n      transform: 'translateY(-50%)',\n      transition: 'background 0.2s',\n    },\n    '@media (hover: hover)': {\n      '&:hover::after': {\n        background: (theme.vars || theme).palette.text.tertiary,\n        transition: 'background 0.4s 0.2s',\n      },\n    },\n  })),\n);\n\nexport const SidebarRail = React.forwardRef<\n  HTMLButtonElement,\n  SidebarRailProps & React.ComponentPropsWithoutRef<'button'>\n>(function SidebarRail({ className, component, ...props }, ref) {\n  return (\n    <StyledSidebarRail\n      ref={ref}\n      className={`${sidebarClasses.rail} ${className || ''}`}\n      as={component}\n      {...props}\n    />\n  );\n}) as OverridableComponent<SidebarRailProps, 'button'>;\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-text.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-text.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport type { ForwardStyledProps } from '../../types/shared/component';\nimport { sidebarClasses } from './sidebar-classes';\n\nexport type SidebarTextProps = ForwardStyledProps;\n\nconst StyledSidebarText = styled('span', {\n  name: 'SidebarText',\n  slot: 'root',\n})({\n  '--_ws': 'initial',\n  display: 'block',\n  textOverflow: 'ellipsis',\n  transition: 'var(--tsn, var(--_uncollapsed, opacity 0.3s))',\n  flex: 'var(--_uncollapsed, 1) var(--_collapsed, 0)',\n  opacity: 'var(--_uncollapsed, 1) var(--_collapsed, 0)',\n  overflow: 'hidden',\n  whiteSpace: 'var(--_ws)',\n  [`*:where(.${sidebarClasses.text} + &)`]: {\n    fontSize: 'calc(var(--item-fs, 0.875rem) - 0.125rem)',\n  },\n});\n\nexport const SidebarText = React.forwardRef<\n  HTMLSpanElement,\n  SidebarTextProps & React.ComponentPropsWithoutRef<'span'>\n>(function SidebarText({ className, ...props }, ref) {\n  return (\n    <StyledSidebarText\n      ref={ref}\n      className={`${sidebarClasses.text} ${className || ''}`}\n      {...props}\n    />\n  );\n});\n",
      "type": "registry:item"
    },
    {
      "path": "components/sidebar/sidebar-tooltip.tsx",
      "target": "src/mui-treasury/components/sidebar/sidebar-tooltip.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nimport Tooltip, { type TooltipProps } from '@mui/material/Tooltip';\nimport { styled } from '@mui/material/styles';\n\nimport { sidebarClasses } from './sidebar-classes';\n\nconst StyledTitle = styled('span', {\n  name: 'SidebarTooltip',\n  slot: 'root',\n})({\n  maxWidth: 80,\n  width: 'max-content',\n  display: 'flex',\n  '[role=\"tooltip\"]:has(&)': {\n    display: 'var(--_collapsed, block) var(--_uncollapsed, none)',\n  },\n});\n\ninterface SidebarTooltipProps extends Omit<\n  TooltipProps,\n  'title' | 'placement'\n> {\n  title: React.ReactNode;\n  placement?: TooltipProps['placement'];\n}\n\nconst SidebarTooltip = React.forwardRef<HTMLDivElement, SidebarTooltipProps>(\n  function SidebarTooltip(\n    { title, placement = 'right', slotProps, ...props },\n    forwardedRef,\n  ) {\n    const [container, setContainer] = React.useState<Element | null>(null);\n    const innerRef = React.useRef<HTMLDivElement | null>(null);\n    React.useEffect(() => {\n      if (innerRef.current) {\n        setContainer(innerRef.current.closest('.EdgeSidebar'));\n      }\n    }, []);\n    return (\n      <Tooltip\n        ref={(node: HTMLDivElement | null) => {\n          innerRef.current = node;\n          if (typeof forwardedRef === 'function') {\n            forwardedRef(node);\n          } else if (forwardedRef) {\n            forwardedRef.current = node;\n          }\n        }}\n        title={\n          <StyledTitle className={sidebarClasses.tooltip}>{title}</StyledTitle>\n        }\n        placement={placement}\n        slotProps={{\n          ...slotProps,\n          popper: {\n            container,\n            ...(typeof slotProps?.popper === 'object' && !!slotProps?.popper\n              ? slotProps.popper\n              : {}),\n          },\n        }}\n        {...props}\n      />\n    );\n  },\n);\n\nexport { SidebarTooltip };\n",
      "type": "registry:item"
    }
  ],
  "meta": {
    "category": "primitive",
    "subcategory": "sidebar"
  }
}