@councilbox/councilbox-ui 0.3.6 → 0.3.8
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/Header/Header.js +3 -2
- package/dist/components/Header/header.css +1 -0
- package/dist/components/IconButton/IconButton.js +4 -2
- package/dist/components/InputPassword/InputPassword.js +3 -1
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +8 -1
- package/dist/components/MenuLateralRight/MenuLateralRight.css +9 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.js +5 -1
- package/dist/components/SelectInput/DesignSelectInput.stories.js +36 -0
- package/dist/components/SelectInput/SelectInput.css +0 -0
- package/dist/components/SelectInput/SelectInput.js +90 -0
- package/dist/components/SelectInput/SelectInput.stories.js +39 -0
- package/package.json +1 -1
|
@@ -56,7 +56,8 @@ var Header = function Header(_ref) {
|
|
|
56
56
|
onChangeSearch = _ref.onChangeSearch,
|
|
57
57
|
onClickIconButtonRight = _ref.onClickIconButtonRight,
|
|
58
58
|
colorNoLogo = _ref.colorNoLogo,
|
|
59
|
-
actionLogoLeft = _ref.actionLogoLeft
|
|
59
|
+
actionLogoLeft = _ref.actionLogoLeft,
|
|
60
|
+
backIcon = _ref.backIcon;
|
|
60
61
|
|
|
61
62
|
var _useWindowSize = (0, _useWindowSize2.default)(),
|
|
62
63
|
innerWidth = _useWindowSize.innerWidth,
|
|
@@ -114,7 +115,7 @@ var Header = function Header(_ref) {
|
|
|
114
115
|
id: 'cbx-header-first-button-left',
|
|
115
116
|
className: "cbx-header-first-button-left cbx-header-button",
|
|
116
117
|
onClick: back,
|
|
117
|
-
icon: /*#__PURE__*/_react.default.createElement("i", {
|
|
118
|
+
icon: backIcon || /*#__PURE__*/_react.default.createElement("i", {
|
|
118
119
|
className: "ri-arrow-left-line"
|
|
119
120
|
})
|
|
120
121
|
})), dropdownLeft && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -19,7 +19,7 @@ require("./IconButton.css");
|
|
|
19
19
|
|
|
20
20
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
21
21
|
|
|
22
|
-
var _excluded = ["id", "className", "onClick", "icon", "backgroundColor", "styles", "badge", "classNameBadge", "rounded", "tooltip", "placementTooltip"];
|
|
22
|
+
var _excluded = ["id", "className", "onClick", "icon", "backgroundColor", "styles", "badge", "classNameBadge", "rounded", "tooltip", "placementTooltip", "disabled"];
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
@@ -47,6 +47,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
47
47
|
rounded = _ref.rounded,
|
|
48
48
|
tooltip = _ref.tooltip,
|
|
49
49
|
placementTooltip = _ref.placementTooltip,
|
|
50
|
+
disabled = _ref.disabled,
|
|
50
51
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
51
52
|
|
|
52
53
|
var getIcon = function getIcon() {
|
|
@@ -60,6 +61,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
60
61
|
id: id,
|
|
61
62
|
className: className,
|
|
62
63
|
onClick: onClick,
|
|
64
|
+
disabled: disabled,
|
|
63
65
|
sx: _objectSpread(_objectSpread({
|
|
64
66
|
width: 'var(--spacing40)',
|
|
65
67
|
height: 'var(--spacing40)',
|
|
@@ -67,7 +69,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
67
69
|
color: 'var(--gray3)',
|
|
68
70
|
background: backgroundColor
|
|
69
71
|
}, rounded ? {
|
|
70
|
-
border: '2px solid var(--primary)',
|
|
72
|
+
border: disabled ? '2px solid rgba(0,0,0,0.26)' : '2px solid var(--primary)',
|
|
71
73
|
color: 'var(--primary)'
|
|
72
74
|
} : {}), {}, {
|
|
73
75
|
'&:focus': {
|
|
@@ -23,7 +23,7 @@ var _CouncilboxThemeContext = require("../ThemeProvider/CouncilboxThemeContext")
|
|
|
23
23
|
|
|
24
24
|
var _InputText = _interopRequireDefault(require("../InputText/InputText"));
|
|
25
25
|
|
|
26
|
-
var _excluded = ["id", "className", "onChange", "onClick", "label", "disabled", "error", "helper", "width", "validation", "percentageError", "helperText", "fullWidth"];
|
|
26
|
+
var _excluded = ["id", "className", "onChange", "onKeyUp", "onClick", "label", "disabled", "error", "helper", "width", "validation", "percentageError", "helperText", "fullWidth"];
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
@@ -49,6 +49,7 @@ var InputPassword = function InputPassword(_ref) {
|
|
|
49
49
|
var id = _ref.id,
|
|
50
50
|
className = _ref.className,
|
|
51
51
|
onChange = _ref.onChange,
|
|
52
|
+
onKeyUp = _ref.onKeyUp,
|
|
52
53
|
onClick = _ref.onClick,
|
|
53
54
|
label = _ref.label,
|
|
54
55
|
disabled = _ref.disabled,
|
|
@@ -90,6 +91,7 @@ var InputPassword = function InputPassword(_ref) {
|
|
|
90
91
|
onChange: onChange,
|
|
91
92
|
disabled: disabled,
|
|
92
93
|
error: error,
|
|
94
|
+
onKeyUp: onKeyUp,
|
|
93
95
|
helper: helper,
|
|
94
96
|
type: showPassword ? 'text' : 'password',
|
|
95
97
|
helperText: validation && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -55,7 +55,8 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
55
55
|
var id = _ref.id,
|
|
56
56
|
upperSection = _ref.upperSection,
|
|
57
57
|
underSection = _ref.underSection,
|
|
58
|
-
mobile = _ref.mobile
|
|
58
|
+
mobile = _ref.mobile,
|
|
59
|
+
upperIndex = _ref.upperIndex;
|
|
59
60
|
|
|
60
61
|
var _useWindowSize = (0, _useWindowSize2.default)(),
|
|
61
62
|
innerWidth = _useWindowSize.innerWidth,
|
|
@@ -120,6 +121,12 @@ var MenuLateralLeft = function MenuLateralLeft(_ref) {
|
|
|
120
121
|
}
|
|
121
122
|
}, [resize()]);
|
|
122
123
|
|
|
124
|
+
_react.default.useEffect(function () {
|
|
125
|
+
to(upperSection.findIndex(function (item) {
|
|
126
|
+
return item.active;
|
|
127
|
+
}));
|
|
128
|
+
}, [upperIndex]);
|
|
129
|
+
|
|
123
130
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
124
131
|
id: id,
|
|
125
132
|
className: mobile ? 'cbx-menuLateralLeft-block-mobile' : resize() ? 'cbx-menuLateralLeft-block-mini' : 'cbx-menuLateralLeft-block',
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
.cbx-menuLateralRight-block-under,
|
|
51
51
|
.cbx-menuLateralRight-icon-burguer-mobile-red-dot,
|
|
52
52
|
.cbx-menuLateralRight-block-tooltip-under,
|
|
53
|
-
.cbx-menuLateralRight-block-tooltip-under-triangle
|
|
53
|
+
.cbx-menuLateralRight-block-tooltip-under-triangle,
|
|
54
|
+
.cbx-menuLateralRight-block-action-disabled {
|
|
54
55
|
position: absolute;
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
border-radius: 4px;
|
|
91
92
|
cursor: pointer;
|
|
92
93
|
width: 6rem;
|
|
93
|
-
|
|
94
|
+
height: 4rem;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
.cbx-menuLateralRight-block-tooltip-under-triangle {
|
|
@@ -100,4 +101,10 @@
|
|
|
100
101
|
border-right: 0.438rem solid transparent;
|
|
101
102
|
border-top: 0.625rem solid var(--primary);
|
|
102
103
|
bottom: -0.625rem;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.cbx-menuLateralRight-block-action-disabled {
|
|
107
|
+
width: 2.5rem;
|
|
108
|
+
height: 2.5rem;
|
|
109
|
+
background: transparent;
|
|
103
110
|
}
|
|
@@ -162,7 +162,11 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
|
|
|
162
162
|
style: {
|
|
163
163
|
left: mobile ? '4.313rem' : '3.125rem'
|
|
164
164
|
}
|
|
165
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
165
|
+
})), item.actionDisabled && /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
className: 'cbx-menuLateralRight-block-action-disabled',
|
|
167
|
+
onClick: item.actionDisabled
|
|
168
|
+
}), /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
169
|
+
disabled: item.disabled,
|
|
166
170
|
tooltip: item.text,
|
|
167
171
|
icon: item.icon,
|
|
168
172
|
badge: item.badge,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
require("../../styles/main.css");
|
|
13
|
+
|
|
14
|
+
var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
var majorityTypes = ['Absolute', 'Two thirds', 'Percentage', 'Fraction', 'Number'];
|
|
19
|
+
|
|
20
|
+
var DesignSelectInput = function DesignSelectInput() {
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
style: {
|
|
23
|
+
display: 'flex'
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement(_SelectInput.default, {
|
|
26
|
+
label: 'Majority Type'
|
|
27
|
+
}, majorityTypes.map(function (type) {
|
|
28
|
+
return /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
29
|
+
key: type
|
|
30
|
+
}, type);
|
|
31
|
+
})));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
DesignSelectInput.displayName = "DesignSelectInput";
|
|
35
|
+
var _default = DesignSelectInput;
|
|
36
|
+
exports.default = _default;
|
|
File without changes
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
13
|
+
|
|
14
|
+
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
15
|
+
|
|
16
|
+
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
17
|
+
|
|
18
|
+
require("../../styles/main.css");
|
|
19
|
+
|
|
20
|
+
require("./SelectInput.css");
|
|
21
|
+
|
|
22
|
+
var _excluded = ["id", "className", "onChange", "label", "disabled", "width", "fullWidth", "children"];
|
|
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 _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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
var SelectInput = function SelectInput(_ref) {
|
|
33
|
+
var id = _ref.id,
|
|
34
|
+
className = _ref.className,
|
|
35
|
+
onChange = _ref.onChange,
|
|
36
|
+
label = _ref.label,
|
|
37
|
+
disabled = _ref.disabled,
|
|
38
|
+
width = _ref.width,
|
|
39
|
+
fullWidth = _ref.fullWidth,
|
|
40
|
+
children = _ref.children,
|
|
41
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
+
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_FormControl.default, null, label && /*#__PURE__*/_react.default.createElement(_InputLabel.default, {
|
|
44
|
+
disabled: disabled,
|
|
45
|
+
sx: {
|
|
46
|
+
'&.MuiFormLabel-root:not(.Mui-focused)': {
|
|
47
|
+
top: '-0.25rem!important'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, label), /*#__PURE__*/_react.default.createElement(_Select.default, _extends({
|
|
51
|
+
id: id,
|
|
52
|
+
className: className,
|
|
53
|
+
sx: {
|
|
54
|
+
minWidth: width || '15rem',
|
|
55
|
+
minHeight: '3rem'
|
|
56
|
+
},
|
|
57
|
+
label: label,
|
|
58
|
+
fullWidth: fullWidth,
|
|
59
|
+
onChange: onChange,
|
|
60
|
+
disabled: disabled,
|
|
61
|
+
SelectDisplayProps: {
|
|
62
|
+
style: {
|
|
63
|
+
minHeight: '1rem',
|
|
64
|
+
maxHeight: '1rem'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}, props), children));
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
SelectInput.displayName = "SelectInput";
|
|
71
|
+
SelectInput.propTypes = {
|
|
72
|
+
label: _propTypes.default.string,
|
|
73
|
+
width: _propTypes.default.string,
|
|
74
|
+
id: _propTypes.default.string,
|
|
75
|
+
className: _propTypes.default.string,
|
|
76
|
+
onChange: _propTypes.default.func,
|
|
77
|
+
disabled: _propTypes.default.bool,
|
|
78
|
+
children: _propTypes.default.node
|
|
79
|
+
};
|
|
80
|
+
SelectInput.defaultProps = {
|
|
81
|
+
label: '',
|
|
82
|
+
width: '',
|
|
83
|
+
id: '',
|
|
84
|
+
className: '',
|
|
85
|
+
onChange: undefined,
|
|
86
|
+
disabled: false,
|
|
87
|
+
children: []
|
|
88
|
+
};
|
|
89
|
+
var _default = SelectInput;
|
|
90
|
+
exports.default = _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.DesignSelectInputTemplate = exports.Default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
11
|
+
|
|
12
|
+
var _DesignSelectInput = _interopRequireDefault(require("./DesignSelectInput.stories"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var _default = {
|
|
17
|
+
title: 'Example/SelectInput',
|
|
18
|
+
component: _SelectInput.default,
|
|
19
|
+
argTypes: {}
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
|
|
23
|
+
var Template = function Template(args) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_SelectInput.default, args);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
Template.displayName = "Template";
|
|
28
|
+
var Default = Template.bind({});
|
|
29
|
+
exports.Default = Default;
|
|
30
|
+
Default.args = {};
|
|
31
|
+
|
|
32
|
+
var TemplateSelectInput = function TemplateSelectInput(args) {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_DesignSelectInput.default, args);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
TemplateSelectInput.displayName = "TemplateSelectInput";
|
|
37
|
+
var DesignSelectInputTemplate = TemplateSelectInput.bind({});
|
|
38
|
+
exports.DesignSelectInputTemplate = DesignSelectInputTemplate;
|
|
39
|
+
DesignSelectInputTemplate.args = {};
|