@councilbox/councilbox-ui 0.3.3 → 0.3.6

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.
@@ -25,6 +25,12 @@ var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
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
+
28
34
  var Header = function Header(_ref) {
29
35
  var back = _ref.back,
30
36
  dropdownLeft = _ref.dropdownLeft,
@@ -48,7 +54,9 @@ var Header = function Header(_ref) {
48
54
  itemsDropDownSearch = _ref.itemsDropDownSearch,
49
55
  titleDropdownSearch = _ref.titleDropdownSearch,
50
56
  onChangeSearch = _ref.onChangeSearch,
51
- onClickIconButtonRight = _ref.onClickIconButtonRight;
57
+ onClickIconButtonRight = _ref.onClickIconButtonRight,
58
+ colorNoLogo = _ref.colorNoLogo,
59
+ actionLogoLeft = _ref.actionLogoLeft;
52
60
 
53
61
  var _useWindowSize = (0, _useWindowSize2.default)(),
54
62
  innerWidth = _useWindowSize.innerWidth,
@@ -125,20 +133,30 @@ var Header = function Header(_ref) {
125
133
  },
126
134
  items: dropdownLeft
127
135
  })), logoLeft ? logoLeft !== 'noLogo' && /*#__PURE__*/_react.default.createElement("div", {
128
- className: "cbx-header-first-container-app-logo"
136
+ className: "cbx-header-first-container-app-logo",
137
+ onClick: actionLogoLeft,
138
+ style: {
139
+ cursor: actionLogoLeft ? 'pointer' : 'auto'
140
+ }
129
141
  }, /*#__PURE__*/_react.default.createElement("img", {
130
142
  id: 'cbx-header-first-app-logo',
131
143
  src: innerWidth < breakpoints.md ? logoLeftXS || logoLeft : logoLeft,
132
144
  className: "App-logo",
133
145
  alt: "logo"
134
146
  })) : /*#__PURE__*/_react.default.createElement("div", {
135
- className: "cbx-header-first-container-app-logo-empty"
136
- }, /*#__PURE__*/_react.default.createElement("img", {
147
+ className: "cbx-header-first-container-app-logo-empty",
148
+ onClick: actionLogoLeft,
149
+ style: {
150
+ cursor: actionLogoLeft ? 'pointer' : 'auto'
151
+ }
152
+ }, /*#__PURE__*/_react.default.createElement("div", {
153
+ style: _objectSpread({}, colorNoLogo),
154
+ alt: "logo",
137
155
  id: 'cbx-header-first-app-logo',
138
- src: 'https://ovac.pre.councilbox.com/static/media/organization_demo.38f17776.svg',
139
- className: "App-logo cbx-header-first-app-logo-empty",
140
- alt: "logo"
141
- }), innerWidth > breakpoints.md && /*#__PURE__*/_react.default.createElement("div", {
156
+ className: "cbx-header-first-app-logo-empty"
157
+ }, /*#__PURE__*/_react.default.createElement("i", {
158
+ className: "ri-building-2-line"
159
+ })), innerWidth > breakpoints.md && /*#__PURE__*/_react.default.createElement("div", {
142
160
  className: "cbx-header-first-container-app-logo-text-empty"
143
161
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
144
162
  color: 'var(--primary)',
@@ -375,7 +393,8 @@ Header.propTypes = {
375
393
  backgroundIconButtonRight: _propTypes.default.string,
376
394
  itemsDropDownUser: _propTypes.default.node,
377
395
  itemsDropDownSearch: _propTypes.default.node,
378
- itemsDropDownMore: _propTypes.default.node
396
+ itemsDropDownMore: _propTypes.default.node,
397
+ actionLogoLeft: _propTypes.default.func
379
398
  };
380
399
  Header.defaultProps = {
381
400
  back: '',
@@ -400,7 +419,8 @@ Header.defaultProps = {
400
419
  itemsDropDownUser: '',
401
420
  titleDropdownSearch: 'Reunión',
402
421
  itemsDropDownSearch: '',
403
- itemsDropDownMore: ''
422
+ itemsDropDownMore: '',
423
+ actionLogoLeft: undefined
404
424
  };
405
425
  var _default = Header;
406
426
  exports.default = _default;
@@ -113,6 +113,16 @@
113
113
  height: var(--spacing40);
114
114
  }
115
115
 
116
+ .cbx-header-first-app-logo-empty {
117
+ background: var(--primary);
118
+ border-radius: 50%;
119
+ color: var(--white);
120
+ display: flex;
121
+ align-items: center;
122
+ justify-content: center;
123
+ font-size: 1.375rem;
124
+ }
125
+
116
126
  .cbx-header-button {
117
127
  border: none !important;
118
128
  outline: none !important;
@@ -130,8 +140,7 @@
130
140
  }
131
141
 
132
142
  .cbx-header-first-container-button-dropdown-left,
133
- .cbx-header-second-container-dropdown-title
134
- {
143
+ .cbx-header-second-container-dropdown-title {
135
144
  margin-right: var(--spacing12)
136
145
  }
137
146
 
@@ -140,10 +149,10 @@
140
149
  font-size: 15px
141
150
  }
142
151
 
143
- .cbx-header-second-container-input{
152
+ .cbx-header-second-container-input {
144
153
  width: 100%
145
154
  }
146
155
 
147
- .cbx-header-third-container-logo-right{
156
+ .cbx-header-third-container-logo-right {
148
157
  margin-right: var(--spacing4)
149
158
  }
@@ -1,63 +1,93 @@
1
+ .cbx-menuLateralLeft-block-mini,
1
2
  .cbx-menuLateralLeft-block {
2
- height: 100%;
3
- min-width: 4.75rem;
4
- width: 4.75rem;
5
3
  transition: width .3s ease;
6
- }
7
-
8
- .cbx-menuLateralLeft-block-resize {
9
- min-width: var(--spacing64);
10
- width: var(--spacing64);
11
- }
12
-
13
- .cbx-menuLateralLeft-block {
14
- position: absolute;
15
4
  top: 0;
16
5
  left: 0;
17
6
  }
18
7
 
19
- .cbx-menuLateralLeft-block-mobile {
20
- position: relative;
8
+ .cbx-menuLateralLeft-block-mini,
9
+ .cbx-menuLateralLeft-block,
10
+ .cbx-buttonPrincipalMenu-container-icon {
11
+ min-width: 4.75rem;
12
+ width: 4.75rem;
21
13
  }
22
14
 
23
15
  .cbx-menuLateralLeft-block-mobile {
24
16
  height: var(--spacing64);
25
17
  min-width: 100%;
26
- width: 100%;
27
18
  justify-content: space-between;
19
+ background: var(--gray1);
28
20
  }
29
21
 
30
22
  .cbx-menuLateralLeft-block,
31
- .cbx-menuLateralLeft-block-mobile {
23
+ .cbx-menuLateralLeft-block-mini {
32
24
  background: var(--white);
33
- border-right: 3px solid var(--gray1);
25
+ border-right: 0.188rem solid var(--gray1);
26
+ }
27
+
28
+ .cbx-menuLateralLeft-block-upper,
29
+ .cbx-menuLateralLeft-block-mini,
30
+ .cbx-menuLateralLeft-block {
31
+ height: 100%;
34
32
  }
35
33
 
36
34
  .cbx-menuLateralLeft-block-mobile,
37
35
  .cbx-menuLateralLeft-block-upper-mobile,
38
36
  .cbx-menuLateralLeft-icon-burguer-mobile,
39
37
  .cbx-menuLateralLeft-block-under-mobile,
40
- .cbx-menuLateralLeft-container-under,
41
- .cbx-menuLateralLeft-container-under-mobile {
38
+ .cbx-menuLateralLeft-container-under-mobile,
39
+ .cbx-menuLateralLeft-img-mini,
40
+ .cbx-buttonPrincipalMenu-container,
41
+ .cbx-buttonPrincipalMenu-block-childrens,
42
+ .cbx-menuLateralLeft-img,
43
+ .cbx-buttonPrincipalMenu-container-icon {
42
44
  display: flex;
43
45
  }
44
46
 
47
+ .cbx-menuLateralLeft-block-under,
48
+ .cbx-menuLateralLeft-block-mobile,
49
+ .cbx-menuLateralLeft-img-under,
50
+ .cbx-menuLateralLeft-container-upper,
51
+ .cbx-buttonPrincipalMenu-container-childrens,
52
+ .cbx-buttonPrincipalMenu-container-text {
53
+ overflow: hidden;
54
+ }
55
+
45
56
  .cbx-menuLateralLeft-block-upper-mobile,
46
57
  .cbx-menuLateralLeft-block-mobile,
47
- .cbx-menuLateralLeft-block-under-mobile {
58
+ .cbx-menuLateralLeft-block-under-mobile,
59
+ .cbx-buttonPrincipalMenu-block-childrens,
60
+ .cbx-buttonPrincipalMenu-container,
61
+ .cbx-buttonPrincipalMenu-block-childrens,
62
+ .cbx-buttonPrincipalMenu-container-icon {
48
63
  align-items: center;
49
64
  }
50
65
 
66
+ .cbx-menuLateralLeft-block-under,
67
+ .cbx-menuLateralLeft-block-mobile {
68
+ width: 100%;
69
+ }
70
+
51
71
  .cbx-menuLateralLeft-block-under {
52
72
  bottom: 0;
53
73
  left: 0;
54
- width: 100%;
74
+
75
+ }
76
+
77
+ .cbx-menuLateralLeft-img-mini,
78
+ .cbx-menuLateralLeft-block .cbx-menuLateralLeft-img,
79
+ .cbx-buttonPrincipalMenu-container-icon {
80
+ justify-content: center;
55
81
  }
56
82
 
57
83
  .cbx-menuLateralLeft-block-under,
58
84
  .cbx-menuLateralLeft-icon-burguer-mobile-red-dot,
59
85
  .cbx-menuLateralLeft-block-tooltip-under,
60
- .cbx-menuLateralLeft-block-tooltip-under-triangle {
86
+ .cbx-menuLateralLeft-block-tooltip-under-triangle,
87
+ .cbx-menuLateralLeft-mark,
88
+ .cbx-buttonPrincipalMenu-childrens-arrow,
89
+ .cbx-menuLateralLeft-block-mini,
90
+ .cbx-menuLateralLeft-block {
61
91
  position: absolute;
62
92
  }
63
93
 
@@ -71,7 +101,11 @@
71
101
  }
72
102
 
73
103
  .cbx-menuLateralLeft-container-under,
74
- .cbx-menuLateralLeft-container-under-mobile {
104
+ .cbx-menuLateralLeft-container-under-mobile,
105
+ .cbx-buttonPrincipalMenu-container,
106
+ .cbx-buttonPrincipalMenu-block-childrens,
107
+ .cbx-buttonPrincipalMenu-container-childrens,
108
+ .cbx-menuLateralLeft-block-mobile {
75
109
  position: relative;
76
110
  }
77
111
 
@@ -88,19 +122,27 @@
88
122
  background: var(--error);
89
123
  }
90
124
 
91
- .cbx-menuLateralLeft-block-tooltip-under {
125
+ .cbx-menuLateralLeft-block-tooltip-under,
126
+ .cbx-menuLateralLeft-mark {
92
127
  background: var(--primary);
128
+ }
129
+
130
+ .cbx-menuLateralLeft-block-tooltip-under,
131
+ .cbx-buttonPrincipalMenu-block-childrens,
132
+ .cbx-buttonPrincipalMenu-container {
133
+ cursor: pointer;
134
+ }
135
+
136
+ .cbx-menuLateralLeft-block-tooltip-under {
93
137
  top: -4.688rem;
94
138
  right: 0;
95
139
  padding: 0.5rem 0.75rem;
96
- border-radius: 4px;
97
- cursor: pointer;
140
+ border-radius: 0.25rem;
98
141
  width: 6rem;
99
142
  height: 4rem;
100
143
  }
101
144
 
102
145
  .cbx-menuLateralLeft-block-tooltip-under-triangle {
103
- width: 0;
104
146
  height: 0;
105
147
  border-left: 0.438rem solid transparent;
106
148
  border-right: 0.438rem solid transparent;
@@ -108,7 +150,101 @@
108
150
  bottom: -0.625rem;
109
151
  }
110
152
 
111
- .hoverGrande:hover {
112
- width: 250px;
113
- /* min-width: 250px; */
153
+ .cbx-menuLateralLeft-block-tooltip-under-triangle,
154
+ .scrollTransparent>div:nth-child(3)>div {
155
+ width: 0;
156
+ }
157
+
158
+ .cbx-menuLateralLeft-block:hover {
159
+ width: 14.375rem;
160
+ }
161
+
162
+ .cbx-menuLateralLeft-img-under {
163
+ width: 2.5rem;
164
+ height: 1.875rem;
165
+ transition: width 0.3s;
166
+ }
167
+
168
+ .cbx-menuLateralLeft-block:hover .cbx-menuLateralLeft-container-under {
169
+ justify-content: initial !important;
170
+ }
171
+
172
+ .cbx-menuLateralLeft-block:hover .cbx-menuLateralLeft-img-under {
173
+ width: 7.75rem;
174
+ margin-left: 1.394rem;
175
+ }
176
+
177
+ .cbx-buttonPrincipalMenu-block-icon {
178
+ font-size: 1.375rem;
179
+ }
180
+
181
+ .cbx-buttonPrincipalMenu-container div p,
182
+ .cbx-buttonPrincipalMenu-container .cbx-buttonPrincipalMenu-block-icon i,
183
+ .cbx-buttonPrincipalMenu-block-icon {
184
+ transition: color .3s;
185
+ }
186
+
187
+ .cbx-buttonPrincipalMenu-container:hover div p,
188
+ .cbx-buttonPrincipalMenu-container:hover .cbx-buttonPrincipalMenu-block-icon i,
189
+ .cbx-buttonPrincipalMenu-childrens-icon {
190
+ color: var(--primary);
191
+ }
192
+
193
+ .cbx-buttonPrincipalMenu-block-childrens {
194
+ transition: all .3s;
195
+ max-width: 12.5rem;
196
+ margin-left: 1.188rem;
197
+ margin-bottom: 0.5rem;
198
+ border-radius: 1.25rem;
199
+ padding: 0 1.25rem;
200
+ }
201
+
202
+ .cbx-buttonPrincipalMenu-block-childrens:hover {
203
+ background: var(--primary10) !important;
204
+ }
205
+
206
+ .scrollTransparent>div:nth-child(3) {
207
+ width: 0px !important;
208
+ }
209
+
210
+ .scrollTransparent>div:nth-child(3)>div {
211
+ background: white;
212
+ }
213
+
214
+ .cbx-menuLateralLeft-mark {
215
+ width: 0.313rem;
216
+ height: 1.75rem;
217
+ right: -0.188rem;
218
+ transition: all .1s;
219
+ }
220
+
221
+ .cbx-buttonPrincipalMenu-childrens-arrow {
222
+ left: var(--spacing8);
223
+ font-weight: bold;
224
+ transition: font-size .3s, transform .3s;
225
+ }
226
+
227
+ .cbx-buttonPrincipalMenu-container-icon {
228
+ height: 4.75rem;
229
+ }
230
+
231
+ .cbx-buttonPrincipalMenu-container-text {
232
+ transition: width 0.2s ease-in 0.0s;
233
+ margin-left: -0.5rem;
234
+ max-width: 9.375rem;
235
+ }
236
+
237
+ .cbx-buttonPrincipalMenu-container-childrens {
238
+ top: -0.625rem;
239
+ transition: max-height .4s linear;
240
+ }
241
+
242
+ .cbx-buttonPrincipalMenu-childrens-icon-block {
243
+ min-width: 1.125rem;
244
+ min-height: 1.75rem;
245
+ margin-right: 0.688rem;
246
+ }
247
+
248
+ .cbx-buttonPrincipalMenu-childrens-icon {
249
+ transition: font-size .3s;
114
250
  }
@@ -27,6 +27,8 @@ var _IconButtonSquare = _interopRequireDefault(require("../IconButtonSquare/Icon
27
27
 
28
28
  var _Typography = _interopRequireDefault(require("../Typography/Typography"));
29
29
 
30
+ var _Scrollbar = _interopRequireDefault(require("../Scrollbar/Scrollbar"));
31
+
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
33
 
32
34
  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; }
@@ -47,6 +49,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
47
49
 
48
50
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
51
 
52
+ var buttonRef = [];
53
+
50
54
  var MenuLateralLeft = function MenuLateralLeft(_ref) {
51
55
  var id = _ref.id,
52
56
  upperSection = _ref.upperSection,
@@ -62,10 +66,20 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
62
66
  hover = _React$useState2[0],
63
67
  setHover = _React$useState2[1];
64
68
 
69
+ var _React$useState3 = _react.default.useState(23),
70
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
71
+ position = _React$useState4[0],
72
+ setPosition = _React$useState4[1];
73
+
65
74
  var iconSelectDropDown = function iconSelectDropDown() {
66
75
  var upperSectionFilter = upperSection.filter(function (item) {
67
- return item.active;
76
+ return item.active && !item.first;
68
77
  });
78
+
79
+ if (upperSectionFilter.length <= 0) {
80
+ upperSectionFilter = [upperSection[1]];
81
+ }
82
+
69
83
  return upperSectionFilter.length > 0 ? upperSectionFilter[0] : {};
70
84
  };
71
85
 
@@ -76,33 +90,81 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
76
90
  return upperSectionFilter.length > 0 ? upperSectionFilter[0] : {};
77
91
  };
78
92
 
93
+ var to = function to(idItem) {
94
+ if (buttonRef && buttonRef[idItem] != null && buttonRef[idItem].offsetTop !== null) {
95
+ var positionRef = buttonRef[idItem].offsetTop + 22;
96
+
97
+ if (buttonRef[idItem].offsetTop < 400) {
98
+ setPosition(positionRef);
99
+ } else {
100
+ setPosition(400);
101
+ }
102
+
103
+ setTimeout(function () {
104
+ if (positionRef !== buttonRef[idItem].offsetTop + 22) {
105
+ setPosition(buttonRef[idItem].offsetTop + 22);
106
+ }
107
+ }, 450);
108
+ }
109
+ };
110
+
79
111
  var resize = function resize() {
80
112
  return window.innerHeight < 665 || innerWidth < breakpoints.md;
81
113
  };
82
114
 
115
+ _react.default.useEffect(function () {
116
+ if (!resize()) {
117
+ to(upperSection.findIndex(function (item) {
118
+ return item.active;
119
+ }));
120
+ }
121
+ }, [resize()]);
122
+
83
123
  return /*#__PURE__*/_react.default.createElement("div", {
84
124
  id: id,
85
- className: mobile ? 'cbx-menuLateralLeft-block-mobile' : "cbx-menuLateralLeft-block hoverGrande ".concat(resize() ? 'cbx-menuLateralLeft-block-resize' : ''),
125
+ className: mobile ? 'cbx-menuLateralLeft-block-mobile' : resize() ? 'cbx-menuLateralLeft-block-mini' : 'cbx-menuLateralLeft-block',
86
126
  onMouseEnter: function onMouseEnter() {
87
- return setHover(true);
127
+ return setHover(!resize());
88
128
  },
89
129
  onMouseLeave: function onMouseLeave() {
90
130
  return setHover(false);
91
131
  }
132
+ }, !mobile && /*#__PURE__*/_react.default.createElement("div", {
133
+ className: 'cbx-menuLateralLeft-mark',
134
+ style: {
135
+ top: "".concat(position, "px"),
136
+ display: resize() && 'none'
137
+ }
138
+ }), /*#__PURE__*/_react.default.createElement("div", {
139
+ className: 'cbx-menuLateralLeft-container-upper',
140
+ style: {
141
+ height: mobile ? '4rem' : '26.875rem',
142
+ width: mobile && '100%'
143
+ }
92
144
  }, /*#__PURE__*/_react.default.createElement("div", {
93
145
  className: mobile ? 'cbx-menuLateralLeft-block-upper-mobile' : 'cbx-menuLateralLeft-block-upper'
94
- }, resize() ? /*#__PURE__*/_react.default.createElement("div", {
146
+ }, resize() || mobile ? /*#__PURE__*/_react.default.createElement("div", {
95
147
  style: {
96
148
  display: mobile && 'flex'
97
149
  }
98
150
  }, /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
151
+ icon: upperSection[0].icon,
152
+ active: upperSection[0].active,
153
+ onClick: upperSection[0].action,
154
+ badge: upperSection[0].badge,
155
+ styles: _objectSpread({}, mobile ? {
156
+ width: 'var(--spacing64)',
157
+ height: 'var(--spacing64)'
158
+ } : {})
159
+ }), /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
99
160
  icon: iconSelectDropDown().icon,
100
161
  active: iconSelectDropDown().active,
101
162
  onClick: iconSelectDropDown().action,
102
163
  badge: iconSelectDropDown().badge,
103
- styles: _objectSpread({}, resize() ? {
164
+ styles: _objectSpread({}, mobile ? {
104
165
  width: 'var(--spacing64)',
105
- height: 'var(--spacing64)'
166
+ height: 'var(--spacing64)',
167
+ fontSize: '1.375rem'
106
168
  } : {})
107
169
  }), /*#__PURE__*/_react.default.createElement(_DropDown.default, {
108
170
  color: "transparent",
@@ -112,14 +174,14 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
112
174
  className: 'ri-menu-line'
113
175
  }),
114
176
  badge: badgeBurguer().badge,
115
- styles: _objectSpread({}, resize() ? {
177
+ styles: _objectSpread({}, mobile ? {
116
178
  width: 'var(--spacing64)',
117
179
  height: 'var(--spacing64)'
118
180
  } : {})
119
181
  });
120
182
  },
121
183
  items: upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
122
- return !item.active && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
184
+ return !item.active && !item.first && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
123
185
  key: "upper-section-".concat(index),
124
186
  onClick: item.action
125
187
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -133,21 +195,26 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
133
195
  }),
134
196
  anchorOrigin: _objectSpread({}, !mobile ? {
135
197
  vertical: 'center',
136
- horizontal: 'left'
198
+ horizontal: 'right'
137
199
  } : {
138
200
  vertical: 'top',
139
201
  horizontal: 'center'
140
202
  }),
141
203
  transformOrigin: _objectSpread({}, !mobile ? {
142
204
  vertical: 'top',
143
- horizontal: 'right'
205
+ horizontal: 'left'
144
206
  } : {
145
207
  vertical: 'bottom',
146
208
  horizontal: 'left'
147
209
  })
148
- })) : upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
210
+ })) : /*#__PURE__*/_react.default.createElement(_Scrollbar.default, {
211
+ classFix: 'scrollTransparent'
212
+ }, upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
149
213
  return /*#__PURE__*/_react.default.createElement("div", {
150
- key: "upper-section-".concat(index)
214
+ key: "upper-section-".concat(index),
215
+ ref: function ref(el) {
216
+ buttonRef[index] = el;
217
+ }
151
218
  }, /*#__PURE__*/_react.default.createElement(ButtonPrincipalMenu, {
152
219
  icon: item.icon,
153
220
  active: item.active,
@@ -155,9 +222,11 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
155
222
  onClick: item.action,
156
223
  badge: item.badge,
157
224
  hover: hover,
158
- childrens: item.childrens
225
+ childrens: item.childrens,
226
+ to: to,
227
+ index: index
159
228
  }));
160
- })), /*#__PURE__*/_react.default.createElement("div", {
229
+ })))), !mobile && /*#__PURE__*/_react.default.createElement("div", {
161
230
  className: mobile ? 'cbx-menuLateralLeft-block-under-mobile' : 'cbx-menuLateralLeft-block-under'
162
231
  }, underSection === null || underSection === void 0 ? void 0 : underSection.map(function (item, index) {
163
232
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -172,17 +241,10 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
172
241
  hover: hover
173
242
  }));
174
243
  }), /*#__PURE__*/_react.default.createElement("div", {
175
- className: mobile ? 'cbx-menuLateralLeft-container-under-mobile' : 'cbx-menuLateralLeft-container-under',
176
- style: {
177
- justifyContent: 'center'
178
- }
244
+ className: mobile ? 'cbx-menuLateralLeft-container-under-mobile' : resize() ? 'cbx-menuLateralLeft-container-under cbx-menuLateralLeft-img-mini' : 'cbx-menuLateralLeft-container-under cbx-menuLateralLeft-img'
179
245
  }, /*#__PURE__*/_react.default.createElement("img", {
180
246
  src: hover ? _cbxLogo.default : _cbxXs.default,
181
- style: {
182
- width: hover ? '173px' : 'var(--spacing40)',
183
- height: 'var(--spacing40)',
184
- transition: 'width 0.5s linear'
185
- }
247
+ className: 'cbx-menuLateralLeft-img-under'
186
248
  }))));
187
249
  };
188
250
 
@@ -192,66 +254,80 @@ var ButtonPrincipalMenu = function ButtonPrincipalMenu(_ref2) {
192
254
  var icon = _ref2.icon,
193
255
  active = _ref2.active,
194
256
  text = _ref2.text,
195
- onClick = _ref2.onClick,
257
+ _onClick = _ref2.onClick,
196
258
  hover = _ref2.hover,
197
- childrens = _ref2.childrens;
198
- return /*#__PURE__*/_react.default.createElement("div", {
199
- style: {
200
- display: 'flex',
201
- alignItems: 'center',
202
- position: 'relative',
203
- cursor: 'pointer'
204
- },
205
- onClick: onClick
259
+ childrens = _ref2.childrens,
260
+ to = _ref2.to,
261
+ index = _ref2.index;
262
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
263
+ className: 'cbx-buttonPrincipalMenu-container',
264
+ onClick: function onClick() {
265
+ _onClick();
266
+
267
+ to(index);
268
+ }
206
269
  }, childrens && /*#__PURE__*/_react.default.createElement("div", {
270
+ className: 'cbx-buttonPrincipalMenu-childrens-arrow',
207
271
  style: {
208
272
  color: active ? 'var(--primary)' : 'var(--gray3)',
209
- position: 'absolute',
210
- left: 'var(--spacing8)',
211
- fontSize: hover ? '18px' : '0px',
212
- fontWeight: 'bold',
213
- transition: 'font-size .3s'
273
+ fontSize: hover ? '1.125rem' : '0px',
274
+ transform: active ? 'rotate(90deg)' : 'rotate(0deg)'
214
275
  }
215
276
  }, /*#__PURE__*/_react.default.createElement("i", {
216
277
  className: 'ri-arrow-right-s-line'
217
278
  })), /*#__PURE__*/_react.default.createElement("div", {
218
- style: {
219
- width: '4.75rem',
220
- minWidth: '4.75rem',
221
- height: '4.75rem',
222
- display: 'flex',
223
- alignItems: 'center',
224
- justifyContent: 'center'
225
- }
279
+ className: 'cbx-buttonPrincipalMenu-container-icon'
226
280
  }, /*#__PURE__*/_react.default.createElement("div", {
281
+ className: 'cbx-buttonPrincipalMenu-block-icon',
227
282
  style: {
228
- fontSize: '1.375rem',
229
- color: active ? 'var(--primary)' : 'var(--gray3)',
230
- transition: 'color .3s'
283
+ color: active ? 'var(--primary)' : 'var(--gray3)'
231
284
  }
232
285
  }, icon)), /*#__PURE__*/_react.default.createElement("div", {
286
+ className: 'cbx-buttonPrincipalMenu-container-text',
233
287
  style: {
234
- width: hover ? '100%' : '0%',
235
- transition: 'width 0.2s ease-in 0.0s',
236
- overflow: 'hidden',
237
- marginLeft: '-0.5rem'
288
+ width: hover ? '100%' : '0%'
238
289
  }
239
290
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
240
291
  color: active ? 'var(--primary)' : 'var(--gray3)',
241
292
  fontWeight: '700',
242
293
  styles: {
243
- transition: 'color .3s'
294
+ transition: 'color .3s',
295
+ whiteSpace: 'nowrap',
296
+ textOverflow: 'ellipsis',
297
+ overflow: 'hidden'
244
298
  }
245
- }, text)), /*#__PURE__*/_react.default.createElement("div", {
299
+ }, text))), childrens && childrens.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
300
+ className: 'cbx-buttonPrincipalMenu-container-childrens',
246
301
  style: {
247
- width: active ? '5px' : '0px',
248
- height: active ? '28px' : '0px',
249
- background: 'var(--primary)',
250
- position: 'absolute',
251
- right: '-3px',
252
- transition: 'all .1s'
302
+ maxHeight: hover && active ? '18.75rem' : '0px'
253
303
  }
254
- }));
304
+ }, childrens === null || childrens === void 0 ? void 0 : childrens.map(function (item) {
305
+ return /*#__PURE__*/_react.default.createElement("div", {
306
+ key: "childrens-".concat(item.name),
307
+ className: 'cbx-buttonPrincipalMenu-block-childrens',
308
+ style: {
309
+ background: item.active ? 'var(--primary10)' : 'var(--white)'
310
+ },
311
+ onClick: item.action
312
+ }, /*#__PURE__*/_react.default.createElement("div", {
313
+ className: 'cbx-buttonPrincipalMenu-childrens-icon-block'
314
+ }, /*#__PURE__*/_react.default.createElement("i", {
315
+ className: "ri-quill-pen-line cbx-buttonPrincipalMenu-childrens-icon",
316
+ style: {
317
+ fontSize: item.active ? '1.125rem' : '0px'
318
+ }
319
+ })), /*#__PURE__*/_react.default.createElement(_Typography.default, {
320
+ component: 'span',
321
+ color: active ? 'var(--primary)' : 'var(--gray3)',
322
+ fontWeight: '700',
323
+ styles: {
324
+ transition: 'color .3s',
325
+ whiteSpace: 'nowrap',
326
+ textOverflow: 'ellipsis',
327
+ overflow: 'hidden'
328
+ }
329
+ }, item.name));
330
+ })));
255
331
  };
256
332
 
257
333
  ButtonPrincipalMenu.displayName = "ButtonPrincipalMenu";
@@ -0,0 +1,29 @@
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 _Scrollbar = _interopRequireDefault(require("./Scrollbar"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var DesignScrollbar = function DesignScrollbar() {
15
+ return /*#__PURE__*/_react.default.createElement("div", {
16
+ style: {
17
+ height: '18.75rem'
18
+ }
19
+ }, /*#__PURE__*/_react.default.createElement(_Scrollbar.default, null, /*#__PURE__*/_react.default.createElement("div", {
20
+ style: {
21
+ height: '31.25rem',
22
+ background: 'gainsboro'
23
+ }
24
+ }, "Prueba")));
25
+ };
26
+
27
+ DesignScrollbar.displayName = "DesignScrollbar";
28
+ var _default = DesignScrollbar;
29
+ exports.default = _default;
@@ -0,0 +1,38 @@
1
+ .scrollbarFix {
2
+ margin-right: -17px;
3
+ scroll-behavior: smooth;
4
+ }
5
+
6
+ .Scrollbar>div:first-child {
7
+ scroll-behavior: smooth;
8
+ }
9
+
10
+ .scrollbarBoth>div:first-child {
11
+ margin-right: -17px !important;
12
+ margin-bottom: -0 !important;
13
+ overflow-x: auto !important;
14
+ }
15
+
16
+ .scrollbarOnlyY>div:first-child {
17
+ overflow-x: hidden !important;
18
+ margin-right: -17px !important;
19
+ margin-bottom: -0 !important;
20
+ }
21
+
22
+ .scrollflex>div:first-child {
23
+ display: flex;
24
+ flex-grow: 1;
25
+ min-height: 100%;
26
+ }
27
+
28
+ .scrollbarFixHeight > div > div {
29
+ /* flex-grow: 1; */
30
+ }
31
+
32
+ .scrollbarFixHeightIos > div > div {
33
+ padding-bottom: 0!important;
34
+ }
35
+
36
+ .macOSFlexFix> div > div > div {
37
+ min-height: 100%;
38
+ }
@@ -0,0 +1,95 @@
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
+ require("./Scrollbar.css");
13
+
14
+ var _reactCustomScrollbarsCbx = require("react-custom-scrollbars-cbx");
15
+
16
+ var _getScrollbarWidth = require("react-custom-scrollbars-cbx/lib/utils/getScrollbarWidth");
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ 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; }
21
+
22
+ 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; }
23
+
24
+ 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; }
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
+ var Scrollbar = function Scrollbar(_ref) {
29
+ var props = _extends({}, _ref);
30
+
31
+ var scrollbar = null;
32
+
33
+ var scrollToBottom = function scrollToBottom() {
34
+ scrollbar.scrollToBottom();
35
+ };
36
+
37
+ var scrollToTop = function scrollToTop() {
38
+ return scrollbar.scrollToTop();
39
+ };
40
+
41
+ var getScrollHeight = function getScrollHeight() {
42
+ return scrollbar.getScrollHeight();
43
+ };
44
+
45
+ var getValues = function getValues() {
46
+ return scrollbar.getValues();
47
+ };
48
+
49
+ var style = props.style,
50
+ autoHide = props.autoHide,
51
+ children = props.children,
52
+ showX = props.showX,
53
+ onScrollStop = props.onScrollStop,
54
+ _props$classFix = props.classFix,
55
+ classFix = _props$classFix === void 0 ? '' : _props$classFix,
56
+ _props$horizontalScro = props.horizontalScroll,
57
+ horizontalScroll = _props$horizontalScro === void 0 ? false : _props$horizontalScro;
58
+ var extraClass = '';
59
+
60
+ if (classFix === 'scrollflex' && !(0, _getScrollbarWidth.actualBarWidth)()) {
61
+ extraClass = 'macOSFlexFix';
62
+ }
63
+
64
+ return /*#__PURE__*/_react.default.createElement(_reactCustomScrollbarsCbx.Scrollbars, _extends({
65
+ ref: function ref(_ref2) {
66
+ scrollbar = _ref2;
67
+ },
68
+ autoHide: autoHide,
69
+ className: "Scrollbar ".concat(classFix, " ").concat(extraClass, " ").concat(horizontalScroll ? 'scrollbarBoth' : 'scrollbarOnlyY', " scrollbarFixHeight"),
70
+ onScrollStop: onScrollStop,
71
+ style: _objectSpread({
72
+ width: '100%',
73
+ height: '100%'
74
+ }, style)
75
+ }, !showX ? {
76
+ renderTrackHorizontal: function renderTrackHorizontal() {
77
+ return /*#__PURE__*/_react.default.createElement("span", {
78
+ style: {
79
+ display: 'hidden'
80
+ }
81
+ });
82
+ },
83
+ renderThumbHorizontal: function renderThumbHorizontal() {
84
+ return /*#__PURE__*/_react.default.createElement("span", {
85
+ style: {
86
+ display: 'hidden'
87
+ }
88
+ });
89
+ }
90
+ } : {}), children);
91
+ };
92
+
93
+ Scrollbar.displayName = "Scrollbar";
94
+ var _default = Scrollbar;
95
+ exports.default = _default;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.DesignScrollbarTemplate = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Scrollbar = _interopRequireDefault(require("./Scrollbar"));
11
+
12
+ var _DesignScrollbar = _interopRequireDefault(require("./DesignScrollbar"));
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ var _default = {
17
+ title: 'Example/Scrollbar',
18
+ component: _Scrollbar.default,
19
+ argTypes: {}
20
+ };
21
+ exports.default = _default;
22
+
23
+ var Template = function Template(args) {
24
+ return /*#__PURE__*/_react.default.createElement(_DesignScrollbar.default, args);
25
+ };
26
+
27
+ Template.displayName = "Template";
28
+ var DesignScrollbarTemplate = Template.bind({});
29
+ exports.DesignScrollbarTemplate = DesignScrollbarTemplate;
30
+ DesignScrollbarTemplate.args = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@councilbox/councilbox-ui",
3
- "version": "0.3.3",
3
+ "version": "0.3.6",
4
4
  "main": "dist/build-index.js",
5
5
  "files": [
6
6
  "dist",
@@ -19,6 +19,7 @@
19
19
  "@mui/material": "^5.2.8",
20
20
  "cross-env": "^7.0.3",
21
21
  "prop-types": "^15.8.1",
22
+ "react-custom-scrollbars-cbx": "^4.2.2",
22
23
  "remixicon": "^2.5.0",
23
24
  "web-vitals": "^2.1.0"
24
25
  },