@councilbox/councilbox-ui 0.0.6 → 0.0.9
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.
|
@@ -15,6 +15,8 @@ require("../../styles/main.css");
|
|
|
15
15
|
|
|
16
16
|
require("./button.css");
|
|
17
17
|
|
|
18
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
19
|
+
|
|
18
20
|
var _excluded = ["id", "text", "onClick", "disabled", "loading", "variant", "fullWidth", "icon"];
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -79,31 +81,43 @@ var Button = function Button(_ref) {
|
|
|
79
81
|
id: id,
|
|
80
82
|
sx: {
|
|
81
83
|
minWidth: !isSecondaryOrTernary(variant) ? '140px' : '100px',
|
|
82
|
-
|
|
83
|
-
boxShadow: 'none'
|
|
84
|
+
minHeight: '48px',
|
|
85
|
+
boxShadow: 'none',
|
|
86
|
+
letterSpacing: '1px'
|
|
84
87
|
},
|
|
85
|
-
className: "cbx-button ".concat(buttonVariant, " ").concat(icon ? 'cbx-button-with-icon' : '', " ").concat(!isSecondaryOrTernary(variant) && "cbx-button-hoverAndAnimation".concat(fullWidth ? '-fullWidth' : '')),
|
|
88
|
+
className: "cbx-button ".concat(isSecondaryOrTernary(variant) && disabled ? 'cbx-button-outlined-disabled' : '', " ").concat(buttonVariant, " ").concat(icon ? 'cbx-button-with-icon' : '', " ").concat(!isSecondaryOrTernary(variant) && "cbx-button-hoverAndAnimation".concat(fullWidth ? '-fullWidth' : '')),
|
|
86
89
|
disabled: loading || disabled,
|
|
87
90
|
variant: buttonVariant,
|
|
88
91
|
style: _objectSpread({
|
|
89
92
|
backgroundColor: background,
|
|
90
|
-
color: buttonColor
|
|
93
|
+
color: buttonColor,
|
|
94
|
+
lineHeight: 'normal'
|
|
91
95
|
}, disabled || loading ? {
|
|
92
|
-
opacity: '0.
|
|
96
|
+
opacity: '0.4'
|
|
93
97
|
} : {}),
|
|
94
98
|
disableFocusRipple: true,
|
|
95
99
|
fullWidth: fullWidth,
|
|
96
100
|
onClick: onClick,
|
|
97
|
-
startIcon: icon
|
|
101
|
+
startIcon: icon && icon === 'arrow' ? /*#__PURE__*/_react.default.createElement("i", {
|
|
102
|
+
className: "ri-arrow-left-s-line"
|
|
103
|
+
}) : icon
|
|
98
104
|
}, props), /*#__PURE__*/_react.default.createElement("span", {
|
|
99
105
|
className: "button-text"
|
|
100
106
|
}, text), buttonVariant === 'contained' && !loading && /*#__PURE__*/_react.default.createElement("span", {
|
|
101
|
-
className: "containerArrow"
|
|
107
|
+
className: "cbx-button-containerArrow"
|
|
102
108
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
103
109
|
className: "ri-arrow-right-s-line arrow-primary"
|
|
104
|
-
})), loading && /*#__PURE__*/_react.default.createElement("
|
|
105
|
-
className: "
|
|
106
|
-
}
|
|
110
|
+
})), loading && /*#__PURE__*/_react.default.createElement("span", {
|
|
111
|
+
className: "cbx-button-containerLoading"
|
|
112
|
+
}, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
113
|
+
sx: {
|
|
114
|
+
color: 'white'
|
|
115
|
+
},
|
|
116
|
+
style: {
|
|
117
|
+
height: 'var(--spacing24)',
|
|
118
|
+
width: 'var(--spacing24)'
|
|
119
|
+
}
|
|
120
|
+
})));
|
|
107
121
|
};
|
|
108
122
|
|
|
109
123
|
Button.displayName = "Button";
|
|
@@ -19,9 +19,7 @@ var ICONS = {
|
|
|
19
19
|
edit: /*#__PURE__*/_react.default.createElement("i", {
|
|
20
20
|
className: "ri-pencil-line"
|
|
21
21
|
}),
|
|
22
|
-
arrowLeft:
|
|
23
|
-
className: "ri-arrow-left-s-line"
|
|
24
|
-
})
|
|
22
|
+
arrowLeft: 'arrow'
|
|
25
23
|
};
|
|
26
24
|
var _default = {
|
|
27
25
|
title: 'Example/Button',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.cbx-button:focus-visible {
|
|
6
|
-
box-shadow: 0 0 0
|
|
6
|
+
box-shadow: inset 0 0 0 2px white, 0px 0px 5px 3px rgb(56 57 140 / 75%);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.cbx-button-hoverAndAnimation{
|
|
@@ -14,13 +14,18 @@
|
|
|
14
14
|
justify-content: center;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.cbx-button-
|
|
17
|
+
.cbx-button-containerArrow, .cbx-button-containerLoading {
|
|
18
|
+
width: 15px;
|
|
19
|
+
display: flex;
|
|
20
|
+
height: 100%;
|
|
21
|
+
align-items: center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cbx-button-hoverAndAnimation .cbx-button-containerArrow, .cbx-button-hoverAndAnimation-fullWidth .cbx-button-containerArrow, .cbx-button-hoverAndAnimation .cbx-button-containerLoading, .cbx-button-hoverAndAnimation-fullWidth .cbx-button-containerLoading {
|
|
18
25
|
margin-left: var(--spacing24);
|
|
19
26
|
margin-right: var(--spacing8);
|
|
20
27
|
position: relative;
|
|
21
28
|
transition: padding .4s ease-in-out;
|
|
22
|
-
width: 15px;
|
|
23
|
-
height: 28px;
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
.cbx-button-hoverAndAnimation span i , .cbx-button-hoverAndAnimation-fullWidth span i {
|
|
@@ -32,3 +37,8 @@
|
|
|
32
37
|
.cbx-button-hoverAndAnimation:hover span i , .cbx-button-hoverAndAnimation-fullWidth:hover span i {
|
|
33
38
|
padding-left: var(--spacing8);
|
|
34
39
|
}
|
|
40
|
+
|
|
41
|
+
.cbx-button-outlined-disabled{
|
|
42
|
+
color: var(--neutral900)!important;
|
|
43
|
+
border-color: var(--primary)!important;
|
|
44
|
+
}
|
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
}
|
|
5
5
|
.cbx-inputText-infoBtn {
|
|
6
6
|
margin-right: var(--spacing4);
|
|
7
|
+
color: var(--error600);
|
|
8
|
+
height: 14px;
|
|
9
|
+
line-height: 1.1;
|
|
10
|
+
font-size: 14px;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
.cbx-inputText-endAdornment {
|
|
10
14
|
margin-right: var(--spacing4);
|
|
11
15
|
margin-top: var(--spacing12);
|
|
12
16
|
margin-bottom: var(--spacing12);
|
|
17
|
+
color: var(--success600);
|
|
18
|
+
font-size: 19px;
|
|
13
19
|
}
|
|
@@ -17,14 +17,8 @@ require("./InputText.css");
|
|
|
17
17
|
|
|
18
18
|
var _styled = _interopRequireDefault(require("@mui/material/styles/styled"));
|
|
19
19
|
|
|
20
|
-
var _info = require("../../assets/img/info.svg");
|
|
21
|
-
|
|
22
|
-
var _check = require("../../assets/img/check.svg");
|
|
23
|
-
|
|
24
20
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
25
21
|
|
|
26
|
-
var _CouncilboxThemeContext = require("../ThemeProvider/CouncilboxThemeContext");
|
|
27
|
-
|
|
28
22
|
var _excluded = ["id", "className", "onChange", "label", "disabled", "error", "helper", "success", "width", "helperText", "fullWidth"];
|
|
29
23
|
|
|
30
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -159,9 +153,6 @@ var InputText = function InputText(_ref2) {
|
|
|
159
153
|
fullWidth = _ref2.fullWidth,
|
|
160
154
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
161
155
|
|
|
162
|
-
var _useCouncilboxTheme = (0, _CouncilboxThemeContext.useCouncilboxTheme)(),
|
|
163
|
-
theme = _useCouncilboxTheme.theme;
|
|
164
|
-
|
|
165
156
|
return /*#__PURE__*/_react.default.createElement(CssTextField, _extends({
|
|
166
157
|
id: id,
|
|
167
158
|
className: className,
|
|
@@ -176,25 +167,22 @@ var InputText = function InputText(_ref2) {
|
|
|
176
167
|
error: error,
|
|
177
168
|
helperText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, helperText && !error && helperText, error ? /*#__PURE__*/_react.default.createElement("div", {
|
|
178
169
|
className: "cbx-inputText-items-center"
|
|
179
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
180
|
-
className:
|
|
181
|
-
|
|
182
|
-
}), " ", /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
171
|
+
className: 'cbx-inputText-infoBtn ri-information-line'
|
|
172
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
183
173
|
variant: "XS",
|
|
184
|
-
color:
|
|
174
|
+
color: 'var(--error600)'
|
|
185
175
|
}, error)) : helper && /*#__PURE__*/_react.default.createElement("div", {
|
|
186
176
|
className: "cbx-inputText-items-center"
|
|
187
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
188
|
-
className:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
color: !disabled ? theme.colors.neutral500 : theme.colors.neutral400,
|
|
177
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
178
|
+
className: 'cbx-inputText-infoBtn ri-information-line'
|
|
179
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
180
|
+
color: !disabled ? 'var(--neutral500)' : 'var(--neutral400)',
|
|
192
181
|
variant: "XS"
|
|
193
182
|
}, helper))),
|
|
194
183
|
InputProps: {
|
|
195
|
-
endAdornment: success && /*#__PURE__*/_react.default.createElement(
|
|
196
|
-
|
|
197
|
-
className: "cbx-inputText-endAdornment"
|
|
184
|
+
endAdornment: success && /*#__PURE__*/_react.default.createElement("i", {
|
|
185
|
+
className: "cbx-inputText-endAdornment ri-check-line"
|
|
198
186
|
})
|
|
199
187
|
}
|
|
200
188
|
}, props));
|