@zohodesk/dot 1.0.0-temp-222 → 1.0.0-temp-220.2

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 (82) hide show
  1. package/README.md +8 -3
  2. package/es/ActionButton/ActionButton.module.css +1 -1
  3. package/es/AlphabeticList/AlphabeticList.module.css +1 -1
  4. package/es/AudioPlayer/AudioPlayer.module.css +1 -1
  5. package/es/DotProvider/hooks/useDotProvider.js +1 -0
  6. package/es/Drawer/Drawer.module.css +1 -1
  7. package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +1 -1
  8. package/es/emptystate/EditionPage/EditionPage.css +2 -2
  9. package/es/errorstate/PermissionPlay/PermissionPlay.module.css +1 -1
  10. package/es/form/fields/CurrencyField/__tests__/__snapshots__/CurrencyField.spec.js.snap +1 -6
  11. package/es/form/fields/DateField/__tests__/__snapshots__/DateField.spec.js.snap +1 -6
  12. package/es/form/fields/Fields.module.css +3 -8
  13. package/es/form/fields/MultiSelectField/__tests__/__snapshots__/MultiSelectField.spec.js.snap +1 -3
  14. package/es/form/fields/PhoneField/__tests__/__snapshots__/PhoneField.spec.js.snap +1 -6
  15. package/es/form/fields/RadioField/RadioField.js +10 -29
  16. package/es/form/fields/RadioField/__tests__/RadioField.spec.js +0 -33
  17. package/es/form/fields/RadioField/__tests__/__snapshots__/RadioField.spec.js.snap +66 -562
  18. package/es/form/fields/SelectField/__tests__/__snapshots__/SelectField.spec.js.snap +1 -6
  19. package/es/form/fields/TagsMultiSelect/__tests__/__snapshots__/TagsMultiSelect.spec.js.snap +1 -3
  20. package/es/form/fields/TagsMultiSelectField/__tests__/__snapshots__/TagsMultiSelectField.spec.js.snap +1 -3
  21. package/es/form/fields/TextBoxField/__tests__/__snapshots__/TextBoxField.spec.js.snap +1 -6
  22. package/es/form/fields/TextEditor/TextEditor.js +2 -1
  23. package/es/form/fields/TextEditor/TextEditor.module.css +2 -2
  24. package/es/layout/SetupDetailLayout/SetupDetailLayout.module.css +1 -1
  25. package/es/list/SecondaryText/SecondaryText.module.css +6 -6
  26. package/es/list/Subject/Subject.module.css +3 -3
  27. package/es/lookup/EmptyPage/LookupEmptyPage.module.css +4 -2
  28. package/es/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +6 -18
  29. package/es/lookup/header/Title/LookupTitle.module.css +7 -3
  30. package/es/lookup/header/ViewDropDown/ViewDropDown.module.css +13 -2
  31. package/es/setup/header/Search/Search.module.css +1 -1
  32. package/es/v1/form/fields/TextEditor/TextEditor.js +2 -1
  33. package/es/version2/GlobalNotification/GlobalNotification.js +46 -7
  34. package/es/version2/GlobalNotification/GlobalNotification.module.css +3 -2
  35. package/es/version2/GlobalNotification/__tests__/GlobalNotification.spec.js +9 -0
  36. package/es/version2/GlobalNotification/props/propTypes.js +4 -3
  37. package/es/version2/GlobalNotification/utils/constants.js +6 -0
  38. package/es/version2/errorstate/V2_ErrorStates.module.css +1 -1
  39. package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +9 -3
  40. package/es/version2/lookup/alertLookupCommonNew.module.css +1 -1
  41. package/es/version2/notification/DesktopNotification/DesktopNotification.module.css +4 -3
  42. package/lib/ActionButton/ActionButton.module.css +1 -1
  43. package/lib/AlphabeticList/AlphabeticList.module.css +1 -1
  44. package/lib/AudioPlayer/AudioPlayer.module.css +1 -1
  45. package/lib/DotProvider/hooks/useDotProvider.js +2 -0
  46. package/lib/Drawer/Drawer.module.css +1 -1
  47. package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +1 -1
  48. package/lib/emptystate/EditionPage/EditionPage.css +2 -2
  49. package/lib/errorstate/PermissionPlay/PermissionPlay.module.css +1 -1
  50. package/lib/form/fields/CurrencyField/__tests__/__snapshots__/CurrencyField.spec.js.snap +1 -6
  51. package/lib/form/fields/DateField/__tests__/__snapshots__/DateField.spec.js.snap +1 -6
  52. package/lib/form/fields/Fields.module.css +3 -8
  53. package/lib/form/fields/MultiSelectField/__tests__/__snapshots__/MultiSelectField.spec.js.snap +1 -3
  54. package/lib/form/fields/PhoneField/__tests__/__snapshots__/PhoneField.spec.js.snap +1 -6
  55. package/lib/form/fields/RadioField/RadioField.js +11 -26
  56. package/lib/form/fields/RadioField/__tests__/RadioField.spec.js +0 -33
  57. package/lib/form/fields/RadioField/__tests__/__snapshots__/RadioField.spec.js.snap +66 -562
  58. package/lib/form/fields/SelectField/__tests__/__snapshots__/SelectField.spec.js.snap +1 -6
  59. package/lib/form/fields/TagsMultiSelect/__tests__/__snapshots__/TagsMultiSelect.spec.js.snap +1 -3
  60. package/lib/form/fields/TagsMultiSelectField/__tests__/__snapshots__/TagsMultiSelectField.spec.js.snap +1 -3
  61. package/lib/form/fields/TextBoxField/__tests__/__snapshots__/TextBoxField.spec.js.snap +1 -6
  62. package/lib/form/fields/TextEditor/TextEditor.js +1 -1
  63. package/lib/form/fields/TextEditor/TextEditor.module.css +2 -2
  64. package/lib/layout/SetupDetailLayout/SetupDetailLayout.module.css +1 -1
  65. package/lib/list/SecondaryText/SecondaryText.module.css +6 -6
  66. package/lib/list/Subject/Subject.module.css +3 -3
  67. package/lib/lookup/EmptyPage/LookupEmptyPage.module.css +4 -2
  68. package/lib/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +6 -18
  69. package/lib/lookup/header/Title/LookupTitle.module.css +7 -3
  70. package/lib/lookup/header/ViewDropDown/ViewDropDown.module.css +13 -2
  71. package/lib/setup/header/Search/Search.module.css +1 -1
  72. package/lib/v1/form/fields/TextEditor/TextEditor.js +1 -1
  73. package/lib/version2/GlobalNotification/GlobalNotification.js +68 -18
  74. package/lib/version2/GlobalNotification/GlobalNotification.module.css +3 -2
  75. package/lib/version2/GlobalNotification/__tests__/GlobalNotification.spec.js +10 -0
  76. package/lib/version2/GlobalNotification/props/propTypes.js +4 -3
  77. package/lib/version2/GlobalNotification/utils/constants.js +13 -0
  78. package/lib/version2/errorstate/V2_ErrorStates.module.css +1 -1
  79. package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +9 -3
  80. package/lib/version2/lookup/alertLookupCommonNew.module.css +1 -1
  81. package/lib/version2/notification/DesktopNotification/DesktopNotification.module.css +4 -3
  82. package/package.json +11 -11
@@ -19,10 +19,8 @@ exports[`SelectField rendering the defult props 1`] = `
19
19
  data-test-id="selectComponent"
20
20
  >
21
21
  <div
22
- class="container effect input flex rowdir"
23
- data-id="containerComponent"
22
+ class="varClass customContainer border_bottom effect borderColor_default hasBorder container input flex rowdir"
24
23
  data-selector-id="textBoxIcon"
25
- data-test-id="containerComponent"
26
24
  >
27
25
  <div
28
26
  class="grow basis shrinkOff"
@@ -96,9 +94,6 @@ exports[`SelectField rendering the defult props 1`] = `
96
94
  </div>
97
95
  </div>
98
96
  </div>
99
- <div
100
- class="line borderColor_default "
101
- />
102
97
  </div>
103
98
  </div>
104
99
  </div>
@@ -25,10 +25,8 @@ exports[`TagsMultiSelect rendering the defult props 1`] = `
25
25
  class="custmSpan"
26
26
  />
27
27
  <div
28
- class="container effect custmInp flex rowdir"
29
- data-id="containerComponent"
28
+ class="varClass customContainer effect container custmInp flex rowdir"
30
29
  data-selector-id="textBoxIcon"
31
- data-test-id="containerComponent"
32
30
  >
33
31
  <div
34
32
  class="grow basis shrinkOff"
@@ -31,10 +31,8 @@ exports[`TagsMultiSelectField rendering the defult props 1`] = `
31
31
  class="custmSpan"
32
32
  />
33
33
  <div
34
- class="container effect custmInp flex rowdir"
35
- data-id="containerComponent"
34
+ class="varClass customContainer effect container custmInp flex rowdir"
36
35
  data-selector-id="textBoxIcon"
37
- data-test-id="containerComponent"
38
36
  >
39
37
  <div
40
38
  class="grow basis shrinkOff"
@@ -10,10 +10,8 @@ exports[`TextBoxField rendering the defult props 1`] = `
10
10
  class="fieldContainer "
11
11
  >
12
12
  <div
13
- class="container effect flex rowdir"
14
- data-id="containerComponent"
13
+ class="varClass customContainer border_bottom effect borderColor_default hasBorder container flex rowdir"
15
14
  data-selector-id="textBoxIcon"
16
- data-test-id="containerComponent"
17
15
  >
18
16
  <div
19
17
  class="grow basis shrinkOff"
@@ -45,9 +43,6 @@ exports[`TextBoxField rendering the defult props 1`] = `
45
43
  data-test-id="containerComponent"
46
44
  />
47
45
  </div>
48
- <div
49
- class="line borderColor_default "
50
- />
51
46
  </div>
52
47
  </div>
53
48
  </div>
@@ -243,7 +243,8 @@ export default class TextEditor extends Component {
243
243
  let customStyleTag = document.createElement('style');
244
244
  customStyleTag.type = 'text/css';
245
245
  const customizedCSS = `pre {white-space: pre-wrap} ${customCSS}`;
246
- const fontCSS = `@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}`;
246
+ const fontCSS = `@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: 400;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swap;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}
247
+ @font-face {font-family: 'ZohoPuvi';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: 400;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: ZDLato;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'Roboto';font-weight: 400;font-style: normal;font-display: swap;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}`;
247
248
  customStyleTag.textContent = `${customizedCSS} ${fontCSS}`;
248
249
  iframeHead.appendChild(customStyleTag);
249
250
  }
@@ -32,7 +32,7 @@
32
32
  .textEditor * {
33
33
  box-sizing: initial;
34
34
  line-height: initial;
35
- font-family: var(--zd_regular);
35
+ font-weight: var(--zd-fw-normal);
36
36
  }
37
37
 
38
38
  .textEditor {
@@ -717,7 +717,7 @@
717
717
  }
718
718
 
719
719
  :global .KB_Editor textarea.ze_area {
720
- font-family: var(--zd_regular) !important;
720
+ font-weight: var(--zd-fw-normal) !important;
721
721
  font-size: var(--zd_font_size14) !important;
722
722
  padding: var(--zd_size15) var(--zd_size20) !important;
723
723
  }
@@ -30,7 +30,7 @@
30
30
  .title {
31
31
  font-size: var(--zd_font_size16) ;
32
32
  line-height: 1;
33
- font-family: var(--zd_semibold);
33
+ font-weight: var(--zd-fw-semibold);
34
34
  color: var(--zdt_setupdetail_backicon);
35
35
  composes: ftsmooth from '~@zohodesk/components/es/common/common.module.css';
36
36
  }
@@ -15,14 +15,14 @@
15
15
  cursor: not-allowed;
16
16
  }
17
17
  .textBold {
18
- font-family: var(--zd_bold);
18
+ font-weight: var(--zd-fw-bold);
19
19
  color: var(--zdt_secondaryText_black_text);
20
20
  }
21
21
  .textStyle, .link{
22
22
  display: block
23
23
  }
24
24
  .textStyle.textBold {
25
- font-family: var(--zd_bold);
25
+ font-weight: var(--zd-fw-bold);
26
26
  color: var(--zdt_secondaryText_black_text);
27
27
  }
28
28
  .ticketId,
@@ -64,7 +64,7 @@
64
64
  .ticketIdLink {
65
65
  cursor: pointer;
66
66
  }
67
- .ticketIdLink:hover, .ticketIdLink:focus {
67
+ .ticketIdLink:hover,.ticketIdLink:focus {
68
68
  color: var(--zdt_secondaryText_blue_hover_text);
69
69
  }
70
70
  .primaryAccountNameCnt {
@@ -72,13 +72,13 @@
72
72
  }
73
73
  /* status */
74
74
  .font_regular {
75
- font-family: var(--zd_regular);
75
+ font-weight: var(--zd-fw-normal);
76
76
  }
77
77
  .font_semibold {
78
- font-family: var(--zd_semibold);
78
+ font-weight: var(--zd-fw-semibold);
79
79
  }
80
80
  .font_bold {
81
- font-family: var(--zd_bold);
81
+ font-weight: var(--zd-fw-bold);
82
82
  }
83
83
  .font_semibold,
84
84
  .font_bold,
@@ -14,15 +14,15 @@
14
14
  }
15
15
 
16
16
  .font_regular {
17
- font-family: var(--zd_regular);
17
+ font-weight: var(--zd-fw-normal);
18
18
  }
19
19
 
20
20
  .font_semibold {
21
- font-family: var(--zd_semibold);
21
+ font-weight: var(--zd-fw-semibold);
22
22
  }
23
23
 
24
24
  .font_bold {
25
- font-family: var(--zd_bold);
25
+ font-weight: var(--zd-fw-bold);
26
26
  }
27
27
 
28
28
  .font_semibold,
@@ -1,12 +1,14 @@
1
1
  .container {
2
2
  text-align: center;
3
3
  }
4
+
4
5
  .image {
5
6
  margin: var(--zd_size20) auto ;
6
7
  }
8
+
7
9
  .contentDiv {
8
10
  font-size: var(--zd_font_size20) ;
9
- font-family: var(--zd_semibold);
11
+ font-weight: var(--zd-fw-semibold);
10
12
  composes: ftsmooth from '~@zohodesk/components/es/common/common.module.css';
11
13
  margin-top: var(--zd_size15) ;
12
- }
14
+ }
@@ -18,10 +18,8 @@ exports[`Search rendering the customized style search 1`] = `
18
18
  data-test-id="boxComponent"
19
19
  >
20
20
  <div
21
- class="container effect flex rowdir"
22
- data-id="containerComponent"
21
+ class="varClass customContainer effect container flex rowdir"
23
22
  data-selector-id="textBoxIcon"
24
- data-test-id="containerComponent"
25
23
  >
26
24
  <div
27
25
  class="grow basis shrinkOff"
@@ -77,10 +75,8 @@ exports[`Search rendering the defult props 1`] = `
77
75
  data-test-id="boxComponent"
78
76
  >
79
77
  <div
80
- class="container effect flex rowdir"
81
- data-id="containerComponent"
78
+ class="varClass customContainer effect container flex rowdir"
82
79
  data-selector-id="textBoxIcon"
83
- data-test-id="containerComponent"
84
80
  >
85
81
  <div
86
82
  class="grow basis shrinkOff"
@@ -136,10 +132,8 @@ exports[`Search rendering the prop hasSeparator is false 1`] = `
136
132
  data-test-id="boxComponent"
137
133
  >
138
134
  <div
139
- class="container effect flex rowdir"
140
- data-id="containerComponent"
135
+ class="varClass customContainer effect container flex rowdir"
141
136
  data-selector-id="textBoxIcon"
142
- data-test-id="containerComponent"
143
137
  >
144
138
  <div
145
139
  class="grow basis shrinkOff"
@@ -198,10 +192,8 @@ exports[`Search rendering the prop hasSeparator is true 1`] = `
198
192
  data-test-id="boxComponent"
199
193
  >
200
194
  <div
201
- class="container effect flex rowdir"
202
- data-id="containerComponent"
195
+ class="varClass customContainer effect container flex rowdir"
203
196
  data-selector-id="textBoxIcon"
204
- data-test-id="containerComponent"
205
197
  >
206
198
  <div
207
199
  class="grow basis shrinkOff"
@@ -270,10 +262,8 @@ exports[`Search rendering the renderChildren props via function 1`] = `
270
262
  data-test-id="boxComponent"
271
263
  >
272
264
  <div
273
- class="container effect flex rowdir"
274
- data-id="containerComponent"
265
+ class="varClass customContainer effect container flex rowdir"
275
266
  data-selector-id="textBoxIcon"
276
- data-test-id="containerComponent"
277
267
  >
278
268
  <div
279
269
  class="grow basis shrinkOff"
@@ -331,10 +321,8 @@ exports[`Search rendering the search active 1`] = `
331
321
  data-test-id="boxComponent"
332
322
  >
333
323
  <div
334
- class="container effect effectFocused flex rowdir"
335
- data-id="containerComponent"
324
+ class="varClass customContainer effect active container flex rowdir"
336
325
  data-selector-id="textBoxIcon"
337
- data-test-id="containerComponent"
338
326
  >
339
327
  <div
340
328
  class="grow basis shrinkOff"
@@ -1,21 +1,25 @@
1
1
  .title {
2
2
  font-size: var(--zd_font_size16) ;
3
- font-family: var(--zd_semibold);
3
+ font-weight: var(--zd-fw-semibold);
4
4
  composes: ftsmooth from '~@zohodesk/components/es/common/common.module.css';
5
5
  vertical-align: middle;
6
6
  word-break: break-all;
7
7
  cursor: initial;
8
8
  }
9
+
9
10
  .bold {
10
- font-family: var(--zd_semibold);
11
+ font-weight: var(--zd-fw-semibold);
11
12
  }
13
+
12
14
  /* Palette */
13
15
  .default {
14
16
  color: var(--zdt_lookuptitle_default_text);
15
17
  }
18
+
16
19
  .primary {
17
20
  color: var(--zdt_lookuptitle_primary_text);
18
21
  }
22
+
19
23
  .danger {
20
24
  color: var(--zdt_lookuptitle_danger_text);
21
- }
25
+ }
@@ -1,28 +1,35 @@
1
1
  .small {
2
2
  max-height: var(--zd_size200) ;
3
3
  }
4
+
4
5
  .medium {
5
6
  max-height: var(--zd_size348) ;
6
7
  }
8
+
7
9
  .large {
8
10
  max-height: var(--zd_size400) ;
9
11
  }
12
+
10
13
  .emptyState {
11
14
  font-size: var(--zd_font_size14) ;
12
15
  color: var(--zdt_viewdropdown_empty_text);
13
- font-family: var(--zd_semibold);
16
+ font-weight: var(--zd-fw-semibold);
14
17
  composes: ftsmooth from '~@zohodesk/components/es/common/common.module.css';
15
18
  padding: var(--zd_size12) var(--zd_size15) ;
16
19
  }
20
+
17
21
  .hide {
18
22
  composes: vishidden from '~@zohodesk/components/es/common/common.module.css';
19
23
  }
24
+
20
25
  .container {
21
26
  position: relative;
22
27
  }
28
+
23
29
  .listItemContainer {
24
30
  padding: var(--zd_size10) 0 ;
25
31
  }
32
+
26
33
  /* Label Style */
27
34
  .labelCnt {
28
35
  composes: dInflex alignVertical from '~@zohodesk/components/es/common/common.module.css';
@@ -30,21 +37,25 @@
30
37
  color: var(--zdt_viewdropdown_label_text);
31
38
  cursor: pointer;
32
39
  }
40
+
33
41
  .labelText {
34
42
  font-size: var(--zd_font_size12) ;
35
43
  max-width: var(--zd_size180) ;
36
44
  composes: dotted from '~@zohodesk/components/es/common/common.module.css';
37
45
  }
46
+
38
47
  [dir=ltr] .labelText {
39
48
  margin-right: var(--zd_size5) ;
40
49
  }
50
+
41
51
  [dir=rtl] .labelText {
42
52
  margin-left: var(--zd_size5) ;
43
53
  }
54
+
44
55
  .labelCnt:hover .arrowIcon {
45
56
  color: var(--zdt_viewdropdown_hover_label_text);
46
57
  }
47
58
 
48
59
  .loader {
49
60
  padding: var(--zd_size12) var(--zd_size15) ;
50
- }
61
+ }
@@ -38,7 +38,7 @@
38
38
  letter-spacing: 0.2px;
39
39
  transition: all var(--zd_transition3) ease;
40
40
  color: var(--zdt_search_input_text);
41
- font-family: var(--zd_regular);
41
+ font-weight: var(--zd-fw-normal);
42
42
  -webkit-appearance: none;
43
43
  -moz-appearance: none;
44
44
  appearance: none;
@@ -243,7 +243,8 @@ export default class TextEditor extends Component {
243
243
  let customStyleTag = document.createElement('style');
244
244
  customStyleTag.type = 'text/css';
245
245
  const customizedCSS = `pre {white-space: pre-wrap} ${customCSS}`;
246
- const fontCSS = `@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: normal;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swa;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}`;
246
+ const fontCSS = `@font-face {font-family: 'ZohoPuviRegular';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: 400;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: Regular;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'RobotoRegular';font-weight: 400;font-style: normal;font-display: swap;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}
247
+ @font-face {font-family: 'ZohoPuvi';src: url('https://static.zohocdn.com/zohofonts/zohopuvi/4.0/Zoho_Puvi_Regular.woff2') format('woff2');font-style: normal;font-weight: 400;text-rendering: optimizeLegibility;font-display: swap}@font-face {font-family: ZDLato;src: url('https://static.zohocdn.com/webfonts/lato2regular/font.woff2') format('woff2');font-weight: 400;font-style: normal;font-display: swap}@font-face {font-family: 'Roboto';font-weight: 400;font-style: normal;font-display: swap;src: url('https://static.zohocdn.com/webfonts/robotoregular/font.woff2')}`;
247
248
  customStyleTag.textContent = `${customizedCSS} ${fontCSS}`;
248
249
  iframeHead.appendChild(customStyleTag);
249
250
  }
@@ -7,6 +7,8 @@ import AlertClose from "../AlertClose/AlertClose";
7
7
  import style from "./GlobalNotification.module.css";
8
8
  import { Container, Box } from '@zohodesk/components/es/Layout';
9
9
  import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
10
+ import getCurrentTime from '@zohodesk/utils/es/getCurrentTime';
11
+ import { STATUS } from "./utils/constants";
10
12
  export default class GlobalNotification extends React.Component {
11
13
  constructor(props) {
12
14
  super(props);
@@ -15,6 +17,8 @@ export default class GlobalNotification extends React.Component {
15
17
  shadowClose: true
16
18
  };
17
19
  this.onClose = this.onClose.bind(this);
20
+ this.getNotiifcationData = this.getNotiifcationData.bind(this);
21
+ this.handleStatusChange = this.handleStatusChange.bind(this);
18
22
  }
19
23
 
20
24
  componentDidMount() {
@@ -24,18 +28,44 @@ export default class GlobalNotification extends React.Component {
24
28
  id,
25
29
  needAutoClose
26
30
  } = this.props;
31
+ this.handleStatusChange(STATUS.MOUNTED);
27
32
 
28
33
  if (needAutoClose) {
29
34
  this.hideMessageTimer = setTimeout(() => {
30
35
  hideMessage(id);
36
+ this.handleStatusChange(STATUS.DISMISSING);
31
37
  }, hideTime);
32
38
  }
33
39
  }
34
40
 
41
+ componentDidUpdate(prevProps) {
42
+ if (prevProps.id === this.props.id && (prevProps.message !== this.props.message || prevProps.type !== this.props.type)) {
43
+ this.handleStatusChange(STATUS.UPDATED);
44
+ }
45
+ }
46
+
35
47
  componentWillUnmount() {
36
48
  if (this.hideMessageTimer) {
37
49
  clearTimeout(this.hideMessageTimer);
38
50
  }
51
+
52
+ this.handleStatusChange(STATUS.UNMOUNTED);
53
+ }
54
+
55
+ handleStatusChange(status) {
56
+ const {
57
+ onStatusChange
58
+ } = this.props;
59
+
60
+ if (typeof onStatusChange == 'function') {
61
+ const notificationData = this.getNotiifcationData();
62
+ const currentTime = getCurrentTime();
63
+ onStatusChange({
64
+ status,
65
+ ...notificationData,
66
+ time: currentTime
67
+ });
68
+ }
39
69
  }
40
70
 
41
71
  onClose(e) {
@@ -47,20 +77,31 @@ export default class GlobalNotification extends React.Component {
47
77
  this.setState({
48
78
  shadowClose: false
49
79
  });
80
+ this.handleStatusChange(STATUS.DISMISSING);
50
81
  hideMessage && hideMessage(id);
51
82
  onClose && onClose(e);
52
83
  }
53
84
 
85
+ getNotiifcationData() {
86
+ const {
87
+ id,
88
+ type,
89
+ message
90
+ } = this.props;
91
+ return {
92
+ id,
93
+ type,
94
+ message
95
+ };
96
+ }
97
+
54
98
  render() {
55
99
  let {
56
- type,
57
- message,
58
100
  hideMessage,
59
101
  onClick,
60
102
  i18nKeys = {},
61
103
  customProps,
62
104
  dataSelectorId,
63
- id,
64
105
  needShadow,
65
106
  shadowCount,
66
107
  eleRef
@@ -71,15 +112,13 @@ export default class GlobalNotification extends React.Component {
71
112
  let {
72
113
  closeTitle = 'Close'
73
114
  } = i18nKeys;
74
- return /*#__PURE__*/React.createElement(GlobalNotificationUI, {
75
- type: type,
76
- message: message,
115
+ const notificationData = this.getNotiifcationData();
116
+ return /*#__PURE__*/React.createElement(GlobalNotificationUI, { ...notificationData,
77
117
  hideMessage: hideMessage,
78
118
  onClick: onClick,
79
119
  closeTitle: closeTitle,
80
120
  customProps: customProps,
81
121
  dataSelectorId: dataSelectorId,
82
- id: id,
83
122
  shadowCount: shadowCount,
84
123
  onClose: this.onClose,
85
124
  needShadow: shadowClose && needShadow,
@@ -126,7 +126,8 @@
126
126
  --globalnotification_text_color: var(--zdt_globalnotification_info_text);
127
127
  }
128
128
 
129
- .danger,.error {
129
+ .danger,
130
+ .error {
130
131
  --commonalert_border_color: var(--zdt_commonalert_danger_border);
131
132
  --globalnotification_bg_color: var(--zdt_globalnotification_danger_bg);
132
133
  --globalnotification_text_color: var(--zdt_globalnotification_danger_text);
@@ -148,7 +149,7 @@
148
149
 
149
150
  .text {
150
151
  font-size: var(--zd_font_size14) ;
151
- font-family: var(--zd_semibold);
152
+ font-weight: var(--zd-fw-semibold);
152
153
  composes: ftsmooth from '~@zohodesk/components/es/common/common.module.css';
153
154
  line-height: 1.4286;
154
155
  overflow: hidden;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
  import GlobalNotification from "../GlobalNotification";
4
+ import { STATUS } from "../utils/constants";
4
5
  describe('GlobalNotification', () => {
5
6
  test('rendering the defult props', () => {
6
7
  const {
@@ -8,4 +9,12 @@ describe('GlobalNotification', () => {
8
9
  } = render( /*#__PURE__*/React.createElement(GlobalNotification, null));
9
10
  expect(asFragment()).toMatchSnapshot();
10
11
  });
12
+ });
13
+ describe('GlobalNotification Constants', () => {
14
+ test('should have correct constant values', () => {
15
+ expect(STATUS.MOUNTED).toBe('mounted');
16
+ expect(STATUS.UPDATED).toBe('updated');
17
+ expect(STATUS.DISMISSING).toBe('dismissing');
18
+ expect(STATUS.UNMOUNTED).toBe('unmounted');
19
+ });
11
20
  });
@@ -10,12 +10,13 @@ export const propTypes = {
10
10
  customProps: PropTypes.shape({
11
11
  ExtraProps: PropTypes.object
12
12
  }),
13
- id: PropTypes.number,
13
+ id: PropTypes.string,
14
14
  hideTime: PropTypes.number,
15
15
  needAutoClose: PropTypes.bool,
16
16
  isCollapseView: PropTypes.bool,
17
17
  shadowCount: PropTypes.number,
18
- needShadow: PropTypes.bool
18
+ needShadow: PropTypes.bool,
19
+ onStatusChange: PropTypes.func
19
20
  };
20
21
  export const UI_propTypes = {
21
22
  dataSelectorId: PropTypes.string,
@@ -28,7 +29,7 @@ export const UI_propTypes = {
28
29
  }),
29
30
  needShadow: PropTypes.bool,
30
31
  shadowCount: PropTypes.number,
31
- id: PropTypes.number,
32
+ id: PropTypes.string,
32
33
  onClose: PropTypes.func
33
34
  };
34
35
  export const new_propTypes = {
@@ -0,0 +1,6 @@
1
+ export const STATUS = {
2
+ MOUNTED: 'mounted',
3
+ UNMOUNTED: 'unmounted',
4
+ UPDATED: 'updated',
5
+ DISMISSING: 'dismissing'
6
+ };
@@ -5,7 +5,7 @@
5
5
  margin-top: var(--zd_size15) ;
6
6
  }
7
7
  .title {
8
- font-family: var(--zd_bold);
8
+ font-weight: var(--zd-fw-bold);
9
9
  }
10
10
  .desc {
11
11
  line-height: 1.5714;
@@ -1,6 +1,7 @@
1
1
  .varClass {
2
2
  --commonalert_border_color: var(--zdt_commonalert_default_border);
3
3
  }
4
+
4
5
  .container {
5
6
  composes: varClass;
6
7
  position: relative;
@@ -9,12 +10,15 @@
9
10
  border-color: var(--commonalert_border_color);
10
11
  border-width: 2px 0 0 0;
11
12
  }
13
+
12
14
  .headerLayout {
13
15
  min-height: var(--zd_size54) ;
14
16
  }
17
+
15
18
  [dir=ltr] .headerLayout {
16
19
  padding: var(--zd_size15) var(--zd_size45) 0 var(--zd_size20) ;
17
20
  }
21
+
18
22
  [dir=rtl] .headerLayout {
19
23
  padding: var(--zd_size15) var(--zd_size20) 0 var(--zd_size45) ;
20
24
  }
@@ -23,11 +27,13 @@
23
27
  --commonalert_border_color: var(--zdt_commonalert_success_border);
24
28
  }
25
29
 
26
- .info,.notification {
30
+ .info,
31
+ .notification {
27
32
  --commonalert_border_color: var(--zdt_commonalert_info_border);
28
33
  }
29
34
 
30
- .danger,.error {
35
+ .danger,
36
+ .error {
31
37
  --commonalert_border_color: var(--zdt_commonalert_danger_border);
32
38
  }
33
39
 
@@ -52,7 +58,7 @@
52
58
  color: var(--zdt_alertlookupnew_text);
53
59
  font-size: var(--zd_font_size18) ;
54
60
  line-height: 1.2222;
55
- font-family: var(--zd_bold);
61
+ font-weight: var(--zd-fw-bold);
56
62
  composes: ftsmooth wbreak from '~@zohodesk/components/es/common/common.module.css';
57
63
  vertical-align: middle;
58
64
  cursor: default;
@@ -14,7 +14,7 @@
14
14
 
15
15
  .noteTitle {
16
16
  font-size: var(--zd_font_size13) ;
17
- font-family: var(--zd_semibold);
17
+ font-weight: var(--zd-fw-semibold);
18
18
  composes: ftsmooth from '~@zohodesk/components/es/common/common.module.css';
19
19
  }
20
20
 
@@ -36,7 +36,8 @@
36
36
  .large {
37
37
  width: var(--zd_size580) ;
38
38
  }
39
- .tapWidth{
39
+
40
+ .tapWidth {
40
41
  max-width: 100% ;
41
42
  min-width: 100% ;
42
43
  }
@@ -109,7 +110,7 @@
109
110
  .subTitle {
110
111
  font-size: var(--zd_font_size15) ;
111
112
  line-height: 1.3333;
112
- font-family: var(--zd_semibold);
113
+ font-weight: var(--zd-fw-semibold);
113
114
  composes: ftsmooth wbreak from '~@zohodesk/components/es/common/common.module.css';
114
115
  }
115
116
 
@@ -130,4 +131,4 @@
130
131
  .footer {
131
132
  overflow: hidden;
132
133
  border-radius: 0 0 var(--zd_size10) var(--zd_size10);
133
- }
134
+ }