@zohodesk/dot 1.4.8 → 1.4.10

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 (51) hide show
  1. package/README.md +19 -0
  2. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +0 -1
  3. package/assets/Appearance/light/mode/Dot_LightMode.module.css +0 -1
  4. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +0 -1
  5. package/coverage/ExternalLink/ExternalLink.js.html +1 -1
  6. package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
  7. package/coverage/ExternalLink/index.html +1 -1
  8. package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
  9. package/coverage/ExternalLink/props/index.html +1 -1
  10. package/coverage/ExternalLink/props/propTypes.js.html +1 -1
  11. package/coverage/IconButton/IconButton.js.html +1 -1
  12. package/coverage/IconButton/IconButton.module.css.html +1 -1
  13. package/coverage/IconButton/index.html +1 -1
  14. package/coverage/IconButton/props/defaultProps.js.html +1 -1
  15. package/coverage/IconButton/props/index.html +1 -1
  16. package/coverage/IconButton/props/propTypes.js.html +1 -1
  17. package/coverage/Image/Image.js.html +1 -1
  18. package/coverage/Image/Image.module.css.html +1 -1
  19. package/coverage/Image/index.html +1 -1
  20. package/coverage/Image/props/defaultProps.js.html +1 -1
  21. package/coverage/Image/props/index.html +1 -1
  22. package/coverage/Image/props/propTypes.js.html +1 -1
  23. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
  24. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
  25. package/coverage/avatar/AvatarWithTeam/index.html +1 -1
  26. package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
  27. package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
  28. package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
  29. package/coverage/index.html +1 -1
  30. package/es/NewStar/NewStar.module.css +128 -67
  31. package/es/common/dot_boxShadow.module.css +3 -1
  32. package/es/form/fields/TextEditor/TextEditor.module.css +63 -47
  33. package/es/v1/GlobalNotification/GlobalNotification.js +51 -19
  34. package/es/v1/GlobalNotification/props/defaultProps.js +3 -1
  35. package/es/v1/GlobalNotification/props/propTypes.js +12 -2
  36. package/es/version2/GlobalNotification/GlobalNotification.js +52 -26
  37. package/es/version2/GlobalNotification/GlobalNotification.module.css +57 -6
  38. package/es/version2/GlobalNotification/props/defaultProps.js +3 -1
  39. package/es/version2/GlobalNotification/props/propTypes.js +12 -4
  40. package/lib/NewStar/NewStar.module.css +128 -67
  41. package/lib/common/dot_boxShadow.module.css +3 -1
  42. package/lib/form/fields/TextEditor/TextEditor.module.css +63 -47
  43. package/lib/v1/GlobalNotification/GlobalNotification.js +66 -17
  44. package/lib/v1/GlobalNotification/props/defaultProps.js +3 -1
  45. package/lib/v1/GlobalNotification/props/propTypes.js +17 -4
  46. package/lib/version2/GlobalNotification/GlobalNotification.js +52 -29
  47. package/lib/version2/GlobalNotification/GlobalNotification.module.css +57 -6
  48. package/lib/version2/GlobalNotification/props/defaultProps.js +3 -1
  49. package/lib/version2/GlobalNotification/props/propTypes.js +12 -4
  50. package/package.json +5 -5
  51. package/result.json +1 -1
@@ -77,20 +77,20 @@
77
77
  background-color: transparent;
78
78
  }
79
79
 
80
- .small :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
81
- .small :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
82
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
83
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
84
- .large :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
85
- .large :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
86
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
87
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel,
88
- .default :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover,
89
- .default :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel {
80
+ .small :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
81
+ .small :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
82
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
83
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
84
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
85
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
86
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
87
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel,
88
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover,
89
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel {
90
90
  color: var(--zdt_texteditor_default_text);
91
91
  }
92
92
 
93
- .small :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .small :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .large :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .large :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel, .default :global .KB_Editor_menus .KB_Editor_MultiTools>li:hover, .default :global .KB_Editor_menus .KB_Editor_MultiTools>li.KB_Editor_sel {
93
+ .small :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .small :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .large :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .large :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel, .default :global .KB_Editor_menus .KB_Editor_MultiTools > li:hover, .default :global .KB_Editor_menus .KB_Editor_MultiTools > li.KB_Editor_sel {
94
94
  background-color: var(--zdt_texteditor_menu_li_bg);
95
95
  }
96
96
 
@@ -101,10 +101,10 @@
101
101
  /* large type editor - ticket add form editor */
102
102
  .large :global .KB_Editor,
103
103
  .large :global .KB_Editor_menus .KB_Editor_MultiTools,
104
- .large :global .KB_Editor_menus .KB_Editor_MultiTools>li,
104
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools > li,
105
105
  .default :global .KB_Editor,
106
106
  .default :global .KB_Editor_menus .KB_Editor_MultiTools,
107
- .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
107
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
108
108
  display: -webkit-box;
109
109
  display: -ms-flexbox;
110
110
  display: flex;
@@ -160,24 +160,24 @@
160
160
  min-height: inherit ;
161
161
  }
162
162
 
163
- .large :global .KB_Editor_menus .KB_Editor_MultiTools>li,
164
- .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
163
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools > li,
164
+ .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
165
165
  height: unset;
166
166
  -webkit-box-align: center;
167
167
  -ms-flex-align: center;
168
168
  align-items: center;
169
169
  }
170
170
 
171
- .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
171
+ .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
172
172
  padding: 0 ;
173
173
  float: unset;
174
174
  }
175
175
 
176
- [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
176
+ [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
177
177
  margin-right: 0 ;
178
178
  }
179
179
 
180
- [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
180
+ [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
181
181
  margin-left: 0 ;
182
182
  }
183
183
 
@@ -190,14 +190,14 @@
190
190
  float: unset !important;
191
191
  }
192
192
 
193
- .large :global .KB_Editor_menus>ul>li>span>svg,
194
- .default :global .KB_Editor_menus>ul>li>span>svg {
193
+ .large :global .KB_Editor_menus > ul > li > span > svg,
194
+ .default :global .KB_Editor_menus > ul > li > span > svg {
195
195
  width: var(--zd_size28) ;
196
196
  height: var(--zd_size28) ;
197
197
  }
198
198
 
199
- .large :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg,
200
- .default :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
199
+ .large :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg,
200
+ .default :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
201
201
  width: var(--zd_size8) ;
202
202
  height: var(--zd_size8) ;
203
203
  }
@@ -241,18 +241,18 @@
241
241
  left: 0 ;
242
242
  }
243
243
 
244
- [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
244
+ [dir=ltr] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=ltr] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
245
245
  margin-right: var(--zd_size2) ;
246
246
  }
247
247
 
248
- [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools>li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools>li {
248
+ [dir=rtl] .large :global .KB_Editor_menus .KB_Editor_MultiTools > li, [dir=rtl] .default :global .KB_Editor_menus .KB_Editor_MultiTools > li {
249
249
  margin-left: var(--zd_size2) ;
250
250
  }
251
251
 
252
252
  /* xlarge type editor - reply area, blue print cases - full height hover style */
253
253
  .xlarge :global .KB_Editor,
254
254
  .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools,
255
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
255
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
256
256
  display: -webkit-box;
257
257
  display: -ms-flexbox;
258
258
  display: flex;
@@ -293,7 +293,7 @@
293
293
  min-height: inherit ;
294
294
  }
295
295
 
296
- .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
296
+ .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
297
297
  height: unset;
298
298
  -webkit-box-align: center;
299
299
  -ms-flex-align: center;
@@ -302,11 +302,11 @@
302
302
  float: unset;
303
303
  }
304
304
 
305
- [dir=ltr] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
305
+ [dir=ltr] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
306
306
  margin-right: 0 ;
307
307
  }
308
308
 
309
- [dir=rtl] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools>li {
309
+ [dir=rtl] .xlarge :global .KB_Editor_menus .KB_Editor_MultiTools > li {
310
310
  margin-left: 0 ;
311
311
  }
312
312
 
@@ -324,12 +324,12 @@
324
324
  padding: var(--zd_size6) ;
325
325
  }
326
326
 
327
- .xlarge :global .KB_Editor_menus>ul>li>span>svg {
327
+ .xlarge :global .KB_Editor_menus > ul > li > span > svg {
328
328
  width: var(--zd_size22) ;
329
329
  height: var(--zd_size22) ;
330
330
  }
331
331
 
332
- .xlarge :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
332
+ .xlarge :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
333
333
  width: var(--zd_size8) ;
334
334
  height: var(--zd_size8) ;
335
335
  }
@@ -354,13 +354,13 @@
354
354
  left: 0 ;
355
355
  }
356
356
 
357
- .xlarge :global .KB_Editor_menus>ul>li>span.SnippetIcon svg {
357
+ .xlarge :global .KB_Editor_menus > ul > li > span.SnippetIcon svg {
358
358
  width: var(--zd_size17) ;
359
359
  height: var(--zd_size21) ;
360
360
  padding: 0 var(--zd_size7) ;
361
361
  }
362
362
 
363
- .xlarge :global .KB_Editor_menus>ul>li>span.TemplateIcon svg {
363
+ .xlarge :global .KB_Editor_menus > ul > li > span.TemplateIcon svg {
364
364
  width: var(--zd_size16) ;
365
365
  height: var(--zd_size16) ;
366
366
  padding: 0 var(--zd_size9) ;
@@ -393,16 +393,31 @@
393
393
  padding: 0 var(--zd_size7) ;
394
394
  }
395
395
 
396
- .xlarge :global .KB_Editor_MultiTools li .Kbeditor_more_icon>svg {
396
+ .xlarge :global .KB_Editor_MultiTools li .Kbeditor_more_icon > svg {
397
397
  width: var(--zd_size12) ;
398
398
  height: var(--zd_size12) ;
399
399
  }
400
400
 
401
- .xlarge :global .KB_Editor_menus>ul>li>span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(.TemplateIcon):not(.KB_Editor_Richtext):not(.KB_Editor_PlainText) {
401
+ .xlarge
402
+ :global
403
+ .KB_Editor_menus
404
+ > ul
405
+ > li
406
+ > span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(
407
+ .TemplateIcon
408
+ ):not(.KB_Editor_Richtext):not(.KB_Editor_PlainText) {
402
409
  height: var(--zd_size21) ;
403
410
  }
404
411
 
405
- .xlarge :global .KB_Editor_menus>ul>li>span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(.TemplateIcon)>svg {
412
+ .xlarge
413
+ :global
414
+ .KB_Editor_menus
415
+ > ul
416
+ > li
417
+ > span:not(.KB_Editor_Bdr_div):not(.KBEditortools-Block-down-arrow):not(.Kbeditor_more_icon):not(.SnippetIcon):not(
418
+ .TemplateIcon
419
+ )
420
+ > svg {
406
421
  width: var(--zd_size21) ;
407
422
  height: var(--zd_size21) ;
408
423
  padding: 0 var(--zd_size4) ;
@@ -427,7 +442,7 @@
427
442
  /* medium type editor - snippet, bug tracker cases */
428
443
  .medium :global .KB_Editor,
429
444
  .medium :global .KB_Editor_menus .KB_Editor_MultiTools,
430
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li {
445
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li {
431
446
  display: -webkit-box;
432
447
  display: -ms-flexbox;
433
448
  display: flex;
@@ -468,7 +483,7 @@
468
483
  min-height: inherit ;
469
484
  }
470
485
 
471
- .medium :global .KB_Editor_menus .KB_Editor_MultiTools>li {
486
+ .medium :global .KB_Editor_menus .KB_Editor_MultiTools > li {
472
487
  height: unset;
473
488
  -webkit-box-align: center;
474
489
  -ms-flex-align: center;
@@ -481,21 +496,21 @@
481
496
  line-height: 0;
482
497
  }
483
498
 
484
- .medium :global .KB_Editor_menus>ul>li>span>svg {
499
+ .medium :global .KB_Editor_menus > ul > li > span > svg {
485
500
  width: var(--zd_size22) ;
486
501
  height: var(--zd_size22) ;
487
502
  }
488
503
 
489
- .medium :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
504
+ .medium :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
490
505
  width: var(--zd_size8) ;
491
506
  height: var(--zd_size8) ;
492
507
  }
493
508
 
494
- [dir=ltr] .medium :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
509
+ [dir=ltr] .medium :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
495
510
  padding: 0 0 0 var(--zd_size2) ;
496
511
  }
497
512
 
498
- [dir=rtl] .medium :global .KB_Editor_menus>ul>li>span.KB_Editor_Bdr_div>svg {
513
+ [dir=rtl] .medium :global .KB_Editor_menus > ul > li > span.KB_Editor_Bdr_div > svg {
499
514
  padding: 0 var(--zd_size2) 0 0 ;
500
515
  }
501
516
 
@@ -532,7 +547,7 @@
532
547
  padding: 0 var(--zd_size3) ;
533
548
  }
534
549
 
535
- .medium :global .KB_Editor_MultiTools li .Kbeditor_more_icon>svg {
550
+ .medium :global .KB_Editor_MultiTools li .Kbeditor_more_icon > svg {
536
551
  width: var(--zd_size12) ;
537
552
  height: var(--zd_size12) ;
538
553
  }
@@ -612,13 +627,13 @@
612
627
  line-height: 0;
613
628
  }
614
629
 
615
- .small :global .KB_Editor_menus>ul>li>span>svg,
616
- .mini :global .KB_Editor_menus>ul>li>span>svg {
630
+ .small :global .KB_Editor_menus > ul > li > span > svg,
631
+ .mini :global .KB_Editor_menus > ul > li > span > svg {
617
632
  width: var(--zd_size25) ;
618
633
  height: var(--zd_size25) ;
619
634
  }
620
635
 
621
- .small :global .KB_Editor_menus>ul>li>span>svg, .mini :global .KB_Editor_menus>ul>li>span>svg {
636
+ .small :global .KB_Editor_menus > ul > li > span > svg, .mini :global .KB_Editor_menus > ul > li > span > svg {
622
637
  padding: 0 var(--zd_size6) ;
623
638
  }
624
639
 
@@ -759,7 +774,8 @@
759
774
  position: absolute !important;
760
775
  top: 0 ;
761
776
  opacity: 0;
762
- visibility: hidden;
777
+ /* visibility: hidden; */
778
+ z-index: -1;
763
779
  }
764
780
 
765
781
  [dir=ltr] .editorHide :global .KB_Editor {
@@ -768,4 +784,4 @@
768
784
 
769
785
  [dir=rtl] .editorHide :global .KB_Editor {
770
786
  right: 0 ;
771
- }
787
+ }
@@ -7,28 +7,50 @@ import AutoClose from '../../actions/AutoClose';
7
7
  import AlertIcons from '../alert/alertIcons/AlertIcons';
8
8
  import AlertClose from '../alert/AlertClose/AlertClose';
9
9
  import { Container, Box } from '@zohodesk/components/es/v1/Layout';
10
+ import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
10
11
  import style from '../../version2/GlobalNotification/GlobalNotification.module.css';
11
12
  export default function GlobalNotification(props) {
12
13
  let {
13
14
  type,
14
15
  message,
15
16
  hideMessage,
17
+ hideTime,
16
18
  onClick,
19
+ onClose,
20
+ needAutoClose,
17
21
  i18nKeys = {},
18
22
  customProps,
19
23
  dataSelectorId,
20
- showMessage
24
+ id,
25
+ needShadow,
26
+ shadowCount,
27
+ eleRef
21
28
  } = props;
29
+ const hideMessageTimer = useRef(null);
30
+ const [shadowClose, setShadowClose] = useState(true);
22
31
  useEffect(() => {
23
- if (!['danger', 'error', 'warning'].includes(type)) {
24
- setTimeout(() => {
25
- hideMessage();
26
- }, 3000);
32
+ if (needAutoClose) {
33
+ hideMessageTimer.current = setTimeout(() => {
34
+ hideMessage(id);
35
+ }, hideTime);
27
36
  }
28
- }, [showMessage, type]);
37
+
38
+ return () => {
39
+ if (hideMessageTimer.current) {
40
+ clearTimeout(hideMessageTimer.current);
41
+ }
42
+ };
43
+ }, []);
29
44
  let {
30
45
  closeTitle = 'Close'
31
46
  } = i18nKeys;
47
+
48
+ function onCloseLocal(e) {
49
+ setShadowClose(false);
50
+ hideMessage && hideMessage(id);
51
+ onClose && onClose(e);
52
+ }
53
+
32
54
  return /*#__PURE__*/React.createElement(GlobalNotificationUI, {
33
55
  type: type,
34
56
  message: message,
@@ -36,7 +58,12 @@ export default function GlobalNotification(props) {
36
58
  onClick: onClick,
37
59
  closeTitle: closeTitle,
38
60
  customProps: customProps,
39
- dataSelectorId: dataSelectorId
61
+ dataSelectorId: dataSelectorId,
62
+ id: id,
63
+ shadowCount: shadowCount,
64
+ onClose: onCloseLocal,
65
+ needShadow: shadowClose && needShadow,
66
+ eleRef: eleRef
40
67
  });
41
68
  }
42
69
  GlobalNotification.propTypes = propTypes;
@@ -48,28 +75,33 @@ GlobalNotification.defaultProps = defaultProps; // if (__DOCS__) {
48
75
  // }
49
76
 
50
77
  export function GlobalNotificationUI(props) {
51
- function onClose(e) {
52
- let {
53
- hideMessage,
54
- onClose
55
- } = props;
56
- hideMessage && hideMessage(e);
57
- onClose && onClose(e);
58
- }
59
-
60
78
  let {
61
79
  type = '',
62
80
  message,
63
81
  onClick,
64
82
  closeTitle = '',
65
83
  customProps = {},
66
- dataSelectorId
84
+ dataSelectorId,
85
+ shadowCount,
86
+ needShadow,
87
+ eleRef,
88
+ onClose
67
89
  } = props;
68
90
  let {
69
91
  ExtraProps = {}
70
92
  } = customProps;
93
+
94
+ function onCloseLocal(e) {
95
+ cancelBubblingEffect(e);
96
+ onClose && onClose(e);
97
+ }
98
+
71
99
  return /*#__PURE__*/React.createElement("div", _extends({
72
- className: `${style.message} ${type ? style[type] : ''}`,
100
+ ref: eleRef,
101
+ className: ` ${style.message}
102
+ ${needShadow && shadowCount >= 2 ? shadowCount > 2 ? `${style.stackShadowTwo} ${style.stackShadowOne}` : style.stackShadowOne : ''}
103
+ ${type ? style[type] : ''}
104
+ `,
73
105
  "data-id": `show_${type}_message`,
74
106
  "data-test-id": `show_${type}_message`,
75
107
  tabIndex: 0,
@@ -100,7 +132,7 @@ export function GlobalNotificationUI(props) {
100
132
  }, /*#__PURE__*/React.createElement(AlertClose, {
101
133
  dataId: `close_${type}_message`,
102
134
  dataTitle: closeTitle,
103
- onClose: onClose,
135
+ onClose: onCloseLocal,
104
136
  type: type
105
137
  }))));
106
138
  }
@@ -1,4 +1,6 @@
1
1
  export const defaultProps = {
2
2
  customProps: {},
3
- dataSelectorId: 'globalNotification'
3
+ dataSelectorId: 'globalNotification',
4
+ needAutoClose: true,
5
+ hideTime: 3000
4
6
  };
@@ -9,7 +9,13 @@ export const propTypes = {
9
9
  i18nKeys: PropTypes.object,
10
10
  customProps: PropTypes.shape({
11
11
  ExtraProps: PropTypes.object
12
- })
12
+ }),
13
+ id: PropTypes.number,
14
+ hideTime: PropTypes.number,
15
+ needAutoClose: PropTypes.bool,
16
+ isCollapseView: PropTypes.bool,
17
+ shadowCount: PropTypes.number,
18
+ needShadow: PropTypes.bool
13
19
  };
14
20
  export const UI_propTypes = {
15
21
  dataSelectorId: PropTypes.string,
@@ -21,7 +27,11 @@ export const UI_propTypes = {
21
27
  type: PropTypes.oneOf(['success', 'danger', 'info', 'warning', 'error']),
22
28
  customProps: PropTypes.shape({
23
29
  ExtraProps: PropTypes.object
24
- })
30
+ }),
31
+ needShadow: PropTypes.bool,
32
+ shadowCount: PropTypes.number,
33
+ id: PropTypes.number,
34
+ onClose: PropTypes.func
25
35
  };
26
36
  export const new_propTypes = {
27
37
  Element: PropTypes.element,
@@ -8,43 +8,51 @@ import AlertIcons from '../alertIcons/AlertIcons';
8
8
  import AlertClose from '../AlertClose/AlertClose';
9
9
  import style from './GlobalNotification.module.css';
10
10
  import { Container, Box } from '@zohodesk/components/lib/Layout';
11
+ import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
11
12
  export default class GlobalNotification extends React.Component {
12
13
  constructor(props) {
13
14
  super(props);
15
+ this.hideMessageTimer = null;
14
16
  this.state = {
15
- hideMessage: false
17
+ shadowClose: true
16
18
  };
19
+ this.onClose = this.onClose.bind(this);
17
20
  }
18
21
 
19
- UNSAFE_componentWillReceiveProps(nextProps) {
22
+ componentDidMount() {
20
23
  let {
21
- showMessage,
22
24
  hideMessage,
23
- type
25
+ hideTime,
26
+ id,
27
+ needAutoClose
24
28
  } = this.props;
25
29
 
26
- if (showMessage !== nextProps.showMessage || type !== nextProps.type) {
27
- if (!['danger', 'error', 'warning'].includes(nextProps.type)) {
28
- setTimeout(() => {
29
- hideMessage();
30
- }, 3000);
31
- }
30
+ if (needAutoClose) {
31
+ this.hideMessageTimer = setTimeout(() => {
32
+ hideMessage(id);
33
+ }, hideTime);
32
34
  }
33
35
  }
34
36
 
35
- componentDidMount() {
36
- let {
37
- type,
38
- hideMessage
39
- } = this.props;
40
-
41
- if (!['danger', 'error', 'warning'].includes(type)) {
42
- setTimeout(() => {
43
- hideMessage();
44
- }, 3000);
37
+ componentWillUnmount() {
38
+ if (this.hideMessageTimer) {
39
+ clearTimeout(this.hideMessageTimer);
45
40
  }
46
41
  }
47
42
 
43
+ onClose(e) {
44
+ const {
45
+ onClose,
46
+ hideMessage,
47
+ id
48
+ } = this.props;
49
+ this.setState({
50
+ shadowClose: false
51
+ });
52
+ hideMessage && hideMessage(id);
53
+ onClose && onClose(e);
54
+ }
55
+
48
56
  render() {
49
57
  let {
50
58
  type,
@@ -53,8 +61,15 @@ export default class GlobalNotification extends React.Component {
53
61
  onClick,
54
62
  i18nKeys = {},
55
63
  customProps,
56
- dataSelectorId
64
+ dataSelectorId,
65
+ id,
66
+ needShadow,
67
+ shadowCount,
68
+ eleRef
57
69
  } = this.props;
70
+ let {
71
+ shadowClose
72
+ } = this.state;
58
73
  let {
59
74
  closeTitle = 'Close'
60
75
  } = i18nKeys;
@@ -65,7 +80,12 @@ export default class GlobalNotification extends React.Component {
65
80
  onClick: onClick,
66
81
  closeTitle: closeTitle,
67
82
  customProps: customProps,
68
- dataSelectorId: dataSelectorId
83
+ dataSelectorId: dataSelectorId,
84
+ id: id,
85
+ shadowCount: shadowCount,
86
+ onClose: this.onClose,
87
+ needShadow: shadowClose && needShadow,
88
+ eleRef: eleRef
69
89
  });
70
90
  }
71
91
 
@@ -81,10 +101,9 @@ GlobalNotification.defaultProps = defaultProps; // if (__DOCS__) {
81
101
  export function GlobalNotificationUI(props) {
82
102
  function onClose(e) {
83
103
  let {
84
- hideMessage,
85
104
  onClose
86
105
  } = props;
87
- hideMessage && hideMessage(e);
106
+ cancelBubblingEffect(e);
88
107
  onClose && onClose(e);
89
108
  }
90
109
 
@@ -94,13 +113,20 @@ export function GlobalNotificationUI(props) {
94
113
  onClick,
95
114
  closeTitle = '',
96
115
  customProps = {},
97
- dataSelectorId
116
+ dataSelectorId,
117
+ shadowCount,
118
+ needShadow,
119
+ eleRef
98
120
  } = props;
99
121
  let {
100
122
  ExtraProps = {}
101
123
  } = customProps;
102
124
  return /*#__PURE__*/React.createElement("div", _extends({
103
- className: `${style.message} ${type ? style[type] : ''}`,
125
+ ref: eleRef,
126
+ className: ` ${style.message}
127
+ ${needShadow && shadowCount >= 2 ? shadowCount > 2 ? `${style.stackShadowTwo} ${style.stackShadowOne}` : style.stackShadowOne : ''}
128
+ ${type ? style[type] : ''}
129
+ `,
104
130
  "data-id": `show_${type}_message`,
105
131
  "data-test-id": `show_${type}_message`,
106
132
  tabIndex: 0,
@@ -3,7 +3,6 @@
3
3
  --commonalert_border_color: var(--zdt_commonalert_default_border);
4
4
  --globalnotification_bg_color: var(--zdt_globalnotification_default_bg);
5
5
  --globalnotification_text_color: var(--zdt_globalnotification_default_text);
6
- --globalnotification_box_shadow: var(--zdt_globalnotification_default_box_shadow);
7
6
  }
8
7
 
9
8
  .message {
@@ -11,19 +10,69 @@
11
10
  position: absolute;
12
11
  top: 0 ;
13
12
  z-index: 1000;
14
- /*Hook for editor alert*/
15
- pointer-events: none;
13
+ width: var(--zd_size420) ;
16
14
  text-align: center;
15
+ margin: auto ;
17
16
  }
18
17
 
19
18
  [dir=ltr] .message {
20
- right: 0 ;
21
19
  left: 0 ;
20
+ right: 0 ;
22
21
  }
23
22
 
24
23
  [dir=rtl] .message {
25
- left: 0 ;
26
24
  right: 0 ;
25
+ left: 0 ;
26
+ }
27
+
28
+ .stackShadowOne::after,
29
+ .stackShadowTwo::before {
30
+ content: '';
31
+ position: absolute;
32
+ /* css:theme-validation:ignore */
33
+ height: var(--zd_size20) ;
34
+ }
35
+
36
+ .stackShadowOne::after, .stackShadowTwo::before {
37
+ background-color: var(--globalnotification_bg_color);
38
+ border-radius: 0 0 6px 6px;
39
+ box-shadow: var(--zd_bs_globalnotification_container);
40
+ }
41
+
42
+ [dir=ltr] .stackShadowOne::after, [dir=ltr] .stackShadowTwo::before {
43
+ left: 50% ;
44
+ right: 50% ;
45
+ transform: translate(-50%);
46
+ animation: behindInfo 0.8s forwards;
47
+ }
48
+
49
+ [dir=rtl] .stackShadowOne::after, [dir=rtl] .stackShadowTwo::before {
50
+ right: 50% ;
51
+ left: 50% ;
52
+ transform: translate(50%);
53
+ animation: behindInfo 0.8s forwards;
54
+ }
55
+
56
+ .stackShadowTwo::before {
57
+ width: 90% ;
58
+ bottom: calc( var(--zd_size10) * -1 ) ;
59
+ }
60
+
61
+ .stackShadowOne::after {
62
+ width: 95% ;
63
+ bottom: calc( var(--zd_size5) * -1 ) ;
64
+ }
65
+
66
+ @keyframes behindInfo {
67
+
68
+ 0%,
69
+ 40% {
70
+ opacity: 0;
71
+ }
72
+
73
+ 100% {
74
+ opacity: 1;
75
+ }
27
76
  }
28
77
 
29
78
  .container {
@@ -33,8 +82,9 @@
33
82
  /* css:theme-validation:ignore */
34
83
  /* css:theme-validation:ignore */
35
84
  color: var(--globalnotification_text_color);
36
- max-width: var(--zd_size490) ;
85
+ z-index: 1;
37
86
  composes: wbreak from '~@zohodesk/components/lib/common/common.module.css';
87
+ width: 100% ;
38
88
  box-shadow: var(--zd_bs_globalnotification_container);
39
89
  border-radius: 0 0 var(--zd_size10) var(--zd_size10);
40
90
  background-color: var(--globalnotification_bg_color);
@@ -103,6 +153,7 @@
103
153
  font-family: var(--zd_semibold);
104
154
  composes: ftsmooth from '~@zohodesk/components/lib/common/common.module.css';
105
155
  line-height: 1.4286;
156
+ overflow: hidden;
106
157
  }
107
158
 
108
159
  [dir=ltr] .text {