@councilbox/councilbox-ui 0.1.4 → 0.1.5
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/build-index.js +8 -0
- package/dist/components/Avatar/Avatar.css +5 -0
- package/dist/components/Avatar/Avatar.js +13 -17
- package/dist/components/AvatarGroup/AvatarGroup.css +3 -3
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/button.css +1 -1
- package/dist/components/ButtonBasic/ButtonBasic.js +18 -11
- package/dist/components/DrawerPanel/DrawerPanel.css +5 -1
- package/dist/components/DrawerPanel/DrawerPanel.js +25 -11
- package/dist/components/DropDown/DesignDropDown.stories.js +0 -15
- package/dist/components/DropDown/DropDown.js +6 -1
- package/dist/components/Grid/DesignGrid.stories.js +46 -0
- package/dist/components/Grid/Grid.js +35 -5
- package/dist/components/Grid/Grid.stories.js +7 -12
- package/dist/components/Grid/GridItem.js +13 -15
- package/dist/components/Header/Header.js +15 -16
- package/dist/components/Header/header.css +7 -4
- package/dist/components/IconButton/DesignIconButton.stories.js +3 -1
- package/dist/components/IconButton/IconButton.js +41 -6
- package/dist/components/IconButton/IconButton.stories.js +1 -4
- package/dist/components/IconButtonSquare/DesignIconButtonSquare.stories.js +27 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.css +23 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.js +103 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +31 -0
- package/dist/components/InputPassword/InputPassword.css +2 -2
- package/dist/components/InputText/InputText.css +3 -3
- package/dist/components/InputText/InputText.js +4 -4
- package/dist/components/MenuLateralRight/MenuLateralRight.css +80 -0
- package/dist/components/MenuLateralRight/MenuLateralRight.js +159 -4
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +2 -6
- package/dist/components/Modal/Modal.js +9 -14
- package/dist/components/TextInput/TextInput.css +2 -2
- package/dist/components/TextInput/TextInput.js +4 -4
- package/dist/components/Typography/Typography.js +20 -20
- package/dist/styles/stylesheet.js +2 -2
- package/package.json +1 -1
- package/dist/components/Grid/DesignGrid.js +0 -21
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
border-bottom: 1px solid gainsboro;
|
|
7
7
|
background: white;
|
|
8
8
|
box-shadow: 0px 0.25rem 0.25rem rgba(0, 0, 0, 0.25);
|
|
9
|
-
padding: 0 var(--spacing16)
|
|
9
|
+
padding: 0 var(--spacing16);
|
|
10
|
+
position: relative;
|
|
11
|
+
z-index: 1;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
.cbx-header-first-block {
|
|
@@ -35,12 +37,13 @@
|
|
|
35
37
|
font-size: 1.125rem;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
.cbx-header-third-logo-right,
|
|
40
|
+
.cbx-header-third-logo-right,
|
|
41
|
+
.App-logo {
|
|
39
42
|
display: block;
|
|
40
43
|
max-width: 7.813rem;
|
|
41
44
|
max-height: 2.5rem;
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
45
|
+
width: 7.813rem;
|
|
46
|
+
height: 2.5rem;
|
|
44
47
|
user-select: none;
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -13,8 +13,10 @@ var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
|
-
var DesignIconButton = function DesignIconButton() {
|
|
16
|
+
var DesignIconButton = function DesignIconButton(_ref) {
|
|
17
|
+
var badge = _ref.badge;
|
|
17
18
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
19
|
+
badge: badge,
|
|
18
20
|
icon: /*#__PURE__*/_react.default.createElement("i", {
|
|
19
21
|
className: "ri-user-3-line"
|
|
20
22
|
})
|
|
@@ -11,11 +11,15 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
13
13
|
|
|
14
|
+
var _Badge = _interopRequireDefault(require("@mui/material/Badge"));
|
|
15
|
+
|
|
14
16
|
require("../../styles/main.css");
|
|
15
17
|
|
|
16
18
|
require("./IconButton.css");
|
|
17
19
|
|
|
18
|
-
var
|
|
20
|
+
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
21
|
+
|
|
22
|
+
var _excluded = ["id", "className", "onClick", "icon", "backgroundColor", "styles", "badge", "classNameBadge", "rounded", "tooltip"];
|
|
19
23
|
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
@@ -38,19 +42,46 @@ var IconButton = function IconButton(_ref) {
|
|
|
38
42
|
icon = _ref.icon,
|
|
39
43
|
backgroundColor = _ref.backgroundColor,
|
|
40
44
|
styles = _ref.styles,
|
|
45
|
+
badge = _ref.badge,
|
|
46
|
+
classNameBadge = _ref.classNameBadge,
|
|
47
|
+
rounded = _ref.rounded,
|
|
48
|
+
tooltip = _ref.tooltip,
|
|
41
49
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
50
|
|
|
51
|
+
var getIcon = function getIcon() {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
53
|
+
title: tooltip || ''
|
|
54
|
+
}, icon);
|
|
55
|
+
};
|
|
56
|
+
|
|
43
57
|
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
44
58
|
id: id,
|
|
45
59
|
className: className,
|
|
46
60
|
onClick: onClick,
|
|
47
|
-
sx: _objectSpread({
|
|
61
|
+
sx: _objectSpread(_objectSpread({
|
|
48
62
|
width: 'var(--spacing40)',
|
|
49
63
|
height: 'var(--spacing40)',
|
|
50
64
|
fontSize: 'var(--spacing20)',
|
|
51
65
|
background: backgroundColor
|
|
52
|
-
},
|
|
53
|
-
|
|
66
|
+
}, rounded ? {
|
|
67
|
+
border: '2px solid var(--primary)',
|
|
68
|
+
color: 'var(--primary)'
|
|
69
|
+
} : {}), styles)
|
|
70
|
+
}, props), badge ? /*#__PURE__*/_react.default.createElement(_Badge.default, {
|
|
71
|
+
badgeContent: Number.parseInt(badge, 10) || ' ',
|
|
72
|
+
variant: !Number.parseInt(badge, 10) && 'dot',
|
|
73
|
+
className: classNameBadge,
|
|
74
|
+
sx: {
|
|
75
|
+
'& .MuiBadge-dot': {
|
|
76
|
+
background: !Number.parseInt(badge, 10) && 'var(--error)!important',
|
|
77
|
+
right: '-0.5rem',
|
|
78
|
+
top: '-0.25rem'
|
|
79
|
+
},
|
|
80
|
+
'& .MuiBadge-badge ': {
|
|
81
|
+
background: 'var(--secondary)'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, getIcon()) : getIcon());
|
|
54
85
|
};
|
|
55
86
|
|
|
56
87
|
IconButton.displayName = "IconButton";
|
|
@@ -59,14 +90,18 @@ IconButton.propTypes = {
|
|
|
59
90
|
className: _propTypes.default.string,
|
|
60
91
|
onClick: _propTypes.default.func,
|
|
61
92
|
icon: _propTypes.default.node,
|
|
62
|
-
backgroundColor: _propTypes.default.string
|
|
93
|
+
backgroundColor: _propTypes.default.string,
|
|
94
|
+
badge: _propTypes.default.any,
|
|
95
|
+
tooltip: _propTypes.default.string
|
|
63
96
|
};
|
|
64
97
|
IconButton.defaultProps = {
|
|
65
98
|
id: '',
|
|
66
99
|
className: '',
|
|
67
100
|
onClick: Function.prototype,
|
|
68
101
|
icon: undefined,
|
|
69
|
-
backgroundColor: ''
|
|
102
|
+
backgroundColor: '',
|
|
103
|
+
badge: false,
|
|
104
|
+
tooltip: ''
|
|
70
105
|
};
|
|
71
106
|
var _default = IconButton;
|
|
72
107
|
exports.default = _default;
|
|
@@ -26,9 +26,6 @@ var TemplateIconButton = function TemplateIconButton(args) {
|
|
|
26
26
|
TemplateIconButton.displayName = "TemplateIconButton";
|
|
27
27
|
var DesignIconButtonTemplate = TemplateIconButton.bind({});
|
|
28
28
|
exports.DesignIconButtonTemplate = DesignIconButtonTemplate;
|
|
29
|
-
DesignIconButtonTemplate.parameters = {
|
|
30
|
-
controls: {
|
|
31
|
-
disable: true
|
|
32
|
-
}
|
|
29
|
+
DesignIconButtonTemplate.parameters = {// controls: { disable: true },
|
|
33
30
|
};
|
|
34
31
|
DesignIconButtonTemplate.args = {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
require("../../styles/main.css");
|
|
11
|
+
|
|
12
|
+
var _IconButtonSquare = _interopRequireDefault(require("./IconButtonSquare"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var DesignIconButtonSquare = function DesignIconButtonSquare(_ref) {
|
|
17
|
+
var badge = _ref.badge;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
19
|
+
badge: badge,
|
|
20
|
+
icon: /*#__PURE__*/_react.default.createElement("i", {
|
|
21
|
+
className: "ri-user-3-line"
|
|
22
|
+
})
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var _default = DesignIconButtonSquare;
|
|
27
|
+
exports.default = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.cbx-iconButtonSquare-red-dot {
|
|
2
|
+
position: absolute;
|
|
3
|
+
width: var(--spacing8);
|
|
4
|
+
height: var(--spacing8);
|
|
5
|
+
right: var(--spacing4);
|
|
6
|
+
top: 0.125rem;
|
|
7
|
+
border-radius: 50rem;
|
|
8
|
+
background: #ff3200;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.cbx-iconButtonSquare-red-dot-noText {
|
|
12
|
+
right: -0.813rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.cbx-iconButtonSquare-containerIcon {
|
|
16
|
+
font-size: 1.125rem;
|
|
17
|
+
position: relative;
|
|
18
|
+
color: var(--gray3)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.cbx-iconButtonSquare-containerIcon-active {
|
|
22
|
+
color: var(--primary)
|
|
23
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
require("./IconButtonSquare.css");
|
|
17
|
+
|
|
18
|
+
var _TouchRipple = _interopRequireDefault(require("@mui/material/ButtonBase/TouchRipple"));
|
|
19
|
+
|
|
20
|
+
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
21
|
+
|
|
22
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
|
+
|
|
28
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
|
+
|
|
30
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
|
|
32
|
+
var IconButtonSquare = function IconButtonSquare(_ref) {
|
|
33
|
+
var text = _ref.text,
|
|
34
|
+
icon = _ref.icon,
|
|
35
|
+
active = _ref.active,
|
|
36
|
+
badge = _ref.badge,
|
|
37
|
+
onClick = _ref.onClick,
|
|
38
|
+
styles = _ref.styles,
|
|
39
|
+
tooltip = _ref.tooltip;
|
|
40
|
+
|
|
41
|
+
var rippleRef = _react.default.useRef(null);
|
|
42
|
+
|
|
43
|
+
var onRippleStart = function onRippleStart(e) {
|
|
44
|
+
rippleRef.current.start(e);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var onRippleStop = function onRippleStop(e) {
|
|
48
|
+
rippleRef.current.stop(e);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
52
|
+
onMouseDown: onRippleStart,
|
|
53
|
+
onMouseUp: onRippleStop,
|
|
54
|
+
disableRipple: true,
|
|
55
|
+
sx: _objectSpread({
|
|
56
|
+
width: '4.75rem',
|
|
57
|
+
height: '4.75rem',
|
|
58
|
+
background: active ? 'white' : 'transparent',
|
|
59
|
+
borderRadius: '0'
|
|
60
|
+
}, styles),
|
|
61
|
+
onClick: onClick
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_TouchRipple.default, {
|
|
63
|
+
ref: rippleRef,
|
|
64
|
+
center: false
|
|
65
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
66
|
+
title: tooltip || ''
|
|
67
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
+
className: "cbx-iconButtonSquare-containerIcon ".concat(active ? 'cbx-iconButtonSquare-containerIcon-active' : '')
|
|
69
|
+
}, badge && /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: "cbx-iconButtonSquare-red-dot ".concat(text ? '' : 'cbx-iconButtonSquare-red-dot-noText')
|
|
71
|
+
}), icon)), text && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
72
|
+
variant: 'XS',
|
|
73
|
+
color: active ? 'var(--primary)' : 'var(--gray3)',
|
|
74
|
+
styles: {
|
|
75
|
+
overflow: 'hidden',
|
|
76
|
+
whiteSpace: 'nowrap',
|
|
77
|
+
textOverflow: 'ellipsis',
|
|
78
|
+
maxWidth: '3.25rem'
|
|
79
|
+
}
|
|
80
|
+
}, text))));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
IconButtonSquare.displayName = "IconButtonSquare";
|
|
84
|
+
IconButtonSquare.propTypes = {
|
|
85
|
+
text: _propTypes.default.any,
|
|
86
|
+
icon: _propTypes.default.node,
|
|
87
|
+
active: _propTypes.default.bool,
|
|
88
|
+
badge: _propTypes.default.bool,
|
|
89
|
+
onClick: _propTypes.default.func,
|
|
90
|
+
styles: _propTypes.default.object,
|
|
91
|
+
tooltip: _propTypes.default.string
|
|
92
|
+
};
|
|
93
|
+
IconButtonSquare.defaultProps = {
|
|
94
|
+
text: '',
|
|
95
|
+
icon: undefined,
|
|
96
|
+
active: false,
|
|
97
|
+
badge: false,
|
|
98
|
+
onClick: Function.prototype,
|
|
99
|
+
styles: {},
|
|
100
|
+
tooltip: ''
|
|
101
|
+
};
|
|
102
|
+
var _default = IconButtonSquare;
|
|
103
|
+
exports.default = _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.DesignIconButtonSquareTemplate = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _IconButtonSquare = _interopRequireDefault(require("./IconButtonSquare"));
|
|
11
|
+
|
|
12
|
+
var _DesignIconButtonSquare = _interopRequireDefault(require("./DesignIconButtonSquare.stories"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: 'Example/IconButtonSquare',
|
|
18
|
+
component: _IconButtonSquare.default
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
|
|
22
|
+
var TemplateIconButtonSquare = function TemplateIconButtonSquare(args) {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(_DesignIconButtonSquare.default, args);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
TemplateIconButtonSquare.displayName = "TemplateIconButtonSquare";
|
|
27
|
+
var DesignIconButtonSquareTemplate = TemplateIconButtonSquare.bind({});
|
|
28
|
+
exports.DesignIconButtonSquareTemplate = DesignIconButtonSquareTemplate;
|
|
29
|
+
DesignIconButtonSquareTemplate.parameters = {// controls: { disable: true },
|
|
30
|
+
};
|
|
31
|
+
DesignIconButtonSquareTemplate.args = {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
background: #DBDBDB;
|
|
4
4
|
height: var(--spacing8);
|
|
5
|
-
border-radius:
|
|
5
|
+
border-radius: 1.25rem;
|
|
6
6
|
margin-top: var(--spacing4);
|
|
7
7
|
margin-bottom: var(--spacing4);
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
.cbx-inputPassword-validation > div {
|
|
12
12
|
height: var(--spacing8);
|
|
13
|
-
border-radius:
|
|
13
|
+
border-radius: 1.25rem;
|
|
14
14
|
transition: all .5s;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
}
|
|
5
5
|
.cbx-inputText-infoBtn {
|
|
6
6
|
margin-right: var(--spacing4);
|
|
7
|
-
height:
|
|
7
|
+
height: 0.875rem;
|
|
8
8
|
line-height: 1.1;
|
|
9
|
-
font-size:
|
|
9
|
+
font-size: 0.875rem;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.cbx-inputText-endAdornment {
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
margin-top: var(--spacing12);
|
|
15
15
|
margin-bottom: var(--spacing12);
|
|
16
16
|
color: var(--success);
|
|
17
|
-
font-size:
|
|
17
|
+
font-size: 1.188rem;
|
|
18
18
|
}
|
|
@@ -47,13 +47,13 @@ var CssTextField = (0, _styled.default)(_TextField.default)(function () {
|
|
|
47
47
|
marginRight: '0px'
|
|
48
48
|
},
|
|
49
49
|
'& .MuiInputBase-input': {
|
|
50
|
-
height: '
|
|
50
|
+
height: '1.5rem',
|
|
51
51
|
lineHeight: 'var(--spacing12)',
|
|
52
52
|
padding: 'var(--spacing12)',
|
|
53
53
|
paddingRight: 'var(--spacing8)'
|
|
54
54
|
},
|
|
55
55
|
'& .MuiFormLabel-root': {
|
|
56
|
-
top: '-
|
|
56
|
+
top: '-0.25rem'
|
|
57
57
|
},
|
|
58
58
|
'& .Mui-error': {
|
|
59
59
|
color: 'var(--error)'
|
|
@@ -157,8 +157,8 @@ var InputText = function InputText(_ref) {
|
|
|
157
157
|
id: id,
|
|
158
158
|
className: className,
|
|
159
159
|
sx: {
|
|
160
|
-
minWidth: width || '
|
|
161
|
-
height: '
|
|
160
|
+
minWidth: width || '15rem',
|
|
161
|
+
height: '3rem'
|
|
162
162
|
},
|
|
163
163
|
label: label,
|
|
164
164
|
fullWidth: fullWidth,
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.cbx-menuLateralRight-block {
|
|
2
|
+
height: 100%;
|
|
3
|
+
min-width: 4.75rem;
|
|
4
|
+
width: 4.75rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.cbx-menuLateralRight-block-resize {
|
|
8
|
+
min-width: var(--spacing64);
|
|
9
|
+
width: var(--spacing64);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.cbx-menuLateralRight-block,
|
|
13
|
+
.cbx-menuLateralRight-block-mobile {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cbx-menuLateralRight-block-mobile {
|
|
18
|
+
height: var(--spacing64);
|
|
19
|
+
min-width: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cbx-menuLateralRight-block,
|
|
25
|
+
.cbx-menuLateralRight-block-mobile {
|
|
26
|
+
background: var(--gray1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.cbx-menuLateralRight-block-mobile,
|
|
30
|
+
.cbx-menuLateralRight-block-upper-mobile,
|
|
31
|
+
.cbx-menuLateralRight-icon-burguer-mobile,
|
|
32
|
+
.cbx-menuLateralRight-block-under-mobile,
|
|
33
|
+
.cbx-menuLateralRight-container-under,
|
|
34
|
+
.cbx-menuLateralRight-container-under-mobile {
|
|
35
|
+
display: flex;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cbx-menuLateralRight-block-upper-mobile,
|
|
39
|
+
.cbx-menuLateralRight-block-mobile,
|
|
40
|
+
.cbx-menuLateralRight-block-under-mobile {
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.cbx-menuLateralRight-block-under {
|
|
45
|
+
bottom: 0;
|
|
46
|
+
left: 0;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.cbx-menuLateralRight-block-under,
|
|
51
|
+
.cbx-menuLateralRight-icon-burguer-mobile-red-dot {
|
|
52
|
+
position: absolute;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.cbx-menuLateralRight-icon-burguer-mobile {
|
|
56
|
+
font-size: 1.125rem;
|
|
57
|
+
margin-right: var(--spacing8);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.cbx-menuLateralRight-container-under {
|
|
61
|
+
margin-bottom: var(--spacing12);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cbx-menuLateralRight-container-under,
|
|
65
|
+
.cbx-menuLateralRight-container-under-mobile {
|
|
66
|
+
justify-content: center;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cbx-menuLateralRight-container-under-mobile {
|
|
70
|
+
margin-right: var(--spacing12);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.cbx-menuLateralRight-icon-burguer-mobile-red-dot {
|
|
74
|
+
width: var(--spacing8);
|
|
75
|
+
height: var(--spacing8);
|
|
76
|
+
top: -0.188rem;
|
|
77
|
+
right: -0.438rem;
|
|
78
|
+
border-radius: 50rem;
|
|
79
|
+
background: #ff3200;
|
|
80
|
+
}
|
|
@@ -13,18 +13,173 @@ require("../../styles/main.css");
|
|
|
13
13
|
|
|
14
14
|
require("./MenuLateralRight.css");
|
|
15
15
|
|
|
16
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
17
|
+
|
|
18
|
+
var _useWindowSize2 = _interopRequireDefault(require("../../HOCs/useWindowSize"));
|
|
19
|
+
|
|
20
|
+
var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
|
|
21
|
+
|
|
22
|
+
var _DropDown = _interopRequireDefault(require("../DropDown/DropDown"));
|
|
23
|
+
|
|
24
|
+
var _IconButtonSquare = _interopRequireDefault(require("../IconButtonSquare/IconButtonSquare"));
|
|
25
|
+
|
|
16
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
27
|
|
|
18
|
-
var
|
|
19
|
-
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
+
|
|
32
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
+
|
|
34
|
+
var MenuLateralRight = function MenuLateralRight(_ref) {
|
|
35
|
+
var id = _ref.id,
|
|
36
|
+
upperSection = _ref.upperSection,
|
|
37
|
+
underSection = _ref.underSection,
|
|
38
|
+
mobile = _ref.mobile,
|
|
39
|
+
buttonVideo = _ref.buttonVideo;
|
|
40
|
+
|
|
41
|
+
var _useWindowSize = (0, _useWindowSize2.default)(),
|
|
42
|
+
innerWidth = _useWindowSize.innerWidth,
|
|
43
|
+
breakpoints = _useWindowSize.breakpoints;
|
|
44
|
+
|
|
45
|
+
var iconSelectDropDown = function iconSelectDropDown() {
|
|
46
|
+
var upperSectionFilter = upperSection.filter(function (item) {
|
|
47
|
+
return item.active;
|
|
48
|
+
});
|
|
49
|
+
return upperSectionFilter.length > 0 ? upperSectionFilter[0] : {};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var badgeBurguer = function badgeBurguer() {
|
|
53
|
+
var upperSectionFilter = upperSection.filter(function (item) {
|
|
54
|
+
return item.badge;
|
|
55
|
+
});
|
|
56
|
+
return upperSectionFilter.length > 0 ? upperSectionFilter[0] : {};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var resize = function resize() {
|
|
60
|
+
return window.innerHeight < 665 || innerWidth < breakpoints.md;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
+
id: id,
|
|
65
|
+
className: mobile ? 'cbx-menuLateralRight-block-mobile' : "cbx-menuLateralRight-block ".concat(resize() ? 'cbx-menuLateralRight-block-resize' : '')
|
|
66
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
+
className: mobile ? 'cbx-menuLateralRight-block-upper-mobile' : 'cbx-menuLateralRight-block-upper'
|
|
68
|
+
}, resize() ? /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
style: {
|
|
70
|
+
display: mobile && 'flex'
|
|
71
|
+
}
|
|
72
|
+
}, buttonVideo && (innerWidth < breakpoints.md || mobile) && /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
73
|
+
icon: buttonVideo.icon,
|
|
74
|
+
active: buttonVideo.active,
|
|
75
|
+
onClick: buttonVideo.action,
|
|
76
|
+
badge: buttonVideo.badge,
|
|
77
|
+
styles: _objectSpread({}, resize() ? {
|
|
78
|
+
width: 'var(--spacing64)',
|
|
79
|
+
height: 'var(--spacing64)'
|
|
80
|
+
} : {})
|
|
81
|
+
}), /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
82
|
+
icon: iconSelectDropDown().icon,
|
|
83
|
+
active: buttonVideo.active ? false : iconSelectDropDown().active,
|
|
84
|
+
onClick: iconSelectDropDown().action,
|
|
85
|
+
badge: iconSelectDropDown().badge,
|
|
86
|
+
styles: _objectSpread({}, resize() ? {
|
|
87
|
+
width: 'var(--spacing64)',
|
|
88
|
+
height: 'var(--spacing64)'
|
|
89
|
+
} : {})
|
|
90
|
+
}), /*#__PURE__*/_react.default.createElement(_DropDown.default, {
|
|
91
|
+
color: "transparent",
|
|
92
|
+
Component: function Component() {
|
|
93
|
+
return /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
94
|
+
icon: /*#__PURE__*/_react.default.createElement("i", {
|
|
95
|
+
className: 'ri-menu-line'
|
|
96
|
+
}),
|
|
97
|
+
badge: badgeBurguer().badge,
|
|
98
|
+
styles: _objectSpread({}, resize() ? {
|
|
99
|
+
width: 'var(--spacing64)',
|
|
100
|
+
height: 'var(--spacing64)'
|
|
101
|
+
} : {})
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
items: upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
|
|
105
|
+
return !item.active && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
106
|
+
key: "upper-section-".concat(index),
|
|
107
|
+
onClick: item.action
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
+
className: 'cbx-menuLateralRight-icon-burguer-mobile',
|
|
110
|
+
style: {
|
|
111
|
+
position: 'relative'
|
|
112
|
+
}
|
|
113
|
+
}, item.badge && /*#__PURE__*/_react.default.createElement("div", {
|
|
114
|
+
className: "cbx-menuLateralRight-icon-burguer-mobile-red-dot"
|
|
115
|
+
}), item.icon), /*#__PURE__*/_react.default.createElement("div", null, item.text));
|
|
116
|
+
}),
|
|
117
|
+
anchorOrigin: _objectSpread({}, !mobile ? {
|
|
118
|
+
vertical: 'center',
|
|
119
|
+
horizontal: 'left'
|
|
120
|
+
} : {
|
|
121
|
+
vertical: 'top',
|
|
122
|
+
horizontal: 'center'
|
|
123
|
+
}),
|
|
124
|
+
transformOrigin: _objectSpread({}, !mobile ? {
|
|
125
|
+
vertical: 'top',
|
|
126
|
+
horizontal: 'right'
|
|
127
|
+
} : {
|
|
128
|
+
vertical: 'bottom',
|
|
129
|
+
horizontal: 'left'
|
|
130
|
+
})
|
|
131
|
+
})) : upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
|
|
132
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
+
key: "upper-section-".concat(index)
|
|
134
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
|
|
135
|
+
icon: item.icon,
|
|
136
|
+
text: !mobile && item.text,
|
|
137
|
+
tooltip: item.text,
|
|
138
|
+
active: item.active,
|
|
139
|
+
onClick: item.action,
|
|
140
|
+
badge: item.badge,
|
|
141
|
+
styles: _objectSpread({}, mobile ? {
|
|
142
|
+
width: 'var(--spacing64)',
|
|
143
|
+
height: 'var(--spacing64)'
|
|
144
|
+
} : {})
|
|
145
|
+
}));
|
|
146
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
147
|
+
className: mobile ? 'cbx-menuLateralRight-block-under-mobile' : 'cbx-menuLateralRight-block-under'
|
|
148
|
+
}, underSection === null || underSection === void 0 ? void 0 : underSection.map(function (item, index) {
|
|
149
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
150
|
+
key: "under-section-".concat(index),
|
|
151
|
+
className: mobile ? 'cbx-menuLateralRight-container-under-mobile' : 'cbx-menuLateralRight-container-under'
|
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
153
|
+
tooltip: item.text,
|
|
154
|
+
icon: item.icon,
|
|
155
|
+
badge: item.badge,
|
|
156
|
+
onClick: item.action,
|
|
157
|
+
styles: _objectSpread({}, item.active ? {
|
|
158
|
+
color: 'white',
|
|
159
|
+
backgroundColor: 'var(--primary)',
|
|
160
|
+
'&&:hover': {
|
|
161
|
+
backgroundColor: '#272762'
|
|
162
|
+
}
|
|
163
|
+
} : {}),
|
|
164
|
+
rounded: true
|
|
165
|
+
}));
|
|
166
|
+
})));
|
|
20
167
|
};
|
|
21
168
|
|
|
22
169
|
MenuLateralRight.displayName = "MenuLateralRight";
|
|
23
170
|
MenuLateralRight.propTypes = {
|
|
24
|
-
id: _propTypes.default.string
|
|
171
|
+
id: _propTypes.default.string,
|
|
172
|
+
mobile: _propTypes.default.bool,
|
|
173
|
+
upperSection: _propTypes.default.array,
|
|
174
|
+
underSection: _propTypes.default.array,
|
|
175
|
+
buttonVideo: _propTypes.default.object
|
|
25
176
|
};
|
|
26
177
|
MenuLateralRight.defaultProps = {
|
|
27
|
-
id: ''
|
|
178
|
+
id: '',
|
|
179
|
+
mobile: false,
|
|
180
|
+
upperSection: [],
|
|
181
|
+
underSection: [],
|
|
182
|
+
buttonVideo: {}
|
|
28
183
|
};
|
|
29
184
|
var _default = MenuLateralRight;
|
|
30
185
|
exports.default = _default;
|
|
@@ -14,7 +14,7 @@ var _MenuLateralRight2 = _interopRequireDefault(require("./MenuLateralRight.stor
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
var _default = {
|
|
17
|
-
title: 'Example/
|
|
17
|
+
title: 'Example/MenuLateralRight',
|
|
18
18
|
component: _MenuLateralRight.default
|
|
19
19
|
};
|
|
20
20
|
exports.default = _default;
|
|
@@ -26,9 +26,5 @@ var TemplateMenuLateralRight = function TemplateMenuLateralRight(args) {
|
|
|
26
26
|
TemplateMenuLateralRight.displayName = "TemplateMenuLateralRight";
|
|
27
27
|
var DesignMenuLateralRightTemplate = TemplateMenuLateralRight.bind({});
|
|
28
28
|
exports.DesignMenuLateralRightTemplate = DesignMenuLateralRightTemplate;
|
|
29
|
-
DesignMenuLateralRightTemplate.parameters = {
|
|
30
|
-
controls: {
|
|
31
|
-
disable: true
|
|
32
|
-
}
|
|
33
|
-
};
|
|
29
|
+
DesignMenuLateralRightTemplate.parameters = {};
|
|
34
30
|
DesignMenuLateralRightTemplate.args = {};
|