@zohodesk/dot 1.3.0 → 1.3.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 (164) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropValidationExcludeFilesArray.js +1 -1
  3. package/.cli/propValidation_report.html +1 -1
  4. package/README.md +21 -12
  5. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +163 -553
  6. package/assets/Appearance/dark/themes/blue/blue_DotTheme_DarkTheme.module.css +3 -12
  7. package/assets/Appearance/dark/themes/green/green_DotTheme_DarkTheme.module.css +3 -12
  8. package/assets/Appearance/dark/themes/orange/orange_DotTheme_DarkTheme.module.css +3 -12
  9. package/assets/Appearance/dark/themes/red/red_DotTheme_DarkTheme.module.css +3 -12
  10. package/assets/Appearance/dark/themes/yellow/yellow_DotTheme_DarkTheme.module.css +3 -12
  11. package/assets/Appearance/light/mode/Dot_LightMode.module.css +163 -553
  12. package/assets/Appearance/light/themes/blue/blue_DotTheme_LightTheme.module.css +3 -12
  13. package/assets/Appearance/light/themes/green/green_DotTheme_LightTheme.module.css +3 -12
  14. package/assets/Appearance/light/themes/orange/orange_DotTheme_LightTheme.module.css +3 -12
  15. package/assets/Appearance/light/themes/red/red_DotTheme_LightTheme.module.css +3 -12
  16. package/assets/Appearance/light/themes/yellow/yellow_DotTheme_LightTheme.module.css +3 -12
  17. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +163 -553
  18. package/assets/Appearance/pureDark/themes/blue/blue_DotTheme_PureDarkTheme.module.css +3 -12
  19. package/assets/Appearance/pureDark/themes/green/green_DotTheme_PureDarkTheme.module.css +3 -12
  20. package/assets/Appearance/pureDark/themes/orange/orange_DotTheme_PureDarkTheme.module.css +3 -12
  21. package/assets/Appearance/pureDark/themes/red/red_DotTheme_PureDarkTheme.module.css +3 -12
  22. package/assets/Appearance/pureDark/themes/yellow/yellow_DotTheme_PureDarkTheme.module.css +3 -12
  23. package/coverage/ExternalLink/ExternalLink.js.html +1 -1
  24. package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
  25. package/coverage/ExternalLink/index.html +1 -1
  26. package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
  27. package/coverage/ExternalLink/props/index.html +1 -1
  28. package/coverage/ExternalLink/props/propTypes.js.html +1 -1
  29. package/coverage/IconButton/IconButton.js.html +466 -0
  30. package/coverage/IconButton/IconButton.module.css.html +151 -0
  31. package/coverage/IconButton/index.html +131 -0
  32. package/coverage/IconButton/props/defaultProps.js.html +136 -0
  33. package/coverage/IconButton/props/index.html +131 -0
  34. package/coverage/IconButton/props/propTypes.js.html +187 -0
  35. package/coverage/Image/Image.js.html +1 -1
  36. package/coverage/Image/Image.module.css.html +1 -1
  37. package/coverage/Image/index.html +1 -1
  38. package/coverage/Image/props/defaultProps.js.html +1 -1
  39. package/coverage/Image/props/index.html +1 -1
  40. package/coverage/Image/props/propTypes.js.html +1 -1
  41. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
  42. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
  43. package/coverage/avatar/AvatarWithTeam/index.html +1 -1
  44. package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
  45. package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
  46. package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
  47. package/coverage/coverage-final.json +4 -0
  48. package/coverage/coverage-summary.json +5 -1
  49. package/coverage/index.html +40 -10
  50. package/es/IconButton/__tests__/IconButton.spec.js +148 -0
  51. package/es/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
  52. package/es/form/fields/FieldContainer/props/propTypes.js +1 -1
  53. package/es/v1/ActionButton/ActionButton.js +2 -2
  54. package/es/v1/AlphabeticList/AlphabeticList.js +6 -2
  55. package/es/v1/Attachment/Attachment.js +78 -75
  56. package/es/v1/AttachmentViewer/AttachmentImage.js +44 -63
  57. package/es/v1/Image/Image.js +26 -33
  58. package/es/v1/Loader/Loader.js +12 -18
  59. package/es/v1/Message/Message.js +16 -42
  60. package/es/v1/PlusIcon/PlusIcon.js +25 -37
  61. package/es/v1/Separator/Separator.js +40 -47
  62. package/es/v1/Upload/Upload.js +59 -66
  63. package/es/v1/alert/AlertHeader/AlertHeader.js +5 -4
  64. package/es/v1/alert/AlertHeader/props/defaultProps.js +12 -0
  65. package/es/v1/alert/AlertHeader/props/propTypes.js +20 -0
  66. package/es/v1/alert/AlertLookup/AlertLookup.js +6 -4
  67. package/es/v1/alert/AlertLookup/props/defaultProps.js +13 -0
  68. package/es/v1/alert/AlertLookup/props/propTypes.js +36 -0
  69. package/es/v1/avatar/AvatarClose/AvatarClose.js +32 -43
  70. package/es/v1/avatar/AvatarCollision/AvatarCollision.js +41 -52
  71. package/es/v1/avatar/AvatarIcon/AvatarIcon.js +38 -43
  72. package/es/v1/avatar/AvatarStatus/AvatarStatus.js +52 -63
  73. package/es/v1/avatar/AvatarThread/AvatarThread.js +62 -69
  74. package/es/v1/avatar/AvatarUser/AvatarUser.js +93 -100
  75. package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +81 -88
  76. package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
  77. package/es/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
  78. package/es/v1/form/fields/DateField/DateField.js +6 -6
  79. package/es/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
  80. package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
  81. package/es/v1/form/fields/PhoneField/PhoneField.js +6 -6
  82. package/es/v1/form/fields/RadioField/RadioField.js +89 -97
  83. package/es/v1/form/fields/SelectField/SelectField.js +139 -154
  84. package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +154 -197
  85. package/es/v1/layout/SubtabLayout/SubtabLayout.js +108 -124
  86. package/es/v1/list/SecondaryText/AccountName.js +61 -69
  87. package/es/v1/list/SecondaryText/ContactName.js +66 -74
  88. package/es/v1/list/SecondaryText/DepartmentText.js +15 -27
  89. package/es/v1/list/SecondaryText/Email.js +32 -40
  90. package/es/v1/list/SecondaryText/HappinessRating.js +17 -25
  91. package/es/v1/list/SecondaryText/PhoneNumber.js +36 -44
  92. package/es/v1/list/SecondaryText/PriorityText.js +16 -28
  93. package/es/v1/list/SecondaryText/SecondaryText.js +21 -33
  94. package/es/v1/list/SecondaryText/StatusText.js +17 -29
  95. package/es/v1/list/SecondaryText/TicketId.js +33 -45
  96. package/es/v1/list/SecondaryText/Website.js +22 -30
  97. package/es/v1/list/SecondryPanel/SecondryPanel.js +66 -83
  98. package/es/v1/list/SentimentStatus/SentimentStatus.js +18 -29
  99. package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  100. package/es/v1/list/status/StatusListItem/StatusListItem.js +75 -100
  101. package/es/v1/lookup/EmptyPage/EmptyPage.js +15 -26
  102. package/es/v1/lookup/Section/Section.js +14 -20
  103. package/es/v1/svg/PlusIcon.js +20 -27
  104. package/es/v1/svg/SnippetIcon.js +22 -29
  105. package/es/v1/svg/TemplateIcon.js +23 -30
  106. package/lib/IconButton/__tests__/IconButton.spec.js +156 -0
  107. package/lib/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
  108. package/lib/form/fields/FieldContainer/props/propTypes.js +1 -1
  109. package/lib/v1/ActionButton/ActionButton.js +2 -2
  110. package/lib/v1/AlphabeticList/AlphabeticList.js +7 -3
  111. package/lib/v1/Attachment/Attachment.js +77 -112
  112. package/lib/v1/AttachmentViewer/AttachmentImage.js +61 -96
  113. package/lib/v1/Image/Image.js +26 -71
  114. package/lib/v1/Loader/Loader.js +12 -55
  115. package/lib/v1/Message/Message.js +23 -80
  116. package/lib/v1/PlusIcon/PlusIcon.js +25 -71
  117. package/lib/v1/Separator/Separator.js +44 -85
  118. package/lib/v1/Upload/Upload.js +58 -103
  119. package/lib/v1/alert/AlertHeader/AlertHeader.js +5 -4
  120. package/lib/v1/alert/AlertHeader/props/defaultProps.js +19 -0
  121. package/lib/v1/alert/AlertHeader/props/propTypes.js +31 -0
  122. package/lib/v1/alert/AlertLookup/AlertLookup.js +6 -4
  123. package/lib/v1/alert/AlertLookup/props/defaultProps.js +20 -0
  124. package/lib/v1/alert/AlertLookup/props/propTypes.js +47 -0
  125. package/lib/v1/avatar/AvatarClose/AvatarClose.js +32 -77
  126. package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +41 -86
  127. package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +37 -80
  128. package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +52 -97
  129. package/lib/v1/avatar/AvatarThread/AvatarThread.js +61 -106
  130. package/lib/v1/avatar/AvatarUser/AvatarUser.js +95 -140
  131. package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +85 -130
  132. package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
  133. package/lib/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
  134. package/lib/v1/form/fields/DateField/DateField.js +6 -6
  135. package/lib/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
  136. package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
  137. package/lib/v1/form/fields/PhoneField/PhoneField.js +6 -6
  138. package/lib/v1/form/fields/RadioField/RadioField.js +91 -137
  139. package/lib/v1/form/fields/SelectField/SelectField.js +149 -200
  140. package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +160 -253
  141. package/lib/v1/layout/SubtabLayout/SubtabLayout.js +107 -206
  142. package/lib/v1/list/SecondaryText/AccountName.js +63 -113
  143. package/lib/v1/list/SecondaryText/ContactName.js +67 -117
  144. package/lib/v1/list/SecondaryText/DepartmentText.js +16 -66
  145. package/lib/v1/list/SecondaryText/Email.js +32 -82
  146. package/lib/v1/list/SecondaryText/HappinessRating.js +21 -68
  147. package/lib/v1/list/SecondaryText/PhoneNumber.js +36 -86
  148. package/lib/v1/list/SecondaryText/PriorityText.js +16 -66
  149. package/lib/v1/list/SecondaryText/SecondaryText.js +19 -69
  150. package/lib/v1/list/SecondaryText/StatusText.js +17 -67
  151. package/lib/v1/list/SecondaryText/TicketId.js +33 -83
  152. package/lib/v1/list/SecondaryText/Website.js +29 -72
  153. package/lib/v1/list/SecondryPanel/SecondryPanel.js +69 -168
  154. package/lib/v1/list/SentimentStatus/SentimentStatus.js +19 -64
  155. package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
  156. package/lib/v1/list/status/StatusListItem/StatusListItem.js +81 -137
  157. package/lib/v1/lookup/EmptyPage/EmptyPage.js +43 -93
  158. package/lib/v1/lookup/Section/Section.js +14 -58
  159. package/lib/v1/svg/PlusIcon.js +20 -65
  160. package/lib/v1/svg/SnippetIcon.js +22 -67
  161. package/lib/v1/svg/TemplateIcon.js +23 -68
  162. package/package.json +12 -12
  163. package/result.json +1 -1
  164. package/unittest/index.html +1 -1
@@ -0,0 +1,316 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`IconButton Checking the "Children" 1`] = `
4
+ <DocumentFragment>
5
+ <button
6
+ aria-pressed="false"
7
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
8
+ data-id="iconContainer"
9
+ data-ishtml="false"
10
+ data-selector-id="iconButton"
11
+ data-test-id="iconContainer"
12
+ >
13
+ <span>
14
+ Element 1
15
+ </span>
16
+ <span>
17
+ Element 2
18
+ </span>
19
+ <span>
20
+ Element 3
21
+ </span>
22
+ </button>
23
+ </DocumentFragment>
24
+ `;
25
+
26
+ exports[`IconButton eleRef prop is a function 1`] = `
27
+ <DocumentFragment>
28
+ <button
29
+ aria-pressed="false"
30
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
31
+ data-id="iconContainer"
32
+ data-ishtml="false"
33
+ data-selector-id="iconButton"
34
+ data-test-id="iconContainer"
35
+ />
36
+ </DocumentFragment>
37
+ `;
38
+
39
+ exports[`IconButton rendering ally 1`] = `
40
+ <DocumentFragment>
41
+ <button
42
+ aria-controls="ariaControls"
43
+ aria-expanded="true"
44
+ aria-haspopup="true"
45
+ aria-label="ariaLabel"
46
+ aria-labelledby="ariaLabelledby"
47
+ aria-pressed="false"
48
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
49
+ data-id="iconContainer"
50
+ data-ishtml="false"
51
+ data-selector-id="iconButton"
52
+ data-test-id="iconContainer"
53
+ />
54
+ </DocumentFragment>
55
+ `;
56
+
57
+ exports[`IconButton rendering ally 2`] = `
58
+ <DocumentFragment>
59
+ <button
60
+ aria-expanded="false"
61
+ aria-haspopup="false"
62
+ aria-pressed="false"
63
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
64
+ data-id="iconContainer"
65
+ data-ishtml="false"
66
+ data-selector-id="iconButton"
67
+ data-test-id="iconContainer"
68
+ />
69
+ </DocumentFragment>
70
+ `;
71
+
72
+ exports[`IconButton rendering in ClassName 1`] = `
73
+ <DocumentFragment>
74
+ <button
75
+ aria-pressed="false"
76
+ class="buttonReset wrapper IconButtonClass undefined effect default border defaultHover hoverEffect inflex coldir both"
77
+ data-id="iconContainer"
78
+ data-ishtml="false"
79
+ data-selector-id="iconButton"
80
+ data-test-id="iconContainer"
81
+ />
82
+ </DocumentFragment>
83
+ `;
84
+
85
+ exports[`IconButton rendering in Icon 1`] = `
86
+ <DocumentFragment>
87
+ <button
88
+ aria-pressed="false"
89
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
90
+ data-id="iconContainer"
91
+ data-ishtml="false"
92
+ data-selector-id="iconButton"
93
+ data-test-id="iconContainer"
94
+ >
95
+ <i
96
+ aria-hidden="true"
97
+ class="zd_font_icons basic icon-infoStroke fbold iconClass "
98
+ data-id="fontIcon"
99
+ data-selector-id="fontIcon"
100
+ data-test-id="fontIcon"
101
+ style="--zd-iconfont-size: var(--zd_font_size13);"
102
+ />
103
+ </button>
104
+ </DocumentFragment>
105
+ `;
106
+
107
+ exports[`IconButton rendering in dataIsHtml is True 1`] = `
108
+ <DocumentFragment>
109
+ <button
110
+ aria-pressed="false"
111
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
112
+ data-id="iconContainer"
113
+ data-ishtml="true"
114
+ data-selector-id="iconButton"
115
+ data-test-id="iconContainer"
116
+ />
117
+ </DocumentFragment>
118
+ `;
119
+
120
+ exports[`IconButton rendering in isDisabled is True 1`] = `
121
+ <DocumentFragment>
122
+ <button
123
+ aria-pressed="false"
124
+ class="buttonReset wrapper undefined effect default border defaultHover disabled inflex coldir both"
125
+ data-id="iconContainer"
126
+ data-ishtml="false"
127
+ data-selector-id="iconButton"
128
+ data-test-id="iconContainer"
129
+ disabled=""
130
+ />
131
+ </DocumentFragment>
132
+ `;
133
+
134
+ exports[`IconButton rendering in title 1`] = `
135
+ <DocumentFragment>
136
+ <button
137
+ aria-pressed="false"
138
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
139
+ data-id="iconContainer"
140
+ data-ishtml="false"
141
+ data-selector-id="iconButton"
142
+ data-test-id="iconContainer"
143
+ data-title="IconTitle"
144
+ />
145
+ </DocumentFragment>
146
+ `;
147
+
148
+ exports[`IconButton rendering isNeedEffect is False 1`] = `
149
+ <DocumentFragment>
150
+ <button
151
+ aria-pressed="false"
152
+ class="buttonReset wrapper undefined inflex coldir both"
153
+ data-id="iconContainer"
154
+ data-ishtml="false"
155
+ data-selector-id="iconButton"
156
+ data-test-id="iconContainer"
157
+ />
158
+ </DocumentFragment>
159
+ `;
160
+
161
+ exports[`IconButton rendering needButtonTag 1`] = `
162
+ <DocumentFragment>
163
+ <div
164
+ aria-pressed="false"
165
+ class="false wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
166
+ data-id="iconContainer"
167
+ data-ishtml="false"
168
+ data-selector-id="iconButton"
169
+ data-test-id="iconContainer"
170
+ />
171
+ </DocumentFragment>
172
+ `;
173
+
174
+ exports[`IconButton rendering the defult props 1`] = `
175
+ <DocumentFragment>
176
+ <button
177
+ aria-pressed="false"
178
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
179
+ data-id="iconContainer"
180
+ data-ishtml="false"
181
+ data-selector-id="iconButton"
182
+ data-test-id="iconContainer"
183
+ />
184
+ </DocumentFragment>
185
+ `;
186
+
187
+ exports[`IconButton rendering the hovertypes- bg 1`] = `
188
+ <DocumentFragment>
189
+ <button
190
+ aria-pressed="false"
191
+ class="buttonReset wrapper undefined effect default border bgHover hoverEffect inflex coldir both"
192
+ data-id="iconContainer"
193
+ data-ishtml="false"
194
+ data-selector-id="iconButton"
195
+ data-test-id="iconContainer"
196
+ />
197
+ </DocumentFragment>
198
+ `;
199
+
200
+ exports[`IconButton rendering the hovertypes- border 1`] = `
201
+ <DocumentFragment>
202
+ <button
203
+ aria-pressed="false"
204
+ class="buttonReset wrapper undefined effect default border borderHover hoverEffect inflex coldir both"
205
+ data-id="iconContainer"
206
+ data-ishtml="false"
207
+ data-selector-id="iconButton"
208
+ data-test-id="iconContainer"
209
+ />
210
+ </DocumentFragment>
211
+ `;
212
+
213
+ exports[`IconButton rendering the hovertypes- default 1`] = `
214
+ <DocumentFragment>
215
+ <button
216
+ aria-pressed="false"
217
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
218
+ data-id="iconContainer"
219
+ data-ishtml="false"
220
+ data-selector-id="iconButton"
221
+ data-test-id="iconContainer"
222
+ />
223
+ </DocumentFragment>
224
+ `;
225
+
226
+ exports[`IconButton rendering the isActive true with palette of- default 1`] = `
227
+ <DocumentFragment>
228
+ <button
229
+ aria-pressed="false"
230
+ class="buttonReset wrapper undefined effect default border defaultHover active hoverEffect inflex coldir both"
231
+ data-id="iconContainer"
232
+ data-ishtml="false"
233
+ data-selector-id="iconButton"
234
+ data-test-id="iconContainer"
235
+ />
236
+ </DocumentFragment>
237
+ `;
238
+
239
+ exports[`IconButton rendering the isActive true with palette of- primary 1`] = `
240
+ <DocumentFragment>
241
+ <button
242
+ aria-pressed="false"
243
+ class="buttonReset wrapper primary_active effect primary border defaultHover active hoverEffect inflex coldir both"
244
+ data-id="iconContainer"
245
+ data-ishtml="false"
246
+ data-selector-id="iconButton"
247
+ data-test-id="iconContainer"
248
+ />
249
+ </DocumentFragment>
250
+ `;
251
+
252
+ exports[`IconButton rendering the isActive true with palette of- primaryFilled 1`] = `
253
+ <DocumentFragment>
254
+ <button
255
+ aria-pressed="false"
256
+ class="buttonReset wrapper primaryFilled_active effect primaryFilled border defaultHover active hoverEffect inflex coldir both"
257
+ data-id="iconContainer"
258
+ data-ishtml="false"
259
+ data-selector-id="iconButton"
260
+ data-test-id="iconContainer"
261
+ />
262
+ </DocumentFragment>
263
+ `;
264
+
265
+ exports[`IconButton rendering the palette of- default 1`] = `
266
+ <DocumentFragment>
267
+ <button
268
+ aria-pressed="false"
269
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
270
+ data-id="iconContainer"
271
+ data-ishtml="false"
272
+ data-selector-id="iconButton"
273
+ data-test-id="iconContainer"
274
+ />
275
+ </DocumentFragment>
276
+ `;
277
+
278
+ exports[`IconButton rendering the palette of- primary 1`] = `
279
+ <DocumentFragment>
280
+ <button
281
+ aria-pressed="false"
282
+ class="buttonReset wrapper primary effect primary border defaultHover hoverEffect inflex coldir both"
283
+ data-id="iconContainer"
284
+ data-ishtml="false"
285
+ data-selector-id="iconButton"
286
+ data-test-id="iconContainer"
287
+ />
288
+ </DocumentFragment>
289
+ `;
290
+
291
+ exports[`IconButton rendering the palette of- primaryFilled 1`] = `
292
+ <DocumentFragment>
293
+ <button
294
+ aria-pressed="false"
295
+ class="buttonReset wrapper primaryFilled effect primaryFilled border defaultHover hoverEffect inflex coldir both"
296
+ data-id="iconContainer"
297
+ data-ishtml="false"
298
+ data-selector-id="iconButton"
299
+ data-test-id="iconContainer"
300
+ />
301
+ </DocumentFragment>
302
+ `;
303
+
304
+ exports[`IconButton rendering tourId 1`] = `
305
+ <DocumentFragment>
306
+ <button
307
+ aria-pressed="false"
308
+ class="buttonReset wrapper undefined effect default border defaultHover hoverEffect inflex coldir both"
309
+ data-id="iconContainer"
310
+ data-ishtml="false"
311
+ data-selector-id="iconButton"
312
+ data-test-id="iconContainer"
313
+ data-tour="tourId"
314
+ />
315
+ </DocumentFragment>
316
+ `;
@@ -1,7 +1,7 @@
1
1
  import PropTypes from 'prop-types';
2
2
  export const propTypes = {
3
3
  children: PropTypes.node,
4
- alignContainer: PropTypes.oneOf('vertical', 'baseline'),
4
+ alignContainer: PropTypes.oneOf(['vertical', 'baseline']),
5
5
  renderProps: PropTypes.shape({
6
6
  start: PropTypes.func,
7
7
  middle: PropTypes.func,
@@ -132,8 +132,8 @@ function ActionButton(props) {
132
132
  ActionButton.defaultProps = defaultProps;
133
133
  ActionButton.propTypes = propTypes;
134
134
  const ActionButtonComponent = Popup(ActionButton);
135
- ActionButtonComponent.defaultProps = ActionButton.defaultProps;
136
- ActionButtonComponent.propTypes = ActionButton.propTypes; // ActionButton.docs = {
135
+ ActionButtonComponent.defaultProps = defaultProps;
136
+ ActionButtonComponent.propTypes = propTypes; // ActionButton.docs = {
137
137
  // componentGroup: 'Atom'
138
138
  // };
139
139
 
@@ -60,6 +60,11 @@ function AlphabeticList(props) {
60
60
 
61
61
  AlphabeticList.propTypes = AlphabeticList_propTypes;
62
62
  AlphabeticList.defaultProps = AlphabeticList_defaultProps;
63
+ const MemoizedAlphabeticList = /*#__PURE__*/memo(AlphabeticList);
64
+ MemoizedAlphabeticList.propTypes = AlphabeticList_propTypes;
65
+ MemoizedAlphabeticList.defaultProps = AlphabeticList_defaultProps;
66
+ MemoizedAlphabeticList.displayName = 'AlphabeticList';
67
+ export default MemoizedAlphabeticList;
63
68
 
64
69
  function AlphabeticListItem(props) {
65
70
  let {
@@ -86,5 +91,4 @@ function AlphabeticListItem(props) {
86
91
  }
87
92
 
88
93
  AlphabeticListItem.propTypes = AlphabeticListItem_propTypes;
89
- AlphabeticListItem.defaultProps = AlphabeticListItem_defaultProps;
90
- export default AlphabeticList;
94
+ AlphabeticListItem.defaultProps = AlphabeticListItem_defaultProps;
@@ -1,87 +1,90 @@
1
+ /**** Libraries ****/
1
2
  import React from 'react';
2
3
  import { defaultProps } from '../../Attachment/props/defaultProps';
3
4
  import { propTypes } from '../../Attachment/props/propTypes';
4
5
  import { Icon } from '@zohodesk/icons';
5
6
  import { Container, Box } from '@zohodesk/components/es/v1/Layout';
6
7
  import Link from '../Link/Link';
8
+ /**** CSS ****/
9
+
7
10
  import style from '../../Attachment/Attachment.module.css';
8
- export default class Attachment extends React.Component {
9
- render() {
10
- let {
11
- onClick,
12
- dataId,
13
- size,
14
- iconName,
15
- fileName,
16
- fileSize,
17
- downloadLink,
18
- palette,
19
- tooltip,
20
- fileInfo,
21
- i18nKeys,
22
- dataSelectorId
23
- } = this.props;
24
- let {
25
- downloadTitle = 'Download'
26
- } = i18nKeys;
27
- return /*#__PURE__*/React.createElement(Container, {
28
- isInline: true,
29
- className: `${style.attachment} ${onClick ? style.attachmentHover : ''} ${style[`palette_${palette}`]} ${style[size]}`,
30
- onClick: onClick,
31
- dataId: dataId,
32
- "data-title": tooltip,
33
- alignBox: "row",
34
- isCover: false,
35
- dataSelectorId: dataSelectorId,
36
- tabIndex: "0"
37
- }, iconName ? /*#__PURE__*/React.createElement(Box, {
38
- className: style.attachleft
39
- }, /*#__PURE__*/React.createElement(Container, {
40
- align: "both"
41
- }, /*#__PURE__*/React.createElement(Icon, {
42
- name: iconName,
43
- iconClass: style.attachIcon
44
- }))) : null, /*#__PURE__*/React.createElement(Box, {
45
- flexible: true,
46
- className: style.attachright
47
- }, /*#__PURE__*/React.createElement(Container, {
48
- align: "horizontal"
49
- }, fileName ? /*#__PURE__*/React.createElement(Box, {
50
- className: style.atatchName,
51
- "data-title": fileName
52
- }, fileName) : null, /*#__PURE__*/React.createElement(Box, {
53
- className: style.footer
54
- }, /*#__PURE__*/React.createElement(Container, {
55
- alignBox: "row",
56
- align: "baseline",
57
- isCover: false
58
- }, fileSize ? /*#__PURE__*/React.createElement(Box, {
59
- className: style.attachSize,
60
- adjust: true,
61
- shrink: true,
62
- "data-title": fileSize
63
- }, fileSize) : null, fileInfo ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
64
- className: style.dot
65
- }), /*#__PURE__*/React.createElement(Box, {
66
- className: style.attachSize,
67
- adjust: true,
68
- shrink: true,
69
- "data-title": fileInfo
70
- }, fileInfo)) : null)))), downloadLink ? /*#__PURE__*/React.createElement(Link, {
71
- target: "_self",
72
- href: downloadLink,
73
- className: style.attachDownload,
74
- title: downloadTitle,
75
- hasReload: true
76
- }, /*#__PURE__*/React.createElement(Icon, {
77
- name: "ZD-downloadNew",
78
- iconClass: style.downIcon
79
- })) : null);
80
- }
81
11
 
82
- }
12
+ const Attachment = props => {
13
+ const {
14
+ onClick,
15
+ dataId,
16
+ size,
17
+ iconName,
18
+ fileName,
19
+ fileSize,
20
+ downloadLink,
21
+ palette,
22
+ tooltip,
23
+ fileInfo,
24
+ i18nKeys,
25
+ dataSelectorId
26
+ } = props;
27
+ let {
28
+ downloadTitle = 'Download'
29
+ } = i18nKeys;
30
+ return /*#__PURE__*/React.createElement(Container, {
31
+ isInline: true,
32
+ className: `${style.attachment} ${onClick ? style.attachmentHover : ''} ${style[`palette_${palette}`]} ${style[size]}`,
33
+ onClick: onClick,
34
+ dataId: dataId,
35
+ "data-title": tooltip,
36
+ alignBox: "row",
37
+ isCover: false,
38
+ dataSelectorId: dataSelectorId,
39
+ tabIndex: "0"
40
+ }, iconName ? /*#__PURE__*/React.createElement(Box, {
41
+ className: style.attachleft
42
+ }, /*#__PURE__*/React.createElement(Container, {
43
+ align: "both"
44
+ }, /*#__PURE__*/React.createElement(Icon, {
45
+ name: iconName,
46
+ iconClass: style.attachIcon
47
+ }))) : null, /*#__PURE__*/React.createElement(Box, {
48
+ flexible: true,
49
+ className: style.attachright
50
+ }, /*#__PURE__*/React.createElement(Container, {
51
+ align: "horizontal"
52
+ }, fileName ? /*#__PURE__*/React.createElement(Box, {
53
+ className: style.atatchName,
54
+ "data-title": fileName
55
+ }, fileName) : null, /*#__PURE__*/React.createElement(Box, {
56
+ className: style.footer
57
+ }, /*#__PURE__*/React.createElement(Container, {
58
+ alignBox: "row",
59
+ align: "baseline",
60
+ isCover: false
61
+ }, fileSize ? /*#__PURE__*/React.createElement(Box, {
62
+ className: style.attachSize,
63
+ adjust: true,
64
+ shrink: true,
65
+ "data-title": fileSize
66
+ }, fileSize) : null, fileInfo ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
67
+ className: style.dot
68
+ }), /*#__PURE__*/React.createElement(Box, {
69
+ className: style.attachSize,
70
+ adjust: true,
71
+ shrink: true,
72
+ "data-title": fileInfo
73
+ }, fileInfo)) : null)))), downloadLink ? /*#__PURE__*/React.createElement(Link, {
74
+ target: "_self",
75
+ href: downloadLink,
76
+ className: style.attachDownload,
77
+ title: downloadTitle,
78
+ hasReload: true
79
+ }, /*#__PURE__*/React.createElement(Icon, {
80
+ name: "ZD-downloadNew",
81
+ iconClass: style.downIcon
82
+ })) : null);
83
+ };
84
+
83
85
  Attachment.propTypes = propTypes;
84
- Attachment.defaultProps = defaultProps; // if (__DOCS__) {
86
+ Attachment.defaultProps = defaultProps;
87
+ export default Attachment; // if (__DOCS__) {
85
88
  // Attachment.docs = {
86
89
  // componentGroup: 'Attachment'
87
90
  // };
@@ -1,79 +1,60 @@
1
1
  /* eslint-disable css-modules/no-unused-class */
2
2
 
3
3
  /** * Libraries ** */
4
- import React, { Component } from 'react';
4
+ import React, { useRef, useEffect, useState } from 'react';
5
5
  import { AttachmentImage_defaultProps } from '../../AttachmentViewer/props/defaultProps';
6
6
  import { AttachmentImage_propTypes } from '../../AttachmentViewer/props/propTypes';
7
7
  import Image from '../Image/Image';
8
8
  /** * CSS ** */
9
9
 
10
10
  import style from '../../AttachmentViewer/AttachmentViewer.module.css';
11
- export default class AttachmentImage extends Component {
12
- constructor(props) {
13
- super(props);
14
- this.imageEle = /*#__PURE__*/React.createRef();
15
- this.state = {
16
- isLoading: true
17
- };
18
- this.imgLoad = this.imgLoad.bind(this);
19
- }
20
11
 
21
- componentDidMount() {
22
- const {
23
- isImage
24
- } = this.props;
12
+ const AttachmentImage = props => {
13
+ const {
14
+ isImage,
15
+ onLoad,
16
+ src,
17
+ onClick,
18
+ alt,
19
+ dataId,
20
+ id,
21
+ className,
22
+ isCover
23
+ } = props;
24
+ const imageEle = useRef();
25
+ const [isLoading, setLoading] = useState(true);
25
26
 
27
+ const imgLoad = () => {
28
+ setLoading(false);
29
+ onLoad && onLoad();
30
+ };
31
+
32
+ useEffect(() => {
26
33
  if (isImage) {
27
- const image = this.imageEle.current;
28
- image.addEventListener('load', this.imgLoad);
34
+ const image = imageEle.current;
35
+ image.addEventListener('load', imgLoad);
29
36
  } else {
30
- this.setState({
31
- isLoading: false
32
- });
37
+ setLoading(false);
33
38
  }
34
- }
35
-
36
- imgLoad() {
37
- this.setState({
38
- isLoading: false
39
- });
40
- const {
41
- onLoad
42
- } = this.props;
43
- onLoad && onLoad();
44
- }
45
-
46
- render() {
47
- const {
48
- src,
49
- onClick,
50
- alt,
51
- dataId,
52
- id,
53
- className,
54
- isCover
55
- } = this.props;
56
- const {
57
- isLoading
58
- } = this.state;
59
- return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading ? /*#__PURE__*/React.createElement("div", {
60
- className: `${style.spinLoad}`,
61
- "data-id": `${dataId}_loader`,
62
- "data-test-id": `${dataId}_loader`
63
- }, /*#__PURE__*/React.createElement("div", {
64
- className: style.loader
65
- })) : null, /*#__PURE__*/React.createElement(Image, {
66
- htmlId: id,
67
- eleRef: this.imageEle,
68
- dataId: dataId,
69
- src: src,
70
- onClick: onClick,
71
- className: `${isLoading ? style.hide : ''} ${className}`,
72
- alt: alt,
73
- isCover: isCover
74
- }));
75
- }
39
+ }, []);
40
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading ? /*#__PURE__*/React.createElement("div", {
41
+ className: `${style.spinLoad}`,
42
+ "data-id": `${dataId}_loader`,
43
+ "data-test-id": `${dataId}_loader`
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ className: style.loader
46
+ })) : null, /*#__PURE__*/React.createElement(Image, {
47
+ htmlId: id,
48
+ eleRef: imageEle,
49
+ dataId: dataId,
50
+ src: src,
51
+ onClick: onClick,
52
+ className: `${isLoading ? style.hide : ''} ${className}`,
53
+ alt: alt,
54
+ isCover: isCover
55
+ }));
56
+ };
76
57
 
77
- }
78
58
  AttachmentImage.propTypes = AttachmentImage_propTypes;
79
- AttachmentImage.defaultProps = AttachmentImage_defaultProps;
59
+ AttachmentImage.defaultProps = AttachmentImage_defaultProps;
60
+ export default AttachmentImage;