@zohodesk/components 1.2.18 → 1.2.19
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/.cli/AppearanceThemeValidationExcludeFiles.js +1 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +6 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +3 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +3 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +3 -0
- package/es/Avatar/Avatar.module.css +12 -0
- package/es/AvatarTeam/AvatarTeam.module.css +2 -0
- package/es/Button/css/Button.module.css +9 -1
- package/es/Buttongroup/Buttongroup.module.css +2 -0
- package/es/CheckBox/CheckBox.module.css +2 -0
- package/es/DateTime/DateTime.module.css +1 -0
- package/es/DateTime/dateFormatUtils/dateFormat.js +6 -1
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +7 -0
- package/es/DropBox/css/DropBox.module.css +1 -0
- package/es/DropDown/DropDownHeading.module.css +6 -0
- package/es/DropDown/DropDownItem.module.css +3 -0
- package/es/Label/Label.module.css +1 -0
- package/es/ListItem/ListItem.module.css +21 -0
- package/es/PopOver/PopOver.module.css +1 -0
- package/es/Radio/Radio.module.css +1 -0
- package/es/Ribbon/Ribbon.module.css +4 -0
- package/es/Switch/Switch.module.css +2 -0
- package/es/Tag/Tag.module.css +6 -0
- package/es/TextBox/TextBox.module.css +20 -0
- package/es/TextBoxIcon/TextBoxIcon.module.css +5 -0
- package/es/Textarea/Textarea.module.css +6 -0
- package/es/Tooltip/Tooltip.module.css +4 -0
- package/es/common/customscroll.module.css +37 -0
- package/es/v1/Modal/Modal.js +86 -114
- package/es/v1/Typography/css/Typography.module.css +83 -112
- package/es/v1/Typography/css/cssJSLogic.js +6 -2
- package/es/v1/Typography/props/propTypes.js +2 -2
- package/es/v1/Typography/utils/index.js +50 -0
- package/lib/Avatar/Avatar.module.css +12 -0
- package/lib/AvatarTeam/AvatarTeam.module.css +2 -0
- package/lib/Button/css/Button.module.css +9 -1
- package/lib/Buttongroup/Buttongroup.module.css +2 -0
- package/lib/CheckBox/CheckBox.module.css +2 -0
- package/lib/DateTime/DateTime.module.css +1 -0
- package/lib/DateTime/dateFormatUtils/dateFormat.js +6 -1
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +7 -0
- package/lib/DropBox/css/DropBox.module.css +1 -0
- package/lib/DropDown/DropDownHeading.module.css +6 -0
- package/lib/DropDown/DropDownItem.module.css +3 -0
- package/lib/Label/Label.module.css +1 -0
- package/lib/ListItem/ListItem.module.css +21 -0
- package/lib/PopOver/PopOver.module.css +1 -0
- package/lib/Radio/Radio.module.css +1 -0
- package/lib/Ribbon/Ribbon.module.css +4 -0
- package/lib/Switch/Switch.module.css +2 -0
- package/lib/Tag/Tag.module.css +6 -0
- package/lib/TextBox/TextBox.module.css +20 -0
- package/lib/TextBoxIcon/TextBoxIcon.module.css +5 -0
- package/lib/Textarea/Textarea.module.css +6 -0
- package/lib/Tooltip/Tooltip.module.css +4 -0
- package/lib/common/customscroll.module.css +37 -0
- package/lib/v1/Modal/Modal.js +118 -164
- package/lib/v1/Typography/css/Typography.module.css +83 -112
- package/lib/v1/Typography/css/cssJSLogic.js +7 -3
- package/lib/v1/Typography/props/propTypes.js +2 -2
- package/lib/v1/Typography/utils/index.js +59 -0
- package/package.json +8 -6
- package/result.json +1 -1
- package/es/v1/Typography/css/letterSpacingMap.js +0 -12
- package/lib/v1/Typography/css/letterSpacingMap.js +0 -20
package/es/v1/Modal/Modal.js
CHANGED
|
@@ -1,154 +1,126 @@
|
|
|
1
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
2
|
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
3
|
+
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
5
4
|
import ReactDOM from 'react-dom';
|
|
5
|
+
import useEffectCallOnlyAfterState from '@zohodesk/hooks/es/utils/useEffectCallOnlyAfterState';
|
|
6
6
|
import { defaultProps } from '../../Modal/props/defaultProps';
|
|
7
7
|
import { propTypes } from '../../Modal/props/propTypes';
|
|
8
8
|
import style from '../../AppContainer/AppContainer.module.css';
|
|
9
9
|
let createdPortalIds = [];
|
|
10
10
|
let newPortalPrefix = 'CPortal';
|
|
11
11
|
let portalChildrenTopIndexValues;
|
|
12
|
-
export default
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
export default function Modal(props) {
|
|
13
|
+
let {
|
|
14
|
+
children,
|
|
15
|
+
isActive,
|
|
16
|
+
autoZIndexNeeded,
|
|
17
|
+
portalId: propPortalId
|
|
18
|
+
} = props;
|
|
19
|
+
const [isMounted, setMounted] = useState(false);
|
|
20
|
+
const portalId = useRef(propPortalId);
|
|
21
|
+
const ref = useRef(null);
|
|
22
|
+
const isZIndexAppendNeeded = useRef();
|
|
23
|
+
const zIndex = useRef();
|
|
24
|
+
const modalRoot = useRef();
|
|
25
|
+
const newModalRoot = useRef();
|
|
26
|
+
const containerDiv = useRef();
|
|
27
|
+
const portalDiv = useRef(); // document.createDocumentFragment()
|
|
28
|
+
|
|
29
|
+
const isCustomPortalId = useRef();
|
|
30
|
+
const setRef = useCallback(ele => {
|
|
31
|
+
ref.current = ele;
|
|
32
|
+
|
|
33
|
+
if (isZIndexAppendNeeded.current) {
|
|
34
|
+
ref.current.style.zIndex = zIndex.current;
|
|
35
|
+
isZIndexAppendNeeded.current = false;
|
|
33
36
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
getPortalDiv() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
function getPortalDiv() {
|
|
40
|
+
modalRoot.current = propPortalId ? document.querySelector(`[data-portal=${propPortalId}]`) : "";
|
|
41
|
+
|
|
42
|
+
if (!modalRoot.current) {
|
|
43
|
+
portalId.current = handleAddPortalId();
|
|
44
|
+
newModalRoot.current = document.createElement('div');
|
|
45
|
+
newModalRoot.current.className = style.container;
|
|
46
|
+
newModalRoot.current.setAttribute('data-portal', portalId.current);
|
|
47
|
+
containerDiv.current && containerDiv.current.appendChild(newModalRoot.current);
|
|
48
|
+
modalRoot.current = newModalRoot.current;
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
return
|
|
51
|
+
return modalRoot.current;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.handleInsertPortalDiv();
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
containerDiv.current = document.getElementsByTagName("desk")[0] ? document.getElementsByTagName('desk')[0] : document.getElementsByTagName('body')[0];
|
|
56
|
+
portalDiv.current = getPortalDiv();
|
|
57
|
+
setMounted(true);
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
handleInsertPortalDiv();
|
|
58
60
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.handleRemovePortalId();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
|
|
69
|
-
portalChildrenTopIndexValues -= 1;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
61
|
+
return () => {
|
|
62
|
+
// modalRoot.current && modalRoot.current.removeChild(portalDiv.current);
|
|
63
|
+
if (newModalRoot.current) {
|
|
64
|
+
containerDiv.current && containerDiv.current.removeChild(newModalRoot.current);
|
|
65
|
+
handleRemovePortalId();
|
|
66
|
+
}
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
if (prevProps.isActive != this.props.isActive) {
|
|
75
|
-
if (this.props.isActive) {
|
|
76
|
-
this.handleInsertPortalDiv();
|
|
77
|
-
} else if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
|
|
68
|
+
if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
|
|
78
69
|
portalChildrenTopIndexValues -= 1;
|
|
79
70
|
}
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
useEffectCallOnlyAfterState(() => {
|
|
74
|
+
if (isActive) {
|
|
75
|
+
handleInsertPortalDiv();
|
|
76
|
+
} else if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
|
|
77
|
+
portalChildrenTopIndexValues -= 1;
|
|
80
78
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
handleInsertPortalDiv() {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (isActive) {
|
|
94
|
-
let newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
|
|
95
|
-
portalChildrenTopIndexValues = newHighValue;
|
|
96
|
-
this.zIndex = newHighValue;
|
|
97
|
-
|
|
98
|
-
if (this.ref) {
|
|
99
|
-
this.ref.style.zIndex = newHighValue;
|
|
100
|
-
} else {
|
|
101
|
-
this.isZIndexAppendNeeded = true;
|
|
102
|
-
}
|
|
79
|
+
}, [isActive]);
|
|
80
|
+
|
|
81
|
+
function handleInsertPortalDiv() {
|
|
82
|
+
if (autoZIndexNeeded && isActive) {
|
|
83
|
+
let newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
|
|
84
|
+
portalChildrenTopIndexValues = newHighValue;
|
|
85
|
+
zIndex.current = newHighValue;
|
|
86
|
+
|
|
87
|
+
if (ref.current) {
|
|
88
|
+
ref.current.style.zIndex = newHighValue;
|
|
89
|
+
} else {
|
|
90
|
+
isZIndexAppendNeeded.current = true;
|
|
103
91
|
}
|
|
104
92
|
}
|
|
105
93
|
}
|
|
106
94
|
|
|
107
|
-
handleAddPortalId() {
|
|
95
|
+
function handleAddPortalId() {
|
|
108
96
|
let createdPortalIdsLen = createdPortalIds.length;
|
|
109
97
|
let newPortalId = createdPortalIdsLen ? createdPortalIds[createdPortalIdsLen - 1] + 1 : 1;
|
|
110
98
|
createdPortalIds.push(newPortalId);
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
portalId.current = newPortalId;
|
|
100
|
+
isCustomPortalId.current = true;
|
|
113
101
|
return `${newPortalPrefix}${newPortalId}`;
|
|
114
102
|
}
|
|
115
103
|
|
|
116
|
-
handleRemovePortalId() {
|
|
117
|
-
if (
|
|
118
|
-
createdPortalIds = createdPortalIds.filter(id => id !==
|
|
104
|
+
function handleRemovePortalId() {
|
|
105
|
+
if (isCustomPortalId.current) {
|
|
106
|
+
createdPortalIds = createdPortalIds.filter(id => id !== portalId.current);
|
|
119
107
|
}
|
|
120
108
|
}
|
|
121
109
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
children
|
|
125
|
-
} = this.props,
|
|
126
|
-
{
|
|
127
|
-
isMounted
|
|
128
|
-
} = this.state;
|
|
129
|
-
let Element = children.type,
|
|
130
|
-
elementProps = children.props;
|
|
131
|
-
|
|
132
|
-
if (isMounted) {
|
|
133
|
-
if (Element) {
|
|
134
|
-
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Element, _extends({
|
|
135
|
-
ref: this.setRef
|
|
136
|
-
}, elementProps)), this.portalDiv);
|
|
137
|
-
}
|
|
110
|
+
let Element = children.type,
|
|
111
|
+
elementProps = children.props;
|
|
138
112
|
|
|
139
|
-
|
|
113
|
+
if (isMounted) {
|
|
114
|
+
if (Element) {
|
|
115
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Element, _extends({
|
|
116
|
+
ref: setRef
|
|
117
|
+
}, elementProps)), portalDiv.current);
|
|
140
118
|
}
|
|
141
119
|
|
|
142
120
|
return null;
|
|
143
121
|
}
|
|
144
122
|
|
|
123
|
+
return null;
|
|
145
124
|
}
|
|
146
125
|
Modal.defaultProps = defaultProps;
|
|
147
|
-
Modal.propTypes = propTypes;
|
|
148
|
-
// Modal.docs = {
|
|
149
|
-
// componentGroup: 'Atom',
|
|
150
|
-
// folderName: 'Style Guide',
|
|
151
|
-
// external: false,
|
|
152
|
-
// description: ' '
|
|
153
|
-
// };
|
|
154
|
-
// }
|
|
126
|
+
Modal.propTypes = propTypes;
|
|
@@ -238,130 +238,77 @@
|
|
|
238
238
|
.lineheight_inherit{
|
|
239
239
|
line-height: inherit;
|
|
240
240
|
}
|
|
241
|
-
.
|
|
242
|
-
line-height:
|
|
243
|
-
}
|
|
244
|
-
.lineheight_1{
|
|
245
|
-
line-height: 1;
|
|
246
|
-
}
|
|
247
|
-
.lineheight_8{
|
|
248
|
-
line-height: 8px;
|
|
249
|
-
}
|
|
250
|
-
.lineheight_10{
|
|
251
|
-
line-height: 10px;
|
|
252
|
-
}
|
|
253
|
-
.lineheight_11{
|
|
254
|
-
line-height: 11px;
|
|
255
|
-
}
|
|
256
|
-
.lineheight_12{
|
|
257
|
-
line-height: 12px;
|
|
258
|
-
}
|
|
259
|
-
.lineheight_13{
|
|
260
|
-
line-height: 13px;
|
|
261
|
-
}
|
|
262
|
-
.lineheight_14{
|
|
263
|
-
line-height: 14px;
|
|
264
|
-
}
|
|
265
|
-
.lineheight_15{
|
|
266
|
-
line-height: 15px;
|
|
267
|
-
}
|
|
268
|
-
.lineheight_16{
|
|
269
|
-
line-height: 16px;
|
|
270
|
-
}
|
|
271
|
-
.lineheight_17{
|
|
272
|
-
line-height: 17px;
|
|
273
|
-
}
|
|
274
|
-
.lineheight_18{
|
|
275
|
-
line-height: 18px;
|
|
276
|
-
}
|
|
277
|
-
.lineheight_19{
|
|
278
|
-
line-height: 19px;
|
|
279
|
-
}
|
|
280
|
-
.lineheight_20{
|
|
281
|
-
line-height: 20px;
|
|
282
|
-
}
|
|
283
|
-
.lineheight_21{
|
|
284
|
-
line-height: 21px;
|
|
285
|
-
}
|
|
286
|
-
.lineheight_22{
|
|
287
|
-
line-height: 22px;
|
|
241
|
+
.lineheight_initial{
|
|
242
|
+
line-height: initial;
|
|
288
243
|
}
|
|
289
|
-
.
|
|
290
|
-
line-height:
|
|
244
|
+
.lineheight_normal{
|
|
245
|
+
line-height: normal;
|
|
291
246
|
}
|
|
292
|
-
.
|
|
293
|
-
line-height:
|
|
294
|
-
}
|
|
295
|
-
.lineheight_26{
|
|
296
|
-
line-height: 26px;
|
|
297
|
-
}
|
|
298
|
-
.lineheight_27{
|
|
299
|
-
line-height: 27px;
|
|
300
|
-
}
|
|
301
|
-
.lineheight_28{
|
|
302
|
-
line-height: 28px;
|
|
247
|
+
.lineheight_0{
|
|
248
|
+
line-height: 0;
|
|
303
249
|
}
|
|
304
|
-
.
|
|
305
|
-
line-height:
|
|
250
|
+
.lineheight_0_1{
|
|
251
|
+
line-height: 0.1;
|
|
306
252
|
}
|
|
307
|
-
.
|
|
308
|
-
line-height:
|
|
253
|
+
.lineheight_0_2{
|
|
254
|
+
line-height: 0.2;
|
|
309
255
|
}
|
|
310
|
-
.
|
|
311
|
-
line-height:
|
|
256
|
+
.lineheight_0_3{
|
|
257
|
+
line-height: 0.3;
|
|
312
258
|
}
|
|
313
|
-
.
|
|
314
|
-
line-height:
|
|
259
|
+
.lineheight_0_4{
|
|
260
|
+
line-height: 0.4;
|
|
315
261
|
}
|
|
316
|
-
.
|
|
317
|
-
line-height:
|
|
262
|
+
.lineheight_0_5{
|
|
263
|
+
line-height: 0.5;
|
|
318
264
|
}
|
|
319
|
-
.
|
|
320
|
-
line-height:
|
|
265
|
+
.lineheight_0_6{
|
|
266
|
+
line-height: 0.6;
|
|
321
267
|
}
|
|
322
|
-
.
|
|
323
|
-
line-height:
|
|
268
|
+
.lineheight_0_7{
|
|
269
|
+
line-height: 0.7;
|
|
324
270
|
}
|
|
325
|
-
.
|
|
326
|
-
line-height:
|
|
271
|
+
.lineheight_0_8{
|
|
272
|
+
line-height: 0.8;
|
|
327
273
|
}
|
|
328
|
-
.
|
|
329
|
-
line-height:
|
|
274
|
+
.lineheight_0_9{
|
|
275
|
+
line-height: 0.9;
|
|
330
276
|
}
|
|
331
|
-
.
|
|
332
|
-
line-height:
|
|
277
|
+
.lineheight_1{
|
|
278
|
+
line-height: 1;
|
|
333
279
|
}
|
|
334
|
-
.
|
|
335
|
-
line-height:
|
|
280
|
+
.lineheight_1_1{
|
|
281
|
+
line-height: 1.1;
|
|
336
282
|
}
|
|
337
|
-
.
|
|
338
|
-
line-height:
|
|
283
|
+
.lineheight_1_2{
|
|
284
|
+
line-height: 1.2;
|
|
339
285
|
}
|
|
340
|
-
.
|
|
341
|
-
line-height:
|
|
286
|
+
.lineheight_1_3{
|
|
287
|
+
line-height: 1.3;
|
|
342
288
|
}
|
|
343
|
-
.
|
|
344
|
-
line-height:
|
|
289
|
+
.lineheight_1_4{
|
|
290
|
+
line-height: 1.4;
|
|
345
291
|
}
|
|
346
|
-
.
|
|
347
|
-
line-height:
|
|
292
|
+
.lineheight_1_5{
|
|
293
|
+
line-height: 1.5;
|
|
348
294
|
}
|
|
349
|
-
.
|
|
350
|
-
line-height:
|
|
295
|
+
.lineheight_1_6{
|
|
296
|
+
line-height: 1.6;
|
|
351
297
|
}
|
|
352
|
-
.
|
|
353
|
-
line-height:
|
|
298
|
+
.lineheight_1_7{
|
|
299
|
+
line-height: 1.7;
|
|
354
300
|
}
|
|
355
|
-
.
|
|
356
|
-
line-height:
|
|
301
|
+
.lineheight_1_8{
|
|
302
|
+
line-height: 1.8;
|
|
357
303
|
}
|
|
358
|
-
.
|
|
359
|
-
line-height:
|
|
304
|
+
.lineheight_1_9{
|
|
305
|
+
line-height: 1.9;
|
|
360
306
|
}
|
|
361
|
-
.
|
|
362
|
-
line-height:
|
|
307
|
+
.lineheight_2{
|
|
308
|
+
line-height: 2;
|
|
363
309
|
}
|
|
364
310
|
|
|
311
|
+
|
|
365
312
|
/*............... Lineheight End.........*/
|
|
366
313
|
|
|
367
314
|
/*............... Letterspacing Start.........*/
|
|
@@ -369,41 +316,65 @@
|
|
|
369
316
|
.letterspacing_inherit{
|
|
370
317
|
letter-spacing:inherit;
|
|
371
318
|
}
|
|
372
|
-
.
|
|
319
|
+
.letterspacing_0_1{
|
|
373
320
|
letter-spacing: 0.1px;
|
|
374
321
|
}
|
|
375
|
-
.
|
|
322
|
+
.letterspacing_0_2{
|
|
376
323
|
letter-spacing: 0.2px;
|
|
377
324
|
}
|
|
378
|
-
.
|
|
325
|
+
.letterspacing_0_3{
|
|
379
326
|
letter-spacing: 0.3px;
|
|
380
327
|
}
|
|
381
|
-
.
|
|
328
|
+
.letterspacing_0_4{
|
|
382
329
|
letter-spacing: 0.4px;
|
|
383
330
|
}
|
|
384
|
-
.
|
|
331
|
+
.letterspacing_0_5{
|
|
385
332
|
letter-spacing: 0.5px;
|
|
386
333
|
}
|
|
387
|
-
.
|
|
334
|
+
.letterspacing_0_6{
|
|
388
335
|
letter-spacing: 0.6px;
|
|
389
336
|
}
|
|
390
|
-
.
|
|
337
|
+
.letterspacing_0_7{
|
|
391
338
|
letter-spacing: 0.7px;
|
|
392
339
|
}
|
|
393
|
-
.
|
|
340
|
+
.letterspacing_0_8{
|
|
394
341
|
letter-spacing: 0.8px;
|
|
395
342
|
}
|
|
396
|
-
.
|
|
343
|
+
.letterspacing_0_9{
|
|
397
344
|
letter-spacing: 0.9px;
|
|
398
345
|
}
|
|
399
346
|
.letterspacing_1{
|
|
400
347
|
letter-spacing: 1px;
|
|
401
348
|
}
|
|
349
|
+
.letterspacing_1_1{
|
|
350
|
+
letter-spacing: 1.1px;
|
|
351
|
+
}
|
|
352
|
+
.letterspacing_1_2{
|
|
353
|
+
letter-spacing: 1.2px;
|
|
354
|
+
}
|
|
355
|
+
.letterspacing_1_3{
|
|
356
|
+
letter-spacing: 1.3px;
|
|
357
|
+
}
|
|
358
|
+
.letterspacing_1_4{
|
|
359
|
+
letter-spacing: 1.4px;
|
|
360
|
+
}
|
|
361
|
+
.letterspacing_1_5{
|
|
362
|
+
letter-spacing: 1.5px;
|
|
363
|
+
}
|
|
364
|
+
.letterspacing_1_6{
|
|
365
|
+
letter-spacing: 1.6px;
|
|
366
|
+
}
|
|
367
|
+
.letterspacing_1_7{
|
|
368
|
+
letter-spacing: 1.7px;
|
|
369
|
+
}
|
|
370
|
+
.letterspacing_1_8{
|
|
371
|
+
letter-spacing: 1.8px;
|
|
372
|
+
}
|
|
373
|
+
.letterspacing_1_9{
|
|
374
|
+
letter-spacing: 1.9px;
|
|
375
|
+
}
|
|
402
376
|
.letterspacing_2{
|
|
403
377
|
letter-spacing: 2px;
|
|
404
378
|
}
|
|
405
|
-
.letterspacing_4{
|
|
406
|
-
letter-spacing: 4px;
|
|
407
|
-
}
|
|
408
379
|
|
|
409
380
|
/*............... Letterspacing End.........*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compileClassNames } from '@zohodesk/utils';
|
|
2
|
-
import { letterspacingMapping } from '
|
|
2
|
+
import { letterspacingMapping, lineheightMapping } from '../utils';
|
|
3
3
|
export default function cssJSLogic(_ref) {
|
|
4
4
|
let {
|
|
5
5
|
props,
|
|
@@ -24,10 +24,14 @@ export default function cssJSLogic(_ref) {
|
|
|
24
24
|
$ui_whiteSpace
|
|
25
25
|
} = props;
|
|
26
26
|
|
|
27
|
-
if ($ui_letterSpacing
|
|
27
|
+
if ($ui_letterSpacing) {
|
|
28
28
|
$ui_letterSpacing = letterspacingMapping[$ui_letterSpacing];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
if ($ui_lineHeight) {
|
|
32
|
+
$ui_lineHeight = lineheightMapping[$ui_lineHeight];
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
let typographyClass = compileClassNames({
|
|
32
36
|
[style.reset]: $flag_reset,
|
|
33
37
|
[style.dotted]: $flag_dotted,
|
|
@@ -13,8 +13,8 @@ export const propTypes = {
|
|
|
13
13
|
$ui_typeFace: PropTypes.oneOf(['normal', 'italic']),
|
|
14
14
|
$ui_decoration: PropTypes.oneOf(['default', 'underline', 'strike', 'overline']),
|
|
15
15
|
$ui_size: PropTypes.oneOf(['7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '24', '25', '26', '28', '29', '30', '32', '34', '35', '36', '40', '50', 'inherit']),
|
|
16
|
-
$ui_lineHeight: PropTypes.oneOf(['0', '1', '
|
|
17
|
-
$ui_letterSpacing: PropTypes.oneOf(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '2', '4', 'inherit']),
|
|
16
|
+
$ui_lineHeight: PropTypes.oneOf(['0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '2', 'normal', 'initial', 'inherit']),
|
|
17
|
+
$ui_letterSpacing: PropTypes.oneOf(['0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', '1.8', '1.9', '2', 'inherit']),
|
|
18
18
|
$ui_wordBreak: PropTypes.oneOf(['breakAll', 'keepAll', 'breakWord']),
|
|
19
19
|
$ui_wordWrap: PropTypes.oneOf(['normal', 'break']),
|
|
20
20
|
$ui_whiteSpace: PropTypes.oneOf(['normal', 'noWrap', 'pre', 'preLine', 'preWrap']),
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export const letterspacingMapping = {
|
|
3
|
+
'inherit': 'inherit',
|
|
4
|
+
'0.1': '0_1',
|
|
5
|
+
'0.2': '0_2',
|
|
6
|
+
'0.3': '0_3',
|
|
7
|
+
'0.4': '0_4',
|
|
8
|
+
'0.5': '0_5',
|
|
9
|
+
'0.6': '0_6',
|
|
10
|
+
'0.7': '0_7',
|
|
11
|
+
'0.8': '0_8',
|
|
12
|
+
'0.9': '0_9',
|
|
13
|
+
'1': '1',
|
|
14
|
+
'1.1': '1_1',
|
|
15
|
+
'1.2': '1_2',
|
|
16
|
+
'1.3': '1_3',
|
|
17
|
+
'1.4': '1_4',
|
|
18
|
+
'1.5': '1_5',
|
|
19
|
+
'1.6': '1_6',
|
|
20
|
+
'1.7': '1_7',
|
|
21
|
+
'1.8': '1_8',
|
|
22
|
+
'1.9': '1_9',
|
|
23
|
+
'2': '2'
|
|
24
|
+
};
|
|
25
|
+
export const lineheightMapping = {
|
|
26
|
+
'inherit': 'inherit',
|
|
27
|
+
'initial': 'initial',
|
|
28
|
+
'normal': 'normal',
|
|
29
|
+
'0': '0',
|
|
30
|
+
'0.1': '0_1',
|
|
31
|
+
'0.2': '0_2',
|
|
32
|
+
'0.3': '0_3',
|
|
33
|
+
'0.4': '0_4',
|
|
34
|
+
'0.5': '0_5',
|
|
35
|
+
'0.6': '0_6',
|
|
36
|
+
'0.7': '0_7',
|
|
37
|
+
'0.8': '0_8',
|
|
38
|
+
'0.9': '0_9',
|
|
39
|
+
'1': '1',
|
|
40
|
+
'1.1': '1_1',
|
|
41
|
+
'1.2': '1_2',
|
|
42
|
+
'1.3': '1_3',
|
|
43
|
+
'1.4': '1_4',
|
|
44
|
+
'1.5': '1_5',
|
|
45
|
+
'1.6': '1_6',
|
|
46
|
+
'1.7': '1_7',
|
|
47
|
+
'1.8': '1_8',
|
|
48
|
+
'1.9': '1_9',
|
|
49
|
+
'2': '2'
|
|
50
|
+
};
|
|
@@ -18,19 +18,31 @@
|
|
|
18
18
|
composes: dInflex alignVertical alignHorizontal from '../common/common.module.css';
|
|
19
19
|
vertical-align: middle;
|
|
20
20
|
font-size: var(--avatar_font_size);
|
|
21
|
+
/* css:theme-validation:ignore */
|
|
21
22
|
color: var(--avatar_text_color);
|
|
22
23
|
border-width: var(--avatar_border_width);
|
|
23
24
|
border-style: var(--avatar_border_style);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
.border {
|
|
28
|
+
/* css:theme-validation:ignore */
|
|
27
29
|
border-color: var(--avatar_border_color);
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
.borderOnHover:hover,
|
|
33
|
+
.borderOnActive {
|
|
34
|
+
/* css:theme-validation:ignore */
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
.borderOnHover:hover, .borderOnActive {
|
|
31
38
|
border-color: var(--avatar_border_hoverColor);
|
|
32
39
|
}
|
|
33
40
|
|
|
41
|
+
.avatar,
|
|
42
|
+
.primary {
|
|
43
|
+
/* css:theme-validation:ignore */
|
|
44
|
+
}
|
|
45
|
+
|
|
34
46
|
.avatar, .primary {
|
|
35
47
|
background-color: var(--avatar_bg_color);
|
|
36
48
|
}
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
composes: varClass;
|
|
26
26
|
composes: posab from '../common/common.module.css';
|
|
27
27
|
top: var(--avatarteam_top_top);
|
|
28
|
+
/* css:theme-validation:ignore */
|
|
29
|
+
/* css:theme-validation:ignore */
|
|
28
30
|
width: var(--avatarteam_width);
|
|
29
31
|
height: var(--avatarteam_height);
|
|
30
32
|
outline-width: var(--avatarteam_outline_width);
|
|
@@ -48,10 +48,13 @@
|
|
|
48
48
|
composes: dotted from '../../common/common.module.css';
|
|
49
49
|
position: relative;
|
|
50
50
|
font-size: var(--button_font_size);
|
|
51
|
+
/* css:theme-validation:ignore */
|
|
51
52
|
color: var(--button_text_color);
|
|
52
53
|
font-family: var(--button_font_family);
|
|
53
54
|
text-transform: var(--button_text_transform);
|
|
55
|
+
/* css:theme-validation:ignore */
|
|
54
56
|
min-width: var(--button_min_width);
|
|
57
|
+
/* css:theme-validation:ignore */
|
|
55
58
|
height: var(--button_height);
|
|
56
59
|
background-color: var(--button_bg_color);
|
|
57
60
|
border-radius: var(--button_border_radius);
|
|
@@ -295,6 +298,7 @@
|
|
|
295
298
|
.loadingelement:after {
|
|
296
299
|
content: '';
|
|
297
300
|
position: absolute;
|
|
301
|
+
/* css:theme-validation:ignore */
|
|
298
302
|
}
|
|
299
303
|
|
|
300
304
|
.loadingelement:before, .loadingelement:after {
|
|
@@ -468,6 +472,7 @@
|
|
|
468
472
|
transform-origin: center;
|
|
469
473
|
border-width: 2px 2px 0 0;
|
|
470
474
|
border-style: solid;
|
|
475
|
+
/* css:theme-validation:ignore */
|
|
471
476
|
border-color: var(--button_success_border_color);
|
|
472
477
|
animation: tick var(--zd_no_transition3) ease 0s forwards;
|
|
473
478
|
}
|
|
@@ -523,4 +528,7 @@
|
|
|
523
528
|
}
|
|
524
529
|
}
|
|
525
530
|
|
|
526
|
-
.loader{
|
|
531
|
+
.loader{
|
|
532
|
+
/* css:theme-validation:ignore */
|
|
533
|
+
color:var(--dot_mirror)
|
|
534
|
+
}
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
.buttonGroup {
|
|
12
12
|
composes: varClass;
|
|
13
13
|
composes: cboth from '../common/common.module.css';
|
|
14
|
+
/* css:theme-validation:ignore */
|
|
15
|
+
/* css:theme-validation:ignore */
|
|
14
16
|
background-color: var(--buttongroup_bg_color);
|
|
15
17
|
box-shadow: var(--buttongroup_box_shadow);
|
|
16
18
|
padding: var(--buttongroup_padding);
|