@laerdal/life-react-components 2.1.0 → 2.1.1-dev.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/AuthPage/AuthPage.d.ts +1 -1
  2. package/dist/Banners/Banner.d.ts +1 -1
  3. package/dist/Banners/OverviewBanner.d.ts +1 -1
  4. package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
  5. package/dist/Button/BackButton.cjs +3 -1
  6. package/dist/Button/BackButton.cjs.map +1 -1
  7. package/dist/Button/BackButton.d.ts +2 -2
  8. package/dist/Button/BackButton.js +3 -1
  9. package/dist/Button/BackButton.js.map +1 -1
  10. package/dist/Button/Button.cjs.map +1 -1
  11. package/dist/Button/Button.js.map +1 -1
  12. package/dist/Button/DualFunctionButton.cjs +1 -0
  13. package/dist/Button/DualFunctionButton.cjs.map +1 -1
  14. package/dist/Button/DualFunctionButton.js +1 -0
  15. package/dist/Button/DualFunctionButton.js.map +1 -1
  16. package/dist/Button/Iconbutton.cjs +9 -6
  17. package/dist/Button/Iconbutton.cjs.map +1 -1
  18. package/dist/Button/Iconbutton.d.ts +3 -1
  19. package/dist/Button/Iconbutton.js +9 -6
  20. package/dist/Button/Iconbutton.js.map +1 -1
  21. package/dist/Card/HorizontalCard/HorizontalCardActions.d.ts +1 -1
  22. package/dist/Card/HorizontalCard/HorizontalCardBody.d.ts +1 -1
  23. package/dist/Card/HorizontalCard/HorizontalCardThumbnail.d.ts +1 -1
  24. package/dist/Card/HorizontalCard/types.d.ts +4 -4
  25. package/dist/Chips/ActionChip.cjs +3 -1
  26. package/dist/Chips/ActionChip.cjs.map +1 -1
  27. package/dist/Chips/ActionChip.js +3 -1
  28. package/dist/Chips/ActionChip.js.map +1 -1
  29. package/dist/Chips/ChipTypes.cjs.map +1 -1
  30. package/dist/Chips/ChipTypes.d.ts +5 -5
  31. package/dist/Chips/ChipTypes.js.map +1 -1
  32. package/dist/Chips/ChoiceChips.cjs +3 -1
  33. package/dist/Chips/ChoiceChips.cjs.map +1 -1
  34. package/dist/Chips/ChoiceChips.js +3 -1
  35. package/dist/Chips/ChoiceChips.js.map +1 -1
  36. package/dist/Chips/FilterChip.cjs +3 -1
  37. package/dist/Chips/FilterChip.cjs.map +1 -1
  38. package/dist/Chips/FilterChip.js +3 -1
  39. package/dist/Chips/FilterChip.js.map +1 -1
  40. package/dist/Chips/InputChip.cjs +3 -1
  41. package/dist/Chips/InputChip.cjs.map +1 -1
  42. package/dist/Chips/InputChip.js +3 -1
  43. package/dist/Chips/InputChip.js.map +1 -1
  44. package/dist/ChipsInput/ChipDropdownInput.cjs.map +1 -1
  45. package/dist/ChipsInput/ChipDropdownInput.d.ts +1 -1
  46. package/dist/ChipsInput/ChipDropdownInput.js.map +1 -1
  47. package/dist/ChipsInput/ChipInput.cjs +13 -2
  48. package/dist/ChipsInput/ChipInput.cjs.map +1 -1
  49. package/dist/ChipsInput/ChipInput.js +14 -3
  50. package/dist/ChipsInput/ChipInput.js.map +1 -1
  51. package/dist/ChipsInput/ChipInputField.cjs +3 -1
  52. package/dist/ChipsInput/ChipInputField.cjs.map +1 -1
  53. package/dist/ChipsInput/ChipInputField.js +3 -1
  54. package/dist/ChipsInput/ChipInputField.js.map +1 -1
  55. package/dist/ChipsInput/ChipInputTypes.cjs.map +1 -1
  56. package/dist/ChipsInput/ChipInputTypes.d.ts +2 -1
  57. package/dist/ChipsInput/ChipInputTypes.js.map +1 -1
  58. package/dist/Dropdown/BasicDropdown.cjs +4 -1
  59. package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
  60. package/dist/Dropdown/BasicDropdown.d.ts +5 -5
  61. package/dist/Dropdown/BasicDropdown.js +4 -1
  62. package/dist/Dropdown/BasicDropdown.js.map +1 -1
  63. package/dist/Dropdown/CommonStyling.cjs +1 -1
  64. package/dist/Dropdown/CommonStyling.cjs.map +1 -1
  65. package/dist/Dropdown/CommonStyling.js +1 -1
  66. package/dist/Dropdown/CommonStyling.js.map +1 -1
  67. package/dist/Dropdown/DropdownButton.cjs +6 -1
  68. package/dist/Dropdown/DropdownButton.cjs.map +1 -1
  69. package/dist/Dropdown/DropdownButton.js +6 -1
  70. package/dist/Dropdown/DropdownButton.js.map +1 -1
  71. package/dist/Dropdown/DropdownButtonTypes.cjs.map +1 -1
  72. package/dist/Dropdown/DropdownButtonTypes.d.ts +5 -5
  73. package/dist/Dropdown/DropdownButtonTypes.js.map +1 -1
  74. package/dist/Dropdown/DropdownContent.cjs +20 -5
  75. package/dist/Dropdown/DropdownContent.cjs.map +1 -1
  76. package/dist/Dropdown/DropdownContent.js +20 -5
  77. package/dist/Dropdown/DropdownContent.js.map +1 -1
  78. package/dist/Dropdown/DropdownFilter.cjs +4 -2
  79. package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
  80. package/dist/Dropdown/DropdownFilter.d.ts +2 -2
  81. package/dist/Dropdown/DropdownFilter.js +4 -2
  82. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  83. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +13 -7
  84. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
  85. package/dist/GlobalNavigationBar/GlobalNavigationBar.d.ts +3 -2
  86. package/dist/GlobalNavigationBar/GlobalNavigationBar.js +13 -7
  87. package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
  88. package/dist/GlobalNavigationBar/Logo.d.ts +1 -1
  89. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +3 -1
  90. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
  91. package/dist/GlobalNavigationBar/desktop/DesktopActions.d.ts +1 -0
  92. package/dist/GlobalNavigationBar/desktop/DesktopActions.js +3 -1
  93. package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
  94. package/dist/GlobalNavigationBar/desktop/ExtendedMainMenu.d.ts +1 -1
  95. package/dist/GlobalNavigationBar/desktop/MainMenu.d.ts +1 -1
  96. package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs +14 -4
  97. package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
  98. package/dist/GlobalNavigationBar/desktop/RightSideNav.d.ts +1 -1
  99. package/dist/GlobalNavigationBar/desktop/RightSideNav.js +14 -4
  100. package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
  101. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs +4 -2
  102. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
  103. package/dist/GlobalNavigationBar/desktop/UserMenu.js +4 -2
  104. package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
  105. package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs +2 -2
  106. package/dist/GlobalNavigationBar/mobile/MobileActionContainer.cjs.map +1 -1
  107. package/dist/GlobalNavigationBar/mobile/MobileActionContainer.js +2 -2
  108. package/dist/GlobalNavigationBar/mobile/MobileActionContainer.js.map +1 -1
  109. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +3 -0
  110. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
  111. package/dist/GlobalNavigationBar/mobile/MobileMenu.d.ts +1 -1
  112. package/dist/GlobalNavigationBar/mobile/MobileMenu.js +3 -0
  113. package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
  114. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs +2 -2
  115. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.cjs.map +1 -1
  116. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js +3 -2
  117. package/dist/GlobalNavigationBar/mobile/MobileMenuHeader.js.map +1 -1
  118. package/dist/GlobalNavigationBar/types.cjs.map +1 -1
  119. package/dist/GlobalNavigationBar/types.d.ts +11 -12
  120. package/dist/GlobalNavigationBar/types.js.map +1 -1
  121. package/dist/HyperLink/index.cjs +10 -2
  122. package/dist/HyperLink/index.cjs.map +1 -1
  123. package/dist/HyperLink/index.d.ts +2 -2
  124. package/dist/HyperLink/index.js +2 -2
  125. package/dist/HyperLink/index.js.map +1 -1
  126. package/dist/Image/ImageWithFallbacks.d.ts +1 -1
  127. package/dist/InputFields/Checkbox.cjs +3 -1
  128. package/dist/InputFields/Checkbox.cjs.map +1 -1
  129. package/dist/InputFields/Checkbox.js +3 -1
  130. package/dist/InputFields/Checkbox.js.map +1 -1
  131. package/dist/InputFields/DatepickerField.cjs +5 -1
  132. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  133. package/dist/InputFields/DatepickerField.d.ts +2 -1
  134. package/dist/InputFields/DatepickerField.js +5 -1
  135. package/dist/InputFields/DatepickerField.js.map +1 -1
  136. package/dist/InputFields/Label.cjs +39 -6
  137. package/dist/InputFields/Label.cjs.map +1 -1
  138. package/dist/InputFields/Label.d.ts +2 -1
  139. package/dist/InputFields/Label.js +41 -9
  140. package/dist/InputFields/Label.js.map +1 -1
  141. package/dist/InputFields/NumberField.cjs +5 -2
  142. package/dist/InputFields/NumberField.cjs.map +1 -1
  143. package/dist/InputFields/NumberField.d.ts +2 -2
  144. package/dist/InputFields/NumberField.js +5 -2
  145. package/dist/InputFields/NumberField.js.map +1 -1
  146. package/dist/InputFields/PasswordField.cjs +3 -1
  147. package/dist/InputFields/PasswordField.cjs.map +1 -1
  148. package/dist/InputFields/PasswordField.d.ts +2 -2
  149. package/dist/InputFields/PasswordField.js +3 -1
  150. package/dist/InputFields/PasswordField.js.map +1 -1
  151. package/dist/InputFields/QuickSearch.cjs +2 -0
  152. package/dist/InputFields/QuickSearch.cjs.map +1 -1
  153. package/dist/InputFields/QuickSearch.d.ts +1 -1
  154. package/dist/InputFields/QuickSearch.js +2 -0
  155. package/dist/InputFields/QuickSearch.js.map +1 -1
  156. package/dist/InputFields/RadioButton.cjs +3 -1
  157. package/dist/InputFields/RadioButton.cjs.map +1 -1
  158. package/dist/InputFields/RadioButton.d.ts +2 -2
  159. package/dist/InputFields/RadioButton.js +3 -1
  160. package/dist/InputFields/RadioButton.js.map +1 -1
  161. package/dist/InputFields/ResponsiveComponentWrapper.d.ts +1 -1
  162. package/dist/InputFields/SearchBar.d.ts +1 -1
  163. package/dist/InputFields/TextField.cjs +3 -1
  164. package/dist/InputFields/TextField.cjs.map +1 -1
  165. package/dist/InputFields/TextField.d.ts +2 -2
  166. package/dist/InputFields/TextField.js +3 -1
  167. package/dist/InputFields/TextField.js.map +1 -1
  168. package/dist/InputFields/Textarea.cjs +3 -1
  169. package/dist/InputFields/Textarea.cjs.map +1 -1
  170. package/dist/InputFields/Textarea.d.ts +1 -1
  171. package/dist/InputFields/Textarea.js +3 -1
  172. package/dist/InputFields/Textarea.js.map +1 -1
  173. package/dist/InputFields/components/SearchBarInput.d.ts +1 -1
  174. package/dist/InputFields/types.cjs.map +1 -1
  175. package/dist/InputFields/types.d.ts +5 -5
  176. package/dist/InputFields/types.js.map +1 -1
  177. package/dist/List/ListRow.d.ts +1 -1
  178. package/dist/LoadingIndicator/LoadingIndicator.d.ts +1 -1
  179. package/dist/MiniProductCard/MiniProductCard.d.ts +1 -1
  180. package/dist/Modals/Modal.d.ts +1 -1
  181. package/dist/Modals/ModalContainer.d.ts +2 -2
  182. package/dist/Modals/ModalContent.cjs +1 -0
  183. package/dist/Modals/ModalContent.cjs.map +1 -1
  184. package/dist/Modals/ModalContent.js +1 -0
  185. package/dist/Modals/ModalContent.js.map +1 -1
  186. package/dist/Modals/ModalTypes.d.ts +1 -1
  187. package/dist/NavItem/NavItem.d.ts +1 -1
  188. package/dist/Paginator/Paginator.d.ts +1 -1
  189. package/dist/Popover/Popover.d.ts +4 -4
  190. package/dist/ProfileButton/ProfileButton.d.ts +1 -1
  191. package/dist/QuizButton/QuizButton.d.ts +1 -1
  192. package/dist/SideMenu/types.d.ts +3 -3
  193. package/dist/SkipToContent/SkipToContent.d.ts +1 -1
  194. package/dist/Table/TableTypes.d.ts +4 -4
  195. package/dist/Tabs/TabLink.d.ts +1 -1
  196. package/dist/Tabs/Tabs.d.ts +1 -1
  197. package/dist/Tag/Tag.cjs +3 -5
  198. package/dist/Tag/Tag.cjs.map +1 -1
  199. package/dist/Tag/Tag.d.ts +2 -2
  200. package/dist/Tag/Tag.js +3 -5
  201. package/dist/Tag/Tag.js.map +1 -1
  202. package/dist/Tile/TileTypes.d.ts +8 -8
  203. package/dist/Toasters/Toast.d.ts +2 -2
  204. package/dist/Toasters/ToastContext.d.ts +2 -2
  205. package/dist/Tooltips/TooltipStyles.cjs +3 -1
  206. package/dist/Tooltips/TooltipStyles.cjs.map +1 -1
  207. package/dist/Tooltips/TooltipStyles.d.ts +1 -0
  208. package/dist/Tooltips/TooltipStyles.js +3 -1
  209. package/dist/Tooltips/TooltipStyles.js.map +1 -1
  210. package/dist/assets/index.d.ts +1 -1
  211. package/dist/icons/index.d.ts +2 -2
  212. package/dist/styles/typography.cjs +2 -1
  213. package/dist/styles/typography.cjs.map +1 -1
  214. package/dist/styles/typography.d.ts +3 -2
  215. package/dist/styles/typography.js +1 -1
  216. package/dist/styles/typography.js.map +1 -1
  217. package/dist/types.cjs.map +1 -1
  218. package/dist/types.d.ts +3 -0
  219. package/dist/types.js.map +1 -1
  220. package/package.json +10 -13
@@ -1 +1 @@
1
- {"version":3,"file":"MobileMenu.cjs","names":["Wrapper","styled","div","Z_INDEXES","off_canvas","BREAKPOINTS","SMALL","SwitcherLabel","MobileFooter","COLORS","neutral_200","ComponentXSStyling","ComponentTextStyle","Bold","neutral_600","ComponentSStyling","CustomContent","MobileMenu","show","profile","buttons","label","header","items","footer","action","onClose","useStackState","reset","length","push","pop","peek","isMediumScreen","useMediaMatch","LARGE","replace","location","useLocation","onSubMenuOpen","menu","type","content","customContent","custom","React","useEffect","setTimeout","current","switcher","find","a","undefined"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, Z_INDEXES} from '../../styles';\nimport {SwitchApp} from '../../icons/systemicons/SystemIcons';\nimport {useLocation} from 'react-router-dom';\nimport {IconButton} from '../../Button';\nimport {LaerdalLogo} from '../../assets';\nimport {\n MenuAccountInfo,\n MenuButton,\n MenuNavigationItemTypeGroup,\n MenuGroupFooter,\n MenuGroupHeader,\n MenuIconButton,\n MenuNavigationItemTypeItem,\n MobileNavigationMenuProps,\n ProfileMenu,\n MenuNavigationItemTypeSection,\n MobileMenuButtonTypes,\n MenuSwitcherButton,\n MenuNavigationCustomSubMenu\n} from '../types';\nimport MobileMenuHeader from './MobileMenuHeader';\nimport MobileMenuContent from './MobileMenuContent';\nimport {useStackState} from '../../common/StackState';\nimport {useMediaMatch} from \"rooks\";\n\nconst Wrapper = styled.div`\n width: 320px;\n z-index: ${Z_INDEXES.off_canvas};\n height: 100%;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n ${BREAKPOINTS.SMALL} {\n width: 400px;\n }\n`;\n\nconst SwitcherLabel = styled.div`\n margin-left: auto;\n`;\n\nconst MobileFooter = styled.div`\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 48px;\n\n padding: 0 4px 0 16px;\n border-top: 1px solid ${COLORS.neutral_200};\n\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n height: 56px;\n padding: 4px 8px 4px 16px;\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nconst CustomContent = styled.div`\n width: 100%;\n box-sizing: border-box;\n flex-flow: column;\n display: flex;\n flex: 1;\n overflow: hidden;\n`;\n\ntype Props = MobileNavigationMenuProps & {\n profile?: ProfileMenu;\n show?: boolean;\n onClose: () => void;\n};\n\ninterface MenuState {\n header: {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n }\n content?: {\n header?: MenuGroupHeader;\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection)[];\n footer?: MenuGroupFooter;\n action?: MenuButton;\n },\n customContent?: () => React.ReactNode;\n footer?: boolean;\n}\n\nconst MobileMenu = ({\n show,\n profile,\n buttons,\n label,\n header,\n items,\n footer,\n action,\n onClose,\n }: Props) => {\n\n const {reset, length, push, pop, peek} = useStackState<MenuState>();\n\n const isMediumScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\n\n const location = useLocation();\n\n const onSubMenuOpen = (menu?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => {\n\n switch (menu?.type) {\n case 'group':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n content: {\n header: menu.header,\n items: menu.items,\n footer: menu.footer,\n action: menu.action\n },\n footer: false\n });\n break;\n case 'custom':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n customContent: menu.custom,\n footer: false\n });\n break;\n default:\n break;\n }\n\n };\n\n React.useEffect(() => {\n onClose();\n }, [location]);\n\n React.useEffect(() => {\n isMediumScreen && onClose()\n }, [isMediumScreen]);\n\n React.useEffect(() => {\n setTimeout(() => {\n reset({\n footer: true,\n header: {\n label: label,\n buttons: buttons,\n },\n content: {\n header: header,\n items: items,\n footer: footer,\n action: action\n }\n })\n }, 300)\n }, [show])\n\n\n const current = peek();\n\n const switcher = current?.header?.buttons?.find(a => a.type === 'switcher') as MenuSwitcherButton;\n\n return (\n <Wrapper>\n <MobileMenuHeader buttons={current?.header.buttons}\n onGoBack={length > 1 ? pop : undefined}\n onSubMenuOpen={onSubMenuOpen}\n profile={profile}\n label={current?.header.label}\n onClose={onClose}/>\n {current?.customContent && <CustomContent>{current?.customContent()}</CustomContent>}\n {current?.content && <MobileMenuContent header={current?.content.header}\n items={current?.content.items}\n footer={current?.content.footer}\n action={current?.content.action}\n onSubMenuOpen={onSubMenuOpen}/>}\n\n {\n current?.footer &&\n <MobileFooter>\n <LaerdalLogo height={'36px'} width={'66px'}/>\n {switcher &&\n <>\n <SwitcherLabel className={'globalNav-toggler'}>Switch site</SwitcherLabel>\n <IconButton\n variant={'secondary'}\n shape={'circular'}\n id=\"globalNavAppsButton\"\n action={() => switcher.action && switcher.action() && onClose()}>\n <SwitchApp size=\"24px\"/>\n </IconButton>\n </>\n }\n\n </MobileFooter>\n }\n </Wrapper>\n );\n};\n\nexport default MobileMenu;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AAAoC;AAAA;AAAA;AAAA;AAEpC,IAAMA,OAAO,GAAGC,yBAAM,CAACC,GAAG,qQAEbC,iBAAS,CAACC,UAAU,EAQ7BC,mBAAW,CAACC,KAAK,CAGpB;AAED,IAAMC,aAAa,GAAGN,yBAAM,CAACC,GAAG,6GAE/B;AAED,IAAMM,YAAY,GAAGP,yBAAM,CAACC,GAAG,+TAOLO,cAAM,CAACC,WAAW,EAExC,IAAAC,0BAAkB,EAACC,0BAAkB,CAACC,IAAI,EAAEJ,cAAM,CAACK,WAAW,CAAC,EAC/DT,mBAAW,CAACC,KAAK,EAGf,IAAAS,yBAAiB,EAACH,0BAAkB,CAACC,IAAI,EAAEJ,cAAM,CAACK,WAAW,CAAC,CAEnE;AAED,IAAME,aAAa,GAAGf,yBAAM,CAACC,GAAG,2MAO/B;AAuBD,IAAMe,UAAU,GAAG,SAAbA,UAAU,OAUiB;EAAA;EAAA,IATXC,IAAI,QAAJA,IAAI;IACJC,OAAO,QAAPA,OAAO;IACPC,OAAO,QAAPA,OAAO;IACPC,KAAK,QAALA,KAAK;IACLC,MAAM,QAANA,MAAM;IACNC,KAAK,QAALA,KAAK;IACLC,MAAM,QAANA,MAAM;IACNC,MAAM,QAANA,MAAM;IACNC,OAAO,QAAPA,OAAO;EAG3B,qBAAyC,IAAAC,yBAAa,GAAa;IAA5DC,KAAK,kBAALA,KAAK;IAAEC,MAAM,kBAANA,MAAM;IAAEC,IAAI,kBAAJA,IAAI;IAAEC,GAAG,kBAAHA,GAAG;IAAEC,IAAI,kB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E0B,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEN,OAAO,CAACnB,KAAM;MAC9B,MAAM,EAAEyB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEN,OAAO,CAAClB,MAAO;MAChC,MAAM,EAAEwB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEN,OAAO,CAACjB,MAAO;MAChC,aAAa,EAAEc;IAAc,EAAE,EAGrE,CAAAS,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAExB,MAAM,kBACf,sBAAC,YAAY;MAAA,wBACX,qBAAC,mBAAW;QAAC,MAAM,EAAE,MAAO;QAAC,KAAK,EAAE;MAAO,EAAE,EAC5CyB,QAAQ,iBACP;QAAA,wBACE,qBAAC,aAAa;UAAC,SAAS,EAAE,mBAAoB;UAAA;QAAA,EAA4B,eAC1E,qBAAC,kBAAU;UACT,OAAO,EAAE,WAAY;UACrB,KAAK,EAAE,UAAW;UAClB,EAAE,EAAC,qBAAqB;UACxB,MAAM,EAAE;YAAA,OAAMA,QAAQ,CAACxB,MAAM,IAAIwB,QAAQ,CAACxB,MAAM,EAAE,IAAIC,OAAO,EAAE;UAAA,CAAC;UAAA,uBAChE,qBAAC,sBAAS;YAAC,IAAI,EAAC;UAAM;QAAE,EACb;MAAA,EACZ;IAAA,EAGQ;EAAA,EAET;AAEd,CAAC;AAAC;EA1IAR,IAAI;EACJQ,OAAO;AAAA;AAAA,eA2IMT,UAAU;AAAA"}
1
+ {"version":3,"file":"MobileMenu.cjs","names":["Wrapper","styled","div","Z_INDEXES","off_canvas","BREAKPOINTS","SMALL","SwitcherLabel","MobileFooter","COLORS","neutral_200","ComponentXSStyling","ComponentTextStyle","Bold","neutral_600","ComponentSStyling","CustomContent","MobileMenu","show","profile","buttons","label","header","items","footer","action","onClose","useStackState","reset","length","push","pop","peek","isMediumScreen","useMediaMatch","LARGE","replace","location","useLocation","onSubMenuOpen","menu","type","content","customContent","custom","React","useEffect","setTimeout","current","switcher","find","a","undefined"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, Z_INDEXES} from '../../styles';\nimport {SwitchApp} from '../../icons/systemicons/SystemIcons';\nimport {useLocation} from 'react-router-dom';\nimport {IconButton} from '../../Button';\nimport {LaerdalLogo} from '../../assets';\nimport {\n MenuAccountInfo,\n MenuButton,\n MenuNavigationItemTypeGroup,\n MenuGroupFooter,\n MenuGroupHeader,\n MenuIconButton,\n MenuNavigationItemTypeItem,\n MobileNavigationMenuProps,\n ProfileMenu,\n MenuNavigationItemTypeSection,\n MobileMenuButtonTypes,\n MenuSwitcherButton,\n MenuNavigationCustomSubMenu\n} from '../types';\nimport MobileMenuHeader from './MobileMenuHeader';\nimport MobileMenuContent from './MobileMenuContent';\nimport {useStackState} from '../../common/StackState';\nimport {useMediaMatch} from \"rooks\";\n\nconst Wrapper = styled.div`\n width: 320px;\n z-index: ${Z_INDEXES.off_canvas};\n height: 100%;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n ${BREAKPOINTS.SMALL} {\n width: 400px;\n }\n`;\n\nconst SwitcherLabel = styled.div`\n margin-left: auto;\n`;\n\nconst MobileFooter = styled.div`\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 48px;\n\n padding: 0 4px 0 16px;\n border-top: 1px solid ${COLORS.neutral_200};\n\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n height: 56px;\n padding: 4px 8px 4px 16px;\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nconst CustomContent = styled.div`\n width: 100%;\n box-sizing: border-box;\n flex-flow: column;\n display: flex;\n flex: 1;\n overflow: hidden;\n`;\n\ntype Props = MobileNavigationMenuProps & {\n profile?: ProfileMenu;\n show?: boolean;\n onClose: () => void;\n};\n\ninterface MenuState {\n header: {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n }\n content?: {\n header?: MenuGroupHeader;\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection)[];\n footer?: MenuGroupFooter;\n action?: MenuButton;\n },\n customContent?: () => React.ReactNode;\n footer?: boolean;\n}\n\nconst MobileMenu = ({\n show,\n profile,\n buttons,\n label,\n header,\n items,\n footer,\n action,\n onClose,\n }: Props) => {\n\n const {reset, length, push, pop, peek} = useStackState<MenuState>();\n\n const isMediumScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\n\n const location = useLocation();\n\n const onSubMenuOpen = (menu?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => {\n\n switch (menu?.type) {\n case 'group':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n content: {\n header: menu.header,\n items: menu.items,\n footer: menu.footer,\n action: menu.action\n },\n footer: false\n });\n break;\n case 'custom':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n customContent: menu.custom,\n footer: false\n });\n break;\n default:\n break;\n }\n\n };\n\n React.useEffect(() => {\n onClose();\n }, [location]);\n\n React.useEffect(() => {\n isMediumScreen && onClose()\n }, [isMediumScreen]);\n\n React.useEffect(() => {\n setTimeout(() => {\n reset({\n footer: true,\n header: {\n label: label,\n buttons: buttons,\n },\n content: {\n header: header,\n items: items,\n footer: footer,\n action: action\n }\n })\n }, 300)\n }, [show])\n\n\n const current = peek();\n\n const switcher = current?.header?.buttons?.find(a => a.type === 'switcher') as MenuSwitcherButton;\n\n return (\n <Wrapper>\n <MobileMenuHeader buttons={current?.header.buttons}\n onGoBack={length > 1 ? pop : undefined}\n onSubMenuOpen={onSubMenuOpen}\n profile={profile}\n label={current?.header.label}\n onClose={onClose}/>\n {current?.customContent && <CustomContent>{current?.customContent()}</CustomContent>}\n {current?.content && <MobileMenuContent header={current?.content.header}\n items={current?.content.items}\n footer={current?.content.footer}\n action={current?.content.action}\n onSubMenuOpen={onSubMenuOpen}/>}\n\n {\n current?.footer &&\n <MobileFooter>\n <LaerdalLogo height={'36px'} width={'66px'}/>\n {switcher &&\n <>\n <SwitcherLabel className={'globalNav-toggler'} onClick={() => switcher.action && switcher.action() && onClose()}>Switch site</SwitcherLabel>\n <IconButton\n variant={'secondary'}\n shape={'circular'}\n id=\"globalNavAppsButton\"\n action={() => switcher.action && switcher.action() && onClose()}>\n <SwitchApp size=\"24px\"/>\n </IconButton>\n </>\n }\n\n </MobileFooter>\n }\n </Wrapper>\n );\n};\n\nexport default MobileMenu;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAgBA;AACA;AACA;AACA;AAAoC;AAAA;AAAA;AAAA;AAEpC,IAAMA,OAAO,GAAGC,yBAAM,CAACC,GAAG,qQAEbC,iBAAS,CAACC,UAAU,EAQ7BC,mBAAW,CAACC,KAAK,CAGpB;AAED,IAAMC,aAAa,GAAGN,yBAAM,CAACC,GAAG,6GAE/B;AAED,IAAMM,YAAY,GAAGP,yBAAM,CAACC,GAAG,+TAOLO,cAAM,CAACC,WAAW,EAExC,IAAAC,0BAAkB,EAACC,0BAAkB,CAACC,IAAI,EAAEJ,cAAM,CAACK,WAAW,CAAC,EAC/DT,mBAAW,CAACC,KAAK,EAGf,IAAAS,yBAAiB,EAACH,0BAAkB,CAACC,IAAI,EAAEJ,cAAM,CAACK,WAAW,CAAC,CAEnE;AAED,IAAME,aAAa,GAAGf,yBAAM,CAACC,GAAG,2MAO/B;AAuBD,IAAMe,UAAU,GAAG,SAAbA,UAAU,OAUiB;EAAA;EAAA,IATXC,IAAI,QAAJA,IAAI;IACJC,OAAO,QAAPA,OAAO;IACPC,OAAO,QAAPA,OAAO;IACPC,KAAK,QAALA,KAAK;IACLC,MAAM,QAANA,MAAM;IACNC,KAAK,QAALA,KAAK;IACLC,MAAM,QAANA,MAAM;IACNC,MAAM,QAANA,MAAM;IAC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
  import { MobileNavigationMenuProps, ProfileMenu } from '../types';
2
- declare type Props = MobileNavigationMenuProps & {
2
+ type Props = MobileNavigationMenuProps & {
3
3
  profile?: ProfileMenu;
4
4
  show?: boolean;
5
5
  onClose: () => void;
@@ -119,6 +119,9 @@ var MobileMenu = function MobileMenu(_ref) {
119
119
  }), switcher && /*#__PURE__*/_jsxs(_Fragment, {
120
120
  children: [/*#__PURE__*/_jsx(SwitcherLabel, {
121
121
  className: 'globalNav-toggler',
122
+ onClick: function onClick() {
123
+ return switcher.action && switcher.action() && onClose();
124
+ },
122
125
  children: "Switch site"
123
126
  }), /*#__PURE__*/_jsx(IconButton, {
124
127
  variant: 'secondary',
@@ -1 +1 @@
1
- {"version":3,"file":"MobileMenu.js","names":["React","styled","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","SwitchApp","useLocation","IconButton","LaerdalLogo","MobileMenuHeader","MobileMenuContent","useStackState","useMediaMatch","Wrapper","div","off_canvas","SMALL","SwitcherLabel","MobileFooter","neutral_200","Bold","neutral_600","CustomContent","MobileMenu","show","profile","buttons","label","header","items","footer","action","onClose","reset","length","push","pop","peek","isMediumScreen","LARGE","replace","location","onSubMenuOpen","menu","type","content","customContent","custom","useEffect","setTimeout","current","switcher","find","a","undefined"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, Z_INDEXES} from '../../styles';\nimport {SwitchApp} from '../../icons/systemicons/SystemIcons';\nimport {useLocation} from 'react-router-dom';\nimport {IconButton} from '../../Button';\nimport {LaerdalLogo} from '../../assets';\nimport {\n MenuAccountInfo,\n MenuButton,\n MenuNavigationItemTypeGroup,\n MenuGroupFooter,\n MenuGroupHeader,\n MenuIconButton,\n MenuNavigationItemTypeItem,\n MobileNavigationMenuProps,\n ProfileMenu,\n MenuNavigationItemTypeSection,\n MobileMenuButtonTypes,\n MenuSwitcherButton,\n MenuNavigationCustomSubMenu\n} from '../types';\nimport MobileMenuHeader from './MobileMenuHeader';\nimport MobileMenuContent from './MobileMenuContent';\nimport {useStackState} from '../../common/StackState';\nimport {useMediaMatch} from \"rooks\";\n\nconst Wrapper = styled.div`\n width: 320px;\n z-index: ${Z_INDEXES.off_canvas};\n height: 100%;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n ${BREAKPOINTS.SMALL} {\n width: 400px;\n }\n`;\n\nconst SwitcherLabel = styled.div`\n margin-left: auto;\n`;\n\nconst MobileFooter = styled.div`\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 48px;\n\n padding: 0 4px 0 16px;\n border-top: 1px solid ${COLORS.neutral_200};\n\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n height: 56px;\n padding: 4px 8px 4px 16px;\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nconst CustomContent = styled.div`\n width: 100%;\n box-sizing: border-box;\n flex-flow: column;\n display: flex;\n flex: 1;\n overflow: hidden;\n`;\n\ntype Props = MobileNavigationMenuProps & {\n profile?: ProfileMenu;\n show?: boolean;\n onClose: () => void;\n};\n\ninterface MenuState {\n header: {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n }\n content?: {\n header?: MenuGroupHeader;\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection)[];\n footer?: MenuGroupFooter;\n action?: MenuButton;\n },\n customContent?: () => React.ReactNode;\n footer?: boolean;\n}\n\nconst MobileMenu = ({\n show,\n profile,\n buttons,\n label,\n header,\n items,\n footer,\n action,\n onClose,\n }: Props) => {\n\n const {reset, length, push, pop, peek} = useStackState<MenuState>();\n\n const isMediumScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\n\n const location = useLocation();\n\n const onSubMenuOpen = (menu?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => {\n\n switch (menu?.type) {\n case 'group':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n content: {\n header: menu.header,\n items: menu.items,\n footer: menu.footer,\n action: menu.action\n },\n footer: false\n });\n break;\n case 'custom':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n customContent: menu.custom,\n footer: false\n });\n break;\n default:\n break;\n }\n\n };\n\n React.useEffect(() => {\n onClose();\n }, [location]);\n\n React.useEffect(() => {\n isMediumScreen && onClose()\n }, [isMediumScreen]);\n\n React.useEffect(() => {\n setTimeout(() => {\n reset({\n footer: true,\n header: {\n label: label,\n buttons: buttons,\n },\n content: {\n header: header,\n items: items,\n footer: footer,\n action: action\n }\n })\n }, 300)\n }, [show])\n\n\n const current = peek();\n\n const switcher = current?.header?.buttons?.find(a => a.type === 'switcher') as MenuSwitcherButton;\n\n return (\n <Wrapper>\n <MobileMenuHeader buttons={current?.header.buttons}\n onGoBack={length > 1 ? pop : undefined}\n onSubMenuOpen={onSubMenuOpen}\n profile={profile}\n label={current?.header.label}\n onClose={onClose}/>\n {current?.customContent && <CustomContent>{current?.customContent()}</CustomContent>}\n {current?.content && <MobileMenuContent header={current?.content.header}\n items={current?.content.items}\n footer={current?.content.footer}\n action={current?.content.action}\n onSubMenuOpen={onSubMenuOpen}/>}\n\n {\n current?.footer &&\n <MobileFooter>\n <LaerdalLogo height={'36px'} width={'66px'}/>\n {switcher &&\n <>\n <SwitcherLabel className={'globalNav-toggler'}>Switch site</SwitcherLabel>\n <IconButton\n variant={'secondary'}\n shape={'circular'}\n id=\"globalNavAppsButton\"\n action={() => switcher.action && switcher.action() && onClose()}>\n <SwitchApp size=\"24px\"/>\n </IconButton>\n </>\n }\n\n </MobileFooter>\n }\n </Wrapper>\n );\n};\n\nexport default MobileMenu;\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,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AAEK,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEL,OAAO,CAACjB,MAAO;MAChC,KAAK,EAAEsB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEL,OAAO,CAAChB,KAAM;MAC9B,MAAM,EAAEqB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEL,OAAO,CAACf,MAAO;MAChC,MAAM,EAAEoB,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEL,OAAO,CAACd,MAAO;MAChC,aAAa,EAAEW;IAAc,EAAE,EAGrE,CAAAQ,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEpB,MAAM,kBACf,MAAC,YAAY;MAAA,wBACX,KAAC,WAAW;QAAC,MAAM,EAAE,MAAO;QAAC,KAAK,EAAE;MAAO,EAAE,EAC5CqB,QAAQ,iBACP;QAAA,wBACE,KAAC,aAAa;UAAC,SAAS,EAAE,mBAAoB;UAAA;QAAA,EAA4B,eAC1E,KAAC,UAAU;UACT,OAAO,EAAE,WAAY;UACrB,KAAK,EAAE,UAAW;UAClB,EAAE,EAAC,qBAAqB;UACxB,MAAM,EAAE;YAAA,OAAMA,QAAQ,CAACpB,MAAM,IAAIoB,QAAQ,CAACpB,MAAM,EAAE,IAAIC,OAAO,EAAE;UAAA,CAAC;UAAA,uBAChE,KAAC,SAAS;YAAC,IAAI,EAAC;UAAM;QAAE,EACb;MAAA,EACZ;IAAA,EAGQ;EAAA,EAET;AAEd,CAAC;AAAC;EA1IAR,IAAI;EACJQ,OAAO;AAAA;AA2IT,eAAeT,UAAU"}
1
+ {"version":3,"file":"MobileMenu.js","names":["React","styled","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","Z_INDEXES","SwitchApp","useLocation","IconButton","LaerdalLogo","MobileMenuHeader","MobileMenuContent","useStackState","useMediaMatch","Wrapper","div","off_canvas","SMALL","SwitcherLabel","MobileFooter","neutral_200","Bold","neutral_600","CustomContent","MobileMenu","show","profile","buttons","label","header","items","footer","action","onClose","reset","length","push","pop","peek","isMediumScreen","LARGE","replace","location","onSubMenuOpen","menu","type","content","customContent","custom","useEffect","setTimeout","current","switcher","find","a","undefined"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling, Z_INDEXES} from '../../styles';\nimport {SwitchApp} from '../../icons/systemicons/SystemIcons';\nimport {useLocation} from 'react-router-dom';\nimport {IconButton} from '../../Button';\nimport {LaerdalLogo} from '../../assets';\nimport {\n MenuAccountInfo,\n MenuButton,\n MenuNavigationItemTypeGroup,\n MenuGroupFooter,\n MenuGroupHeader,\n MenuIconButton,\n MenuNavigationItemTypeItem,\n MobileNavigationMenuProps,\n ProfileMenu,\n MenuNavigationItemTypeSection,\n MobileMenuButtonTypes,\n MenuSwitcherButton,\n MenuNavigationCustomSubMenu\n} from '../types';\nimport MobileMenuHeader from './MobileMenuHeader';\nimport MobileMenuContent from './MobileMenuContent';\nimport {useStackState} from '../../common/StackState';\nimport {useMediaMatch} from \"rooks\";\n\nconst Wrapper = styled.div`\n width: 320px;\n z-index: ${Z_INDEXES.off_canvas};\n height: 100%;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n ${BREAKPOINTS.SMALL} {\n width: 400px;\n }\n`;\n\nconst SwitcherLabel = styled.div`\n margin-left: auto;\n`;\n\nconst MobileFooter = styled.div`\n display: flex;\n align-items: center;\n box-sizing: border-box;\n height: 48px;\n\n padding: 0 4px 0 16px;\n border-top: 1px solid ${COLORS.neutral_200};\n\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n height: 56px;\n padding: 4px 8px 4px 16px;\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nconst CustomContent = styled.div`\n width: 100%;\n box-sizing: border-box;\n flex-flow: column;\n display: flex;\n flex: 1;\n overflow: hidden;\n`;\n\ntype Props = MobileNavigationMenuProps & {\n profile?: ProfileMenu;\n show?: boolean;\n onClose: () => void;\n};\n\ninterface MenuState {\n header: {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n }\n content?: {\n header?: MenuGroupHeader;\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection)[];\n footer?: MenuGroupFooter;\n action?: MenuButton;\n },\n customContent?: () => React.ReactNode;\n footer?: boolean;\n}\n\nconst MobileMenu = ({\n show,\n profile,\n buttons,\n label,\n header,\n items,\n footer,\n action,\n onClose,\n }: Props) => {\n\n const {reset, length, push, pop, peek} = useStackState<MenuState>();\n\n const isMediumScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\n\n const location = useLocation();\n\n const onSubMenuOpen = (menu?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => {\n\n switch (menu?.type) {\n case 'group':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n content: {\n header: menu.header,\n items: menu.items,\n footer: menu.footer,\n action: menu.action\n },\n footer: false\n });\n break;\n case 'custom':\n push({\n header: {\n label: menu.label,\n buttons: menu.buttons,\n },\n customContent: menu.custom,\n footer: false\n });\n break;\n default:\n break;\n }\n\n };\n\n React.useEffect(() => {\n onClose();\n }, [location]);\n\n React.useEffect(() => {\n isMediumScreen && onClose()\n }, [isMediumScreen]);\n\n React.useEffect(() => {\n setTimeout(() => {\n reset({\n footer: true,\n header: {\n label: label,\n buttons: buttons,\n },\n content: {\n header: header,\n items: items,\n footer: footer,\n action: action\n }\n })\n }, 300)\n }, [show])\n\n\n const current = peek();\n\n const switcher = current?.header?.buttons?.find(a => a.type === 'switcher') as MenuSwitcherButton;\n\n return (\n <Wrapper>\n <MobileMenuHeader buttons={current?.header.buttons}\n onGoBack={length > 1 ? pop : undefined}\n onSubMenuOpen={onSubMenuOpen}\n profile={profile}\n label={current?.header.label}\n onClose={onClose}/>\n {current?.customContent && <CustomContent>{current?.customContent()}</CustomContent>}\n {current?.content && <MobileMenuContent header={current?.content.header}\n items={current?.content.items}\n footer={current?.content.footer}\n action={current?.content.action}\n onSubMenuOpen={onSubMenuOpen}/>}\n\n {\n current?.footer &&\n <MobileFooter>\n <LaerdalLogo height={'36px'} width={'66px'}/>\n {switcher &&\n <>\n <SwitcherLabel className={'globalNav-toggler'} onClick={() => switcher.action && switcher.action() && onClose()}>Switch site</SwitcherLabel>\n <IconButton\n variant={'secondary'}\n shape={'circular'}\n id=\"globalNavAppsButton\"\n action={() => switcher.action && switcher.action() && onClose()}>\n <SwitchApp size=\"24px\"/>\n </IconButton>\n </>\n }\n\n </MobileFooter>\n }\n </Wrapper>\n );\n};\n\nexport default MobileMenu;\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAAQC,WAAW,EAAEC,MAAM,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,kBAAkB,EAAEC,SAAS,QAAO,cAAc;AACtH,SAAQC,SAAS,QAAO,qCAAqC;AAC7D,SAAQC,WAAW,QAAO,kBAAkB;AAC5C,SAAQC,UAAU,QAAO,cAAc;AACvC,SAAQC,WAAW,QAAO,cAAc;AAgBxC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,iBAAiB,MAAM,qBAAqB;AACnD,SAAQC,aAAa,QAAO,yBAAyB;AACrD,SAAQC,aAAa,QAAO,OAAO;AAAC;AAAA;AAAA;AAEpC,IAAMC,OAAO,GAAGf,MAAM,CAACgB,GAAG,uPAEbV,SAAS,CAACW,UAAU,EAQ7BhB,WAAW,CAACiB,KAAK,CAGpB;AAED,IAAMC,aAAa,GAAGnB,MAAM,CAACgB,GAAG,+FAE/B;AAED,IAAMI,YAAY,GAAGpB,MAAM,CAACgB,GAAG,iTAOLd,MAAM,CAACmB,WAAW,EAExChB,kBAAk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AAO,EAAE;UAAA,CAAC;UAAA;QAAA,EAA4B,eAC5I,KAAC,UAAU;UACT,OAAO,EAAE,WAAY;UACrB,KAAK,EAAE,UAAW;UAClB,EAAE,EAAC,qBAAqB;UACxB,MAAM,EAAE;YAAA,OAAMmB,QAAQ,CAACpB,MAAM,IAAIoB,QAAQ,CAACpB,MAAM,EAAE,IAAIC,OAAO,EAAE;UAAA,CAAC;UAAA,uBAChE,KAAC,SAAS;YAAC,IAAI,EAAC;UAAM;QAAE,EACb;MAAA,EACZ;IAAA,EAGQ;EAAA,EAET;AAEd,CAAC;AAAC;EA1IAR,IAAI;EACJQ,OAAO;AAAA;AA2IT,eAAeT,UAAU"}
@@ -67,14 +67,14 @@ var MobileMenuHeader = function MobileMenuHeader(_ref) {
67
67
  type = item.type,
68
68
  action = item.action,
69
69
  rest = (0, _objectWithoutProperties2.default)(item, _excluded);
70
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileButton.ProfileButton, _objectSpread({
70
+ if (!!profile) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProfileButton.ProfileButton, _objectSpread({
71
71
  onClick: function onClick(e) {
72
72
  e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
73
73
  item.action ? item.action(e === null || e === void 0 ? void 0 : e.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu());
74
74
  },
75
75
  icon: !profile && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.User, {}),
76
76
  initials: ((_profile$user$firstNa = profile === null || profile === void 0 ? void 0 : (_profile$user = profile.user) === null || _profile$user === void 0 ? void 0 : (_profile$user$firstNa2 = _profile$user.firstName) === null || _profile$user$firstNa2 === void 0 ? void 0 : _profile$user$firstNa2.charAt(0)) !== null && _profile$user$firstNa !== void 0 ? _profile$user$firstNa : '') + ((_profile$user$lastNam = profile === null || profile === void 0 ? void 0 : (_profile$user2 = profile.user) === null || _profile$user2 === void 0 ? void 0 : (_profile$user2$lastNa = _profile$user2.lastName) === null || _profile$user2$lastNa === void 0 ? void 0 : _profile$user2$lastNa.charAt(0)) !== null && _profile$user$lastNam !== void 0 ? _profile$user$lastNam : '')
77
- }, rest), index);
77
+ }, rest), index);else return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
78
78
  }
79
79
  case 'submenu':
80
80
  {
@@ -1 +1 @@
1
- {"version":3,"file":"MobileMenuHeader.cjs","names":["MobileMenuHeaderActions","styled","div","MobileMenuHeaderLabel","ComponentXSStyling","ComponentTextStyle","Bold","COLORS","neutral_600","BREAKPOINTS","SMALL","ComponentSStyling","MobileMenuHeaderWrapper","Breakpoints","LARGE","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","placement","rest","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","marginLeft"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.LARGE} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n }\n case 'submenu': {\n const {placement, type, icon, menu, ...rest} = item;\n\n return <IconButton key={index}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"mappings":";;;;;;;;;;;AAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AAAkD;AAAA;EAAA;EAAA;AAAA;AAAA;AAAA;AAE3C,IAAMA,uBAAuB,GAAGC,yBAAM,CAACC,GAAG,yKAKhD;AAAC;AACF,IAAMC,qBAAqB,GAAGF,yBAAM,CAACC,GAAG,yHACpC,IAAAE,0BAAkB,EAACC,0BAAkB,CAACC,IAAI,EAAEC,cAAM,CAACC,WAAW,CAAC,EAC/DC,mBAAW,CAACC,KAAK,EACf,IAAAC,yBAAiB,EAACN,0BAAkB,CAACC,IAAI,EAAEC,cAAM,CAACC,WAAW,CAAC,CAEnE;AAEM,IAAMI,uBAAuB,GAAGX,yBAAM,CAACC,GAAG,0PAM7CW,oBAAW,CAACH,KAAK,EAIjBG,oBAAW,CAACC,KAAK,CAGpB;AAAA;AAcD,IAAMC,gBAAgE,GAAG,SAAnEA,gBAAgE,OAOU;EAAA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AU,CAAC,EAG5DtB,KAAK,iBACL,qBAAC,qBAAqB;MAAA,UAAEA;IAAK,EAAyB,eAExD,sBAAC,uBAAuB;MAAA,WAEpBE,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE+B,MAAM,CAAC,UAAAb,CAAC;QAAA,OAAIA,CAAC,CAACK,SAAS,KAAK,MAAM;MAAA,EAAC,CAACN,GAAG,CAACG,UAAU,CAAC,EAI5DvB,OAAO,iBACP;QAAK,KAAK,EAAE;UAACmC,UAAU,EAAE;QAAK,CAAE;QAAA,uBAC9B,qBAAC,kBAAU;UAAC,OAAO,EAAE,WAAY;UACrB,MAAM,EAAE,gBAAAP,CAAC,EAAI;YACXA,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,WAAW,CAACC,wBAAwB,EAAE;YACzC9B,OAAO,EAAE;UACX,CAAE;UACF,KAAK,EAAE,UAAW;UAAA,uBAC5B,qBAAC,kBAAW,CAAC,KAAK;QAAE;MACT,EACT;IAAA,EAEgB;EAAA,EAEF;AAE9B,CAAC;AAAC;EA3HAD,QAAQ;EACRC,OAAO;EACPC,KAAK;EAGLE,OAAO;EAEPC,aAAa;AAAA;AAAA,eAuHAN,gBAAgB;AAAA"}
1
+ {"version":3,"file":"MobileMenuHeader.cjs","names":["MobileMenuHeaderActions","styled","div","MobileMenuHeaderLabel","ComponentXSStyling","ComponentTextStyle","Bold","COLORS","neutral_600","BREAKPOINTS","SMALL","ComponentSStyling","MobileMenuHeaderWrapper","Breakpoints","LARGE","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","placement","rest","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","marginLeft"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.LARGE} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n if(!!profile)\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n else return <></>\n \n }\n case 'submenu': {\n const {placement, type, icon, menu, ...rest} = item;\n\n return <IconButton key={index}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"mappings":";;;;;;;;;;;AAAA;AAMA;AACA;AACA;A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C;AAAC;EA9HAD,QAAQ;EACRC,OAAO;EACPC,KAAK;EAGLE,OAAO;EAEPC,aAAa;AAAA;AAAA,eA0HAN,gBAAgB;AAAA"}
@@ -16,6 +16,7 @@ import { SystemIcons } from '../../icons';
16
16
  import { BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling } from '../../styles';
17
17
  import { ProfileButton } from '../../ProfileButton';
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { Fragment as _Fragment } from "react/jsx-runtime";
19
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
21
  export var MobileMenuHeaderActions = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n"])));
21
22
  var MobileMenuHeaderLabel = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", " {\n ", "\n }\n"])), ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600), BREAKPOINTS.SMALL, ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600));
@@ -59,14 +60,14 @@ var MobileMenuHeader = function MobileMenuHeader(_ref) {
59
60
  type = item.type,
60
61
  action = item.action,
61
62
  rest = _objectWithoutProperties(item, _excluded);
62
- return /*#__PURE__*/_jsx(ProfileButton, _objectSpread({
63
+ if (!!profile) return /*#__PURE__*/_jsx(ProfileButton, _objectSpread({
63
64
  onClick: function onClick(e) {
64
65
  e === null || e === void 0 ? void 0 : e.nativeEvent.stopImmediatePropagation();
65
66
  item.action ? item.action(e === null || e === void 0 ? void 0 : e.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu());
66
67
  },
67
68
  icon: !profile && /*#__PURE__*/_jsx(SystemIcons.User, {}),
68
69
  initials: ((_profile$user$firstNa = profile === null || profile === void 0 ? void 0 : (_profile$user = profile.user) === null || _profile$user === void 0 ? void 0 : (_profile$user$firstNa2 = _profile$user.firstName) === null || _profile$user$firstNa2 === void 0 ? void 0 : _profile$user$firstNa2.charAt(0)) !== null && _profile$user$firstNa !== void 0 ? _profile$user$firstNa : '') + ((_profile$user$lastNam = profile === null || profile === void 0 ? void 0 : (_profile$user2 = profile.user) === null || _profile$user2 === void 0 ? void 0 : (_profile$user2$lastNa = _profile$user2.lastName) === null || _profile$user2$lastNa === void 0 ? void 0 : _profile$user2$lastNa.charAt(0)) !== null && _profile$user$lastNam !== void 0 ? _profile$user$lastNam : '')
69
- }, rest), index);
70
+ }, rest), index);else return /*#__PURE__*/_jsx(_Fragment, {});
70
71
  }
71
72
  case 'submenu':
72
73
  {
@@ -1 +1 @@
1
- {"version":3,"file":"MobileMenuHeader.js","names":["React","styled","Breakpoints","IconButton","SystemIcons","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ProfileButton","MobileMenuHeaderActions","div","MobileMenuHeaderLabel","Bold","neutral_600","SMALL","MobileMenuHeaderWrapper","LARGE","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","placement","rest","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","marginLeft"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.LARGE} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n }\n case 'submenu': {\n const {placement, type, icon, menu, ...rest} = item;\n\n return <IconButton key={index}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAMzB,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,WAAW,MAAM,0BAA0B;AAClD,SAAQC,UAAU,QAAO,cAAc;AACvC,SAAQC,WAAW,QAAO,aAAa;AACvC,SAAQC,WAAW,EAAEC,MAAM,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,kBAAkB,QAAO,cAAc;AAC3G,SAAQC,aAAa,QAAO,qBAAqB;AAAC;AAAA;AAElD,OAAO,IAAMC,uBAAuB,GAAGV,MAAM,CAACW,GAAG,2JAKhD;AACD,IAAMC,qBAAqB,GA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I;QACvBA,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,WAAW,CAACC,wBAAwB,EAAE;QACzC/B,QAAQ,EAAE;MACZ,CAAE;MACU,OAAO,EAAE,WAAY;MACrB,KAAK,EAAE,UAAW;MAAA,uBAC5B,KAAC,WAAW,CAAC,aAAa;IAAE,EACjB,EAGbI,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE+B,MAAM,CAAC,UAAAb,CAAC;MAAA,OAAIA,CAAC,CAACK,SAAS,KAAK,MAAM;IAAA,EAAC,CAACN,GAAG,CAACG,UAAU,CAAC,EAG5DtB,KAAK,iBACL,KAAC,qBAAqB;MAAA,UAAEA;IAAK,EAAyB,eAExD,MAAC,uBAAuB;MAAA,WAEpBE,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE+B,MAAM,CAAC,UAAAb,CAAC;QAAA,OAAIA,CAAC,CAACK,SAAS,KAAK,MAAM;MAAA,EAAC,CAACN,GAAG,CAACG,UAAU,CAAC,EAI5DvB,OAAO,iBACP;QAAK,KAAK,EAAE;UAACmC,UAAU,EAAE;QAAK,CAAE;QAAA,uBAC9B,KAAC,UAAU;UAAC,OAAO,EAAE,WAAY;UACrB,MAAM,EAAE,gBAAAP,CAAC,EAAI;YACXA,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,WAAW,CAACC,wBAAwB,EAAE;YACzC9B,OAAO,EAAE;UACX,CAAE;UACF,KAAK,EAAE,UAAW;UAAA,uBAC5B,KAAC,WAAW,CAAC,KAAK;QAAE;MACT,EACT;IAAA,EAEgB;EAAA,EAEF;AAE9B,CAAC;AAAC;EA3HAD,QAAQ;EACRC,OAAO;EACPC,KAAK;EAGLE,OAAO;EAEPC,aAAa;AAAA;AAuHf,eAAeN,gBAAgB"}
1
+ {"version":3,"file":"MobileMenuHeader.js","names":["React","styled","Breakpoints","IconButton","SystemIcons","BREAKPOINTS","COLORS","ComponentSStyling","ComponentTextStyle","ComponentXSStyling","ProfileButton","MobileMenuHeaderActions","div","MobileMenuHeaderLabel","Bold","neutral_600","SMALL","MobileMenuHeaderWrapper","LARGE","MobileMenuHeader","onGoBack","onClose","label","profile","buttons","onSubMenuOpen","buildProfileSubMenu","type","header","user","firstName","lastName","note","email","link","action","signOut","icon","disabled","items","sections","map","a","undefined","renderItem","item","index","placement","rest","e","nativeEvent","stopImmediatePropagation","target","charAt","menu","filter","marginLeft"],"sources":["../../../src/GlobalNavigationBar/mobile/MobileMenuHeader.tsx"],"sourcesContent":["import React from 'react';\nimport {\n MobileMenuButtonTypes,\n MenuNavigationItemTypeGroup,\n ProfileMenu, MenuNavigationCustomSubMenu\n} from '../types';\nimport styled from 'styled-components';\nimport Breakpoints from '../../styles/breakpoints';\nimport {IconButton} from '../../Button';\nimport {SystemIcons} from '../../icons';\nimport {BREAKPOINTS, COLORS, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../../styles';\nimport {ProfileButton} from '../../ProfileButton';\n\nexport const MobileMenuHeaderActions = styled.div`\n flex: 1;\n justify-content: flex-end;\n display: flex;\n flex-direction: row;\n`;\nconst MobileMenuHeaderLabel = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n ${BREAKPOINTS.SMALL} {\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n`;\n\nexport const MobileMenuHeaderWrapper = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 4px;\n\n ${Breakpoints.SMALL} {\n padding: 4px 8px;\n }\n\n ${Breakpoints.LARGE} {\n display: none;\n }\n`\n\ninterface MobileMenuHeaderProps {\n onGoBack?: () => void;\n onClose: () => void;\n label?: string;\n\n profile?: ProfileMenu\n buttons?: MobileMenuButtonTypes[];\n\n onSubMenuOpen?: (item?: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu) => void;\n}\n\n\nconst MobileMenuHeader: React.FunctionComponent<MobileMenuHeaderProps> = ({\n onGoBack,\n onClose,\n label,\n profile,\n buttons,\n onSubMenuOpen\n }) => {\n\n const buildProfileSubMenu = () => !!profile ? {\n type: 'group',\n label: profile.label,\n header: {\n header: profile.user.firstName + ' ' + profile.user.lastName,\n note: profile.user.email,\n link: profile.user.link\n },\n action: {\n label: profile.signOut?.label,\n action: profile.signOut?.action,\n icon: profile.signOut?.icon,\n disabled: profile.signOut?.disabled\n },\n items: profile.sections.map(a => ({...a, type: 'section'}))\n } as MenuNavigationItemTypeGroup : undefined\n\n const renderItem = (item: MobileMenuButtonTypes, index: number) => {\n switch (item.type) {\n case 'profile': {\n const {placement, type, action, ...rest} = item;\n if(!!profile)\n return <ProfileButton key={index}\n onClick={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action ? item.action(e?.target) && onClose() : onSubMenuOpen && onSubMenuOpen(buildProfileSubMenu())\n }}\n icon={!profile && <SystemIcons.User/>}\n initials={(profile?.user?.firstName?.charAt(0) ?? '') + (profile?.user?.lastName?.charAt(0) ?? '')}\n {...rest}/>\n else return <></>\n \n }\n case 'submenu': {\n const {placement, type, icon, menu, ...rest} = item;\n\n return <IconButton key={index}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onSubMenuOpen && onSubMenuOpen(item.menu)\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n case 'action': {\n const {placement, type, icon, action, ...rest} = item;\n return <IconButton key={index}\n disabled={item.disabled}\n variant={'secondary'}\n shape={'circular'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n item.action && item.action(e?.target) && onClose();\n }}\n {...rest}>\n {item.icon}\n </IconButton>\n }\n }\n }\n\n return (\n <MobileMenuHeaderWrapper>\n {\n onGoBack &&\n <IconButton action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onGoBack();\n }}\n variant={'secondary'}\n shape={'circular'}>\n <SystemIcons.ArrowLineLeft/>\n </IconButton>\n }\n {\n buttons?.filter(a => a.placement === 'left').map(renderItem)\n }\n {\n label &&\n <MobileMenuHeaderLabel>{label}</MobileMenuHeaderLabel>\n }\n <MobileMenuHeaderActions>\n {\n buttons?.filter(a => a.placement !== 'left').map(renderItem)\n }\n\n {\n onClose &&\n <div style={{marginLeft: '8px'}}>\n <IconButton variant={'secondary'}\n action={e => {\n e?.nativeEvent.stopImmediatePropagation();\n onClose();\n }}\n shape={'circular'}>\n <SystemIcons.Close/>\n </IconButton>\n </div>\n }\n </MobileMenuHeaderActions>\n\n </MobileMenuHeaderWrapper>\n )\n};\n\n\nexport default MobileMenuHeader;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAMzB,OAAOC,MAAM,MAAM,mBAAmB;AACtC,OAAOC,WAAW,MAAM,0BAA0B;AAClD,SAAQC,UAAU,QAAO,cAAc;AACvC,SAAQC,WAAW,QAAO,aAAa;AACvC,SAAQC,WAAW,EAAEC,MAAM,EAAEC,iBAAiB,EAAEC,kBAAkB,EAAEC,kBAAkB,QAAO,cAAc;AAC3G,SAAQC,aAAa,QAAO,qBAAqB;AAAC;AAAA;AAAA;AAElD,OAAO,IAAMC,uBAAuB,GAAGV,MAAM,CAACW,GAAG,2JAKhD;AACD,IAAMC,qBAAqB,GAAGZ,MAAM,CAACW,GAAG,2GACpCH,kBAAkB,CAACD,kBAAkB,CAACM,IAAI,EAAER,MAAM,CAACS,WAAW,CAAC,EAC/DV,WAAW,CAACW,KAAK,EACfT,iBAAiB,CAACC,kBAAkB,CAACM,IAAI,EAAER,MAAM,CAACS,WAAW,CAAC,CAEnE;AAED,OAAO,IAAME,uBAAuB,GAAGhB,MAAM,CAACW,GAAG,4OAM7CV,WAAW,CAACc,KAAK,EAIjBd,WAAW,CAACgB,KAAK,CAGpB;AAcD,IAAMC,gBAAgE,GAAG,SAAnEA,gBAAgE,OAOU;EAAA,IANJC,QAAQ,QAARA,QAAQ;IACRC,OAAO,QAAPA,OAAO;IACPC,KAAK,QAALA,KAAK;IACLC,OAAO,QAAPA,OAAO;IACPC,OAAO,QAAPA,OAAO;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AuB;MAAA,WAEpBE,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAE+B,MAAM,CAAC,UAAAb,CAAC;QAAA,OAAIA,CAAC,CAACK,SAAS,KAAK,MAAM;MAAA,EAAC,CAACN,GAAG,CAACG,UAAU,CAAC,EAI5DvB,OAAO,iBACP;QAAK,KAAK,EAAE;UAACmC,UAAU,EAAE;QAAK,CAAE;QAAA,uBAC9B,KAAC,UAAU;UAAC,OAAO,EAAE,WAAY;UACrB,MAAM,EAAE,gBAAAP,CAAC,EAAI;YACXA,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,WAAW,CAACC,wBAAwB,EAAE;YACzC9B,OAAO,EAAE;UACX,CAAE;UACF,KAAK,EAAE,UAAW;UAAA,uBAC5B,KAAC,WAAW,CAAC,KAAK;QAAE;MACT,EACT;IAAA,EAEgB;EAAA,EAEF;AAE9B,CAAC;AAAC;EA9HAD,QAAQ;EACRC,OAAO;EACPC,KAAK;EAGLE,OAAO;EAEPC,aAAa;AAAA;AA0Hf,eAAeN,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\nimport { IconButtonProps } from '../Button/Iconbutton';\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\nimport { NavLinkProps } from 'react-router-dom';\n\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\n label: string;\n icon?: React.ReactElement;\n}\n\nexport interface MenuButton {\n label: string;\n icon?: React.ReactNode;\n action: () => void;\n disabled?: boolean;\n isLoading?: boolean;\n variant?: 'primary' | 'secondary';\n}\n\nexport interface MenuGroupFooter {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuGroupHeader {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuAccountInfo {\n firstName: string;\n lastName: string;\n email: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface ProfileMenu {\n label?: string;\n\n user: MenuAccountInfo;\n\n sections: MenuNavigationSection[];\n\n signOut?: MenuButton;\n}\n\nexport interface MenuIconSubMenuButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'submenu';\n icon: React.ReactNode;\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuIconButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'action';\n icon: React.ReactNode;\n action: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\n type: 'profile';\n action?: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuSwitcherButton\n extends Omit<\n IconButtonProps,\n | 'id'\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'switcher';\n placement?: 'left' | 'right';\n action?: (button?: EventTarget) => boolean | void;\n}\n\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;\n\nexport interface MobileNavigationMenuProps {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n\n header?: MenuGroupHeader;\n\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport interface DesktopNavigationMenuProps {\n buttons?: DesktopMenuButtonTypes[];\n items: MenuNavigationItemTypeItem[];\n action?: MenuButton;\n reverseRightSideOrder?: boolean;\n}\n\n// @ts-ignore\nexport interface MenuNavigationGroup<T = MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\n label: string;\n note?: string;\n\n buttons?: MobileMenuButtonTypes[];\n header?: MenuGroupHeader;\n\n items: T[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport type MenuNavigationItem = {\n icon?: React.ReactNode;\n to: string;\n exact?: boolean;\n disabled?: boolean;\n external?: boolean;\n action?: (e: React.MouseEvent) => void;\n label: string;\n note?: string;\n pinned?: boolean;\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\n\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\n divider?: boolean;\n pinned?: boolean;\n label?: string;\n items: T[];\n}\n\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\n type?: 'item';\n};\n\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\n type: 'group';\n icon?: React.ReactNode;\n pinned?: boolean;\n disabled?: boolean;\n};\n\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\n type: 'section';\n};\n\nexport type MenuNavigationCustomSubMenu = {\n type: 'custom';\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n custom: () => React.ReactNode;\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\nimport { IconButtonProps } from '../Button/Iconbutton';\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\nimport { NavLinkProps } from 'react-router-dom';\nimport {ButtonProps} from \"../Button/Button\";\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\n\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\n label: string;\n icon?: React.ReactElement;\n}\n\nexport interface MenuButton extends Omit<ButtonProps, 'onClick' | 'children' | 'size'> {\n label: string;\n action: () => void;\n\n tooltip?: TooltipProps;\n}\n\nexport interface MenuGroupFooter {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuGroupHeader {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuAccountInfo {\n firstName: string;\n lastName: string;\n email: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface ProfileMenu {\n label?: string;\n\n user: MenuAccountInfo;\n\n sections: MenuNavigationSection[];\n\n signOut?: MenuButton;\n}\n\nexport interface MenuIconSubMenuButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'submenu';\n icon: React.ReactNode;\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuIconButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'action';\n icon: React.ReactNode;\n action: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\n type: 'profile';\n action?: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuSwitcherButton\n extends Omit<\n IconButtonProps,\n | 'id'\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'switcher';\n placement?: 'left' | 'right';\n action?: (button?: EventTarget) => boolean | void;\n}\n\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;\n\nexport interface MobileNavigationMenuProps {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n\n header?: MenuGroupHeader;\n\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport interface DesktopNavigationMenuProps {\n buttons?: DesktopMenuButtonTypes[];\n items: MenuNavigationItemTypeItem[];\n action?: MenuButton;\n reverseRightSideOrder?: boolean;\n}\n\n// @ts-ignore\nexport interface MenuNavigationGroup<T = MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\n label: string;\n note?: string;\n\n buttons?: MobileMenuButtonTypes[];\n header?: MenuGroupHeader;\n\n items: T[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport type MenuNavigationItem = {\n icon?: React.ReactNode;\n to: string;\n exact?: boolean;\n disabled?: boolean;\n external?: boolean;\n action?: (e: React.MouseEvent) => void;\n label: string;\n note?: string;\n pinned?: boolean;\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\n\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\n divider?: boolean;\n pinned?: boolean;\n label?: string;\n items: T[];\n}\n\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\n type?: 'item';\n};\n\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\n type: 'group';\n icon?: React.ReactNode;\n pinned?: boolean;\n disabled?: boolean;\n};\n\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\n type: 'section';\n};\n\nexport type MenuNavigationCustomSubMenu = {\n type: 'custom';\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n custom: () => React.ReactNode;\n};\n"],"mappings":""}
@@ -3,17 +3,16 @@ import { HyperlinkProps } from '../HyperLink/HyperLink';
3
3
  import { IconButtonProps } from '../Button/Iconbutton';
4
4
  import { ProfileButtonProps } from '../ProfileButton/ProfileButton';
5
5
  import { NavLinkProps } from 'react-router-dom';
6
+ import { ButtonProps } from "../Button/Button";
7
+ import { TooltipProps } from "../Tooltips/TooltipTypes";
6
8
  export interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {
7
9
  label: string;
8
10
  icon?: React.ReactElement;
9
11
  }
10
- export interface MenuButton {
12
+ export interface MenuButton extends Omit<ButtonProps, 'onClick' | 'children' | 'size'> {
11
13
  label: string;
12
- icon?: React.ReactNode;
13
14
  action: () => void;
14
- disabled?: boolean;
15
- isLoading?: boolean;
16
- variant?: 'primary' | 'secondary';
15
+ tooltip?: TooltipProps;
17
16
  }
18
17
  export interface MenuGroupFooter {
19
18
  header: string;
@@ -59,8 +58,8 @@ export interface MenuSwitcherButton extends Omit<IconButtonProps, 'id' | 'type'
59
58
  placement?: 'left' | 'right';
60
59
  action?: (button?: EventTarget) => boolean | void;
61
60
  }
62
- export declare type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;
63
- export declare type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;
61
+ export type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;
62
+ export type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;
64
63
  export interface MobileNavigationMenuProps {
65
64
  label?: string;
66
65
  buttons?: MobileMenuButtonTypes[];
@@ -84,7 +83,7 @@ export interface MenuNavigationGroup<T = MenuNavigationItem | MenuNavigationSect
84
83
  footer?: MenuGroupFooter;
85
84
  action?: MenuButton;
86
85
  }
87
- export declare type MenuNavigationItem = {
86
+ export type MenuNavigationItem = {
88
87
  icon?: React.ReactNode;
89
88
  to: string;
90
89
  exact?: boolean;
@@ -101,19 +100,19 @@ export interface MenuNavigationSection<T = MenuNavigationItem> {
101
100
  label?: string;
102
101
  items: T[];
103
102
  }
104
- export declare type MenuNavigationItemTypeItem = MenuNavigationItem & {
103
+ export type MenuNavigationItemTypeItem = MenuNavigationItem & {
105
104
  type?: 'item';
106
105
  };
107
- export declare type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {
106
+ export type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {
108
107
  type: 'group';
109
108
  icon?: React.ReactNode;
110
109
  pinned?: boolean;
111
110
  disabled?: boolean;
112
111
  };
113
- export declare type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {
112
+ export type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {
114
113
  type: 'section';
115
114
  };
116
- export declare type MenuNavigationCustomSubMenu = {
115
+ export type MenuNavigationCustomSubMenu = {
117
116
  type: 'custom';
118
117
  label?: string;
119
118
  buttons?: MobileMenuButtonTypes[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\nimport { IconButtonProps } from '../Button/Iconbutton';\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\nimport { NavLinkProps } from 'react-router-dom';\n\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\n label: string;\n icon?: React.ReactElement;\n}\n\nexport interface MenuButton {\n label: string;\n icon?: React.ReactNode;\n action: () => void;\n disabled?: boolean;\n isLoading?: boolean;\n variant?: 'primary' | 'secondary';\n}\n\nexport interface MenuGroupFooter {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuGroupHeader {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuAccountInfo {\n firstName: string;\n lastName: string;\n email: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface ProfileMenu {\n label?: string;\n\n user: MenuAccountInfo;\n\n sections: MenuNavigationSection[];\n\n signOut?: MenuButton;\n}\n\nexport interface MenuIconSubMenuButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'submenu';\n icon: React.ReactNode;\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuIconButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'action';\n icon: React.ReactNode;\n action: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\n type: 'profile';\n action?: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuSwitcherButton\n extends Omit<\n IconButtonProps,\n | 'id'\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'switcher';\n placement?: 'left' | 'right';\n action?: (button?: EventTarget) => boolean | void;\n}\n\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;\n\nexport interface MobileNavigationMenuProps {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n\n header?: MenuGroupHeader;\n\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport interface DesktopNavigationMenuProps {\n buttons?: DesktopMenuButtonTypes[];\n items: MenuNavigationItemTypeItem[];\n action?: MenuButton;\n reverseRightSideOrder?: boolean;\n}\n\n// @ts-ignore\nexport interface MenuNavigationGroup<T = MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\n label: string;\n note?: string;\n\n buttons?: MobileMenuButtonTypes[];\n header?: MenuGroupHeader;\n\n items: T[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport type MenuNavigationItem = {\n icon?: React.ReactNode;\n to: string;\n exact?: boolean;\n disabled?: boolean;\n external?: boolean;\n action?: (e: React.MouseEvent) => void;\n label: string;\n note?: string;\n pinned?: boolean;\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\n\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\n divider?: boolean;\n pinned?: boolean;\n label?: string;\n items: T[];\n}\n\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\n type?: 'item';\n};\n\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\n type: 'group';\n icon?: React.ReactNode;\n pinned?: boolean;\n disabled?: boolean;\n};\n\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\n type: 'section';\n};\n\nexport type MenuNavigationCustomSubMenu = {\n type: 'custom';\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n custom: () => React.ReactNode;\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/GlobalNavigationBar/types.tsx"],"sourcesContent":["import React from 'react';\nimport { HyperlinkProps } from '../HyperLink/HyperLink';\nimport { IconButtonProps } from '../Button/Iconbutton';\nimport { ProfileButtonProps } from '../ProfileButton/ProfileButton';\nimport { NavLinkProps } from 'react-router-dom';\nimport {ButtonProps} from \"../Button/Button\";\nimport {TooltipProps} from \"../Tooltips/TooltipTypes\";\n\nexport interface MenuHyperLinkProps extends Pick<HyperlinkProps, 'id' | 'href' | 'onClick' | 'target'> {\n label: string;\n icon?: React.ReactElement;\n}\n\nexport interface MenuButton extends Omit<ButtonProps, 'onClick' | 'children' | 'size'> {\n label: string;\n action: () => void;\n\n tooltip?: TooltipProps;\n}\n\nexport interface MenuGroupFooter {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuGroupHeader {\n header: string;\n note?: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface MenuAccountInfo {\n firstName: string;\n lastName: string;\n email: string;\n link?: MenuHyperLinkProps;\n}\n\nexport interface ProfileMenu {\n label?: string;\n\n user: MenuAccountInfo;\n\n sections: MenuNavigationSection[];\n\n signOut?: MenuButton;\n}\n\nexport interface MenuIconSubMenuButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'submenu';\n icon: React.ReactNode;\n menu: MenuNavigationItemTypeGroup | MenuNavigationCustomSubMenu;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuIconButton\n extends Omit<\n IconButtonProps,\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'action';\n icon: React.ReactNode;\n action: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuProfileButton extends Omit<ProfileButtonProps, 'type' | 'onClick' | 'initials' | 'hideOnLowWidth' | 'icon' | 'portraitSrc'> {\n type: 'profile';\n action?: (button?: EventTarget) => boolean | void;\n placement?: 'left' | 'right';\n}\n\nexport interface MenuSwitcherButton\n extends Omit<\n IconButtonProps,\n | 'id'\n | 'type'\n | 'action'\n | 'shape'\n | 'variant'\n | 'hideOnLowWidth'\n | 'flatEdge'\n | 'isInMobileMenu'\n | 'useTransparentBackground'\n | 'shouldNotInteract'\n | 'iconColor'\n | 'unsetIconSize'\n | 'borderRadius'\n | 'focusBackgroundColor'\n | 'children'\n | 'invertFocus'\n > {\n type: 'switcher';\n placement?: 'left' | 'right';\n action?: (button?: EventTarget) => boolean | void;\n}\n\nexport type DesktopMenuButtonTypes = MenuIconButton | MenuProfileButton | MenuSwitcherButton;\nexport type MobileMenuButtonTypes = MenuIconSubMenuButton | MenuIconButton | MenuProfileButton | MenuSwitcherButton;\n\nexport interface MobileNavigationMenuProps {\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n\n header?: MenuGroupHeader;\n\n items?: (MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup)[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport interface DesktopNavigationMenuProps {\n buttons?: DesktopMenuButtonTypes[];\n items: MenuNavigationItemTypeItem[];\n action?: MenuButton;\n reverseRightSideOrder?: boolean;\n}\n\n// @ts-ignore\nexport interface MenuNavigationGroup<T = MenuNavigationItem | MenuNavigationSection | MenuNavigationGroup> {\n label: string;\n note?: string;\n\n buttons?: MobileMenuButtonTypes[];\n header?: MenuGroupHeader;\n\n items: T[];\n\n footer?: MenuGroupFooter;\n action?: MenuButton;\n}\n\nexport type MenuNavigationItem = {\n icon?: React.ReactNode;\n to: string;\n exact?: boolean;\n disabled?: boolean;\n external?: boolean;\n action?: (e: React.MouseEvent) => void;\n label: string;\n note?: string;\n pinned?: boolean;\n} & Omit<NavLinkProps, 'onClick' | 'to' | 'exact' | 'onMouseDown'>;\n\nexport interface MenuNavigationSection<T = MenuNavigationItem> {\n divider?: boolean;\n pinned?: boolean;\n label?: string;\n items: T[];\n}\n\nexport type MenuNavigationItemTypeItem = MenuNavigationItem & {\n type?: 'item';\n};\n\nexport type MenuNavigationItemTypeGroup = MenuNavigationGroup<MenuNavigationItemTypeItem | MenuNavigationItemTypeGroup | MenuNavigationItemTypeSection> & {\n type: 'group';\n icon?: React.ReactNode;\n pinned?: boolean;\n disabled?: boolean;\n};\n\nexport type MenuNavigationItemTypeSection = MenuNavigationSection<MenuNavigationItemTypeItem> & {\n type: 'section';\n};\n\nexport type MenuNavigationCustomSubMenu = {\n type: 'custom';\n label?: string;\n buttons?: MobileMenuButtonTypes[];\n custom: () => React.ReactNode;\n};\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -22,6 +22,14 @@ Object.defineProperty(exports, "HyperLinkInvertedStyling", {
22
22
  return _styling.invertedStyle;
23
23
  }
24
24
  });
25
- var _HyperLink = _interopRequireDefault(require("./HyperLink"));
25
+ Object.defineProperty(exports, "StyledLink", {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _HyperLink.StyledLink;
29
+ }
30
+ });
31
+ var _HyperLink = _interopRequireWildcard(require("./HyperLink"));
26
32
  var _styling = require("./styling");
33
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
35
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/HyperLink/index.ts"],"sourcesContent":["import HyperLink from './HyperLink';\nimport {defaultStyle as HyperLinkDefaultStyling, invertedStyle as HyperLinkInvertedStyling} from './styling';\n\nexport { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/HyperLink/index.ts"],"sourcesContent":["import HyperLink, { StyledLink } from './HyperLink';\nimport {defaultStyle as HyperLinkDefaultStyling, invertedStyle as HyperLinkInvertedStyling} from './styling';\n\nexport { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling, StyledLink };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAA6G;AAAA"}
@@ -1,3 +1,3 @@
1
- import HyperLink from './HyperLink';
1
+ import HyperLink, { StyledLink } from './HyperLink';
2
2
  import { defaultStyle as HyperLinkDefaultStyling, invertedStyle as HyperLinkInvertedStyling } from './styling';
3
- export { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling };
3
+ export { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling, StyledLink };
@@ -1,4 +1,4 @@
1
- import HyperLink from './HyperLink';
1
+ import HyperLink, { StyledLink } from './HyperLink';
2
2
  import { defaultStyle as HyperLinkDefaultStyling, invertedStyle as HyperLinkInvertedStyling } from './styling';
3
- export { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling };
3
+ export { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling, StyledLink };
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["HyperLink","defaultStyle","HyperLinkDefaultStyling","invertedStyle","HyperLinkInvertedStyling"],"sources":["../../src/HyperLink/index.ts"],"sourcesContent":["import HyperLink from './HyperLink';\nimport {defaultStyle as HyperLinkDefaultStyling, invertedStyle as HyperLinkInvertedStyling} from './styling';\n\nexport { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling };\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AACnC,SAAQC,YAAY,IAAIC,uBAAuB,EAAEC,aAAa,IAAIC,wBAAwB,QAAO,WAAW;AAE5G,SAASJ,SAAS,EAAEI,wBAAwB,EAAEF,uBAAuB"}
1
+ {"version":3,"file":"index.js","names":["HyperLink","StyledLink","defaultStyle","HyperLinkDefaultStyling","invertedStyle","HyperLinkInvertedStyling"],"sources":["../../src/HyperLink/index.ts"],"sourcesContent":["import HyperLink, { StyledLink } from './HyperLink';\nimport {defaultStyle as HyperLinkDefaultStyling, invertedStyle as HyperLinkInvertedStyling} from './styling';\n\nexport { HyperLink, HyperLinkInvertedStyling, HyperLinkDefaultStyling, StyledLink };\n"],"mappings":"AAAA,OAAOA,SAAS,IAAIC,UAAU,QAAQ,aAAa;AACnD,SAAQC,YAAY,IAAIC,uBAAuB,EAAEC,aAAa,IAAIC,wBAAwB,QAAO,WAAW;AAE5G,SAASL,SAAS,EAAEK,wBAAwB,EAAEF,uBAAuB,EAAEF,UAAU"}
@@ -5,7 +5,7 @@ export interface ImageWithFallbacksProps extends Omit<React.ImgHTMLAttributes<HT
5
5
  alt: string;
6
6
  loader: boolean;
7
7
  }
8
- declare type ImageWithFallbacksState = {
8
+ type ImageWithFallbacksState = {
9
9
  src: string;
10
10
  fallbackIndex: number;
11
11
  fallbacks: string[];
@@ -17,7 +17,7 @@ var _types = require("../types");
17
17
  var _typography = require("../styles/typography");
18
18
  var _common = require("../common");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
- var _excluded = ["id", "selected", "select", "label", "invalid", "iconPointerEventsTransparent", "disabled", "margin", "size", "semiSelected", "children", "readOnly", "tabIndexVal", "className"];
20
+ var _excluded = ["id", "selected", "select", "label", "invalid", "iconPointerEventsTransparent", "disabled", "margin", "size", "semiSelected", "children", "readOnly", "tabIndexVal", "dataTestId", "className"];
21
21
  var _templateObject;
22
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
23
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -44,6 +44,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
44
44
  children = _ref.children,
45
45
  readOnly = _ref.readOnly,
46
46
  tabIndexVal = _ref.tabIndexVal,
47
+ dataTestId = _ref.dataTestId,
47
48
  className = _ref.className,
48
49
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
49
50
  var onKeyPress = function onKeyPress(e) {
@@ -74,6 +75,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
74
75
  }, rest), {}, {
75
76
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
76
77
  id: id,
78
+ "data-testId": dataTestId,
77
79
  className: 'checkbox-icon',
78
80
  children: selected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SystemIcons.CheckboxOn, {
79
81
  className: iconPointerEventsTransparent ? 'pointerTransparent' : '',
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.cjs","names":["StyledCheckBox","styled","div","props","margin","COLORS","black","selected","primary_500","invalid","critical_400","neutral_600","ComponentSStyling","ComponentTextStyle","Regular","ComponentMStyling","ComponentLStyling","focusStyles","primary_20","primary_700","primary_100","primary_800","neutral_300","white","Checkbox","React","forwardRef","ref","id","select","label","iconPointerEventsTransparent","disabled","size","semiSelected","children","readOnly","tabIndexVal","className","rest","onKeyPress","e","keyCode","handleClick","Size","Medium","cls","defaultOnMouseDownHandler"],"sources":["../../src/InputFields/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {CheckboxOff, CheckboxOn, CheckboxSemi} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport {Size} from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling} from '../styles/typography';\nimport {defaultOnMouseDownHandler} from '../common';\nimport { CheckboxProps } from './types';\n\nexport const StyledCheckBox = styled.div<{ disabled?: boolean; invalid?: boolean; selected?: boolean; margin?: string }>`\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ${props => (props.margin ? `margin: ${props.margin};` : '')}\n cursor: pointer;\n\n color: ${COLORS.black};\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .checkbox-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ${props => (props.selected ? COLORS.primary_500 : props.invalid ? COLORS.critical_400 : COLORS.neutral_600)};\n }\n }\n\n .checkbox-label {\n user-select: none;\n cursor: inherit;\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ${ComponentLStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):not(.readonly):focus {\n ${focusStyles}\n }\n\n &:not(.disabled):not(.readonly):hover {\n .checkbox-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n\n &:not(.disabled):not(.readonly):active {\n .checkbox-icon {\n background: ${COLORS.primary_100};\n\n svg {\n color: ${COLORS.primary_800};\n }\n }\n }\n\n &.readonly {\n cursor: inherit;\n\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n color: ${COLORS.neutral_300};\n\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n\n .checkbox-icon {\n background-color: ${COLORS.white};\n }\n\n .checkbox-icon svg {\n color: ${COLORS.neutral_300};\n }\n }\n\n &.dropdown-hover:not(.disabled) {\n .checkbox-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n`;\n\nconst Checkbox = React.forwardRef<HTMLDivElement, CheckboxProps>(({\n id,\n selected,\n select,\n label,\n invalid,\n iconPointerEventsTransparent,\n disabled,\n margin,\n size,\n semiSelected,\n children,\n readOnly,\n tabIndexVal,\n className,\n ...rest\n }, ref) => {\n const onKeyPress = (e: any) => {\n if (e.keyCode === 13 && !disabled && !readOnly) {\n select && select(!selected);\n }\n };\n\n const handleClick = () => {\n if (disabled || readOnly) {\n return;\n }\n select && select(!selected);\n };\n\n size = size ?? Size.Medium;\n\n const cls = `${size} ${className || ''} ${disabled ? ' disabled' : ''} ${readOnly ? ' readonly' : ''}`;\n\n return (\n <StyledCheckBox key={id}\n ref={ref}\n disabled={disabled}\n className={cls}\n aria-checked={selected}\n selected={selected}\n tabIndex={disabled || readOnly ? -1 : (tabIndexVal ? tabIndexVal : 0)}\n invalid={invalid}\n margin={margin}\n onClick={handleClick}\n onKeyDown={onKeyPress}\n onMouseDown={defaultOnMouseDownHandler}\n {...rest}>\n <div id={id} className={'checkbox-icon'}>\n {\n selected\n ? <CheckboxOn className={iconPointerEventsTransparent ? 'pointerTransparent' : ''} size=\"24px\"/>\n : semiSelected\n ? <CheckboxSemi className={iconPointerEventsTransparent ? 'pointerTransparent' : ''} size=\"24px\"/>\n : <CheckboxOff className={iconPointerEventsTransparent ? 'pointerTransparent' : ''} size=\"24px\"/>\n }\n </div>\n {\n label &&\n (\n <label className={'checkbox-label'}\n htmlFor={id}>\n {label}\n </label>\n )\n }\n {\n !label &&\n <label className={'checkbox-label'}\n htmlFor={id}>\n {children}\n </label>\n }\n </StyledCheckBox>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAoD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAG7C,IAAMA,cAAc,GAAGC,yBAAM,CAACC,GAAG,yuDAMpC,UAAAC,KAAK;EAAA,OAAKA,KAAK,CAACC,MAAM,qBAAcD,KAAK,CAACC,MAAM,SAAM,EAAE;AAAA,CAAC,EAGlDC,cAAM,CAACC,KAAK,EAiBR,UAAAH,KAAK;EAAA,OAAKA,KAAK,CAACI,QAAQ,GAAGF,cAAM,CAACG,WAAW,GAAGL,KAAK,CAACM,OAAO,GAAGJ,cAAM,CAACK,YAAY,GAAGL,cAAM,CAACM,WAAW;AAAA,CAAC,EAUlH,IAAAC,6BAAiB,EAACC,0BAAkB,CAACC,OAAO,EAAET,cAAM,CAACC,KAAK,CAAC,EAO3D,IAAAS,6BAAiB,EAACF,0BAAkB,CAACC,OAAO,EAAET,cAAM,CAACC,KAAK,CAAC,EAO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EYJ,QAAQ;AAAA"}
1
+ {"version":3,"file":"Checkbox.cjs","names":["StyledCheckBox","styled","div","props","margin","COLORS","black","selected","primary_500","invalid","critical_400","neutral_600","ComponentSStyling","ComponentTextStyle","Regular","ComponentMStyling","ComponentLStyling","focusStyles","primary_20","primary_700","primary_100","primary_800","neutral_300","white","Checkbox","React","forwardRef","ref","id","select","label","iconPointerEventsTransparent","disabled","size","semiSelected","children","readOnly","tabIndexVal","dataTestId","className","rest","onKeyPress","e","keyCode","handleClick","Size","Medium","cls","defaultOnMouseDownHandler"],"sources":["../../src/InputFields/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {CheckboxOff, CheckboxOn, CheckboxSemi} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle, focusStyles} from '../styles';\nimport {Size} from '../types';\nimport {ComponentLStyling, ComponentMStyling, ComponentSStyling} from '../styles/typography';\nimport {defaultOnMouseDownHandler} from '../common';\nimport { CheckboxProps } from './types';\n\nexport const StyledCheckBox = styled.div<{ disabled?: boolean; invalid?: boolean; selected?: boolean; margin?: string }>`\n display: flex;\n width: 100%;\n min-height: 48px;\n min-width: 48px;\n\n ${props => (props.margin ? `margin: ${props.margin};` : '')}\n cursor: pointer;\n\n color: ${COLORS.black};\n\n .pointerTransparent {\n pointer-events: none;\n }\n\n .checkbox-icon {\n margin: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n height: 36px;\n min-width: 36px;\n border-radius: 50%;\n\n svg {\n color: ${props => (props.selected ? COLORS.primary_500 : props.invalid ? COLORS.critical_400 : COLORS.neutral_600)};\n }\n }\n\n .checkbox-label {\n user-select: none;\n cursor: inherit;\n }\n\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 14px;\n }\n }\n\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &.large {\n ${ComponentLStyling(ComponentTextStyle.Regular, COLORS.black)}\n .checkbox-label {\n padding-top: 12px;\n }\n }\n\n &:not(.disabled):not(.readonly):focus {\n ${focusStyles}\n }\n\n &:not(.disabled):not(.readonly):hover {\n .checkbox-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n\n &:not(.disabled):not(.readonly):active {\n .checkbox-icon {\n background: ${COLORS.primary_100};\n\n svg {\n color: ${COLORS.primary_800};\n }\n }\n }\n\n &.readonly {\n cursor: inherit;\n\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n color: ${COLORS.neutral_300};\n\n .checkbox-icon,\n .checkbox-label {\n pointer-events: none;\n }\n\n .checkbox-icon {\n background-color: ${COLORS.white};\n }\n\n .checkbox-icon svg {\n color: ${COLORS.neutral_300};\n }\n }\n\n &.dropdown-hover:not(.disabled) {\n .checkbox-icon {\n background-color: ${COLORS.primary_20};\n\n svg {\n color: ${COLORS.primary_700};\n }\n }\n }\n`;\n\nconst Checkbox = React.forwardRef<HTMLDivElement, CheckboxProps>(({\n id,\n selected,\n select,\n label,\n invalid,\n iconPointerEventsTransparent,\n disabled,\n margin,\n size,\n semiSelected,\n children,\n readOnly,\n tabIndexVal,\n dataTestId,\n className,\n ...rest\n }, ref) => {\n const onKeyPress = (e: any) => {\n if (e.keyCode === 13 && !disabled && !readOnly) {\n select && select(!selected);\n }\n };\n\n const handleClick = () => {\n if (disabled || readOnly) {\n return;\n }\n select && select(!selected);\n };\n\n size = size ?? Size.Medium;\n\n const cls = `${size} ${className || ''} ${disabled ? ' disabled' : ''} ${readOnly ? ' readonly' : ''}`;\n\n return (\n <StyledCheckBox key={id}\n ref={ref}\n disabled={disabled}\n className={cls}\n aria-checked={selected}\n selected={selected}\n tabIndex={disabled || readOnly ? -1 : (tabIndexVal ? tabIndexVal : 0)}\n invalid={invalid}\n margin={margin}\n onClick={handleClick}\n onKeyDown={onKeyPress}\n onMouseDown={defaultOnMouseDownHandler}\n {...rest}>\n <div id={id} data-testId={dataTestId} className={'checkbox-icon'}>\n {\n selected\n ? <CheckboxOn className={iconPointerEventsTransparent ? 'pointerTransparent' : ''} size=\"24px\"/>\n : semiSelected\n ? <CheckboxSemi className={iconPointerEventsTransparent ? 'pointerTransparent' : ''} size=\"24px\"/>\n : <CheckboxOff className={iconPointerEventsTransparent ? 'pointerTransparent' : ''} size=\"24px\"/>\n }\n </div>\n {\n label &&\n (\n <label className={'checkbox-label'}\n htmlFor={id}>\n {label}\n </label>\n )\n }\n {\n !label &&\n <label className={'checkbox-label'}\n htmlFor={id}>\n {children}\n </label>\n }\n </StyledCheckBox>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAoD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAG7C,IAAMA,cAAc,GAAGC,yBAAM,CAACC,GAAG,yuDAMpC,UAAAC,KAAK;EAAA,OAAKA,KAAK,CAACC,MAAM,qBAAcD,KAAK,CAACC,MAAM,SAAM,EAAE;AAAA,CAAC,EAGlDC,cAAM,CAACC,KAAK,EAiBR,UAAAH,KAAK;EAAA,OAAKA,KAAK,CAACI,QAAQ,GAAGF,cAAM,CAACG,WAAW,GAAGL,KAAK,CAACM,OAAO,GAAGJ,cAAM,CAACK,YAAY,GAAGL,cAAM,CAACM,WAAW;AAAA,CAAC,EAUlH,IAAAC,6BAAiB,EAACC,0BAAkB,CAACC,OAAO,EAAET,cAAM,CAACC,KAAK,CAAC,EAO3D,IAAAS,6BAAiB,EAACF,0BAAkB,CAACC,OAAO,EAAET,cAAM,CAACC,KAAK,CAAC,EAO3D,IAAAU,6BAAiB,EAACH,0BAAkB,CAACC,OAAO,EAAET,cAAM,CAACC,KAAK,CAAC,EAO3DW,mBAAW,EAKSZ,cAAM,CAACa,UAAU,EAG1Bb,cAAM,CAACc,WAAW,EA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