@zohodesk/icons 1.2.1 → 1.2.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 (166) hide show
  1. package/README.md +1 -1
  2. package/assets/fonts/gs-zdfonts.svg +71 -0
  3. package/assets/fonts/gs-zdfonts.woff +0 -0
  4. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviBold.woff +0 -0
  5. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviBold.woff2 +0 -0
  6. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviExtrabold.woff +0 -0
  7. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviExtrabold.woff2 +0 -0
  8. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviLight.woff +0 -0
  9. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviLight.woff2 +0 -0
  10. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviMedium.woff +0 -0
  11. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviMedium.woff2 +0 -0
  12. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviRegular.woff +0 -0
  13. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviRegular.woff2 +0 -0
  14. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviSemibold.woff +0 -0
  15. package/assets/fonts/webfonts/ZohoPuvi/ZohoPuviSemibold.woff2 +0 -0
  16. package/assets/fonts/zd-addforms +0 -0
  17. package/assets/fonts/zd-addforms.svg +101 -0
  18. package/assets/fonts/zd-addforms.woff +0 -0
  19. package/assets/fonts/zd-addforms.woff2 +0 -0
  20. package/assets/fonts/zd-automate.svg +22 -0
  21. package/assets/fonts/zd-automate.woff +0 -0
  22. package/assets/fonts/zd-automate.woff2 +0 -0
  23. package/assets/fonts/zd-channels.svg +114 -0
  24. package/assets/fonts/zd-channels.woff +0 -0
  25. package/assets/fonts/zd-channels.woff2 +0 -0
  26. package/assets/fonts/zd-common.svg +232 -0
  27. package/assets/fonts/zd-common.woff +0 -0
  28. package/assets/fonts/zd-common.woff2 +0 -0
  29. package/assets/fonts/zd-community.svg +66 -0
  30. package/assets/fonts/zd-community.woff +0 -0
  31. package/assets/fonts/zd-community.woff2 +0 -0
  32. package/assets/fonts/zd-customers.svg +15 -0
  33. package/assets/fonts/zd-customers.woff +0 -0
  34. package/assets/fonts/zd-customers.woff2 +0 -0
  35. package/assets/fonts/zd-customize.svg +147 -0
  36. package/assets/fonts/zd-customize.woff +0 -0
  37. package/assets/fonts/zd-customize.woff2 +0 -0
  38. package/assets/fonts/zd-font-icon-portallist.svg +13 -0
  39. package/assets/fonts/zd-font-icon-portallist.woff +0 -0
  40. package/assets/fonts/zd-font-icon-portallist.woff2 +0 -0
  41. package/assets/fonts/zd-gamescope.svg +28 -0
  42. package/assets/fonts/zd-gamescope.woff +0 -0
  43. package/assets/fonts/zd-gamescope.woff2 +0 -0
  44. package/assets/fonts/zd-gcFonts.svg +462 -0
  45. package/assets/fonts/zd-gcFonts.woff +0 -0
  46. package/assets/fonts/zd-gcFonts.woff2 +0 -0
  47. package/assets/fonts/zd-gettingstarted.svg +86 -0
  48. package/assets/fonts/zd-gettingstarted.woff +0 -0
  49. package/assets/fonts/zd-gettingstarted.woff2 +0 -0
  50. package/assets/fonts/zd-integrations.svg +17 -0
  51. package/assets/fonts/zd-integrations.woff +0 -0
  52. package/assets/fonts/zd-integrations.woff2 +0 -0
  53. package/assets/fonts/zd-kb.svg +1019 -0
  54. package/assets/fonts/zd-kb.woff +0 -0
  55. package/assets/fonts/zd-kb.woff2 +0 -0
  56. package/assets/fonts/zd-kbeditortools.svg +89 -0
  57. package/assets/fonts/zd-kbeditortools.woff +0 -0
  58. package/assets/fonts/zd-kbeditortools.woff2 +0 -0
  59. package/assets/fonts/zd-logo.svg +13 -0
  60. package/assets/fonts/zd-logo.woff +0 -0
  61. package/assets/fonts/zd-logo.woff2 +0 -0
  62. package/assets/fonts/zd-mobile-marketplace.svg +14 -0
  63. package/assets/fonts/zd-mobile-marketplace.woff +0 -0
  64. package/assets/fonts/zd-mobile-marketplace.woff2 +0 -0
  65. package/assets/fonts/zd-organization.svg +27 -0
  66. package/assets/fonts/zd-organization.woff +0 -0
  67. package/assets/fonts/zd-organization.woff2 +0 -0
  68. package/assets/fonts/zd-others.svg +69 -0
  69. package/assets/fonts/zd-others.woff +0 -0
  70. package/assets/fonts/zd-others.woff2 +0 -0
  71. package/assets/fonts/zd-rAI.svg +19 -0
  72. package/assets/fonts/zd-rAI.woff +0 -0
  73. package/assets/fonts/zd-rAI.woff2 +0 -0
  74. package/assets/fonts/zd-rAccessibility.svg +25 -0
  75. package/assets/fonts/zd-rAccessibility.woff +0 -0
  76. package/assets/fonts/zd-rAccessibility.woff2 +0 -0
  77. package/assets/fonts/zd-rAutomation.svg +18 -0
  78. package/assets/fonts/zd-rAutomation.woff +0 -0
  79. package/assets/fonts/zd-rAutomation.woff2 +0 -0
  80. package/assets/fonts/zd-rCallBar.svg +22 -0
  81. package/assets/fonts/zd-rCallBar.woff +0 -0
  82. package/assets/fonts/zd-rCallBar.woff2 +0 -0
  83. package/assets/fonts/zd-rChannels.svg +58 -0
  84. package/assets/fonts/zd-rChannels.woff +0 -0
  85. package/assets/fonts/zd-rChannels.woff2 +0 -0
  86. package/assets/fonts/zd-rCustomize.svg +61 -0
  87. package/assets/fonts/zd-rCustomize.woff +0 -0
  88. package/assets/fonts/zd-rCustomize.woff2 +0 -0
  89. package/assets/fonts/zd-rDeveloperSpace.svg +11 -0
  90. package/assets/fonts/zd-rDeveloperSpace.woff +0 -0
  91. package/assets/fonts/zd-rDeveloperSpace.woff2 +0 -0
  92. package/assets/fonts/zd-rExportFiles.svg +168 -0
  93. package/assets/fonts/zd-rExportFiles.woff +0 -0
  94. package/assets/fonts/zd-rExportFiles.woff2 +0 -0
  95. package/assets/fonts/zd-rGeneral.svg +228 -0
  96. package/assets/fonts/zd-rGeneral.woff +0 -0
  97. package/assets/fonts/zd-rGeneral.woff2 +0 -0
  98. package/assets/fonts/zd-rIntegrations.svg +51 -0
  99. package/assets/fonts/zd-rIntegrations.woff +0 -0
  100. package/assets/fonts/zd-rIntegrations.woff2 +0 -0
  101. package/assets/fonts/zd-rLhs.svg +84 -0
  102. package/assets/fonts/zd-rLhs.woff +0 -0
  103. package/assets/fonts/zd-rLhs.woff2 +0 -0
  104. package/assets/fonts/zd-rMarketplace.svg +42 -0
  105. package/assets/fonts/zd-rMarketplace.woff +0 -0
  106. package/assets/fonts/zd-rMarketplace.woff2 +0 -0
  107. package/assets/fonts/zd-rReports.svg +67 -0
  108. package/assets/fonts/zd-rReports.woff +0 -0
  109. package/assets/fonts/zd-rReports.woff2 +0 -0
  110. package/assets/fonts/zd-rSetup.svg +65 -0
  111. package/assets/fonts/zd-rSetup.woff +0 -0
  112. package/assets/fonts/zd-rSetup.woff2 +0 -0
  113. package/assets/fonts/zd-rTickets.svg +127 -0
  114. package/assets/fonts/zd-rTickets.woff +0 -0
  115. package/assets/fonts/zd-rTickets.woff2 +0 -0
  116. package/assets/fonts/zd-rTopband.svg +53 -0
  117. package/assets/fonts/zd-rTopband.woff +0 -0
  118. package/assets/fonts/zd-rTopband.woff2 +0 -0
  119. package/assets/fonts/zd-rTwotone.svg +283 -0
  120. package/assets/fonts/zd-rTwotone.woff +0 -0
  121. package/assets/fonts/zd-rTwotone.woff2 +0 -0
  122. package/assets/fonts/zd-rUpdates.svg +13 -0
  123. package/assets/fonts/zd-rUpdates.woff +0 -0
  124. package/assets/fonts/zd-rUpdates.woff2 +0 -0
  125. package/assets/fonts/zd-reports.svg +132 -0
  126. package/assets/fonts/zd-reports.woff +0 -0
  127. package/assets/fonts/zd-reports.woff2 +0 -0
  128. package/assets/fonts/zd-setup.svg +208 -0
  129. package/assets/fonts/zd-setup.woff +0 -0
  130. package/assets/fonts/zd-setup.woff2 +0 -0
  131. package/assets/fonts/zd-social.svg +157 -0
  132. package/assets/fonts/zd-social.woff +0 -0
  133. package/assets/fonts/zd-social.woff2 +0 -0
  134. package/assets/fonts/zd-ticket-channels.svg +68 -0
  135. package/assets/fonts/zd-ticket-channels.woff +0 -0
  136. package/assets/fonts/zd-ticket-channels.woff2 +0 -0
  137. package/assets/fonts/zd-tickets.svg +281 -0
  138. package/assets/fonts/zd-tickets.woff +0 -0
  139. package/assets/fonts/zd-tickets.woff2 +0 -0
  140. package/assets/fonts/zd-topband.svg +216 -0
  141. package/assets/fonts/zd-topband.woff +0 -0
  142. package/assets/fonts/zd-topband.woff2 +0 -0
  143. package/assets/fonts/zd-zohohc-kb-articlenotes-font-icon.svg +16 -0
  144. package/assets/fonts/zd-zohohc-kb-articlenotes-font-icon.woff +0 -0
  145. package/assets/fonts/zd-zohohc-kb-articlenotes-font-icon.woff2 +0 -0
  146. package/assets/react/zd-font-rAccessibility.module.css +2 -2
  147. package/assets/react/zd-font-rGeneral.module.css +4 -1
  148. package/cbt.config.js +1 -1
  149. package/es/Icon/FontIcon.js +4 -4
  150. package/es/Icon/__tests__/FontIcon.spec.js +1 -1
  151. package/es/Icon/index.js +39 -39
  152. package/es/index.js +1 -1
  153. package/lib/Icon/index.js +37 -37
  154. package/package.json +8 -6
  155. package/es/v1/FontIcon.js +0 -72
  156. package/es/v1/__tests__/FontIcon.spec.js +0 -144
  157. package/es/v1/__tests__/__snapshots__/FontIcon.spec.js.snap +0 -251
  158. package/es/v1/asyncComponent.js +0 -42
  159. package/es/v1/props/defaultProps.js +0 -5
  160. package/es/v1/props/propTypes.js +0 -18
  161. package/lib/v1/FontIcon.js +0 -86
  162. package/lib/v1/__tests__/FontIcon.spec.js +0 -151
  163. package/lib/v1/__tests__/__snapshots__/FontIcon.spec.js.snap +0 -251
  164. package/lib/v1/asyncComponent.js +0 -107
  165. package/lib/v1/props/defaultProps.js +0 -12
  166. package/lib/v1/props/propTypes.js +0 -29
@@ -1,144 +0,0 @@
1
- import React from 'react';
2
- import FontIcon from '../FontIcon';
3
- import { render } from "@testing-library/react";
4
- describe('FontIcon - ', () => {
5
- test('rendering the "default" props', () => {
6
- const {
7
- asFragment
8
- } = render( /*#__PURE__*/React.createElement(FontIcon, null));
9
- expect(asFragment()).toMatchSnapshot();
10
- });
11
- test('checking "isBold" is true', () => {
12
- const {
13
- asFragment
14
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
15
- isBold: true
16
- }));
17
- expect(asFragment()).toMatchSnapshot();
18
- });
19
- test('checking "isBold" is false', () => {
20
- const {
21
- asFragment
22
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
23
- isBold: false
24
- }));
25
- expect(asFragment()).toMatchSnapshot();
26
- });
27
- test('rendering the "iconClass"', () => {
28
- const {
29
- asFragment
30
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
31
- iconClass: "iconStyleCss"
32
- }));
33
- expect(asFragment()).toMatchSnapshot();
34
- });
35
- test('rendering the "fontSize"', () => {
36
- const {
37
- asFragment
38
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
39
- size: "15"
40
- }));
41
- expect(asFragment()).toMatchSnapshot();
42
- });
43
- test('rendering the "title"', () => {
44
- const {
45
- asFragment
46
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
47
- title: "FontIcon"
48
- }));
49
- expect(asFragment()).toMatchSnapshot();
50
- });
51
- test('rendering the "pathname"', () => {
52
- const {
53
- asFragment
54
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
55
- pathName: "zd67f91bb627"
56
- }));
57
- expect(asFragment()).toMatchSnapshot();
58
- });
59
- test('rendering "Name" with "iconContent" and without path', () => {
60
- const {
61
- asFragment
62
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
63
- name: ['icon-addAccounts', 3],
64
- iconContent: {
65
- path1: "icon1",
66
- path2: "icon2",
67
- path3: "icon3"
68
- }
69
- }));
70
- expect(asFragment()).toMatchSnapshot();
71
- });
72
- test('rendering "iconClass" with path ', () => {
73
- const {
74
- asFragment
75
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
76
- iconClass: "iconStyleCss",
77
- name: ['icon-addAccounts', 3],
78
- iconContent: {
79
- path1: "icon1",
80
- path2: "icon2",
81
- path3: "icon3"
82
- }
83
- }));
84
- expect(asFragment()).toMatchSnapshot();
85
- });
86
- test('rendering "custumIcon" with path', () => {
87
- const {
88
- asFragment
89
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
90
- name: ['icon-ch-chat-in', 2],
91
- iconName: "ZD-chChatMis",
92
- iconContent: {
93
- path1: "icon1",
94
- path2: "icon2"
95
- }
96
- }));
97
- expect(asFragment()).toMatchSnapshot();
98
- });
99
- test('rendering "ariaHidden" is false', () => {
100
- const {
101
- asFragment
102
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
103
- a11y: {
104
- ariaHidden: false
105
- }
106
- }));
107
- expect(asFragment()).toMatchSnapshot();
108
- });
109
- test('rendering "IconName"', () => {
110
- const {
111
- asFragment
112
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
113
- iconName: "ZD-addAccount"
114
- }));
115
- expect(asFragment()).toMatchSnapshot();
116
- });
117
- test('rendering custom icon name', () => {
118
- const {
119
- asFragment
120
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
121
- iconName: "ZD-chChatMis"
122
- }));
123
- expect(asFragment()).toMatchSnapshot();
124
- });
125
- const titlePosition = ['top', 'bottom', 'left', 'right'];
126
- test.each(titlePosition)('rendering the "titlePostion" to - %s', titlePosition => {
127
- const {
128
- asFragment
129
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
130
- titlePosition: titlePosition
131
- }));
132
- expect(asFragment()).toMatchSnapshot();
133
- });
134
- test('rendering custom attributes with tagAttributes prop', () => {
135
- const {
136
- asFragment
137
- } = render( /*#__PURE__*/React.createElement(FontIcon, {
138
- tagAttributes: {
139
- 'data-custom-attr': 'true'
140
- }
141
- }));
142
- expect(asFragment()).toMatchSnapshot();
143
- });
144
- });
@@ -1,251 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`FontIcon - checking "isBold" is false 1`] = `
4
- <DocumentFragment>
5
- <i
6
- aria-hidden="true"
7
- class="zd_font_icons basic undefined "
8
- data-id="fontIcon"
9
- data-selector-id="fontIcon"
10
- data-test-id="fontIcon"
11
- />
12
- </DocumentFragment>
13
- `;
14
-
15
- exports[`FontIcon - checking "isBold" is true 1`] = `
16
- <DocumentFragment>
17
- <i
18
- aria-hidden="true"
19
- class="zd_font_icons basic undefined fbold "
20
- data-id="fontIcon"
21
- data-selector-id="fontIcon"
22
- data-test-id="fontIcon"
23
- />
24
- </DocumentFragment>
25
- `;
26
-
27
- exports[`FontIcon - rendering "IconName" 1`] = `
28
- <DocumentFragment>
29
- <i
30
- aria-hidden="true"
31
- class="zd_font_icons basic undefined "
32
- data-id="fontIcon"
33
- data-selector-id="fontIcon"
34
- data-test-id="fontIcon"
35
- />
36
- </DocumentFragment>
37
- `;
38
-
39
- exports[`FontIcon - rendering "Name" with "iconContent" and without path 1`] = `
40
- <DocumentFragment>
41
- <i
42
- aria-hidden="true"
43
- class="zd_font_icons basic undefined "
44
- data-id="fontIcon"
45
- data-selector-id="fontIcon"
46
- data-test-id="fontIcon"
47
- >
48
- <span
49
- class="icon1 "
50
- />
51
- <span
52
- class="icon2 "
53
- />
54
- <span
55
- class="icon3 "
56
- />
57
- </i>
58
- </DocumentFragment>
59
- `;
60
-
61
- exports[`FontIcon - rendering "ariaHidden" is false 1`] = `
62
- <DocumentFragment>
63
- <i
64
- aria-hidden="false"
65
- class="zd_font_icons basic undefined "
66
- data-id="fontIcon"
67
- data-selector-id="fontIcon"
68
- data-test-id="fontIcon"
69
- />
70
- </DocumentFragment>
71
- `;
72
-
73
- exports[`FontIcon - rendering "custumIcon" with path 1`] = `
74
- <DocumentFragment>
75
- <i
76
- aria-hidden="true"
77
- class="zd_font_icons basic undefined red"
78
- data-id="fontIcon"
79
- data-selector-id="fontIcon"
80
- data-test-id="fontIcon"
81
- >
82
- <span
83
- class="icon1 path1"
84
- />
85
- <span
86
- class="icon2 path2"
87
- />
88
- </i>
89
- </DocumentFragment>
90
- `;
91
-
92
- exports[`FontIcon - rendering "iconClass" with path 1`] = `
93
- <DocumentFragment>
94
- <i
95
- aria-hidden="true"
96
- class="zd_font_icons basic undefined iconStyleCss "
97
- data-id="fontIcon"
98
- data-selector-id="fontIcon"
99
- data-test-id="fontIcon"
100
- >
101
- <span
102
- class="icon1 path1"
103
- />
104
- <span
105
- class="icon2 path2"
106
- />
107
- <span
108
- class="icon3 path3"
109
- />
110
- </i>
111
- </DocumentFragment>
112
- `;
113
-
114
- exports[`FontIcon - rendering custom attributes with tagAttributes prop 1`] = `
115
- <DocumentFragment>
116
- <i
117
- aria-hidden="true"
118
- class="zd_font_icons basic undefined "
119
- data-custom-attr="true"
120
- data-id="fontIcon"
121
- data-selector-id="fontIcon"
122
- data-test-id="fontIcon"
123
- />
124
- </DocumentFragment>
125
- `;
126
-
127
- exports[`FontIcon - rendering custom icon name 1`] = `
128
- <DocumentFragment>
129
- <i
130
- aria-hidden="true"
131
- class="zd_font_icons basic undefined red"
132
- data-id="fontIcon"
133
- data-selector-id="fontIcon"
134
- data-test-id="fontIcon"
135
- />
136
- </DocumentFragment>
137
- `;
138
-
139
- exports[`FontIcon - rendering the "default" props 1`] = `
140
- <DocumentFragment>
141
- <i
142
- aria-hidden="true"
143
- class="zd_font_icons basic undefined "
144
- data-id="fontIcon"
145
- data-selector-id="fontIcon"
146
- data-test-id="fontIcon"
147
- />
148
- </DocumentFragment>
149
- `;
150
-
151
- exports[`FontIcon - rendering the "fontSize" 1`] = `
152
- <DocumentFragment>
153
- <i
154
- aria-hidden="true"
155
- class="zd_font_icons basic undefined "
156
- data-id="fontIcon"
157
- data-selector-id="fontIcon"
158
- data-test-id="fontIcon"
159
- style="--zd-iconfont-size: var(--zd_font_size15);"
160
- />
161
- </DocumentFragment>
162
- `;
163
-
164
- exports[`FontIcon - rendering the "iconClass" 1`] = `
165
- <DocumentFragment>
166
- <i
167
- aria-hidden="true"
168
- class="zd_font_icons basic undefined iconStyleCss "
169
- data-id="fontIcon"
170
- data-selector-id="fontIcon"
171
- data-test-id="fontIcon"
172
- />
173
- </DocumentFragment>
174
- `;
175
-
176
- exports[`FontIcon - rendering the "pathname" 1`] = `
177
- <DocumentFragment>
178
- <i
179
- aria-hidden="true"
180
- class="zd_font_icons basic zd67f91bb627 "
181
- data-id="fontIcon"
182
- data-selector-id="fontIcon"
183
- data-test-id="fontIcon"
184
- />
185
- </DocumentFragment>
186
- `;
187
-
188
- exports[`FontIcon - rendering the "title" 1`] = `
189
- <DocumentFragment>
190
- <i
191
- aria-hidden="true"
192
- class="zd_font_icons basic undefined "
193
- data-id="fontIcon"
194
- data-selector-id="fontIcon"
195
- data-test-id="fontIcon"
196
- data-title="FontIcon"
197
- />
198
- </DocumentFragment>
199
- `;
200
-
201
- exports[`FontIcon - rendering the "titlePostion" to - bottom 1`] = `
202
- <DocumentFragment>
203
- <i
204
- aria-hidden="true"
205
- class="zd_font_icons basic undefined "
206
- data-id="fontIcon"
207
- data-selector-id="fontIcon"
208
- data-test-id="fontIcon"
209
- data-title-position="bottom"
210
- />
211
- </DocumentFragment>
212
- `;
213
-
214
- exports[`FontIcon - rendering the "titlePostion" to - left 1`] = `
215
- <DocumentFragment>
216
- <i
217
- aria-hidden="true"
218
- class="zd_font_icons basic undefined "
219
- data-id="fontIcon"
220
- data-selector-id="fontIcon"
221
- data-test-id="fontIcon"
222
- data-title-position="left"
223
- />
224
- </DocumentFragment>
225
- `;
226
-
227
- exports[`FontIcon - rendering the "titlePostion" to - right 1`] = `
228
- <DocumentFragment>
229
- <i
230
- aria-hidden="true"
231
- class="zd_font_icons basic undefined "
232
- data-id="fontIcon"
233
- data-selector-id="fontIcon"
234
- data-test-id="fontIcon"
235
- data-title-position="right"
236
- />
237
- </DocumentFragment>
238
- `;
239
-
240
- exports[`FontIcon - rendering the "titlePostion" to - top 1`] = `
241
- <DocumentFragment>
242
- <i
243
- aria-hidden="true"
244
- class="zd_font_icons basic undefined "
245
- data-id="fontIcon"
246
- data-selector-id="fontIcon"
247
- data-test-id="fontIcon"
248
- data-title-position="top"
249
- />
250
- </DocumentFragment>
251
- `;
@@ -1,42 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import React, { useEffect, useState, useRef } from 'react';
4
- export default function asyncComponent(getComponentProps) {
5
- return function AsyncComponent(props) {
6
- const [Component, setComponent] = useState(null);
7
- const mount = useRef(true);
8
- const eleRef = useRef(null);
9
-
10
- const loadComponent = async () => {
11
- try {
12
- const component = await getComponentProps(props);
13
-
14
- if (mount.current) {
15
- setComponent(() => component);
16
- }
17
- } catch (e) {
18
- console.log('errorme', e);
19
- }
20
- };
21
-
22
- useEffect(() => {
23
- mount.current = true;
24
- loadComponent();
25
- return () => {
26
- mount.current = false;
27
- };
28
- }, [props.name]);
29
-
30
- const getRef = ele => {
31
- eleRef.current = ele;
32
- };
33
-
34
- if (Component) {
35
- return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
36
- ref: getRef
37
- }));
38
- }
39
-
40
- return null;
41
- };
42
- }
@@ -1,5 +0,0 @@
1
- export const IconDefaultProps = {
2
- a11y: {},
3
- dataSelectorId: 'fontIcon',
4
- dataId: 'fontIcon'
5
- };
@@ -1,18 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- export const IconProps = {
3
- dataId: PropTypes.string,
4
- iconClass: PropTypes.string,
5
- iconContent: PropTypes.object,
6
- isBold: PropTypes.bool,
7
- name: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
8
- onClick: PropTypes.func,
9
- pathName: PropTypes.string,
10
- size: PropTypes.string,
11
- title: PropTypes.string,
12
- iconName: PropTypes.string,
13
- titlePosition: PropTypes.oneOf(['top', 'bottom', 'left', 'right']),
14
- tagAttributes: PropTypes.object,
15
- a11y: PropTypes.shape({
16
- ariaHidden: PropTypes.bool
17
- })
18
- };
@@ -1,86 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = FontIcon;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _defaultProps = require("./props/defaultProps");
11
-
12
- var _propTypes = require("./props/propTypes");
13
-
14
- var _CustomIcons = require("../Icon/CustomIcons");
15
-
16
- var _IconModule = _interopRequireDefault(require("../Icon/Icon.module.css"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
-
20
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
-
22
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
23
-
24
- function FontIcon(props) {
25
- var name = props.name,
26
- onClick = props.onClick,
27
- isBold = props.isBold,
28
- pathName = props.pathName,
29
- iconContent = props.iconContent,
30
- iconClass = props.iconClass,
31
- title = props.title,
32
- dataId = props.dataId,
33
- dataSelectorId = props.dataSelectorId,
34
- size = props.size,
35
- iconName = props.iconName,
36
- titlePosition = props.titlePosition,
37
- tagAttributes = props.tagAttributes,
38
- a11y = props.a11y;
39
- var _a11y$ariaHidden = a11y.ariaHidden,
40
- ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden;
41
- var fontStyle = size ? {
42
- '--zd-iconfont-size': 'var(--zd_font_size' + size + ')'
43
- } : {};
44
- var isCustom = _CustomIcons.allCustomIcons[iconName] || null;
45
- isCustom = isCustom ? _IconModule["default"][isCustom] : ''; // let isTwoTone = TwoToneIcons[iconName] || null;
46
- // isTwoTone = isTwoTone ? style[isTwoTone] : '';
47
-
48
- var fontClass = "".concat(_IconModule["default"].basic, " ").concat(pathName, " ").concat(isBold ? _IconModule["default"].fbold : '', " ").concat(iconClass ? iconClass : '', " ").concat(onClick ? _IconModule["default"].cursor : '');
49
- var childArray;
50
-
51
- if (_typeof(name) === 'object') {
52
- childArray = [];
53
- var isRtl = name[2] ? name[2] : false;
54
- fontClass = isRtl ? "".concat(fontClass, " ").concat(_IconModule["default"].rtl) : fontClass;
55
-
56
- for (var i = 1; i < name[1] + 1; i++) {
57
- var pathClass = "".concat(iconContent["path".concat(i)], " ").concat(iconClass || isCustom ? "path".concat(i) : '');
58
- childArray.push( /*#__PURE__*/_react["default"].createElement("span", {
59
- className: pathClass,
60
- key: i
61
- }));
62
- }
63
- }
64
-
65
- return /*#__PURE__*/_react["default"].createElement("i", _extends({
66
- className: 'zd_font_icons'.concat(" ", fontClass, " ").concat(isCustom),
67
- "data-title": title,
68
- onClick: onClick,
69
- "data-id": dataId,
70
- "data-test-id": dataId,
71
- "data-title-position": titlePosition,
72
- style: fontStyle,
73
- "aria-hidden": ariaHidden,
74
- "data-selector-id": dataSelectorId
75
- }, tagAttributes), childArray ? childArray : null);
76
- }
77
-
78
- FontIcon.propTypes = _propTypes.IconProps;
79
- FontIcon.defaultProps = _defaultProps.IconDefaultProps;
80
-
81
- if (__DOCS__) {
82
- FontIcon.docs = {
83
- componentGroup: 'Icon',
84
- folderName: 'Style Guide'
85
- };
86
- }
@@ -1,151 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _FontIcon = _interopRequireDefault(require("../FontIcon"));
6
-
7
- var _react2 = require("@testing-library/react");
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
-
11
- describe('FontIcon - ', function () {
12
- test('rendering the "default" props', function () {
13
- var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], null)),
14
- asFragment = _render.asFragment;
15
-
16
- expect(asFragment()).toMatchSnapshot();
17
- });
18
- test('checking "isBold" is true', function () {
19
- var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
20
- isBold: true
21
- })),
22
- asFragment = _render2.asFragment;
23
-
24
- expect(asFragment()).toMatchSnapshot();
25
- });
26
- test('checking "isBold" is false', function () {
27
- var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
28
- isBold: false
29
- })),
30
- asFragment = _render3.asFragment;
31
-
32
- expect(asFragment()).toMatchSnapshot();
33
- });
34
- test('rendering the "iconClass"', function () {
35
- var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
36
- iconClass: "iconStyleCss"
37
- })),
38
- asFragment = _render4.asFragment;
39
-
40
- expect(asFragment()).toMatchSnapshot();
41
- });
42
- test('rendering the "fontSize"', function () {
43
- var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
44
- size: "15"
45
- })),
46
- asFragment = _render5.asFragment;
47
-
48
- expect(asFragment()).toMatchSnapshot();
49
- });
50
- test('rendering the "title"', function () {
51
- var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
52
- title: "FontIcon"
53
- })),
54
- asFragment = _render6.asFragment;
55
-
56
- expect(asFragment()).toMatchSnapshot();
57
- });
58
- test('rendering the "pathname"', function () {
59
- var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
60
- pathName: "zd67f91bb627"
61
- })),
62
- asFragment = _render7.asFragment;
63
-
64
- expect(asFragment()).toMatchSnapshot();
65
- });
66
- test('rendering "Name" with "iconContent" and without path', function () {
67
- var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
68
- name: ['icon-addAccounts', 3],
69
- iconContent: {
70
- path1: "icon1",
71
- path2: "icon2",
72
- path3: "icon3"
73
- }
74
- })),
75
- asFragment = _render8.asFragment;
76
-
77
- expect(asFragment()).toMatchSnapshot();
78
- });
79
- test('rendering "iconClass" with path ', function () {
80
- var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
81
- iconClass: "iconStyleCss",
82
- name: ['icon-addAccounts', 3],
83
- iconContent: {
84
- path1: "icon1",
85
- path2: "icon2",
86
- path3: "icon3"
87
- }
88
- })),
89
- asFragment = _render9.asFragment;
90
-
91
- expect(asFragment()).toMatchSnapshot();
92
- });
93
- test('rendering "custumIcon" with path', function () {
94
- var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
95
- name: ['icon-ch-chat-in', 2],
96
- iconName: "ZD-chChatMis",
97
- iconContent: {
98
- path1: "icon1",
99
- path2: "icon2"
100
- }
101
- })),
102
- asFragment = _render10.asFragment;
103
-
104
- expect(asFragment()).toMatchSnapshot();
105
- });
106
- test('rendering "ariaHidden" is false', function () {
107
- var _render11 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
108
- a11y: {
109
- ariaHidden: false
110
- }
111
- })),
112
- asFragment = _render11.asFragment;
113
-
114
- expect(asFragment()).toMatchSnapshot();
115
- });
116
- test('rendering "IconName"', function () {
117
- var _render12 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
118
- iconName: "ZD-addAccount"
119
- })),
120
- asFragment = _render12.asFragment;
121
-
122
- expect(asFragment()).toMatchSnapshot();
123
- });
124
- test('rendering custom icon name', function () {
125
- var _render13 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
126
- iconName: "ZD-chChatMis"
127
- })),
128
- asFragment = _render13.asFragment;
129
-
130
- expect(asFragment()).toMatchSnapshot();
131
- });
132
- var titlePosition = ['top', 'bottom', 'left', 'right'];
133
- test.each(titlePosition)('rendering the "titlePostion" to - %s', function (titlePosition) {
134
- var _render14 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
135
- titlePosition: titlePosition
136
- })),
137
- asFragment = _render14.asFragment;
138
-
139
- expect(asFragment()).toMatchSnapshot();
140
- });
141
- test('rendering custom attributes with tagAttributes prop', function () {
142
- var _render15 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_FontIcon["default"], {
143
- tagAttributes: {
144
- 'data-custom-attr': 'true'
145
- }
146
- })),
147
- asFragment = _render15.asFragment;
148
-
149
- expect(asFragment()).toMatchSnapshot();
150
- });
151
- });