@camunda/camunda-composite-components 0.22.4 → 0.22.6

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 (196) hide show
  1. package/lib/esm/package.json +98 -0
  2. package/lib/esm/src/api/api.d.ts +29 -0
  3. package/lib/esm/src/api/api.js +92 -0
  4. package/lib/esm/src/api/clusters.d.ts +10 -0
  5. package/lib/esm/src/api/clusters.js +32 -0
  6. package/lib/esm/src/api/endpoints.const.d.ts +22 -0
  7. package/lib/esm/src/api/endpoints.const.js +70 -0
  8. package/lib/esm/src/api/help-center.d.ts +42 -0
  9. package/lib/esm/src/api/help-center.js +56 -0
  10. package/lib/esm/src/api/jwt.utils.d.ts +5 -0
  11. package/lib/esm/src/api/jwt.utils.js +26 -0
  12. package/lib/esm/src/api/notifications.d.ts +41 -0
  13. package/lib/esm/src/api/notifications.js +170 -0
  14. package/lib/esm/src/api/organizations.d.ts +15 -0
  15. package/lib/esm/src/api/organizations.js +16 -0
  16. package/lib/esm/src/api/profile.d.ts +20 -0
  17. package/lib/esm/src/api/profile.js +48 -0
  18. package/lib/esm/src/api/status.d.ts +7 -0
  19. package/lib/esm/src/api/status.js +46 -0
  20. package/lib/esm/src/assets/c3-icons.d.ts +5 -0
  21. package/lib/esm/src/assets/c3-icons.js +5 -0
  22. package/lib/esm/src/assets/c3-icons.types.d.ts +3 -0
  23. package/lib/esm/src/assets/c3-icons.types.js +6 -0
  24. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.d.ts +5 -0
  25. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards-config.js +94 -0
  26. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.d.ts +17 -0
  27. package/lib/esm/src/components/c3-app-teaser/app-teaser-cards.js +31 -0
  28. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.d.ts +14 -0
  29. package/lib/esm/src/components/c3-app-teaser/app-teaster-card.js +24 -0
  30. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.d.ts +9 -0
  31. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.js +48 -0
  32. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.d.ts +1 -0
  33. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser-page.test.js +33 -0
  34. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.d.ts +14 -0
  35. package/lib/esm/src/components/c3-app-teaser/c3-app-teaser.js +53 -0
  36. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.d.ts +6 -0
  37. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.js +84 -0
  38. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.d.ts +1 -0
  39. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.test.js +13 -0
  40. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.d.ts +26 -0
  41. package/lib/esm/src/components/c3-cluster-tag/c3-cluster-tag.types.js +11 -0
  42. package/lib/esm/src/components/c3-data-table/c3-data-table.d.ts +3 -0
  43. package/lib/esm/src/components/c3-data-table/c3-data-table.js +509 -0
  44. package/lib/esm/src/components/c3-data-table/c3-data-table.types.d.ts +122 -0
  45. package/lib/esm/src/components/c3-data-table/c3-data-table.types.js +6 -0
  46. package/lib/esm/src/components/c3-data-table/link-button/link-button.d.ts +3 -0
  47. package/lib/esm/src/components/c3-data-table/link-button/link-button.js +15 -0
  48. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.d.ts +8 -0
  49. package/lib/esm/src/components/c3-data-table/link-button/link-button.types.js +6 -0
  50. package/lib/esm/src/components/c3-empty-state/c3-empty-state.d.ts +3 -0
  51. package/lib/esm/src/components/c3-empty-state/c3-empty-state.js +15 -0
  52. package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.d.ts +1 -0
  53. package/lib/esm/src/components/c3-empty-state/c3-empty-state.test.js +25 -0
  54. package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.d.ts +29 -0
  55. package/lib/esm/src/components/c3-empty-state/c3-empty-state.types.js +6 -0
  56. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.d.ts +19 -0
  57. package/lib/esm/src/components/c3-help-center/c3-help-center-provider.js +58 -0
  58. package/lib/esm/src/components/c3-help-center/c3-help-center.d.ts +16 -0
  59. package/lib/esm/src/components/c3-help-center/c3-help-center.js +218 -0
  60. package/lib/esm/src/components/c3-help-center/c3-help-center.types.d.ts +43 -0
  61. package/lib/esm/src/components/c3-help-center/c3-help-center.types.js +6 -0
  62. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.d.ts +10 -0
  63. package/lib/esm/src/components/c3-help-center/defaultHelpCenterConfig.js +17 -0
  64. package/lib/esm/src/components/c3-help-center/help-center-hint.d.ts +4 -0
  65. package/lib/esm/src/components/c3-help-center/help-center-hint.js +15 -0
  66. package/lib/esm/src/components/c3-help-center/help-center.d.ts +18 -0
  67. package/lib/esm/src/components/c3-help-center/help-center.js +189 -0
  68. package/lib/esm/src/components/c3-help-center/recommendations.d.ts +4 -0
  69. package/lib/esm/src/components/c3-help-center/recommendations.js +55 -0
  70. package/lib/esm/src/components/c3-help-center/styles.d.ts +4 -0
  71. package/lib/esm/src/components/c3-help-center/styles.js +48 -0
  72. package/lib/esm/src/components/c3-help-center/tabs/feedback.d.ts +9 -0
  73. package/lib/esm/src/components/c3-help-center/tabs/feedback.js +141 -0
  74. package/lib/esm/src/components/c3-help-center/tabs/tabContent.d.ts +20 -0
  75. package/lib/esm/src/components/c3-help-center/tabs/tabContent.js +22 -0
  76. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.d.ts +2 -0
  77. package/lib/esm/src/components/c3-help-center/tabs/tabContentSkeleton.js +26 -0
  78. package/lib/esm/src/components/c3-help-center/tile.d.ts +10 -0
  79. package/lib/esm/src/components/c3-help-center/tile.js +61 -0
  80. package/lib/esm/src/components/c3-navigation/c3-info-button.d.ts +4 -0
  81. package/lib/esm/src/components/c3-navigation/c3-info-button.js +9 -0
  82. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.d.ts +6 -0
  83. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.js +18 -0
  84. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.d.ts +10 -0
  85. package/lib/esm/src/components/c3-navigation/c3-navigation-actions/c3-action-buttons.types.js +6 -0
  86. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.d.ts +4 -0
  87. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/c3-navigation-appbar.js +387 -0
  88. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.d.ts +2 -0
  89. package/lib/esm/src/components/c3-navigation/c3-navigation-appbar/components.js +21 -0
  90. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.d.ts +6 -0
  91. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-info-sidebar.js +38 -0
  92. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.d.ts +12 -0
  93. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar-element.js +68 -0
  94. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.d.ts +10 -0
  95. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.js +87 -0
  96. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.d.ts +81 -0
  97. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-navigation-sidebar.types.js +6 -0
  98. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.d.ts +5 -0
  99. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-notification-sidebar.js +107 -0
  100. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.d.ts +29 -0
  101. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-sidebar-state-provider.js +54 -0
  102. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.d.ts +6 -0
  103. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/c3-user-sidebar.js +57 -0
  104. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.d.ts +2 -0
  105. package/lib/esm/src/components/c3-navigation/c3-navigation-sidebar/components.js +11 -0
  106. package/lib/esm/src/components/c3-navigation/c3-navigation.d.ts +7 -0
  107. package/lib/esm/src/components/c3-navigation/c3-navigation.js +262 -0
  108. package/lib/esm/src/components/c3-navigation/c3-navigation.test.d.ts +1 -0
  109. package/lib/esm/src/components/c3-navigation/c3-navigation.test.js +89 -0
  110. package/lib/esm/src/components/c3-navigation/c3-navigation.types.d.ts +97 -0
  111. package/lib/esm/src/components/c3-navigation/c3-navigation.types.js +6 -0
  112. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.d.ts +13 -0
  113. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-container.js +100 -0
  114. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.d.ts +19 -0
  115. package/lib/esm/src/components/c3-navigation/c3-notification-provider/c3-notification-provider.js +110 -0
  116. package/lib/esm/src/components/c3-navigation/c3-org-name.d.ts +6 -0
  117. package/lib/esm/src/components/c3-navigation/c3-org-name.js +34 -0
  118. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.d.ts +6 -0
  119. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/c3-org-sidebar.js +188 -0
  120. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.d.ts +29 -0
  121. package/lib/esm/src/components/c3-navigation/c3-org-sidebar/components.js +92 -0
  122. package/lib/esm/src/components/c3-navigation/helpers.d.ts +8 -0
  123. package/lib/esm/src/components/c3-navigation/helpers.js +58 -0
  124. package/lib/esm/src/components/c3-navigation/index.d.ts +2 -0
  125. package/lib/esm/src/components/c3-navigation/index.js +8 -0
  126. package/lib/esm/src/components/c3-navigation/stories/story-helpers.d.ts +35 -0
  127. package/lib/esm/src/components/c3-navigation/stories/story-helpers.js +264 -0
  128. package/lib/esm/src/components/c3-navigation/stories/story-templates.d.ts +9 -0
  129. package/lib/esm/src/components/c3-navigation/stories/story-templates.js +38 -0
  130. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.d.ts +14 -0
  131. package/lib/esm/src/components/c3-onboarding-survey/c3-onboarding-survey.js +94 -0
  132. package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.d.ts +16 -0
  133. package/lib/esm/src/components/c3-onboarding-survey/defaultOnboardingConfig.js +8 -0
  134. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.d.ts +15 -0
  135. package/lib/esm/src/components/c3-onboarding-survey/elements/dropdownSelect.js +58 -0
  136. package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.d.ts +3 -0
  137. package/lib/esm/src/components/c3-onboarding-survey/elements/inlineNotification.js +10 -0
  138. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.d.ts +7 -0
  139. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupMulti.js +53 -0
  140. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.d.ts +7 -0
  141. package/lib/esm/src/components/c3-onboarding-survey/elements/radioGroupSingle.js +36 -0
  142. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.d.ts +6 -0
  143. package/lib/esm/src/components/c3-onboarding-survey/elements/textField.js +14 -0
  144. package/lib/esm/src/components/c3-onboarding-survey/helpers.d.ts +1 -0
  145. package/lib/esm/src/components/c3-onboarding-survey/helpers.js +10 -0
  146. package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.d.ts +30 -0
  147. package/lib/esm/src/components/c3-onboarding-survey/onboarding.types.js +13 -0
  148. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.d.ts +25 -0
  149. package/lib/esm/src/components/c3-onboarding-survey/onboardingModal.js +52 -0
  150. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.d.ts +21 -0
  151. package/lib/esm/src/components/c3-onboarding-survey/onboardingPage.js +35 -0
  152. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.d.ts +17 -0
  153. package/lib/esm/src/components/c3-onboarding-survey/onboardingSurvey.js +148 -0
  154. package/lib/esm/src/components/c3-onboarding-survey/step.d.ts +7 -0
  155. package/lib/esm/src/components/c3-onboarding-survey/step.js +44 -0
  156. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.d.ts +3 -0
  157. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.js +28 -0
  158. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.d.ts +19 -0
  159. package/lib/esm/src/components/c3-page/c3-breadcrumb/c3-breadcrumb.types.js +6 -0
  160. package/lib/esm/src/components/c3-page/c3-page.d.ts +4 -0
  161. package/lib/esm/src/components/c3-page/c3-page.js +16 -0
  162. package/lib/esm/src/components/c3-page/c3-page.test.d.ts +1 -0
  163. package/lib/esm/src/components/c3-page/c3-page.test.js +25 -0
  164. package/lib/esm/src/components/c3-page/c3-page.types.d.ts +18 -0
  165. package/lib/esm/src/components/c3-page/c3-page.types.js +6 -0
  166. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.d.ts +3 -0
  167. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.js +37 -0
  168. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.d.ts +14 -0
  169. package/lib/esm/src/components/c3-page/c3-tabs/c3-tabs.types.js +6 -0
  170. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.d.ts +2 -0
  171. package/lib/esm/src/components/c3-responsive-stack/c3-responsive-stack.js +18 -0
  172. package/lib/esm/src/components/c3-user-configuration/authToken.d.ts +30 -0
  173. package/lib/esm/src/components/c3-user-configuration/authToken.js +30 -0
  174. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.d.ts +26 -0
  175. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/c3-profile-provider.js +117 -0
  176. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.d.ts +13 -0
  177. package/lib/esm/src/components/c3-user-configuration/c3-profile-provider/carbon-theme-provider.js +29 -0
  178. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.d.ts +54 -0
  179. package/lib/esm/src/components/c3-user-configuration/c3-user-configuration-provider.js +43 -0
  180. package/lib/esm/src/components/styles.d.ts +13 -0
  181. package/lib/esm/src/components/styles.js +90 -0
  182. package/lib/esm/src/components/test-utils.d.ts +3 -0
  183. package/lib/esm/src/components/test-utils.js +32 -0
  184. package/lib/esm/src/contexts/c3-cluster-update-manager.d.ts +12 -0
  185. package/lib/esm/src/contexts/c3-cluster-update-manager.js +27 -0
  186. package/lib/esm/src/hooks/useApi.d.ts +20 -0
  187. package/lib/esm/src/hooks/useApi.js +54 -0
  188. package/lib/esm/src/index.d.ts +23 -0
  189. package/lib/esm/src/index.js +19 -0
  190. package/lib/esm/src/utils/camunda.d.ts +21 -0
  191. package/lib/esm/src/utils/camunda.js +59 -0
  192. package/lib/esm/src/utils/camunda.types.d.ts +63 -0
  193. package/lib/esm/src/utils/camunda.types.js +6 -0
  194. package/lib/esm/src/utils/versionCheck.utils.d.ts +15 -0
  195. package/lib/esm/src/utils/versionCheck.utils.js +99 -0
  196. package/package.json +16 -16
@@ -0,0 +1,262 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
+ * under one or more contributor license agreements. Licensed under a commercial license.
5
+ * You may not use this file except in compliance with the commercial license.
6
+ */
7
+ import { Callout, Stack as CarbonStack, DefinitionTooltip, Header, HeaderGlobalBar, HeaderMenu, HeaderMenuItem, HeaderName, HeaderNavigation, Link, SkipToContent, Tag, Toggletip, ToggletipButton, ToggletipContent, } from '@carbon/react';
8
+ import { Time, Warning } from '@carbon/react/icons/index.esm.js';
9
+ import React, { useState } from 'react';
10
+ import styled from 'styled-components';
11
+ import { StatusService } from '../../api/status.js';
12
+ import { CamundaLogo } from '../../assets/c3-icons.js';
13
+ import { C3ClusterTagWithClusterName } from '../c3-cluster-tag/c3-cluster-tag.js';
14
+ import { C3HelpCenter } from '../c3-help-center/c3-help-center.js';
15
+ import { useC3HelpCenter } from '../c3-help-center/c3-help-center-provider.js';
16
+ import { HelpCenterHint } from '../c3-help-center/help-center-hint.js';
17
+ import { useC3Profile } from '../c3-user-configuration/c3-profile-provider/c3-profile-provider.js';
18
+ import { useC3UserConfiguration } from '../c3-user-configuration/c3-user-configuration-provider.js';
19
+ import { InfoButton } from './c3-info-button.js';
20
+ import C3ActionButtons from './c3-navigation-actions/c3-action-buttons.js';
21
+ import { C3NavigationAppBar } from './c3-navigation-appbar/c3-navigation-appbar.js';
22
+ import C3InfoSidebar from './c3-navigation-sidebar/c3-info-sidebar.js';
23
+ import { C3NotificationSidebar } from './c3-navigation-sidebar/c3-notification-sidebar.js';
24
+ import { C3SidebarStateProvider } from './c3-navigation-sidebar/c3-sidebar-state-provider.js';
25
+ import C3UserSidebar from './c3-navigation-sidebar/c3-user-sidebar.js';
26
+ import { OrgName } from './c3-org-name.js';
27
+ import C3OrgSidebar from './c3-org-sidebar/c3-org-sidebar.js';
28
+ import { useMediaQuery } from './helpers.js';
29
+ /**
30
+ * UI SHELL
31
+ * Docs: https://react.carbondesignsystem.com/?path=/story/components-ui-shell--fixed-side-nav
32
+ */
33
+ const BREAKPOINT_LG_WIDTH = '66rem'; // This is Carbon's breakpoint (lg) width https://github.com/carbon-design-system/carbon/blob/main/packages/layout/src/index.js#L56
34
+ const Stack = styled(CarbonStack) `
35
+ align-items: center;
36
+ `;
37
+ const StyledToggletipContent = styled(ToggletipContent) `
38
+ .cds--link:visited {
39
+ color: var(--cds-link-text-color);
40
+ }
41
+
42
+ .cds--link:visited:hover {
43
+ color: var(--cds-link-hover-text-color);
44
+ }
45
+ `;
46
+ const ClusterTagWrapper = styled.div `
47
+ .cds--tag {
48
+ height: 1.5rem;
49
+ margin-top: 0.75rem;
50
+ padding: 0 1rem;
51
+ }
52
+ `;
53
+ const ResponsiveNavbarElementsWrapper = styled.div `
54
+ display: grid;
55
+ grid-auto-flow: column;
56
+ gap: 0.5rem;
57
+ paddingright: 0.5rem;
58
+
59
+ @media (max-width: 768px) {
60
+ display: none;
61
+ }
62
+ `;
63
+ const NON_PRODUCTION_TERMS_LINK = 'https://legal.camunda.com/#self-managed-non-production-terms';
64
+ const SALES_CONTACT_LINK = 'https://camunda.com/contact/';
65
+ export const SECOND = 1000;
66
+ export const MINUTE = SECOND * 60;
67
+ export const HOUR = MINUTE * 60;
68
+ export const DAY = HOUR * 24;
69
+ const LICENSE_EXPIRY = DAY * 30;
70
+ export const C3Navigation = ({ app, appBar, forwardRef, navbar, orgSideBar, infoSideBar, infoButton, helpCenter, actionButtons, userSideBar, notificationSideBar, clusterUuid, options, }) => {
71
+ const { openHelpCenter } = useC3HelpCenter();
72
+ const { currentClusterUuid, decodedAudience } = useC3UserConfiguration();
73
+ const { activeOrg } = useC3Profile();
74
+ const isLargeScreen = useMediaQuery(`(min-width: ${BREAKPOINT_LG_WIDTH}`);
75
+ const appBarElementsLength = appBar.elements?.length ?? 0;
76
+ const displayAppBar = !!(appBarElementsLength > 0 ||
77
+ appBar.appTeaserRouteProps ||
78
+ (!isLargeScreen && navbar.elements.length > 0));
79
+ const [appBarOpen, setAppBarOpen] = useState(appBar.isOpen || false);
80
+ const orgName = activeOrg?.name || navbar.orgName;
81
+ let expiresAt;
82
+ if (navbar.licenseTag?.expiresAt !== undefined) {
83
+ if (typeof navbar.licenseTag?.expiresAt === 'string') {
84
+ expiresAt = Date.parse(navbar.licenseTag?.expiresAt);
85
+ }
86
+ if (typeof navbar.licenseTag?.expiresAt === 'number') {
87
+ expiresAt = navbar.licenseTag?.expiresAt;
88
+ }
89
+ }
90
+ const [camundaStatus, setCamundaStatus] = useState({ error: false, description: '', endpoint: '' });
91
+ const fetchStatus = async (audience) => {
92
+ const status = await StatusService.camundaStatus(audience);
93
+ setCamundaStatus(status);
94
+ };
95
+ React.useEffect(() => {
96
+ if (decodedAudience) {
97
+ fetchStatus(decodedAudience);
98
+ }
99
+ const interval = setInterval(() => {
100
+ if (decodedAudience) {
101
+ fetchStatus(decodedAudience);
102
+ }
103
+ }, 5 * MINUTE);
104
+ return () => clearInterval(interval);
105
+ }, [decodedAudience]);
106
+ const tags = [
107
+ ...(navbar.tags || []),
108
+ ...(navbar.licenseTag?.show
109
+ ? [
110
+ {
111
+ key: 'license-tag',
112
+ label: navbar.licenseTag.isProductionLicense
113
+ ? 'Production license'
114
+ : 'Non-production license',
115
+ color: 'gray',
116
+ tooltip: navbar.licenseTag.isProductionLicense
117
+ ? undefined
118
+ : {
119
+ content: (_jsxs("p", { children: ["Non-production license. For production usage details, visit our", ' ', _jsx(Link, { href: NON_PRODUCTION_TERMS_LINK, target: '_blank', style: { display: 'inline' }, children: "terms & conditions page" }), ' ', "or", ' ', _jsx(Link, { href: SALES_CONTACT_LINK, target: '_blank', style: { display: 'inline' }, children: "contact our sales team" }), "."] })),
120
+ buttonLabel: 'Learn more',
121
+ },
122
+ },
123
+ ]
124
+ : []),
125
+ ...(navbar.licenseTag?.show &&
126
+ navbar.licenseTag?.isCommercial === false &&
127
+ (expiresAt === undefined || expiresAt - LICENSE_EXPIRY >= Date.now())
128
+ ? [
129
+ {
130
+ key: 'non-commercial-license-tag',
131
+ label: `Non-commercial license`,
132
+ color: 'gray',
133
+ },
134
+ ]
135
+ : []),
136
+ ...(navbar.licenseTag?.show &&
137
+ expiresAt &&
138
+ navbar.licenseTag?.isCommercial === false &&
139
+ expiresAt - LICENSE_EXPIRY < Date.now() &&
140
+ expiresAt > Date.now()
141
+ ? [
142
+ {
143
+ key: 'non-commercial-license-tag-about-to-expire',
144
+ label: `Non-commercial license - ${Math.floor((expiresAt - Date.now()) / DAY)} ${Math.floor((expiresAt - Date.now()) / DAY) > 1 ? 'days' : 'day'} left`,
145
+ color: 'blue',
146
+ renderIcon: Time,
147
+ tooltip: {
148
+ content: (_jsx("p", { children: "Please renew and provide new license keys to continue production use of Camunda." })),
149
+ buttonLabel: 'Learn more',
150
+ },
151
+ },
152
+ ]
153
+ : []),
154
+ ...(navbar.licenseTag?.show &&
155
+ navbar.licenseTag?.expiresAt &&
156
+ navbar.licenseTag?.isCommercial === false &&
157
+ expiresAt < Date.now()
158
+ ? [
159
+ {
160
+ key: 'non-commercial-license-tag-is-expired',
161
+ label: `Non-commercial license - expired`,
162
+ color: 'red',
163
+ renderIcon: Warning,
164
+ tooltip: {
165
+ content: (_jsx("p", { children: "To continue using all features, please renew your license." })),
166
+ buttonLabel: 'Learn more',
167
+ },
168
+ },
169
+ ]
170
+ : []),
171
+ ];
172
+ if (app.prefix)
173
+ console.warn('The `prefix` prop is deprecated and will be removed in a future release. It has been replaced with a Camunda icon.');
174
+ return (_jsxs(C3SidebarStateProvider, { isNotificationSidebarOpen: notificationSideBar?.isOpen, isOrgSidebarOpen: orgSideBar?.isOpen, isInfoSidebarOpen: infoSideBar?.isOpen, isUserSidebarOpen: userSideBar?.isOpen, children: [_jsxs(Header, { "aria-label": app.ariaLabel, children: [_jsx(SkipToContent, {}), displayAppBar && (_jsx(C3NavigationAppBar, { app: app, appBar: { ...appBar, isOpen: appBarOpen }, forwardRef: forwardRef, navbar: navbar, toggleAppbar: (value) => {
175
+ setAppBarOpen(value);
176
+ } })), _jsx(HeaderName, { as: forwardRef, prefix: '', ...app.routeProps, children: _jsxs(Stack, { gap: 3, orientation: 'horizontal', children: [_jsx(CamundaLogo, { "aria-label": 'Camunda' }), _jsx("span", { children: app.name })] }) }), _jsx(HeaderNavigation, { "aria-label": app.ariaLabel, children: navbar.elements.map((element) => {
177
+ if (element.subElements && element.subElements.length > 0) {
178
+ const isSubElementActive = element.subElements.some((subElement) => subElement.isCurrentPage);
179
+ return (_jsx(HeaderMenu, { "aria-label": element.label, menuLinkName: element.label, isActive: element.isCurrentPage || isSubElementActive, children: element.subElements.map((subElement) => {
180
+ const routeProps = subElement.routeProps ?? {};
181
+ const { onClick: routeOnClick, ...restRouteProps } = routeProps;
182
+ return (_jsx(HeaderMenuItem, { as: subElement.routeProps && forwardRef, isActive: subElement.isCurrentPage, href: subElement.href, target: subElement.href ? subElement.target : undefined, ...restRouteProps, onClick: () => {
183
+ subElement.onClick?.();
184
+ routeOnClick?.();
185
+ }, children: _jsx("span", { children: subElement.label }) }, subElement.key));
186
+ }) }, element.key));
187
+ }
188
+ return (_jsx(HeaderMenuItem, { as: element.routeProps && forwardRef, isActive: element.isCurrentPage, ...element.routeProps, children: _jsx("span", { children: element.label }) }, element.key));
189
+ }) }), navbar?.customNavSlot && navbar?.customNavSlot, _jsxs(HeaderGlobalBar, { children: [_jsxs(ResponsiveNavbarElementsWrapper, { children: [tags &&
190
+ tags.length > 0 &&
191
+ tags.map((tag) => {
192
+ if (tag?.tooltip !== undefined) {
193
+ const { content, buttonLabel } = tag.tooltip;
194
+ return (_jsx("div", { style: {
195
+ height: '1.5rem',
196
+ marginTop: '0.75rem',
197
+ }, children: _jsxs(Toggletip, { children: [_jsx(ToggletipButton, { as: 'span', label: buttonLabel, children: _jsx(Tag, { type: tag.color, renderIcon: tag.renderIcon, style: {
198
+ margin: '0',
199
+ cursor: 'pointer',
200
+ overflow: 'hidden',
201
+ whiteSpace: 'nowrap',
202
+ textOverflow: 'ellipsis',
203
+ }, children: tag.label }) }), _jsx(StyledToggletipContent, { children: content })] }) }, tag.key));
204
+ }
205
+ return (_jsx(Tag, { renderIcon: tag.renderIcon, style: {
206
+ height: '1.5rem',
207
+ marginTop: '0.75rem',
208
+ overflow: 'hidden',
209
+ whiteSpace: 'nowrap',
210
+ textOverflow: 'ellipsis',
211
+ }, type: tag.color, children: tag.label }, tag.key));
212
+ }), (clusterUuid || currentClusterUuid) && (_jsx(ClusterTagWrapper, { children: _jsx(C3ClusterTagWithClusterName, { clusterUuid: clusterUuid || currentClusterUuid || '', conditionalRendering: options?.conditionalTagRendering }) })), orgName && (_jsx(OrgName, { orgName: orgName, isSuperOrg: activeOrg?.isSuperOrg, activeSuperOrg: activeOrg?.superOrganization?.name }))] }), actionButtons && _jsx(C3ActionButtons, { elements: actionButtons }), notificationSideBar && (_jsx(C3NotificationSidebar, { sideBar: {
213
+ ...notificationSideBar,
214
+ type: 'notifications',
215
+ } })), orgSideBar && (_jsx(C3OrgSidebar, { sideBar: {
216
+ ...orgSideBar,
217
+ type: 'org',
218
+ } })), infoButton || helpCenter ? (_jsx(HelpCenterHint, { children: _jsx(InfoButton, { onClick: infoButton ? infoButton.onClick : () => openHelpCenter() }) })) : (infoSideBar && (_jsx(C3InfoSidebar, { sideBar: { ...infoSideBar, type: 'info' } }))), userSideBar && (_jsx(C3UserSidebar, { sideBar: {
219
+ ...userSideBar,
220
+ type: 'user',
221
+ } }))] })] }), (() => {
222
+ if (camundaStatus.error &&
223
+ camundaStatus.endpoint &&
224
+ options?.c8StatusBanner) {
225
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'cds--header', style: {
226
+ position: 'fixed',
227
+ marginTop: '48px',
228
+ zIndex: '7000',
229
+ }, children: _jsx(Callout, { title: '', kind: 'error', lowContrast: true, style: { maxWidth: '100%' }, children: _jsxs("div", { style: {
230
+ display: 'flex',
231
+ justifyContent: 'space-between',
232
+ alignItems: 'center',
233
+ width: '100%',
234
+ position: 'absolute',
235
+ paddingRight: '62px',
236
+ }, children: [_jsx("div", { className: 'cds--actionable-notification__title', dir: 'auto', style: {
237
+ flexShrink: 0,
238
+ }, children: "Service incident alert" }), _jsx(DefinitionTooltip, { "aria-describedby": '', definition: 'We&apos;re aware of a live incident potentially impacting our SaaS product. Please check our status page for details.', align: 'bottom', openOnHover: true, style: {
239
+ marginTop: '-1px',
240
+ width: 'calc(100vw - 400px)',
241
+ borderBlockEnd: 'none',
242
+ overflow: 'hidden',
243
+ textOverflow: 'ellipsis',
244
+ textWrap: 'nowrap',
245
+ whiteSpace: 'nowrap',
246
+ fontSize: '14px',
247
+ }, children: _jsx("span", { children: "We're aware of a live incident potentially impacting our SaaS product. Please check our status page for details." }) }), _jsx(Link, { onClick: () => {
248
+ window.open(camundaStatus.endpoint, '_blank');
249
+ }, inline: true, style: {
250
+ cursor: 'pointer',
251
+ color: '$link-primary',
252
+ marginLeft: 'auto',
253
+ marginRight: 0,
254
+ textDecoration: 'none',
255
+ overflow: 'hidden',
256
+ whiteSpace: 'nowrap',
257
+ textWrap: 'nowrap',
258
+ }, children: 'Camunda status page' })] }) }) }), _jsx("div", { style: { height: '48px' } })] }));
259
+ }
260
+ return _jsx(_Fragment, {});
261
+ })(), helpCenter && _jsx(C3HelpCenter, { ...helpCenter })] }));
262
+ };
@@ -0,0 +1,89 @@
1
+ /*
2
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
+ * under one or more contributor license agreements. Licensed under a commercial license.
4
+ * You may not use this file except in compliance with the commercial license.
5
+ */
6
+ import { expect, test } from '@playwright/test';
7
+ import { getStory } from '../test-utils.js';
8
+ test.describe('Navigation', () => {
9
+ test('Basic', async ({ page }) => {
10
+ await getStory(page, 'uishell-c3navigation--basic');
11
+ await expect(page).toHaveScreenshot();
12
+ });
13
+ test('App bar open', async ({ page }) => {
14
+ await getStory(page, 'uishell-c3navigation--app-bar-opened');
15
+ await expect(page).toHaveScreenshot();
16
+ });
17
+ test('Org bar open', async ({ page }) => {
18
+ await getStory(page, 'uishell-c3navigation--org-side-bar-opened');
19
+ await expect(page).toHaveScreenshot();
20
+ });
21
+ test('Info bar open', async ({ page }) => {
22
+ await getStory(page, 'uishell-c3navigation--info-side-bar-opened');
23
+ await expect(page).toHaveScreenshot();
24
+ });
25
+ test('Info bar open - with divider', async ({ page }) => {
26
+ await getStory(page, 'uishell-c3navigation--info-side-bar-opened-with-divider');
27
+ await expect(page).toHaveScreenshot();
28
+ });
29
+ test('Info button', async ({ page }) => {
30
+ await getStory(page, 'uishell-c3navigation--info-button');
31
+ await expect(page).toHaveScreenshot();
32
+ });
33
+ test('User bar open', async ({ page }) => {
34
+ await getStory(page, 'uishell-c3navigation--user-side-bar-opened');
35
+ await expect(page).toHaveScreenshot();
36
+ });
37
+ test('User bar open - with custom section', async ({ page }) => {
38
+ await getStory(page, 'uishell-c3navigation--user-side-bar-opened-with-custom-section');
39
+ await expect(page).toHaveScreenshot();
40
+ });
41
+ test('User bar open - with custom section and state', async ({ page }) => {
42
+ await getStory(page, 'uishell-c3navigation--user-side-bar-with-custom-section-and-state');
43
+ await expect(page).toHaveScreenshot();
44
+ });
45
+ test('App bar - without elements', async ({ page }) => {
46
+ await getStory(page, 'uishell-c3navigation--app-bar-without-elements');
47
+ await expect(page).toHaveScreenshot();
48
+ });
49
+ test('App bar - without elements and nav elements', async ({ page }) => {
50
+ await getStory(page, 'uishell-c3navigation--app-bar-without-elements-and-nav-elements');
51
+ await expect(page).toHaveScreenshot();
52
+ });
53
+ test('Notifications bar open', async ({ page }) => {
54
+ // Fake current time for consistent screenshots
55
+ const fakeNow = new Date('January 5 2023 13:37:11').valueOf();
56
+ await page.addInitScript(`{
57
+ Date = class extends Date {
58
+ constructor(...args) {
59
+ if (args.length === 0) {
60
+ super(${fakeNow});
61
+ } else {
62
+ super(...args);
63
+ }
64
+ }
65
+ }
66
+ const __DateNowOffset = ${fakeNow} - Date.now();
67
+ const __DateNow = Date.now;
68
+ Date.now = () => __DateNow() + __DateNowOffset;
69
+ }`);
70
+ await getStory(page, 'uishell-c3navigation--notifications-side-bar-opened');
71
+ await expect(page).toHaveScreenshot();
72
+ });
73
+ test('Notifications bar open - no notifications', async ({ page }) => {
74
+ await getStory(page, 'uishell-c3navigation--notifications-side-bar-opened-no-notifications');
75
+ await expect(page).toHaveScreenshot();
76
+ });
77
+ test('Action button', async ({ page }) => {
78
+ await getStory(page, 'uishell-c3navigation--acion-button-instead-of-info-bar');
79
+ await expect(page).toHaveScreenshot();
80
+ });
81
+ test('Action button with custom element', async ({ page }) => {
82
+ await getStory(page, 'uishell-c3navigation--acion-button-with-custom-element');
83
+ await expect(page).toHaveScreenshot();
84
+ });
85
+ test('Navbar with submenu', async ({ page }) => {
86
+ await getStory(page, 'uishell-c3navigation--nav-bar-with-submenu');
87
+ await expect(page).toHaveScreenshot();
88
+ });
89
+ });
@@ -0,0 +1,97 @@
1
+ import type { Endpoints, Stage } from '../../api/endpoints.const';
2
+ import type { TagColor } from '../c3-cluster-tag/c3-cluster-tag';
3
+ import type { CamundaClusterStage } from '../c3-cluster-tag/c3-cluster-tag.types';
4
+ import type { C3HelpCenterProps } from '../c3-help-center/c3-help-center';
5
+ import type { C3ActionButtonsProps } from './c3-navigation-actions/c3-action-buttons.types';
6
+ import type { C3NavigationAppBarProps, C3NavigationInfoSideBarProps, C3NavigationNotificationsSideBarProps, C3NavigationOrgSideBarProps, C3NavigationUserSideBarProps } from './c3-navigation-sidebar/c3-navigation-sidebar.types';
7
+ export interface C3NavigationAppProps {
8
+ prefix?: string;
9
+ name: string;
10
+ ariaLabel: string;
11
+ routeProps: any;
12
+ }
13
+ export interface C3NavigationElementProps {
14
+ ariaLabel?: string;
15
+ key: string;
16
+ label: string;
17
+ kind?: 'ghost' | 'danger--ghost';
18
+ active?: boolean;
19
+ isActive?: boolean;
20
+ renderIcon?: any;
21
+ routeProps?: any;
22
+ href?: string;
23
+ target?: '_blank' | '_self' | '_parent' | '_top';
24
+ onClick?: () => void;
25
+ subElements?: C3NavigationElementProps[];
26
+ preceedingDivider?: boolean;
27
+ overflowMenu?: React.ReactNode;
28
+ isNavLink?: boolean;
29
+ }
30
+ export interface C3NavigationNavBarSubElement {
31
+ key: string;
32
+ label: string;
33
+ routeProps?: C3NavigationElementProps['routeProps'];
34
+ href?: string;
35
+ target?: '_blank' | '_self' | '_parent' | '_top';
36
+ isCurrentPage?: boolean;
37
+ onClick?: () => void;
38
+ }
39
+ export interface C3NavigationNavBarElement {
40
+ label: string;
41
+ key: string;
42
+ routeProps?: C3NavigationElementProps['routeProps'];
43
+ isCurrentPage: boolean;
44
+ subElements?: C3NavigationNavBarSubElement[];
45
+ }
46
+ export interface C3NavigationNavBarProps {
47
+ elements: C3NavigationNavBarElement[];
48
+ tags?: Array<{
49
+ label: string;
50
+ key: string;
51
+ color?: TagColor;
52
+ renderIcon?: any;
53
+ tooltip?: {
54
+ content: React.ReactNode;
55
+ buttonLabel: string;
56
+ };
57
+ }>;
58
+ licenseTag?: {
59
+ show: boolean;
60
+ isProductionLicense: boolean;
61
+ isCommercial?: boolean;
62
+ expiresAt?: number | string;
63
+ };
64
+ customNavSlot?: React.ReactNode;
65
+ orgName?: string;
66
+ }
67
+ export interface C3NotificationsProps {
68
+ stage?: Stage;
69
+ endpoints?: Endpoints;
70
+ activeOrganizationId: string;
71
+ userToken: string;
72
+ getNewUserToken: () => Promise<string>;
73
+ enableLogs?: boolean;
74
+ }
75
+ type WithoutType<P> = Omit<P, 'type'>;
76
+ export interface C3NavigationProps {
77
+ app: C3NavigationAppProps;
78
+ appBar: WithoutType<C3NavigationAppBarProps>;
79
+ orgSideBar?: WithoutType<C3NavigationOrgSideBarProps>;
80
+ infoSideBar?: WithoutType<C3NavigationInfoSideBarProps>;
81
+ infoButton?: {
82
+ onClick: () => void;
83
+ };
84
+ helpCenter?: C3HelpCenterProps;
85
+ actionButtons?: C3ActionButtonsProps;
86
+ userSideBar?: WithoutType<C3NavigationUserSideBarProps>;
87
+ notificationSideBar?: WithoutType<C3NavigationNotificationsSideBarProps>;
88
+ navbar: C3NavigationNavBarProps;
89
+ forwardRef?: React.ForwardRefExoticComponent<any>;
90
+ clusterUuid?: string;
91
+ options?: {
92
+ conditionalTagRendering?: (stage: CamundaClusterStage) => boolean;
93
+ c8StatusBanner?: boolean;
94
+ };
95
+ toggleAppbar: (value: boolean) => void;
96
+ }
97
+ export {};
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
3
+ * under one or more contributor license agreements. Licensed under a commercial license.
4
+ * You may not use this file except in compliance with the commercial license.
5
+ */
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type FC } from 'react';
2
+ import type { Notification as NotificationProps } from '../../../api/notifications';
3
+ export declare const NotificationTitle: any;
4
+ export declare const NotificationDescription: any;
5
+ export declare const LinkContainer: any;
6
+ declare const C3NotificationContainer: FC<NotificationProps & {
7
+ onRead: () => void;
8
+ onDismiss: () => void;
9
+ onLinkClick?: (meta: NotificationProps['meta']) => void;
10
+ originalOnLinkClick?: (meta: NotificationProps['meta']) => void;
11
+ unread?: boolean;
12
+ }>;
13
+ export default C3NotificationContainer;
@@ -0,0 +1,100 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
+ * under one or more contributor license agreements. Licensed under a commercial license.
5
+ * You may not use this file except in compliance with the commercial license.
6
+ */
7
+ import { Button, Link, Tile } from '@carbon/react';
8
+ import { Close } from '@carbon/react/icons/index.esm.js';
9
+ import { useState } from 'react';
10
+ import styled from 'styled-components';
11
+ const NotificationTile = styled(Tile) `
12
+ box-shadow: inset 0px -1px 0px var(--cds-border-subtle-01);
13
+ `;
14
+ const CloseButton = styled(Button) `
15
+ margin-right: -1rem;
16
+ visibility: ${({ $show }) => ($show ? 'visible' : 'hidden')};
17
+ `;
18
+ const UnreadNotificationHeader = styled.div `
19
+ display: flex;
20
+ align-items: center;
21
+ width: 100%;
22
+ `;
23
+ const Dot = styled.div `
24
+ background: var(--cds-interactive);
25
+ width: 5px;
26
+ height: 5px;
27
+ border-radius: 50%;
28
+ margin-left: -9px;
29
+ margin-right: 4px;
30
+ `;
31
+ const Timestamp = styled.p `
32
+ color: var(--cds-text-helper);
33
+ font-size: var(--cds-label-01-font-size);
34
+ font-weight: var(--cds-label-01-font-weight);
35
+ line-height: var(--cds-label-01-line-height);
36
+ letter-spacing: var(--cds-label-01-letter-spacing);
37
+ `;
38
+ const NotificationHeader = styled.div `
39
+ width: 100%;
40
+ min-height: 2rem;
41
+ display: flex;
42
+ align-items: flex-end;
43
+ justify-content: space-between;
44
+ margin-top: -1rem;
45
+ `;
46
+ export const NotificationTitle = styled.p `
47
+ color: var(--cds-text-primary);
48
+ font-size: var(--cds-heading-compact-01-font-size);
49
+ font-weight: var(--cds-heading-compact-01-font-weight);
50
+ line-height: var(--cds-heading-compact-01-line-height);
51
+ letter-spacing: var(--cds-heading-compact-01-letter-spacing);
52
+ margin-top: var(--cds-spacing-01);
53
+ `;
54
+ export const NotificationDescription = styled.p `
55
+ color: var(--cds-text-primary);
56
+ font-size: var(--cds-helper-text-01-font-size);
57
+ font-weight: var(--cds-helper-text-01-font-weight);
58
+ line-height: var(--cds-helper-text-01-line-height);
59
+ letter-spacing: var(--cds-helper-text-01-letter-spacing);
60
+ margin-top: var(--cds-spacing-01);
61
+ `;
62
+ export const LinkContainer = styled.div `
63
+ margin-top: 0.5rem;
64
+ `;
65
+ const getReadableTimestamp = (timestamp) => {
66
+ const date = new Date(timestamp);
67
+ const minutesAgo = Math.floor(Math.abs(Date.now() - timestamp) / 1000 / 60);
68
+ if (minutesAgo === 0) {
69
+ return 'New';
70
+ }
71
+ if (minutesAgo < 60) {
72
+ return `${minutesAgo}min ago`;
73
+ }
74
+ const hoursAgo = Math.floor(minutesAgo / 60);
75
+ if (hoursAgo < 24) {
76
+ return `${hoursAgo}hr ago`;
77
+ }
78
+ return date.toDateString();
79
+ };
80
+ const C3NotificationContainer = ({ description, state, timestamp, title, onDismiss, meta, onLinkClick, originalOnLinkClick, unread = false, }) => {
81
+ const [isHovering, setIsHovering] = useState(false);
82
+ const dismissNotification = (e) => {
83
+ e.stopPropagation();
84
+ onDismiss();
85
+ };
86
+ const handleLinkClick = (event) => {
87
+ if (originalOnLinkClick && onLinkClick) {
88
+ event.preventDefault();
89
+ onLinkClick(meta);
90
+ return false;
91
+ }
92
+ return true;
93
+ };
94
+ return (_jsxs(NotificationTile, { onMouseEnter: () => {
95
+ setIsHovering(true);
96
+ }, onMouseLeave: () => {
97
+ setIsHovering(false);
98
+ }, children: [_jsxs(UnreadNotificationHeader, { children: [(state === 'new' || unread) && _jsx(Dot, {}), _jsxs(NotificationHeader, { children: [_jsx(Timestamp, { children: getReadableTimestamp(timestamp) }), _jsx(CloseButton, { kind: 'ghost', hasIconOnly: true, iconDescription: 'Dismiss', align: 'bottom-right', renderIcon: Close, onClick: dismissNotification, size: 'sm', "$show": isHovering })] })] }), _jsx(NotificationTitle, { children: title }), _jsx(NotificationDescription, { children: description }), meta && (_jsx(LinkContainer, { children: _jsx(Link, { href: meta.href, onClick: handleLinkClick, visited: true, style: { fontSize: 'var(--cds-helper-text-01-font-size)' }, children: meta.label }) }))] }));
99
+ };
100
+ export default C3NotificationContainer;
@@ -0,0 +1,19 @@
1
+ import React, { type ComponentType, type FC, type ReactNode } from 'react';
2
+ import { type AnalyticsEvent, type Notification } from '../../../api/notifications';
3
+ export type C3NotificationContextValue = {
4
+ enabled: boolean;
5
+ isFetching: boolean;
6
+ notifications: Notification[];
7
+ markAsRead: (notification: Notification) => void;
8
+ markAllAsRead: (notifications: Notification[]) => void;
9
+ dismiss: (notification: Notification) => void;
10
+ dismissAll: (notifications: Notification[]) => void;
11
+ analytics: (event: AnalyticsEvent, id?: string) => void;
12
+ };
13
+ export declare const C3NotificationContext: React.Context<C3NotificationContextValue>;
14
+ export type C3NotificationProviderProps = {
15
+ children?: ReactNode;
16
+ };
17
+ declare const C3NotificationProvider: FC<C3NotificationProviderProps>;
18
+ export declare function withNotifications<P>(Component: ComponentType<P>): ComponentType<P>;
19
+ export default C3NotificationProvider;