{"version":3,"file":"side-navigation-context.mjs","names":[],"sources":["../../../src/side-navigation/side-navigation-context.tsx"],"sourcesContent":["/*!\n *\n *  Copyright (c) \"Neo4j\"\n *  Neo4j Sweden AB [http://neo4j.com]\n *\n *  This file is part of Neo4j.\n *\n *  Neo4j is free software: you can redistribute it and/or modify\n *  it under the terms of the GNU General Public License as published by\n *  the Free Software Foundation, either version 3 of the License, or\n *  (at your option) any later version.\n *\n *  This program is distributed in the hope that it will be useful,\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n *  GNU General Public License for more details.\n *\n *  You should have received a copy of the GNU General Public License\n *  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { createContext, useContext } from 'react';\n\ntype SideNavContextType = {\n  shouldOverlayOnInteraction: boolean;\n  isExpanded: boolean;\n  isHovered: boolean;\n  onPinButtonClick?: () => void;\n};\n\nexport const SideNavContext = createContext<SideNavContextType | null>(null);\n\nexport const useSideNavContext = () => {\n  const context = useContext(SideNavContext);\n  if (!context) {\n    throw new Error(\n      'SideNavigation subcomponents must be wrapped in <SideNavigation /> component',\n    );\n  }\n  return context;\n};\n\ntype SideNavCategoryContextType = {\n  activeIndex: number | null;\n  getItemProps: (\n    userProps?: React.HTMLProps<HTMLElement>,\n  ) => Record<string, unknown>;\n};\n\nexport const SideNavCategoryContext =\n  createContext<SideNavCategoryContextType | null>(null);\n\nexport const useSideNavCategoryContext = () => {\n  return useContext(SideNavCategoryContext);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,iBAAiB,cAAyC,IAAI;AAE3E,MAAa,0BAA0B;CACrC,MAAM,UAAU,WAAW,cAAc;CACzC,IAAI,CAAC,SACH,MAAM,IAAI,MACR,8EACF;CAEF,OAAO;AACT;AASA,MAAa,yBACX,cAAiD,IAAI;AAEvD,MAAa,kCAAkC;CAC7C,OAAO,WAAW,sBAAsB;AAC1C"}