@councilbox/councilbox-ui 0.3.3 → 0.3.4

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,8 @@ 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;
52
59
 
53
60
  var _useWindowSize = (0, _useWindowSize2.default)(),
54
61
  innerWidth = _useWindowSize.innerWidth,
@@ -133,12 +140,14 @@ var Header = function Header(_ref) {
133
140
  alt: "logo"
134
141
  })) : /*#__PURE__*/_react.default.createElement("div", {
135
142
  className: "cbx-header-first-container-app-logo-empty"
136
- }, /*#__PURE__*/_react.default.createElement("img", {
143
+ }, /*#__PURE__*/_react.default.createElement("div", {
144
+ style: _objectSpread({}, colorNoLogo),
145
+ alt: "logo",
137
146
  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", {
147
+ className: "cbx-header-first-app-logo-empty"
148
+ }, /*#__PURE__*/_react.default.createElement("i", {
149
+ className: "ri-building-2-line"
150
+ })), innerWidth > breakpoints.md && /*#__PURE__*/_react.default.createElement("div", {
142
151
  className: "cbx-header-first-container-app-logo-text-empty"
143
152
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
144
153
  color: 'var(--primary)',
@@ -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,88 @@
1
+ .cbx-menuLateralLeft-block-mini,
1
2
  .cbx-menuLateralLeft-block {
2
3
  height: 100%;
3
- min-width: 4.75rem;
4
- width: 4.75rem;
5
4
  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
5
  top: 0;
16
6
  left: 0;
17
7
  }
18
8
 
19
- .cbx-menuLateralLeft-block-mobile {
20
- position: relative;
9
+ .cbx-menuLateralLeft-block-mini,
10
+ .cbx-menuLateralLeft-block,
11
+ .cbx-buttonPrincipalMenu-container-icon {
12
+ min-width: 4.75rem;
13
+ width: 4.75rem;
21
14
  }
22
15
 
23
16
  .cbx-menuLateralLeft-block-mobile {
24
17
  height: var(--spacing64);
25
18
  min-width: 100%;
26
- width: 100%;
27
19
  justify-content: space-between;
20
+ background: var(--gray1);
28
21
  }
29
22
 
30
23
  .cbx-menuLateralLeft-block,
31
- .cbx-menuLateralLeft-block-mobile {
24
+ .cbx-menuLateralLeft-block-mini {
32
25
  background: var(--white);
33
- border-right: 3px solid var(--gray1);
26
+ border-right: 0.188rem solid var(--gray1);
34
27
  }
35
28
 
36
29
  .cbx-menuLateralLeft-block-mobile,
37
30
  .cbx-menuLateralLeft-block-upper-mobile,
38
31
  .cbx-menuLateralLeft-icon-burguer-mobile,
39
32
  .cbx-menuLateralLeft-block-under-mobile,
40
- .cbx-menuLateralLeft-container-under,
41
- .cbx-menuLateralLeft-container-under-mobile {
33
+ .cbx-menuLateralLeft-container-under-mobile,
34
+ .cbx-menuLateralLeft-img-mini,
35
+ .cbx-buttonPrincipalMenu-container,
36
+ .cbx-buttonPrincipalMenu-block-childrens,
37
+ .cbx-menuLateralLeft-img,
38
+ .cbx-buttonPrincipalMenu-container-icon {
42
39
  display: flex;
43
40
  }
44
41
 
42
+ .cbx-menuLateralLeft-block-under,
43
+ .cbx-menuLateralLeft-block-mobile,
44
+ .cbx-menuLateralLeft-img-under,
45
+ .cbx-menuLateralLeft-container-upper,
46
+ .cbx-buttonPrincipalMenu-container-childrens,
47
+ .cbx-buttonPrincipalMenu-container-text {
48
+ overflow: hidden;
49
+ }
50
+
45
51
  .cbx-menuLateralLeft-block-upper-mobile,
46
52
  .cbx-menuLateralLeft-block-mobile,
47
- .cbx-menuLateralLeft-block-under-mobile {
53
+ .cbx-menuLateralLeft-block-under-mobile,
54
+ .cbx-buttonPrincipalMenu-block-childrens,
55
+ .cbx-buttonPrincipalMenu-container,
56
+ .cbx-buttonPrincipalMenu-block-childrens,
57
+ .cbx-buttonPrincipalMenu-container-icon {
48
58
  align-items: center;
49
59
  }
50
60
 
61
+ .cbx-menuLateralLeft-block-under,
62
+ .cbx-menuLateralLeft-block-mobile {
63
+ width: 100%;
64
+ }
65
+
51
66
  .cbx-menuLateralLeft-block-under {
52
67
  bottom: 0;
53
68
  left: 0;
54
- width: 100%;
69
+
70
+ }
71
+
72
+ .cbx-menuLateralLeft-img-mini,
73
+ .cbx-menuLateralLeft-block .cbx-menuLateralLeft-img,
74
+ .cbx-buttonPrincipalMenu-container-icon {
75
+ justify-content: center;
55
76
  }
56
77
 
57
78
  .cbx-menuLateralLeft-block-under,
58
79
  .cbx-menuLateralLeft-icon-burguer-mobile-red-dot,
59
80
  .cbx-menuLateralLeft-block-tooltip-under,
60
- .cbx-menuLateralLeft-block-tooltip-under-triangle {
81
+ .cbx-menuLateralLeft-block-tooltip-under-triangle,
82
+ .cbx-menuLateralLeft-mark,
83
+ .cbx-buttonPrincipalMenu-childrens-arrow,
84
+ .cbx-menuLateralLeft-block-mini,
85
+ .cbx-menuLateralLeft-block {
61
86
  position: absolute;
62
87
  }
63
88
 
@@ -71,7 +96,11 @@
71
96
  }
72
97
 
73
98
  .cbx-menuLateralLeft-container-under,
74
- .cbx-menuLateralLeft-container-under-mobile {
99
+ .cbx-menuLateralLeft-container-under-mobile,
100
+ .cbx-buttonPrincipalMenu-container,
101
+ .cbx-buttonPrincipalMenu-block-childrens,
102
+ .cbx-buttonPrincipalMenu-container-childrens,
103
+ .cbx-menuLateralLeft-block-mobile {
75
104
  position: relative;
76
105
  }
77
106
 
@@ -88,19 +117,27 @@
88
117
  background: var(--error);
89
118
  }
90
119
 
91
- .cbx-menuLateralLeft-block-tooltip-under {
120
+ .cbx-menuLateralLeft-block-tooltip-under,
121
+ .cbx-menuLateralLeft-mark {
92
122
  background: var(--primary);
123
+ }
124
+
125
+ .cbx-menuLateralLeft-block-tooltip-under,
126
+ .cbx-buttonPrincipalMenu-block-childrens,
127
+ .cbx-buttonPrincipalMenu-container {
128
+ cursor: pointer;
129
+ }
130
+
131
+ .cbx-menuLateralLeft-block-tooltip-under {
93
132
  top: -4.688rem;
94
133
  right: 0;
95
134
  padding: 0.5rem 0.75rem;
96
- border-radius: 4px;
97
- cursor: pointer;
135
+ border-radius: 0.25rem;
98
136
  width: 6rem;
99
137
  height: 4rem;
100
138
  }
101
139
 
102
140
  .cbx-menuLateralLeft-block-tooltip-under-triangle {
103
- width: 0;
104
141
  height: 0;
105
142
  border-left: 0.438rem solid transparent;
106
143
  border-right: 0.438rem solid transparent;
@@ -108,7 +145,101 @@
108
145
  bottom: -0.625rem;
109
146
  }
110
147
 
111
- .hoverGrande:hover {
112
- width: 250px;
113
- /* min-width: 250px; */
148
+ .cbx-menuLateralLeft-block-tooltip-under-triangle,
149
+ .scrollTransparent>div:nth-child(3)>div {
150
+ width: 0;
151
+ }
152
+
153
+ .cbx-menuLateralLeft-block:hover {
154
+ width: 14.375rem;
155
+ }
156
+
157
+ .cbx-menuLateralLeft-img-under {
158
+ width: 2.5rem;
159
+ height: 1.875rem;
160
+ transition: width 0.3s;
161
+ }
162
+
163
+ .cbx-menuLateralLeft-block:hover .cbx-menuLateralLeft-container-under {
164
+ justify-content: initial !important;
165
+ }
166
+
167
+ .cbx-menuLateralLeft-block:hover .cbx-menuLateralLeft-img-under {
168
+ width: 7.75rem;
169
+ margin-left: 1.394rem;
170
+ }
171
+
172
+ .cbx-buttonPrincipalMenu-block-icon {
173
+ font-size: 1.375rem;
174
+ }
175
+
176
+ .cbx-buttonPrincipalMenu-container div p,
177
+ .cbx-buttonPrincipalMenu-container .cbx-buttonPrincipalMenu-block-icon i,
178
+ .cbx-buttonPrincipalMenu-block-icon {
179
+ transition: color .3s;
180
+ }
181
+
182
+ .cbx-buttonPrincipalMenu-container:hover div p,
183
+ .cbx-buttonPrincipalMenu-container:hover .cbx-buttonPrincipalMenu-block-icon i,
184
+ .cbx-buttonPrincipalMenu-childrens-icon {
185
+ color: var(--primary);
186
+ }
187
+
188
+ .cbx-buttonPrincipalMenu-block-childrens {
189
+ transition: all .3s;
190
+ max-width: 12.5rem;
191
+ margin-left: 1.188rem;
192
+ margin-bottom: 0.5rem;
193
+ border-radius: 1.25rem;
194
+ padding: 0 1.25rem;
195
+ }
196
+
197
+ .cbx-buttonPrincipalMenu-block-childrens:hover {
198
+ background: var(--primary10) !important;
199
+ }
200
+
201
+ .scrollTransparent>div:nth-child(3) {
202
+ width: 0px !important;
203
+ }
204
+
205
+ .scrollTransparent>div:nth-child(3)>div {
206
+ background: white;
207
+ }
208
+
209
+ .cbx-menuLateralLeft-mark {
210
+ width: 0.313rem;
211
+ height: 1.75rem;
212
+ right: -0.188rem;
213
+ transition: all .1s;
214
+ }
215
+
216
+ .cbx-buttonPrincipalMenu-childrens-arrow {
217
+ left: var(--spacing8);
218
+ font-weight: bold;
219
+ transition: font-size .3s, transform .3s;
220
+ }
221
+
222
+ .cbx-buttonPrincipalMenu-container-icon {
223
+ height: 4.75rem;
224
+ }
225
+
226
+ .cbx-buttonPrincipalMenu-container-text {
227
+ transition: width 0.2s ease-in 0.0s;
228
+ margin-left: -0.5rem;
229
+ max-width: 9.375rem;
230
+ }
231
+
232
+ .cbx-buttonPrincipalMenu-container-childrens {
233
+ top: -0.625rem;
234
+ transition: max-height .4s linear;
235
+ }
236
+
237
+ .cbx-buttonPrincipalMenu-childrens-icon-block {
238
+ min-width: 1.125rem;
239
+ min-height: 1.75rem;
240
+ margin-right: 0.688rem;
241
+ }
242
+
243
+ .cbx-buttonPrincipalMenu-childrens-icon {
244
+ transition: font-size .3s;
114
245
  }
@@ -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,83 @@ 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
+ }
144
+ }, /*#__PURE__*/_react.default.createElement(_Scrollbar.default, {
145
+ classFix: 'scrollTransparent'
92
146
  }, /*#__PURE__*/_react.default.createElement("div", {
93
147
  className: mobile ? 'cbx-menuLateralLeft-block-upper-mobile' : 'cbx-menuLateralLeft-block-upper'
94
- }, resize() ? /*#__PURE__*/_react.default.createElement("div", {
148
+ }, resize() || mobile ? /*#__PURE__*/_react.default.createElement("div", {
95
149
  style: {
96
150
  display: mobile && 'flex'
97
151
  }
98
152
  }, /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
153
+ icon: upperSection[0].icon,
154
+ active: upperSection[0].active,
155
+ onClick: upperSection[0].action,
156
+ badge: upperSection[0].badge,
157
+ styles: _objectSpread({}, mobile ? {
158
+ width: 'var(--spacing64)',
159
+ height: 'var(--spacing64)'
160
+ } : {})
161
+ }), /*#__PURE__*/_react.default.createElement(_IconButtonSquare.default, {
99
162
  icon: iconSelectDropDown().icon,
100
163
  active: iconSelectDropDown().active,
101
164
  onClick: iconSelectDropDown().action,
102
165
  badge: iconSelectDropDown().badge,
103
- styles: _objectSpread({}, resize() ? {
166
+ styles: _objectSpread({}, mobile ? {
104
167
  width: 'var(--spacing64)',
105
- height: 'var(--spacing64)'
168
+ height: 'var(--spacing64)',
169
+ fontSize: '1.375rem'
106
170
  } : {})
107
171
  }), /*#__PURE__*/_react.default.createElement(_DropDown.default, {
108
172
  color: "transparent",
@@ -112,14 +176,14 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
112
176
  className: 'ri-menu-line'
113
177
  }),
114
178
  badge: badgeBurguer().badge,
115
- styles: _objectSpread({}, resize() ? {
179
+ styles: _objectSpread({}, mobile ? {
116
180
  width: 'var(--spacing64)',
117
181
  height: 'var(--spacing64)'
118
182
  } : {})
119
183
  });
120
184
  },
121
185
  items: upperSection === null || upperSection === void 0 ? void 0 : upperSection.map(function (item, index) {
122
- return !item.active && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
186
+ return !item.active && !item.first && /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
123
187
  key: "upper-section-".concat(index),
124
188
  onClick: item.action
125
189
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -133,21 +197,24 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
133
197
  }),
134
198
  anchorOrigin: _objectSpread({}, !mobile ? {
135
199
  vertical: 'center',
136
- horizontal: 'left'
200
+ horizontal: 'right'
137
201
  } : {
138
202
  vertical: 'top',
139
203
  horizontal: 'center'
140
204
  }),
141
205
  transformOrigin: _objectSpread({}, !mobile ? {
142
206
  vertical: 'top',
143
- horizontal: 'right'
207
+ horizontal: 'left'
144
208
  } : {
145
209
  vertical: 'bottom',
146
210
  horizontal: 'left'
147
211
  })
148
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.4",
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
  },