@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.
Files changed (100) hide show
  1. package/.cli/AppearanceThemeValidationExcludeFiles.js +1 -0
  2. package/.cli/PropLessFiles.html +1 -1
  3. package/.cli/PropUnificationExcludeFilesArray.js +231 -0
  4. package/.cli/propValidation_report.html +24 -2
  5. package/PropValidationExcludeFilesArray.js +1 -0
  6. package/README.md +6 -0
  7. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +3 -0
  8. package/assets/Appearance/light/mode/Component_LightMode.module.css +3 -0
  9. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +3 -0
  10. package/es/Avatar/Avatar.js +2 -1
  11. package/es/Avatar/Avatar.module.css +12 -0
  12. package/es/AvatarTeam/AvatarTeam.module.css +2 -0
  13. package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +1 -0
  14. package/es/Button/css/Button.module.css +9 -1
  15. package/es/Buttongroup/Buttongroup.module.css +3 -2
  16. package/es/CheckBox/CheckBox.module.css +2 -0
  17. package/es/DateTime/DateTime.module.css +3 -2
  18. package/es/DateTime/YearView.module.css +1 -1
  19. package/es/DateTime/dateFormatUtils/dateFormat.js +6 -1
  20. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +8 -4
  21. package/es/DropBox/css/DropBox.module.css +1 -0
  22. package/es/DropDown/DropDownHeading.module.css +6 -0
  23. package/es/DropDown/DropDownItem.module.css +3 -0
  24. package/es/Label/Label.module.css +2 -1
  25. package/es/ListItem/ListContainer.js +1 -1
  26. package/es/ListItem/ListItem.module.css +28 -18
  27. package/es/MultiSelect/Suggestions.js +2 -1
  28. package/es/PopOver/PopOver.module.css +1 -0
  29. package/es/Radio/Radio.module.css +1 -0
  30. package/es/Ribbon/Ribbon.module.css +9 -6
  31. package/es/Select/Select.js +3 -2
  32. package/es/Switch/Switch.js +2 -2
  33. package/es/Switch/Switch.module.css +2 -0
  34. package/es/Switch/__tests__/__snapshots__/Switch.spec.js.snap +22 -22
  35. package/es/Tab/Tab.module.css +3 -3
  36. package/es/Tag/Tag.module.css +8 -3
  37. package/es/TextBox/TextBox.module.css +25 -5
  38. package/es/TextBoxIcon/TextBoxIcon.module.css +5 -0
  39. package/es/Textarea/Textarea.module.css +9 -3
  40. package/es/Tooltip/Tooltip.module.css +5 -1
  41. package/es/common/common.module.css +2 -2
  42. package/es/common/customscroll.module.css +37 -0
  43. package/es/v1/Avatar/Avatar.js +2 -1
  44. package/es/v1/ListItem/ListContainer.js +1 -1
  45. package/es/v1/Modal/Modal.js +86 -114
  46. package/es/v1/MultiSelect/Suggestions.js +2 -1
  47. package/es/v1/Select/Select.js +3 -2
  48. package/es/v1/Switch/Switch.js +2 -2
  49. package/es/v1/Typography/css/Typography.module.css +83 -112
  50. package/es/v1/Typography/css/cssJSLogic.js +6 -2
  51. package/es/v1/Typography/props/propTypes.js +2 -2
  52. package/es/v1/Typography/utils/index.js +50 -0
  53. package/lib/Avatar/Avatar.js +2 -1
  54. package/lib/Avatar/Avatar.module.css +12 -0
  55. package/lib/AvatarTeam/AvatarTeam.module.css +2 -0
  56. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +1 -0
  57. package/lib/Button/css/Button.module.css +9 -1
  58. package/lib/Buttongroup/Buttongroup.module.css +3 -2
  59. package/lib/CheckBox/CheckBox.module.css +2 -0
  60. package/lib/DateTime/DateTime.module.css +3 -2
  61. package/lib/DateTime/YearView.module.css +1 -1
  62. package/lib/DateTime/dateFormatUtils/dateFormat.js +6 -1
  63. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +8 -4
  64. package/lib/DropBox/css/DropBox.module.css +1 -0
  65. package/lib/DropDown/DropDownHeading.module.css +6 -0
  66. package/lib/DropDown/DropDownItem.module.css +3 -0
  67. package/lib/Label/Label.module.css +2 -1
  68. package/lib/ListItem/ListContainer.js +1 -1
  69. package/lib/ListItem/ListItem.module.css +28 -18
  70. package/lib/MultiSelect/Suggestions.js +2 -1
  71. package/lib/PopOver/PopOver.module.css +1 -0
  72. package/lib/Radio/Radio.module.css +1 -0
  73. package/lib/Ribbon/Ribbon.module.css +9 -6
  74. package/lib/Select/Select.js +3 -2
  75. package/lib/Switch/Switch.js +2 -2
  76. package/lib/Switch/Switch.module.css +2 -0
  77. package/lib/Switch/__tests__/__snapshots__/Switch.spec.js.snap +22 -22
  78. package/lib/Tab/Tab.module.css +3 -3
  79. package/lib/Tag/Tag.module.css +8 -3
  80. package/lib/TextBox/TextBox.module.css +25 -5
  81. package/lib/TextBoxIcon/TextBoxIcon.module.css +5 -0
  82. package/lib/Textarea/Textarea.module.css +9 -3
  83. package/lib/Tooltip/Tooltip.module.css +5 -1
  84. package/lib/common/common.module.css +2 -2
  85. package/lib/common/customscroll.module.css +37 -0
  86. package/lib/v1/Avatar/Avatar.js +2 -1
  87. package/lib/v1/ListItem/ListContainer.js +1 -1
  88. package/lib/v1/Modal/Modal.js +118 -164
  89. package/lib/v1/MultiSelect/Suggestions.js +2 -1
  90. package/lib/v1/Select/Select.js +3 -2
  91. package/lib/v1/Switch/Switch.js +2 -2
  92. package/lib/v1/Typography/css/Typography.module.css +83 -112
  93. package/lib/v1/Typography/css/cssJSLogic.js +7 -3
  94. package/lib/v1/Typography/props/propTypes.js +2 -2
  95. package/lib/v1/Typography/utils/index.js +59 -0
  96. package/package.json +12 -10
  97. package/propValidationArg.json +8 -0
  98. package/result.json +1 -1
  99. package/es/v1/Typography/css/letterSpacingMap.js +0 -12
  100. 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
  }
@@ -161,7 +161,8 @@ function Avatar(props) {
161
161
  "data-id": dataId,
162
162
  "data-test-id": dataId,
163
163
  onClick: onClick,
164
- "data-selector-id": dataSelectorId
164
+ "data-selector-id": dataSelectorId,
165
+ tabIndex: onClick ? 0 : null
165
166
  }, AvatarProps), showInitial && !showAlternateAvatar && /*#__PURE__*/_react["default"].createElement("span", {
166
167
  className: "".concat(_AvatarModule["default"].initial),
167
168
  "data-id": "".concat(dataId, "_AvatarInitial"),
@@ -105,7 +105,7 @@ var ListContainer = function ListContainer(props) {
105
105
  eleRef: eleRef,
106
106
  tagName: isLink ? 'a' : 'li',
107
107
  "data-title": isDisabled ? disableTitle : title
108
- }, options, customProps), children);
108
+ }, options, customProps, a11y), children);
109
109
  };
110
110
 
111
111
  ListContainer.defaultProps = _defaultProps.ListContainerDefaultProps;
@@ -5,12 +5,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = void 0;
8
+ exports["default"] = Modal;
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _reactDom = _interopRequireDefault(require("react-dom"));
13
13
 
14
+ var _useEffectCallOnlyAfterState = _interopRequireDefault(require("@zohodesk/hooks/es/utils/useEffectCallOnlyAfterState"));
15
+
14
16
  var _defaultProps = require("../../Modal/props/defaultProps");
15
17
 
16
18
  var _propTypes = require("../../Modal/props/propTypes");
@@ -19,194 +21,146 @@ var _AppContainerModule = _interopRequireDefault(require("../../AppContainer/App
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
- 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); }
23
-
24
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
25
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
27
 
30
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
28
+ 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); }
31
29
 
32
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
31
 
34
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
32
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
35
33
 
36
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
34
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
37
35
 
38
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
36
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
39
37
 
40
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
38
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
41
39
 
42
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
41
 
44
42
  var createdPortalIds = [];
45
43
  var newPortalPrefix = 'CPortal';
46
44
  var portalChildrenTopIndexValues;
47
45
 
48
- var Modal = /*#__PURE__*/function (_React$Component) {
49
- _inherits(Modal, _React$Component);
50
-
51
- var _super = _createSuper(Modal);
52
-
53
- function Modal(props) {
54
- var _this;
55
-
56
- _classCallCheck(this, Modal);
57
-
58
- _this = _super.call(this, props);
59
- _this.handleAddPortalId = _this.handleAddPortalId.bind(_assertThisInitialized(_this));
60
- _this.handleRemovePortalId = _this.handleRemovePortalId.bind(_assertThisInitialized(_this));
61
- _this.handleInsertPortalDiv = _this.handleInsertPortalDiv.bind(_assertThisInitialized(_this));
62
- _this.getPortalDiv = _this.getPortalDiv.bind(_assertThisInitialized(_this));
63
- _this.state = {
64
- isMounted: false
65
- };
66
- _this.portalId = props.portalId;
67
- _this.setRef = _this.setRef.bind(_assertThisInitialized(_this));
68
- _this.ref = null; // this.portalDiv = document.createDocumentFragment();
46
+ function Modal(props) {
47
+ var children = props.children,
48
+ isActive = props.isActive,
49
+ autoZIndexNeeded = props.autoZIndexNeeded,
50
+ propPortalId = props.portalId;
51
+
52
+ var _useState = (0, _react.useState)(false),
53
+ _useState2 = _slicedToArray(_useState, 2),
54
+ isMounted = _useState2[0],
55
+ setMounted = _useState2[1];
56
+
57
+ var portalId = (0, _react.useRef)(propPortalId);
58
+ var ref = (0, _react.useRef)(null);
59
+ var isZIndexAppendNeeded = (0, _react.useRef)();
60
+ var zIndex = (0, _react.useRef)();
61
+ var modalRoot = (0, _react.useRef)();
62
+ var newModalRoot = (0, _react.useRef)();
63
+ var containerDiv = (0, _react.useRef)();
64
+ var portalDiv = (0, _react.useRef)(); // document.createDocumentFragment()
65
+
66
+ var isCustomPortalId = (0, _react.useRef)();
67
+ var setRef = (0, _react.useCallback)(function (ele) {
68
+ ref.current = ele;
69
+
70
+ if (isZIndexAppendNeeded.current) {
71
+ ref.current.style.zIndex = zIndex.current;
72
+ isZIndexAppendNeeded.current = false;
73
+ }
74
+ }, []);
75
+
76
+ function getPortalDiv() {
77
+ modalRoot.current = propPortalId ? document.querySelector("[data-portal=".concat(propPortalId, "]")) : "";
78
+
79
+ if (!modalRoot.current) {
80
+ portalId.current = handleAddPortalId();
81
+ newModalRoot.current = document.createElement('div');
82
+ newModalRoot.current.className = _AppContainerModule["default"].container;
83
+ newModalRoot.current.setAttribute('data-portal', portalId.current);
84
+ containerDiv.current && containerDiv.current.appendChild(newModalRoot.current);
85
+ modalRoot.current = newModalRoot.current;
86
+ }
69
87
 
70
- return _this;
88
+ return modalRoot.current;
71
89
  }
72
90
 
73
- _createClass(Modal, [{
74
- key: "setRef",
75
- value: function setRef(ele) {
76
- this.ref = ele;
77
-
78
- if (this.isZIndexAppendNeeded) {
79
- this.ref.style.zIndex = this.zIndex;
80
- this.isZIndexAppendNeeded = false;
81
- }
82
- }
83
- }, {
84
- key: "getPortalDiv",
85
- value: function getPortalDiv() {
86
- this.modalRoot = this.props.portalId ? document.querySelector("[data-portal=".concat(this.props.portalId, "]")) : '';
87
-
88
- if (!this.modalRoot) {
89
- this.portalId = this.handleAddPortalId();
90
- this.newModalRoot = document.createElement('div');
91
- this.newModalRoot.className = _AppContainerModule["default"].container;
92
- this.newModalRoot.setAttribute('data-portal', this.portalId);
93
- this.containerDiv && this.containerDiv.appendChild(this.newModalRoot);
94
- this.modalRoot = this.newModalRoot;
91
+ (0, _react.useEffect)(function () {
92
+ containerDiv.current = document.getElementsByTagName("desk")[0] ? document.getElementsByTagName('desk')[0] : document.getElementsByTagName('body')[0];
93
+ portalDiv.current = getPortalDiv();
94
+ setMounted(true);
95
+ setTimeout(function () {
96
+ handleInsertPortalDiv();
97
+ });
98
+ return function () {
99
+ // modalRoot.current && modalRoot.current.removeChild(portalDiv.current);
100
+ if (newModalRoot.current) {
101
+ containerDiv.current && containerDiv.current.removeChild(newModalRoot.current);
102
+ handleRemovePortalId();
95
103
  }
96
104
 
97
- return this.modalRoot;
98
- }
99
- }, {
100
- key: "componentDidMount",
101
- value: function componentDidMount() {
102
- var _this2 = this;
103
-
104
- this.containerDiv = document.getElementsByTagName('desk')[0] ? document.getElementsByTagName('desk')[0] : document.getElementsByTagName('body')[0];
105
- this.portalDiv = this.getPortalDiv();
106
- this.setState({
107
- isMounted: true
108
- }, function () {
109
- _this2.handleInsertPortalDiv();
110
- });
111
- }
112
- }, {
113
- key: "componentWillUnmount",
114
- value: function componentWillUnmount() {
115
- //this.modalRoot && this.modalRoot.removeChild(this.portalDiv);
116
- if (this.newModalRoot) {
117
- this.containerDiv && this.containerDiv.removeChild(this.newModalRoot);
118
- this.handleRemovePortalId();
119
- }
120
-
121
- if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
105
+ if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
122
106
  portalChildrenTopIndexValues -= 1;
123
107
  }
108
+ };
109
+ }, []);
110
+ (0, _useEffectCallOnlyAfterState["default"])(function () {
111
+ if (isActive) {
112
+ handleInsertPortalDiv();
113
+ } else if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
114
+ portalChildrenTopIndexValues -= 1;
124
115
  }
125
- }, {
126
- key: "componentDidUpdate",
127
- value: function componentDidUpdate(prevProps) {
128
- if (prevProps.isActive != this.props.isActive) {
129
- if (this.props.isActive) {
130
- this.handleInsertPortalDiv();
131
- } else if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
132
- portalChildrenTopIndexValues -= 1;
133
- }
134
- }
135
- }
136
- }, {
137
- key: "handleInsertPortalDiv",
138
- value: function handleInsertPortalDiv() {
139
- var autoZIndexNeeded = this.props.autoZIndexNeeded;
140
-
141
- if (autoZIndexNeeded) {
142
- var isActive = this.props.isActive;
143
-
144
- if (isActive) {
145
- var newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
146
- portalChildrenTopIndexValues = newHighValue;
147
- this.zIndex = newHighValue;
148
-
149
- if (this.ref) {
150
- this.ref.style.zIndex = newHighValue;
151
- } else {
152
- this.isZIndexAppendNeeded = true;
153
- }
154
- }
116
+ }, [isActive]);
117
+
118
+ function handleInsertPortalDiv() {
119
+ if (autoZIndexNeeded && isActive) {
120
+ var newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
121
+ portalChildrenTopIndexValues = newHighValue;
122
+ zIndex.current = newHighValue;
123
+
124
+ if (ref.current) {
125
+ ref.current.style.zIndex = newHighValue;
126
+ } else {
127
+ isZIndexAppendNeeded.current = true;
155
128
  }
156
129
  }
157
- }, {
158
- key: "handleAddPortalId",
159
- value: function handleAddPortalId() {
160
- var createdPortalIdsLen = createdPortalIds.length;
161
- var newPortalId = createdPortalIdsLen ? createdPortalIds[createdPortalIdsLen - 1] + 1 : 1;
162
- createdPortalIds.push(newPortalId);
163
- this.portalId = newPortalId;
164
- this.isCustomPortalId = true;
165
- return "".concat(newPortalPrefix).concat(newPortalId);
166
- }
167
- }, {
168
- key: "handleRemovePortalId",
169
- value: function handleRemovePortalId() {
170
- var _this3 = this;
171
-
172
- if (this.isCustomPortalId) {
173
- createdPortalIds = createdPortalIds.filter(function (id) {
174
- return id !== _this3.portalId;
175
- });
176
- }
130
+ }
131
+
132
+ function handleAddPortalId() {
133
+ var createdPortalIdsLen = createdPortalIds.length;
134
+ var newPortalId = createdPortalIdsLen ? createdPortalIds[createdPortalIdsLen - 1] + 1 : 1;
135
+ createdPortalIds.push(newPortalId);
136
+ portalId.current = newPortalId;
137
+ isCustomPortalId.current = true;
138
+ return "".concat(newPortalPrefix).concat(newPortalId);
139
+ }
140
+
141
+ function handleRemovePortalId() {
142
+ if (isCustomPortalId.current) {
143
+ createdPortalIds = createdPortalIds.filter(function (id) {
144
+ return id !== portalId.current;
145
+ });
177
146
  }
178
- }, {
179
- key: "render",
180
- value: function render() {
181
- var children = this.props.children,
182
- isMounted = this.state.isMounted;
183
- var Element = children.type,
184
- elementProps = children.props;
185
-
186
- if (isMounted) {
187
- if (Element) {
188
- return /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement(Element, _extends({
189
- ref: this.setRef
190
- }, elementProps)), this.portalDiv);
191
- }
192
-
193
- return null;
194
- }
147
+ }
195
148
 
196
- return null;
149
+ var Element = children.type,
150
+ elementProps = children.props;
151
+
152
+ if (isMounted) {
153
+ if (Element) {
154
+ return /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement(Element, _extends({
155
+ ref: setRef
156
+ }, elementProps)), portalDiv.current);
197
157
  }
198
- }]);
199
158
 
200
- return Modal;
201
- }(_react["default"].Component);
159
+ return null;
160
+ }
161
+
162
+ return null;
163
+ }
202
164
 
203
- exports["default"] = Modal;
204
165
  Modal.defaultProps = _defaultProps.defaultProps;
205
- Modal.propTypes = _propTypes.propTypes; // if (__DOCS__) {
206
- // Modal.docs = {
207
- // componentGroup: 'Atom',
208
- // folderName: 'Style Guide',
209
- // external: false,
210
- // description: ' '
211
- // };
212
- // }
166
+ Modal.propTypes = _propTypes.propTypes;
@@ -110,7 +110,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
110
110
  var isHighlight = hoverOption === index || id === hoverId ? true : false;
111
111
  var list_a11y = Object.assign({}, a11y, {
112
112
  ariaSelected: isActive,
113
- ariaLabel: value
113
+ ariaLabel: value,
114
+ 'data-a11y-list-active': isHighlight
114
115
  });
115
116
 
116
117
  var commonProps = _objectSpread({
@@ -346,7 +346,8 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
346
346
  isPopupOpen = _this$props4.isPopupOpen,
347
347
  onKeyDown = _this$props4.onKeyDown,
348
348
  isPopupOpenOnEnter = _this$props4.isPopupOpenOnEnter,
349
- needCloseOnSelect = _this$props4.needCloseOnSelect;
349
+ needCloseOnSelect = _this$props4.needCloseOnSelect,
350
+ isPopupReady = _this$props4.isPopupReady;
350
351
  var _this$state2 = this.state,
351
352
  hoverIndex = _this$state2.hoverIndex,
352
353
  optionsNormalize = _this$state2.optionsNormalize;
@@ -395,7 +396,7 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
395
396
  var _ref2 = option || {},
396
397
  id = _ref2.id;
397
398
 
398
- if (isPopupOpen && !(0, _Common.getIsEmptyValue)(id) && onChange) {
399
+ if (isPopupReady && !(0, _Common.getIsEmptyValue)(id) && onChange) {
399
400
  onChange(id, optionsNormalize[id]);
400
401
  needCloseOnSelect && this.handlePopupClose(e);
401
402
  }
@@ -66,7 +66,6 @@ var Switch = function Switch(props) {
66
66
  "data-title": disabled ? disableTitle : title,
67
67
  "aria-checked": checked,
68
68
  role: "switch",
69
- tabIndex: isReadOnly || disabled ? '-1' : '0',
70
69
  dataSelectorId: dataSelectorId
71
70
  }, SwitchProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
72
71
  className: "".concat(_SwitchModule["default"][size], " ").concat(customSwitchSize)
@@ -84,7 +83,8 @@ var Switch = function Switch(props) {
84
83
  htmlFor: id,
85
84
  "data-id": dataId,
86
85
  "data-test-id": dataId,
87
- className: "".concat(_SwitchModule["default"].label, " ").concat(_SwitchModule["default"]["".concat(size, "Label")], " ").concat(customSwitch)
86
+ className: "".concat(_SwitchModule["default"].label, " ").concat(_SwitchModule["default"]["".concat(size, "Label")], " ").concat(customSwitch),
87
+ tabIndex: isReadOnly || disabled ? '-1' : '0'
88
88
  })), text && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
89
89
  text: text,
90
90
  palette: labelPalette,