@councilbox/councilbox-ui 1.0.0 → 2.0.0
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/useDynamicStyles.js +99 -0
- package/dist/HOCs/useRipple.js +91 -0
- package/dist/build-index.js +8 -0
- package/dist/components/1.Introduction.stories.mdx +2 -1
- package/dist/components/2.Changelog.stories.mdx +7 -0
- package/dist/components/3.Guide.stories.mdx +56 -0
- package/dist/components/Accordion/Accordion.css +39 -1
- package/dist/components/Accordion/Accordion.js +84 -45
- package/dist/components/Accordion/Accordion.stories.js +4 -2
- package/dist/components/Accordion/AccordionOld.css +16 -0
- package/dist/components/Accordion/AccordionOld.js +115 -0
- package/dist/components/Accordion/DesignAccordion.stories.js +38 -0
- package/dist/components/Alert/Alert.css +5 -0
- package/dist/components/Alert/Alert.js +17 -6
- package/dist/components/Avatar/Avatar.css +3 -3
- package/dist/components/Avatar/Avatar.js +36 -20
- package/dist/components/Avatar/AvatarOld.js +138 -0
- package/dist/components/Avatar/DesignAvatar.stories.js +1 -1
- package/dist/components/Block/Block.js +17 -2
- package/dist/components/ButtonBasic/ButtonBasic.css +264 -20
- package/dist/components/ButtonBasic/ButtonBasic.js +85 -110
- package/dist/components/ButtonBasic/ButtonBasicOld.css +41 -0
- package/dist/components/ButtonBasic/ButtonBasicOld.js +231 -0
- package/dist/components/Checkbox/Checkbox.css +101 -22
- package/dist/components/Checkbox/Checkbox.js +119 -63
- package/dist/components/Checkbox/CheckboxOld.css +31 -0
- package/dist/components/Checkbox/CheckboxOld.js +112 -0
- package/dist/components/DragDrop/DragDrop.js +24 -9
- package/dist/components/DrawerPanel/DesignDrawerPanel.js +4 -2
- package/dist/components/DrawerPanel/DrawerPanel.css +76 -36
- package/dist/components/DrawerPanel/DrawerPanel.js +137 -115
- package/dist/components/DrawerPanel/DrawerPanelOld.css +56 -0
- package/dist/components/DrawerPanel/DrawerPanelOld.js +233 -0
- package/dist/components/DropDown/DesignDropDown.stories.js +146 -17
- package/dist/components/DropDown/DropDown.css +96 -1
- package/dist/components/DropDown/DropDown.js +363 -82
- package/dist/components/DropDown/DropDown.stories.js +1 -0
- package/dist/components/DropDown/DropDownOld.css +3 -0
- package/dist/components/DropDown/DropDownOld.js +186 -0
- package/dist/components/DropDown/PopoverPlayground.css +22 -0
- package/dist/components/DropDown/PopoverPlayground.js +235 -0
- package/dist/components/EnhancedTable/EnhancedTable.js +5 -6
- package/dist/components/FabButton/DesignFabButton.stories.js +3 -1
- package/dist/components/FabButton/FabButton.js +25 -5
- package/dist/components/Grid/DesignGrid.stories.js +9 -3
- package/dist/components/Grid/Grid.css +325 -0
- package/dist/components/Grid/Grid.js +57 -16
- package/dist/components/Grid/GridItem.js +31 -13
- package/dist/components/Grid/GridItemOld.js +43 -0
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +53 -0
- package/dist/components/Header/Header.js +144 -115
- package/dist/components/IconButton/DesignIconButton.stories.js +37 -2
- package/dist/components/IconButton/IconButton.css +144 -0
- package/dist/components/IconButton/IconButton.js +177 -50
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +138 -0
- package/dist/components/IconButtonSquare/IconButtonSquare.js +20 -90
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +43 -0
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +133 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.css +109 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.js +316 -77
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +118 -6
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +5 -0
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +178 -0
- package/dist/components/InputPassword/InputPassword.js +10 -20
- package/dist/components/InputText/InputText.css +442 -1
- package/dist/components/InputText/InputText.js +298 -239
- package/dist/components/InputText/InputText.stories.js +12 -3
- package/dist/components/InputText/InputTextOld.css +10 -0
- package/dist/components/InputText/InputTextOld.js +340 -0
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +30 -4
- package/dist/components/InputTextArea/InputTextArea.js +13 -6
- package/dist/components/LoadingSection/LoadingSection.css +44 -2
- package/dist/components/LoadingSection/LoadingSection.js +63 -9
- package/dist/components/MenuItem/DesignMenuItem.stories.js +1 -0
- package/dist/components/MenuItem/MenuItem.css +31 -6
- package/dist/components/MenuItem/MenuItem.js +95 -50
- package/dist/components/MenuItem/MenuItemOld.js +139 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +60 -40
- package/dist/components/MenuLateralRight/MenuLateralRight.js +32 -12
- package/dist/components/Modal/DesignModal.stories.js +54 -0
- package/dist/components/Modal/Modal.css +81 -2
- package/dist/components/Modal/Modal.js +112 -80
- package/dist/components/Modal/Modal.stories.js +13 -2
- package/dist/components/Modal/ModalOld.css +3 -0
- package/dist/components/Modal/ModalOld.js +230 -0
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +9 -1
- package/dist/components/PaginationFooter/PaginationFooter.css +73 -0
- package/dist/components/PaginationFooter/PaginationFooter.js +45 -87
- package/dist/components/RadioButton/Radio.css +115 -16
- package/dist/components/RadioButton/Radio.js +70 -94
- package/dist/components/RadioButton/Radio.stories.js +42 -18
- package/dist/components/RadioButton/RadioOld.css +31 -0
- package/dist/components/RadioButton/RadioOld.js +142 -0
- package/dist/components/Ripple/DesignRipple.js +77 -0
- package/dist/components/Ripple/Ripple.stories.js +45 -0
- package/dist/components/Scrollbar/Scrollbar.js +21 -6
- package/dist/components/SelectInput/DesignSelectInput.js +62 -23
- package/dist/components/SelectInput/SelectInput.css +128 -10
- package/dist/components/SelectInput/SelectInput.js +233 -246
- package/dist/components/SelectInput/SelectInputOld.css +17 -0
- package/dist/components/SelectInput/SelectInputOld.js +325 -0
- package/dist/components/Stars/Stars.css +28 -28
- package/dist/components/Stars/Stars.js +22 -12
- package/dist/components/Stepper/Stepper.css +1 -0
- package/dist/components/Stepper/Stepper.js +81 -24
- package/dist/components/Table/DesignTable.stories.js +1 -0
- package/dist/components/Table/Table.css +56 -53
- package/dist/components/Table/Table.js +55 -75
- package/dist/components/Table/TableOld.css +79 -0
- package/dist/components/Table/TableOld.js +165 -0
- package/dist/components/Tabs/DesignTabs.js +37 -12
- package/dist/components/Tabs/Tabs.css +39 -4
- package/dist/components/Tabs/Tabs.js +194 -30
- package/dist/components/Tabs/Tabs.stories.js +8 -1
- package/dist/components/Tabs/TabsOld.js +92 -0
- package/dist/components/Tag/Tag.js +19 -9
- package/dist/components/Toggle/Toggle.css +122 -3
- package/dist/components/Toggle/Toggle.js +95 -68
- package/dist/components/Tooltip/DesignTooltip.stories.js +48 -0
- package/dist/components/Tooltip/Tooltip.css +75 -0
- package/dist/components/Tooltip/Tooltip.js +126 -0
- package/dist/components/Tooltip/Tooltip.stories.js +40 -0
- package/dist/components/Typography/Typography.css +9 -0
- package/dist/components/Typography/Typography.js +30 -21
- package/dist/components/Typography/TypographyOld.js +132 -0
- package/dist/styles/colorConsts.css +24 -0
- package/dist/styles/main.css +41 -49
- package/dist/styles/scpacingConsts.css +26 -0
- package/dist/styles/zIndexConsts.css +9 -0
- package/package.json +2 -1
|
@@ -3,11 +3,37 @@
|
|
|
3
3
|
overflow: hidden
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.cbx-menuItem {
|
|
7
|
+
padding: 0.75rem 1.25rem;
|
|
8
|
+
min-width: 13.75rem;
|
|
9
|
+
max-height: 3rem;
|
|
10
|
+
max-width: 17.5rem;
|
|
11
|
+
position: relative;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cbx-menuItem.cbx-menuItem-active{
|
|
18
|
+
background-color: var(--primary10);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.cbx-menuItem-fullWidth{
|
|
22
|
+
width: 100%;
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.cbx-menuItem:hover {
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
background-color: var(--gray1);
|
|
29
|
+
}
|
|
30
|
+
|
|
6
31
|
.cbx-menuItem-container {
|
|
7
|
-
|
|
32
|
+
justify-content: space-between;
|
|
8
33
|
}
|
|
9
34
|
|
|
10
|
-
.cbx-menuItem-container,
|
|
35
|
+
.cbx-menuItem-container,
|
|
36
|
+
.cbx-menuItem-container-typography {
|
|
11
37
|
width: 100%;
|
|
12
38
|
}
|
|
13
39
|
|
|
@@ -32,6 +58,7 @@
|
|
|
32
58
|
|
|
33
59
|
.cbx-menuItem-container-icon-right i {
|
|
34
60
|
font-size: 1.5rem;
|
|
61
|
+
color: var(--gray4);
|
|
35
62
|
}
|
|
36
63
|
|
|
37
64
|
.cbx-menuItem-container-icon,
|
|
@@ -64,8 +91,6 @@
|
|
|
64
91
|
right: 0.063rem;
|
|
65
92
|
}
|
|
66
93
|
|
|
67
|
-
.cbx-menuItem-
|
|
68
|
-
width: 100
|
|
69
|
-
min-width: 100%!important;
|
|
70
|
-
max-width: 100%!important;
|
|
94
|
+
.cbx-menuItem-combinedDropdown {
|
|
95
|
+
width: 100%;
|
|
71
96
|
}
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
9
|
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
11
|
|
|
12
|
+
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
13
|
+
|
|
14
14
|
require("../../styles/main.css");
|
|
15
15
|
|
|
16
16
|
require("./MenuItem.css");
|
|
@@ -19,7 +19,11 @@ var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
|
19
19
|
|
|
20
20
|
var _DropDown = _interopRequireDefault(require("../DropDown/DropDown"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
23
|
+
|
|
24
|
+
var _useRipple3 = _interopRequireDefault(require("../../HOCs/useRipple"));
|
|
25
|
+
|
|
26
|
+
var _excluded = ["id", "children", "icon", "sx", "badge", "menuItems", "setOpen", "onClick", "endIcon", "className", "style", "active", "fullWidth", "value"];
|
|
23
27
|
|
|
24
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
29
|
|
|
@@ -31,6 +35,18 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
31
35
|
|
|
32
36
|
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
37
|
|
|
38
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
+
|
|
40
|
+
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."); }
|
|
41
|
+
|
|
42
|
+
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); }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
47
|
+
|
|
48
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
+
|
|
34
50
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
35
51
|
|
|
36
52
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -46,67 +62,101 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
46
62
|
onClick = _ref.onClick,
|
|
47
63
|
endIcon = _ref.endIcon,
|
|
48
64
|
className = _ref.className,
|
|
65
|
+
style = _ref.style,
|
|
66
|
+
active = _ref.active,
|
|
49
67
|
fullWidth = _ref.fullWidth,
|
|
68
|
+
value = _ref.value,
|
|
50
69
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
70
|
|
|
71
|
+
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
72
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
73
|
+
prefixClass = _useDynamicStyles.prefixClass;
|
|
74
|
+
|
|
75
|
+
var _useRipple = (0, _useRipple3.default)(),
|
|
76
|
+
_useRipple2 = _slicedToArray(_useRipple, 2),
|
|
77
|
+
addRipple = _useRipple2[0],
|
|
78
|
+
ripples = _useRipple2[1];
|
|
79
|
+
|
|
80
|
+
var typographyRef = _react.default.useRef(null);
|
|
81
|
+
|
|
82
|
+
var _React$useState = _react.default.useState(false),
|
|
83
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
84
|
+
isEllipsisActive = _React$useState2[0],
|
|
85
|
+
setIsEllipsisActive = _React$useState2[1];
|
|
86
|
+
|
|
87
|
+
var handleClick = function handleClick(e) {
|
|
88
|
+
addRipple(e);
|
|
89
|
+
if (onClick) onClick(e);
|
|
90
|
+
if (setOpen) setOpen();
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
_react.default.useEffect(function () {
|
|
94
|
+
if (typographyRef.current) {
|
|
95
|
+
var isEllipsis = typographyRef.current.scrollWidth > typographyRef.current.clientWidth;
|
|
96
|
+
setIsEllipsisActive(isEllipsis);
|
|
97
|
+
}
|
|
98
|
+
}, [children]);
|
|
99
|
+
|
|
100
|
+
var extractText = function extractText(child) {
|
|
101
|
+
return _react.default.Children.toArray(child).reduce(function (text, item) {
|
|
102
|
+
if (typeof item === 'string') {
|
|
103
|
+
return text + item;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if ( /*#__PURE__*/_react.default.isValidElement(item)) {
|
|
107
|
+
return text + extractText(item.props.children);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return text;
|
|
111
|
+
}, '');
|
|
112
|
+
};
|
|
113
|
+
|
|
52
114
|
var getContent = function getContent() {
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement("li", _extends({
|
|
54
116
|
id: id,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
'&.MuiButtonBase-root.MuiMenuItem-root:hover': {
|
|
65
|
-
background: 'var(--gray1)'
|
|
66
|
-
}
|
|
67
|
-
}, sx)
|
|
68
|
-
}, props, {
|
|
69
|
-
onClick: onClick || setOpen,
|
|
70
|
-
className: "cbx-menuItem ".concat(className || '')
|
|
71
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
72
|
-
className: "cbx-menuItem-container"
|
|
117
|
+
className: prefixClass("cbx-menuItem ".concat(className || '', " cbx-ripple ").concat(active ? 'cbx-menuItem-active' : '', " ").concat(fullWidth ? 'cbx-menuItem-fullWidth' : '')),
|
|
118
|
+
onClick: function onClick(e) {
|
|
119
|
+
return handleClick(e);
|
|
120
|
+
},
|
|
121
|
+
style: _objectSpread(_objectSpread({}, style), stylesInLine),
|
|
122
|
+
value: "".concat(value)
|
|
123
|
+
}, props), /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
+
className: prefixClass('cbx-menuItem-container')
|
|
73
125
|
}, icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
-
className:
|
|
126
|
+
className: prefixClass('cbx-menuItem-container-icon')
|
|
75
127
|
}, badge && /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
-
className:
|
|
128
|
+
className: prefixClass('cbx-menuItem-badge-icon')
|
|
77
129
|
}), typeof icon === 'string' ? /*#__PURE__*/_react.default.createElement("i", {
|
|
78
130
|
className: icon
|
|
79
131
|
}) : icon), /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
-
className:
|
|
132
|
+
className: prefixClass('cbx-menuItem-container-typography'),
|
|
81
133
|
style: {
|
|
82
134
|
paddingRight: badge && !icon && '1.188rem'
|
|
83
135
|
}
|
|
136
|
+
}, /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
137
|
+
title: isEllipsisActive ? extractText(children) : ''
|
|
84
138
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
85
139
|
color: 'var(--black)',
|
|
140
|
+
prefixClass: prefixClass,
|
|
141
|
+
ref: typographyRef,
|
|
86
142
|
styles: {
|
|
87
143
|
whiteSpace: 'nowrap',
|
|
88
144
|
textOverflow: 'ellipsis',
|
|
89
145
|
overflow: 'hidden'
|
|
90
146
|
}
|
|
91
|
-
}, children), badge && !icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
-
className:
|
|
147
|
+
}, children)), badge && !icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
+
className: prefixClass('cbx-menuItem-badge-typography')
|
|
93
149
|
})), (menuItems || endIcon) && /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
-
className:
|
|
150
|
+
className: prefixClass('cbx-menuItem-container-icon-right')
|
|
95
151
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
96
152
|
className: endIcon || 'ri-arrow-right-s-line'
|
|
97
|
-
}))));
|
|
153
|
+
}))), ripples);
|
|
98
154
|
};
|
|
99
155
|
|
|
100
156
|
return menuItems ? /*#__PURE__*/_react.default.createElement(_DropDown.default, {
|
|
101
157
|
Component: function Component() {
|
|
102
158
|
return getContent();
|
|
103
159
|
},
|
|
104
|
-
sx: {
|
|
105
|
-
'& .MuiPopover-paper': {
|
|
106
|
-
marginLeft: '-0.5rem',
|
|
107
|
-
boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
160
|
anchorOrigin: {
|
|
111
161
|
vertical: 'center',
|
|
112
162
|
horizontal: 'right'
|
|
@@ -115,27 +165,22 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
115
165
|
vertical: 'center',
|
|
116
166
|
horizontal: 'left'
|
|
117
167
|
},
|
|
118
|
-
items: menuItems
|
|
168
|
+
items: menuItems,
|
|
169
|
+
className: 'cbx-menuItem-combinedDropdown'
|
|
119
170
|
}) : getContent();
|
|
120
171
|
};
|
|
121
172
|
|
|
122
173
|
MenuItem.propTypes = {
|
|
123
|
-
badge: _propTypes.default.bool,
|
|
124
174
|
id: _propTypes.default.string,
|
|
125
|
-
children: _propTypes.default.
|
|
126
|
-
icon: _propTypes.default.string,
|
|
127
|
-
|
|
175
|
+
children: _propTypes.default.node,
|
|
176
|
+
icon: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
177
|
+
sx: _propTypes.default.object,
|
|
178
|
+
badge: _propTypes.default.bool,
|
|
179
|
+
menuItems: _propTypes.default.node,
|
|
128
180
|
setOpen: _propTypes.default.func,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
badge: false,
|
|
133
|
-
id: '',
|
|
134
|
-
children: '',
|
|
135
|
-
icon: '',
|
|
136
|
-
menuItems: '',
|
|
137
|
-
setOpen: undefined,
|
|
138
|
-
endIcon: ''
|
|
181
|
+
onClick: _propTypes.default.func,
|
|
182
|
+
endIcon: _propTypes.default.string,
|
|
183
|
+
className: _propTypes.default.string
|
|
139
184
|
};
|
|
140
185
|
var _default = MenuItem;
|
|
141
186
|
exports.default = _default;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
require("../../styles/main.css");
|
|
15
|
+
|
|
16
|
+
require("./MenuItem.css");
|
|
17
|
+
|
|
18
|
+
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
19
|
+
|
|
20
|
+
var _DropDown = _interopRequireDefault(require("../DropDown/DropDown"));
|
|
21
|
+
|
|
22
|
+
var _excluded = ["id", "children", "icon", "sx", "badge", "menuItems", "setOpen", "onClick", "endIcon", "className"];
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
27
|
+
|
|
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
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
35
|
+
|
|
36
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
37
|
+
|
|
38
|
+
var MenuItem = function MenuItem(_ref) {
|
|
39
|
+
var id = _ref.id,
|
|
40
|
+
children = _ref.children,
|
|
41
|
+
icon = _ref.icon,
|
|
42
|
+
sx = _ref.sx,
|
|
43
|
+
badge = _ref.badge,
|
|
44
|
+
menuItems = _ref.menuItems,
|
|
45
|
+
setOpen = _ref.setOpen,
|
|
46
|
+
onClick = _ref.onClick,
|
|
47
|
+
endIcon = _ref.endIcon,
|
|
48
|
+
className = _ref.className,
|
|
49
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
|
|
51
|
+
var getContent = function getContent() {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, _extends({
|
|
53
|
+
id: id,
|
|
54
|
+
sx: _objectSpread({
|
|
55
|
+
padding: '0.75rem 1.25rem!important',
|
|
56
|
+
minWidth: '13.75rem!important',
|
|
57
|
+
maxHeight: '3rem!important',
|
|
58
|
+
maxWidth: '17.5rem!important',
|
|
59
|
+
'&.MuiButtonBase-root.MuiMenuItem-root.Mui-selected': {
|
|
60
|
+
background: 'var(--gray1)'
|
|
61
|
+
},
|
|
62
|
+
'&.MuiButtonBase-root.MuiMenuItem-root:hover': {
|
|
63
|
+
background: 'var(--gray1)'
|
|
64
|
+
}
|
|
65
|
+
}, sx)
|
|
66
|
+
}, props, {
|
|
67
|
+
onClick: onClick || setOpen,
|
|
68
|
+
className: "cbx-menuItem ".concat(className)
|
|
69
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
70
|
+
className: "cbx-menuItem-container"
|
|
71
|
+
}, icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
72
|
+
className: "cbx-menuItem-container-icon"
|
|
73
|
+
}, badge && /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
+
className: "cbx-menuItem-badge-icon"
|
|
75
|
+
}), typeof icon === 'string' ? /*#__PURE__*/_react.default.createElement("i", {
|
|
76
|
+
className: icon
|
|
77
|
+
}) : icon), /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: "cbx-menuItem-container-typography",
|
|
79
|
+
style: {
|
|
80
|
+
paddingRight: badge && !icon && '1.188rem'
|
|
81
|
+
}
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
83
|
+
color: 'var(--black)',
|
|
84
|
+
styles: {
|
|
85
|
+
whiteSpace: 'nowrap',
|
|
86
|
+
textOverflow: 'ellipsis',
|
|
87
|
+
overflow: 'hidden'
|
|
88
|
+
}
|
|
89
|
+
}, children), badge && !icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
90
|
+
className: "cbx-menuItem-badge-typography"
|
|
91
|
+
})), (menuItems || endIcon) && /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: "cbx-menuItem-container-icon-right"
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
94
|
+
className: endIcon || 'ri-arrow-right-s-line'
|
|
95
|
+
}))));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return menuItems ? /*#__PURE__*/_react.default.createElement(_DropDown.default, {
|
|
99
|
+
Component: function Component() {
|
|
100
|
+
return getContent();
|
|
101
|
+
},
|
|
102
|
+
sx: {
|
|
103
|
+
'& .MuiPopover-paper': {
|
|
104
|
+
marginLeft: '-0.5rem',
|
|
105
|
+
boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.25)'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
anchorOrigin: {
|
|
109
|
+
vertical: 'center',
|
|
110
|
+
horizontal: 'right'
|
|
111
|
+
},
|
|
112
|
+
transformOrigin: {
|
|
113
|
+
vertical: 'center',
|
|
114
|
+
horizontal: 'left'
|
|
115
|
+
},
|
|
116
|
+
items: menuItems
|
|
117
|
+
}) : getContent();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
MenuItem.propTypes = {
|
|
121
|
+
badge: _propTypes.default.bool,
|
|
122
|
+
id: _propTypes.default.string,
|
|
123
|
+
children: _propTypes.default.string,
|
|
124
|
+
icon: _propTypes.default.string,
|
|
125
|
+
menuItems: _propTypes.default.any,
|
|
126
|
+
setOpen: _propTypes.default.func,
|
|
127
|
+
endIcon: _propTypes.default.string
|
|
128
|
+
};
|
|
129
|
+
MenuItem.defaultProps = {
|
|
130
|
+
badge: false,
|
|
131
|
+
id: '',
|
|
132
|
+
children: '',
|
|
133
|
+
icon: '',
|
|
134
|
+
menuItems: '',
|
|
135
|
+
setOpen: undefined,
|
|
136
|
+
endIcon: ''
|
|
137
|
+
};
|
|
138
|
+
var _default = MenuItem;
|
|
139
|
+
exports.default = _default;
|
|
@@ -13,7 +13,7 @@ require("../../styles/main.css");
|
|
|
13
13
|
|
|
14
14
|
require("./MenuLateralLeft.css");
|
|
15
15
|
|
|
16
|
-
var _MenuItem = _interopRequireDefault(require("
|
|
16
|
+
var _MenuItem = _interopRequireDefault(require("../MenuItem/MenuItem"));
|
|
17
17
|
|
|
18
18
|
var _useWindowSize2 = _interopRequireDefault(require("../../HOCs/useWindowSize"));
|
|
19
19
|
|
|
@@ -29,6 +29,8 @@ var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
|
29
29
|
|
|
30
30
|
var _Scrollbar = _interopRequireDefault(require("../Scrollbar/Scrollbar"));
|
|
31
31
|
|
|
32
|
+
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
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; }
|
|
@@ -62,7 +64,13 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
62
64
|
contrastColor = _ref.contrastColor,
|
|
63
65
|
backgroundMark = _ref.backgroundMark,
|
|
64
66
|
invlogo = _ref.invlogo,
|
|
65
|
-
activeColor = _ref.activeColor
|
|
67
|
+
activeColor = _ref.activeColor,
|
|
68
|
+
sx = _ref.sx,
|
|
69
|
+
style = _ref.style;
|
|
70
|
+
|
|
71
|
+
var _useDynamicStyles = (0, _useDynamicStyles2.default)(sx),
|
|
72
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
73
|
+
prefixClass = _useDynamicStyles.prefixClass;
|
|
66
74
|
|
|
67
75
|
var _useWindowSize = (0, _useWindowSize2.default)(),
|
|
68
76
|
innerWidth = _useWindowSize.innerWidth,
|
|
@@ -98,18 +106,26 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
98
106
|
};
|
|
99
107
|
|
|
100
108
|
var to = function to(idItem) {
|
|
101
|
-
|
|
102
|
-
|
|
109
|
+
var _buttonRef$idItem;
|
|
110
|
+
|
|
111
|
+
if (buttonRef && buttonRef[idItem] != null && ((_buttonRef$idItem = buttonRef[idItem]) === null || _buttonRef$idItem === void 0 ? void 0 : _buttonRef$idItem.offsetTop) !== null) {
|
|
112
|
+
var _buttonRef$idItem2, _buttonRef$idItem3;
|
|
113
|
+
|
|
114
|
+
var positionRef = ((_buttonRef$idItem2 = buttonRef[idItem]) === null || _buttonRef$idItem2 === void 0 ? void 0 : _buttonRef$idItem2.offsetTop) + 22;
|
|
103
115
|
|
|
104
|
-
if (buttonRef[idItem].offsetTop < 400) {
|
|
116
|
+
if (((_buttonRef$idItem3 = buttonRef[idItem]) === null || _buttonRef$idItem3 === void 0 ? void 0 : _buttonRef$idItem3.offsetTop) < 400) {
|
|
105
117
|
setPosition(positionRef);
|
|
106
118
|
} else {
|
|
107
119
|
setPosition(400);
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
setTimeout(function () {
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
var _buttonRef$idItem4;
|
|
124
|
+
|
|
125
|
+
if (positionRef !== ((_buttonRef$idItem4 = buttonRef[idItem]) === null || _buttonRef$idItem4 === void 0 ? void 0 : _buttonRef$idItem4.offsetTop) + 22) {
|
|
126
|
+
var _buttonRef$idItem5;
|
|
127
|
+
|
|
128
|
+
setPosition(((_buttonRef$idItem5 = buttonRef[idItem]) === null || _buttonRef$idItem5 === void 0 ? void 0 : _buttonRef$idItem5.offsetTop) + 22);
|
|
113
129
|
}
|
|
114
130
|
}, 450);
|
|
115
131
|
}
|
|
@@ -135,31 +151,31 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
135
151
|
|
|
136
152
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
137
153
|
id: id,
|
|
138
|
-
className: mobile ? 'cbx-menuLateralLeft-block-mobile' : resize() ? 'cbx-menuLateralLeft-block-mini' : 'cbx-menuLateralLeft-block',
|
|
154
|
+
className: prefixClass(mobile ? 'cbx-menuLateralLeft-block-mobile' : resize() ? 'cbx-menuLateralLeft-block-mini' : 'cbx-menuLateralLeft-block'),
|
|
139
155
|
onMouseEnter: function onMouseEnter() {
|
|
140
156
|
return setHover(!resize());
|
|
141
157
|
},
|
|
142
158
|
onMouseLeave: function onMouseLeave() {
|
|
143
159
|
return setHover(false);
|
|
144
160
|
},
|
|
145
|
-
style: {
|
|
161
|
+
style: _objectSpread(_objectSpread({
|
|
146
162
|
backgroundColor: background
|
|
147
|
-
}
|
|
163
|
+
}, style), stylesInLine)
|
|
148
164
|
}, !mobile && /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
-
className: 'cbx-menuLateralLeft-mark',
|
|
165
|
+
className: prefixClass('cbx-menuLateralLeft-mark'),
|
|
150
166
|
style: {
|
|
151
167
|
top: "".concat(position, "px"),
|
|
152
168
|
display: resize() && 'none',
|
|
153
169
|
background: backgroundMark
|
|
154
170
|
}
|
|
155
171
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
156
|
-
className: 'cbx-menuLateralLeft-container-upper',
|
|
172
|
+
className: prefixClass('cbx-menuLateralLeft-container-upper'),
|
|
157
173
|
style: {
|
|
158
174
|
height: mobile ? '4rem' : '26.875rem',
|
|
159
175
|
width: mobile && '100%'
|
|
160
176
|
}
|
|
161
177
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
-
className: mobile ? 'cbx-menuLateralLeft-block-upper-mobile' : 'cbx-menuLateralLeft-block-upper'
|
|
178
|
+
className: prefixClass(mobile ? 'cbx-menuLateralLeft-block-upper-mobile' : 'cbx-menuLateralLeft-block-upper')
|
|
163
179
|
}, resize() || mobile ? /*#__PURE__*/_react.default.createElement("div", {
|
|
164
180
|
style: {
|
|
165
181
|
display: mobile && 'flex'
|
|
@@ -202,15 +218,10 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
202
218
|
items: upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
|
|
203
219
|
return !item.active && !item.first && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
|
|
204
220
|
key: "upper-section-".concat(index),
|
|
205
|
-
onClick: item.action
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
position: 'relative'
|
|
210
|
-
}
|
|
211
|
-
}, item.badge && /*#__PURE__*/_react.default.createElement("div", {
|
|
212
|
-
className: "cbx-menuLateralLeft-icon-burguer-mobile-red-dot"
|
|
213
|
-
}), item.icon), /*#__PURE__*/_react.default.createElement("div", null, item.text));
|
|
221
|
+
onClick: item.action,
|
|
222
|
+
icon: item.icon,
|
|
223
|
+
badge: item.badge
|
|
224
|
+
}, item.text);
|
|
214
225
|
}),
|
|
215
226
|
anchorOrigin: _objectSpread({}, !mobile ? {
|
|
216
227
|
vertical: 'center',
|
|
@@ -245,14 +256,15 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
245
256
|
to: to,
|
|
246
257
|
index: index,
|
|
247
258
|
contrastColor: contrastColor,
|
|
248
|
-
activeColor: activeColor
|
|
259
|
+
activeColor: activeColor,
|
|
260
|
+
prefixClass: prefixClass
|
|
249
261
|
}));
|
|
250
262
|
})))), !mobile && /*#__PURE__*/_react.default.createElement("div", {
|
|
251
|
-
className: mobile ? 'cbx-menuLateralLeft-block-under-mobile' : 'cbx-menuLateralLeft-block-under'
|
|
263
|
+
className: prefixClass(mobile ? 'cbx-menuLateralLeft-block-under-mobile' : 'cbx-menuLateralLeft-block-under')
|
|
252
264
|
}, underSection === null || underSection === void 0 ? void 0 : underSection.map(function (item, index) {
|
|
253
265
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
254
266
|
key: "under-section-".concat(index),
|
|
255
|
-
className: mobile ? 'cbx-menuLateralLeft-container-under-mobile' : 'cbx-menuLateralLeft-container-under'
|
|
267
|
+
className: prefixClass(mobile ? 'cbx-menuLateralLeft-container-under-mobile' : 'cbx-menuLateralLeft-container-under')
|
|
256
268
|
}, /*#__PURE__*/_react.default.createElement(ButtonPrincipalMenu, {
|
|
257
269
|
icon: item.icon,
|
|
258
270
|
active: item.active,
|
|
@@ -264,11 +276,12 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
264
276
|
activeColor: activeColor,
|
|
265
277
|
stylesIcon: _objectSpread({}, resize() ? {
|
|
266
278
|
fontSize: '1.125rem'
|
|
267
|
-
} : {})
|
|
279
|
+
} : {}),
|
|
280
|
+
prefixClass: prefixClass
|
|
268
281
|
}));
|
|
269
282
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
270
283
|
onClick: goToLogo,
|
|
271
|
-
className: mobile ? 'cbx-menuLateralLeft-container-under-mobile' : 'cbx-menuLateralLeft-container-under cbx-menuLateralLeft-img',
|
|
284
|
+
className: prefixClass(mobile ? 'cbx-menuLateralLeft-container-under-mobile' : 'cbx-menuLateralLeft-container-under cbx-menuLateralLeft-img'),
|
|
272
285
|
style: {
|
|
273
286
|
width: hover ? '7.75rem' : '1.75rem',
|
|
274
287
|
cursor: goToLogo && 'pointer'
|
|
@@ -294,19 +307,24 @@ var ButtonPrincipalMenu = function ButtonPrincipalMenu(_ref2) {
|
|
|
294
307
|
index = _ref2.index,
|
|
295
308
|
contrastColor = _ref2.contrastColor,
|
|
296
309
|
stylesIcon = _ref2.stylesIcon,
|
|
297
|
-
activeColor = _ref2.activeColor
|
|
310
|
+
activeColor = _ref2.activeColor,
|
|
311
|
+
prefixClass = _ref2.prefixClass;
|
|
298
312
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
299
|
-
className: "cbx-buttonPrincipalMenu-container ".concat(contrastColor ? '' : 'cbx-buttonPrincipalMenu-container-hover-color'),
|
|
313
|
+
className: prefixClass("cbx-buttonPrincipalMenu-container ".concat(contrastColor ? '' : 'cbx-buttonPrincipalMenu-container-hover-color')),
|
|
300
314
|
onClick: function onClick() {
|
|
301
|
-
_onClick
|
|
315
|
+
if (_onClick) {
|
|
316
|
+
_onClick();
|
|
317
|
+
}
|
|
302
318
|
|
|
303
|
-
to
|
|
319
|
+
if (to) {
|
|
320
|
+
to(index);
|
|
321
|
+
}
|
|
304
322
|
},
|
|
305
323
|
style: {
|
|
306
324
|
background: active && contrastColor
|
|
307
325
|
}
|
|
308
326
|
}, childrens && /*#__PURE__*/_react.default.createElement("div", {
|
|
309
|
-
className: 'cbx-buttonPrincipalMenu-childrens-arrow',
|
|
327
|
+
className: prefixClass('cbx-buttonPrincipalMenu-childrens-arrow'),
|
|
310
328
|
style: {
|
|
311
329
|
color: active ? activeColor || 'var(--primary)' : contrastColor || 'var(--gray3)',
|
|
312
330
|
fontSize: hover ? '1.125rem' : '0px',
|
|
@@ -315,14 +333,14 @@ var ButtonPrincipalMenu = function ButtonPrincipalMenu(_ref2) {
|
|
|
315
333
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
316
334
|
className: 'ri-arrow-right-s-line'
|
|
317
335
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
318
|
-
className: 'cbx-buttonPrincipalMenu-container-icon'
|
|
336
|
+
className: prefixClass('cbx-buttonPrincipalMenu-container-icon')
|
|
319
337
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
320
|
-
className: 'cbx-buttonPrincipalMenu-block-icon',
|
|
338
|
+
className: prefixClass('cbx-buttonPrincipalMenu-block-icon'),
|
|
321
339
|
style: _objectSpread({
|
|
322
340
|
color: active ? activeColor || 'var(--primary)' : contrastColor || 'var(--gray3)'
|
|
323
341
|
}, stylesIcon)
|
|
324
342
|
}, icon)), /*#__PURE__*/_react.default.createElement("div", {
|
|
325
|
-
className: 'cbx-buttonPrincipalMenu-container-text',
|
|
343
|
+
className: prefixClass('cbx-buttonPrincipalMenu-container-text'),
|
|
326
344
|
style: {
|
|
327
345
|
width: hover ? '100%' : '0%'
|
|
328
346
|
}
|
|
@@ -334,9 +352,10 @@ var ButtonPrincipalMenu = function ButtonPrincipalMenu(_ref2) {
|
|
|
334
352
|
whiteSpace: 'nowrap',
|
|
335
353
|
textOverflow: 'ellipsis',
|
|
336
354
|
overflow: 'hidden'
|
|
337
|
-
}
|
|
355
|
+
},
|
|
356
|
+
prefixClass: prefixClass
|
|
338
357
|
}, text))), childrens && childrens.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
339
|
-
className: 'cbx-buttonPrincipalMenu-container-childrens',
|
|
358
|
+
className: prefixClass('cbx-buttonPrincipalMenu-container-childrens'),
|
|
340
359
|
style: {
|
|
341
360
|
maxHeight: hover && active ? '18.75rem' : '0px',
|
|
342
361
|
top: contrastColor && '0.25rem'
|
|
@@ -344,19 +363,20 @@ var ButtonPrincipalMenu = function ButtonPrincipalMenu(_ref2) {
|
|
|
344
363
|
}, childrens === null || childrens === void 0 ? void 0 : childrens.map(function (item) {
|
|
345
364
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
346
365
|
key: "childrens-".concat(item.name),
|
|
347
|
-
className: 'cbx-buttonPrincipalMenu-block-childrens',
|
|
366
|
+
className: prefixClass('cbx-buttonPrincipalMenu-block-childrens'),
|
|
348
367
|
style: {
|
|
349
368
|
background: item.active ? 'var(--primary10)' : 'var(--white)'
|
|
350
369
|
},
|
|
351
370
|
onClick: item.action
|
|
352
371
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
353
|
-
className: 'cbx-buttonPrincipalMenu-childrens-icon-block'
|
|
372
|
+
className: prefixClass('cbx-buttonPrincipalMenu-childrens-icon-block')
|
|
354
373
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
355
|
-
className: "ri-quill-pen-line cbx-buttonPrincipalMenu-childrens-icon
|
|
374
|
+
className: "ri-quill-pen-line ".concat(prefixClass('cbx-buttonPrincipalMenu-childrens-icon')),
|
|
356
375
|
style: {
|
|
357
376
|
fontSize: item.active ? '1.125rem' : '0px'
|
|
358
377
|
}
|
|
359
378
|
})), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
379
|
+
prefixClass: prefixClass,
|
|
360
380
|
component: 'span',
|
|
361
381
|
color: active ? activeColor || 'var(--primary)' : contrastColor || 'var(--gray3)',
|
|
362
382
|
fontWeight: '700',
|