@zohodesk/icons 1.0.0-temp-101 → 1.0.0-temp-111
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.
- package/README.md +128 -0
- package/assets_final/fonts/zd-gcFonts.svg +87 -6
- package/assets_final/fonts/zd-gcFonts.woff +0 -0
- package/assets_final/fonts/zd-gcFonts.woff2 +0 -0
- package/assets_final/fonts/zd-rAI.svg +19 -0
- package/assets_final/fonts/zd-rAI.woff +0 -0
- package/assets_final/fonts/zd-rAI.woff2 +0 -0
- package/assets_final/fonts/zd-rAutomation.svg +16 -0
- package/assets_final/fonts/zd-rAutomation.woff +0 -0
- package/assets_final/fonts/zd-rAutomation.woff2 +0 -0
- package/assets_final/fonts/zd-rDeveloperSpace.svg +11 -0
- package/assets_final/fonts/zd-rDeveloperSpace.woff +0 -0
- package/assets_final/fonts/zd-rDeveloperSpace.woff2 +0 -0
- package/assets_final/fonts/zd-rExportFiles.svg +7 -0
- package/assets_final/fonts/zd-rExportFiles.woff +0 -0
- package/assets_final/fonts/zd-rExportFiles.woff2 +0 -0
- package/assets_final/fonts/zd-rGeneral.svg +15 -0
- package/assets_final/fonts/zd-rGeneral.woff +0 -0
- package/assets_final/fonts/zd-rGeneral.woff2 +0 -0
- package/assets_final/fonts/zd-rReports.svg +1 -0
- package/assets_final/fonts/zd-rReports.woff +0 -0
- package/assets_final/fonts/zd-rReports.woff2 +0 -0
- package/assets_final/fonts/zd-rTwotone.svg +32 -0
- package/assets_final/fonts/zd-rTwotone.woff +0 -0
- package/assets_final/fonts/zd-rTwotone.woff2 +0 -0
- package/assets_final/fonts/zd-rUpdates.svg +13 -0
- package/assets_final/fonts/zd-rUpdates.woff +0 -0
- package/assets_final/fonts/zd-rUpdates.woff2 +0 -0
- package/assets_final/react/zd-font-rAI.module.css +48 -0
- package/assets_final/react/zd-font-rAccessibility.module.css +5 -1
- package/assets_final/react/zd-font-rAutomation.module.css +42 -0
- package/assets_final/react/zd-font-rCallBar.module.css +5 -1
- package/assets_final/react/zd-font-rChannels.module.css +5 -1
- package/assets_final/react/zd-font-rCustomize.module.css +5 -1
- package/assets_final/react/zd-font-rDeveloperSpace.module.css +24 -0
- package/assets_final/react/zd-font-rExportFiles.module.css +42 -4
- package/assets_final/react/zd-font-rGeneral.module.css +56 -4
- package/assets_final/react/zd-font-rIntegrations.module.css +5 -1
- package/assets_final/react/zd-font-rLhs.module.css +5 -1
- package/assets_final/react/zd-font-rMarketplace.module.css +5 -1
- package/assets_final/react/zd-font-rReports.module.css +11 -4
- package/assets_final/react/zd-font-rSetup.module.css +5 -1
- package/assets_final/react/zd-font-rTickets.module.css +5 -1
- package/assets_final/react/zd-font-rTopband.module.css +7 -3
- package/assets_final/react/zd-font-rTwotone.module.css +156 -4
- package/assets_final/react/zd-font-rUpdates.module.css +30 -0
- package/assets_final/react/zd-font-react-addforms.module.css +5 -1
- package/assets_final/react/zd-font-react-automate.module.css +5 -2
- package/assets_final/react/zd-font-react-channels.module.css +5 -1
- package/assets_final/react/zd-font-react-channels.plain.css +5 -1
- package/assets_final/react/zd-font-react-common.module.css +5 -1
- package/assets_final/react/zd-font-react-common.plain.css +5 -1
- package/assets_final/react/zd-font-react-community.module.css +5 -1
- package/assets_final/react/zd-font-react-customers.module.css +5 -1
- package/assets_final/react/zd-font-react-customize.module.css +5 -1
- package/assets_final/react/zd-font-react-gamescope.module.css +5 -1
- package/assets_final/react/zd-font-react-gcFonts.module.css +281 -4
- package/assets_final/react/zd-font-react-gettingstarted.module.css +5 -1
- package/assets_final/react/zd-font-react-integrations.module.css +5 -1
- package/assets_final/react/zd-font-react-kb.module.css +5 -1
- package/assets_final/react/zd-font-react-logo.module.css +5 -1
- package/assets_final/react/zd-font-react-organization.module.css +5 -1
- package/assets_final/react/zd-font-react-organization.plain.css +5 -1
- package/assets_final/react/zd-font-react-others.module.css +5 -1
- package/assets_final/react/zd-font-react-reports.module.css +5 -1
- package/assets_final/react/zd-font-react-setup.module.css +5 -1
- package/assets_final/react/zd-font-react-setup.plain.css +5 -1
- package/assets_final/react/zd-font-react-social.module.css +5 -1
- package/assets_final/react/zd-font-react-ticket-channels.module.css +5 -1
- package/assets_final/react/zd-font-react-tickets.module.css +5 -1
- package/assets_final/react/zd-font-react-tickets.plain.css +5 -1
- package/assets_final/react/zd-font-react-topband.module.css +5 -1
- package/assets_final/react/zd-font-react-topband.plain.css +5 -1
- package/coverage/Icon/CustomIcons.js.html +5 -5
- package/coverage/Icon/FontIcon.js.html +16 -10
- package/coverage/Icon/Icon.module.css.html +2 -2
- package/coverage/Icon/index.html +1 -1
- package/coverage/Icon/props/defaultProps.js.html +1 -1
- package/coverage/Icon/props/index.html +1 -1
- package/coverage/Icon/props/propTypes.js.html +5 -2
- package/coverage/coverage-final.json +8 -5
- package/coverage/coverage-summary.json +9 -6
- package/coverage/index.html +37 -7
- package/coverage/v1/FontIcon.js.html +298 -0
- package/coverage/v1/index.html +116 -0
- package/coverage/v1/props/defaultProps.js.html +100 -0
- package/coverage/v1/props/index.html +131 -0
- package/coverage/v1/props/propTypes.js.html +142 -0
- package/css_layer_config.json +191 -0
- package/es/Icon/CustomIcons.js +1 -1
- package/es/Icon/FontFactory.js +134 -5
- package/es/Icon/FontIcon.js +7 -5
- package/es/Icon/Icon.module.css +3 -1
- package/es/Icon/__tests__/FontIcon.spec.js +11 -1
- package/es/Icon/__tests__/__snapshots__/FontIcon.spec.js.snap +13 -0
- package/es/Icon/index.js +63 -42
- package/es/Icon/props/propTypes.js +1 -0
- package/es/icon_layer.module.css +1 -0
- package/es/index.js +1 -1
- package/es/v1/FontIcon.js +7 -5
- package/es/v1/__tests__/FontIcon.spec.js +144 -0
- package/es/v1/__tests__/__snapshots__/FontIcon.spec.js.snap +251 -0
- package/es/v1/props/propTypes.js +1 -0
- package/lib/Icon/CustomIcons.js +1 -1
- package/lib/Icon/FontFactory.js +48 -5
- package/lib/Icon/FontIcon.js +5 -2
- package/lib/Icon/Icon.module.css +3 -1
- package/lib/Icon/__tests__/FontIcon.spec.js +10 -0
- package/lib/Icon/__tests__/__snapshots__/FontIcon.spec.js.snap +13 -0
- package/lib/Icon/index.js +59 -37
- package/lib/Icon/props/propTypes.js +1 -0
- package/lib/icon_layer.module.css +1 -0
- package/lib/v1/FontIcon.js +5 -2
- package/lib/v1/__tests__/FontIcon.spec.js +151 -0
- package/lib/v1/__tests__/__snapshots__/FontIcon.spec.js.snap +251 -0
- package/lib/v1/props/propTypes.js +1 -0
- package/package.json +15 -7
- package/react-cli.config.js +12 -8
- package/result.json +1 -1
package/es/Icon/index.js
CHANGED
|
@@ -1,138 +1,153 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import FontIcon from '../v1/FontIcon';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FontFactory } from "./FontFactory";
|
|
3
|
+
import FontIcon from "../v1/FontIcon";
|
|
5
4
|
|
|
6
5
|
function getAddforms() {
|
|
7
|
-
return require(
|
|
6
|
+
return require("../../assets_final/react/zd-font-react-addforms.module.css");
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
function getAutomate() {
|
|
11
|
-
return require(
|
|
10
|
+
return require("../../assets_final/react/zd-font-react-automate.module.css");
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
function getChannels() {
|
|
15
|
-
return require(
|
|
14
|
+
return require("../../assets_final/react/zd-font-react-channels.module.css");
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
function getCommon() {
|
|
19
|
-
return require(
|
|
18
|
+
return require("../../assets_final/react/zd-font-react-common.module.css");
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
function getCommunity() {
|
|
23
|
-
return require(
|
|
22
|
+
return require("../../assets_final/react/zd-font-react-community.module.css");
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
function getCustomers() {
|
|
27
|
-
return require(
|
|
26
|
+
return require("../../assets_final/react/zd-font-react-customers.module.css");
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
function getCustomize() {
|
|
31
|
-
return require(
|
|
30
|
+
return require("../../assets_final/react/zd-font-react-customize.module.css");
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
function getGamescope() {
|
|
35
|
-
return require(
|
|
34
|
+
return require("../../assets_final/react/zd-font-react-gamescope.module.css");
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
function getGettingstarted() {
|
|
39
|
-
return require(
|
|
38
|
+
return require("../../assets_final/react/zd-font-react-gettingstarted.module.css");
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
function getKnowledgeBase() {
|
|
43
|
-
return require(
|
|
42
|
+
return require("../../assets_final/react/zd-font-react-kb.module.css");
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
function getOrganization() {
|
|
47
|
-
return require(
|
|
46
|
+
return require("../../assets_final/react/zd-font-react-organization.module.css");
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
function getOthers() {
|
|
51
|
-
return require(
|
|
50
|
+
return require("../../assets_final/react/zd-font-react-others.module.css");
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
function getReports() {
|
|
55
|
-
return require(
|
|
54
|
+
return require("../../assets_final/react/zd-font-react-reports.module.css");
|
|
56
55
|
}
|
|
57
56
|
|
|
58
57
|
function getSetup() {
|
|
59
|
-
return require(
|
|
58
|
+
return require("../../assets_final/react/zd-font-react-setup.module.css");
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
function getSocial() {
|
|
63
|
-
return require(
|
|
62
|
+
return require("../../assets_final/react/zd-font-react-social.module.css");
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
function getTickets() {
|
|
67
|
-
return require(
|
|
66
|
+
return require("../../assets_final/react/zd-font-react-tickets.module.css");
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
function getTopband() {
|
|
71
|
-
return require(
|
|
70
|
+
return require("../../assets_final/react/zd-font-react-topband.module.css");
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
function getTicketsChannel() {
|
|
75
|
-
return require(
|
|
74
|
+
return require("../../assets_final/react/zd-font-react-ticket-channels.module.css");
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
function getReactCallBar() {
|
|
79
|
-
return require(
|
|
78
|
+
return require("../../assets_final/react/zd-font-rCallBar.module.css");
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
function getReactChannels() {
|
|
83
|
-
return require(
|
|
82
|
+
return require("../../assets_final/react/zd-font-rChannels.module.css");
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
function getReactCutomize() {
|
|
87
|
-
return require(
|
|
86
|
+
return require("../../assets_final/react/zd-font-rCustomize.module.css");
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
function getReactExportFiles() {
|
|
91
|
-
return require(
|
|
90
|
+
return require("../../assets_final/react/zd-font-rExportFiles.module.css");
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
function getReactGeneral() {
|
|
95
|
-
return require(
|
|
94
|
+
return require("../../assets_final/react/zd-font-rGeneral.module.css");
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
function getReactIntegrations() {
|
|
99
|
-
return require(
|
|
98
|
+
return require("../../assets_final/react/zd-font-rIntegrations.module.css");
|
|
100
99
|
}
|
|
101
100
|
|
|
102
101
|
function getReactLhs() {
|
|
103
|
-
return require(
|
|
102
|
+
return require("../../assets_final/react/zd-font-rLhs.module.css");
|
|
104
103
|
}
|
|
105
104
|
|
|
106
105
|
function getReactMarketplace() {
|
|
107
|
-
return require(
|
|
106
|
+
return require("../../assets_final/react/zd-font-rMarketplace.module.css");
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
function getReactReports() {
|
|
111
|
-
return require(
|
|
110
|
+
return require("../../assets_final/react/zd-font-rReports.module.css");
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
function getReactSetup() {
|
|
115
|
-
return require(
|
|
114
|
+
return require("../../assets_final/react/zd-font-rSetup.module.css");
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
function getReactTickets() {
|
|
119
|
-
return require(
|
|
118
|
+
return require("../../assets_final/react/zd-font-rTickets.module.css");
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
function getReactTopband() {
|
|
123
|
-
return require(
|
|
122
|
+
return require("../../assets_final/react/zd-font-rTopband.module.css");
|
|
124
123
|
}
|
|
125
124
|
|
|
126
125
|
function getReactGC() {
|
|
127
|
-
return require(
|
|
126
|
+
return require("../../assets_final/react/zd-font-react-gcFonts.module.css");
|
|
128
127
|
}
|
|
129
128
|
|
|
130
129
|
function getReactTwotone() {
|
|
131
|
-
return require(
|
|
130
|
+
return require("../../assets_final/react/zd-font-rTwotone.module.css");
|
|
132
131
|
}
|
|
133
132
|
|
|
134
133
|
function getReactAccessibility() {
|
|
135
|
-
return require(
|
|
134
|
+
return require("../../assets_final/react/zd-font-rAccessibility.module.css");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function getReactUpdates() {
|
|
138
|
+
return require("../../assets_final/react/zd-font-rUpdates.module.css");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function getReactAI() {
|
|
142
|
+
return require("../../assets_final/react/zd-font-rAI.module.css");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function getReactAutomation() {
|
|
146
|
+
return require("../../assets_final/react/zd-font-rAutomation.module.css");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function getReactDeveloperSpace() {
|
|
150
|
+
return require("../../assets_final/react/zd-font-rDeveloperSpace.module.css");
|
|
136
151
|
}
|
|
137
152
|
|
|
138
153
|
function IconRender(iconName, iconContent, props) {
|
|
@@ -144,7 +159,8 @@ function IconRender(iconName, iconContent, props) {
|
|
|
144
159
|
title,
|
|
145
160
|
dataId,
|
|
146
161
|
size,
|
|
147
|
-
titlePosition
|
|
162
|
+
titlePosition,
|
|
163
|
+
tagAttributes
|
|
148
164
|
} = props;
|
|
149
165
|
const pathName = typeof FontFactory[iconName][name] === 'object' ? FontFactory[iconName][name][0] : FontFactory[iconName][name];
|
|
150
166
|
return /*#__PURE__*/React.createElement(FontIcon, {
|
|
@@ -158,7 +174,8 @@ function IconRender(iconName, iconContent, props) {
|
|
|
158
174
|
dataId: dataId,
|
|
159
175
|
size: size,
|
|
160
176
|
iconName: name,
|
|
161
|
-
titlePosition: titlePosition
|
|
177
|
+
titlePosition: titlePosition,
|
|
178
|
+
tagAttributes: tagAttributes
|
|
162
179
|
});
|
|
163
180
|
}
|
|
164
181
|
|
|
@@ -197,7 +214,11 @@ function getIcon(props) {
|
|
|
197
214
|
ReactTopbandFontIcon: getReactTopband,
|
|
198
215
|
ReactGCFontIcon: getReactGC,
|
|
199
216
|
ReactTwotoneIcon: getReactTwotone,
|
|
200
|
-
ReactAccessibilityIcon: getReactAccessibility
|
|
217
|
+
ReactAccessibilityIcon: getReactAccessibility,
|
|
218
|
+
ReactProductUpdatesIcon: getReactUpdates,
|
|
219
|
+
ReactAIIcon: getReactAI,
|
|
220
|
+
ReactAutomationIcon: getReactAutomation,
|
|
221
|
+
ReactDeveloperSpaceIcon: getReactDeveloperSpace
|
|
201
222
|
};
|
|
202
223
|
const iconNames = Object.keys(FontFactory);
|
|
203
224
|
|
|
@@ -209,10 +230,10 @@ function getIcon(props) {
|
|
|
209
230
|
}
|
|
210
231
|
|
|
211
232
|
if (iconName) {
|
|
212
|
-
|
|
233
|
+
let iconCssModule = filesMap[iconName]();
|
|
213
234
|
let iconContent;
|
|
214
235
|
|
|
215
|
-
if (iconCssModule.
|
|
236
|
+
if (iconCssModule.default && typeof iconCssModule.default != 'string') {
|
|
216
237
|
iconContent = iconCssModule.default;
|
|
217
238
|
} else {
|
|
218
239
|
iconContent = iconCssModule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer dot-icons, dot-icons.base, dot-icons.core;
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Icon } from
|
|
1
|
+
export { default as Icon } from "./Icon";
|
package/es/v1/FontIcon.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IconDefaultProps } from
|
|
3
|
-
import { IconProps } from
|
|
4
|
-
import { allCustomIcons } from
|
|
5
|
-
import style from
|
|
2
|
+
import { IconDefaultProps } from "./props/defaultProps";
|
|
3
|
+
import { IconProps } from "./props/propTypes";
|
|
4
|
+
import { allCustomIcons } from "../Icon/CustomIcons";
|
|
5
|
+
import style from "../Icon/Icon.module.css";
|
|
6
6
|
export default function FontIcon(props) {
|
|
7
7
|
const {
|
|
8
8
|
name,
|
|
@@ -17,6 +17,7 @@ export default function FontIcon(props) {
|
|
|
17
17
|
size,
|
|
18
18
|
iconName,
|
|
19
19
|
titlePosition,
|
|
20
|
+
tagAttributes,
|
|
20
21
|
a11y
|
|
21
22
|
} = props;
|
|
22
23
|
const {
|
|
@@ -55,7 +56,8 @@ export default function FontIcon(props) {
|
|
|
55
56
|
"data-title-position": titlePosition,
|
|
56
57
|
style: fontStyle,
|
|
57
58
|
"aria-hidden": ariaHidden,
|
|
58
|
-
"data-selector-id": dataSelectorId
|
|
59
|
+
"data-selector-id": dataSelectorId,
|
|
60
|
+
...tagAttributes
|
|
59
61
|
}, childArray ? childArray : null);
|
|
60
62
|
}
|
|
61
63
|
FontIcon.propTypes = IconProps;
|
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,251 @@
|
|
|
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
|
+
`;
|
package/es/v1/props/propTypes.js
CHANGED