@councilbox/councilbox-ui 0.0.7 → 0.0.10

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,7 +15,11 @@ require("../../styles/main.css");
15
15
 
16
16
  require("./button.css");
17
17
 
18
- var _excluded = ["id", "text", "onClick", "disabled", "loading", "variant", "fullWidth", "icon"];
18
+ var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
19
+
20
+ var _Typography = _interopRequireDefault(require("../Typography/Typography"));
21
+
22
+ var _excluded = ["id", "text", "onClick", "disabled", "loading", "variant", "fullWidth", "icon", "variantText"];
19
23
 
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
25
 
@@ -40,6 +44,7 @@ var Button = function Button(_ref) {
40
44
  variant = _ref.variant,
41
45
  fullWidth = _ref.fullWidth,
42
46
  icon = _ref.icon,
47
+ variantText = _ref.variantText,
43
48
  props = _objectWithoutProperties(_ref, _excluded);
44
49
 
45
50
  var buttonVariant;
@@ -79,31 +84,45 @@ var Button = function Button(_ref) {
79
84
  id: id,
80
85
  sx: {
81
86
  minWidth: !isSecondaryOrTernary(variant) ? '140px' : '100px',
82
- height: '48px',
83
- boxShadow: 'none'
87
+ minHeight: '48px',
88
+ boxShadow: 'none',
89
+ letterSpacing: '1px',
90
+ lineHeight: 'normal'
84
91
  },
85
- className: "cbx-button ".concat(buttonVariant, " ").concat(icon ? 'cbx-button-with-icon' : '', " ").concat(!isSecondaryOrTernary(variant) && "cbx-button-hoverAndAnimation".concat(fullWidth ? '-fullWidth' : '')),
92
+ 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
93
  disabled: loading || disabled,
87
94
  variant: buttonVariant,
88
95
  style: _objectSpread({
89
96
  backgroundColor: background,
90
- color: buttonColor
97
+ color: buttonColor,
98
+ lineHeight: 'normal'
91
99
  }, disabled || loading ? {
92
- opacity: '0.5'
100
+ opacity: '0.4'
93
101
  } : {}),
94
102
  disableFocusRipple: true,
95
103
  fullWidth: fullWidth,
96
104
  onClick: onClick,
97
- startIcon: icon
98
- }, props), /*#__PURE__*/_react.default.createElement("span", {
99
- className: "button-text"
105
+ startIcon: icon && icon === 'arrow' ? /*#__PURE__*/_react.default.createElement("i", {
106
+ className: "ri-arrow-left-s-line"
107
+ }) : icon
108
+ }, props), /*#__PURE__*/_react.default.createElement(_Typography.default, {
109
+ color: buttonColor,
110
+ variant: variantText
100
111
  }, text), buttonVariant === 'contained' && !loading && /*#__PURE__*/_react.default.createElement("span", {
101
- className: "containerArrow"
112
+ className: "cbx-button-containerArrow"
102
113
  }, /*#__PURE__*/_react.default.createElement("i", {
103
114
  className: "ri-arrow-right-s-line arrow-primary"
104
- })), loading && /*#__PURE__*/_react.default.createElement("i", {
105
- className: "ri-refresh-line"
106
- }));
115
+ })), loading && /*#__PURE__*/_react.default.createElement("span", {
116
+ className: "cbx-button-containerLoading"
117
+ }, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
118
+ sx: {
119
+ color: 'white'
120
+ },
121
+ style: {
122
+ height: 'var(--spacing24)',
123
+ width: 'var(--spacing24)'
124
+ }
125
+ })));
107
126
  };
108
127
 
109
128
  Button.displayName = "Button";
@@ -115,7 +134,8 @@ Button.propTypes = {
115
134
  loading: _propTypes.default.bool,
116
135
  variant: _propTypes.default.string,
117
136
  fullWidth: _propTypes.default.bool,
118
- icon: _propTypes.default.node
137
+ icon: _propTypes.default.node,
138
+ variantText: _propTypes.default.string
119
139
  };
120
140
  Button.defaultProps = {
121
141
  backgroundColor: null,
@@ -125,7 +145,8 @@ Button.defaultProps = {
125
145
  loading: false,
126
146
  variant: 'primary',
127
147
  fullWidth: false,
128
- icon: null
148
+ icon: null,
149
+ variantText: ''
129
150
  };
130
151
  var _default = Button;
131
152
  exports.default = _default;
@@ -19,9 +19,7 @@ var ICONS = {
19
19
  edit: /*#__PURE__*/_react.default.createElement("i", {
20
20
  className: "ri-pencil-line"
21
21
  }),
22
- arrowLeft: /*#__PURE__*/_react.default.createElement("i", {
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 1px white, 0 0 7px 4px rgba(56,57,140,0.75);
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-hoverAndAnimation .containerArrow, .cbx-button-hoverAndAnimation-fullWidth .containerArrow {
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
+ }
@@ -7,20 +7,18 @@
7
7
  margin-bottom: var(--spacing4);
8
8
 
9
9
  }
10
+
10
11
  .cbx-inputPassword-validation > div {
11
12
  height: var(--spacing8);
12
13
  border-radius: 20px;
13
14
  transition: all .5s;
14
15
  }
15
16
 
16
-
17
- .cbx-inputPassword-icon-button {
17
+ .cbx-inputPassword-icon-button, .cbx-inputPassword-icon-size {
18
+ width: var(--spacing24);
19
+ height: var(--spacing24);
20
+ border: none;
18
21
  outline: none;
19
- width: var(--spacing24);
20
- height: var(--spacing24);
21
22
 
22
23
  }
23
- .cbx-inputPassword-icon-size {
24
- width: var(--spacing24);
25
- height: var(--spacing24);
26
- }
24
+
@@ -86,10 +86,6 @@ var InputPassword = function InputPassword(_ref) {
86
86
  id: id,
87
87
  fullWidth: fullWidth,
88
88
  className: className,
89
- sx: {
90
- width: width || '240px',
91
- height: '48px'
92
- },
93
89
  label: label,
94
90
  onChange: onChange,
95
91
  disabled: disabled,
@@ -4,10 +4,15 @@
4
4
  }
5
5
  .cbx-inputText-infoBtn {
6
6
  margin-right: var(--spacing4);
7
+ height: 14px;
8
+ line-height: 1.1;
9
+ font-size: 14px;
7
10
  }
8
11
 
9
12
  .cbx-inputText-endAdornment {
10
13
  margin-right: var(--spacing4);
11
14
  margin-top: var(--spacing12);
12
15
  margin-bottom: var(--spacing12);
16
+ color: var(--success600);
17
+ font-size: 19px;
13
18
  }
@@ -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,14 +153,14 @@ 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,
158
+ style: {
159
+ height: 'auto'
160
+ },
167
161
  className: className,
168
162
  sx: {
169
- width: width || '240px',
163
+ minWidth: width || '240px',
170
164
  height: '48px'
171
165
  },
172
166
  label: label,
@@ -174,27 +168,25 @@ var InputText = function InputText(_ref2) {
174
168
  onChange: onChange,
175
169
  disabled: disabled,
176
170
  error: error,
177
- helperText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, helperText && !error && helperText, error ? /*#__PURE__*/_react.default.createElement("div", {
171
+ helperText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, helperText, error ? /*#__PURE__*/_react.default.createElement("div", {
178
172
  className: "cbx-inputText-items-center"
179
- }, /*#__PURE__*/_react.default.createElement(_info.ReactComponent, {
180
- className: "cbx-inputText-infoBtn",
181
- fill: theme.colors.error600
182
- }), " ", /*#__PURE__*/_react.default.createElement(_Typography.default, {
173
+ }, /*#__PURE__*/_react.default.createElement("i", {
174
+ className: 'cbx-inputText-infoBtn ri-information-line',
175
+ color: 'var(--error600)'
176
+ }), /*#__PURE__*/_react.default.createElement(_Typography.default, {
183
177
  variant: "XS",
184
- color: theme.colors.error600
178
+ color: 'var(--error600)'
185
179
  }, error)) : helper && /*#__PURE__*/_react.default.createElement("div", {
186
180
  className: "cbx-inputText-items-center"
187
- }, /*#__PURE__*/_react.default.createElement(_info.ReactComponent, {
188
- className: "cbx-inputText-infoBtn",
189
- fill: !disabled ? theme.colors.neutral500 : theme.colors.neutral400
190
- }), " ", /*#__PURE__*/_react.default.createElement(_Typography.default, {
191
- color: !disabled ? theme.colors.neutral500 : theme.colors.neutral400,
181
+ }, /*#__PURE__*/_react.default.createElement("i", {
182
+ className: 'cbx-inputText-infoBtn ri-information-line'
183
+ }), /*#__PURE__*/_react.default.createElement(_Typography.default, {
184
+ color: !disabled ? 'var(--neutral500)' : 'var(--neutral400)',
192
185
  variant: "XS"
193
186
  }, helper))),
194
187
  InputProps: {
195
- endAdornment: success && /*#__PURE__*/_react.default.createElement(_check.ReactComponent, {
196
- fill: '#138A00',
197
- className: "cbx-inputText-endAdornment"
188
+ endAdornment: success && /*#__PURE__*/_react.default.createElement("i", {
189
+ className: "cbx-inputText-endAdornment ri-check-line"
198
190
  })
199
191
  }
200
192
  }, props));
@@ -220,8 +212,7 @@ InputText.defaultProps = {
220
212
  className: '',
221
213
  onChange: undefined,
222
214
  disabled: false,
223
- error: '',
224
- success: false
215
+ error: ''
225
216
  };
226
217
  var _default = InputText;
227
218
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@councilbox/councilbox-ui",
3
- "version": "0.0.7",
3
+ "version": "0.0.10",
4
4
  "main": "dist/build-index.js",
5
5
  "files": [
6
6
  "dist",