{"version":3,"file":"side-navigation-types.mjs","names":[],"sources":["../../../src/side-navigation/side-navigation-types.ts"],"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 { type IconIndicatorType } from '../_common/IconIndicatorWrapper';\nimport { type HtmlAttributes } from '../_common/types';\n\ntype SideNavProps = {\n  /** Content displayed inside the side navigation */\n  children?: React.ReactNode;\n  /** Aria label for the side navigation. Needed for menubar accessibility. */\n  ariaLabel: string;\n  /** Whether the side navigation is expanded */\n  isExpanded?: boolean;\n  /** Whether the side navigation expands on hover/focus when not pinned or compact */\n  shouldOverlayOnInteraction?: boolean;\n  /** Callback function triggered when the pin button is clicked */\n  onPinButtonClick?: () => void;\n  /** Width used when expanded. Accepts any valid CSS width value or a number */\n  expandedWidth?: React.CSSProperties['width'];\n};\n\ntype SideNavListItemProps = {\n  /** Content displayed inside the side navigation list item */\n  children?: React.ReactNode;\n};\n\ntype BaseItemProps = {\n  /** Icon displayed inside the side navigation item */\n  icon?: React.ReactNode;\n  /** Text label of the side navigation item */\n  label?: string;\n  /** Whether the side navigation item is selected */\n  isActive?: boolean;\n  /** Badge displayed inside the side navigation item. Represented by an object with a number and a type (e.g., 'info', 'warning', 'danger'). */\n  badge?: ItemBadgeProps;\n};\n\ntype NavItemProps = BaseItemProps & {\n  /** Element displayed on the leading side of the side navigation item (e.g., counter) */\n  trailingElement?: React.ReactNode;\n} & (\n    | {\n        as: 'button';\n        /** Event handler for when the button is clicked. Only applicable if `as` is `'button'`. */\n        onClick?: HtmlAttributes<'button'>['onClick'];\n      }\n    | {\n        /** What HTML element to render the root element as. */\n        as?: React.ElementType;\n      }\n    | {\n        as: 'a';\n        /** The href of the link. Only applicable if `as` is `'a'`. */\n        href?: HtmlAttributes<'a'>['href'];\n        /** The target of the link. Only applicable if `as` is `'a'`. */\n        target?: HtmlAttributes<'a'>['target'];\n      }\n  );\n\ntype CategoryItemProps = BaseItemProps & {\n  /** Content displayed inside the submenu popover. Typically a list of `SideNavigation.NavItem`. */\n  children?: React.ReactNode;\n  /**\n   * If true, the menu will be open. Otherwise, the menu will open and close\n   * based on the user hovering the item.\n   */\n  isMenuOpen?: boolean;\n};\n\ntype CategoryHeaderProps = {\n  /** Content displayed inside the side navigation category header */\n  children?: React.ReactNode;\n};\n\ntype ItemBadgeProps = {\n  /** Number displayed inside the side navigation item badge */\n  number: number;\n  /** Type of the side navigation item badge */\n  type: IconIndicatorType;\n};\n\nexport type {\n  SideNavProps,\n  SideNavListItemProps,\n  NavItemProps,\n  CategoryItemProps,\n  CategoryHeaderProps,\n  ItemBadgeProps,\n};\n"],"mappings":""}