@councilbox/councilbox-ui 0.6.1 → 0.6.2
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/dist/HOCs/useWindowSize.js +10 -13
- package/dist/components/1.Introduction.stories.mdx +1 -1
- package/dist/components/2.Changelog.stories.mdx +5 -0
- package/dist/components/MenuLateralRight/MenuLateralRight.js +16 -3
- package/dist/components/Stepper/Stepper.css +2 -1
- package/dist/components/Stepper/Stepper.js +5 -1
- package/package.json +1 -1
|
@@ -29,9 +29,17 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
29
29
|
|
|
30
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
31
|
|
|
32
|
+
var getSize = function getSize(innerWidth) {
|
|
33
|
+
if (innerWidth < 600) return 'xs';
|
|
34
|
+
if (innerWidth < 960) return 'sm';
|
|
35
|
+
if (innerWidth < 1280) return 'md';
|
|
36
|
+
if (innerWidth < 1920) return 'lg';
|
|
37
|
+
return 'xl';
|
|
38
|
+
};
|
|
39
|
+
|
|
32
40
|
var useWindowSize = function useWindowSize() {
|
|
33
41
|
var _React$useState = _react.default.useState({
|
|
34
|
-
size:
|
|
42
|
+
size: getSize(window.innerWidth),
|
|
35
43
|
innerWidth: window.innerWidth,
|
|
36
44
|
innerHeight: window.innerHeight,
|
|
37
45
|
breakpoints: _stylesheet.defaultBreakpoints
|
|
@@ -44,20 +52,9 @@ var useWindowSize = function useWindowSize() {
|
|
|
44
52
|
function handleResize() {
|
|
45
53
|
var state = _objectSpread({}, windowSize);
|
|
46
54
|
|
|
55
|
+
state.size = getSize(window.innerWidth);
|
|
47
56
|
state.innerWidth = window.innerWidth;
|
|
48
57
|
|
|
49
|
-
if (window.innerWidth < _stylesheet.defaultBreakpoints.sm) {
|
|
50
|
-
state.size = 'xs';
|
|
51
|
-
} else if (window.innerWidth < _stylesheet.defaultBreakpoints.md) {
|
|
52
|
-
state.size = 'sm';
|
|
53
|
-
} else if (window.innerWidth < _stylesheet.defaultBreakpoints.lg) {
|
|
54
|
-
state.size = 'md';
|
|
55
|
-
} else if (window.innerWidth < _stylesheet.defaultBreakpoints.xl) {
|
|
56
|
-
state.size = 'lg';
|
|
57
|
-
} else {
|
|
58
|
-
state.size = 'xl';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
58
|
if (window.innerWidth < window.innerHeight) {
|
|
62
59
|
state.orientation = 'portrait';
|
|
63
60
|
} else if (window.innerWidth > window.innerHeight) {
|
|
@@ -25,6 +25,11 @@ a.noStyles:hover{
|
|
|
25
25
|
<div>Fix zIndex label InputText y SelectInput</div>
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
|
+
<h2>v0.6.2</h2>
|
|
29
|
+
<div>Add prop noCollapseUpperSection en MenuLateralRight</div>
|
|
30
|
+
<div>Fix useWindowSize</div>
|
|
31
|
+
<div>Fix Stepper quitado onClick de la flecha</div>
|
|
32
|
+
|
|
28
33
|
<h2>v0.6.1</h2>
|
|
29
34
|
<div>Fix estilos Stepper</div>
|
|
30
35
|
<div>Add prop freeNavigation Stepper</div>
|
|
@@ -38,7 +38,8 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
|
|
|
38
38
|
upperSection = _ref.upperSection,
|
|
39
39
|
underSection = _ref.underSection,
|
|
40
40
|
mobile = _ref.mobile,
|
|
41
|
-
buttonVideo = _ref.buttonVideo
|
|
41
|
+
buttonVideo = _ref.buttonVideo,
|
|
42
|
+
noCollapseUpperSection = _ref.noCollapseUpperSection;
|
|
42
43
|
|
|
43
44
|
var _useWindowSize = (0, _useWindowSize2.default)(),
|
|
44
45
|
innerWidth = _useWindowSize.innerWidth,
|
|
@@ -80,7 +81,19 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
|
|
|
80
81
|
width: 'var(--spacing64)',
|
|
81
82
|
height: 'var(--spacing64)'
|
|
82
83
|
} : {})
|
|
83
|
-
}),
|
|
84
|
+
}), noCollapseUpperSection ? upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
|
|
85
|
+
return /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
86
|
+
key: "upper-square-section-".concat(index),
|
|
87
|
+
icon: item.icon,
|
|
88
|
+
active: buttonVideo.active ? false : item.active,
|
|
89
|
+
onClick: item.action,
|
|
90
|
+
badge: item.badge,
|
|
91
|
+
styles: _objectSpread({}, resize() ? {
|
|
92
|
+
width: 'var(--spacing64)',
|
|
93
|
+
height: 'var(--spacing64)'
|
|
94
|
+
} : {})
|
|
95
|
+
});
|
|
96
|
+
}) : /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
84
97
|
icon: iconSelectDropDown().icon,
|
|
85
98
|
active: buttonVideo.active ? false : iconSelectDropDown().active,
|
|
86
99
|
onClick: iconSelectDropDown().action,
|
|
@@ -89,7 +102,7 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
|
|
|
89
102
|
width: 'var(--spacing64)',
|
|
90
103
|
height: 'var(--spacing64)'
|
|
91
104
|
} : {})
|
|
92
|
-
}), /*#__PURE__*/_react.default.createElement(_DropDown.default, {
|
|
105
|
+
}), !noCollapseUpperSection && /*#__PURE__*/_react.default.createElement(_DropDown.default, {
|
|
93
106
|
color: "transparent",
|
|
94
107
|
Component: function Component() {
|
|
95
108
|
return /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
@@ -72,7 +72,11 @@ var Stepper = function Stepper(_ref) {
|
|
|
72
72
|
return i.name === active;
|
|
73
73
|
}) ? 'var(--primary)' : 'var(--gray4)'
|
|
74
74
|
}, item.text)))), items.length - 1 !== index && /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
-
className: "cbx-stepper-item-arrow-content"
|
|
75
|
+
className: "cbx-stepper-item-arrow-content",
|
|
76
|
+
onClick: function onClick(e) {
|
|
77
|
+
e.stopPropagation();
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
}
|
|
76
80
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
77
81
|
className: "cbx-stepper-item-arrow-icon ri-arrow-drop-right-line"
|
|
78
82
|
})));
|