@dhis2-ui/header-bar 10.16.3 → 10.16.4

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 (40) hide show
  1. package/build/cjs/__e2e__/stories/common.js +6 -11
  2. package/build/cjs/__e2e__/stories/with-update-available-notification.js +1 -2
  3. package/build/cjs/apps.js +51 -66
  4. package/build/cjs/debug-info/debug-info-menu-item.js +4 -5
  5. package/build/cjs/debug-info/debug-info-modal.js +3 -4
  6. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +2 -4
  7. package/build/cjs/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +1 -2
  8. package/build/cjs/header-bar-context.js +6 -8
  9. package/build/cjs/header-bar.js +12 -14
  10. package/build/cjs/header-bar.prod.stories.js +1 -2
  11. package/build/cjs/join-path.js +1 -4
  12. package/build/cjs/locales/index.js +106 -65
  13. package/build/cjs/notification-icon.js +21 -24
  14. package/build/cjs/notifications.js +5 -6
  15. package/build/cjs/online-status.js +3 -4
  16. package/build/cjs/profile-menu/profile-header.js +44 -57
  17. package/build/cjs/profile-menu/profile-menu.js +17 -22
  18. package/build/cjs/profile-menu/update-notification.js +4 -5
  19. package/build/cjs/profile.js +7 -9
  20. package/build/cjs/title.js +9 -12
  21. package/build/es/__e2e__/stories/common.js +5 -9
  22. package/build/es/apps.js +50 -64
  23. package/build/es/debug-info/debug-info-menu-item.js +4 -5
  24. package/build/es/debug-info/debug-info-modal.js +3 -4
  25. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +2 -4
  26. package/build/es/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +1 -2
  27. package/build/es/header-bar-context.js +5 -6
  28. package/build/es/header-bar.js +11 -12
  29. package/build/es/join-path.js +1 -4
  30. package/build/es/locales/index.js +78 -37
  31. package/build/es/notification-icon.js +21 -24
  32. package/build/es/notifications.js +5 -6
  33. package/build/es/online-status.js +3 -4
  34. package/build/es/profile-menu/profile-header.js +44 -57
  35. package/build/es/profile-menu/profile-menu.js +16 -20
  36. package/build/es/profile-menu/update-notification.js +4 -5
  37. package/build/es/profile.js +6 -7
  38. package/build/es/title.js +9 -12
  39. package/package.json +15 -15
  40. package/src/locales/index.js +114 -37
@@ -32,15 +32,14 @@ const query = {
32
32
  resource: 'me/dashboard'
33
33
  }
34
34
  };
35
- export const HeaderBar = _ref => {
36
- var _data$user2, _data$user2$settings, _data$user$avatar;
37
- let {
38
- appName,
39
- className,
40
- updateAvailable,
41
- onApplyAvailableUpdate,
42
- skipI18n
43
- } = _ref;
35
+ export const HeaderBar = ({
36
+ appName,
37
+ className,
38
+ updateAvailable,
39
+ onApplyAvailableUpdate,
40
+ skipI18n
41
+ }) => {
42
+ var _data$user2, _data$user$avatar;
44
43
  const {
45
44
  appName: configAppName,
46
45
  baseUrl,
@@ -61,16 +60,16 @@ export const HeaderBar = _ref => {
61
60
  }, [data, baseUrl]);
62
61
  useEffect(() => {
63
62
  if (!loading && !error && !skipI18n) {
64
- var _data$user, _data$user$settings;
63
+ var _data$user;
65
64
  // This is the "legacy" way of localising the header bar, which is necesasry for external (non-platform) apps
66
65
  // For platform apps, setting i18n is handled by the app-shell so this logic is redundant (and running it twice caused issues)
67
66
  // For external apps, this logic is kept for backwards compatibility, but they also have the option of passing `skipI18n`
68
67
  // and initialising i18n in the consumer
69
- const locale = (data === null || data === void 0 ? void 0 : (_data$user = data.user) === null || _data$user === void 0 ? void 0 : (_data$user$settings = _data$user.settings) === null || _data$user$settings === void 0 ? void 0 : _data$user$settings.keyUiLocale) || 'en';
68
+ const locale = (data === null || data === void 0 || (_data$user = data.user) === null || _data$user === void 0 || (_data$user = _data$user.settings) === null || _data$user === void 0 ? void 0 : _data$user.keyUiLocale) || 'en';
70
69
  i18n.setDefaultNamespace('default');
71
70
  i18n.changeLanguage(locale);
72
71
  }
73
- }, [data === null || data === void 0 ? void 0 : (_data$user2 = data.user) === null || _data$user2 === void 0 ? void 0 : (_data$user2$settings = _data$user2.settings) === null || _data$user2$settings === void 0 ? void 0 : _data$user2$settings.keyUiLocale, error, loading, skipI18n]);
72
+ }, [data === null || data === void 0 || (_data$user2 = data.user) === null || _data$user2 === void 0 || (_data$user2 = _data$user2.settings) === null || _data$user2 === void 0 ? void 0 : _data$user2.keyUiLocale, error, loading, skipI18n]);
74
73
  return /*#__PURE__*/React.createElement(HeaderBarContextProvider, {
75
74
  updateAvailable: updateAvailable,
76
75
  onApplyAvailableUpdate: onApplyAvailableUpdate
@@ -1,7 +1,4 @@
1
- export const joinPath = function () {
2
- for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
3
- parts[_key] = arguments[_key];
4
- }
1
+ export const joinPath = (...parts) => {
5
2
  const realParts = parts.filter(part => !!part);
6
3
  return realParts.map(part => part.replace(/^\/+|\/+$/g, '')).join('/');
7
4
  };
@@ -45,41 +45,82 @@ import viTranslations from './vi/translations.json';
45
45
  import zhTranslations from './zh/translations.json';
46
46
  import zh_CNTranslations from './zh_CN/translations.json';
47
47
  const namespace = 'default';
48
- i18n.addResources('ar', namespace, arTranslations);
49
- i18n.addResources('ar_IQ', namespace, ar_IQTranslations);
50
- i18n.addResources('bn', namespace, bnTranslations);
51
- i18n.addResources('ckb', namespace, ckbTranslations);
52
- i18n.addResources('cs', namespace, csTranslations);
53
- i18n.addResources('da', namespace, daTranslations);
54
- i18n.addResources('en', namespace, enTranslations);
55
- i18n.addResources('en_US', namespace, en_USTranslations);
56
- i18n.addResources('es', namespace, esTranslations);
57
- i18n.addResources('es_419', namespace, es_419Translations);
58
- i18n.addResources('fr', namespace, frTranslations);
59
- i18n.addResources('hi_IN', namespace, hi_INTranslations);
60
- i18n.addResources('id', namespace, idTranslations);
61
- i18n.addResources('km', namespace, kmTranslations);
62
- i18n.addResources('lo', namespace, loTranslations);
63
- i18n.addResources('my', namespace, myTranslations);
64
- i18n.addResources('nb', namespace, nbTranslations);
65
- i18n.addResources('nl', namespace, nlTranslations);
66
- i18n.addResources('or', namespace, orTranslations);
67
- i18n.addResources('prs', namespace, prsTranslations);
68
- i18n.addResources('ps', namespace, psTranslations);
69
- i18n.addResources('pt', namespace, ptTranslations);
70
- i18n.addResources('pt_BR', namespace, pt_BRTranslations);
71
- i18n.addResources('ro', namespace, roTranslations);
72
- i18n.addResources('ru', namespace, ruTranslations);
73
- i18n.addResources('si', namespace, siTranslations);
74
- i18n.addResources('sv', namespace, svTranslations);
75
- i18n.addResources('tet', namespace, tetTranslations);
76
- i18n.addResources('tg', namespace, tgTranslations);
77
- i18n.addResources('uk', namespace, ukTranslations);
78
- i18n.addResources('ur', namespace, urTranslations);
79
- i18n.addResources('uz_Latn', namespace, uz_LatnTranslations);
80
- i18n.addResources('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations);
81
- i18n.addResources('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations);
82
- i18n.addResources('vi', namespace, viTranslations);
83
- i18n.addResources('zh', namespace, zhTranslations);
84
- i18n.addResources('zh_CN', namespace, zh_CNTranslations);
48
+
49
+ // Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
50
+ // custom translations from the datastore (added by the app adapter)
51
+
52
+ i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
53
+ i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
54
+ i18n.addResourceBundle('ar_IQ', namespace, ar_IQTranslations, true, false);
55
+ i18n.addResourceBundle('ar-IQ', namespace, ar_IQTranslations, true, false);
56
+ i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
57
+ i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
58
+ i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
59
+ i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
60
+ i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
61
+ i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
62
+ i18n.addResourceBundle('da', namespace, daTranslations, true, false);
63
+ i18n.addResourceBundle('da', namespace, daTranslations, true, false);
64
+ i18n.addResourceBundle('en', namespace, enTranslations, true, false);
65
+ i18n.addResourceBundle('en', namespace, enTranslations, true, false);
66
+ i18n.addResourceBundle('en_US', namespace, en_USTranslations, true, false);
67
+ i18n.addResourceBundle('en-US', namespace, en_USTranslations, true, false);
68
+ i18n.addResourceBundle('es', namespace, esTranslations, true, false);
69
+ i18n.addResourceBundle('es', namespace, esTranslations, true, false);
70
+ i18n.addResourceBundle('es_419', namespace, es_419Translations, true, false);
71
+ i18n.addResourceBundle('es-419', namespace, es_419Translations, true, false);
72
+ i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
73
+ i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
74
+ i18n.addResourceBundle('hi_IN', namespace, hi_INTranslations, true, false);
75
+ i18n.addResourceBundle('hi-IN', namespace, hi_INTranslations, true, false);
76
+ i18n.addResourceBundle('id', namespace, idTranslations, true, false);
77
+ i18n.addResourceBundle('id', namespace, idTranslations, true, false);
78
+ i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
79
+ i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
80
+ i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
81
+ i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
82
+ i18n.addResourceBundle('my', namespace, myTranslations, true, false);
83
+ i18n.addResourceBundle('my', namespace, myTranslations, true, false);
84
+ i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
85
+ i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
86
+ i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
87
+ i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
88
+ i18n.addResourceBundle('or', namespace, orTranslations, true, false);
89
+ i18n.addResourceBundle('or', namespace, orTranslations, true, false);
90
+ i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
91
+ i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
92
+ i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
93
+ i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
94
+ i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
95
+ i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
96
+ i18n.addResourceBundle('pt_BR', namespace, pt_BRTranslations, true, false);
97
+ i18n.addResourceBundle('pt-BR', namespace, pt_BRTranslations, true, false);
98
+ i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
99
+ i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
100
+ i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
101
+ i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
102
+ i18n.addResourceBundle('si', namespace, siTranslations, true, false);
103
+ i18n.addResourceBundle('si', namespace, siTranslations, true, false);
104
+ i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
105
+ i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
106
+ i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
107
+ i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
108
+ i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
109
+ i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
110
+ i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
111
+ i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
112
+ i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
113
+ i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
114
+ i18n.addResourceBundle('uz_Latn', namespace, uz_LatnTranslations, true, false);
115
+ i18n.addResourceBundle('uz-Latn', namespace, uz_LatnTranslations, true, false);
116
+ i18n.addResourceBundle('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations, true, false);
117
+ i18n.addResourceBundle('uz-Cyrl-UZ', namespace, uz_UZ_CyrlTranslations, true, false);
118
+ i18n.addResourceBundle('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations, true, false);
119
+ i18n.addResourceBundle('uz-Latn-UZ', namespace, uz_UZ_LatnTranslations, true, false);
120
+ i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
121
+ i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
122
+ i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
123
+ i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
124
+ i18n.addResourceBundle('zh_CN', namespace, zh_CNTranslations, true, false);
125
+ i18n.addResourceBundle('zh-CN', namespace, zh_CNTranslations, true, false);
85
126
  export default i18n;
@@ -15,30 +15,27 @@ function icon(kind) {
15
15
  });
16
16
  }
17
17
  }
18
- export const NotificationIcon = _ref => {
19
- let {
20
- count = 0,
21
- href,
22
- kind,
23
- dataTestId,
24
- title,
25
- 'aria-label': ariaLabel
26
- } = _ref;
27
- return /*#__PURE__*/React.createElement("a", {
28
- dir: "ltr",
29
- href: href,
30
- "data-test": dataTestId,
31
- title: i18n.t(title),
32
- "aria-label": i18n.t(ariaLabel),
33
- className: _JSXStyle.dynamic([["995028205", [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]]]) + " " + (kind || "")
34
- }, icon(kind), count > 0 && /*#__PURE__*/React.createElement("span", {
35
- "data-test": `${dataTestId}-count`,
36
- className: _JSXStyle.dynamic([["995028205", [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]]])
37
- }, count), /*#__PURE__*/React.createElement(_JSXStyle, {
38
- id: "995028205",
39
- dynamic: [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]
40
- }, [`a.__jsx-style-dynamic-selector{position:relative;margin:0;cursor:pointer;padding:0 ${spacers.dp12};height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}`, "a.__jsx-style-dynamic-selector:focus{outline:2px solid white;outline-offset:-2px;}", "a.__jsx-style-dynamic-selector:focus.__jsx-style-dynamic-selector:not(:focus-visible){outline:none;}", "a.__jsx-style-dynamic-selector:hover{background:#1a557f;}", "a.__jsx-style-dynamic-selector:active{background:#104067;}", `span.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;position:absolute;top:3px;inset-inline-end:2px;min-width:18px;min-height:18px;border-radius:${spacers.dp12};box-shadow:0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);background-color:${theme.secondary500};color:${colors.white};font-size:13px;font-weight:600;line-height:15px;text-align:center;cursor:inherit;padding:0 ${spacers.dp4};}`]));
41
- };
18
+ export const NotificationIcon = ({
19
+ count = 0,
20
+ href,
21
+ kind,
22
+ dataTestId,
23
+ title,
24
+ 'aria-label': ariaLabel
25
+ }) => /*#__PURE__*/React.createElement("a", {
26
+ dir: "ltr",
27
+ href: href,
28
+ "data-test": dataTestId,
29
+ title: i18n.t(title),
30
+ "aria-label": i18n.t(ariaLabel),
31
+ className: _JSXStyle.dynamic([["995028205", [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]]]) + " " + (kind || "")
32
+ }, icon(kind), count > 0 && /*#__PURE__*/React.createElement("span", {
33
+ "data-test": `${dataTestId}-count`,
34
+ className: _JSXStyle.dynamic([["995028205", [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]]])
35
+ }, count), /*#__PURE__*/React.createElement(_JSXStyle, {
36
+ id: "995028205",
37
+ dynamic: [spacers.dp12, spacers.dp12, theme.secondary500, colors.white, spacers.dp4]
38
+ }, [`a.__jsx-style-dynamic-selector{position:relative;margin:0;cursor:pointer;padding:0 ${spacers.dp12};height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}`, "a.__jsx-style-dynamic-selector:focus{outline:2px solid white;outline-offset:-2px;}", "a.__jsx-style-dynamic-selector:focus.__jsx-style-dynamic-selector:not(:focus-visible){outline:none;}", "a.__jsx-style-dynamic-selector:hover{background:#1a557f;}", "a.__jsx-style-dynamic-selector:active{background:#104067;}", `span.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;position:absolute;top:3px;inset-inline-end:2px;min-width:18px;min-height:18px;border-radius:${spacers.dp12};box-shadow:0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);background-color:${theme.secondary500};color:${colors.white};font-size:13px;font-weight:600;line-height:15px;text-align:center;cursor:inherit;padding:0 ${spacers.dp4};}`]));
42
39
  NotificationIcon.propTypes = {
43
40
  'aria-label': PropTypes.string.isRequired,
44
41
  href: PropTypes.string.isRequired,
@@ -6,12 +6,11 @@ import { joinPath } from './join-path.js';
6
6
  import i18n from './locales/index.js';
7
7
  import { NotificationIcon } from './notification-icon.js';
8
8
  const hasAuthority = (userAuthorities, authId) => Array.isArray(userAuthorities) && userAuthorities.some(userAuthId => userAuthId === 'ALL' || userAuthId === authId);
9
- export const Notifications = _ref => {
10
- let {
11
- interpretations,
12
- messages,
13
- userAuthorities
14
- } = _ref;
9
+ export const Notifications = ({
10
+ interpretations,
11
+ messages,
12
+ userAuthorities
13
+ }) => {
15
14
  const {
16
15
  baseUrl
17
16
  } = useConfig();
@@ -7,10 +7,9 @@ import i18n from './locales/index.js';
7
7
  import styles from './online-status.styles.js';
8
8
 
9
9
  /** A badge to display online/offline status in the header bar */
10
- export function OnlineStatus(_ref) {
11
- let {
12
- dense
13
- } = _ref;
10
+ export function OnlineStatus({
11
+ dense
12
+ }) {
14
13
  const {
15
14
  isConnected: online
16
15
  } = useDhis2ConnectionStatus();
@@ -5,38 +5,31 @@ import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
  import { joinPath } from '../join-path.js';
7
7
  import i18n from '../locales/index.js';
8
- const ProfileName = _ref => {
9
- let {
10
- children
11
- } = _ref;
12
- return /*#__PURE__*/React.createElement("div", {
13
- "data-test": "headerbar-profile-username",
14
- className: "jsx-2223023701"
15
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
16
- id: "2223023701"
17
- }, ["div.jsx-2223023701{margin-bottom:3px;font-size:16px;line-height:19px;}"]));
18
- };
8
+ const ProfileName = ({
9
+ children
10
+ }) => /*#__PURE__*/React.createElement("div", {
11
+ "data-test": "headerbar-profile-username",
12
+ className: "jsx-2223023701"
13
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
14
+ id: "2223023701"
15
+ }, ["div.jsx-2223023701{margin-bottom:3px;font-size:16px;line-height:19px;}"]));
19
16
  ProfileName.propTypes = {
20
17
  children: PropTypes.string
21
18
  };
22
- const ProfileEmail = _ref2 => {
23
- let {
24
- children
25
- } = _ref2;
26
- return /*#__PURE__*/React.createElement("div", {
27
- "data-test": "headerbar-profile-user-email",
28
- className: "jsx-1072768994"
29
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
30
- id: "1072768994"
31
- }, ["div.jsx-1072768994{margin-bottom:6px;font-size:14px;line-height:16px;}"]));
32
- };
19
+ const ProfileEmail = ({
20
+ children
21
+ }) => /*#__PURE__*/React.createElement("div", {
22
+ "data-test": "headerbar-profile-user-email",
23
+ className: "jsx-1072768994"
24
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
25
+ id: "1072768994"
26
+ }, ["div.jsx-1072768994{margin-bottom:6px;font-size:14px;line-height:16px;}"]));
33
27
  ProfileEmail.propTypes = {
34
28
  children: PropTypes.string
35
29
  };
36
- const ProfileEdit = _ref3 => {
37
- let {
38
- children
39
- } = _ref3;
30
+ const ProfileEdit = ({
31
+ children
32
+ }) => {
40
33
  const {
41
34
  baseUrl
42
35
  } = useConfig();
@@ -51,41 +44,35 @@ const ProfileEdit = _ref3 => {
51
44
  ProfileEdit.propTypes = {
52
45
  children: PropTypes.string
53
46
  };
54
- const ProfileDetails = _ref4 => {
55
- let {
56
- name,
57
- email
58
- } = _ref4;
59
- return /*#__PURE__*/React.createElement("div", {
60
- className: "jsx-4236878114"
61
- }, /*#__PURE__*/React.createElement(ProfileName, null, name), /*#__PURE__*/React.createElement(ProfileEmail, null, email), /*#__PURE__*/React.createElement(ProfileEdit, null, i18n.t('Edit profile')), /*#__PURE__*/React.createElement(_JSXStyle, {
62
- id: "4236878114"
63
- }, ["div.jsx-4236878114{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-inline-start:20px;color:#000;font-size:14px;font-weight:400;}"]));
64
- };
47
+ const ProfileDetails = ({
48
+ name,
49
+ email
50
+ }) => /*#__PURE__*/React.createElement("div", {
51
+ className: "jsx-4236878114"
52
+ }, /*#__PURE__*/React.createElement(ProfileName, null, name), /*#__PURE__*/React.createElement(ProfileEmail, null, email), /*#__PURE__*/React.createElement(ProfileEdit, null, i18n.t('Edit profile')), /*#__PURE__*/React.createElement(_JSXStyle, {
53
+ id: "4236878114"
54
+ }, ["div.jsx-4236878114{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-inline-start:20px;color:#000;font-size:14px;font-weight:400;}"]));
65
55
  ProfileDetails.propTypes = {
66
56
  email: PropTypes.string,
67
57
  name: PropTypes.string
68
58
  };
69
- export const ProfileHeader = _ref5 => {
70
- let {
71
- name,
72
- email,
73
- avatarId
74
- } = _ref5;
75
- return /*#__PURE__*/React.createElement("div", {
76
- className: "jsx-371352323"
77
- }, /*#__PURE__*/React.createElement(UserAvatar, {
78
- avatarId: avatarId,
79
- name: name,
80
- dataTest: "headerbar-profile-menu-icon",
81
- large: true
82
- }), /*#__PURE__*/React.createElement(ProfileDetails, {
83
- name: name,
84
- email: email
85
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
86
- id: "371352323"
87
- }, ["div.jsx-371352323{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-inline-start:24px;padding-top:20px;}"]));
88
- };
59
+ export const ProfileHeader = ({
60
+ name,
61
+ email,
62
+ avatarId
63
+ }) => /*#__PURE__*/React.createElement("div", {
64
+ className: "jsx-371352323"
65
+ }, /*#__PURE__*/React.createElement(UserAvatar, {
66
+ avatarId: avatarId,
67
+ name: name,
68
+ dataTest: "headerbar-profile-menu-icon",
69
+ large: true
70
+ }), /*#__PURE__*/React.createElement(ProfileDetails, {
71
+ name: name,
72
+ email: email
73
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
74
+ id: "371352323"
75
+ }, ["div.jsx-371352323{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-inline-start:24px;padding-top:20px;}"]));
89
76
  ProfileHeader.propTypes = {
90
77
  avatarId: PropTypes.string,
91
78
  email: PropTypes.string,
@@ -20,15 +20,14 @@ const LoadingMask = () => /*#__PURE__*/React.createElement(Layer, {
20
20
  disablePortal: true,
21
21
  dataTest: "headerbar-profile-menu-loading-mask"
22
22
  }, /*#__PURE__*/React.createElement(Center, null, /*#__PURE__*/React.createElement(CircularLoader, null)));
23
- const ProfileContents = _ref => {
24
- let {
25
- name,
26
- email,
27
- avatarId,
28
- helpUrl,
29
- hideProfileMenu,
30
- showDebugInfoModal
31
- } = _ref;
23
+ const ProfileContents = ({
24
+ name,
25
+ email,
26
+ avatarId,
27
+ helpUrl,
28
+ hideProfileMenu,
29
+ showDebugInfoModal
30
+ }) => {
32
31
  const {
33
32
  baseUrl
34
33
  } = useConfig();
@@ -108,17 +107,14 @@ ProfileContents.propTypes = {
108
107
  helpUrl: PropTypes.string,
109
108
  name: PropTypes.string
110
109
  };
111
- export const ProfileMenu = _ref2 => {
112
- let {
113
- ...props
114
- } = _ref2;
115
- return /*#__PURE__*/React.createElement("div", {
116
- "data-test": "headerbar-profile-menu",
117
- className: "jsx-3924623997"
118
- }, /*#__PURE__*/React.createElement(ProfileContents, props), /*#__PURE__*/React.createElement(_JSXStyle, {
119
- id: "3924623997"
120
- }, ["div.jsx-3924623997{z-index:10000;position:absolute;inset-inline-end:4px;width:320px;}"]));
121
- };
110
+ export const ProfileMenu = ({
111
+ ...props
112
+ }) => /*#__PURE__*/React.createElement("div", {
113
+ "data-test": "headerbar-profile-menu",
114
+ className: "jsx-3924623997"
115
+ }, /*#__PURE__*/React.createElement(ProfileContents, props), /*#__PURE__*/React.createElement(_JSXStyle, {
116
+ id: "3924623997"
117
+ }, ["div.jsx-3924623997{z-index:10000;position:absolute;inset-inline-end:4px;width:320px;}"]));
122
118
  ProfileMenu.propTypes = {
123
119
  hideProfileMenu: PropTypes.func.isRequired,
124
120
  showDebugInfoModal: PropTypes.func.isRequired,
@@ -6,10 +6,9 @@ import PropTypes from 'prop-types';
6
6
  import React from 'react';
7
7
  import { useHeaderBarContext } from '../header-bar-context.js';
8
8
  import i18n from '../locales/index.js';
9
- export function UpdateNotification(_ref) {
10
- let {
11
- hideProfileMenu
12
- } = _ref;
9
+ export function UpdateNotification({
10
+ hideProfileMenu
11
+ }) {
13
12
  const {
14
13
  appName
15
14
  } = useConfig();
@@ -19,7 +18,7 @@ export function UpdateNotification(_ref) {
19
18
  } = useHeaderBarContext();
20
19
  const onClick = () => {
21
20
  hideProfileMenu();
22
- onApplyAvailableUpdate === null || onApplyAvailableUpdate === void 0 ? void 0 : onApplyAvailableUpdate();
21
+ onApplyAvailableUpdate === null || onApplyAvailableUpdate === void 0 || onApplyAvailableUpdate();
23
22
  };
24
23
  const updateNotificationLabel = /*#__PURE__*/React.createElement("div", {
25
24
  className: _JSXStyle.dynamic([["4135170305", [colors.blue600]]]) + " " + "root"
@@ -6,13 +6,12 @@ import { DebugInfoModal } from './debug-info/debug-info-modal.js';
6
6
  import i18n from './locales/index.js';
7
7
  import { useOnDocClick } from './profile/use-on-doc-click.js';
8
8
  import { ProfileMenu } from './profile-menu/index.js';
9
- const Profile = _ref => {
10
- let {
11
- name,
12
- email,
13
- avatarId,
14
- helpUrl
15
- } = _ref;
9
+ const Profile = ({
10
+ name,
11
+ email,
12
+ avatarId,
13
+ helpUrl
14
+ }) => {
16
15
  const [showProfileMenu, setShowProfileMenu] = useState(false);
17
16
  const [showDebugInfoModal, setShowDebugInfoModal] = useState(false);
18
17
  const hideProfileMenu = useCallback(() => setShowProfileMenu(false), [setShowProfileMenu]);
package/build/es/title.js CHANGED
@@ -1,18 +1,15 @@
1
1
  import _JSXStyle from "styled-jsx/style";
2
2
  import PropTypes from 'prop-types';
3
3
  import React from 'react';
4
- export const Title = _ref => {
5
- let {
6
- app,
7
- instance
8
- } = _ref;
9
- return /*#__PURE__*/React.createElement("div", {
10
- "data-test": "headerbar-title",
11
- className: "jsx-2721515324"
12
- }, app ? `${instance} - ${app}` : `${instance}`, /*#__PURE__*/React.createElement(_JSXStyle, {
13
- id: "2721515324"
14
- }, ["div.jsx-2721515324{overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;-webkit-letter-spacing:0.01em;-moz-letter-spacing:0.01em;-ms-letter-spacing:0.01em;letter-spacing:0.01em;white-space:nowrap;}"]));
15
- };
4
+ export const Title = ({
5
+ app,
6
+ instance
7
+ }) => /*#__PURE__*/React.createElement("div", {
8
+ "data-test": "headerbar-title",
9
+ className: "jsx-2721515324"
10
+ }, app ? `${instance} - ${app}` : `${instance}`, /*#__PURE__*/React.createElement(_JSXStyle, {
11
+ id: "2721515324"
12
+ }, ["div.jsx-2721515324{overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;-webkit-letter-spacing:0.01em;-moz-letter-spacing:0.01em;-ms-letter-spacing:0.01em;letter-spacing:0.01em;white-space:nowrap;}"]));
16
13
  Title.propTypes = {
17
14
  app: PropTypes.string,
18
15
  instance: PropTypes.string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2-ui/header-bar",
3
- "version": "10.16.3",
3
+ "version": "10.16.4",
4
4
  "description": "UI HeaderBar",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,21 +34,21 @@
34
34
  "styled-jsx": "^4"
35
35
  },
36
36
  "dependencies": {
37
- "@dhis2-ui/box": "10.16.3",
38
- "@dhis2-ui/button": "10.16.3",
39
- "@dhis2-ui/card": "10.16.3",
40
- "@dhis2-ui/center": "10.16.3",
41
- "@dhis2-ui/divider": "10.16.3",
42
- "@dhis2-ui/input": "10.16.3",
43
- "@dhis2-ui/layer": "10.16.3",
44
- "@dhis2-ui/loader": "10.16.3",
45
- "@dhis2-ui/logo": "10.16.3",
46
- "@dhis2-ui/menu": "10.16.3",
47
- "@dhis2-ui/modal": "10.16.3",
48
- "@dhis2-ui/user-avatar": "10.16.3",
37
+ "@dhis2-ui/box": "10.16.4",
38
+ "@dhis2-ui/button": "10.16.4",
39
+ "@dhis2-ui/card": "10.16.4",
40
+ "@dhis2-ui/center": "10.16.4",
41
+ "@dhis2-ui/divider": "10.16.4",
42
+ "@dhis2-ui/input": "10.16.4",
43
+ "@dhis2-ui/layer": "10.16.4",
44
+ "@dhis2-ui/loader": "10.16.4",
45
+ "@dhis2-ui/logo": "10.16.4",
46
+ "@dhis2-ui/menu": "10.16.4",
47
+ "@dhis2-ui/modal": "10.16.4",
48
+ "@dhis2-ui/user-avatar": "10.16.4",
49
49
  "@dhis2/prop-types": "^3.1.2",
50
- "@dhis2/ui-constants": "10.16.3",
51
- "@dhis2/ui-icons": "10.16.3",
50
+ "@dhis2/ui-constants": "10.16.4",
51
+ "@dhis2/ui-icons": "10.16.4",
52
52
  "classnames": "^2.3.1",
53
53
  "moment": "^2.29.1",
54
54
  "prop-types": "^15.7.2"