@hitachivantara/app-shell-ui 0.38.0

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 (142) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/dts/index.d.ts +9 -0
  4. package/dist/esm/components/AppShell/AppShell.js +13 -0
  5. package/dist/esm/components/AppShell/AppShell.js.map +1 -0
  6. package/dist/esm/components/AppShellProvider/AppShellProvider.js +62 -0
  7. package/dist/esm/components/AppShellProvider/AppShellProvider.js.map +1 -0
  8. package/dist/esm/components/AppShellRoutes/AppShellRoutes.js +31 -0
  9. package/dist/esm/components/AppShellRoutes/AppShellRoutes.js.map +1 -0
  10. package/dist/esm/components/AppShellViewProvider/AppShellViewProvider.js +16 -0
  11. package/dist/esm/components/AppShellViewProvider/AppShellViewProvider.js.map +1 -0
  12. package/dist/esm/components/CustomHooksInitializer/CustomHooksInitializer.js +7 -0
  13. package/dist/esm/components/CustomHooksInitializer/CustomHooksInitializer.js.map +1 -0
  14. package/dist/esm/components/GlobalStyles/GlobalStyles.js +19 -0
  15. package/dist/esm/components/GlobalStyles/GlobalStyles.js.map +1 -0
  16. package/dist/esm/components/GlobalStyles/index.js +5 -0
  17. package/dist/esm/components/GlobalStyles/index.js.map +1 -0
  18. package/dist/esm/components/IconUiKit/IconUiKit.js +10 -0
  19. package/dist/esm/components/IconUiKit/IconUiKit.js.map +1 -0
  20. package/dist/esm/components/IconUiKit/index.js +7 -0
  21. package/dist/esm/components/IconUiKit/index.js.map +1 -0
  22. package/dist/esm/components/hoc/withClickAwayListener.js +15 -0
  23. package/dist/esm/components/hoc/withClickAwayListener.js.map +1 -0
  24. package/dist/esm/components/hoc/withGlobalProvider.js +34 -0
  25. package/dist/esm/components/hoc/withGlobalProvider.js.map +1 -0
  26. package/dist/esm/components/layout/Header/BrandLogo/BrandLogo.js +20 -0
  27. package/dist/esm/components/layout/Header/BrandLogo/BrandLogo.js.map +1 -0
  28. package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/Hitachi.js +10 -0
  29. package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/Hitachi.js.map +1 -0
  30. package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/styles.js +28 -0
  31. package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/styles.js.map +1 -0
  32. package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/Lumada.js +15 -0
  33. package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/Lumada.js.map +1 -0
  34. package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/styles.js +34 -0
  35. package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/styles.js.map +1 -0
  36. package/dist/esm/components/layout/Header/Header.js +38 -0
  37. package/dist/esm/components/layout/Header/Header.js.map +1 -0
  38. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/DynamicAction.js +22 -0
  39. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/DynamicAction.js.map +1 -0
  40. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/index.js +5 -0
  41. package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/index.js.map +1 -0
  42. package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js +31 -0
  43. package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js.map +1 -0
  44. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js +52 -0
  45. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js.map +1 -0
  46. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/index.js +5 -0
  47. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/index.js.map +1 -0
  48. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/styles.js +12 -0
  49. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/styles.js.map +1 -0
  50. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js +24 -0
  51. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js.map +1 -0
  52. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/index.js +5 -0
  53. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/index.js.map +1 -0
  54. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js +24 -0
  55. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js.map +1 -0
  56. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/index.js +5 -0
  57. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/index.js.map +1 -0
  58. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/InternalAction/InternalAction.js +34 -0
  59. package/dist/esm/components/layout/Header/HeaderActions/InternalActions/InternalAction/InternalAction.js.map +1 -0
  60. package/dist/esm/components/layout/Header/HeaderActions/index.js +5 -0
  61. package/dist/esm/components/layout/Header/HeaderActions/index.js.map +1 -0
  62. package/dist/esm/components/layout/Header/styles.js +22 -0
  63. package/dist/esm/components/layout/Header/styles.js.map +1 -0
  64. package/dist/esm/components/layout/Loading/Loading.js +9 -0
  65. package/dist/esm/components/layout/Loading/Loading.js.map +1 -0
  66. package/dist/esm/components/layout/Loading/styles.js +24 -0
  67. package/dist/esm/components/layout/Loading/styles.js.map +1 -0
  68. package/dist/esm/components/layout/Main/Main.js +30 -0
  69. package/dist/esm/components/layout/Main/Main.js.map +1 -0
  70. package/dist/esm/components/layout/Main/styles.js +19 -0
  71. package/dist/esm/components/layout/Main/styles.js.map +1 -0
  72. package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js +56 -0
  73. package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js.map +1 -0
  74. package/dist/esm/components/layout/VerticalNavigation/styles.js +21 -0
  75. package/dist/esm/components/layout/VerticalNavigation/styles.js.map +1 -0
  76. package/dist/esm/index.js +5 -0
  77. package/dist/esm/index.js.map +1 -0
  78. package/dist/esm/lib/hooks/useClearLocationState.js +19 -0
  79. package/dist/esm/lib/hooks/useClearLocationState.js.map +1 -0
  80. package/dist/esm/lib/hooks/useCustomEventListener.js +18 -0
  81. package/dist/esm/lib/hooks/useCustomEventListener.js.map +1 -0
  82. package/dist/esm/lib/hooks/useLocalStorage.js +24 -0
  83. package/dist/esm/lib/hooks/useLocalStorage.js.map +1 -0
  84. package/dist/esm/lib/hooks/useNavigationMenuItems.js +33 -0
  85. package/dist/esm/lib/hooks/useNavigationMenuItems.js.map +1 -0
  86. package/dist/esm/lib/hooks/useNotificationsEventListener.js +32 -0
  87. package/dist/esm/lib/hooks/useNotificationsEventListener.js.map +1 -0
  88. package/dist/esm/lib/hooks/useThemeEventListener.js +27 -0
  89. package/dist/esm/lib/hooks/useThemeEventListener.js.map +1 -0
  90. package/dist/esm/lib/i18n/index.js +29 -0
  91. package/dist/esm/lib/i18n/index.js.map +1 -0
  92. package/dist/esm/lib/i18n/localization/en.json.js +55 -0
  93. package/dist/esm/lib/i18n/localization/en.json.js.map +1 -0
  94. package/dist/esm/lib/i18n/localization/pt.json.js +55 -0
  95. package/dist/esm/lib/i18n/localization/pt.json.js.map +1 -0
  96. package/dist/esm/lib/utils/CombinedProviders.js +18 -0
  97. package/dist/esm/lib/utils/CombinedProviders.js.map +1 -0
  98. package/dist/esm/lib/utils/basePathUtils.js +5 -0
  99. package/dist/esm/lib/utils/basePathUtils.js.map +1 -0
  100. package/dist/esm/lib/utils/documentUtil.js +9 -0
  101. package/dist/esm/lib/utils/documentUtil.js.map +1 -0
  102. package/dist/esm/lib/utils/navigationUtil.js +41 -0
  103. package/dist/esm/lib/utils/navigationUtil.js.map +1 -0
  104. package/dist/esm/lib/utils/textUtil.js +5 -0
  105. package/dist/esm/lib/utils/textUtil.js.map +1 -0
  106. package/dist/esm/pages/ErrorPage/ErrorPage.js +30 -0
  107. package/dist/esm/pages/ErrorPage/ErrorPage.js.map +1 -0
  108. package/dist/esm/pages/ErrorPage/Footer/Footer.js +38 -0
  109. package/dist/esm/pages/ErrorPage/Footer/Footer.js.map +1 -0
  110. package/dist/esm/pages/ErrorPage/Footer/styles.js +23 -0
  111. package/dist/esm/pages/ErrorPage/Footer/styles.js.map +1 -0
  112. package/dist/esm/pages/ErrorPage/styles.js +40 -0
  113. package/dist/esm/pages/ErrorPage/styles.js.map +1 -0
  114. package/dist/esm/pages/GenericError/500.svg.js +5 -0
  115. package/dist/esm/pages/GenericError/500.svg.js.map +1 -0
  116. package/dist/esm/pages/GenericError/GenericError.js +17 -0
  117. package/dist/esm/pages/GenericError/GenericError.js.map +1 -0
  118. package/dist/esm/pages/LoadingPage/LoadingPage.js +15 -0
  119. package/dist/esm/pages/LoadingPage/LoadingPage.js.map +1 -0
  120. package/dist/esm/pages/LoadingPage/index.js +5 -0
  121. package/dist/esm/pages/LoadingPage/index.js.map +1 -0
  122. package/dist/esm/pages/LoadingPage/styles.js +16 -0
  123. package/dist/esm/pages/LoadingPage/styles.js.map +1 -0
  124. package/dist/esm/pages/NotFound/404.svg.js +5 -0
  125. package/dist/esm/pages/NotFound/404.svg.js.map +1 -0
  126. package/dist/esm/pages/NotFound/NotFound.js +14 -0
  127. package/dist/esm/pages/NotFound/NotFound.js.map +1 -0
  128. package/dist/esm/pages/NotFound/index.js +5 -0
  129. package/dist/esm/pages/NotFound/index.js.map +1 -0
  130. package/dist/esm/providers/BannerProvider.js +72 -0
  131. package/dist/esm/providers/BannerProvider.js.map +1 -0
  132. package/dist/esm/providers/LayoutProvider.js +25 -0
  133. package/dist/esm/providers/LayoutProvider.js.map +1 -0
  134. package/dist/esm/providers/NavigationProvider.js +56 -0
  135. package/dist/esm/providers/NavigationProvider.js.map +1 -0
  136. package/dist/esm/providers/hooks/useBannerContext.js +10 -0
  137. package/dist/esm/providers/hooks/useBannerContext.js.map +1 -0
  138. package/dist/esm/providers/hooks/useLayoutContext.js +10 -0
  139. package/dist/esm/providers/hooks/useLayoutContext.js.map +1 -0
  140. package/dist/esm/providers/hooks/useNavigationContext.js +10 -0
  141. package/dist/esm/providers/hooks/useNavigationContext.js.map +1 -0
  142. package/package.json +72 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Main.js","sources":["../../../../../src/components/layout/Main/Main.tsx"],"sourcesContent":["import { HvContainer } from \"@hitachivantara/uikit-react-core\";\n\nimport { useHvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\nimport useNavigationContext from \"../../../providers/hooks/useNavigationContext\";\nimport VerticalNavigation from \"../VerticalNavigation\";\n\nimport { StyledMain, StyledContainer } from \"./styles\";\nimport useLayoutContext from \"../../../providers/hooks/useLayoutContext\";\n\nexport type MainProps = {\n children: React.ReactNode;\n};\n\nconst Main = ({ children }: MainProps) => {\n const {\n hasVerticalNavigation,\n verticalNavigationMode,\n showHeaderSubMenu,\n isCompactMode,\n switchVerticalNavigationMode\n } = useNavigationContext();\n const { bannerMaxHeight } = useLayoutContext();\n const { mainPanel } = useHvAppShellConfig();\n\n return (\n <StyledContainer\n showHeaderSubMenu={showHeaderSubMenu}\n isCompactMode={isCompactMode}>\n {hasVerticalNavigation && verticalNavigationMode !== \"CLOSED\" && (\n <VerticalNavigation\n onClickAway={isCompactMode ? switchVerticalNavigationMode : undefined}\n />\n )}\n\n <StyledMain paddingTop={bannerMaxHeight}>\n <HvContainer maxWidth={mainPanel?.maxWidth ?? \"xl\"}>\n {children}\n </HvContainer>\n </StyledMain>\n </StyledContainer>\n );\n};\n\nexport default Main;\n"],"names":["Main","children","hasVerticalNavigation","verticalNavigationMode","showHeaderSubMenu","isCompactMode","switchVerticalNavigationMode","useNavigationContext","bannerMaxHeight","useLayoutContext","mainPanel","useHvAppShellConfig","jsxs","StyledContainer","jsx","VerticalNavigation","undefined","StyledMain","HvContainer","maxWidth","Main$1"],"mappings":";;;;;;;AAcA,MAAMA,IAAOA,CAAC;AAAA,EAAEC,UAAAA;AAAoB,MAAM;AAClC,QAAA;AAAA,IACJC,uBAAAA;AAAAA,IACAC,wBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,8BAAAA;AAAAA,MACEC,EAAqB,GACnB;AAAA,IAAEC,iBAAAA;AAAAA,MAAoBC,EAAiB,GACvC;AAAA,IAAEC,WAAAA;AAAAA,MAAcC,EAAoB;AAGxC,SAAA,gBAAAC,EAACC,GACC,EAAA,mBAAAT,GACA,eAAAC,GACCH,UAAAA;AAAAA,IAAAA,KAAyBC,MAA2B,YACnD,gBAAAW,EAACC,KACC,aAAaV,IAAgBC,IAA+BU,QAE/D;AAAA,IAED,gBAAAF,EAACG,GAAW,EAAA,YAAYT,GACtB,UAAA,gBAAAM,EAACI,GAAY,EAAA,WAAUR,KAAAA,gBAAAA,EAAWS,aAAY,MAC3ClB,UAAAA,EAAAA,CACH,EACF,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ,GAEAmB,IAAepB;"}
@@ -0,0 +1,19 @@
1
+ import c from "@emotion/styled/base";
2
+ import { theme as b } from "@hitachivantara/uikit-react-core";
3
+ const W = 68, B = /* @__PURE__ */ c("div", process.env.NODE_ENV === "production" ? {
4
+ target: "ew4l8di1"
5
+ } : {
6
+ target: "ew4l8di1",
7
+ label: "StyledContainer"
8
+ })("display:flex;margin-top:", (l) => l.showHeaderSubMenu && !l.isCompactMode ? `calc(${b.header.height} + ${W}px)` : b.header.height, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9NYWluL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrQndEIiwiZmlsZSI6Ii9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9NYWluL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuXG5pbXBvcnQgeyB0aGVtZSB9IGZyb20gXCJAaGl0YWNoaXZhbnRhcmEvdWlraXQtcmVhY3QtY29yZVwiO1xuXG4vKipcbiAqIFRoZSB2YWx1ZSBvZiB0aGUgc3ViIGhlYWRlciBzaG91bGQgYmUgY29taW5nIGZyb20gVUktS0lULCBhdCB0aGlzIHRpbWUgaXQgaXMgbm90LCBzbyB3ZSBhcmUgaGFyZGNvZGluZyB0aGUgdmFsdWVcbiAqIGhlcmUuIDY0cHggZm9yIHRoZSBoZWlnaHQgYW5kIGFuIGV4dHJhIDRweCBmb3IgdGhlIHRvcCBwYWRkaW5nLlxuICovXG5leHBvcnQgY29uc3QgU1VCX0hFQURFUl9IRUlHSFQgPSA2ODtcblxuaW50ZXJmYWNlIFN0eWxlZENvbnRhaW5lclByb3BzIHtcbiAgc2hvd0hlYWRlclN1Yk1lbnU/OiBib29sZWFuO1xuICBpc0NvbXBhY3RNb2RlPzogYm9vbGVhbjtcbn1cbmludGVyZmFjZSBTdHlsZWRNYWluUHJvcHMge1xuICBwYWRkaW5nVG9wPzogbnVtYmVyO1xufVxuXG5jb25zdCBTdHlsZWRDb250YWluZXIgPSBzdHlsZWQuZGl2PFN0eWxlZENvbnRhaW5lclByb3BzPmBcbiAgZGlzcGxheTogZmxleDtcbiAgbWFyZ2luLXRvcDogJHtwcm9wcyA9PiB7XG4gICAgaWYgKHByb3BzLnNob3dIZWFkZXJTdWJNZW51ICYmICFwcm9wcy5pc0NvbXBhY3RNb2RlKSB7XG4gICAgICByZXR1cm4gYGNhbGMoJHt0aGVtZS5oZWFkZXIuaGVpZ2h0fSArICR7U1VCX0hFQURFUl9IRUlHSFR9cHgpYDtcbiAgICB9XG5cbiAgICByZXR1cm4gdGhlbWUuaGVhZGVyLmhlaWdodDtcbiAgfX07XG5gO1xuXG5jb25zdCBTdHlsZWRNYWluID0gc3R5bGVkLm1haW48U3R5bGVkTWFpblByb3BzPmBcbiAgZmxleDogMTtcbiAgcGFkZGluZy10b3A6ICR7cHJvcHMgPT4ge1xuICAgIHJldHVybiBgJHtwcm9wcy5wYWRkaW5nVG9wfXB4YDtcbiAgfX07XG5gO1xuXG5leHBvcnQgeyBTdHlsZWRDb250YWluZXIsIFN0eWxlZE1haW4gfTtcbiJdfQ== */")), G = /* @__PURE__ */ c("main", process.env.NODE_ENV === "production" ? {
9
+ target: "ew4l8di0"
10
+ } : {
11
+ target: "ew4l8di0",
12
+ label: "StyledMain"
13
+ })("flex:1;padding-top:", (l) => `${l.paddingTop}px`, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9NYWluL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2QitDIiwiZmlsZSI6Ii9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9NYWluL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuXG5pbXBvcnQgeyB0aGVtZSB9IGZyb20gXCJAaGl0YWNoaXZhbnRhcmEvdWlraXQtcmVhY3QtY29yZVwiO1xuXG4vKipcbiAqIFRoZSB2YWx1ZSBvZiB0aGUgc3ViIGhlYWRlciBzaG91bGQgYmUgY29taW5nIGZyb20gVUktS0lULCBhdCB0aGlzIHRpbWUgaXQgaXMgbm90LCBzbyB3ZSBhcmUgaGFyZGNvZGluZyB0aGUgdmFsdWVcbiAqIGhlcmUuIDY0cHggZm9yIHRoZSBoZWlnaHQgYW5kIGFuIGV4dHJhIDRweCBmb3IgdGhlIHRvcCBwYWRkaW5nLlxuICovXG5leHBvcnQgY29uc3QgU1VCX0hFQURFUl9IRUlHSFQgPSA2ODtcblxuaW50ZXJmYWNlIFN0eWxlZENvbnRhaW5lclByb3BzIHtcbiAgc2hvd0hlYWRlclN1Yk1lbnU/OiBib29sZWFuO1xuICBpc0NvbXBhY3RNb2RlPzogYm9vbGVhbjtcbn1cbmludGVyZmFjZSBTdHlsZWRNYWluUHJvcHMge1xuICBwYWRkaW5nVG9wPzogbnVtYmVyO1xufVxuXG5jb25zdCBTdHlsZWRDb250YWluZXIgPSBzdHlsZWQuZGl2PFN0eWxlZENvbnRhaW5lclByb3BzPmBcbiAgZGlzcGxheTogZmxleDtcbiAgbWFyZ2luLXRvcDogJHtwcm9wcyA9PiB7XG4gICAgaWYgKHByb3BzLnNob3dIZWFkZXJTdWJNZW51ICYmICFwcm9wcy5pc0NvbXBhY3RNb2RlKSB7XG4gICAgICByZXR1cm4gYGNhbGMoJHt0aGVtZS5oZWFkZXIuaGVpZ2h0fSArICR7U1VCX0hFQURFUl9IRUlHSFR9cHgpYDtcbiAgICB9XG5cbiAgICByZXR1cm4gdGhlbWUuaGVhZGVyLmhlaWdodDtcbiAgfX07XG5gO1xuXG5jb25zdCBTdHlsZWRNYWluID0gc3R5bGVkLm1haW48U3R5bGVkTWFpblByb3BzPmBcbiAgZmxleDogMTtcbiAgcGFkZGluZy10b3A6ICR7cHJvcHMgPT4ge1xuICAgIHJldHVybiBgJHtwcm9wcy5wYWRkaW5nVG9wfXB4YDtcbiAgfX07XG5gO1xuXG5leHBvcnQgeyBTdHlsZWRDb250YWluZXIsIFN0eWxlZE1haW4gfTtcbiJdfQ== */"));
14
+ export {
15
+ W as SUB_HEADER_HEIGHT,
16
+ B as StyledContainer,
17
+ G as StyledMain
18
+ };
19
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":["../../../../../src/components/layout/Main/styles.ts"],"sourcesContent":["import styled from \"@emotion/styled\";\n\nimport { theme } from \"@hitachivantara/uikit-react-core\";\n\n/**\n * The value of the sub header should be coming from UI-KIT, at this time it is not, so we are hardcoding the value\n * here. 64px for the height and an extra 4px for the top padding.\n */\nexport const SUB_HEADER_HEIGHT = 68;\n\ninterface StyledContainerProps {\n showHeaderSubMenu?: boolean;\n isCompactMode?: boolean;\n}\ninterface StyledMainProps {\n paddingTop?: number;\n}\n\nconst StyledContainer = styled.div<StyledContainerProps>`\n display: flex;\n margin-top: ${props => {\n if (props.showHeaderSubMenu && !props.isCompactMode) {\n return `calc(${theme.header.height} + ${SUB_HEADER_HEIGHT}px)`;\n }\n\n return theme.header.height;\n }};\n`;\n\nconst StyledMain = styled.main<StyledMainProps>`\n flex: 1;\n padding-top: ${props => {\n return `${props.paddingTop}px`;\n }};\n`;\n\nexport { StyledContainer, StyledMain };\n"],"names":["SUB_HEADER_HEIGHT","StyledContainer","_styled","process","env","NODE_ENV","target","label","props","showHeaderSubMenu","isCompactMode","theme","header","height","StyledMain","paddingTop"],"mappings":";;AAQO,MAAMA,IAAoB,IAU3BC,IAAe,gBAAAC,EAAA,OAAAC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAA,4BAELC,CAASA,MACjBA,EAAMC,qBAAqB,CAACD,EAAME,gBAC5B,QAAOC,EAAMC,OAAOC,MAAO,MAAKb,CAAkB,QAGrDW,EAAMC,OAAOC,eACrBV,QAAAC,IAAAC,aACF,eAAA,KAAA,8sDAAA,GAEKS,IAAU,gBAAAZ,EAAA,QAAAC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CAAA,EAAA,uBAECC,CAASA,MACd,GAAEA,EAAMO,UAAW,aAC5BZ,QAAAC,IAAAC,aACF,eAAA,KAAA,8sDAAA;"}
@@ -0,0 +1,56 @@
1
+ import { jsx as r, jsxs as m } from "@emotion/react/jsx-runtime";
2
+ import { useRef as b, useEffect as h } from "react";
3
+ import { useTranslation as C } from "react-i18next";
4
+ import { HvVerticalNavigationHeader as H, HvVerticalNavigationTree as L, HvVerticalNavigationActions as V } from "@hitachivantara/uikit-react-core";
5
+ import { useHvNavigation as x } from "@hitachivantara/app-shell-navigation";
6
+ import B from "../../../providers/hooks/useNavigationContext.js";
7
+ import { StyledHvVerticalNavigation as I, navigationPopupStyles as P } from "./styles.js";
8
+ import w from "../../hoc/withClickAwayListener.js";
9
+ import A from "../../../providers/hooks/useLayoutContext.js";
10
+ const E = () => {
11
+ const {
12
+ t: a
13
+ } = C(), {
14
+ selectedMenuItemId: v,
15
+ rootMenuItemId: d,
16
+ verticalNavigationItems: g,
17
+ isCompactMode: t,
18
+ verticalNavigationMode: l,
19
+ switchVerticalNavigationMode: s
20
+ } = B(), {
21
+ setVerticalNavigationWidth: o
22
+ } = A(), {
23
+ navigate: p
24
+ } = x(), c = b(null), n = l === "EXPANDED", u = (e, i) => {
25
+ e.preventDefault(), i.href && (p(i.href, {
26
+ state: {
27
+ selectedItemId: i.id
28
+ }
29
+ }), t && s());
30
+ }, f = () => {
31
+ s();
32
+ };
33
+ h(() => {
34
+ const {
35
+ current: e
36
+ } = c, i = e == null ? void 0 : e.childNodes[0];
37
+ return o(i && !t ? i.offsetWidth : 0), () => o(0);
38
+ }, [l, t, o]);
39
+ const N = a(n ? "verticalNavigation.ariaLabelCollapse" : "verticalNavigation.ariaLabelExpand");
40
+ return /* @__PURE__ */ r("div", { ref: c, children: /* @__PURE__ */ m(I, { isCompactMode: t, open: n, useIcons: !0, slider: t, children: [
41
+ /* @__PURE__ */ r(H, { title: a("verticalNavigation.title") ?? "", onCollapseButtonClick: t ? void 0 : f, collapseButtonProps: {
42
+ "aria-label": N,
43
+ "aria-expanded": n
44
+ }, backButtonProps: {
45
+ "aria-label": a("verticalNavigation.ariaLabelHeaderBackButton") ?? ""
46
+ } }),
47
+ /* @__PURE__ */ r(L, { mode: "navigation", collapsible: !0, "aria-label": a("verticalNavigation.ariaLabelNavigationTree") ?? "", selected: v ?? "", onChange: u, data: g, classes: {
48
+ navigationPopup: P
49
+ }, sliderForwardButtonAriaLabel: a("verticalNavigation.ariaLabelSliderForwardButton") ?? "" }, d),
50
+ /* @__PURE__ */ r(V, {})
51
+ ] }) });
52
+ }, W = w(E);
53
+ export {
54
+ W as default
55
+ };
56
+ //# sourceMappingURL=VerticalNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerticalNavigation.js","sources":["../../../../../src/components/layout/VerticalNavigation/VerticalNavigation.tsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n HvVerticalNavigationActions,\n HvVerticalNavigationHeader,\n HvVerticalNavigationTree\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nimport { NavigationMenuItem } from \"../../../lib/types\";\nimport useNavigationContext from \"../../../providers/hooks/useNavigationContext\";\nimport { navigationPopupStyles, StyledHvVerticalNavigation } from \"./styles\";\n\nimport withClickAwayListener from \"../../hoc/withClickAwayListener\";\nimport useLayoutContext from \"../../../providers/hooks/useLayoutContext\";\n\nconst VerticalNavigation = () => {\n const { t } = useTranslation();\n const {\n selectedMenuItemId,\n rootMenuItemId,\n verticalNavigationItems,\n isCompactMode,\n verticalNavigationMode,\n switchVerticalNavigationMode\n } = useNavigationContext();\n const { setVerticalNavigationWidth } = useLayoutContext();\n const { navigate } = useHvNavigation();\n const verticalNavigationRef = useRef<HTMLDivElement>(null);\n const isVerticalNavigationExpanded = verticalNavigationMode === \"EXPANDED\";\n\n const changeHandler = (\n event: React.SyntheticEvent<Element, Event>,\n selectedItem: NavigationMenuItem\n ) => {\n // Due to the change from buttons to links on the navigation tree, we need to prevent the default behaviour of\n // the event to avoid full refreshes when clicking on the links.\n event.preventDefault();\n\n if (selectedItem.href) {\n navigate(selectedItem.href, {\n state: { selectedItemId: selectedItem.id }\n });\n\n if (isCompactMode) {\n switchVerticalNavigationMode();\n }\n }\n };\n\n const closePanelHandler = () => {\n switchVerticalNavigationMode();\n };\n\n useEffect(() => {\n const { current } = verticalNavigationRef;\n const firstChild = current?.childNodes[0] as HTMLElement;\n if (firstChild && !isCompactMode) {\n setVerticalNavigationWidth(firstChild.offsetWidth);\n } else {\n setVerticalNavigationWidth(0);\n }\n\n return () => setVerticalNavigationWidth(0);\n }, [verticalNavigationMode, isCompactMode, setVerticalNavigationWidth]);\n\n const collapseButtonAriaLabel = isVerticalNavigationExpanded\n ? t(\"verticalNavigation.ariaLabelCollapse\")\n : t(\"verticalNavigation.ariaLabelExpand\");\n\n return (\n <div ref={verticalNavigationRef}>\n <StyledHvVerticalNavigation\n isCompactMode={isCompactMode}\n open={isVerticalNavigationExpanded}\n useIcons\n slider={isCompactMode}>\n <HvVerticalNavigationHeader\n title={t(\"verticalNavigation.title\") ?? \"\"}\n onCollapseButtonClick={!isCompactMode ? closePanelHandler : undefined}\n collapseButtonProps={{\n \"aria-label\": collapseButtonAriaLabel,\n \"aria-expanded\": isVerticalNavigationExpanded\n }}\n backButtonProps={{\n \"aria-label\":\n t(\"verticalNavigation.ariaLabelHeaderBackButton\") ?? \"\"\n }}\n />\n\n <HvVerticalNavigationTree\n key={rootMenuItemId}\n mode=\"navigation\"\n collapsible\n aria-label={t(\"verticalNavigation.ariaLabelNavigationTree\") ?? \"\"}\n selected={selectedMenuItemId ?? \"\"}\n onChange={changeHandler}\n data={verticalNavigationItems}\n classes={{ navigationPopup: navigationPopupStyles }}\n sliderForwardButtonAriaLabel={\n t(\"verticalNavigation.ariaLabelSliderForwardButton\") ?? \"\"\n }\n />\n\n <HvVerticalNavigationActions />\n </StyledHvVerticalNavigation>\n </div>\n );\n};\n\nexport default withClickAwayListener(VerticalNavigation);\n"],"names":["VerticalNavigation","t","useTranslation","selectedMenuItemId","rootMenuItemId","verticalNavigationItems","isCompactMode","verticalNavigationMode","switchVerticalNavigationMode","useNavigationContext","setVerticalNavigationWidth","useLayoutContext","navigate","useHvNavigation","verticalNavigationRef","useRef","isVerticalNavigationExpanded","changeHandler","event","selectedItem","preventDefault","href","state","selectedItemId","id","closePanelHandler","useEffect","current","firstChild","childNodes","offsetWidth","collapseButtonAriaLabel","jsx","jsxs","StyledHvVerticalNavigation","HvVerticalNavigationHeader","undefined","HvVerticalNavigationTree","navigationPopup","navigationPopupStyles","HvVerticalNavigationActions","withClickAwayListener"],"mappings":";;;;;;;;;AAkBA,MAAMA,IAAqBA,MAAM;AACzB,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IACJC,oBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,yBAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,wBAAAA;AAAAA,IACAC,8BAAAA;AAAAA,MACEC,EAAqB,GACnB;AAAA,IAAEC,4BAAAA;AAAAA,MAA+BC,EAAiB,GAClD;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAgB,GAC/BC,IAAwBC,EAAuB,IAAI,GACnDC,IAA+BT,MAA2B,YAE1DU,IAAgBA,CACpBC,GACAC,MACG;AAGHD,IAAAA,EAAME,eAAe,GAEjBD,EAAaE,SACfT,EAASO,EAAaE,MAAM;AAAA,MAC1BC,OAAO;AAAA,QAAEC,gBAAgBJ,EAAaK;AAAAA,MAAG;AAAA,IAAA,CAC1C,GAEGlB,KAC2BE;EAEjC,GAGIiB,IAAoBA,MAAM;AACD,IAAAjB;EAAA;AAG/BkB,EAAAA,EAAU,MAAM;AACR,UAAA;AAAA,MAAEC,SAAAA;AAAAA,IAAYb,IAAAA,GACdc,IAAaD,KAAAA,gBAAAA,EAASE,WAAW;AACnCD,WACFlB,EADEkB,KAAc,CAACtB,IACUsB,EAAWE,cAEX,CAFsB,GAK5C,MAAMpB,EAA2B,CAAC;AAAA,EACxC,GAAA,CAACH,GAAwBD,GAAeI,CAA0B,CAAC;AAEtE,QAAMqB,IACF9B,EAD4Be,IAC1B,yCACA,oCADsC;AAG5C,SACG,gBAAAgB,EAAA,OAAA,EAAI,KAAKlB,GACR,UAAC,gBAAAmB,EAAAC,GAAA,EACC,eAAA5B,GACA,MAAMU,GACN,UAAQ,IACR,QAAQV,GACR,UAAA;AAAA,IAAC,gBAAA0B,EAAAG,GAAA,EACC,OAAOlC,EAAE,0BAA0B,KAAK,IACxC,uBAAwBK,IAAoC8B,SAApBX,GACxC,qBAAqB;AAAA,MACnB,cAAcM;AAAAA,MACd,iBAAiBf;AAAAA,OAEnB,iBAAiB;AAAA,MACf,cACEf,EAAE,8CAA8C,KAAK;AAAA,IAAA,GACvD;AAAA,sBAGHoC,GAEC,EAAA,MAAK,cACL,aAAW,IACX,cAAYpC,EAAE,4CAA4C,KAAK,IAC/D,UAAUE,KAAsB,IAChC,UAAUc,GACV,MAAMZ,GACN,SAAS;AAAA,MAAEiC,iBAAiBC;AAAAA,IAAAA,GAC5B,8BACEtC,EAAE,iDAAiD,KAAK,MATrDG,CAUJ;AAAA,sBAGFoC,GAA2B,EAAA;AAAA,EAAA,EAC9B,CAAA,EACF,CAAA;AAEJ,GAEeC,IAAAA,EAAsBzC,CAAkB;"}
@@ -0,0 +1,21 @@
1
+ import l from "@emotion/styled/base";
2
+ import { css as G } from "@emotion/css";
3
+ import { HvVerticalNavigation as W, theme as b, verticalNavigationTreeClasses as d } from "@hitachivantara/uikit-react-core";
4
+ const h = /* @__PURE__ */ l(W, process.env.NODE_ENV === "production" ? {
5
+ target: "ec8s0yn0"
6
+ } : {
7
+ target: "ec8s0yn0",
8
+ label: "StyledHvVerticalNavigation"
9
+ })("height:calc(100vh - ", b.header.height, ");top:", b.header.height, ";z-index:", b.zIndices.overlay, ";position:", (c) => c.isCompactMode ? "fixed" : "sticky", ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9WZXJ0aWNhbE5hdmlnYXRpb24vc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVrQyIsImZpbGUiOiIvX193L2h2LWFwcC1zaGVsbC9odi1hcHAtc2hlbGwvY2xpZW50L3BhY2thZ2VzL2FwcC1zaGVsbC11aS9zcmMvY29tcG9uZW50cy9sYXlvdXQvVmVydGljYWxOYXZpZ2F0aW9uL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gXCJAZW1vdGlvbi9jc3NcIjtcbmltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuXG5pbXBvcnQge1xuICBIdlZlcnRpY2FsTmF2aWdhdGlvbixcbiAgdGhlbWUsXG4gIHZlcnRpY2FsTmF2aWdhdGlvblRyZWVDbGFzc2VzXG59IGZyb20gXCJAaGl0YWNoaXZhbnRhcmEvdWlraXQtcmVhY3QtY29yZVwiO1xuXG5pbnRlcmZhY2UgU3R5bGVkSHZWZXJ0aWNhbE5hdmlnYXRpb25Qcm9wcyB7XG4gIGlzQ29tcGFjdE1vZGU6IGJvb2xlYW47XG59XG5cbmNvbnN0IFN0eWxlZEh2VmVydGljYWxOYXZpZ2F0aW9uID0gc3R5bGVkKFxuICBIdlZlcnRpY2FsTmF2aWdhdGlvblxuKTxTdHlsZWRIdlZlcnRpY2FsTmF2aWdhdGlvblByb3BzPmBcbiAgaGVpZ2h0OiBjYWxjKDEwMHZoIC0gJHt0aGVtZS5oZWFkZXIuaGVpZ2h0fSk7XG4gIHRvcDogJHt0aGVtZS5oZWFkZXIuaGVpZ2h0fTtcbiAgei1pbmRleDogJHt0aGVtZS56SW5kaWNlcy5vdmVybGF5fTtcblxuICBwb3NpdGlvbjogJHtwcm9wcyA9PiB7XG4gICAgaWYgKHByb3BzLmlzQ29tcGFjdE1vZGUpIHtcbiAgICAgIHJldHVybiBcImZpeGVkXCI7XG4gICAgfVxuXG4gICAgcmV0dXJuIFwic3RpY2t5XCI7XG4gIH19O1xuYDtcblxuY29uc3QgbmF2aWdhdGlvblBvcHVwU3R5bGVzID0gY3NzKHtcbiAgbWF4SGVpZ2h0OiBgY2FsYygxMDB2aCAtICR7dGhlbWUuaGVhZGVyLmhlaWdodH0pYCxcbiAgb3ZlcmZsb3dZOiBcImF1dG9cIixcbiAgYm94U2hhZG93OiB0aGVtZS5jb2xvcnMuc2hhZG93LFxuICBbYCYgLiR7dmVydGljYWxOYXZpZ2F0aW9uVHJlZUNsYXNzZXMucG9wdXB9YF06IHsgYm94U2hhZG93OiBcIm5vbmVcIiB9XG59KTtcblxuZXhwb3J0IHsgU3R5bGVkSHZWZXJ0aWNhbE5hdmlnYXRpb24sIG5hdmlnYXRpb25Qb3B1cFN0eWxlcyB9O1xuIl19 */")), I = /* @__PURE__ */ G({
10
+ maxHeight: `calc(100vh - ${b.header.height})`,
11
+ overflowY: "auto",
12
+ boxShadow: b.colors.shadow,
13
+ [`& .${d.popup}`]: {
14
+ boxShadow: "none"
15
+ }
16
+ }, process.env.NODE_ENV === "production" ? "" : ";label:navigationPopupStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9WZXJ0aWNhbE5hdmlnYXRpb24vc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZCOEIiLCJmaWxlIjoiL19fdy9odi1hcHAtc2hlbGwvaHYtYXBwLXNoZWxsL2NsaWVudC9wYWNrYWdlcy9hcHAtc2hlbGwtdWkvc3JjL2NvbXBvbmVudHMvbGF5b3V0L1ZlcnRpY2FsTmF2aWdhdGlvbi9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vY3NzXCI7XG5pbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcblxuaW1wb3J0IHtcbiAgSHZWZXJ0aWNhbE5hdmlnYXRpb24sXG4gIHRoZW1lLFxuICB2ZXJ0aWNhbE5hdmlnYXRpb25UcmVlQ2xhc3Nlc1xufSBmcm9tIFwiQGhpdGFjaGl2YW50YXJhL3Vpa2l0LXJlYWN0LWNvcmVcIjtcblxuaW50ZXJmYWNlIFN0eWxlZEh2VmVydGljYWxOYXZpZ2F0aW9uUHJvcHMge1xuICBpc0NvbXBhY3RNb2RlOiBib29sZWFuO1xufVxuXG5jb25zdCBTdHlsZWRIdlZlcnRpY2FsTmF2aWdhdGlvbiA9IHN0eWxlZChcbiAgSHZWZXJ0aWNhbE5hdmlnYXRpb25cbik8U3R5bGVkSHZWZXJ0aWNhbE5hdmlnYXRpb25Qcm9wcz5gXG4gIGhlaWdodDogY2FsYygxMDB2aCAtICR7dGhlbWUuaGVhZGVyLmhlaWdodH0pO1xuICB0b3A6ICR7dGhlbWUuaGVhZGVyLmhlaWdodH07XG4gIHotaW5kZXg6ICR7dGhlbWUuekluZGljZXMub3ZlcmxheX07XG5cbiAgcG9zaXRpb246ICR7cHJvcHMgPT4ge1xuICAgIGlmIChwcm9wcy5pc0NvbXBhY3RNb2RlKSB7XG4gICAgICByZXR1cm4gXCJmaXhlZFwiO1xuICAgIH1cblxuICAgIHJldHVybiBcInN0aWNreVwiO1xuICB9fTtcbmA7XG5cbmNvbnN0IG5hdmlnYXRpb25Qb3B1cFN0eWxlcyA9IGNzcyh7XG4gIG1heEhlaWdodDogYGNhbGMoMTAwdmggLSAke3RoZW1lLmhlYWRlci5oZWlnaHR9KWAsXG4gIG92ZXJmbG93WTogXCJhdXRvXCIsXG4gIGJveFNoYWRvdzogdGhlbWUuY29sb3JzLnNoYWRvdyxcbiAgW2AmIC4ke3ZlcnRpY2FsTmF2aWdhdGlvblRyZWVDbGFzc2VzLnBvcHVwfWBdOiB7IGJveFNoYWRvdzogXCJub25lXCIgfVxufSk7XG5cbmV4cG9ydCB7IFN0eWxlZEh2VmVydGljYWxOYXZpZ2F0aW9uLCBuYXZpZ2F0aW9uUG9wdXBTdHlsZXMgfTtcbiJdfQ== */");
17
+ export {
18
+ h as StyledHvVerticalNavigation,
19
+ I as navigationPopupStyles
20
+ };
21
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":["../../../../../src/components/layout/VerticalNavigation/styles.ts"],"sourcesContent":["import { css } from \"@emotion/css\";\nimport styled from \"@emotion/styled\";\n\nimport {\n HvVerticalNavigation,\n theme,\n verticalNavigationTreeClasses\n} from \"@hitachivantara/uikit-react-core\";\n\ninterface StyledHvVerticalNavigationProps {\n isCompactMode: boolean;\n}\n\nconst StyledHvVerticalNavigation = styled(\n HvVerticalNavigation\n)<StyledHvVerticalNavigationProps>`\n height: calc(100vh - ${theme.header.height});\n top: ${theme.header.height};\n z-index: ${theme.zIndices.overlay};\n\n position: ${props => {\n if (props.isCompactMode) {\n return \"fixed\";\n }\n\n return \"sticky\";\n }};\n`;\n\nconst navigationPopupStyles = css({\n maxHeight: `calc(100vh - ${theme.header.height})`,\n overflowY: \"auto\",\n boxShadow: theme.colors.shadow,\n [`& .${verticalNavigationTreeClasses.popup}`]: { boxShadow: \"none\" }\n});\n\nexport { StyledHvVerticalNavigation, navigationPopupStyles };\n"],"names":["StyledHvVerticalNavigation","HvVerticalNavigation","process","env","NODE_ENV","target","label","theme","header","height","zIndices","overlay","props","isCompactMode","navigationPopupStyles","css","maxHeight","overflowY","boxShadow","colors","shadow","verticalNavigationTreeClasses","popup"],"mappings":";;;AAaA,MAAMA,IACJC,gBAAAA,EAAAA,GAAoBC,QAAAC,IAAAC,aAAA,eAAA;AAAA,EAAAC,QAAA;AAAA,IAAA;AAAA,EAAAA,QAAA;AAAA,EAAAC,OAAA;AAAA,CACtB,0BACyBC,EAAMC,OAAOC,kBAC7BF,EAAMC,OAAOC,qBACTF,EAAMG,SAASC,SAEdC,cAAAA,CAASA,MACfA,EAAMC,gBACD,UAGF,iBACRX,QAAAC,IAAAC,aACF,eAAA,KAAA,ksDAAA,GAEKU,IAA4B,gBAAAC,EAAA;AAAA,EAChCC,WAAY,gBAAeT,EAAMC,OAAOC,MAAO;AAAA,EAC/CQ,WAAW;AAAA,EACXC,WAAWX,EAAMY,OAAOC;AAAAA,EACxB,CAAE,MAAKC,EAA8BC,KAAM,EAAC,GAAG;AAAA,IAAEJ,WAAW;AAAA,EAAO;AACrE,GAAChB,QAAAC,IAAAC,aAAAF,eAAAA,KAAAA,iCAAAA,QAAAC,IAAAC,aAAC,eAAA,KAAA,qsDAAA;"}
@@ -0,0 +1,5 @@
1
+ import e from "./components/AppShell/AppShell.js";
2
+ export {
3
+ e as default
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,19 @@
1
+ import { useCallback as a } from "react";
2
+ import { useLocation as e, useBeforeUnload as r } from "react-router-dom";
3
+ import { useHvNavigation as n } from "@hitachivantara/app-shell-navigation";
4
+ const s = () => {
5
+ const o = e(), {
6
+ navigate: t
7
+ } = n();
8
+ r(a(() => {
9
+ t({
10
+ ...o
11
+ }, {
12
+ replace: !0
13
+ });
14
+ }, [o, t]));
15
+ }, u = s;
16
+ export {
17
+ u as default
18
+ };
19
+ //# sourceMappingURL=useClearLocationState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClearLocationState.js","sources":["../../../../src/lib/hooks/useClearLocationState.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useBeforeUnload, useLocation } from \"react-router-dom\";\n\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nconst useClearLocationState = () => {\n const location = useLocation();\n const { navigate } = useHvNavigation();\n\n // This will only be called when the user reloads the page or navigates away from the app and is required when\n // the configuration changes (refresh is mandatory) so that useLocation `state` property is reset.\n useBeforeUnload(\n useCallback(() => {\n navigate({ ...location }, { replace: true });\n }, [location, navigate])\n );\n};\n\nexport default useClearLocationState;\n"],"names":["useClearLocationState","location","useLocation","navigate","useHvNavigation","useBeforeUnload","useCallback","replace","useClearLocationState$1"],"mappings":";;;AAKA,MAAMA,IAAwBA,MAAM;AAClC,QAAMC,IAAWC,KACX;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAgB;AAIrCC,EAAAA,EACEC,EAAY,MAAM;AACP,IAAAH,EAAA;AAAA,MAAE,GAAGF;AAAAA,IAAAA,GAAY;AAAA,MAAEM,SAAS;AAAA,IAAA,CAAM;AAAA,EAC1C,GAAA,CAACN,GAAUE,CAAQ,CAAC,CACzB;AACF,GAEAK,IAAeR;"}
@@ -0,0 +1,18 @@
1
+ import { useEffect as o } from "react";
2
+ import { HvAppShellEventNotificationTrigger as n, HvAppShellEventThemeTrigger as i } from "@hitachivantara/app-shell-events";
3
+ import r from "./useNotificationsEventListener.js";
4
+ import s from "./useThemeEventListener.js";
5
+ const v = () => {
6
+ const {
7
+ handleNotificationEvent: e
8
+ } = r(), {
9
+ handleThemeEvent: t
10
+ } = s();
11
+ o(() => (globalThis.addEventListener(n, e), globalThis.addEventListener(i, t), () => {
12
+ globalThis.removeEventListener(n, e), globalThis.removeEventListener(i, t);
13
+ }), [e, t]);
14
+ }, h = v;
15
+ export {
16
+ h as default
17
+ };
18
+ //# sourceMappingURL=useCustomEventListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCustomEventListener.js","sources":["../../../../src/lib/hooks/useCustomEventListener.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport {\n HvAppShellEventThemeTrigger,\n HvAppShellEventNotificationTrigger\n} from \"@hitachivantara/app-shell-events\";\nimport useNotificationsEventListener from \"./useNotificationsEventListener\";\nimport useThemeEventListener from \"./useThemeEventListener\";\n\nconst useCustomEventListener = () => {\n const { handleNotificationEvent } = useNotificationsEventListener();\n const { handleThemeEvent } = useThemeEventListener();\n\n useEffect(() => {\n globalThis.addEventListener(\n HvAppShellEventNotificationTrigger,\n handleNotificationEvent as EventListener\n );\n globalThis.addEventListener(\n HvAppShellEventThemeTrigger,\n handleThemeEvent as EventListener\n );\n\n return () => {\n globalThis.removeEventListener(\n HvAppShellEventNotificationTrigger,\n handleNotificationEvent as EventListener\n );\n globalThis.removeEventListener(\n HvAppShellEventThemeTrigger,\n handleThemeEvent as EventListener\n );\n };\n }, [handleNotificationEvent, handleThemeEvent]);\n};\n\nexport default useCustomEventListener;\n"],"names":["useCustomEventListener","handleNotificationEvent","useNotificationsEventListener","handleThemeEvent","useThemeEventListener","useEffect","addEventListener","HvAppShellEventNotificationTrigger","HvAppShellEventThemeTrigger","removeEventListener","useCustomEventListener$1"],"mappings":";;;;AAQA,MAAMA,IAAyBA,MAAM;AAC7B,QAAA;AAAA,IAAEC,yBAAAA;AAAAA,MAA4BC,EAA8B,GAC5D;AAAA,IAAEC,kBAAAA;AAAAA,MAAqBC,EAAsB;AAEnDC,EAAAA,EAAU,OACGC,WAAAA,iBACTC,GACAN,CACF,GACWK,WAAAA,iBACTE,GACAL,CACF,GAEO,MAAM;AACAM,eAAAA,oBACTF,GACAN,CACF,GACWQ,WAAAA,oBACTD,GACAL,CACF;AAAA,EAAA,IAED,CAACF,GAAyBE,CAAgB,CAAC;AAChD,GAEAO,IAAeV;"}
@@ -0,0 +1,24 @@
1
+ import { useState as n, useEffect as c } from "react";
2
+ const g = {
3
+ COLOR_MODE: "hv/user-preferences/color-mode"
4
+ }, l = (e) => {
5
+ const [r, a] = n(() => localStorage.getItem(e)), s = (t) => {
6
+ localStorage.setItem(e, t);
7
+ };
8
+ return c(() => {
9
+ const t = (o) => {
10
+ o.key === e && a(o.newValue);
11
+ };
12
+ return window.addEventListener("storage", t), () => {
13
+ window.removeEventListener("storage", t);
14
+ };
15
+ }, [e]), {
16
+ value: r,
17
+ setStoredValue: s
18
+ };
19
+ }, S = l;
20
+ export {
21
+ g as LOCAL_STORAGE_KEYS,
22
+ S as default
23
+ };
24
+ //# sourceMappingURL=useLocalStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLocalStorage.js","sources":["../../../../src/lib/hooks/useLocalStorage.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nexport const LOCAL_STORAGE_KEYS = {\n COLOR_MODE: \"hv/user-preferences/color-mode\"\n};\n\nconst useLocalStorage = (key: string) => {\n const [value, setValue] = useState(() => localStorage.getItem(key));\n\n const setStoredValue = (newValue: string) => {\n localStorage.setItem(key, newValue);\n };\n\n useEffect(() => {\n const handleStorageChange = (event: StorageEvent) => {\n if (event.key === key) {\n setValue(event.newValue);\n }\n };\n\n window.addEventListener(\"storage\", handleStorageChange);\n\n return () => {\n window.removeEventListener(\"storage\", handleStorageChange);\n };\n }, [key]);\n\n return { value, setStoredValue };\n};\n\nexport default useLocalStorage;\n"],"names":["LOCAL_STORAGE_KEYS","COLOR_MODE","useLocalStorage","key","value","setValue","useState","localStorage","getItem","setStoredValue","newValue","setItem","useEffect","handleStorageChange","event","addEventListener","removeEventListener","useLocalStorage$1"],"mappings":";AAEO,MAAMA,IAAqB;AAAA,EAChCC,YAAY;AACd,GAEMC,IAAkBA,CAACC,MAAgB;AACjC,QAAA,CAACC,GAAOC,CAAQ,IAAIC,EAAS,MAAMC,aAAaC,QAAQL,CAAG,CAAC,GAE5DM,IAAiBA,CAACC,MAAqB;AAC9BC,iBAAAA,QAAQR,GAAKO,CAAQ;AAAA,EAAA;AAGpCE,SAAAA,EAAU,MAAM;AACRC,UAAAA,IAAsBA,CAACC,MAAwB;AAC/CA,MAAAA,EAAMX,QAAQA,KAChBE,EAASS,EAAMJ,QAAQ;AAAA,IACzB;AAGKK,kBAAAA,iBAAiB,WAAWF,CAAmB,GAE/C,MAAM;AACJG,aAAAA,oBAAoB,WAAWH,CAAmB;AAAA,IAAA;AAAA,EAC3D,GACC,CAACV,CAAG,CAAC,GAED;AAAA,IAAEC,OAAAA;AAAAA,IAAOK,gBAAAA;AAAAA,EAAAA;AAClB,GAEAQ,IAAef;"}
@@ -0,0 +1,33 @@
1
+ import { useContext as c, useMemo as f, useEffect as g } from "react";
2
+ import { useLocation as p } from "react-router-dom";
3
+ import { useHvAppShellConfig as v, HvAppShellRuntimeContext as M, CONFIG_TRANSLATIONS_NAMESPACE as I, useHvMenuItems as N } from "@hitachivantara/app-shell-shared";
4
+ import { useHvNavigation as d } from "@hitachivantara/app-shell-navigation";
5
+ import { createNavigationMenuItems as l } from "../utils/navigationUtil.js";
6
+ const A = 2, T = () => {
7
+ const {
8
+ pathname: s
9
+ } = p(), {
10
+ navigationMode: m
11
+ } = v(), {
12
+ navigate: i
13
+ } = d(), {
14
+ i18n: e
15
+ } = c(M) ?? {}, a = f(() => (e == null ? void 0 : e.getFixedT(e.language, I)) ?? // should not happen, but fallback if the i18n instance is not available
16
+ ((o) => o), [e]), {
17
+ items: t,
18
+ selectedMenuItemId: n,
19
+ rootMenuItemId: u
20
+ } = N(), r = l(a, t, m === "ONLY_TOP" ? A : void 0);
21
+ return g(() => {
22
+ var o;
23
+ !n && s === "/" && ((o = t[0]) != null && o.href) && i(t[0].href);
24
+ }, [s, t, i, n]), {
25
+ items: r,
26
+ selectedMenuItemId: n,
27
+ rootMenuItemId: u
28
+ };
29
+ }, O = T;
30
+ export {
31
+ O as default
32
+ };
33
+ //# sourceMappingURL=useNavigationMenuItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNavigationMenuItems.js","sources":["../../../../src/lib/hooks/useNavigationMenuItems.tsx"],"sourcesContent":["import { useContext, useEffect, useMemo } from \"react\";\nimport { useLocation } from \"react-router-dom\";\n\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellRuntimeContext,\n useHvAppShellConfig,\n useHvMenuItems\n} from \"@hitachivantara/app-shell-shared\";\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nimport { createNavigationMenuItems } from \"../utils/navigationUtil\";\nimport { MenuItemsContext } from \"../types\";\n\nconst MAX_TOP_MENU_DEPTH = 2;\n\nconst useNavigationMenuItems = (): MenuItemsContext => {\n // use the i18n instance from the app shell runtime context to ensure we're using\n // the app shell instance of i18n and not the one from the embedded app\n const { pathname } = useLocation();\n const { navigationMode } = useHvAppShellConfig();\n const { navigate } = useHvNavigation();\n const { i18n } = useContext(HvAppShellRuntimeContext) ?? {};\n const tConfig = useMemo(\n () =>\n i18n?.getFixedT(i18n.language, CONFIG_TRANSLATIONS_NAMESPACE) ??\n // should not happen, but fallback if the i18n instance is not available\n ((l: string) => l),\n [i18n]\n );\n\n const { items, selectedMenuItemId, rootMenuItemId } = useHvMenuItems();\n const navigationMenuItemsTmp = createNavigationMenuItems(\n tConfig,\n items,\n navigationMode === \"ONLY_TOP\" ? MAX_TOP_MENU_DEPTH : undefined\n );\n useEffect(() => {\n // First render (or a refresh) without written user url, then navigate to the first menu item\n if (!selectedMenuItemId && pathname === \"/\" && items[0]?.href) {\n navigate(items[0].href);\n }\n }, [pathname, items, navigate, selectedMenuItemId]);\n return {\n items: navigationMenuItemsTmp,\n selectedMenuItemId,\n rootMenuItemId\n };\n};\n\nexport default useNavigationMenuItems;\n"],"names":["MAX_TOP_MENU_DEPTH","useNavigationMenuItems","pathname","useLocation","navigationMode","useHvAppShellConfig","navigate","useHvNavigation","i18n","useContext","HvAppShellRuntimeContext","tConfig","useMemo","getFixedT","language","CONFIG_TRANSLATIONS_NAMESPACE","l","items","selectedMenuItemId","rootMenuItemId","useHvMenuItems","navigationMenuItemsTmp","createNavigationMenuItems","undefined","useEffect","href","useNavigationMenuItems$1"],"mappings":";;;;;AAcA,MAAMA,IAAqB,GAErBC,IAAyBA,MAAwB;AAG/C,QAAA;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAY,GAC3B;AAAA,IAAEC,gBAAAA;AAAAA,MAAmBC,EAAoB,GACzC;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAgB,GAC/B;AAAA,IAAEC,MAAAA;AAAAA,EAAAA,IAASC,EAAWC,CAAwB,KAAK,IACnDC,IAAUC,EACd,OACEJ,KAAAA,gBAAAA,EAAMK,UAAUL,EAAKM,UAAUC;AAAAA,GAE9B,CAACC,MAAcA,IAClB,CAACR,CAAI,CACP,GAEM;AAAA,IAAES,OAAAA;AAAAA,IAAOC,oBAAAA;AAAAA,IAAoBC,gBAAAA;AAAAA,MAAmBC,EAAe,GAC/DC,IAAyBC,EAC7BX,GACAM,GACAb,MAAmB,aAAaJ,IAAqBuB,MACvD;AACAC,SAAAA,EAAU,MAAM;;AAEd,IAAI,CAACN,KAAsBhB,MAAa,SAAOe,IAAAA,EAAM,CAAC,MAAPA,QAAAA,EAAUQ,SAC9CR,EAAAA,EAAM,CAAC,EAAEQ,IAAI;AAAA,KAEvB,CAACvB,GAAUe,GAAOX,GAAUY,CAAkB,CAAC,GAC3C;AAAA,IACLD,OAAOI;AAAAA,IACPH,oBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA;AAEJ,GAEAO,IAAezB;"}
@@ -0,0 +1,32 @@
1
+ import { useHvSnackbar as i } from "@hitachivantara/uikit-react-core";
2
+ import { NOTIFICATION_TYPE as n } from "@hitachivantara/app-shell-events";
3
+ import v from "../../providers/hooks/useBannerContext.js";
4
+ const d = () => {
5
+ const {
6
+ enqueueSnackbar: o
7
+ } = i(), {
8
+ show: r
9
+ } = v(), c = (e) => {
10
+ const t = e.actions ? {
11
+ action: Array.isArray(e.actions) ? e.actions[0] : e.actions,
12
+ actionCallback: e.actionsCallback
13
+ } : void 0;
14
+ e.message && o(e.message, {
15
+ variant: e.variant || "default",
16
+ snackbarContentProps: t
17
+ });
18
+ }, l = (e) => {
19
+ e.message && r(e);
20
+ };
21
+ return {
22
+ handleNotificationEvent: (e) => {
23
+ var s;
24
+ const t = e, a = (s = t.detail) == null ? void 0 : s.type.toUpperCase();
25
+ a === n.SNACKBAR ? c(t.detail) : a === n.BANNER ? l(t.detail) : console.warn("Invalid notification type", a);
26
+ }
27
+ };
28
+ }, N = d;
29
+ export {
30
+ N as default
31
+ };
32
+ //# sourceMappingURL=useNotificationsEventListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotificationsEventListener.js","sources":["../../../../src/lib/hooks/useNotificationsEventListener.ts"],"sourcesContent":["import { useHvSnackbar } from \"@hitachivantara/uikit-react-core\";\nimport {\n HvAppShellEventNotification,\n NOTIFICATION_TYPE\n} from \"@hitachivantara/app-shell-events\";\n\nimport useBannerContext from \"../../providers/hooks/useBannerContext\";\n\nconst useNotificationsEventListener = () => {\n const { enqueueSnackbar } = useHvSnackbar();\n const { show } = useBannerContext();\n\n const handleCustomEventSnackbar = (\n notification: HvAppShellEventNotification\n ) => {\n const snackbarContentProps = notification.actions\n ? {\n action: Array.isArray(notification.actions)\n ? notification.actions[0]\n : notification.actions,\n actionCallback: notification.actionsCallback\n }\n : undefined;\n\n if (notification.message) {\n enqueueSnackbar(notification.message, {\n variant: notification.variant || \"default\",\n snackbarContentProps\n });\n }\n };\n\n const handleCustomEventBanner = (\n notification: HvAppShellEventNotification\n ) => {\n if (notification.message) {\n show(notification);\n }\n };\n\n const handleNotificationEvent = (eventAux: CustomEvent) => {\n // as typescript is not validating the type, the cast will be possible even for the cases that type values is\n // not aligned with the type definition (e.g. Snackbar)\n // It was decided to not use the type at CustomEvent to avoid case-sensitive issues for the notification type\n const event = eventAux as CustomEvent<HvAppShellEventNotification>;\n const type = event.detail?.type.toUpperCase();\n if (type === NOTIFICATION_TYPE.SNACKBAR) {\n handleCustomEventSnackbar(event.detail);\n } else if (type === NOTIFICATION_TYPE.BANNER) {\n handleCustomEventBanner(event.detail);\n } else {\n console.warn(\"Invalid notification type\", type);\n }\n };\n\n return { handleNotificationEvent };\n};\n\nexport default useNotificationsEventListener;\n"],"names":["useNotificationsEventListener","enqueueSnackbar","useHvSnackbar","show","useBannerContext","handleCustomEventSnackbar","notification","snackbarContentProps","actions","action","Array","isArray","actionCallback","actionsCallback","undefined","message","variant","handleCustomEventBanner","handleNotificationEvent","eventAux","event","type","detail","toUpperCase","NOTIFICATION_TYPE","SNACKBAR","BANNER","warn","useNotificationsEventListener$1"],"mappings":";;;AAQA,MAAMA,IAAgCA,MAAM;AACpC,QAAA;AAAA,IAAEC,iBAAAA;AAAAA,MAAoBC,EAAc,GACpC;AAAA,IAAEC,MAAAA;AAAAA,MAASC,EAAiB,GAE5BC,IAA4BA,CAChCC,MACG;AACGC,UAAAA,IAAuBD,EAAaE,UACtC;AAAA,MACEC,QAAQC,MAAMC,QAAQL,EAAaE,OAAO,IACtCF,EAAaE,QAAQ,CAAC,IACtBF,EAAaE;AAAAA,MACjBI,gBAAgBN,EAAaO;AAAAA,IAE/BC,IAAAA;AAEJ,IAAIR,EAAaS,WACfd,EAAgBK,EAAaS,SAAS;AAAA,MACpCC,SAASV,EAAaU,WAAW;AAAA,MACjCT,sBAAAA;AAAAA,IAAAA,CACD;AAAA,EACH,GAGIU,IAA0BA,CAC9BX,MACG;AACH,IAAIA,EAAaS,WACfZ,EAAKG,CAAY;AAAA,EACnB;AAkBK,SAAA;AAAA,IAAEY,yBAfuBA,CAACC,MAA0B;;AAIzD,YAAMC,IAAQD,GACRE,KAAOD,IAAAA,EAAME,WAANF,gBAAAA,EAAcC,KAAKE;AAC5BF,MAAAA,MAASG,EAAkBC,WAC7BpB,EAA0Be,EAAME,MAAM,IAC7BD,MAASG,EAAkBE,SACpCT,EAAwBG,EAAME,MAAM,IAE5BK,QAAAA,KAAK,6BAA6BN,CAAI;AAAA,IAChD;AAAA,EAGOH;AACX,GAEAU,IAAe5B;"}
@@ -0,0 +1,27 @@
1
+ import { useTheme as h } from "@hitachivantara/uikit-react-core";
2
+ import m, { LOCAL_STORAGE_KEYS as a } from "./useLocalStorage.js";
3
+ const i = () => {
4
+ const {
5
+ selectedTheme: s,
6
+ changeTheme: d,
7
+ selectedMode: r,
8
+ colorModes: t
9
+ } = h(), {
10
+ setStoredValue: c
11
+ } = m(a.COLOR_MODE), l = () => {
12
+ const e = (t.indexOf(r) + 1) % t.length;
13
+ return t[e];
14
+ };
15
+ return {
16
+ handleThemeEvent: (o) => {
17
+ const {
18
+ colorMode: e
19
+ } = o.detail, n = !e || t.indexOf(e) === -1 ? l() : e;
20
+ d(s, n), c(n);
21
+ }
22
+ };
23
+ }, E = i;
24
+ export {
25
+ E as default
26
+ };
27
+ //# sourceMappingURL=useThemeEventListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useThemeEventListener.js","sources":["../../../../src/lib/hooks/useThemeEventListener.ts"],"sourcesContent":["import { useTheme } from \"@hitachivantara/uikit-react-core\";\n\nimport { HvAppShellEventTheme } from \"@hitachivantara/app-shell-events\";\nimport useLocalStorage, { LOCAL_STORAGE_KEYS } from \"./useLocalStorage\";\n\nconst useThemeEventListener = () => {\n const { selectedTheme, changeTheme, selectedMode, colorModes } = useTheme();\n const { setStoredValue } = useLocalStorage(LOCAL_STORAGE_KEYS.COLOR_MODE);\n\n const getNextColorMode = () => {\n const index = colorModes.indexOf(selectedMode);\n\n const nextIndex = (index + 1) % colorModes.length;\n return colorModes[nextIndex];\n };\n\n const handleThemeEvent = (event: CustomEvent<HvAppShellEventTheme>) => {\n const { colorMode } = event.detail;\n const newColorMode =\n !colorMode || colorModes.indexOf(colorMode) === -1\n ? getNextColorMode()\n : colorMode;\n\n // For now we only want to change the colorMode\n changeTheme(selectedTheme, newColorMode);\n setStoredValue(newColorMode);\n };\n\n return { handleThemeEvent };\n};\n\nexport default useThemeEventListener;\n"],"names":["useThemeEventListener","selectedTheme","changeTheme","selectedMode","colorModes","useTheme","setStoredValue","useLocalStorage","LOCAL_STORAGE_KEYS","COLOR_MODE","getNextColorMode","nextIndex","indexOf","length","handleThemeEvent","event","colorMode","detail","newColorMode","useThemeEventListener$1"],"mappings":";;AAKA,MAAMA,IAAwBA,MAAM;AAC5B,QAAA;AAAA,IAAEC,eAAAA;AAAAA,IAAeC,aAAAA;AAAAA,IAAaC,cAAAA;AAAAA,IAAcC,YAAAA;AAAAA,MAAeC,EAAS,GACpE;AAAA,IAAEC,gBAAAA;AAAAA,EAAAA,IAAmBC,EAAgBC,EAAmBC,UAAU,GAElEC,IAAmBA,MAAM;AAGvBC,UAAAA,KAFQP,EAAWQ,QAAQT,CAAY,IAElB,KAAKC,EAAWS;AAC3C,WAAOT,EAAWO,CAAS;AAAA,EAAA;AAetB,SAAA;AAAA,IAAEG,kBAZgBA,CAACC,MAA6C;AAC/D,YAAA;AAAA,QAAEC,WAAAA;AAAAA,MAAAA,IAAcD,EAAME,QACtBC,IACJ,CAACF,KAAaZ,EAAWQ,QAAQI,CAAS,MAAM,KAC5CN,EACAM,IAAAA;AAGNd,MAAAA,EAAYD,GAAeiB,CAAY,GACvCZ,EAAeY,CAAY;AAAA,IAAA;AAAA,EAGpBJ;AACX,GAEAK,IAAenB;"}
@@ -0,0 +1,29 @@
1
+ import s from "i18next";
2
+ import { initReactI18next as d } from "react-i18next";
3
+ import u from "i18next-browser-languagedetector";
4
+ import i from "./localization/en.json.js";
5
+ import l from "./localization/pt.json.js";
6
+ const t = "appShell", g = (e, n, r) => {
7
+ Object.entries(n).forEach((o) => {
8
+ const [a, c] = o;
9
+ e.addResourceBundle(a, r ?? t, c);
10
+ });
11
+ }, m = () => {
12
+ const e = s.createInstance();
13
+ return e.use(u).use(d).init({
14
+ defaultNS: t,
15
+ fallbackLng: "en",
16
+ detection: {
17
+ order: ["navigator"]
18
+ },
19
+ resources: {}
20
+ }), e.addResourceBundle("en", t, i), e.addResourceBundle("pt", t, l), {
21
+ i18n: e
22
+ };
23
+ }, B = m;
24
+ export {
25
+ t as APP_SHELL_NAMESPACE,
26
+ g as addResourceBundles,
27
+ B as default
28
+ };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/lib/i18n/index.ts"],"sourcesContent":["import i18next, { i18n } from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport en from \"./localization/en.json\";\nimport pt from \"./localization/pt.json\";\n\nexport const APP_SHELL_NAMESPACE = \"appShell\";\nexport const addResourceBundles = (\n i18nInstance: i18n,\n bundles: Record<string, object>,\n namespace?: string\n) => {\n Object.entries(bundles).forEach(entry => {\n const [key, value] = entry;\n i18nInstance.addResourceBundle(\n key,\n namespace ?? APP_SHELL_NAMESPACE,\n value\n );\n });\n};\n\nconst createI18Next = () => {\n const newInstance = i18next.createInstance();\n newInstance\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n defaultNS: APP_SHELL_NAMESPACE,\n fallbackLng: \"en\",\n detection: { order: [\"navigator\"] },\n resources: {}\n });\n\n newInstance.addResourceBundle(\"en\", APP_SHELL_NAMESPACE, en);\n newInstance.addResourceBundle(\"pt\", APP_SHELL_NAMESPACE, pt);\n\n return {\n i18n: newInstance\n };\n};\n\nexport default createI18Next;\n"],"names":["APP_SHELL_NAMESPACE","addResourceBundles","i18nInstance","bundles","namespace","Object","entries","forEach","entry","key","value","addResourceBundle","createI18Next","newInstance","i18next","createInstance","use","LanguageDetector","initReactI18next","init","defaultNS","fallbackLng","detection","order","resources","en","pt","i18n","createI18Next$1"],"mappings":";;;;;AAMO,MAAMA,IAAsB,YACtBC,IAAqBA,CAChCC,GACAC,GACAC,MACG;AACHC,SAAOC,QAAQH,CAAO,EAAEI,QAAQC,CAASA,MAAA;AACjC,UAAA,CAACC,GAAKC,CAAK,IAAIF;AACrBN,IAAAA,EAAaS,kBACXF,GACAL,KAAaJ,GACbU,CACF;AAAA,EAAA,CACD;AACH,GAEME,IAAgBA,MAAM;AACpBC,QAAAA,IAAcC,EAAQC;AAC5BF,SAAAA,EACGG,IAAIC,CAAgB,EACpBD,IAAIE,CAAgB,EACpBC,KAAK;AAAA,IACJC,WAAWpB;AAAAA,IACXqB,aAAa;AAAA,IACbC,WAAW;AAAA,MAAEC,OAAO,CAAC,WAAW;AAAA,IAAE;AAAA,IAClCC,WAAW,CAAC;AAAA,EAAA,CACb,GAESb,EAAAA,kBAAkB,MAAMX,GAAqByB,CAAE,GAC/Cd,EAAAA,kBAAkB,MAAMX,GAAqB0B,CAAE,GAEpD;AAAA,IACLC,MAAMd;AAAAA,EAAAA;AAEV,GAEAe,IAAehB;"}
@@ -0,0 +1,55 @@
1
+ const a = {
2
+ missing: {
3
+ configuration: "Missing or incomplete configuration."
4
+ },
5
+ notFound: {
6
+ code: "404",
7
+ title: "Oops! Seems like the page is lost in space.",
8
+ image_description: "404 Page not found"
9
+ },
10
+ genericError: {
11
+ code: "500",
12
+ title: "Shoot! We have a problem! Be back soon.",
13
+ image_description: "500 Generic error"
14
+ },
15
+ footer: "Click <navigate>here</navigate> to go back to the {{label}} page."
16
+ }, e = {
17
+ helpUrl: {
18
+ documentationLink: "Documentation link"
19
+ },
20
+ appSwitcher: {
21
+ title: "Apps",
22
+ ariaLabel: "App Switcher Panel"
23
+ },
24
+ navigation: {
25
+ openNavigationPanel: "Open navigation panel",
26
+ closeNavigationPanel: "Close navigation panel"
27
+ },
28
+ colorModeSwitcher: {
29
+ ariaLabel: "Switch color mode"
30
+ }
31
+ }, i = {
32
+ ariaLabelNavigationTree: "Vertical navigation",
33
+ ariaLabelCollapse: "Collapse vertical navigation",
34
+ ariaLabelExpand: "Expand vertical navigation",
35
+ title: "Menu",
36
+ ariaLabelSliderForwardButton: "Navigate to submenu",
37
+ ariaLabelHeaderBackButton: "Back"
38
+ }, o = {
39
+ banner: {
40
+ close: "Close banner"
41
+ }
42
+ }, n = {
43
+ errors: a,
44
+ header: e,
45
+ verticalNavigation: i,
46
+ notifications: o
47
+ };
48
+ export {
49
+ n as default,
50
+ a as errors,
51
+ e as header,
52
+ o as notifications,
53
+ i as verticalNavigation
54
+ };
55
+ //# sourceMappingURL=en.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,55 @@
1
+ const a = {
2
+ missing: {
3
+ configuration: "Configuração em falta ou incompleta."
4
+ },
5
+ notFound: {
6
+ code: "404",
7
+ title: "Oops! Parece que a página está perdida no espaço.",
8
+ image_description: "404 Página não encontrada"
9
+ },
10
+ genericError: {
11
+ code: "500",
12
+ title: "Bolas! Temos um problema! Estaremos de volta em breve.",
13
+ image_description: "500 Erro genérico"
14
+ },
15
+ footer: "Carregue <navigate>aqui</navigate> para voltar à página {{label}}."
16
+ }, e = {
17
+ helpUrl: {
18
+ documentationLink: "Link de documentação"
19
+ },
20
+ appSwitcher: {
21
+ title: "Aplicações",
22
+ ariaLabel: "Painel do App Switcher"
23
+ },
24
+ navigation: {
25
+ openNavigationPanel: "Abrir painel de navegação",
26
+ closeNavigationPanel: "Fechar painel de navegação"
27
+ },
28
+ colorModeSwitcher: {
29
+ ariaLabel: "Alternar modo de cor"
30
+ }
31
+ }, o = {
32
+ ariaLabelNavigationTree: "Navegação vertical",
33
+ ariaLabelCollapse: "Recolher navegação vertical",
34
+ ariaLabelExpand: "Expandir navegação vertical",
35
+ title: "Menu",
36
+ ariaLabelSliderForwardButton: "Navegar para submenu",
37
+ ariaLabelHeaderBackButton: "Voltar"
38
+ }, i = {
39
+ banner: {
40
+ close: "Fechar barra de notificação"
41
+ }
42
+ }, r = {
43
+ errors: a,
44
+ header: e,
45
+ verticalNavigation: o,
46
+ notifications: i
47
+ };
48
+ export {
49
+ r as default,
50
+ a as errors,
51
+ e as header,
52
+ i as notifications,
53
+ o as verticalNavigation
54
+ };
55
+ //# sourceMappingURL=pt.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pt.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,18 @@
1
+ import { jsx as n } from "@emotion/react/jsx-runtime";
2
+ import { useCallback as m } from "react";
3
+ const u = ({
4
+ providers: e,
5
+ children: o
6
+ }) => {
7
+ const i = m(({
8
+ children: t
9
+ }) => {
10
+ let r = t;
11
+ return e && e.length > 0 && (r = e.reduceRight((l, c) => /* @__PURE__ */ n(c, { children: l }), t)), r;
12
+ }, [e]);
13
+ return /* @__PURE__ */ n(i, { children: o });
14
+ }, a = u;
15
+ export {
16
+ a as default
17
+ };
18
+ //# sourceMappingURL=CombinedProviders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CombinedProviders.js","sources":["../../../../src/lib/utils/CombinedProviders.tsx"],"sourcesContent":["import { ComponentType, ReactNode, useCallback, ReactElement } from \"react\";\n\ntype CombinedProvidersProps = {\n providers: ComponentType<{ children: ReactNode }>[] | undefined;\n children: ReactNode;\n};\n\nconst CombinedProviders = ({\n providers,\n children: mainChildren\n}: CombinedProvidersProps) => {\n const Combined = useCallback(\n ({ children }: { children: ReactNode }) => {\n let result = children;\n\n if (providers && providers.length > 0) {\n result = providers.reduceRight((Acc, Curr) => {\n return <Curr>{Acc}</Curr>;\n }, children);\n }\n\n return result as ReactElement;\n },\n [providers]\n );\n return <Combined>{mainChildren}</Combined>;\n};\n\nexport default CombinedProviders;\n"],"names":["CombinedProviders","providers","children","mainChildren","Combined","useCallback","result","length","reduceRight","Acc","Curr","jsx","CombinedProviders$1"],"mappings":";;AAOA,MAAMA,IAAoBA,CAAC;AAAA,EACzBC,WAAAA;AAAAA,EACAC,UAAUC;AACY,MAAM;AACtBC,QAAAA,IAAWC,EACf,CAAC;AAAA,IAAEH,UAAAA;AAAAA,EAAAA,MAAwC;AACzC,QAAII,IAASJ;AAETD,WAAAA,KAAaA,EAAUM,SAAS,MAClCD,IAASL,EAAUO,YAAY,CAACC,GAAKC,MAC5B,gBAAAC,EAACD,KAAMD,UAAIA,EAAA,CAAA,GACjBP,CAAQ,IAGNI;AAAAA,EAAAA,GAET,CAACL,CAAS,CACZ;AACO,SAAA,gBAAAU,EAACP,KAAUD,UAAaA,EAAA,CAAA;AACjC,GAEAS,IAAeZ;"}
@@ -0,0 +1,5 @@
1
+ const e = (t) => (t == null ? void 0 : t.baseUrl) ?? "/", a = e;
2
+ export {
3
+ a as default
4
+ };
5
+ //# sourceMappingURL=basePathUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basePathUtils.js","sources":["../../../../src/lib/utils/basePathUtils.ts"],"sourcesContent":["import { HvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\n/**\n * Returns the app base path.\n * - The path is calculated by returning the sub-path value for the main app.\n * - Main app is the first app that baseUrl matches window.location\n * - App baseUrl don't have case restrictions\n * - If the main app is not discovered, returns \"/\"\n *\n * @return The main app baseUrl, or \"/\" otherwise. Value is always returned in lowercase.\n * @param config The app configuration definition\n */\nconst getBasePath = (config: HvAppShellConfig) => {\n return config?.baseUrl ?? \"/\";\n};\n\nexport default getBasePath;\n"],"names":["getBasePath","config","baseUrl","getBasePath$1"],"mappings":"AAYA,MAAMA,IAAcA,CAACC,OACZA,KAAAA,gBAAAA,EAAQC,YAAW,KAG5BC,IAAeH;"}
@@ -0,0 +1,9 @@
1
+ const a = (t) => {
2
+ const n = "app-shell-panel-container";
3
+ let e = document.getElementById(t ?? n);
4
+ return e || (e = document.createElement("div"), e.id = n, document.body.appendChild(e)), e;
5
+ }, l = a;
6
+ export {
7
+ l as default
8
+ };
9
+ //# sourceMappingURL=documentUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentUtil.js","sources":["../../../../src/lib/utils/documentUtil.ts"],"sourcesContent":["const createAppContainerElement = (id?: string): HTMLElement => {\n const panelContainerId = \"app-shell-panel-container\";\n let panelContainerElement = document.getElementById(id ?? panelContainerId);\n\n if (!panelContainerElement) {\n panelContainerElement = document.createElement(\"div\");\n panelContainerElement.id = panelContainerId;\n document.body.appendChild(panelContainerElement);\n }\n\n return panelContainerElement;\n};\n\nexport default createAppContainerElement;\n"],"names":["createAppContainerElement","id","panelContainerId","panelContainerElement","document","getElementById","createElement","body","appendChild","createAppContainerElement$1"],"mappings":"AAAA,MAAMA,IAA4BA,CAACC,MAA6B;AAC9D,QAAMC,IAAmB;AACzB,MAAIC,IAAwBC,SAASC,eAAeJ,KAAMC,CAAgB;AAE1E,SAAKC,MACqBC,IAAAA,SAASE,cAAc,KAAK,GACpDH,EAAsBF,KAAKC,GAClBK,SAAAA,KAAKC,YAAYL,CAAqB,IAG1CA;AACT,GAEAM,IAAeT;"}
@@ -0,0 +1,41 @@
1
+ import { jsx as a } from "@emotion/react/jsx-runtime";
2
+ import f from "../../components/IconUiKit/index.js";
3
+ const l = (e, t, n) => n !== void 0 && n <= 0 ? [] : (t == null ? void 0 : t.reduce((r, o) => {
4
+ var i;
5
+ const d = n !== void 0 ? n - 1 : void 0, s = {
6
+ ...o,
7
+ icon: o.icon ? /* @__PURE__ */ a(f, { name: ((i = o.icon) == null ? void 0 : i.name) || "" }) : null,
8
+ data: o.data ? l(e, o.data, d) : void 0
9
+ };
10
+ return r.push(s), r;
11
+ }, [])) ?? [], c = (e, t) => {
12
+ let n = null;
13
+ return e.some((r) => {
14
+ const {
15
+ id: o,
16
+ data: d
17
+ } = r;
18
+ return o === t ? (n = r, !0) : d && d.length > 0 ? (n = c(d, t), n !== null) : !1;
19
+ }), n;
20
+ }, h = (e) => {
21
+ const t = e.split("/");
22
+ let n;
23
+ return t[0].startsWith("@") ? n = `${t[0]}/${t[1]}` : [n] = t, n;
24
+ }, p = (e) => e.map((t) => {
25
+ const {
26
+ href: n,
27
+ data: r,
28
+ ...o
29
+ } = t;
30
+ return r && r.length > 0 ? {
31
+ ...o,
32
+ data: p(r)
33
+ } : t;
34
+ });
35
+ export {
36
+ l as createNavigationMenuItems,
37
+ c as findItemById,
38
+ h as getAppIdFromBundle,
39
+ p as removeHrefFromMenuItemsWithChildren
40
+ };
41
+ //# sourceMappingURL=navigationUtil.js.map