@zohodesk/components 1.0.0-temp-178 → 1.0.0-temp-180
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/PropLessFiles.html +1 -1
- package/.cli/PropUnificationExcludeFilesArray.js +231 -0
- package/.cli/propValidation_report.html +24 -2
- package/PropValidationExcludeFilesArray.js +1 -0
- 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.js +2 -1
- package/es/Avatar/Avatar.module.css +12 -0
- package/es/AvatarTeam/AvatarTeam.module.css +2 -0
- package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +1 -0
- package/es/Button/css/Button.module.css +9 -1
- package/es/Buttongroup/Buttongroup.module.css +3 -2
- package/es/CheckBox/CheckBox.module.css +2 -0
- package/es/DateTime/DateTime.module.css +3 -2
- package/es/DateTime/YearView.module.css +1 -1
- package/es/DateTime/dateFormatUtils/dateFormat.js +6 -1
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +8 -4
- 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 +2 -1
- package/es/ListItem/ListContainer.js +1 -1
- package/es/ListItem/ListItem.module.css +28 -18
- package/es/MultiSelect/Suggestions.js +2 -1
- package/es/PopOver/PopOver.module.css +1 -0
- package/es/Radio/Radio.module.css +1 -0
- package/es/Ribbon/Ribbon.module.css +9 -6
- package/es/Select/Select.js +3 -2
- package/es/Switch/Switch.js +2 -2
- package/es/Switch/Switch.module.css +2 -0
- package/es/Switch/__tests__/__snapshots__/Switch.spec.js.snap +22 -22
- package/es/Tab/Tab.module.css +3 -3
- package/es/Tag/Tag.module.css +8 -3
- package/es/TextBox/TextBox.module.css +25 -5
- package/es/TextBoxIcon/TextBoxIcon.module.css +5 -0
- package/es/Textarea/Textarea.module.css +9 -3
- package/es/Tooltip/Tooltip.module.css +5 -1
- package/es/common/common.module.css +2 -2
- package/es/common/customscroll.module.css +37 -0
- package/es/v1/Avatar/Avatar.js +2 -1
- package/es/v1/ListItem/ListContainer.js +1 -1
- package/es/v1/Modal/Modal.js +86 -114
- package/es/v1/MultiSelect/Suggestions.js +2 -1
- package/es/v1/Select/Select.js +3 -2
- package/es/v1/Switch/Switch.js +2 -2
- 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.js +2 -1
- package/lib/Avatar/Avatar.module.css +12 -0
- package/lib/AvatarTeam/AvatarTeam.module.css +2 -0
- package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +1 -0
- package/lib/Button/css/Button.module.css +9 -1
- package/lib/Buttongroup/Buttongroup.module.css +3 -2
- package/lib/CheckBox/CheckBox.module.css +2 -0
- package/lib/DateTime/DateTime.module.css +3 -2
- package/lib/DateTime/YearView.module.css +1 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +6 -1
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +8 -4
- 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 +2 -1
- package/lib/ListItem/ListContainer.js +1 -1
- package/lib/ListItem/ListItem.module.css +28 -18
- package/lib/MultiSelect/Suggestions.js +2 -1
- package/lib/PopOver/PopOver.module.css +1 -0
- package/lib/Radio/Radio.module.css +1 -0
- package/lib/Ribbon/Ribbon.module.css +9 -6
- package/lib/Select/Select.js +3 -2
- package/lib/Switch/Switch.js +2 -2
- package/lib/Switch/Switch.module.css +2 -0
- package/lib/Switch/__tests__/__snapshots__/Switch.spec.js.snap +22 -22
- package/lib/Tab/Tab.module.css +3 -3
- package/lib/Tag/Tag.module.css +8 -3
- package/lib/TextBox/TextBox.module.css +25 -5
- package/lib/TextBoxIcon/TextBoxIcon.module.css +5 -0
- package/lib/Textarea/Textarea.module.css +9 -3
- package/lib/Tooltip/Tooltip.module.css +5 -1
- package/lib/common/common.module.css +2 -2
- package/lib/common/customscroll.module.css +37 -0
- package/lib/v1/Avatar/Avatar.js +2 -1
- package/lib/v1/ListItem/ListContainer.js +1 -1
- package/lib/v1/Modal/Modal.js +118 -164
- package/lib/v1/MultiSelect/Suggestions.js +2 -1
- package/lib/v1/Select/Select.js +3 -2
- package/lib/v1/Switch/Switch.js +2 -2
- 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 +12 -10
- package/propValidationArg.json +8 -0
- package/result.json +1 -1
- package/es/v1/Typography/css/letterSpacingMap.js +0 -12
- package/lib/v1/Typography/css/letterSpacingMap.js +0 -20
|
@@ -23,9 +23,17 @@
|
|
|
23
23
|
-ms-scrollbar-highlight-color: var(--zd-scroll-bg);
|
|
24
24
|
-ms-scrollbar-face-color: var(--zd-scroll-thump);
|
|
25
25
|
}
|
|
26
|
+
.scroll::-webkit-scrollbar,
|
|
27
|
+
.scroll ::-webkit-scrollbar {
|
|
28
|
+
/* css:theme-validation:ignore */
|
|
29
|
+
}
|
|
26
30
|
.scroll::-webkit-scrollbar, .scroll ::-webkit-scrollbar {
|
|
27
31
|
background: var(--zd-scroll-corner-bg);
|
|
28
32
|
}
|
|
33
|
+
.scroll::-webkit-scrollbar:hover,
|
|
34
|
+
.scroll ::-webkit-scrollbar:hover {
|
|
35
|
+
/* css:theme-validation:ignore */
|
|
36
|
+
}
|
|
29
37
|
.scroll::-webkit-scrollbar:hover, .scroll ::-webkit-scrollbar:hover {
|
|
30
38
|
background: var(--zd-scroll-bg);
|
|
31
39
|
}
|
|
@@ -43,6 +51,11 @@
|
|
|
43
51
|
width: 0 ;
|
|
44
52
|
height: 0 ;
|
|
45
53
|
}
|
|
54
|
+
.scroll::-webkit-scrollbar-track:vertical,
|
|
55
|
+
.scroll ::-webkit-scrollbar-track:vertical {
|
|
56
|
+
/* css:theme-validation:ignore */
|
|
57
|
+
/* css:theme-validation:ignore */
|
|
58
|
+
}
|
|
46
59
|
[dir=ltr] .scroll::-webkit-scrollbar-track:vertical, [dir=ltr] .scroll ::-webkit-scrollbar-track:vertical {
|
|
47
60
|
border-left: 1px solid transparent;
|
|
48
61
|
border-right: 1px solid transparent;
|
|
@@ -51,13 +64,26 @@
|
|
|
51
64
|
border-right: 1px solid transparent;
|
|
52
65
|
border-left: 1px solid transparent;
|
|
53
66
|
}
|
|
67
|
+
.scroll::-webkit-scrollbar-track:vertical:hover,
|
|
68
|
+
.scroll ::-webkit-scrollbar-track:vertical:hover {
|
|
69
|
+
/* css:theme-validation:ignore */
|
|
70
|
+
}
|
|
54
71
|
.scroll::-webkit-scrollbar-track:vertical:hover, .scroll ::-webkit-scrollbar-track:vertical:hover {
|
|
55
72
|
border-color: var(--zd-scroll-border);
|
|
56
73
|
}
|
|
74
|
+
.scroll::-webkit-scrollbar-track:horizontal,
|
|
75
|
+
.scroll ::-webkit-scrollbar-track:horizontal {
|
|
76
|
+
/* css:theme-validation:ignore */
|
|
77
|
+
/* css:theme-validation:ignore */
|
|
78
|
+
}
|
|
57
79
|
.scroll::-webkit-scrollbar-track:horizontal, .scroll ::-webkit-scrollbar-track:horizontal {
|
|
58
80
|
border-top: 1px solid transparent;
|
|
59
81
|
border-bottom: 1px solid transparent;
|
|
60
82
|
}
|
|
83
|
+
.scroll::-webkit-scrollbar-track:horizontal:hover,
|
|
84
|
+
.scroll ::-webkit-scrollbar-track:horizontal:hover {
|
|
85
|
+
/* css:theme-validation:ignore */
|
|
86
|
+
}
|
|
61
87
|
.scroll::-webkit-scrollbar-track:horizontal:hover, .scroll ::-webkit-scrollbar-track:horizontal:hover {
|
|
62
88
|
border-color: var(--zd-scroll-border);
|
|
63
89
|
}
|
|
@@ -66,6 +92,8 @@
|
|
|
66
92
|
}
|
|
67
93
|
.scroll::-webkit-scrollbar-thumb,
|
|
68
94
|
.scroll ::-webkit-scrollbar-thumb {
|
|
95
|
+
/* css:theme-validation:ignore */
|
|
96
|
+
/* css:theme-validation:ignore */
|
|
69
97
|
/* display: none; */
|
|
70
98
|
}
|
|
71
99
|
.scroll::-webkit-scrollbar-thumb, .scroll ::-webkit-scrollbar-thumb {
|
|
@@ -74,6 +102,11 @@
|
|
|
74
102
|
background-clip: padding-box;
|
|
75
103
|
border: 3px solid transparent;
|
|
76
104
|
}
|
|
105
|
+
.scroll::-webkit-scrollbar-thumb:hover,
|
|
106
|
+
.scroll ::-webkit-scrollbar-thumb:hover {
|
|
107
|
+
/* css:theme-validation:ignore */
|
|
108
|
+
/* css:theme-validation:ignore */
|
|
109
|
+
}
|
|
77
110
|
.scroll::-webkit-scrollbar-thumb:hover, .scroll ::-webkit-scrollbar-thumb:hover {
|
|
78
111
|
background: var(--zd-scroll-thump-hoverbg);
|
|
79
112
|
background-clip: padding-box;
|
|
@@ -83,6 +116,10 @@
|
|
|
83
116
|
.scroll *:hover > ::-webkit-scrollbar-thumb {
|
|
84
117
|
display: block;
|
|
85
118
|
} */
|
|
119
|
+
.scroll::-webkit-scrollbar-corner,
|
|
120
|
+
.scroll ::-webkit-scrollbar-corner {
|
|
121
|
+
/* css:theme-validation:ignore */
|
|
122
|
+
}
|
|
86
123
|
.scroll::-webkit-scrollbar-corner, .scroll ::-webkit-scrollbar-corner {
|
|
87
124
|
background: var(--zd-scroll-corner-bg);
|
|
88
125
|
}
|
package/es/v1/Avatar/Avatar.js
CHANGED
|
@@ -111,7 +111,8 @@ function Avatar(props) {
|
|
|
111
111
|
"data-id": dataId,
|
|
112
112
|
"data-test-id": dataId,
|
|
113
113
|
onClick: onClick,
|
|
114
|
-
"data-selector-id": dataSelectorId
|
|
114
|
+
"data-selector-id": dataSelectorId,
|
|
115
|
+
tabIndex: onClick ? 0 : null
|
|
115
116
|
}, AvatarProps), showInitial && !showAlternateAvatar && /*#__PURE__*/React.createElement("span", {
|
|
116
117
|
className: `${style.initial}`,
|
|
117
118
|
"data-id": `${dataId}_AvatarInitial`,
|
|
@@ -89,7 +89,7 @@ const ListContainer = props => {
|
|
|
89
89
|
eleRef: eleRef,
|
|
90
90
|
tagName: isLink ? 'a' : 'li',
|
|
91
91
|
"data-title": isDisabled ? disableTitle : title
|
|
92
|
-
}, options, customProps), children);
|
|
92
|
+
}, options, customProps, a11y), children);
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
ListContainer.defaultProps = ListContainerDefaultProps;
|
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;
|
|
@@ -60,7 +60,8 @@ export default class Suggestions extends React.PureComponent {
|
|
|
60
60
|
const isHighlight = hoverOption === index || id === hoverId ? true : false;
|
|
61
61
|
const list_a11y = Object.assign({}, a11y, {
|
|
62
62
|
ariaSelected: isActive,
|
|
63
|
-
ariaLabel: value
|
|
63
|
+
ariaLabel: value,
|
|
64
|
+
'data-a11y-list-active': isHighlight
|
|
64
65
|
});
|
|
65
66
|
const commonProps = {
|
|
66
67
|
isDisabled,
|
package/es/v1/Select/Select.js
CHANGED
|
@@ -298,7 +298,8 @@ export class SelectComponent extends Component {
|
|
|
298
298
|
isPopupOpen,
|
|
299
299
|
onKeyDown,
|
|
300
300
|
isPopupOpenOnEnter,
|
|
301
|
-
needCloseOnSelect
|
|
301
|
+
needCloseOnSelect,
|
|
302
|
+
isPopupReady
|
|
302
303
|
} = this.props;
|
|
303
304
|
let {
|
|
304
305
|
hoverIndex,
|
|
@@ -351,7 +352,7 @@ export class SelectComponent extends Component {
|
|
|
351
352
|
id
|
|
352
353
|
} = option || {};
|
|
353
354
|
|
|
354
|
-
if (
|
|
355
|
+
if (isPopupReady && !getIsEmptyValue(id) && onChange) {
|
|
355
356
|
onChange(id, optionsNormalize[id]);
|
|
356
357
|
needCloseOnSelect && this.handlePopupClose(e);
|
|
357
358
|
}
|
package/es/v1/Switch/Switch.js
CHANGED
|
@@ -54,7 +54,6 @@ const Switch = props => {
|
|
|
54
54
|
"data-title": disabled ? disableTitle : title,
|
|
55
55
|
"aria-checked": checked,
|
|
56
56
|
role: "switch",
|
|
57
|
-
tabIndex: isReadOnly || disabled ? '-1' : '0',
|
|
58
57
|
dataSelectorId: dataSelectorId
|
|
59
58
|
}, SwitchProps), /*#__PURE__*/React.createElement(Box, {
|
|
60
59
|
className: `${style[size]} ${customSwitchSize}`
|
|
@@ -72,7 +71,8 @@ const Switch = props => {
|
|
|
72
71
|
htmlFor: id,
|
|
73
72
|
"data-id": dataId,
|
|
74
73
|
"data-test-id": dataId,
|
|
75
|
-
className: `${style.label} ${style[`${size}Label`]} ${customSwitch}
|
|
74
|
+
className: `${style.label} ${style[`${size}Label`]} ${customSwitch}`,
|
|
75
|
+
tabIndex: isReadOnly || disabled ? '-1' : '0'
|
|
76
76
|
})), text && /*#__PURE__*/React.createElement(Label, _extends({
|
|
77
77
|
text: text,
|
|
78
78
|
palette: labelPalette,
|
|
@@ -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,
|