@carbon-labs/wc-global-header 0.1.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 (243) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +34 -0
  3. package/es/_virtual/_commonjsHelpers.js +6 -0
  4. package/es/_virtual/_commonjsHelpers.js.map +1 -0
  5. package/es/_virtual/index.js +8 -0
  6. package/es/_virtual/index.js.map +1 -0
  7. package/es/_virtual/index2.js +4 -0
  8. package/es/_virtual/index2.js.map +1 -0
  9. package/es/components/global-header/global-header.d.ts +15 -0
  10. package/es/components/global-header/global-header.js +23 -0
  11. package/es/components/global-header/global-header.js.map +1 -0
  12. package/es/components/global-header/src/components/AuthContext/AuthContext.d.ts +26 -0
  13. package/es/components/global-header/src/components/AuthContext/AuthContext.js +238 -0
  14. package/es/components/global-header/src/components/AuthContext/AuthContext.js.map +1 -0
  15. package/es/components/global-header/src/components/AuthContext/AuthContext.types.d.ts +17 -0
  16. package/es/components/global-header/src/components/AuthContext/__stories__/AuthContext.stories.d.ts +12 -0
  17. package/es/components/global-header/src/components/AuthContext/__tests__/AuthContext.test.d.ts +9 -0
  18. package/es/components/global-header/src/components/AuthContext/_index.scss.js +6 -0
  19. package/es/components/global-header/src/components/AuthContext/_index.scss.js.map +1 -0
  20. package/es/components/global-header/src/components/CommonHeader/CommonHeader.d.ts +36 -0
  21. package/es/components/global-header/src/components/CommonHeader/CommonHeader.js +245 -0
  22. package/es/components/global-header/src/components/CommonHeader/CommonHeader.js.map +1 -0
  23. package/es/components/global-header/src/components/CommonHeader/WideSideNav.d.ts +15 -0
  24. package/es/components/global-header/src/components/CommonHeader/WideSideNav.js +32 -0
  25. package/es/components/global-header/src/components/CommonHeader/WideSideNav.js.map +1 -0
  26. package/es/components/global-header/src/components/CommonHeader/__stories__/CommonHeader.stories.d.ts +20 -0
  27. package/es/components/global-header/src/components/CommonHeader/__stories__/SideNav.stories.d.ts +16 -0
  28. package/es/components/global-header/src/components/CommonHeader/__tests__/CommonHeader.test.d.ts +9 -0
  29. package/es/components/global-header/src/components/CommonHeader/__tests__/WideSideNav.test.d.ts +9 -0
  30. package/es/components/global-header/src/components/CommonHeader/_index.scss.js +6 -0
  31. package/es/components/global-header/src/components/CommonHeader/_index.scss.js.map +1 -0
  32. package/es/components/global-header/src/components/HeaderContext/HeaderContext.d.ts +43 -0
  33. package/es/components/global-header/src/components/HeaderContext/HeaderContext.js +311 -0
  34. package/es/components/global-header/src/components/HeaderContext/HeaderContext.js.map +1 -0
  35. package/es/components/global-header/src/components/HeaderContext/HeaderContext.types.d.ts +46 -0
  36. package/es/components/global-header/src/components/HeaderContext/__tests__/HeaderContext.test.d.ts +9 -0
  37. package/es/components/global-header/src/components/HeaderContext/_index.scss.js +6 -0
  38. package/es/components/global-header/src/components/HeaderContext/_index.scss.js.map +1 -0
  39. package/es/components/global-header/src/components/HybridIpaasHeader/HybridIpaasHeader.d.ts +41 -0
  40. package/es/components/global-header/src/components/HybridIpaasHeader/__stories__/HybridIPaasHeader.stories.d.ts +20 -0
  41. package/es/components/global-header/src/components/HybridIpaasHeader/__tests__/HybridIpaasHeader.test.d.ts +10 -0
  42. package/es/components/global-header/src/components/LogoutHeader/LogoutHeader.d.ts +17 -0
  43. package/es/components/global-header/src/components/LogoutHeader/__stories__/LogoutHeader.stories.d.ts +15 -0
  44. package/es/components/global-header/src/components/LogoutHeader/__tests__/LogoutHeader.test.d.ts +9 -0
  45. package/es/components/global-header/src/components/LogoutTile/LogoutTile.d.ts +24 -0
  46. package/es/components/global-header/src/components/LogoutTile/__stories__/LogoutTile.stories.d.ts +14 -0
  47. package/es/components/global-header/src/components/LogoutTile/__tests__/LogoutTile.test.d.ts +9 -0
  48. package/es/components/global-header/src/components/ProfilePopover/ProfilePopover.d.ts +22 -0
  49. package/es/components/global-header/src/components/ProfilePopover/ProfilePopover.js +100 -0
  50. package/es/components/global-header/src/components/ProfilePopover/ProfilePopover.js.map +1 -0
  51. package/es/components/global-header/src/components/ProfilePopover/__tests__/ProfilePopover.test.d.ts +9 -0
  52. package/es/components/global-header/src/components/ProfilePopover/_index.scss.js +6 -0
  53. package/es/components/global-header/src/components/ProfilePopover/_index.scss.js.map +1 -0
  54. package/es/components/global-header/src/components/Search/Search.d.ts +25 -0
  55. package/es/components/global-header/src/components/Search/Search.js +72 -0
  56. package/es/components/global-header/src/components/Search/Search.js.map +1 -0
  57. package/es/components/global-header/src/components/Search/__tests__/Search.test.d.ts +9 -0
  58. package/es/components/global-header/src/components/Search/_index.scss.js +6 -0
  59. package/es/components/global-header/src/components/Search/_index.scss.js.map +1 -0
  60. package/es/components/global-header/src/components/SideNavItem/SideNavItem.d.ts +31 -0
  61. package/es/components/global-header/src/components/SideNavItem/SideNavItem.js +214 -0
  62. package/es/components/global-header/src/components/SideNavItem/SideNavItem.js.map +1 -0
  63. package/es/components/global-header/src/components/SideNavItem/SideNavItem.scss.js +6 -0
  64. package/es/components/global-header/src/components/SideNavItem/SideNavItem.scss.js.map +1 -0
  65. package/es/components/global-header/src/components/SideNavItem/__tests__/SideNavItem.test.d.ts +9 -0
  66. package/es/components/global-header/src/components/Switcher/Switcher.d.ts +29 -0
  67. package/es/components/global-header/src/components/Switcher/Switcher.js +188 -0
  68. package/es/components/global-header/src/components/Switcher/Switcher.js.map +1 -0
  69. package/es/components/global-header/src/components/Switcher/Switcher.types.d.ts +11 -0
  70. package/es/components/global-header/src/components/Switcher/__tests__/Switcher.test.d.ts +9 -0
  71. package/es/components/global-header/src/components/Switcher/_index.scss.js +6 -0
  72. package/es/components/global-header/src/components/Switcher/_index.scss.js.map +1 -0
  73. package/es/components/global-header/src/components/TrialContent/TrialContent.d.ts +11 -0
  74. package/es/components/global-header/src/components/TrialContent/TrialContent.js +74 -0
  75. package/es/components/global-header/src/components/TrialContent/TrialContent.js.map +1 -0
  76. package/es/components/global-header/src/components/TrialContent/TrialContent.types.d.ts +12 -0
  77. package/es/components/global-header/src/components/TrialContent/__stories__/TrialContent.stories.d.ts +14 -0
  78. package/es/components/global-header/src/components/TrialPopover/TrialPopover.d.ts +23 -0
  79. package/es/components/global-header/src/components/TrialPopover/TrialPopover.js +79 -0
  80. package/es/components/global-header/src/components/TrialPopover/TrialPopover.js.map +1 -0
  81. package/es/components/global-header/src/components/TrialPopover/__tests__/TrialPopover.test.d.ts +9 -0
  82. package/es/components/global-header/src/components/TrialPopover/_index.scss.js +6 -0
  83. package/es/components/global-header/src/components/TrialPopover/_index.scss.js.map +1 -0
  84. package/es/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.d.ts +19 -0
  85. package/es/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.js +63 -0
  86. package/es/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.js.map +1 -0
  87. package/es/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.stories.d.ts +15 -0
  88. package/es/components/global-header/src/components/UnauthenticatedContext/__tests__/UnauthenticatedContext.test.d.ts +9 -0
  89. package/es/components/global-header/src/components/UserProfileImage/UserProfileImage.d.ts +31 -0
  90. package/es/components/global-header/src/components/UserProfileImage/UserProfileImage.js +104 -0
  91. package/es/components/global-header/src/components/UserProfileImage/UserProfileImage.js.map +1 -0
  92. package/es/components/global-header/src/components/UserProfileImage/UserProfileImage.scss.js +6 -0
  93. package/es/components/global-header/src/components/UserProfileImage/UserProfileImage.scss.js.map +1 -0
  94. package/es/components/global-header/src/components/UserProfileImage/UserProfileImage.types.d.ts +21 -0
  95. package/es/components/global-header/src/components/UserProfileImage/__tests__/UserProfileImage.test.d.ts +9 -0
  96. package/es/components/global-header/src/components/_index.scss.js +6 -0
  97. package/es/components/global-header/src/components/_index.scss.js.map +1 -0
  98. package/es/components/global-header/src/constant.d.ts +53 -0
  99. package/es/components/global-header/src/constant.js +38 -0
  100. package/es/components/global-header/src/constant.js.map +1 -0
  101. package/es/components/global-header/src/global-header.scss.js +6 -0
  102. package/es/components/global-header/src/global-header.scss.js.map +1 -0
  103. package/es/components/global-header/src/global-header.template.d.ts +16 -0
  104. package/es/components/global-header/src/global-header.template.js +20 -0
  105. package/es/components/global-header/src/global-header.template.js.map +1 -0
  106. package/es/components/global-header/src/globals/__tests__/useScript.test.d.ts +9 -0
  107. package/es/components/global-header/src/globals/__tests__/utils.test.d.ts +9 -0
  108. package/es/components/global-header/src/globals/useScript.d.ts +10 -0
  109. package/es/components/global-header/src/globals/useScript.js +47 -0
  110. package/es/components/global-header/src/globals/useScript.js.map +1 -0
  111. package/es/components/global-header/src/globals/utils.d.ts +22 -0
  112. package/es/components/global-header/src/globals/utils.js +89 -0
  113. package/es/components/global-header/src/globals/utils.js.map +1 -0
  114. package/es/components/global-header/src/index.d.ts +12 -0
  115. package/es/components/global-header/src/types/Header.types.d.ts +267 -0
  116. package/es/components/global-header/src/types/Header.types.js +22 -0
  117. package/es/components/global-header/src/types/Header.types.js.map +1 -0
  118. package/es/index.d.ts +9 -0
  119. package/es/index.js +2 -0
  120. package/es/index.js.map +1 -0
  121. package/es/node_modules/classnames/index.js +86 -0
  122. package/es/node_modules/classnames/index.js.map +1 -0
  123. package/lib/_virtual/_commonjsHelpers.js +8 -0
  124. package/lib/_virtual/_commonjsHelpers.js.map +1 -0
  125. package/lib/_virtual/index.js +12 -0
  126. package/lib/_virtual/index.js.map +1 -0
  127. package/lib/_virtual/index2.js +6 -0
  128. package/lib/_virtual/index2.js.map +1 -0
  129. package/lib/components/global-header/global-header.d.ts +15 -0
  130. package/lib/components/global-header/global-header.js +25 -0
  131. package/lib/components/global-header/global-header.js.map +1 -0
  132. package/lib/components/global-header/src/components/AuthContext/AuthContext.d.ts +26 -0
  133. package/lib/components/global-header/src/components/AuthContext/AuthContext.js +238 -0
  134. package/lib/components/global-header/src/components/AuthContext/AuthContext.js.map +1 -0
  135. package/lib/components/global-header/src/components/AuthContext/AuthContext.types.d.ts +17 -0
  136. package/lib/components/global-header/src/components/AuthContext/__stories__/AuthContext.stories.d.ts +12 -0
  137. package/lib/components/global-header/src/components/AuthContext/__tests__/AuthContext.test.d.ts +9 -0
  138. package/lib/components/global-header/src/components/AuthContext/_index.scss.js +10 -0
  139. package/lib/components/global-header/src/components/AuthContext/_index.scss.js.map +1 -0
  140. package/lib/components/global-header/src/components/CommonHeader/CommonHeader.d.ts +36 -0
  141. package/lib/components/global-header/src/components/CommonHeader/CommonHeader.js +245 -0
  142. package/lib/components/global-header/src/components/CommonHeader/CommonHeader.js.map +1 -0
  143. package/lib/components/global-header/src/components/CommonHeader/WideSideNav.d.ts +15 -0
  144. package/lib/components/global-header/src/components/CommonHeader/WideSideNav.js +32 -0
  145. package/lib/components/global-header/src/components/CommonHeader/WideSideNav.js.map +1 -0
  146. package/lib/components/global-header/src/components/CommonHeader/__stories__/CommonHeader.stories.d.ts +20 -0
  147. package/lib/components/global-header/src/components/CommonHeader/__stories__/SideNav.stories.d.ts +16 -0
  148. package/lib/components/global-header/src/components/CommonHeader/__tests__/CommonHeader.test.d.ts +9 -0
  149. package/lib/components/global-header/src/components/CommonHeader/__tests__/WideSideNav.test.d.ts +9 -0
  150. package/lib/components/global-header/src/components/CommonHeader/_index.scss.js +10 -0
  151. package/lib/components/global-header/src/components/CommonHeader/_index.scss.js.map +1 -0
  152. package/lib/components/global-header/src/components/HeaderContext/HeaderContext.d.ts +43 -0
  153. package/lib/components/global-header/src/components/HeaderContext/HeaderContext.js +311 -0
  154. package/lib/components/global-header/src/components/HeaderContext/HeaderContext.js.map +1 -0
  155. package/lib/components/global-header/src/components/HeaderContext/HeaderContext.types.d.ts +46 -0
  156. package/lib/components/global-header/src/components/HeaderContext/__tests__/HeaderContext.test.d.ts +9 -0
  157. package/lib/components/global-header/src/components/HeaderContext/_index.scss.js +10 -0
  158. package/lib/components/global-header/src/components/HeaderContext/_index.scss.js.map +1 -0
  159. package/lib/components/global-header/src/components/HybridIpaasHeader/HybridIpaasHeader.d.ts +41 -0
  160. package/lib/components/global-header/src/components/HybridIpaasHeader/__stories__/HybridIPaasHeader.stories.d.ts +20 -0
  161. package/lib/components/global-header/src/components/HybridIpaasHeader/__tests__/HybridIpaasHeader.test.d.ts +10 -0
  162. package/lib/components/global-header/src/components/LogoutHeader/LogoutHeader.d.ts +17 -0
  163. package/lib/components/global-header/src/components/LogoutHeader/__stories__/LogoutHeader.stories.d.ts +15 -0
  164. package/lib/components/global-header/src/components/LogoutHeader/__tests__/LogoutHeader.test.d.ts +9 -0
  165. package/lib/components/global-header/src/components/LogoutTile/LogoutTile.d.ts +24 -0
  166. package/lib/components/global-header/src/components/LogoutTile/__stories__/LogoutTile.stories.d.ts +14 -0
  167. package/lib/components/global-header/src/components/LogoutTile/__tests__/LogoutTile.test.d.ts +9 -0
  168. package/lib/components/global-header/src/components/ProfilePopover/ProfilePopover.d.ts +22 -0
  169. package/lib/components/global-header/src/components/ProfilePopover/ProfilePopover.js +100 -0
  170. package/lib/components/global-header/src/components/ProfilePopover/ProfilePopover.js.map +1 -0
  171. package/lib/components/global-header/src/components/ProfilePopover/__tests__/ProfilePopover.test.d.ts +9 -0
  172. package/lib/components/global-header/src/components/ProfilePopover/_index.scss.js +10 -0
  173. package/lib/components/global-header/src/components/ProfilePopover/_index.scss.js.map +1 -0
  174. package/lib/components/global-header/src/components/Search/Search.d.ts +25 -0
  175. package/lib/components/global-header/src/components/Search/Search.js +72 -0
  176. package/lib/components/global-header/src/components/Search/Search.js.map +1 -0
  177. package/lib/components/global-header/src/components/Search/__tests__/Search.test.d.ts +9 -0
  178. package/lib/components/global-header/src/components/Search/_index.scss.js +10 -0
  179. package/lib/components/global-header/src/components/Search/_index.scss.js.map +1 -0
  180. package/lib/components/global-header/src/components/SideNavItem/SideNavItem.d.ts +31 -0
  181. package/lib/components/global-header/src/components/SideNavItem/SideNavItem.js +214 -0
  182. package/lib/components/global-header/src/components/SideNavItem/SideNavItem.js.map +1 -0
  183. package/lib/components/global-header/src/components/SideNavItem/SideNavItem.scss.js +10 -0
  184. package/lib/components/global-header/src/components/SideNavItem/SideNavItem.scss.js.map +1 -0
  185. package/lib/components/global-header/src/components/SideNavItem/__tests__/SideNavItem.test.d.ts +9 -0
  186. package/lib/components/global-header/src/components/Switcher/Switcher.d.ts +29 -0
  187. package/lib/components/global-header/src/components/Switcher/Switcher.js +188 -0
  188. package/lib/components/global-header/src/components/Switcher/Switcher.js.map +1 -0
  189. package/lib/components/global-header/src/components/Switcher/Switcher.types.d.ts +11 -0
  190. package/lib/components/global-header/src/components/Switcher/__tests__/Switcher.test.d.ts +9 -0
  191. package/lib/components/global-header/src/components/Switcher/_index.scss.js +10 -0
  192. package/lib/components/global-header/src/components/Switcher/_index.scss.js.map +1 -0
  193. package/lib/components/global-header/src/components/TrialContent/TrialContent.d.ts +11 -0
  194. package/lib/components/global-header/src/components/TrialContent/TrialContent.js +76 -0
  195. package/lib/components/global-header/src/components/TrialContent/TrialContent.js.map +1 -0
  196. package/lib/components/global-header/src/components/TrialContent/TrialContent.types.d.ts +12 -0
  197. package/lib/components/global-header/src/components/TrialContent/__stories__/TrialContent.stories.d.ts +14 -0
  198. package/lib/components/global-header/src/components/TrialPopover/TrialPopover.d.ts +23 -0
  199. package/lib/components/global-header/src/components/TrialPopover/TrialPopover.js +79 -0
  200. package/lib/components/global-header/src/components/TrialPopover/TrialPopover.js.map +1 -0
  201. package/lib/components/global-header/src/components/TrialPopover/__tests__/TrialPopover.test.d.ts +9 -0
  202. package/lib/components/global-header/src/components/TrialPopover/_index.scss.js +10 -0
  203. package/lib/components/global-header/src/components/TrialPopover/_index.scss.js.map +1 -0
  204. package/lib/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.d.ts +19 -0
  205. package/lib/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.js +63 -0
  206. package/lib/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.js.map +1 -0
  207. package/lib/components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.stories.d.ts +15 -0
  208. package/lib/components/global-header/src/components/UnauthenticatedContext/__tests__/UnauthenticatedContext.test.d.ts +9 -0
  209. package/lib/components/global-header/src/components/UserProfileImage/UserProfileImage.d.ts +31 -0
  210. package/lib/components/global-header/src/components/UserProfileImage/UserProfileImage.js +104 -0
  211. package/lib/components/global-header/src/components/UserProfileImage/UserProfileImage.js.map +1 -0
  212. package/lib/components/global-header/src/components/UserProfileImage/UserProfileImage.scss.js +10 -0
  213. package/lib/components/global-header/src/components/UserProfileImage/UserProfileImage.scss.js.map +1 -0
  214. package/lib/components/global-header/src/components/UserProfileImage/UserProfileImage.types.d.ts +21 -0
  215. package/lib/components/global-header/src/components/UserProfileImage/__tests__/UserProfileImage.test.d.ts +9 -0
  216. package/lib/components/global-header/src/components/_index.scss.js +10 -0
  217. package/lib/components/global-header/src/components/_index.scss.js.map +1 -0
  218. package/lib/components/global-header/src/constant.d.ts +53 -0
  219. package/lib/components/global-header/src/constant.js +53 -0
  220. package/lib/components/global-header/src/constant.js.map +1 -0
  221. package/lib/components/global-header/src/global-header.scss.js +10 -0
  222. package/lib/components/global-header/src/global-header.scss.js.map +1 -0
  223. package/lib/components/global-header/src/global-header.template.d.ts +16 -0
  224. package/lib/components/global-header/src/global-header.template.js +24 -0
  225. package/lib/components/global-header/src/global-header.template.js.map +1 -0
  226. package/lib/components/global-header/src/globals/__tests__/useScript.test.d.ts +9 -0
  227. package/lib/components/global-header/src/globals/__tests__/utils.test.d.ts +9 -0
  228. package/lib/components/global-header/src/globals/useScript.d.ts +10 -0
  229. package/lib/components/global-header/src/globals/useScript.js +51 -0
  230. package/lib/components/global-header/src/globals/useScript.js.map +1 -0
  231. package/lib/components/global-header/src/globals/utils.d.ts +22 -0
  232. package/lib/components/global-header/src/globals/utils.js +96 -0
  233. package/lib/components/global-header/src/globals/utils.js.map +1 -0
  234. package/lib/components/global-header/src/index.d.ts +12 -0
  235. package/lib/components/global-header/src/types/Header.types.d.ts +267 -0
  236. package/lib/components/global-header/src/types/Header.types.js +22 -0
  237. package/lib/components/global-header/src/types/Header.types.js.map +1 -0
  238. package/lib/index.d.ts +9 -0
  239. package/lib/index.js +5 -0
  240. package/lib/index.js.map +1 -0
  241. package/lib/node_modules/classnames/index.js +88 -0
  242. package/lib/node_modules/classnames/index.js.map +1 -0
  243. package/package.json +42 -0
@@ -0,0 +1,188 @@
1
+ import { __decorate } from 'tslib';
2
+ import { unsafeCSS, css, LitElement, html } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ import cx from '../../../../../_virtual/index.js';
5
+ import { AUTOMATION_HEADER_BASE_CLASS } from '../../constant.js';
6
+ import styles from './_index.scss.js';
7
+ import { trackEvent, renderCarbonIcon } from '../../globals/utils.js';
8
+
9
+ /**
10
+ * @license
11
+ *
12
+ * Copyright IBM Corp. 2025
13
+ *
14
+ * This source code is licensed under the Apache-2.0 license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ /* eslint jsdoc/require-jsdoc: 0 */
18
+ /**
19
+ * Environment switcher
20
+ */
21
+ let Switcher = class Switcher extends LitElement {
22
+ get selectedItem() {
23
+ var _a;
24
+ return (_a = this.items[this.initialSelectedIndex || 0]) !== null && _a !== void 0 ? _a : null;
25
+ }
26
+ constructor() {
27
+ super();
28
+ this.items = [];
29
+ this.iconsLeft = false;
30
+ this.disabled = false;
31
+ this.isTrialOpen = false;
32
+ this.initialSelectedIndex = 0;
33
+ this.onClick = (event, value, idx) => {
34
+ console.log(`default onClick called with: ${event}, ${value}, ${idx}`);
35
+ };
36
+ // emit an event (does nothing if analytics has not been configured)
37
+ this.clickEventAnalytics = (label) => {
38
+ trackEvent('UI Interaction', {
39
+ action: 'clicked',
40
+ CTA: label,
41
+ elementId: 'common header - env switcher',
42
+ });
43
+ };
44
+ }
45
+ handleItemSelection(event, value, idx) {
46
+ var _a;
47
+ this.clickEventAnalytics(value.label);
48
+ if (this.onClick) {
49
+ this.onClick(event, value, idx); // Need to add event in this
50
+ }
51
+ if (!value.isLinkItem || !value.isHeading) {
52
+ if (this.items[idx] !== this.selectedItem) {
53
+ this.initialSelectedIndex = idx;
54
+ }
55
+ }
56
+ //Switcher closes upon selecting an option
57
+ const headerMenu = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('cds-custom-header-menu');
58
+ headerMenu.expanded = false;
59
+ }
60
+ renderItem(item, idx) {
61
+ var _a, _b;
62
+ const isSelected = item.id
63
+ ? item.id === ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.id)
64
+ : item.label === ((_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.label);
65
+ const selectedClass = isSelected ? 'selected' : '';
66
+ return html `
67
+ <div>
68
+ <div
69
+ class="${cx({
70
+ [`${AUTOMATION_HEADER_BASE_CLASS}__switcher-menu-item`]: true,
71
+ [selectedClass]: true,
72
+ })}"
73
+ @click="${(event) => {
74
+ if (this.disabled) {
75
+ return;
76
+ }
77
+ this.handleItemSelection(event, item, idx);
78
+ }}"
79
+ title="${item.label}">
80
+ ${this.iconsLeft
81
+ ? html `
82
+ <span
83
+ class="${AUTOMATION_HEADER_BASE_CLASS}__switcher-menu-item-title-icons-left">
84
+ ${!item.isLinkItem
85
+ ? html `
86
+ <div
87
+ class="${!isSelected
88
+ ? `${AUTOMATION_HEADER_BASE_CLASS}__switcher-menu-item-title-hidden-checkmark`
89
+ : ''}">
90
+ <div>
91
+ ${renderCarbonIcon(item.carbonIcon || 'Checkmark', 16)}
92
+ </div>
93
+ </div>
94
+ `
95
+ : ''}
96
+ ${item.isLinkItem
97
+ ? html `<div>
98
+ ${renderCarbonIcon(item.carbonIcon || 'Checkmark', 16)}
99
+ </div>`
100
+ : ''}
101
+ <span>${item.label}</span>
102
+ ${item.isLinkItem
103
+ ? html `<div>${renderCarbonIcon('Launch', 16)}</div>`
104
+ : ''}
105
+ </span>
106
+ `
107
+ : html `
108
+ <span
109
+ class="${AUTOMATION_HEADER_BASE_CLASS}__switcher-menu-item-title">
110
+ <span>${item.label}</span>
111
+ ${isSelected
112
+ ? renderCarbonIcon(item.carbonIcon || 'Checkmark', 16)
113
+ : ''}
114
+ </span>
115
+ `}
116
+ </div>
117
+ ${item.isLastInList ? html `<div class="switcher-divider"></div>` : ''}
118
+ </div>
119
+ `;
120
+ }
121
+ renderItems() {
122
+ return this.items.map((item, idx) => {
123
+ var _a;
124
+ if (item.isHeading) {
125
+ return html `<div
126
+ class="${AUTOMATION_HEADER_BASE_CLASS}__switcher-menu-group-title">
127
+ ${item.label}
128
+ </div>`;
129
+ }
130
+ else {
131
+ return html `<cds-custom-header-menu-item href="${(_a = item === null || item === void 0 ? void 0 : item.href) !== null && _a !== void 0 ? _a : '#'}">
132
+ ${this.renderItem(item, idx)}
133
+ </cds-custom-header-menu-item>`;
134
+ }
135
+ });
136
+ }
137
+ render() {
138
+ var _a, _b, _c, _d, _e;
139
+ const labelMaxLength = 15;
140
+ const switcherLabel = ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.label) &&
141
+ ((_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.label.length) < labelMaxLength
142
+ ? (_c = this.selectedItem) === null || _c === void 0 ? void 0 : _c.label
143
+ : ((_d = this.selectedItem) === null || _d === void 0 ? void 0 : _d.label.slice(0, labelMaxLength)) + '...'; // need to manually reduce length of label to fit the max width
144
+ return html `<div class="${AUTOMATION_HEADER_BASE_CLASS}__switcher">
145
+ <cds-custom-header-menu
146
+ role="button"
147
+ tabindex="${this.isTrialOpen ? -1 : 0}"
148
+ .menuLabel=${switcherLabel}
149
+ .triggerContent=${switcherLabel}
150
+ title="${switcherLabel.length > labelMaxLength
151
+ ? (_e = this.selectedItem) === null || _e === void 0 ? void 0 : _e.label
152
+ : null}"
153
+ class="${cx({
154
+ [`${AUTOMATION_HEADER_BASE_CLASS}__switcher-menu hybrid-ipaas`]: true,
155
+ [`${AUTOMATION_HEADER_BASE_CLASS}__switcher-menu-disabled`]: this.disabled,
156
+ })}">
157
+ ${this.renderItems()}
158
+ </cds-custom-header-menu>
159
+ </div>`;
160
+ }
161
+ };
162
+ Switcher.styles = css `
163
+ ${unsafeCSS(styles)}
164
+ `;
165
+ __decorate([
166
+ property({ type: Array })
167
+ ], Switcher.prototype, "items", void 0);
168
+ __decorate([
169
+ property({ type: Boolean })
170
+ ], Switcher.prototype, "iconsLeft", void 0);
171
+ __decorate([
172
+ property({ type: Boolean })
173
+ ], Switcher.prototype, "disabled", void 0);
174
+ __decorate([
175
+ property({ type: Boolean })
176
+ ], Switcher.prototype, "isTrialOpen", void 0);
177
+ __decorate([
178
+ property({ type: Number })
179
+ ], Switcher.prototype, "initialSelectedIndex", void 0);
180
+ __decorate([
181
+ property({ type: Function })
182
+ ], Switcher.prototype, "onClick", void 0);
183
+ Switcher = __decorate([
184
+ customElement('apaas-switcher-component')
185
+ ], Switcher);
186
+
187
+ export { Switcher };
188
+ //# sourceMappingURL=Switcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switcher.js","sources":["../../../../../../../components/global-header/src/components/Switcher/Switcher.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;AAOG;AACH;AAcA;;AAEG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU,CAAA;AAkBtC,IAAA,IAAI,YAAY,GAAA;;AACd,QAAA,OAAO,CAAA,EAAA,GAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,IAAI;IAC3D;AAEA,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QAlBkB,IAAA,CAAA,KAAK,GAAe,EAAE;QACpB,IAAA,CAAA,SAAS,GAAG,KAAK;QACjB,IAAA,CAAA,QAAQ,GAAG,KAAK;QAChB,IAAA,CAAA,WAAW,GAAG,KAAK;QACpB,IAAA,CAAA,oBAAoB,GAAG,CAAC;QACtB,IAAA,CAAA,OAAO,GAAG,CACtC,KAAiB,EACjB,KAAe,EACf,GAAW,KACT;YACF,OAAO,CAAC,GAAG,CAAC,CAAA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AE,MAAM,EAAE;AAA2B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,MAAA,CAAA;AACvB,UAAA,CAAA;AAA7B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;AAM1B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAhBS,QAAQ,GAAA,UAAA,CAAA;IADpB,aAAa,CAAC,0BAA0B;AAC5B,CAAA,EAAA,QAAQ,CA8JpB;;;;"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { SwitcherConfigs } from '../../types/Header.types';
10
+ export type { ItemLink } from '../../types/Header.types';
11
+ export type SwitcherProps = SwitcherConfigs;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import '../Switcher';
@@ -0,0 +1,6 @@
1
+ import { css } from 'lit';
2
+
3
+ var styles = css([".automation-global-header__switcher{block-size:-moz-max-content;block-size:max-content;border:0!important;color:#a8a8a8;inline-size:-moz-max-content;inline-size:max-content;min-block-size:-moz-max-content;min-block-size:max-content}.automation-global-header__switcher-menu{block-size:47px;color:#a8a8a8;display:inline-block;list-style-type:none;min-inline-size:12rem!important}.automation-global-header__switcher-menu-item-title{align-items:flex-end;display:flex;justify-content:space-between}.automation-global-header__switcher-menu-item-title span{margin-inline-end:1.5rem;max-inline-size:224px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.automation-global-header__switcher-menu-item-title-hidden-checkmark{visibility:hidden}.automation-global-header__switcher-menu-item-title-icons-left{display:flex}.automation-global-header__switcher-menu-item-title-icons-left div{margin-inline-end:1rem}.automation-global-header__switcher-menu-item-title-icons-left span{margin-inline-end:1rem}.automation-global-header__switcher-menu-item-title-icons-left span,.automation-global-header__switcher-menu-item>span{max-inline-size:224px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.automation-global-header__switcher-menu-disabled{pointer-events:none}.automation-global-header__switcher-menu.hybrid-ipaas .cds--header__menu-item+.cds--header__menu-title[aria-expanded=false]{inline-size:100%!important;min-inline-size:15rem!important}.automation-global-header__switcher-menu-group-title{align-items:center;block-size:47px;color:#f4f4f4;display:flex;font-size:var(--cds-heading-compact-01-font-size,.875rem);font-weight:var(--cds-heading-compact-01-font-weight,600);justify-content:space-between;letter-spacing:var(--cds-heading-compact-01-letter-spacing,.16px);line-height:var(--cds-heading-compact-01-line-height,1.28572);margin-inline-start:1rem;pointer-events:none}cds-custom-header-menu::part(menu-body){inline-size:100%!important;max-block-size:calc(100vh - 47px);min-inline-size:15rem!important;overflow-x:hidden}cds-custom-header-menu::part(trigger){align-items:center!important;display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;justify-content:space-between!important;max-inline-size:224px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}cds-custom-header-menu-item:nth-last-child(2){border-block-end:1px solid #393939}"]);
4
+
5
+ export { styles as default };
6
+ //# sourceMappingURL=_index.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { TrialTooltipProps } from './TrialContent.types';
10
+ import '@carbon/web-components/es-custom/components/link/index.js';
11
+ export declare const TrialContent: ({ description, links, actionText, actionLink, }: TrialTooltipProps) => import("lit-html").TemplateResult<1>;
@@ -0,0 +1,74 @@
1
+ import { nothing, html } from 'lit';
2
+ import { AUTOMATION_HEADER_BASE_CLASS } from '../../constant.js';
3
+ import { renderCarbonIcon } from '../../globals/utils.js';
4
+ import '@carbon/web-components/es-custom/components/link/index.js';
5
+ import { TrialLinkType } from '../../types/Header.types.js';
6
+
7
+ /**
8
+ * @license
9
+ *
10
+ * Copyright IBM Corp. 2025
11
+ *
12
+ * This source code is licensed under the Apache-2.0 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ /* eslint jsdoc/require-jsdoc: 0 */
16
+ const TrialContent = ({ description, links, actionText, actionLink, }) => {
17
+ return html `
18
+ <div class="automation-header__tooltip">
19
+ <div class="${AUTOMATION_HEADER_BASE_CLASS}__tooltip-caret"></div>
20
+ <div class="automation-header__tooltip-body">
21
+ ${description
22
+ ? html `<p
23
+ tabindex="{0}"
24
+ role="tabpanel"
25
+ class="${AUTOMATION_HEADER_BASE_CLASS}__tooltip-description"
26
+ aria-label="${description}">
27
+ ${description}
28
+ </p>`
29
+ : nothing}
30
+ <div class="${AUTOMATION_HEADER_BASE_CLASS}__tooltip-links">
31
+ ${links === null || links === void 0 ? void 0 : links.map((link) => html `
32
+ <cds-custom-link
33
+ href="${link.href}"
34
+ class="${AUTOMATION_HEADER_BASE_CLASS}__tooltip-link">
35
+ <span
36
+ >${link.label}
37
+ ${getIconFromType(link.type)}</span
38
+ >
39
+ </cds-custom-link>
40
+ `)}
41
+ </div>
42
+ ${actionText && actionLink
43
+ ? html `
44
+ <cds-custom-link
45
+ href=${actionLink}
46
+ class="${AUTOMATION_HEADER_BASE_CLASS}__trial-button">
47
+ <div class="buttons">
48
+ ${actionText}
49
+ <span class="button-icon"
50
+ >${renderCarbonIcon('Email', 16)}</span
51
+ >
52
+ </div>
53
+ </cds-custom-link>
54
+ `
55
+ : nothing}
56
+ </div>
57
+ </div>
58
+ `;
59
+ };
60
+ function getIconFromType(type) {
61
+ switch (type) {
62
+ case 'invite':
63
+ case TrialLinkType['invite']:
64
+ return renderCarbonIcon('Share', 16);
65
+ case 'requestQuote':
66
+ case TrialLinkType['requestQuote']:
67
+ return renderCarbonIcon('RequestQuote', 16);
68
+ default:
69
+ return renderCarbonIcon('User', 16);
70
+ }
71
+ }
72
+
73
+ export { TrialContent };
74
+ //# sourceMappingURL=TrialContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrialContent.js","sources":["../../../../../../../components/global-header/src/components/TrialContent/TrialContent.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAOG;AACH;AASO,MAAM,YAAY,GAAG,CAAC,EAC3B,WAAW,EACX,KAAK,EACL,UAAU,EACV,UAAU,GACQ,KAAI;AACtB,IAAA,OAAO,IAAI,CAAA;;oBAEO,4BAA4B,CAAA;;UAEtC;UACE,IAAI,CAAA,CAAA;;;uBAGO,4BAA4B,CAAA;4BACvB,WAAW,CAAA;gBACvB,WAAW;AACV,gBAAA;AACP,UAAE,OAAO;sBACG,4BAA4B,CAAA;AACtC,UAAA,EAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAA,MAAA,GAAL,KAAK,CAAE,GAAG,CACV,CAAC,IAAI,KAAK,IAAI,CAAA;;AAEF,sBAAA,EAAA,IAAI,CAAC,IAAI,CAAA;yBACR,4BAA4B,CAAA;;AAEhC,mBAAA,EAAA,IAAI,CAAC,KAAK;AACX,kBAAA,EAAA,eAAe,CAAC,IAAI,CAAC,IAAyB,CAAC,CAAA;;;aAGtD,CACF;;AAED,QAAA,EAAA,UAAU,IAAI;UACZ,IAAI,CAAA;;uBAEO,UAAU;yBACR,4BAA4B,CAAA;;oBAEjC,UAAU;;AAEP,qBAAA,EAAA,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;;;;AAIvC,YAAA;AACH,UAAE,OAAO;;;GAGhB;AACH;AAEA,SAAS,eAAe,CAAC,IAA4B,EAAA;IACnD,QAAQ,IAAI;AACV,QAAA,KAAK,QAAQ;QACb,KAAK,aAAa,CAAC,QAAQ,CAAC;AAC1B,YAAA,OAAO,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC;AACtC,QAAA,KAAK,cAAc;QACnB,KAAK,aAAa,CAAC,cAAc,CAAC;AAChC,YAAA,OAAO,gBAAgB,CAAC,cAAc,EAAE,EAAE,CAAC;AAC7C,QAAA;AACE,YAAA,OAAO,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC;;AAEzC;;;;"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { TrialConfigs } from '../../types/Header.types';
10
+ export interface TrialTooltipProps extends TrialConfigs {
11
+ activeTrialPopover?: boolean;
12
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import type { Meta } from '@storybook/web-components-vite';
10
+ declare const meta: Meta;
11
+ export default meta;
12
+ export declare const Default: (args: any) => import("lit-html").TemplateResult<1>;
13
+ export declare const Warning: (args: any) => import("lit-html").TemplateResult<1>;
14
+ export declare const Expired: (args: any) => import("lit-html").TemplateResult<1>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { LitElement } from 'lit';
10
+ import '@carbon/web-components/es-custom/components/popover/index.js';
11
+ import { TrialConfigs } from '../../types/Header.types';
12
+ /**
13
+ * Content to show when clicking the Trial entry in the header
14
+ */
15
+ export declare class TrialPopover extends LitElement {
16
+ open: boolean;
17
+ trialConfig: TrialConfigs;
18
+ static styles: import("lit").CSSResult;
19
+ constructor();
20
+ updated(changedProperties: Map<string | number | symbol, unknown>): void;
21
+ handleOutsideClick(event: MouseEvent): void;
22
+ render(): import("lit-html").TemplateResult<1>;
23
+ }
@@ -0,0 +1,79 @@
1
+ import { __decorate } from 'tslib';
2
+ import { unsafeCSS, css, LitElement, nothing, html } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ import '@carbon/web-components/es-custom/components/popover/index.js';
5
+ import { TrialContent } from '../TrialContent/TrialContent.js';
6
+ import { animate, fadeOut, fadeIn } from '@lit-labs/motion';
7
+ import styles from './_index.scss.js';
8
+
9
+ /**
10
+ * @license
11
+ *
12
+ * Copyright IBM Corp. 2025
13
+ *
14
+ * This source code is licensed under the Apache-2.0 license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ /* eslint jsdoc/require-jsdoc: 0 */
18
+ /**
19
+ * Content to show when clicking the Trial entry in the header
20
+ */
21
+ let TrialPopover = class TrialPopover extends LitElement {
22
+ constructor() {
23
+ super();
24
+ this.open = false;
25
+ this.trialConfig = {};
26
+ this.handleOutsideClick = this.handleOutsideClick.bind(this);
27
+ }
28
+ updated(changedProperties) {
29
+ if (changedProperties.has('open')) {
30
+ if (this.open) {
31
+ document.addEventListener('click', this.handleOutsideClick);
32
+ }
33
+ else {
34
+ document.removeEventListener('click', this.handleOutsideClick);
35
+ }
36
+ }
37
+ }
38
+ handleOutsideClick(event) {
39
+ const path = event.composedPath();
40
+ if (!path.includes(this)) {
41
+ const toggleEvent = new CustomEvent('trial-toggle', {
42
+ bubbles: true,
43
+ composed: true,
44
+ }); // event to trigger the parent component to update the toggle value
45
+ this.dispatchEvent(toggleEvent);
46
+ }
47
+ }
48
+ render() {
49
+ return html `
50
+ <cds-custom-popover ?open="${this.open}" align="bottom-right">
51
+ <slot></slot>
52
+ <cds-custom-popover-content>
53
+ ${this.open
54
+ ? html `<div
55
+ class="automation-header__tooltip"
56
+ ${animate({ in: fadeIn, out: fadeOut, stabilizeOut: true })}>
57
+ ${TrialContent({ ...this.trialConfig })}
58
+ </div>`
59
+ : nothing}
60
+ </cds-custom-popover-content>
61
+ </cds-custom-popover>
62
+ `;
63
+ }
64
+ };
65
+ TrialPopover.styles = css `
66
+ ${unsafeCSS(styles)}
67
+ `;
68
+ __decorate([
69
+ property({ type: Boolean })
70
+ ], TrialPopover.prototype, "open", void 0);
71
+ __decorate([
72
+ property({ type: Object })
73
+ ], TrialPopover.prototype, "trialConfig", void 0);
74
+ TrialPopover = __decorate([
75
+ customElement('apaas-trial-popover')
76
+ ], TrialPopover);
77
+
78
+ export { TrialPopover };
79
+ //# sourceMappingURL=TrialPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrialPopover.js","sources":["../../../../../../../components/global-header/src/components/TrialPopover/TrialPopover.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;AAOG;AACH;AAYA;;AAEG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU,CAAA;AAO1C,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QAPoB,IAAA,CAAA,IAAI,GAAG,KAAK;QACb,IAAA,CAAA,WAAW,GAAiB,EAAE;QAOxD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;IAC9D;AAEA,IAAA,OAAO,CAAC,iBAAyD,EAAA;AAC/D,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AACjC,YAAA,IAAI,IAAI,CAAC,IAAI,EAAE;gBACb,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC;YAC7D;iBAAO;gBACL,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC;YAChE;QACF;IACF;AAEA,IAAA,kBAAkB,CAAC,KAAiB,EAAA;AAClC,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,EAAE;QAEjC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;AACxB,YAAA,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,cAAc,EAAE;AAClD,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;AACH,YAAA,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;QACjC;IACF;IAEA,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAA;AACoB,iCAAA,EAAA,IAAI,CAAC,IAAI,CAAA;;;AAGhC,UAAA,EAAA,IAAI,CAAC;cACH,IAAI,CAAA,CAAA;;AAEA,gBAAA,EAAA,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAA;AACzD,gBAAA,EAAA,YAAY,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAClC,oBAAA;AACT,cAAE,OAAO;;;KAGhB;IACH;;AA9CO,YAAA,CAAA,MAAM,GAAG,GAAG,CAAA;MACf,SAAS,CAAC,MAAM,CAAC;AACpB,EAAA,CAFY;AAFgB,UAAA,CAAA;AAA5B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;AAAe,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AACd,UAAA,CAAA;AAA3B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE;AAAiC,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;AAFhD,YAAY,GAAA,UAAA,CAAA;IADxB,aAAa,CAAC,qBAAqB;AACvB,CAAA,EAAA,YAAY,CAkDxB;;;;"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import '../TrialPopover';
@@ -0,0 +1,6 @@
1
+ import { css } from 'lit';
2
+
3
+ var styles = css([".automation-header__tooltip{color:#fff;inline-size:16rem;inset-block-start:0;inset-inline-end:0;position:absolute;transform:translateX(40px)}.automation-header__tooltip-body{background-color:#393939;border-radius:3px;box-shadow:0 5px 5px 0 rgba(0,0,0,.3);padding:1rem}.automation-header__tooltip-body :last-child{margin-block-end:0}.automation-global-header__tooltip-description{font-size:14px;line-height:1.25rem;margin-block-end:1rem}.automation-global-header__tooltip-links{margin-block-end:1rem}.automation-global-header__tooltip-links .automation-global-header__tooltip-link{color:#78a9ff;display:block;margin-block-end:.25rem;margin-inline-start:-1rem;padding:6px 15px}.automation-global-header__tooltip-links .automation-global-header__tooltip-link svg{fill:#78a9ff}.automation-global-header__tooltip-links .automation-global-header__tooltip-link:hover{background-color:transparent;text-decoration:underline}.automation-global-header__trial-button{display:inline-block}.automation-global-header__trial-button .buttons{background:#0f62fe;color:#fff;display:flex;padding:6px 15px}.automation-global-header__trial-button .button-icon{display:flex;margin-inline-start:20px}.automation-global-header__trial-button:hover{text-decoration:none}.automation-global-header--popover-content-container .ibm-automation-cds--popover span{display:none}.automation-global-header--popover-content-container .ibm-automation-cds--popover .ibm-automation-cds--popover-content{background-color:#393939;color:#fff;font-size:var(--cds-body-01-font-size,.875rem);font-weight:var(--cds-body-01-font-weight,400);letter-spacing:var(--cds-body-01-letter-spacing,.16px);line-height:var(--cds-body-01-line-height,1.42857);padding:.125rem .5rem}.automation-global-header--popover-content-container .ibm-automation-cds--popover .ibm-automation-cds--popover-caret{display:none}"]);
4
+
5
+ export { styles as default };
6
+ //# sourceMappingURL=_index.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_index.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { LitElement } from 'lit';
10
+ import { NoAuthHeaderLinks } from '../../types/Header.types';
11
+ import '@carbon/web-components/es-custom/components/ui-shell/index.js';
12
+ /**
13
+ * Content to show when not logged in
14
+ */
15
+ export declare class UnauthenticatedContext extends LitElement {
16
+ static styles: import("lit").CSSResult;
17
+ noAuthHeaderLinks: NoAuthHeaderLinks[];
18
+ render(): import("lit-html").TemplateResult<1>;
19
+ }
@@ -0,0 +1,63 @@
1
+ import { __decorate } from 'tslib';
2
+ import { unsafeCSS, css, LitElement, nothing, html } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ import { renderCarbonIcon } from '../../globals/utils.js';
5
+ import '@carbon/web-components/es-custom/components/ui-shell/index.js';
6
+ import cx from '../../../../../_virtual/index.js';
7
+ import { DEFAULT_NO_AUTH_HEADER_LINKS, AUTOMATION_NAMESPACE_PREFIX, HEADER_NAVIGATION_ACTION } from '../../constant.js';
8
+ import styles from '../_index.scss.js';
9
+
10
+ /**
11
+ * @license
12
+ *
13
+ * Copyright IBM Corp. 2025
14
+ *
15
+ * This source code is licensed under the Apache-2.0 license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ /* eslint jsdoc/require-jsdoc: 0 */
19
+ /**
20
+ * Content to show when not logged in
21
+ */
22
+ let UnauthenticatedContext = class UnauthenticatedContext extends LitElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.noAuthHeaderLinks = [
26
+ ...DEFAULT_NO_AUTH_HEADER_LINKS,
27
+ ];
28
+ }
29
+ render() {
30
+ return html ` <cds-custom-header-nav
31
+ aria-label="Navigation"
32
+ class="${cx(AUTOMATION_NAMESPACE_PREFIX, `${HEADER_NAVIGATION_ACTION}__menu`)}">
33
+ ${this.noAuthHeaderLinks &&
34
+ this.noAuthHeaderLinks.map((headerLink) => {
35
+ return html `
36
+ <cds-custom-header-nav-item
37
+ aria-label="${headerLink === null || headerLink === void 0 ? void 0 : headerLink.arialLabel}"
38
+ href="${headerLink === null || headerLink === void 0 ? void 0 : headerLink.href}"
39
+ class="${`${HEADER_NAVIGATION_ACTION}__menu-item`}">
40
+ ${headerLink === null || headerLink === void 0 ? void 0 : headerLink.text}
41
+ ${(headerLink === null || headerLink === void 0 ? void 0 : headerLink.carbonIcon)
42
+ ? html `<span
43
+ >${renderCarbonIcon(headerLink.carbonIcon, 16)}</span
44
+ >`
45
+ : nothing}
46
+ </cds-custom-header-nav-item>
47
+ `;
48
+ })}
49
+ </cds-custom-header-nav>`;
50
+ }
51
+ };
52
+ UnauthenticatedContext.styles = css `
53
+ ${unsafeCSS(styles)}
54
+ `;
55
+ __decorate([
56
+ property({ type: Array })
57
+ ], UnauthenticatedContext.prototype, "noAuthHeaderLinks", void 0);
58
+ UnauthenticatedContext = __decorate([
59
+ customElement('apaas-unauthenticated-context')
60
+ ], UnauthenticatedContext);
61
+
62
+ export { UnauthenticatedContext };
63
+ //# sourceMappingURL=UnauthenticatedContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnauthenticatedContext.js","sources":["../../../../../../../components/global-header/src/components/UnauthenticatedContext/UnauthenticatedContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;AAOG;AACH;AAiBA;;AAEG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU,CAAA;AAA/C,IAAA,WAAA,GAAA;;AAIsB,QAAA,IAAA,CAAA,iBAAiB,GAAwB;AAClE,YAAA,GAAG,4BAA4B;SAChC;IA2BH;IAzBE,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAA,CAAA;;AAEA,aAAA,EAAA,EAAE,CACT,2BAA2B,EAC3B,CAAA,EAAG,wBAAwB,QAAQ,CACpC,CAAA;AACC,MAAA,EAAA,IAAI,CAAC,iBAAiB;YACxB,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAA6B,KAAI;AAC3D,gBAAA,OAAO,IAAI,CAAA;;AAEO,wBAAA,EAAA,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,MAAA,GAAA,MAAA,GAAV,UAAU,CAAE,UAAU,CAAA;AAC5B,kBAAA,EAAA,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,MAAA,GAAA,MAAA,GAAV,UAAU,CAAE,IAAI,CAAA;AACf,mBAAA,EAAA,CAAA,EAAG,wBAAwB,CAAA,WAAA,CAAa,CAAA;AAC/C,YAAA,EAAA,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,MAAA,GAAA,MAAA,GAAV,UAAU,CAAE,IAAI;AAChB,YAAA,EAAA,CAAA,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,MAAA,GAAA,MAAA,GAAV,UAAU,CAAE,UAAU;sBACpB,IAAI,CAAA,CAAA;AACC,mBAAA,EAAA,gBAAgB,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;AAC9C,iBAAA;AACJ,sBAAE,OAAO;;SAEd;AACH,YAAA,CAAC,CAAC;6BACqB;IAC3B;;AA/BO,sBAAA,CAAA,MAAM,GAAG,GAAG,CAAA;MACf,SAAS,CAAC,MAAM,CAAC;AACpB,EAAA,CAFY;AAGc,UAAA,CAAA;AAA1B,IAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE;AAEvB,CAAA,EAAA,sBAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,MAAA,CAAA;AANS,sBAAsB,GAAA,UAAA,CAAA;IADlC,aAAa,CAAC,+BAA+B;AACjC,CAAA,EAAA,sBAAsB,CAiClC;;;;"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import type { Meta, StoryObj } from '@storybook/web-components-vite';
10
+ import { UnauthenticatedContext } from './UnauthenticatedContext';
11
+ import '@carbon/web-components/es-custom/components/ui-shell/index.js';
12
+ declare const meta: Meta;
13
+ export default meta;
14
+ type Story = StoryObj<typeof UnauthenticatedContext>;
15
+ export declare const Basic: Story;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import '../UnauthenticatedContext';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { LitElement } from 'lit';
10
+ /**
11
+ * User image for the profile menu
12
+ */
13
+ export declare class SideNavItem extends LitElement {
14
+ static styles: import("lit").CSSResult;
15
+ kind: string;
16
+ size: string;
17
+ image: string;
18
+ initials: string;
19
+ className: string;
20
+ backgroundColor: string;
21
+ icons: {
22
+ user: {
23
+ md: Element | import("lit-html").TemplateResult<1>;
24
+ lg: Element | import("lit-html").TemplateResult<1>;
25
+ xlg: Element | import("lit-html").TemplateResult<1>;
26
+ };
27
+ };
28
+ formatInitials: () => string | undefined;
29
+ getFillItem: () => string | Element | import("lit-html").TemplateResult<1> | undefined;
30
+ render(): import("lit-html").TemplateResult<1>;
31
+ }