@councilbox/councilbox-ui 0.6.19 → 0.6.21
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/components/1.Introduction.stories.mdx +1 -1
- package/dist/components/2.Changelog.stories.mdx +3 -0
- package/dist/components/Header/Header.js +48 -8
- package/dist/components/Header/header.css +24 -12
- package/dist/components/InputAutocomplete/InputAutocomplete.css +0 -5
- package/dist/components/InputAutocomplete/InputAutocomplete.js +7 -19
- package/dist/components/MenuItem/MenuItem.css +6 -0
- package/dist/components/MenuItem/MenuItem.js +6 -4
- package/dist/components/SelectInput/SelectInput.js +2 -2
- package/package.json +1 -1
|
@@ -76,7 +76,13 @@ var Header = function Header(_ref) {
|
|
|
76
76
|
sectionCenterInputBaseProps = _ref.sectionCenterInputBaseProps,
|
|
77
77
|
iconButtonRightProps = _ref.iconButtonRightProps,
|
|
78
78
|
itemsDropDownUserProps = _ref.itemsDropDownUserProps,
|
|
79
|
-
demoMode = _ref.demoMode
|
|
79
|
+
demoMode = _ref.demoMode,
|
|
80
|
+
onClickButtonNotification = _ref.onClickButtonNotification,
|
|
81
|
+
buttonNotificationIcon = _ref.buttonNotificationIcon,
|
|
82
|
+
buttonNotificationProps = _ref.buttonNotificationProps,
|
|
83
|
+
buttonNotificationBadge = _ref.buttonNotificationBadge,
|
|
84
|
+
styleIconButtonRightContainer = _ref.styleIconButtonRightContainer,
|
|
85
|
+
styleIconButtonRight = _ref.styleIconButtonRight;
|
|
80
86
|
|
|
81
87
|
var _useWindowSize = (0, _useWindowSize2.default)(),
|
|
82
88
|
innerWidth = _useWindowSize.innerWidth,
|
|
@@ -317,7 +323,18 @@ var Header = function Header(_ref) {
|
|
|
317
323
|
}
|
|
318
324
|
}, "DEMO"), logoAndDropdownSeparate ? /*#__PURE__*/_react.default.createElement("div", {
|
|
319
325
|
className: "cbx-header-third-container"
|
|
320
|
-
},
|
|
326
|
+
}, !!onClickButtonNotification && /*#__PURE__*/_react.default.createElement("div", {
|
|
327
|
+
className: "cbx-header-third-button-notification-container"
|
|
328
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
329
|
+
"aria-label": "",
|
|
330
|
+
id: 'cbx-header-third-button-notification',
|
|
331
|
+
className: "cbx-header-third-button-notification",
|
|
332
|
+
onClick: onClickButtonNotification,
|
|
333
|
+
icon: buttonNotificationIcon || /*#__PURE__*/_react.default.createElement("i", {
|
|
334
|
+
className: "ri-notification-3-line"
|
|
335
|
+
}),
|
|
336
|
+
badge: buttonNotificationBadge
|
|
337
|
+
}, buttonNotificationProps))), (logoRight || logoRightXS) && (!itemsDropDownUser || iconButtonRight) && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", {
|
|
321
338
|
id: 'cbx-header-third-logo-right',
|
|
322
339
|
className: "cbx-header-third-logo-right",
|
|
323
340
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
@@ -353,8 +370,10 @@ var Header = function Header(_ref) {
|
|
|
353
370
|
"aria-label": "",
|
|
354
371
|
id: 'cbx-header-third-button-user',
|
|
355
372
|
className: "cbx-header-third-button-user cbx-header-button",
|
|
373
|
+
styles: _objectSpread({}, styleIconButtonRightContainer),
|
|
356
374
|
icon: iconButtonRight || /*#__PURE__*/_react.default.createElement("i", {
|
|
357
|
-
className: "ri-user-3-line"
|
|
375
|
+
className: "ri-user-3-line",
|
|
376
|
+
style: _objectSpread({}, styleIconButtonRight)
|
|
358
377
|
})
|
|
359
378
|
}, iconButtonRightProps)), (logoRight || logoRightXS) && !iconButtonRight && /*#__PURE__*/_react.default.createElement("img", {
|
|
360
379
|
style: {
|
|
@@ -367,7 +386,20 @@ var Header = function Header(_ref) {
|
|
|
367
386
|
}));
|
|
368
387
|
},
|
|
369
388
|
items: itemsDropDownUser
|
|
370
|
-
}, itemsDropDownUserProps)))) : /*#__PURE__*/_react.default.createElement("div",
|
|
389
|
+
}, itemsDropDownUserProps)))) : /*#__PURE__*/_react.default.createElement("div", {
|
|
390
|
+
className: "cbx-header-third-container"
|
|
391
|
+
}, !!onClickButtonNotification && /*#__PURE__*/_react.default.createElement("div", {
|
|
392
|
+
className: "cbx-header-third-button-notification-container-noSeparate"
|
|
393
|
+
}, /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
394
|
+
"aria-label": "",
|
|
395
|
+
id: 'cbx-header-third-button-notification',
|
|
396
|
+
className: "cbx-header-third-button-notification",
|
|
397
|
+
onClick: onClickButtonNotification,
|
|
398
|
+
icon: buttonNotificationIcon || /*#__PURE__*/_react.default.createElement("i", {
|
|
399
|
+
className: "ri-notification-3-line"
|
|
400
|
+
}),
|
|
401
|
+
badge: buttonNotificationBadge
|
|
402
|
+
}, buttonNotificationProps))), /*#__PURE__*/_react.default.createElement(_DropDown.default, _extends({
|
|
371
403
|
color: "transparent",
|
|
372
404
|
anchorOrigin: {
|
|
373
405
|
vertical: 'bottom',
|
|
@@ -394,9 +426,11 @@ var Header = function Header(_ref) {
|
|
|
394
426
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
395
427
|
alt: "logo"
|
|
396
428
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
397
|
-
className: "cbx-header-third-button-user-logo "
|
|
429
|
+
className: "cbx-header-third-button-user-logo ",
|
|
430
|
+
style: _objectSpread({}, styleIconButtonRightContainer)
|
|
398
431
|
}, iconButtonRight || /*#__PURE__*/_react.default.createElement("i", {
|
|
399
|
-
className: "ri-user-3-line"
|
|
432
|
+
className: "ri-user-3-line",
|
|
433
|
+
style: _objectSpread({}, styleIconButtonRight)
|
|
400
434
|
})))
|
|
401
435
|
}, iconButtonRightProps));
|
|
402
436
|
},
|
|
@@ -433,7 +467,10 @@ Header.propTypes = {
|
|
|
433
467
|
finishButtonVariant: _propTypes.default.node,
|
|
434
468
|
finishButtonIcon: _propTypes.default.node,
|
|
435
469
|
actionLogoLeft: _propTypes.default.func,
|
|
436
|
-
demoMode: _propTypes.default.bool
|
|
470
|
+
demoMode: _propTypes.default.bool,
|
|
471
|
+
buttonNotificationIcon: _propTypes.default.any,
|
|
472
|
+
buttonNotificationProps: _propTypes.default.any,
|
|
473
|
+
buttonNotificationBadge: _propTypes.default.bool
|
|
437
474
|
};
|
|
438
475
|
Header.defaultProps = {
|
|
439
476
|
back: '',
|
|
@@ -463,7 +500,10 @@ Header.defaultProps = {
|
|
|
463
500
|
dropdownLeftIcon: '',
|
|
464
501
|
finishButtonVariant: '',
|
|
465
502
|
finishButtonIcon: '',
|
|
466
|
-
demoMode: false
|
|
503
|
+
demoMode: false,
|
|
504
|
+
buttonNotificationIcon: undefined,
|
|
505
|
+
buttonNotificationProps: undefined,
|
|
506
|
+
buttonNotificationBadge: false
|
|
467
507
|
};
|
|
468
508
|
var _default = Header;
|
|
469
509
|
exports.default = _default;
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
.cbx-header-third-logo-right,
|
|
42
42
|
.App-logo-header-ui {
|
|
43
43
|
display: block;
|
|
44
|
-
max-width: 7.813rem!important;
|
|
45
|
-
max-height: 2.5rem!important;
|
|
44
|
+
max-width: 7.813rem !important;
|
|
45
|
+
max-height: 2.5rem !important;
|
|
46
46
|
user-select: none;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -101,11 +101,14 @@
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.cbx-header-third-button-user,
|
|
104
|
-
.cbx-header-third-button-user-logo,
|
|
105
104
|
.cbx-header-second-block-search {
|
|
106
105
|
background: var(--gray1) !important
|
|
107
106
|
}
|
|
108
107
|
|
|
108
|
+
.cbx-header-third-button-user-logo{
|
|
109
|
+
background: var(--gray1);
|
|
110
|
+
}
|
|
111
|
+
|
|
109
112
|
.cbx-header-button,
|
|
110
113
|
.cbx-header-first-app-logo-empty,
|
|
111
114
|
.cbx-header-third-button-user-logo {
|
|
@@ -114,14 +117,14 @@
|
|
|
114
117
|
}
|
|
115
118
|
|
|
116
119
|
.cbx-header-first-app-logo-empty {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
background: var(--primary);
|
|
121
|
+
border-radius: 50%;
|
|
122
|
+
color: var(--white);
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
font-size: 1.375rem;
|
|
127
|
+
min-width: var(--spacing40);
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
.cbx-header-button {
|
|
@@ -156,4 +159,13 @@
|
|
|
156
159
|
|
|
157
160
|
.cbx-header-third-container-logo-right {
|
|
158
161
|
margin-right: var(--spacing4)
|
|
159
|
-
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.cbx-header-third-button-notification-container {
|
|
165
|
+
margin-right: 2rem;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.cbx-header-third-button-notification i {
|
|
169
|
+
color: var(--primary);
|
|
170
|
+
font-size: 1.125rem;
|
|
171
|
+
}
|
|
@@ -7,16 +7,12 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _reactDom = require("react-dom");
|
|
11
|
-
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
11
|
|
|
14
12
|
require("../../styles/main.css");
|
|
15
13
|
|
|
16
14
|
var _Autocomplete = _interopRequireDefault(require("@mui/material/Autocomplete"));
|
|
17
15
|
|
|
18
|
-
var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
|
|
19
|
-
|
|
20
16
|
require("./InputAutocomplete.css");
|
|
21
17
|
|
|
22
18
|
var _InputText = _interopRequireDefault(require("../InputText/InputText"));
|
|
@@ -82,7 +78,7 @@ var InputAutocomplete = function InputAutocomplete(_ref) {
|
|
|
82
78
|
|
|
83
79
|
return /*#__PURE__*/_react.default.createElement(_Autocomplete.default, _extends({
|
|
84
80
|
id: id,
|
|
85
|
-
className: className,
|
|
81
|
+
className: "".concat(className || ''),
|
|
86
82
|
onChange: onChange,
|
|
87
83
|
disabled: disabled,
|
|
88
84
|
sx: _objectSpread({
|
|
@@ -96,9 +92,11 @@ var InputAutocomplete = function InputAutocomplete(_ref) {
|
|
|
96
92
|
},
|
|
97
93
|
'&.MuiAutocomplete-root .MuiInput-root': {
|
|
98
94
|
paddingBottom: '0!important'
|
|
95
|
+
},
|
|
96
|
+
'&.MuiAutocomplete-root .MuiAutocomplete-inputRoot .MuiAutocomplete-input': {
|
|
97
|
+
paddingRight: '2.5rem!important'
|
|
99
98
|
}
|
|
100
99
|
}, sx),
|
|
101
|
-
disablePortal: false,
|
|
102
100
|
freeSolo: true,
|
|
103
101
|
options: top100Films,
|
|
104
102
|
renderInput: function renderInput(params) {
|
|
@@ -116,19 +114,9 @@ var InputAutocomplete = function InputAutocomplete(_ref) {
|
|
|
116
114
|
}));
|
|
117
115
|
},
|
|
118
116
|
renderOption: function renderOption(propsOption) {
|
|
119
|
-
return /*#__PURE__*/_react.default.createElement(_MenuItem.default,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/_react.default.createElement(_Popper.default, _extends({
|
|
123
|
-
className: fullWidth ? 'cbx-inputAutocomplete-fullwidth' : '',
|
|
124
|
-
sx: {
|
|
125
|
-
'&.MuiPopper-root': {
|
|
126
|
-
minWidth: fullWidth ? 'auto' : '13.75rem!important',
|
|
127
|
-
maxWidth: fullWidth ? 'auto' : '17.5rem!important',
|
|
128
|
-
width: fullWidth ? 'auto' : 'auto!important'
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}, propsPopper)), document.body);
|
|
117
|
+
return /*#__PURE__*/_react.default.createElement(_MenuItem.default, _extends({
|
|
118
|
+
fullWidth: fullWidth
|
|
119
|
+
}, propsOption), propsOption.key);
|
|
132
120
|
}
|
|
133
121
|
}, props));
|
|
134
122
|
};
|
|
@@ -19,7 +19,7 @@ var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
|
19
19
|
|
|
20
20
|
var _DropDown = _interopRequireDefault(require("../DropDown/DropDown"));
|
|
21
21
|
|
|
22
|
-
var _excluded = ["id", "children", "icon", "sx", "badge", "menuItems", "setOpen", "onClick", "endIcon", "className"];
|
|
22
|
+
var _excluded = ["id", "children", "icon", "sx", "badge", "menuItems", "setOpen", "onClick", "endIcon", "className", "fullWidth"];
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
@@ -46,6 +46,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
46
46
|
onClick = _ref.onClick,
|
|
47
47
|
endIcon = _ref.endIcon,
|
|
48
48
|
className = _ref.className,
|
|
49
|
+
fullWidth = _ref.fullWidth,
|
|
49
50
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
50
51
|
|
|
51
52
|
var getContent = function getContent() {
|
|
@@ -53,9 +54,10 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
53
54
|
id: id,
|
|
54
55
|
sx: _objectSpread({
|
|
55
56
|
padding: '0.75rem 1.25rem!important',
|
|
56
|
-
minWidth: '13.75rem!important',
|
|
57
|
+
minWidth: fullWidth ? '100%!important' : '13.75rem!important',
|
|
57
58
|
maxHeight: '3rem!important',
|
|
58
|
-
maxWidth: '17.5rem!important',
|
|
59
|
+
maxWidth: fullWidth ? '100%!important' : '17.5rem!important',
|
|
60
|
+
width: fullWidth && '100%!important',
|
|
59
61
|
'&.MuiButtonBase-root.MuiMenuItem-root.Mui-selected': {
|
|
60
62
|
background: 'var(--gray1)'
|
|
61
63
|
},
|
|
@@ -65,7 +67,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
65
67
|
}, sx)
|
|
66
68
|
}, props, {
|
|
67
69
|
onClick: onClick || setOpen,
|
|
68
|
-
className: "cbx-menuItem ".concat(className)
|
|
70
|
+
className: "cbx-menuItem ".concat(className || '')
|
|
69
71
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
70
72
|
className: "cbx-menuItem-container"
|
|
71
73
|
}, icon && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -279,9 +279,9 @@ var SelectInput = function SelectInput(_ref) {
|
|
|
279
279
|
PaperProps: {
|
|
280
280
|
className: fullWidth ? 'cbx-selectInput-fullwidth' : ''
|
|
281
281
|
}
|
|
282
|
-
}
|
|
283
|
-
value: value
|
|
282
|
+
}
|
|
284
283
|
}, props, {
|
|
284
|
+
value: value,
|
|
285
285
|
InputProps: {
|
|
286
286
|
endAdornment: getIcon()
|
|
287
287
|
}
|