{"version":3,"file":"types.cjs","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\r\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\r\nimport { IconButtonProps } from '../Button/Iconbutton';\r\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\r\nimport {TextButtonProps} from \"../Button/TextButton\";\r\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\r\n\r\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\r\n  label: string;\r\n  icon?: React.ReactElement<any>;\r\n}\r\n\r\nexport interface MenuButton extends Omit<TextButtonProps, 'onClick' | 'children' | 'size'> {\r\n  label: string;\r\n  action: () => void;\r\n\r\n  tooltip?: TooltipProps;\r\n}\r\n\r\nexport interface MenuGroupFooter {\r\n  header: string;\r\n  note?: string;\r\n  link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuGroupHeader {\r\n  header: string;\r\n  note?: string;\r\n  link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface MenuAccountInfo {\r\n  firstName: string;\r\n  lastName: string;\r\n  email: string;\r\n  link?: MenuHyperLinkProps;\r\n}\r\n\r\nexport interface ProfileMenu {\r\n  label?: string;\r\n\r\n  user: MenuAccountInfo;\r\n\r\n  sections: MenuNavigationSection[];\r\n\r\n  signOut?: MenuButton;\r\n}\r\n\r\nexport interface MenuIconSubMenuButton\r\n  extends Omit<\r\n    IconButtonProps,\r\n    | 'type'\r\n    | 'action'\r\n    | 'shape'\r\n    | 'variant'\r\n    | 'hideOnLowWidth'\r\n    | 'flatEdge'\r\n    | 'isInMobileMenu'\r\n    | 'useTransparentBackground'\r\n    | 'shouldNotInteract'\r\n    | 'iconColor'\r\n    | 'unsetIconSize'\r\n    | 'borderRadius'\r\n    | 'focusBackgroundColor'\r\n    | 'children'\r\n    | 'invertFocus'\r\n  > {\r\n  type: 'submenu';\r\n  icon: React.ReactNode;\r\n  menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\r\n  placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuIconButton\r\n  extends Omit<\r\n    IconButtonProps,\r\n    | 'type'\r\n    | 'action'\r\n    | 'shape'\r\n    | 'variant'\r\n    | 'hideOnLowWidth'\r\n    | 'flatEdge'\r\n    | 'isInMobileMenu'\r\n    | 'useTransparentBackground'\r\n    | 'shouldNotInteract'\r\n    | 'iconColor'\r\n    | 'unsetIconSize'\r\n    | 'borderRadius'\r\n    | 'focusBackgroundColor'\r\n    | 'children'\r\n    | 'invertFocus'\r\n  > {\r\n  type: 'action';\r\n  icon: React.ReactNode;\r\n  action: (button?: EventTarget) => boolean | void;\r\n  placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\r\n  type: 'profile';\r\n  action?: (button?: EventTarget) => boolean | void;\r\n  placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuSearchButton {\r\n  type: 'search';\r\n  placement?: 'left' | 'right';\r\n}\r\n\r\nexport interface MenuSwitcherButton\r\n  extends Omit<\r\n    IconButtonProps,\r\n    | 'id'\r\n    | 'type'\r\n    | 'action'\r\n    | 'shape'\r\n    | 'variant'\r\n    | 'hideOnLowWidth'\r\n    | 'flatEdge'\r\n    | 'isInMobileMenu'\r\n    | 'useTransparentBackground'\r\n    | 'shouldNotInteract'\r\n    | 'iconColor'\r\n    | 'unsetIconSize'\r\n    | 'borderRadius'\r\n    | 'focusBackgroundColor'\r\n    | 'children'\r\n    | 'invertFocus'\r\n  > {\r\n  type: 'switcher';\r\n  placement?: 'left' | 'right';\r\n  action?: (button?: EventTarget) => boolean | void;\r\n}\r\n\r\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;\r\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton | MenuSearchButton;\r\n\r\nexport interface MobileNavigationMenuProps {\r\n  label?: string;\r\n  buttons?: MobileMenuButtonTypes[];\r\n\r\n  header?: MenuGroupHeader;\r\n\r\n  items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\r\n\r\n  footer?: MenuGroupFooter;\r\n  action?: MenuButton;\r\n}\r\n\r\nexport interface DesktopNavigationMenuProps {\r\n  buttons?: DesktopMenuButtonTypes[];\r\n  items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n  action?: MenuButton;\r\n  reverseRightSideOrder?: boolean;\r\n}\r\n\r\n// @ts-ignore\r\nexport interface MenuNavigationGroup<T = MenuNavigationItemTypeDesktopGroup | MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\r\n  label: string;\r\n  note?: string;\r\n\r\n  buttons?: MobileMenuButtonTypes[];\r\n  header?: MenuGroupHeader;\r\n\r\n  items: T[];\r\n\r\n  footer?: MenuGroupFooter;\r\n  action?: MenuButton;\r\n}\r\n\r\nexport type MenuNavigationItem = {\r\n  icon?: React.ReactNode;\r\n  to: string;\r\n  exact?: boolean;\r\n  disabled?: boolean;\r\n  external?: boolean;\r\n  action?: (e: React.MouseEvent) => void;\r\n  label: string;\r\n  note?: string;\r\n  pinned?: boolean;\r\n  subItems?: MenuNavigationItem[];\r\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\r\n\r\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\r\n  divider?: boolean;\r\n  pinned?: boolean;\r\n  label?: string;\r\n  items: T[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\r\n  type?: 'item';\r\n};\r\n\r\nexport type MenuNavigationItemTypeDesktopGroup = {\r\n  id: string;\r\n  label?: string;\r\n  disabled?: boolean;\r\n  pinned?: boolean;\r\n  type?: 'desktopgroup';\r\n  expanded?: boolean;\r\n  items: (MenuNavigationItemTypeItem | MenuNavigationItemTypeDesktopGroup)[];\r\n}\r\n\r\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\r\n  type: 'group';\r\n  icon?: React.ReactNode;\r\n  pinned?: boolean;\r\n  disabled?: boolean;\r\n};\r\n\r\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\r\n  type: 'section';\r\n};\r\n\r\nexport type MenuNavigationCustomSubMenu = {\r\n  type: 'custom';\r\n  label?: string;\r\n  buttons?: MobileMenuButtonTypes[];\r\n  custom: () => React.ReactNode;\r\n};\r\n"],"mappings":"","ignoreList":[]}