@councilbox/councilbox-ui 0.6.1 → 0.6.3
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 +9 -0
- package/dist/components/DragDrop/DragDrop.js +6 -3
- package/dist/components/MenuLateralRight/MenuLateralRight.js +16 -3
- package/dist/components/Stepper/DesignStepper.stories.js +5 -1
- package/dist/components/Stepper/Stepper.css +7 -2
- package/dist/components/Stepper/Stepper.js +6 -2
- 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) {
|
|
@@ -24,6 +24,15 @@ a.noStyles:hover{
|
|
|
24
24
|
<h2>v0.5.4</h2>
|
|
25
25
|
<div>Fix zIndex label InputText y SelectInput</div>
|
|
26
26
|
</div>
|
|
27
|
+
<h2>v0.6.3</h2>
|
|
28
|
+
<div>fix en el buton de DragDrop cuando esta disabled</div>
|
|
29
|
+
<div>Refactor useWindowSize</div>
|
|
30
|
+
<div>Fix seleccionar el activo Stepper</div>
|
|
31
|
+
|
|
32
|
+
<h2>v0.6.2</h2>
|
|
33
|
+
<div>Add prop noCollapseUpperSection en MenuLateralRight</div>
|
|
34
|
+
<div>Fix useWindowSize</div>
|
|
35
|
+
<div>Fix Stepper quitado onClick de la flecha</div>
|
|
27
36
|
|
|
28
37
|
<h2>v0.6.1</h2>
|
|
29
38
|
<div>Fix estilos Stepper</div>
|
|
@@ -57,7 +57,7 @@ var DragDrop = function DragDrop(_ref) {
|
|
|
57
57
|
}, props), /*#__PURE__*/_react.default.createElement("div", {
|
|
58
58
|
className: 'cbx-dragDrop-container-button'
|
|
59
59
|
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
60
|
-
backgroundColor: 'var(--primary)',
|
|
60
|
+
backgroundColor: inputProps !== null && inputProps !== void 0 && inputProps.disabled ? 'var(--gray2) !important' : 'var(--primary)',
|
|
61
61
|
icon: /*#__PURE__*/_react.default.createElement("i", {
|
|
62
62
|
className: "ri-upload-2-line",
|
|
63
63
|
style: {
|
|
@@ -65,6 +65,7 @@ var DragDrop = function DragDrop(_ref) {
|
|
|
65
65
|
}
|
|
66
66
|
}),
|
|
67
67
|
type: 'fab',
|
|
68
|
+
disabled: inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled,
|
|
68
69
|
hoverColor: 'var(--primary75)'
|
|
69
70
|
}, iconButtonProps))), /*#__PURE__*/_react.default.createElement("input", _extends({}, getInputProps(), {
|
|
70
71
|
title: ''
|
|
@@ -96,7 +97,8 @@ DragDrop.propTypes = {
|
|
|
96
97
|
id: _propTypes.default.string,
|
|
97
98
|
iconButtonProps: _propTypes.default.object,
|
|
98
99
|
alertProps: _propTypes.default.object,
|
|
99
|
-
actionButtons: _propTypes.default.object
|
|
100
|
+
actionButtons: _propTypes.default.object,
|
|
101
|
+
inputProps: _propTypes.default.object
|
|
100
102
|
};
|
|
101
103
|
DragDrop.defaultProps = {
|
|
102
104
|
text: '',
|
|
@@ -104,7 +106,8 @@ DragDrop.defaultProps = {
|
|
|
104
106
|
id: '',
|
|
105
107
|
iconButtonProps: {},
|
|
106
108
|
alertProps: {},
|
|
107
|
-
actionButtons: {}
|
|
109
|
+
actionButtons: {},
|
|
110
|
+
inputProps: {}
|
|
108
111
|
};
|
|
109
112
|
var _default = DragDrop;
|
|
110
113
|
exports.default = _default;
|
|
@@ -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, {
|
|
@@ -29,7 +29,11 @@ var DesignStepper = function DesignStepper() {
|
|
|
29
29
|
state = _React$useState2[0],
|
|
30
30
|
setState = _React$useState2[1];
|
|
31
31
|
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div",
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
style: {
|
|
34
|
+
marginBottom: '1rem'
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(_Stepper.default, {
|
|
33
37
|
onClick: setState,
|
|
34
38
|
items: [{
|
|
35
39
|
text: 'Detalles',
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
align-items: center;
|
|
20
20
|
transition: .3s;
|
|
21
21
|
width: calc( 100% - 2rem );
|
|
22
|
+
max-height: 2.5rem;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
.cbx-stepper-item-contentText:last-child {
|
|
@@ -30,9 +31,12 @@
|
|
|
30
31
|
padding-right: 0;
|
|
31
32
|
padding: 0.5rem 0rem 0.5rem 0rem;
|
|
32
33
|
justify-content: center;
|
|
34
|
+
max-width: 2.5rem;
|
|
35
|
+
min-width: 2.5rem;
|
|
36
|
+
max-height: 2.5rem;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
.cbx-stepper-item-contentText-hover:hover {
|
|
39
|
+
.cbx-stepper-item-contentText-hover:hover, .cbx-stepper-item-active {
|
|
36
40
|
background: var(--gray1);
|
|
37
41
|
border-radius: 0.25rem;
|
|
38
42
|
}
|
|
@@ -73,5 +77,6 @@
|
|
|
73
77
|
|
|
74
78
|
.cbx-stepper-item-arrow-content {
|
|
75
79
|
width: 100%;
|
|
76
|
-
text-align: center
|
|
80
|
+
text-align: center;
|
|
81
|
+
cursor: default;
|
|
77
82
|
}
|
|
@@ -57,7 +57,7 @@ var Stepper = function Stepper(_ref) {
|
|
|
57
57
|
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
58
58
|
title: item.name || ''
|
|
59
59
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: "".concat(innerWidth <
|
|
60
|
+
className: "".concat(innerWidth < 875 ? "cbx-stepper-item-contentText ".concat(active === item.name && 'cbx-stepper-item-active', " ").concat(freeNavigation && 'cbx-stepper-item-contentText-hover', " cbx-stepper-item-contentText-mobile") : "cbx-stepper-item-contentText ".concat(active === item.name && 'cbx-stepper-item-active', " ").concat(freeNavigation && 'cbx-stepper-item-contentText-hover')),
|
|
61
61
|
style: {
|
|
62
62
|
color: active === item.name || items.slice(index + 1).some(function (i) {
|
|
63
63
|
return i.name === active;
|
|
@@ -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
|
})));
|