{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "layout-core",
  "type": "registry:item",
  "title": "Layout Components",
  "description": "Core layout primitives (Root, Header, Content, Footer, EdgeSidebar, InsetSidebar) for building app shells with CSS Grid.",
  "dependencies": [
    "@mui/material",
    "@emotion/react",
    "@emotion/styled"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "layout/layout-core/Content.tsx",
      "target": "src/mui-treasury/layout/layout-core/Content.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport { layoutClasses } from './layoutClasses';\n\nconst StyledContent = styled('main', {\n  name: 'LayoutContent',\n  slot: 'root',\n})(\n  memoTheme(() => ({\n    '--_overflow': 'var(--content-overflow)',\n    overflow: 'var(--_overflow)' as never,\n    gridArea: layoutClasses.Content,\n    minHeight: 0,\n  })),\n);\n\nconst Content = React.forwardRef<\n  HTMLElement,\n  React.ComponentProps<typeof StyledContent>\n>(function Content({ className, ...props }, ref) {\n  return (\n    <StyledContent\n      ref={ref}\n      className={`${layoutClasses.Content} ${className || ''}`}\n      {...props}\n    />\n  );\n});\n\nexport default Content;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/EdgeDrawerClose.tsx",
      "target": "src/mui-treasury/layout/layout-core/EdgeDrawerClose.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport { layoutAttrs } from './layoutAttrs';\nimport { layoutClasses } from './layoutClasses';\n\nconst StyledEdgeDrawerClose = styled('button')({\n  display: 'var(--_drawer, flex) var(--_permanent, none)',\n  visibility: 'hidden',\n  opacity: 0,\n  transition: 'var(--tsn, 0.3s)',\n  position: 'var(--drawer-pos)' as never,\n  top: 'calc(0.875rem + var(--jun-H-clip-h))',\n  right: 'var(--anchorLeft, 0.875rem)',\n  left: 'var(--anchorRight, 0.875rem)',\n  zIndex: 2,\n  width: 40,\n  height: 40,\n  color: 'white',\n  cursor: 'pointer',\n  backgroundColor: '#999',\n  borderRadius: '40px',\n  border: 'none',\n  alignItems: 'center',\n  justifyContent: 'center',\n  '& svg': {\n    width: '1.5em',\n    height: '1.5em',\n  },\n  [`[${layoutAttrs.isDrawerOpen}] &`]: {\n    visibility: 'visible',\n    opacity: 1,\n  },\n});\n\nconst EdgeDrawerClose = React.forwardRef<\n  HTMLButtonElement,\n  React.ComponentProps<typeof StyledEdgeDrawerClose>\n>(function EdgeDrawerClose({ className, children, ...props }, ref) {\n  return (\n    <StyledEdgeDrawerClose\n      ref={ref}\n      className={`${layoutClasses.EdgeDrawerClose} ${className || ''}`}\n      {...props}\n    >\n      {children || (\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          fill=\"none\"\n          viewBox=\"0 0 24 24\"\n          strokeWidth=\"1.5\"\n          stroke=\"currentColor\"\n        >\n          <path\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            d=\"M6 18 18 6M6 6l12 12\"\n          />\n        </svg>\n      )}\n    </StyledEdgeDrawerClose>\n  );\n});\n\nexport default EdgeDrawerClose;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/EdgeDrawerTrigger.tsx",
      "target": "src/mui-treasury/layout/layout-core/EdgeDrawerTrigger.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { triggerEdgeDrawer } from './EdgeSidebar';\nimport { layoutClasses } from './layoutClasses';\n\ninterface EdgeDrawerTriggerProps {\n  render: React.ReactElement<{\n    className?: string;\n    onClick?: React.MouseEventHandler;\n  }>;\n  sidebarId?: string;\n}\n\nfunction EdgeDrawerTrigger({ render, sidebarId }: EdgeDrawerTriggerProps) {\n  return React.cloneElement(render, {\n    className: layoutClasses.EdgeDrawerTrigger,\n    onClick: () => triggerEdgeDrawer({ sidebarId }),\n  });\n}\n\nexport default EdgeDrawerTrigger;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/EdgeDrawerTriggerRight.tsx",
      "target": "src/mui-treasury/layout/layout-core/EdgeDrawerTriggerRight.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { triggerEdgeDrawerRight } from './EdgeSidebarRight';\nimport { layoutClasses } from './layoutClasses';\n\ninterface EdgeDrawerTriggerRightProps {\n  render: React.ReactElement<{\n    className?: string;\n    onClick?: React.MouseEventHandler;\n  }>;\n  sidebarId?: string;\n}\n\nfunction EdgeDrawerTriggerRight({\n  render,\n  sidebarId,\n}: EdgeDrawerTriggerRightProps) {\n  return React.cloneElement(render, {\n    className: layoutClasses.EdgeDrawerTriggerRight,\n    onClick: () => triggerEdgeDrawerRight({ sidebarId }),\n  });\n}\n\nexport default EdgeDrawerTriggerRight;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/EdgeSidebar.tsx",
      "target": "src/mui-treasury/layout/layout-core/EdgeSidebar.tsx",
      "content": "'use client';\nimport React, { useMemo } from 'react';\n\nimport { Breakpoint } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  DrawerConfig,\n  EdgeSidebarVariant,\n  EdgeSidebarVariantInput,\n  PermanentConfig,\n} from './SharedEdgeSidebar';\nimport {\n  EdgeSidebarRoot,\n  internalCollapseSidebar,\n  internalToggleSidebar,\n} from './SharedEdgeSidebar';\nimport { layoutAttrs } from './layoutAttrs';\nimport { layoutClasses } from './layoutClasses';\n\nfunction applyDrawerStyles(params: DrawerConfig) {\n  const { width = '300px', showHeader, withoutOverlay } = params || {};\n  return {\n    '--jun-ES-drawerWidth': '0px',\n    ...(showHeader && {\n      '--drawer-h': 'calc(var(--jun-h) - var(--jun-H-h))',\n      '&::before': {\n        top: 'var(--jun-H-h)',\n      },\n    }),\n    ...(withoutOverlay && {\n      '--drawer-h': 'calc(var(--jun-h) - var(--jun-H-clip-h))',\n      '&::before': {\n        display: 'none',\n      },\n    }),\n    [`.${layoutClasses.Root}:has(&)`]: {\n      '--jun-ES-variant': 'var(--drawer)',\n      [`.${layoutClasses.EdgeSidebarCollapser}`]: {\n        display: 'none',\n      },\n    },\n    [`.${layoutClasses.Root}:has(&[${layoutAttrs.isDrawerOpen}])`]: {\n      [`.${layoutClasses.EdgeDrawerTrigger} .${layoutClasses.EdgeDrawerClosedVisible}`]:\n        {\n          display: 'none',\n        },\n    },\n    [`.${layoutClasses.Root}:has(&:not([${layoutAttrs.isDrawerOpen}]))`]: {\n      [`.${layoutClasses.EdgeDrawerTrigger} .${layoutClasses.EdgeDrawerOpenVisible}`]:\n        {\n          display: 'none',\n        },\n    },\n    [`&[${layoutAttrs.isDrawerOpen}], &[${layoutAttrs.isDrawerClosing}]`]: {\n      '--jun-ES-drawerWidth': width,\n    },\n  };\n}\n\nfunction applyPermanentStyles(params: PermanentConfig) {\n  const { width, collapsedWidth, visibility } = params || {};\n  const defaultExpandConfig = {\n    delay: '0s',\n    shadow: '0 0 10px rgba(0,0,0,0.1)',\n  };\n  let expandConfig: undefined | typeof defaultExpandConfig;\n  if ('hoverUncollapse' in params) {\n    if (params.hoverUncollapse === true) {\n      expandConfig = defaultExpandConfig;\n    } else {\n      expandConfig = params.hoverUncollapse as typeof defaultExpandConfig;\n    }\n  }\n  return {\n    '--jun-EC-shadow':\n      'inset calc(-1 * var(--jun-ES-line-w)) 0px var(--jun-ES-line-color)',\n    '--jun-EC-width': 'var(--_permanentWidth, 0px)',\n    '--_collapsed': 'var(--collapsed)',\n    '--_uncollapsed': 'var(--uncollapsed)',\n    [`.${layoutClasses.Root}:has(&)`]: {\n      '--jun-ES-variant': 'var(--permanent)',\n      ...(width && {\n        '--jun-ES-permanentWidth': width,\n      }),\n      ...(collapsedWidth && {\n        '--jun-ES-collapsedWidth': collapsedWidth,\n        [`.${layoutClasses.EdgeSidebarCollapser}`]: {\n          display: 'var(--display, inline-flex)',\n          '--_sidebarCollapsed': 'var(--collapsed, 1)',\n        },\n        [`.${layoutClasses.EdgeCollapsedVisible}`]: {\n          display: 'var(--collapsed, inline-flex) var(--uncollapsed, none)',\n        },\n        [`.${layoutClasses.EdgeUncollapsedVisible}`]: {\n          display: 'var(--collapsed, none) var(--uncollapsed, inline-flex)',\n        },\n      }),\n      [`.${layoutClasses.EdgeDrawerTrigger}`]: {\n        display: 'none',\n      },\n    },\n    ...(collapsedWidth && {\n      /** Collapsible feature */\n      [`.${layoutClasses.Root}:has(&[${layoutAttrs.isEdgeSidebarCollapsed}])`]:\n        {\n          '--jun-ES-collapsible': 'var(--collapsed)',\n        },\n      [`.${layoutClasses.Root}:has(&[${layoutAttrs.isEdgeSidebarUncollapsed}])`]:\n        {\n          '--jun-ES-collapsible': 'var(--uncollapsed)',\n        },\n    }),\n    ...(visibility === 'hidden' && {\n      [`.${layoutClasses.Root}:has(>&)`]: {\n        '--_permanentWidth': '0px',\n      },\n      [`& .${layoutClasses.EdgeSidebarContent}`]: {\n        visibility: 'hidden',\n      },\n    }),\n    ...(visibility === 'visible' && {\n      [`.${layoutClasses.Root}:has(>&)`]: {\n        '--_permanentWidth': `var(--uncollapsed, var(--jun-ES-permanentWidth))\n                              var(--collapsed, var(--jun-ES-collapsedWidth, 0px))`,\n      },\n      [`& .${layoutClasses.EdgeSidebarContent}`]: {\n        visibility:\n          'var(--_drawer, hidden) var(--_permanent, visible)' as never,\n      },\n    }),\n    ...(expandConfig && {\n      [`&:has(.${layoutClasses.EdgeSidebarContent}:hover)`]: {\n        '--_collapsed': 'var(--__,)', // workaround to use fallback, Emotion strips out spaces if the value is \" \".\n        '--_uncollapsed': 'var(--_)',\n        [`& .${layoutClasses.SidebarRail}`]: {\n          display: 'none',\n        },\n      },\n      [`& .${layoutClasses.EdgeSidebarContent}:hover`]: {\n        '--jun-EC-width': 'var(--jun-ES-permanentWidth)',\n        '--jun-EC-delay': expandConfig.delay,\n        '--jun-EC-shadow': `var(--_permanent, var(--uncollapsed, inset calc(-1 * var(--jun-ES-line-w)) 0 var(--jun-ES-line-color)) var(--collapsed, ${expandConfig.shadow}, inset calc(-1 * var(--jun-ES-line-w)) 0 var(--jun-ES-line-color)))`,\n      },\n    }),\n  };\n}\n\nexport function triggerEdgeCollapse(options: {\n  event: React.MouseEvent;\n  sidebarId?: string;\n  state?: boolean;\n  document?: Document | null;\n}) {\n  const { sidebarId } = options || {};\n  let selector = `.${layoutClasses.EdgeSidebar}`;\n  if (sidebarId) {\n    selector = `#${sidebarId}`;\n  }\n  internalCollapseSidebar({ ...options, selector });\n}\n\nexport function triggerEdgeDrawer(options?: {\n  sidebarId?: string;\n  state?: boolean;\n  document?: Document | null;\n}) {\n  const { sidebarId } = options || {};\n  let selector = `.${layoutClasses.EdgeSidebar}`;\n  if (sidebarId) {\n    selector = `#${sidebarId}`;\n  }\n  internalToggleSidebar({ ...options, selector });\n}\n\ninterface EdgeSidebarOwnerState {\n  variant?: Partial<Record<Breakpoint, EdgeSidebarVariant>>;\n  permanentAutoCollapse?: Breakpoint;\n}\n\ninterface EdgeSidebarProps {\n  variant?: EdgeSidebarVariantInput;\n  permanentAutoCollapse?: Breakpoint;\n}\n\nconst StyledEdgeSidebar = styled(EdgeSidebarRoot, {\n  name: 'LayoutEdgeSidebar',\n  slot: 'root',\n})<{\n  ownerState: EdgeSidebarOwnerState;\n}>(\n  memoTheme(({ theme }) => ({\n    [`.${layoutClasses.Root}:has(&)`]: {\n      /** Root default settings */\n      '--jun-ES-variant': 'var(--permanent)',\n      '--jun-ES-permanentWidth': '256px',\n      '--jun-ES-collapsible': 'var(--uncollapsed)',\n      '--jun-ES-collapsedWidth': '0px',\n\n      /** DO NOT OVERRIDE, internal variables */\n      '--drawer': 'var(--jun-ES-variant,)',\n      '--permanent': 'var(--jun-ES-variant,)',\n      '--_permanentWidth': `var(--uncollapsed, var(--jun-ES-permanentWidth))\n                            var(--collapsed, var(--jun-ES-collapsedWidth, 0px))`,\n      '--collapsed': 'var(--jun-ES-collapsible,)',\n      '--uncollapsed': 'var(--jun-ES-collapsible,)',\n    },\n    /** EdgeSidebar default settings */\n    '--jun-ES-anchor': 'var(--anchorLeft)',\n    '--jun-EC-width': 'var(--_permanentWidth, 0px)',\n    '--_drawer': 'var(--drawer)',\n    '--_permanent': 'var(--permanent)',\n    '--_collapsed': 'var(--collapsed)',\n    '--_uncollapsed': 'var(--uncollapsed)',\n    gridArea: layoutClasses.EdgeSidebar,\n    width: `var(--drawer, 0)\n              var(--permanent, var(--_permanentWidth))`,\n    borderColor: 'var(--jun-ES-line-color)',\n    [`&:not([${layoutAttrs.isDrawerOpen}], [${layoutAttrs.isDrawerClosing}])`]:\n      {\n        overflow: 'var(--drawer, hidden)',\n      },\n    variants: [\n      {\n        props: ({ variant }: EdgeSidebarOwnerState) => !!variant,\n        style: ({ variant }: Required<EdgeSidebarOwnerState>) => {\n          const responsive: Record<string, unknown> = {};\n          (Object.keys(variant) as Array<Breakpoint>)\n            .sort(\n              (a, b) =>\n                theme.breakpoints.values[a] - theme.breakpoints.values[b],\n            )\n            .forEach((breakpoint) => {\n              const variantTuple = variant[breakpoint];\n              if (variantTuple) {\n                const [variantName, params = {}] = variantTuple;\n                const variantStyles = {\n                  drawer: applyDrawerStyles,\n                  permanent: applyPermanentStyles,\n                }[variantName](params as never);\n                if (breakpoint === 'xs') {\n                  Object.assign(responsive, variantStyles);\n                } else {\n                  responsive[theme.breakpoints.up(breakpoint)] = variantStyles;\n                }\n              }\n            });\n          return responsive;\n        },\n      },\n      {\n        props: ({ permanentAutoCollapse }: EdgeSidebarOwnerState) =>\n          !!permanentAutoCollapse,\n        style: ({\n          permanentAutoCollapse,\n        }: Required<EdgeSidebarOwnerState>) => ({\n          [`.${layoutClasses.Root}:has(&) .${layoutClasses.EdgeSidebarCollapser}`]:\n            {\n              '--_autoCollapse': '1',\n            },\n          [theme.breakpoints.down(permanentAutoCollapse)]: {\n            [`.${layoutClasses.Root}:has(&)`]: {\n              '--jun-ES-collapsible': 'var(--collapsed)',\n            },\n          },\n          [theme.breakpoints.up(permanentAutoCollapse)]: {\n            [`.${layoutClasses.Root}:has(&)`]: {\n              '--jun-ES-collapsible': 'var(--uncollapsed)',\n            },\n            [`.${layoutClasses.Root}:has(&) .${layoutClasses.EdgeSidebarCollapser}`]:\n              {\n                '--_in-autoCollapse': '1',\n              },\n          },\n        }),\n      },\n    ],\n  })),\n);\n\nconst defaultVariant: EdgeSidebarVariant = ['permanent', { width: '256px' }];\n\nconst EdgeSidebar = React.forwardRef<\n  HTMLDivElement,\n  Omit<React.ComponentPropsWithoutRef<typeof StyledEdgeSidebar>, 'ownerState'> &\n    EdgeSidebarProps\n>(function EdgeSidebar(\n  { className, variant = defaultVariant, permanentAutoCollapse, ...props },\n  ref,\n) {\n  const normalizedVariant = useMemo(\n    () => (Array.isArray(variant) ? { xs: variant } : variant),\n    [variant],\n  );\n  const ownerState = useMemo(\n    () => ({\n      variant: normalizedVariant,\n      permanentAutoCollapse,\n    }),\n    [normalizedVariant, permanentAutoCollapse],\n  );\n  const hasWithoutOverlay = Object.values(normalizedVariant).some(\n    (v) => v?.[0] === 'drawer' && (v[1] as DrawerConfig)?.withoutOverlay,\n  );\n  return (\n    <StyledEdgeSidebar\n      ref={ref}\n      className={`${layoutClasses.EdgeSidebar}${hasWithoutOverlay ? ` ${layoutClasses.DrawerWithoutOverlay}` : ''} ${className || ''}`}\n      ownerState={ownerState}\n      {...(hasWithoutOverlay && { 'data-without-overlay': '' })}\n      {...props}\n    />\n  );\n});\n\nexport default EdgeSidebar;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/EdgeSidebarCollapser.tsx",
      "target": "src/mui-treasury/layout/layout-core/EdgeSidebarCollapser.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { triggerEdgeCollapse } from './EdgeSidebar';\nimport { triggerEdgeCollapseRight } from './EdgeSidebarRight';\nimport { layoutClasses } from './layoutClasses';\n\ninterface EdgeSidebarCollapserProps {\n  render: React.ReactElement<{\n    className?: string;\n    onClick?: React.MouseEventHandler<HTMLButtonElement>;\n  }>;\n  state?: boolean;\n}\n\nfunction EdgeSidebarCollapser({ render, state }: EdgeSidebarCollapserProps) {\n  return React.cloneElement(render, {\n    className: layoutClasses.EdgeSidebarCollapser,\n    onClick: (event: React.MouseEvent<HTMLButtonElement>) => {\n      const sidebar = event.currentTarget.closest<HTMLElement>(\n        `.${layoutClasses.EdgeSidebar}, .${layoutClasses.EdgeSidebarRight}`,\n      );\n      const opts = {\n        event,\n        state,\n        ...(sidebar?.id && { sidebarId: sidebar.id }),\n      };\n      if (sidebar?.classList.contains(layoutClasses.EdgeSidebarRight)) {\n        triggerEdgeCollapseRight(opts);\n      } else {\n        triggerEdgeCollapse(opts);\n      }\n    },\n  });\n}\n\nexport default EdgeSidebarCollapser;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/EdgeSidebarContent.tsx",
      "target": "src/mui-treasury/layout/layout-core/EdgeSidebarContent.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { styled } from '@mui/material/styles';\n\nimport { layoutAttrs } from './layoutAttrs';\nimport { layoutClasses } from './layoutClasses';\n\nconst StyledEdgeSidebarContent = styled('div', {\n  name: 'LayoutEdgeSidebarContent',\n  slot: 'root',\n})({\n  /* configurable */\n  background: 'var(--EdgeSidebarContent-background)',\n  boxShadow: 'var(--jun-EC-shadow)',\n  display: 'flex',\n  flexDirection: 'column',\n  flex: '1',\n  padding: '0px',\n  overflowX: 'auto', // prevent horizontal content overflow\n  '--jun-EC-delay': '0s',\n  opacity: `var(--_drawer, var(--jun-ES-drawerOpen))\n        var(--_permanent, 1)`,\n  visibility: `var(--_drawer, hidden) var(--_permanent, visible)` as never,\n  margin: '0px', // prevent user from customizing it\n  position:\n    'var(--_drawer, var(--drawer-pos)) var(--_permanent, relative)' as never,\n  zIndex: '2',\n  width:\n    'var(--_drawer, var(--jun-ES-drawerWidth)) var(--_permanent, var(--jun-EC-width))',\n  height: 'var(--_drawer, var(--drawer-h))',\n  top: 'var(--_drawer, calc(var(--jun-h) - var(--drawer-h)))',\n  overflowY: 'var(--_drawer, auto)' as never,\n  transition: `var(--tsn, var(--_drawer, opacity 0.3s, transform 0.3s)\n               var(--_permanent, opacity 0.4s, width 0.3s var(--jun-EC-delay, 0s), transform 0.3s var(--jun-EC-delay, 0s), box-shadow 0.3s var(--jun-EC-delay, 0s)))`,\n  transform: `var(--_drawer, var(--anchorLeft, translateX(calc((1 - var(--jun-ES-drawerOpen)) * -100%))) var(--anchorRight, translateX(calc(var(--jun-ES-drawerOpen) * -100%))))\n              var(--_permanent, translateX(var(--jun-ES-permanentSlide, 0)))`,\n  [`[${layoutAttrs.isEdgeSidebarContentHidden}] &`]: {\n    visibility: 'hidden',\n    opacity: '0',\n  },\n  [`[${layoutAttrs.isDrawerOpen}] &, [${layoutAttrs.isDrawerClosing}] &`]: {\n    visibility: 'visible',\n  },\n  [`[${layoutAttrs.isDrawerClosing}] &`]: {\n    transition: 'var(--tsn, transform 0.3s, visibility 0.3s, opacity 0.3s)',\n  },\n});\n\nconst EdgeSidebarContent = React.forwardRef<\n  HTMLDivElement,\n  React.ComponentPropsWithoutRef<typeof StyledEdgeSidebarContent>\n>(function EdgeSidebarContent({ className, ...props }, ref) {\n  return (\n    <StyledEdgeSidebarContent\n      ref={ref}\n      className={`${layoutClasses.EdgeSidebarContent} ${className || ''}`}\n      {...props}\n    />\n  );\n});\n\nexport default EdgeSidebarContent;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/EdgeSidebarRight.tsx",
      "target": "src/mui-treasury/layout/layout-core/EdgeSidebarRight.tsx",
      "content": "'use client';\nimport React, { useMemo } from 'react';\n\nimport { Breakpoint } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport type {\n  DrawerConfig,\n  EdgeSidebarVariant,\n  EdgeSidebarVariantInput,\n  PermanentConfig,\n} from './SharedEdgeSidebar';\nimport {\n  EdgeSidebarRoot,\n  internalCollapseSidebar,\n  internalToggleSidebar,\n} from './SharedEdgeSidebar';\nimport { layoutAttrs } from './layoutAttrs';\nimport { layoutClasses } from './layoutClasses';\n\nfunction applyDrawerRightStyles(params: DrawerConfig) {\n  const { width = '300px', showHeader, withoutOverlay } = params || {};\n  return {\n    '--jun-ES-drawerWidth': '0px',\n    ...(showHeader && {\n      '--drawer-h': 'calc(var(--jun-h) - var(--jun-H-h))',\n      '&::before': {\n        top: 'var(--jun-H-h)',\n      },\n    }),\n    ...(withoutOverlay && {\n      '--drawer-h': 'calc(var(--jun-h) - var(--jun-H-clip-h))',\n      '&::before': {\n        display: 'none',\n      },\n    }),\n    [`.${layoutClasses.Root}:has(&)`]: {\n      '--jun-ESR-variant': 'var(--drawer-R)',\n      [`.${layoutClasses.EdgeSidebarRightCollapser}`]: {\n        display: 'none',\n      },\n    },\n    [`.${layoutClasses.Root}:has(&[${layoutAttrs.isDrawerOpen}])`]: {\n      [`.${layoutClasses.EdgeDrawerTriggerRight} .${layoutClasses.EdgeDrawerClosedVisible}`]:\n        {\n          display: 'none',\n        },\n    },\n    [`.${layoutClasses.Root}:has(&:not([${layoutAttrs.isDrawerOpen}]))`]: {\n      [`.${layoutClasses.EdgeDrawerTriggerRight} .${layoutClasses.EdgeDrawerOpenVisible}`]:\n        {\n          display: 'none',\n        },\n    },\n    [`&[${layoutAttrs.isDrawerOpen}], &[${layoutAttrs.isDrawerClosing}]`]: {\n      '--jun-ES-drawerWidth': width,\n    },\n  };\n}\n\nfunction applyPermanentRightStyles(params: PermanentConfig) {\n  const { width, collapsedWidth, visibility } = params;\n  const defaultExpandConfig = {\n    delay: '0.3s',\n    shadow: '0 0 10px rgba(0,0,0,0.1)',\n  };\n  let expandConfig: undefined | typeof defaultExpandConfig;\n  if ('hoverUncollapse' in params) {\n    if (params.hoverUncollapse === true) {\n      expandConfig = defaultExpandConfig;\n    } else {\n      expandConfig = params.hoverUncollapse as typeof defaultExpandConfig;\n    }\n  }\n  return {\n    '--jun-EC-shadow':\n      'inset var(--jun-ES-line-w) 0px var(--jun-ES-line-color)',\n    '--jun-EC-width': 'var(--_permanentWidth-R, 0px)',\n    '--_collapsed': 'var(--collapsed-R)',\n    '--_uncollapsed': 'var(--uncollapsed-R)',\n    [`.${layoutClasses.Root}:has(&)`]: {\n      '--jun-ESR-variant': 'var(--permanent-R)',\n      ...(width && {\n        '--jun-ESR-permanentWidth': width,\n      }),\n      ...(collapsedWidth && {\n        '--jun-ESR-collapsedWidth': collapsedWidth,\n        [`.${layoutClasses.EdgeSidebarRightCollapser}`]: {\n          display: 'var(--display, inline-flex)',\n          '--_sidebarCollapsed': 'var(--collapsed-R, 1)',\n        },\n        [`.${layoutClasses.EdgeCollapsedVisible}`]: {\n          display: 'var(--collapsed-R, inline-flex) var(--uncollapsed-R, none)',\n        },\n        [`.${layoutClasses.EdgeUncollapsedVisible}`]: {\n          display: 'var(--collapsed-R, none) var(--uncollapsed-R, inline-flex)',\n        },\n      }),\n      [`.${layoutClasses.EdgeDrawerTriggerRight}`]: {\n        display: 'none',\n      },\n    },\n    ...(collapsedWidth && {\n      /** Collapsible feature */\n      [`.${layoutClasses.Root}:has(&[${layoutAttrs.isEdgeSidebarCollapsed}])`]:\n        {\n          '--jun-ESR-collapsible': 'var(--collapsed-R)',\n        },\n      [`.${layoutClasses.Root}:has(&[${layoutAttrs.isEdgeSidebarUncollapsed}])`]:\n        {\n          '--jun-ESR-collapsible': 'var(--uncollapsed-R)',\n        },\n    }),\n    ...(visibility === 'hidden' && {\n      [`.${layoutClasses.Root}:has(>&)`]: {\n        '--_permanentWidth-R': '0px',\n      },\n      [`& .${layoutClasses.EdgeSidebarContent}`]: {\n        visibility: 'hidden',\n      },\n    }),\n    ...(visibility === 'visible' && {\n      [`.${layoutClasses.Root}:has(>&)`]: {\n        '--_permanentWidth-R': `var(--uncollapsed-R, var(--jun-ESR-permanentWidth))\n                                var(--collapsed-R, var(--jun-ESR-collapsedWidth, 0px))`,\n      },\n      [`& .${layoutClasses.EdgeSidebarContent}`]: {\n        visibility:\n          'var(--_drawer, hidden) var(--_permanent, visible)' as never,\n      },\n    }),\n    ...(expandConfig && {\n      [`&:has(.${layoutClasses.EdgeSidebarContent}:hover)`]: {\n        '--_collapsed': 'var(--__,)', // workaround to use fallback, Emotion strips out spaces if the value is \" \".\n        '--_uncollapsed': 'var(--_)',\n        [`& .${layoutClasses.SidebarRail}`]: {\n          display: 'none',\n        },\n      },\n      [`& .${layoutClasses.EdgeSidebarContent}:hover`]: {\n        '--jun-EC-width': 'var(--jun-ESR-permanentWidth)',\n        '--jun-EC-delay': expandConfig.delay,\n        boxShadow: `var(--collapsed-R, ${expandConfig.shadow}) var(--uncollapsed-R, none)`,\n        '--jun-ES-permanentSlide':\n          'var(--collapsed-R, calc(var(--jun-ESR-collapsedWidth) - var(--jun-EC-width))) var(--uncollapsed-R, 0)',\n      },\n    }),\n  };\n}\n\nexport function triggerEdgeCollapseRight(options: {\n  event: React.MouseEvent;\n  sidebarId?: string;\n  state?: boolean;\n  document?: Document | null;\n}) {\n  const { sidebarId } = options || {};\n  let selector = `.${layoutClasses.EdgeSidebarRight}`;\n  if (sidebarId) {\n    selector = `#${sidebarId}`;\n  }\n  internalCollapseSidebar({ ...options, selector });\n}\n\nexport function triggerEdgeDrawerRight(options?: {\n  sidebarId?: string;\n  state?: boolean;\n  document?: Document | null;\n}) {\n  const { sidebarId } = options || {};\n  let selector = `.${layoutClasses.EdgeSidebarRight}`;\n  if (sidebarId) {\n    selector = `#${sidebarId}`;\n  }\n  internalToggleSidebar({ ...options, selector });\n}\n\ninterface EdgeSidebarRightOwnerState {\n  variant?: Partial<Record<Breakpoint, EdgeSidebarVariant>>;\n  permanentAutoCollapse?: Breakpoint;\n}\n\ninterface EdgeSidebarRightProps {\n  variant?: EdgeSidebarVariantInput;\n  permanentAutoCollapse?: Breakpoint;\n}\n\nconst StyledEdgeSidebarRight = styled(EdgeSidebarRoot, {\n  name: 'LayoutEdgeSidebarRight',\n  slot: 'root',\n})<{\n  ownerState: EdgeSidebarRightOwnerState;\n}>(\n  memoTheme(({ theme }) => ({\n    [`.${layoutClasses.Root}:has(&)`]: {\n      /** Root default settings */\n      '--jun-ESR-variant': 'var(--permanent-R)',\n      '--jun-ESR-permanentWidth': '256px',\n      '--jun-ESR-collapsible': 'var(--uncollapsed-R)',\n      '--jun-ESR-collapsedWidth': '0px',\n\n      /** DO NOT OVERRIDE, internal variables */\n      '--drawer-R': 'var(--jun-ESR-variant,)',\n      '--permanent-R': 'var(--jun-ESR-variant,)',\n      '--_permanentWidth-R': `var(--uncollapsed-R, var(--jun-ESR-permanentWidth))\n                            var(--collapsed-R, var(--jun-ESR-collapsedWidth, 0px))`,\n      '--collapsed-R': 'var(--jun-ESR-collapsible,)',\n      '--uncollapsed-R': 'var(--jun-ESR-collapsible,)',\n    },\n    /** EdgeSidebar default settings */\n    '--jun-ES-anchor': 'var(--anchorRight)',\n    '--jun-EC-width': 'var(--_permanentWidth-R, 0px)',\n    '--_drawer': 'var(--drawer-R)',\n    '--_permanent': 'var(--permanent-R)',\n    '--_collapsed': 'var(--collapsed-R)',\n    '--_uncollapsed': 'var(--uncollapsed-R)',\n    gridArea: layoutClasses.EdgeSidebarRight,\n    width: `var(--drawer-R, 0)\n              var(--permanent-R, var(--_permanentWidth-R))`,\n    [`&:not([${layoutAttrs.isDrawerOpen}], [${layoutAttrs.isDrawerClosing}])`]:\n      {\n        overflow: 'var(--drawer-R, hidden)',\n      },\n    variants: [\n      {\n        props: ({ variant }: EdgeSidebarRightOwnerState) => !!variant,\n        style: ({ variant }: Required<EdgeSidebarRightOwnerState>) => {\n          const responsive: Record<string, unknown> = {};\n          (Object.keys(variant) as Array<Breakpoint>)\n            .sort(\n              (a, b) =>\n                theme.breakpoints.values[a] - theme.breakpoints.values[b],\n            )\n            .forEach((breakpoint) => {\n              const variantTuple = variant[breakpoint];\n              if (variantTuple) {\n                const [variantName, params = {}] = variantTuple;\n                const variantStyles = {\n                  drawer: applyDrawerRightStyles,\n                  permanent: applyPermanentRightStyles,\n                }[variantName](params as never);\n                if (breakpoint === 'xs') {\n                  Object.assign(responsive, variantStyles);\n                } else {\n                  responsive[theme.breakpoints.up(breakpoint)] = variantStyles;\n                }\n              }\n            });\n          return responsive;\n        },\n      },\n      {\n        props: ({ permanentAutoCollapse }: EdgeSidebarRightOwnerState) =>\n          !!permanentAutoCollapse,\n        style: ({\n          permanentAutoCollapse,\n        }: Required<EdgeSidebarRightOwnerState>) => ({\n          [`.${layoutClasses.Root}:has(&) .${layoutClasses.EdgeSidebarRightCollapser}`]:\n            {\n              '--_autoCollapse': '1',\n            },\n          [theme.breakpoints.down(permanentAutoCollapse)]: {\n            [`.${layoutClasses.Root}:has(&)`]: {\n              '--jun-ESR-collapsible': 'var(--collapsed-R)',\n            },\n          },\n          [theme.breakpoints.up(permanentAutoCollapse)]: {\n            [`.${layoutClasses.Root}:has(&)`]: {\n              '--jun-ESR-collapsible': 'var(--uncollapsed-R)',\n            },\n            [`.${layoutClasses.Root}:has(&) .${layoutClasses.EdgeSidebarRightCollapser}`]:\n              {\n                '--_in-autoCollapse': '1',\n              },\n          },\n        }),\n      },\n    ],\n  })),\n);\n\nconst EdgeSidebarRight = React.forwardRef<\n  HTMLDivElement,\n  Omit<\n    React.ComponentPropsWithoutRef<typeof StyledEdgeSidebarRight>,\n    'ownerState'\n  > &\n    EdgeSidebarRightProps\n>(function EdgeSidebarRight(\n  { className, variant, permanentAutoCollapse, ...props },\n  ref,\n) {\n  const normalizedVariant = useMemo(\n    () => (Array.isArray(variant) ? { xs: variant } : variant),\n    [variant],\n  );\n  const ownerState = useMemo(\n    () => ({\n      variant: normalizedVariant,\n      permanentAutoCollapse,\n    }),\n    [normalizedVariant, permanentAutoCollapse],\n  );\n  const hasWithoutOverlay =\n    normalizedVariant &&\n    Object.values(normalizedVariant).some(\n      (v) => v?.[0] === 'drawer' && (v[1] as DrawerConfig)?.withoutOverlay,\n    );\n  return (\n    <StyledEdgeSidebarRight\n      ref={ref}\n      className={`${layoutClasses.EdgeSidebarRight} ${className || ''}`}\n      ownerState={ownerState}\n      {...(hasWithoutOverlay && { 'data-without-overlay': '' })}\n      {...props}\n    />\n  );\n});\n\nexport default EdgeSidebarRight;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/Footer.tsx",
      "target": "src/mui-treasury/layout/layout-core/Footer.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { BoxProps } from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\n\nimport { layoutClasses } from './layoutClasses';\n\nconst StyledFooter = styled('footer')(({ theme }) => ({\n  gridArea: layoutClasses.Footer,\n  transition: 'all 225ms cubic-bezier(0.0, 0, 0.2, 1) 0ms, color 0s',\n  background: `var(--Footer-background, ${(theme.vars || theme).palette.background.paper})`,\n  borderTop: 'var(--Footer-overline)',\n}));\n\nconst Footer = React.forwardRef<HTMLElement, BoxProps>(function Footer(\n  { className, ...props },\n  ref,\n) {\n  return (\n    <StyledFooter\n      ref={ref}\n      className={`${layoutClasses.Footer} ${className || ''}`}\n      {...props}\n    />\n  );\n});\n\nexport default Footer;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/Header.tsx",
      "target": "src/mui-treasury/layout/layout-core/Header.tsx",
      "content": "'use client';\nimport React, { useMemo } from 'react';\n\nimport { Breakpoint } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport { layoutClasses } from './layoutClasses';\n\ntype ClipSide = 'left' | 'right' | boolean;\n\ninterface HeaderProps {\n  height?: string | Partial<Record<Breakpoint, string>>;\n  clip?: ClipSide | Partial<Record<Breakpoint, ClipSide>>;\n}\n\nconst CLIP_BOTH = `\n    \"${layoutClasses.Header} ${layoutClasses.Header} ${layoutClasses.Header}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Content} ${layoutClasses.EdgeSidebarRight}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Footer} ${layoutClasses.EdgeSidebarRight}\"\n  `;\n\nconst CLIP_LEFT = `\n    \"${layoutClasses.Header} ${layoutClasses.Header} ${layoutClasses.EdgeSidebarRight}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Content} ${layoutClasses.EdgeSidebarRight}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Footer} ${layoutClasses.EdgeSidebarRight}\"\n  `;\n\nconst CLIP_RIGHT = `\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Header} ${layoutClasses.Header}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Content} ${layoutClasses.EdgeSidebarRight}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Footer} ${layoutClasses.EdgeSidebarRight}\"\n  `;\n\nconst CLIP_STYLES = {\n  left: {\n    gridTemplateAreas: CLIP_LEFT,\n    [`& .${layoutClasses.EdgeSidebar}`]: {\n      '--jun-H-clip-h': 'var(--jun-H-h)',\n    },\n  },\n  right: {\n    gridTemplateAreas: CLIP_RIGHT,\n    [`& .${layoutClasses.EdgeSidebarRight}`]: {\n      '--jun-H-clip-h': 'var(--jun-H-h)',\n    },\n  },\n  both: {\n    gridTemplateAreas: CLIP_BOTH,\n    '--jun-H-clip-h': 'var(--jun-H-h)',\n  },\n} as const;\n\nconst StyledHeader = styled('header', {\n  name: 'LayoutHeader',\n  slot: 'root',\n})<{\n  ownerState: HeaderProps;\n}>(\n  memoTheme(({ theme }) => ({\n    gridArea: layoutClasses.Header,\n    alignContent: 'center',\n    display: 'flex',\n    alignItems: 'center',\n    zIndex: '1', // to stay on top of the Content, e.g. InsetSidebar\n    top: '0', // for position sticky to work\n    position: 'sticky',\n    background: 'var(--Header-background)',\n    borderBottom: 'var(--Header-underline)',\n    height: 'var(--jun-H-h)',\n    variants: [\n      {\n        props: ({ height }: HeaderProps) => !!height,\n        style: ({ height }: Required<HeaderProps>) =>\n          theme.unstable_sx({\n            [`.${layoutClasses.Root}:has(&)`]: {\n              '--jun-H-h': height,\n            },\n          }),\n      },\n      {\n        props: ({ clip }: HeaderProps) => !!clip,\n        style: ({ clip }: Required<HeaderProps>) => {\n          const normalized =\n            typeof clip === 'string' || typeof clip === 'boolean'\n              ? { xs: clip }\n              : clip;\n          const rootStyles: Record<string, unknown> = {};\n\n          (Object.keys(normalized) as Breakpoint[])\n            .sort(\n              (a, b) =>\n                theme.breakpoints.values[a] - theme.breakpoints.values[b],\n            )\n            .forEach((bp) => {\n              const side = normalized[bp];\n              if (side) {\n                if (bp === 'xs') {\n                  Object.assign(\n                    rootStyles,\n                    CLIP_STYLES[side === true ? 'both' : side],\n                  );\n                } else {\n                  rootStyles[theme.breakpoints.up(bp)] =\n                    CLIP_STYLES[side === true ? 'both' : side];\n                }\n              }\n            });\n\n          return {\n            zIndex: 3,\n            [`.${layoutClasses.Root}:has(&)`]: rootStyles,\n          };\n        },\n      },\n    ],\n  })),\n);\n\nconst Header = React.forwardRef<\n  HTMLElement,\n  Omit<React.ComponentPropsWithoutRef<typeof StyledHeader>, 'ownerState'> &\n    HeaderProps\n>(function Header({ className, height, clip, ...props }, ref) {\n  const ownerState = useMemo(\n    () => ({\n      height,\n      clip,\n    }),\n    [height, clip],\n  );\n  return (\n    <StyledHeader\n      ref={ref}\n      className={`${layoutClasses.Header} ${className || ''}`}\n      ownerState={ownerState}\n      {...props}\n    />\n  );\n});\n\nexport default Header;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/InsetAvoidingView.tsx",
      "target": "src/mui-treasury/layout/layout-core/InsetAvoidingView.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { BoxProps } from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\n\nimport { layoutClasses } from './layoutClasses';\n\nconst StyledInsetAvoidingView = styled('div')({\n  marginRight: 'var(--jun-ISR-w)',\n  marginLeft: 'var(--jun-ISL-w)',\n});\n\nconst InsetAvoidingView = React.forwardRef<HTMLDivElement, BoxProps>(\n  function InsetAvoidingView({ className, ...props }, ref) {\n    return (\n      <StyledInsetAvoidingView\n        ref={ref}\n        className={`${layoutClasses.InsetAvoidingView} ${className || ''}`}\n        {...props}\n      />\n    );\n  },\n);\n\nexport default InsetAvoidingView;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/InsetContent.tsx",
      "target": "src/mui-treasury/layout/layout-core/InsetContent.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { BoxProps } from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\n\nimport { layoutClasses } from './layoutClasses';\n\nconst InsetContentRoot = styled('div')(({ theme }) => ({\n  display: 'flex',\n  flexDirection: 'column',\n  backgroundColor: 'inherit',\n  overflow: 'auto',\n  background: 'var(--jun-IC-bg)',\n  boxSizing: 'var(--fixed, content-box) var(--absolute, border-box)' as never,\n  position: 'var(--fixed, fixed) var(--absolute, absolute)' as never,\n  height:\n    'var(--fixed, calc(100% - var(--jun-H-h, 0px))) var(--absolute, var(--jun-IC-absolute-h, 100%))',\n  width: 'var(--fixed, inherit) var(--absolute, 100%)',\n  top: 0,\n  borderRight: 'var(--anchor-left, var(--jun-IC-sideline))',\n  borderLeft: 'var(--anchor-right, var(--jun-IC-sideline))',\n  borderColor: theme.palette.divider,\n  marginLeft:\n    'var(--fixed, var(--anchor-left, -9999px)) var(--absolute, initial)',\n  paddingLeft:\n    'var(--fixed, var(--anchor-left, 9999px)) var(--absolute, initial)',\n  marginRight:\n    'var(--fixed, var(--anchor-right, -9999px)) var(--absolute, initial)',\n  paddingRight:\n    'var(--fixed, var(--anchor-right, 9999px)) var(--absolute, initial)',\n  marginTop: 'var(--fixed, var(--jun-H-h))',\n}));\n\nconst InsetContent = React.forwardRef<HTMLDivElement, BoxProps>(\n  function InsetContent({ className, children, ...props }, ref) {\n    return (\n      <InsetContentRoot\n        ref={ref}\n        className={`${layoutClasses.InsetContent} ${className || ''}`}\n        {...props}\n      >\n        {children}\n      </InsetContentRoot>\n    );\n  },\n);\n\nexport default InsetContent;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/InsetSidebar.tsx",
      "target": "src/mui-treasury/layout/layout-core/InsetSidebar.tsx",
      "content": "'use client';\nimport React, { useMemo } from 'react';\n\nimport { Breakpoint } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport { layoutClasses } from './layoutClasses';\n\ninterface InsetSidebarProps {\n  position?: 'fixed' | 'absolute' | 'sticky';\n  width?: string | Partial<Record<Breakpoint, string>>;\n}\n\nconst StyledInsetSidebar = styled('aside', {\n  name: 'LayoutInsetSidebar',\n  slot: 'root',\n})<{\n  ownerState: InsetSidebarProps;\n}>(\n  memoTheme(({ theme }) => ({\n    '--jun-IS-position': 'var(--sticky,)',\n    '--fixed': 'var(--jun-IS-position,)',\n    '--absolute': 'var(--jun-IS-position,)',\n    '--anchor-right': 'var(--jun-IS-anchor,)',\n    '--anchor-left': 'var(--jun-IS-anchor,)',\n    '*:has(>&)': {\n      display: 'flex',\n      flexFlow: 'row nowrap !important',\n      flexGrow: '1 !important' as never,\n      [`&:not(.${layoutClasses.Content})`]: {\n        height: '100%',\n      },\n    },\n    [`*:has(>&) > :where(:not([class*=\"${layoutClasses.InsetSidebar}\"]))`]: {\n      flexGrow: '1 !important' as never,\n      overflow: 'auto',\n    },\n    width: '200px',\n    flex: 'none',\n    position: 'sticky' as const,\n    height: 'calc(var(--jun-h) - var(--jun-H-h, 0px))',\n    overflow: 'auto',\n    top: 'var(--jun-H-h, 0px)',\n    '&:first-child': {\n      '--jun-IS-anchor': 'var(--anchor-left)',\n    },\n    '&:last-child': {\n      '--jun-IS-anchor': 'var(--anchor-right)',\n    },\n    variants: [\n      {\n        props: ({ width }: InsetSidebarProps) => !!width,\n        style: ({ width }: Required<InsetSidebarProps>) =>\n          theme.unstable_sx({\n            width,\n            [`.${layoutClasses.Root}:has(> .${layoutClasses.Content} > &:first-child) > .${layoutClasses.Footer}`]:\n              {\n                '--jun-ISL-w': width,\n              },\n            [`.${layoutClasses.Root}:has(> .${layoutClasses.Content} > * > &:first-child) > .${layoutClasses.Footer}`]:\n              {\n                '--jun-ISL-w': width,\n              },\n            [`.${layoutClasses.Root}:has(> .${layoutClasses.Content} > &:last-child) > .${layoutClasses.Footer}`]:\n              {\n                '--jun-ISR-w': width,\n              },\n            [`.${layoutClasses.Root}:has(> .${layoutClasses.Content} > * > &:last-child) > .${layoutClasses.Footer}`]:\n              {\n                '--jun-ISR-w': width,\n              },\n            ...(typeof width !== 'string' && {\n              display: {\n                xs: 'none',\n                [Object.keys(width)[0]]: 'block',\n              },\n            }),\n          }),\n      },\n      {\n        props: { position: 'fixed' },\n        style: {\n          '--jun-IS-position': 'var(--fixed,)',\n          position: 'relative' as const,\n          height: 'auto',\n          overflow: 'visible',\n          top: 'auto',\n          flexShrink: 0,\n          zIndex: 1,\n        },\n      },\n      {\n        props: { position: 'absolute' },\n        style: {\n          '--jun-IS-position': 'var(--absolute,)',\n          position: 'relative' as const,\n          height: 'auto',\n          overflow: 'visible',\n          top: 'auto',\n          flexShrink: 0,\n          zIndex: 1,\n        },\n      },\n    ],\n  })),\n);\n\nconst InsetSidebar = React.forwardRef<\n  HTMLDivElement,\n  Omit<React.ComponentProps<typeof StyledInsetSidebar>, 'ownerState'> &\n    InsetSidebarProps\n>(function InsetSidebar(\n  { className, position = 'sticky', width, ...props },\n  ref,\n) {\n  const ownerState = useMemo(\n    () => ({\n      position,\n      width,\n    }),\n    [position, width],\n  );\n  return (\n    <StyledInsetSidebar\n      ref={ref}\n      className={`${layoutClasses.InsetSidebar} ${layoutClasses.InsetSidebar}-${position} ${className || ''}`}\n      ownerState={ownerState}\n      {...props}\n    />\n  );\n});\n\nexport default InsetSidebar;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/Root.tsx",
      "target": "src/mui-treasury/layout/layout-core/Root.tsx",
      "content": "'use client';\nimport React, { useMemo } from 'react';\n\nimport { Breakpoint } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\nimport { unstable_memoTheme as memoTheme } from '@mui/material/utils';\n\nimport { layoutClasses } from './layoutClasses';\n\ninterface RootProps {\n  height?: string | Record<Breakpoint, string> | Record<string, string>;\n  standalone?: boolean;\n  disableTransition?: boolean;\n}\n\nconst StyledRoot = styled('div', {\n  name: 'LayoutRoot',\n  slot: 'root',\n})<{\n  ownerState: RootProps;\n}>(\n  memoTheme(({ theme }) => ({\n    '--jun-h': 'calc(100svh - env(safe-area-inset-bottom))',\n    '--jun-H-h': '3rem', // default header height\n    '--jun-H-clip-h': '0px', // prevent upper layout\n    '--Header-underline': `1px solid ${(theme.vars || theme).palette.divider}`,\n    '--Header-background': (theme.vars || theme).palette.background.paper,\n    '--Footer-background': (theme.vars || theme).palette.background.default,\n    '--Footer-overline': `1px solid ${(theme.vars || theme).palette.divider}`,\n    '--drawer-pos': 'fixed',\n    '--drawer-z': '999',\n    '--jun-ES-line-w': '1px',\n    '--jun-ES-line-color': (theme.vars || theme).palette.divider,\n    '--EdgeSidebarContent-background': (theme.vars || theme).palette.background\n      .paper,\n    '--jun-IC-bg': (theme.vars || theme).palette.background.paper,\n    '--jun-IC-sideline': `1px solid ${(theme.vars || theme).palette.divider}`,\n    backgroundColor: (theme.vars || theme).palette.background.paper,\n    minHeight: 'var(--jun-h)',\n    minWidth: 0,\n    flex: 1,\n    display: 'grid',\n    position: 'relative',\n    transition: 'var(--tsn, grid-template-columns 0.3s)',\n    containerType: 'inline-size',\n    containerName: 'page',\n    gridTemplateRows: 'auto 1fr',\n    gridTemplateColumns:\n      'var(--_start-col, 0px) minmax(0, 1fr) var(--_end-col, 0px)',\n    gridTemplateAreas: `\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Header} ${layoutClasses.EdgeSidebarRight}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Content} ${layoutClasses.EdgeSidebarRight}\"\n    \"${layoutClasses.EdgeSidebar} ${layoutClasses.Footer} ${layoutClasses.EdgeSidebarRight}\"\n  `,\n\n    [`&:has(.${layoutClasses.EdgeSidebar})`]: {\n      '--_start-col': 'max-content',\n      '--jun-ES-drawerOpen': '0',\n    },\n    [`&:has(.${layoutClasses.EdgeSidebarRight})`]: {\n      '--_end-col': 'max-content',\n      '--jun-ES-drawerOpen': '0',\n    },\n    variants: [\n      {\n        props: ({ height }: RootProps) => !!height,\n        style: ({ height }: Required<RootProps>) =>\n          theme.unstable_sx({\n            '--jun-h': height,\n          }),\n      },\n      {\n        props: { standalone: true },\n        style: {\n          '--drawer-pos': 'absolute', // make edge sidebar (drawer) stay within the layout\n          '--drawer-z': '5',\n          '--content-overflow': 'auto',\n          '--jun-IC-absolute-h': 'calc(var(--jun-h) - var(--jun-H-h))',\n          maxHeight: 'var(--jun-h)',\n          [`:has(.${layoutClasses.Content} .${layoutClasses.InsetSidebar}-absolute)`]:\n            {\n              '--content-overflow': 'initial',\n            },\n        },\n      },\n      {\n        props: { disableTransition: true },\n        style: {\n          '--tsn': 'none',\n        },\n      },\n    ],\n  })),\n);\n\nconst Root = React.forwardRef<\n  HTMLDivElement,\n  Omit<React.ComponentPropsWithoutRef<typeof StyledRoot>, 'ownerState'> &\n    RootProps\n>(function Root(\n  { className, height, standalone, disableTransition, ...props },\n  ref,\n) {\n  const ownerState = useMemo(\n    () => ({\n      height,\n      standalone,\n      disableTransition,\n    }),\n    [height, standalone, disableTransition],\n  );\n  return (\n    <StyledRoot\n      ref={ref}\n      className={`${layoutClasses.Root} ${className || ''}`}\n      ownerState={ownerState}\n      {...props}\n    />\n  );\n});\n\nexport default Root;\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/SharedEdgeSidebar.tsx",
      "target": "src/mui-treasury/layout/layout-core/SharedEdgeSidebar.tsx",
      "content": "'use client';\nimport React from 'react';\n\nimport { Breakpoint } from '@mui/material/styles';\nimport { styled } from '@mui/material/styles';\n\nimport { layoutAttrs } from './layoutAttrs';\nimport { layoutClasses } from './layoutClasses';\n\nexport type DrawerConfig = {\n  width?: string;\n  showHeader?: boolean;\n  withoutOverlay?: boolean;\n};\nexport type PermanentConfig = {\n  width?: string;\n  collapsedWidth?: string;\n  visibility?: 'hidden' | 'visible';\n  hoverUncollapse?:\n    | true\n    | {\n        delay?: string;\n        shadow?: string;\n      };\n};\n\nexport type EdgeSidebarVariant =\n  | ['drawer', DrawerConfig?]\n  | ['permanent', PermanentConfig?];\n\nexport type EdgeSidebarVariantInput =\n  | EdgeSidebarVariant\n  | Partial<Record<Breakpoint, EdgeSidebarVariant>>;\n\nexport function internalCollapseSidebar(options: {\n  event: React.MouseEvent;\n  selector: string;\n  state?: boolean;\n  document?: Document | null;\n}) {\n  const { state, document: d, selector, event } = options || {};\n  const doc = d ?? document;\n  const sidebar = doc.querySelector(selector) as HTMLElement;\n  if (sidebar) {\n    const currentCollapsed =\n      window\n        .getComputedStyle(event.target as Element)\n        .getPropertyValue('--_sidebarCollapsed') === '1';\n    const nextCollapsed = state === undefined ? !currentCollapsed : state;\n    const autoCollapse =\n      window\n        .getComputedStyle(event.target as Element)\n        .getPropertyValue('--_autoCollapse') === '1';\n    const inAutoCollapse =\n      window\n        .getComputedStyle(event.target as Element)\n        .getPropertyValue('--_in-autoCollapse') === '1';\n\n    if (nextCollapsed) {\n      sidebar.removeAttribute(layoutAttrs.isEdgeSidebarUncollapsed);\n      if (!autoCollapse || inAutoCollapse) {\n        sidebar.setAttribute(layoutAttrs.isEdgeSidebarCollapsed, '');\n      }\n    } else {\n      sidebar.removeAttribute(layoutAttrs.isEdgeSidebarCollapsed);\n      if (!inAutoCollapse) {\n        sidebar.setAttribute(layoutAttrs.isEdgeSidebarUncollapsed, '');\n      }\n    }\n  }\n}\n\nexport function internalToggleSidebar(options: {\n  selector: string;\n  state?: boolean;\n  document?: Document | null;\n}) {\n  const { state, document: d, selector } = options || {};\n  const doc = d ?? document;\n  const sidebar = doc.querySelector(selector) as HTMLDivElement | null;\n  if (sidebar) {\n    const currentOpen = sidebar.getAttribute(layoutAttrs.isDrawerOpen) !== null;\n    const nextOpen = state === undefined ? !currentOpen : state;\n    if (nextOpen) {\n      sidebar.setAttribute(layoutAttrs.isDrawerOpen, '');\n      sidebar.style.setProperty('--jun-ES-drawerOpen', '1');\n      function handleOutsideClick(event: MouseEvent) {\n        const closer = doc.querySelector(\n          `.${layoutClasses.EdgeDrawerClose}`,\n        ) as HTMLButtonElement;\n        if (\n          // clicking on the backdrop (psuedo element of sidebar) will close the sidebar\n          event.target === sidebar ||\n          // clicking on the closer button will close the sidebar\n          (closer && closer.contains(event.target as Node))\n        ) {\n          internalToggleSidebar({\n            ...options,\n            state: false,\n          });\n          doc.removeEventListener?.('click', handleOutsideClick);\n        }\n      }\n      setTimeout(() => {\n        // prevent the `handleOutsideClick` to be called immediately\n        doc.addEventListener?.('click', handleOutsideClick);\n      }, 0);\n\n      // TODO: add a way to close the sidebar by swiping\n      // TODO: add a way to close the sidebar by pressing ESC\n    } else {\n      sidebar.removeAttribute(layoutAttrs.isDrawerOpen);\n      sidebar.setAttribute(layoutAttrs.isDrawerClosing, '');\n      setTimeout(() => {\n        sidebar.removeAttribute(layoutAttrs.isDrawerClosing);\n      }, 300);\n      sidebar.style.setProperty('--jun-ES-drawerOpen', '');\n    }\n  }\n}\n\n/**\n * Observes the EdgeSidebar width and returns whether it is collapsed.\n *\n * @param edgeSidebarId - The `id` of the EdgeSidebar element to observe.\n * @param options.collapsedDelay - Delay in ms before setting collapsed to `true`. Defaults to 200.\n * @param options.uncollapsedDelay - Delay in ms before setting collapsed to `false`. Defaults to 200.\n * @returns `undefined` before the first measurement, then `true` if collapsed or `false` if expanded.\n */\nexport function useCollapsedSidebar(\n  edgeSidebarId: string,\n  options?: { collapsedDelay?: number; uncollapsedDelay?: number },\n) {\n  const { collapsedDelay = 300, uncollapsedDelay = 0 } = options || {};\n  const [collapsed, setCollapsed] = React.useState<boolean | undefined>(\n    undefined,\n  );\n\n  React.useEffect(() => {\n    const edgeSidebar = document.getElementById(edgeSidebarId);\n    if (!edgeSidebar) return;\n\n    const cssVar = edgeSidebar.classList.contains(\n      layoutClasses.EdgeSidebarRight,\n    )\n      ? '--jun-ESR-collapsedWidth'\n      : '--jun-ES-collapsedWidth';\n\n    const content = edgeSidebar.querySelector(\n      `.${layoutClasses.EdgeSidebarContent}`,\n    );\n    if (!content) return;\n\n    let timeoutId: ReturnType<typeof setTimeout>;\n    const ro = new ResizeObserver(() => {\n      const width = content.getBoundingClientRect().width;\n      const collapsedWidth =\n        parseFloat(getComputedStyle(edgeSidebar).getPropertyValue(cssVar)) || 0;\n      const next = width <= collapsedWidth;\n      clearTimeout(timeoutId);\n      timeoutId = setTimeout(\n        () => setCollapsed(next),\n        next ? collapsedDelay : uncollapsedDelay,\n      );\n    });\n    ro.observe(content);\n\n    return () => {\n      clearTimeout(timeoutId);\n      ro.disconnect();\n    };\n  }, [edgeSidebarId, collapsedDelay, uncollapsedDelay]);\n\n  return collapsed;\n}\n\nexport const EdgeSidebarRoot = styled('div')({\n  '--anchorLeft': 'var(--jun-ES-anchor,)',\n  '--anchorRight': 'var(--jun-ES-anchor,)',\n  '--drawer-h': 'var(--jun-h)',\n  transition: 'var(--tsn, width 0.3s)',\n  display: 'flex',\n  flexDirection: 'column',\n  padding: '0px', // prevent user from customizing it\n  margin: '0px', // prevent user from customizing it\n  // ==============================\n  // To keep the EdgeSidebar fixed when the Content is scrollable\n  position: 'var(--_permanent, sticky)' as never,\n  top: 'var(--_permanent, var(--jun-H-clip-h))',\n  zIndex: 'var(--_drawer, 2) var(--_permanent, 1)' as never,\n  height: 'var(--_permanent, calc(var(--jun-h) - var(--jun-H-clip-h)))',\n  // ==============================\n  '&::before': {\n    display: `var(--_drawer, block)\n                var(--_permanent, none)`,\n    position: 'absolute',\n    content: '\"\"',\n    inset: '0',\n    backgroundColor: 'rgba(0, 0, 0, 0.48)',\n    backdropFilter: 'blur(4px)',\n    zIndex: '1',\n    transition: 'var(--tsn, opacity 0.4s, visibility 0.4s)',\n    visibility: 'hidden',\n    opacity: 'var(--jun-ES-drawerOpen, 0)',\n  },\n  [`&[${layoutAttrs.isDrawerOpen}]`]: {\n    '&::before': {\n      visibility: 'visible',\n    },\n  },\n  [`html:has([${layoutAttrs.isDrawerOpen}]:not(.${layoutClasses.DrawerWithoutOverlay}):not(.${layoutClasses.Content} &))`]:\n    {\n      overflow: 'hidden',\n    },\n});\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/index.ts",
      "target": "src/mui-treasury/layout/layout-core/index.ts",
      "content": "export { default as Content } from './Content';\nexport * from './Content';\nexport { default as EdgeDrawerClose } from './EdgeDrawerClose';\nexport { default as EdgeDrawerTrigger } from './EdgeDrawerTrigger';\nexport { default as EdgeDrawerTriggerRight } from './EdgeDrawerTriggerRight';\nexport { default as EdgeSidebar } from './EdgeSidebar';\nexport * from './EdgeSidebar';\nexport { default as EdgeSidebarCollapser } from './EdgeSidebarCollapser';\nexport { default as EdgeSidebarContent } from './EdgeSidebarContent';\nexport * from './EdgeSidebarContent';\nexport { default as EdgeSidebarRight } from './EdgeSidebarRight';\nexport * from './EdgeSidebarRight';\nexport { default as Header } from './Header';\nexport * from './Header';\nexport { default as Footer } from './Footer';\nexport * from './Footer';\nexport { default as Root } from './Root';\nexport * from './Root';\nexport { default as InsetAvoidingView } from './InsetAvoidingView';\nexport * from './InsetAvoidingView';\nexport { default as InsetSidebar } from './InsetSidebar';\nexport * from './InsetSidebar';\nexport { default as InsetContent } from './InsetContent';\nexport * from './InsetContent';\nexport { layoutAttrs } from './layoutAttrs';\nexport { layoutClasses } from './layoutClasses';\nexport { layoutVisibility } from './layoutVisibility';\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/layoutAttrs.ts",
      "target": "src/mui-treasury/layout/layout-core/layoutAttrs.ts",
      "content": "export const layoutAttrs = {\n  isDrawerOpen: 'data-drawer-open',\n  isDrawerClosing: 'data-mobile-closing',\n  isEdgeSidebarUncollapsed: 'data-edge-uncollapsed',\n  isEdgeSidebarCollapsed: 'data-edge-collapsed',\n  isEdgeSidebarContentHidden: 'data-sidebar-hidden',\n};\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/layoutClasses.ts",
      "target": "src/mui-treasury/layout/layout-core/layoutClasses.ts",
      "content": "export const layoutClasses = {\n  Root: 'Root',\n  Header: 'Header',\n  Content: 'Content',\n  Footer: 'Footer',\n  EdgeSidebar: 'EdgeSidebar',\n  EdgeSidebarContent: 'EdgeSidebarContent',\n  EdgeSidebarCollapser: 'EdgeSidebar-collapser',\n  EdgeDrawerTrigger: 'EdgeDrawerTrigger',\n  EdgeDrawerClose: 'EdgeDrawerClose',\n  EdgeDrawerOpenVisible: 'EdgeDrawerOpen-visible',\n  EdgeDrawerClosedVisible: 'EdgeDrawerClosed-visible',\n  EdgeCollapsedVisible: 'EdgeCollapsedVisible',\n  EdgeUncollapsedVisible: 'EdgeUncollapsedVisible',\n  EdgeSidebarRight: 'EdgeSidebar-R',\n  EdgeSidebarRightCollapser: 'EdgeSidebar-R-collapser',\n  EdgeDrawerTriggerRight: 'EdgeDrawerTrigger-R',\n  DrawerWithoutOverlay: 'EdgeDrawer-withoutOverlay',\n  InsetSidebar: 'InsetSidebar',\n  InsetContent: 'InsetContent',\n  InsetAvoidingView: 'InsetAvoidingView',\n  SidebarRail: 'SidebarRail',\n};\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/layoutVariables.ts",
      "target": "src/mui-treasury/layout/layout-core/layoutVariables.ts",
      "content": "export const layoutVariables = {\n  height: '--jun-h',\n  headerHeight: '--jun-H-h',\n  headerClipHeight: '--jun-H-clip-h',\n  edgeSidebarLineWidth: '--jun-ES-line-w',\n  edgeSidebarLineColor: '--jun-ES-line-color',\n  edgeSidebarPermanentWidth: '--jun-ES-permanentWidth',\n  edgeSidebarCollapsedWidth: '--jun-ES-collapsedWidth',\n  edgeSidebarDrawerWidth: '--jun-ES-drawerWidth',\n  edgeSidebarRightPermanentWidth: '--jun-ESR-permanentWidth',\n  edgeSidebarRightCollapsedWidth: '--jun-ESR-collapsedWidth',\n  insetSidebarLeftWidth: '--jun-ISL-w',\n  insetSidebarRightWidth: '--jun-ISR-w',\n};\n",
      "type": "registry:item"
    },
    {
      "path": "layout/layout-core/layoutVisibility.ts",
      "target": "src/mui-treasury/layout/layout-core/layoutVisibility.ts",
      "content": "import { layoutClasses } from './layoutClasses';\n\nexport const layoutVisibility = {\n  visibleOnEdgeDrawerOpen: layoutClasses.EdgeDrawerOpenVisible,\n  visibleOnEdgeDrawerClosed: layoutClasses.EdgeDrawerClosedVisible,\n  visibleOnEdgePermanentCollapsed: layoutClasses.EdgeCollapsedVisible,\n  visibleOnEdgePermanentUncollapsed: layoutClasses.EdgeUncollapsedVisible,\n};\n",
      "type": "registry:item"
    }
  ],
  "meta": {
    "category": "layout",
    "previewMode": "iframe"
  }
}