tenjin-ui-kit 0.3.47 → 0.3.48

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.
@@ -31,6 +31,28 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
31
31
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
32
32
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
33
33
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
+ var ANNOUNCEMENT_TYPES = {
35
+ success: {
36
+ backgroundColor: '#EDF7ED',
37
+ borderLeft: '6px solid #4CAF50',
38
+ color: '#1B5E20'
39
+ },
40
+ error: {
41
+ backgroundColor: '#FDECEA',
42
+ borderLeft: '6px solid #F44336',
43
+ color: '#B71C1C'
44
+ },
45
+ warning: {
46
+ backgroundColor: '#FFF6DA',
47
+ borderLeft: '6px solid #FFC107',
48
+ color: '#7C5E10'
49
+ },
50
+ info: {
51
+ backgroundColor: '#E8F4FD',
52
+ borderLeft: '6px solid #2196F3',
53
+ color: '#0D47A1'
54
+ }
55
+ };
34
56
  var ProjectTopbar = function ProjectTopbar(_ref) {
35
57
  var _loggedInUser$role;
36
58
  var homeIcon = _ref.homeIcon,
@@ -40,6 +62,8 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
40
62
  onViewProfileClick = _ref.onViewProfileClick,
41
63
  hrefLink = _ref.hrefLink,
42
64
  avatarItems = _ref.avatarItems,
65
+ _ref$announcement = _ref.announcement,
66
+ announcement = _ref$announcement === void 0 ? null : _ref$announcement,
43
67
  _ref$isChatEnabled = _ref.isChatEnabled,
44
68
  isChatEnabled = _ref$isChatEnabled === void 0 ? false : _ref$isChatEnabled;
45
69
  var theme = (0, _system.useTheme)();
@@ -226,7 +250,27 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
226
250
  },
227
251
  display: "flex",
228
252
  alignItems: "center"
229
- }, (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$role = loggedInUser.role) === null || _loggedInUser$role === void 0 ? void 0 : _loggedInUser$role.id) === 1 && /*#__PURE__*/_react.default.createElement(_button.default, {
253
+ }, announcement && /*#__PURE__*/_react.default.createElement(_system.Box, {
254
+ sx: {
255
+ backgroundColor: ANNOUNCEMENT_TYPES[announcement.type].backgroundColor,
256
+ borderLeft: ANNOUNCEMENT_TYPES[announcement.type].borderLeft,
257
+ color: ANNOUNCEMENT_TYPES[announcement.type].color,
258
+ minHeight: '26px',
259
+ height: '100%',
260
+ minWidth: '200px',
261
+ borderRadius: '4px',
262
+ marginRight: '10px',
263
+ paddingInline: '10px',
264
+ paddingBlock: '6px',
265
+ display: 'flex',
266
+ alignItems: 'center',
267
+ fontSize: '12px'
268
+ }
269
+ }, typeof announcement.message === 'string' ? /*#__PURE__*/_react.default.createElement(_text.default, {
270
+ sx: {
271
+ fontSize: '12px'
272
+ }
273
+ }, announcement.message) : announcement.message), (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$role = loggedInUser.role) === null || _loggedInUser$role === void 0 ? void 0 : _loggedInUser$role.id) === 1 && /*#__PURE__*/_react.default.createElement(_button.default, {
230
274
  variant: "text",
231
275
  startIcon: /*#__PURE__*/_react.default.createElement(_reactFeather.Settings, {
232
276
  size: "1rem"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tenjin-ui-kit",
3
- "version": "0.3.47",
3
+ "version": "0.3.48",
4
4
  "repository": {
5
5
  "url": "https://gitlab.com/yethi/react/tenjin-ui-kit.git"
6
6
  },