@zohodesk/components 1.0.0-temp-229.1 → 1.0.0-temp-220.11
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/propValidation_report.html +1 -1
- package/README.md +35 -0
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +15 -11
- package/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css +5 -0
- package/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css +5 -0
- package/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css +5 -0
- package/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css +5 -0
- package/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css +5 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +13 -9
- package/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css +5 -0
- package/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css +5 -0
- package/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css +5 -0
- package/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css +5 -0
- package/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css +5 -0
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +15 -11
- package/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css +5 -0
- package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css +5 -0
- package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css +5 -0
- package/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css +5 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css +5 -0
- package/es/Button/Button.js +14 -7
- package/es/Button/css/Button.module.css +54 -16
- package/es/Button/css/cssJSLogic.js +6 -1
- package/es/Button/props/propTypes.js +1 -0
- package/es/Card/Card.js +10 -39
- package/es/Card/props/defaultProps.js +1 -2
- package/es/Card/props/propTypes.js +1 -2
- package/es/DropBox/DropBox.js +3 -3
- package/es/ListItem/ListItem.js +11 -2
- package/es/ListItem/ListItem.module.css +9 -0
- package/es/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +15 -1
- package/es/ListItem/props/propTypes.js +2 -1
- package/es/Modal/Modal.js +35 -14
- package/es/Modal/Portal/Portal.js +33 -0
- package/es/Modal/Portal/__tests__/Portal.spec.js +28 -0
- package/es/Modal/Portal/__tests__/__snapshots__/Portal.spec.js.snap +30 -0
- package/es/Modal/Portal/props/defaultProps.js +3 -0
- package/es/Modal/Portal/props/propTypes.js +5 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +80 -10
- package/es/Popup/Popup.js +239 -107
- package/es/Popup/Registry.js +36 -0
- package/es/Popup/viewPort.js +15 -16
- package/es/Provider/Config.js +4 -1
- package/es/Provider/LibraryContext.js +7 -3
- package/es/RippleEffect/RippleEffect.module.css +3 -2
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +512 -64
- package/es/v1/Button/props/propTypes.js +2 -1
- package/es/v1/Switch/useSwitch.js +1 -1
- package/lib/Button/Button.js +12 -5
- package/lib/Button/css/Button.module.css +54 -16
- package/lib/Button/css/cssJSLogic.js +6 -2
- package/lib/Button/props/propTypes.js +1 -0
- package/lib/Card/Card.js +25 -54
- package/lib/Card/props/defaultProps.js +1 -2
- package/lib/Card/props/propTypes.js +1 -2
- package/lib/DropBox/DropBox.js +3 -3
- package/lib/ListItem/ListItem.js +12 -3
- package/lib/ListItem/ListItem.module.css +9 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +15 -1
- package/lib/ListItem/props/propTypes.js +2 -1
- package/lib/Modal/Modal.js +40 -16
- package/lib/Modal/Portal/Portal.js +46 -0
- package/lib/Modal/Portal/__tests__/Portal.spec.js +37 -0
- package/lib/Modal/Portal/__tests__/__snapshots__/Portal.spec.js.snap +30 -0
- package/lib/Modal/Portal/props/defaultProps.js +10 -0
- package/lib/Modal/Portal/props/propTypes.js +16 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +80 -10
- package/lib/Popup/Popup.js +316 -162
- package/lib/Popup/Registry.js +46 -0
- package/lib/Popup/viewPort.js +15 -16
- package/lib/Provider/Config.js +4 -1
- package/lib/Provider/LibraryContext.js +7 -3
- package/lib/RippleEffect/RippleEffect.module.css +3 -2
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +512 -64
- package/lib/v1/Button/props/propTypes.js +2 -1
- package/lib/v1/Switch/useSwitch.js +1 -1
- package/package.json +12 -12
- package/result.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _Config = require("../Provider/Config.js");
|
|
9
|
+
|
|
10
|
+
var Registry = {
|
|
11
|
+
lastOpenedGroup: [],
|
|
12
|
+
popups: {},
|
|
13
|
+
listenerPopupRef: undefined,
|
|
14
|
+
scrollBlockedListenerPopupRef: undefined,
|
|
15
|
+
scrollableListenerPopupRef: undefined,
|
|
16
|
+
getOpenedPopups: function getOpenedPopups() {
|
|
17
|
+
return Object.values(Registry.popups).flat().filter(function (popup) {
|
|
18
|
+
return popup.state.isPopupOpen;
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
getOpenedScrollBlockedFixedPopups: function getOpenedScrollBlockedFixedPopups() {
|
|
22
|
+
return Registry.getOpenedPopups().filter(function (popup) {
|
|
23
|
+
return popup.getIsOutsideScrollBlocked(popup) && !popup.getIsAbsolutePopup(popup);
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
getOpenedScrollableFixedPopups: function getOpenedScrollableFixedPopups() {
|
|
27
|
+
return Registry.getOpenedPopups().filter(function (popup) {
|
|
28
|
+
return !popup.getIsOutsideScrollBlocked(popup) && !popup.getIsAbsolutePopup(popup);
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
getRootElement: function getRootElement() {
|
|
32
|
+
var getRootElement = (0, _Config.getLibraryConfig)('getRootElement');
|
|
33
|
+
|
|
34
|
+
if (getRootElement && typeof getRootElement === 'function') {
|
|
35
|
+
var parent = getRootElement();
|
|
36
|
+
|
|
37
|
+
if (parent) {
|
|
38
|
+
return parent;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return document;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var _default = Registry;
|
|
46
|
+
exports["default"] = _default;
|
package/lib/Popup/viewPort.js
CHANGED
|
@@ -103,24 +103,23 @@ var viewPort = {
|
|
|
103
103
|
var paddingSpace = 5; // space between target and relative element
|
|
104
104
|
|
|
105
105
|
var arrowSize = needArrow ? 10 : 0;
|
|
106
|
-
|
|
107
|
-
rect.width = rect.width + (needArrow ? arrowSize : paddingSpace);
|
|
106
|
+
var padding = needArrow ? arrowSize : paddingSpace;
|
|
108
107
|
var arrowHorizontalBalancePx = !isAbsolute && needArrow ? 30 : 0;
|
|
109
108
|
var arrowVerticalBalancePx = !isAbsolute && needArrow ? 27 : 0;
|
|
110
|
-
var bottomOverFlow = rect.height > relativeBoxGap.bottom;
|
|
111
|
-
var topOverFlow = rect.height > relativeBoxGap.top;
|
|
112
|
-
var rightOverFlow = rect.width > relativeBoxGap.right;
|
|
113
|
-
var leftOverFlow = rect.width > relativeBoxGap.left;
|
|
114
|
-
var horizontalCenterOverFlow = rect.width / 2 > relativeBoxGap.center.right || rect.width / 2 > relativeBoxGap.center.left;
|
|
115
|
-
var verticalCenterOverFlow = rect.height / 2 > relativeBoxGap.center.top || rect.height / 2 > relativeBoxGap.center.bottom;
|
|
116
|
-
var horizontalLeftToRightOverFlow = rect.width > relativeBoxRect.width + relativeBoxGap.right;
|
|
117
|
-
var horizontalCenterToRightOverFlow = rect.width > relativeBoxGap.center.right || arrowHorizontalBalancePx > relativeBoxGap.center.left;
|
|
118
|
-
var horizontalRightToLeft = rect.width > relativeBoxRect.width + relativeBoxGap.left;
|
|
119
|
-
var horizontalCenterToLeft = rect.width > relativeBoxGap.center.left || arrowHorizontalBalancePx > relativeBoxGap.center.right;
|
|
120
|
-
var verticalTopToBottomOverFlow = rect.height > relativeBoxRect.height + relativeBoxGap.bottom;
|
|
121
|
-
var verticalCenterToBottomOverFlow = rect.height > relativeBoxGap.center.bottom || arrowVerticalBalancePx > relativeBoxGap.center.top;
|
|
122
|
-
var verticalBottomToTopOverFlow = rect.height > relativeBoxRect.height + relativeBoxGap.top;
|
|
123
|
-
var verticalCenterToTopOverFlow = rect.height > relativeBoxGap.center.top || arrowVerticalBalancePx > relativeBoxGap.center.bottom;
|
|
109
|
+
var bottomOverFlow = rect.height + padding > relativeBoxGap.bottom;
|
|
110
|
+
var topOverFlow = rect.height + padding > relativeBoxGap.top;
|
|
111
|
+
var rightOverFlow = rect.width + padding > relativeBoxGap.right;
|
|
112
|
+
var leftOverFlow = rect.width + padding > relativeBoxGap.left;
|
|
113
|
+
var horizontalCenterOverFlow = rect.width / 2 + padding > relativeBoxGap.center.right || rect.width / 2 + padding > relativeBoxGap.center.left;
|
|
114
|
+
var verticalCenterOverFlow = rect.height / 2 + padding > relativeBoxGap.center.top || rect.height / 2 + padding > relativeBoxGap.center.bottom;
|
|
115
|
+
var horizontalLeftToRightOverFlow = rect.width + padding > relativeBoxRect.width + relativeBoxGap.right;
|
|
116
|
+
var horizontalCenterToRightOverFlow = rect.width + padding > relativeBoxGap.center.right || arrowHorizontalBalancePx > relativeBoxGap.center.left;
|
|
117
|
+
var horizontalRightToLeft = rect.width + padding > relativeBoxRect.width + relativeBoxGap.left;
|
|
118
|
+
var horizontalCenterToLeft = rect.width + padding > relativeBoxGap.center.left || arrowHorizontalBalancePx > relativeBoxGap.center.right;
|
|
119
|
+
var verticalTopToBottomOverFlow = rect.height + padding > relativeBoxRect.height + relativeBoxGap.bottom;
|
|
120
|
+
var verticalCenterToBottomOverFlow = rect.height + padding > relativeBoxGap.center.bottom || arrowVerticalBalancePx > relativeBoxGap.center.top;
|
|
121
|
+
var verticalBottomToTopOverFlow = rect.height + padding > relativeBoxRect.height + relativeBoxGap.top;
|
|
122
|
+
var verticalCenterToTopOverFlow = rect.height + padding > relativeBoxGap.center.top || arrowVerticalBalancePx > relativeBoxGap.center.bottom;
|
|
124
123
|
var views = {
|
|
125
124
|
bottomCenter: !(bottomOverFlow || horizontalCenterOverFlow),
|
|
126
125
|
bottomLeftToRight: !(bottomOverFlow || horizontalLeftToRightOverFlow),
|
package/lib/Provider/Config.js
CHANGED
|
@@ -15,7 +15,10 @@ var id = {
|
|
|
15
15
|
direction: 'ltr',
|
|
16
16
|
tooltipDebounce: 175,
|
|
17
17
|
getTooltipContainer: function getTooltipContainer() {},
|
|
18
|
-
autoComplete: false
|
|
18
|
+
autoComplete: false,
|
|
19
|
+
portalPrefix: '',
|
|
20
|
+
getPortalContainer: function getPortalContainer() {},
|
|
21
|
+
getRootElement: function getRootElement() {}
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
function getLibraryConfig(key) {
|
|
@@ -45,6 +45,7 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
|
|
|
45
45
|
coloredTagVariant = _ref.coloredTagVariant,
|
|
46
46
|
hasTagColorInheritedToText = _ref.hasTagColorInheritedToText,
|
|
47
47
|
shouldIndicateSwitchState = _ref.shouldIndicateSwitchState,
|
|
48
|
+
shouldStrikeThroughDisabledButton = _ref.shouldStrikeThroughDisabledButton,
|
|
48
49
|
children = _ref.children;
|
|
49
50
|
|
|
50
51
|
var _useState = (0, _react.useState)({
|
|
@@ -52,7 +53,8 @@ var LibraryContextProvider = function LibraryContextProvider(_ref) {
|
|
|
52
53
|
direction: direction,
|
|
53
54
|
coloredTagVariant: coloredTagVariant,
|
|
54
55
|
hasTagColorInheritedToText: hasTagColorInheritedToText,
|
|
55
|
-
shouldIndicateSwitchState: shouldIndicateSwitchState
|
|
56
|
+
shouldIndicateSwitchState: shouldIndicateSwitchState,
|
|
57
|
+
shouldStrikeThroughDisabledButton: shouldStrikeThroughDisabledButton
|
|
56
58
|
}),
|
|
57
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
58
60
|
value = _useState2[0],
|
|
@@ -77,14 +79,16 @@ LibraryContextProvider.propTypes = {
|
|
|
77
79
|
coloredTagVariant: _propTypes["default"].oneOf(['bold', 'subtle', 'minimal']),
|
|
78
80
|
hasTagColorInheritedToText: _propTypes["default"].bool,
|
|
79
81
|
direction: _propTypes["default"].string,
|
|
80
|
-
shouldIndicateSwitchState: _propTypes["default"].bool
|
|
82
|
+
shouldIndicateSwitchState: _propTypes["default"].bool,
|
|
83
|
+
shouldStrikeThroughDisabledButton: _propTypes["default"].bool
|
|
81
84
|
};
|
|
82
85
|
LibraryContextProvider.defaultProps = {
|
|
83
86
|
isReducedMotion: (0, _Config.getLibraryConfig)('isReducedMotion'),
|
|
84
87
|
direction: (0, _Config.getLibraryConfig)('direction'),
|
|
85
88
|
coloredTagVariant: 'bold',
|
|
86
89
|
hasTagColorInheritedToText: true,
|
|
87
|
-
shouldIndicateSwitchState: false
|
|
90
|
+
shouldIndicateSwitchState: false,
|
|
91
|
+
shouldStrikeThroughDisabledButton: false
|
|
88
92
|
};
|
|
89
93
|
var _default = LibraryContextProvider;
|
|
90
94
|
exports["default"] = _default;
|
|
@@ -100,9 +100,10 @@
|
|
|
100
100
|
{
|
|
101
101
|
background-color: var(--zdt_rippleeffect_secondary_bg);
|
|
102
102
|
}
|
|
103
|
-
.secondary.active {
|
|
103
|
+
.secondary.active, .hoverEffect:hover.secondary.active.bgHover {
|
|
104
104
|
background-color: var(--zdt_rippleeffect_secondary_active_bg);
|
|
105
105
|
}
|
|
106
|
-
.secondary.active.border
|
|
106
|
+
.secondary.active.border
|
|
107
|
+
.hoverEffect:hover.secondary.active.border {
|
|
107
108
|
border-color: var(--zdt_rippleeffect_secondary_active_border);
|
|
108
109
|
}
|