@councilbox/councilbox-ui 0.1.0 → 0.1.1
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/HOCs/useWindowSize.js +8 -5
- package/dist/build-index.js +48 -0
- package/dist/components/Avatar/Avatar.js +1 -6
- package/dist/components/Button/Button.js +85 -21
- package/dist/components/Button/Button.stories.js +2 -1
- package/dist/components/Button/button.css +34 -6
- package/dist/components/ButtonBasic/ButtonBasic.css +3 -0
- package/dist/components/ButtonBasic/ButtonBasic.js +117 -0
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +72 -0
- package/dist/components/DrawerPanel/DrawerPanel.css +33 -0
- package/dist/components/DrawerPanel/DrawerPanel.js +165 -0
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +38 -0
- package/dist/components/DrawerPanel/DrawerPanelPrueba.js +52 -0
- package/dist/components/DropDown/DesignDropDown.stories.js +82 -0
- package/dist/components/DropDown/DropDown.css +0 -0
- package/dist/components/DropDown/DropDown.js +162 -0
- package/dist/components/DropDown/DropDown.stories.js +43 -0
- package/dist/components/Header/Header.js +235 -43
- package/dist/components/Header/Header.stories.js +31 -10
- package/dist/components/Header/header.css +121 -19
- package/dist/components/IconButton/IconButton.css +0 -0
- package/dist/components/IconButton/IconButton.js +72 -0
- package/dist/components/IconButton/IconButton.stories.js +27 -0
- package/dist/components/InputPassword/InputPassword.css +28 -0
- package/dist/components/InputPassword/InputPassword.js +37 -162
- package/dist/components/InputPassword/InputPassword.stories.js +33 -2
- package/dist/components/InputText/InputText.css +18 -0
- package/dist/components/InputText/InputText.js +71 -60
- package/dist/components/InputText/InputText.stories.js +26 -2
- package/dist/components/Modal/Modal.css +0 -0
- package/dist/components/Modal/Modal.js +166 -0
- package/dist/components/Modal/Modal.stories.js +49 -0
- package/dist/components/Spacing/Spacing.js +1 -1
- package/dist/components/TextInput/TextInput.css +12 -0
- package/dist/components/TextInput/TextInput.js +216 -0
- package/dist/components/TextInput/TextInput.stories.js +52 -0
- package/dist/components/ThemeProvider/Colors.js +24 -95
- package/dist/components/ThemeProvider/ThemeProvider.js +1 -1
- package/dist/components/Typography/Typography.js +7 -8
- package/dist/styles/main.css +21 -71
- package/dist/styles/stylesheet.js +6 -39
- package/package.json +1 -1
|
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
-
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
13
|
-
|
|
14
12
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
15
13
|
|
|
16
14
|
var _Visibility = _interopRequireDefault(require("@mui/icons-material/Visibility"));
|
|
@@ -19,15 +17,13 @@ var _VisibilityOff = _interopRequireDefault(require("@mui/icons-material/Visibil
|
|
|
19
17
|
|
|
20
18
|
require("../../styles/main.css");
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _info = require("../../assets/img/info.svg");
|
|
25
|
-
|
|
26
|
-
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
20
|
+
require("./InputPassword.css");
|
|
27
21
|
|
|
28
22
|
var _CouncilboxThemeContext = require("../ThemeProvider/CouncilboxThemeContext");
|
|
29
23
|
|
|
30
|
-
var
|
|
24
|
+
var _InputText = _interopRequireDefault(require("../InputText/InputText"));
|
|
25
|
+
|
|
26
|
+
var _excluded = ["id", "className", "onChange", "onClick", "label", "disabled", "error", "helper", "width", "validation", "percentageError", "helperText", "fullWidth"];
|
|
31
27
|
|
|
32
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
29
|
|
|
@@ -49,106 +45,21 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
49
45
|
|
|
50
46
|
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; }
|
|
51
47
|
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
marginLeft: '0px',
|
|
68
|
-
marginRight: '0'
|
|
69
|
-
},
|
|
70
|
-
'& .MuiInputBase-input': {
|
|
71
|
-
height: '15px'
|
|
72
|
-
},
|
|
73
|
-
'& .MuiFormLabel-root': {
|
|
74
|
-
lineHeight: '18px',
|
|
75
|
-
top: '-2px'
|
|
76
|
-
},
|
|
77
|
-
'& .Mui-error': {
|
|
78
|
-
color: theme.palette.error600
|
|
79
|
-
},
|
|
80
|
-
'& .MuiInputLabel-shrink': {
|
|
81
|
-
top: '1px'
|
|
82
|
-
},
|
|
83
|
-
'& .MuiOutlinedInput-root': {
|
|
84
|
-
'& fieldset': {
|
|
85
|
-
borderColor: theme.palette.neutral400
|
|
86
|
-
},
|
|
87
|
-
'&:hover fieldset': {
|
|
88
|
-
borderColor: theme.palette.neutral400,
|
|
89
|
-
borderWidth: '2px'
|
|
90
|
-
},
|
|
91
|
-
'&:active fieldset': {
|
|
92
|
-
borderColor: theme.palette.primary700,
|
|
93
|
-
borderWidth: '2px'
|
|
94
|
-
},
|
|
95
|
-
'&.Mui-focused fieldset': {
|
|
96
|
-
borderColor: theme.palette.primary700,
|
|
97
|
-
borderWidth: '2px',
|
|
98
|
-
boxShadow: "0 0 0 3px white, 0 0 7px 4px ".concat(theme.palette.primary.main)
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
'& .MuiOutlinedInput-root.Mui-error': {
|
|
102
|
-
'& fieldset': {
|
|
103
|
-
borderColor: theme.palette.error600
|
|
104
|
-
},
|
|
105
|
-
'&:hover fieldset': {
|
|
106
|
-
borderColor: theme.palette.error600,
|
|
107
|
-
borderWidth: '2px'
|
|
108
|
-
},
|
|
109
|
-
'&:active fieldset': {
|
|
110
|
-
borderColor: theme.palette.error600,
|
|
111
|
-
borderWidth: '2px'
|
|
112
|
-
},
|
|
113
|
-
'&.Mui-focused fieldset': {
|
|
114
|
-
borderColor: theme.palette.error600,
|
|
115
|
-
borderWidth: '2px',
|
|
116
|
-
boxShadow: "0 0 0 3px white, 0 0 7px 4px ".concat(theme.palette.error600)
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
'& .MuiOutlinedInput-root.Mui-disabled': {
|
|
120
|
-
'& fieldset': {
|
|
121
|
-
borderColor: 'rgba(0,0,0,0.38)'
|
|
122
|
-
},
|
|
123
|
-
'&:hover fieldset': {
|
|
124
|
-
borderColor: 'rgba(0,0,0,0.38)',
|
|
125
|
-
borderWidth: '1px'
|
|
126
|
-
},
|
|
127
|
-
'&:active fieldset': {
|
|
128
|
-
borderColor: 'rgba(0,0,0,0.38)',
|
|
129
|
-
borderWidth: '1px'
|
|
130
|
-
},
|
|
131
|
-
'&.Mui-focused fieldset': {
|
|
132
|
-
borderColor: 'rgba(0,0,0,0.38)',
|
|
133
|
-
borderWidth: '1px',
|
|
134
|
-
boxShadow: '0 0 0 3px white, 0 0 7px 4px rgba(0,0,0,0.38)'
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
var InputText = function InputText(_ref2) {
|
|
141
|
-
var id = _ref2.id,
|
|
142
|
-
className = _ref2.className,
|
|
143
|
-
onChange = _ref2.onChange,
|
|
144
|
-
label = _ref2.label,
|
|
145
|
-
disabled = _ref2.disabled,
|
|
146
|
-
error = _ref2.error,
|
|
147
|
-
helper = _ref2.helper,
|
|
148
|
-
width = _ref2.width,
|
|
149
|
-
validation = _ref2.validation,
|
|
150
|
-
percentageError = _ref2.percentageError,
|
|
151
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
48
|
+
var InputPassword = function InputPassword(_ref) {
|
|
49
|
+
var id = _ref.id,
|
|
50
|
+
className = _ref.className,
|
|
51
|
+
onChange = _ref.onChange,
|
|
52
|
+
onClick = _ref.onClick,
|
|
53
|
+
label = _ref.label,
|
|
54
|
+
disabled = _ref.disabled,
|
|
55
|
+
error = _ref.error,
|
|
56
|
+
helper = _ref.helper,
|
|
57
|
+
width = _ref.width,
|
|
58
|
+
validation = _ref.validation,
|
|
59
|
+
percentageError = _ref.percentageError,
|
|
60
|
+
helperText = _ref.helperText,
|
|
61
|
+
fullWidth = _ref.fullWidth,
|
|
62
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
152
63
|
|
|
153
64
|
var _React$useState = _react.default.useState(false),
|
|
154
65
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -158,98 +69,62 @@ var InputText = function InputText(_ref2) {
|
|
|
158
69
|
var themeData = (0, _CouncilboxThemeContext.useCouncilboxTheme)();
|
|
159
70
|
|
|
160
71
|
var getColorPercent = function getColorPercent(percent) {
|
|
161
|
-
var color = themeData.theme.colors.
|
|
72
|
+
var color = themeData.theme.colors.error;
|
|
162
73
|
|
|
163
74
|
if (percent > 30 && percent < 90) {
|
|
164
75
|
color = themeData.theme.colors.warnig600;
|
|
165
76
|
}
|
|
166
77
|
|
|
167
78
|
if (percent >= 90) {
|
|
168
|
-
color = themeData.theme.colors.
|
|
79
|
+
color = themeData.theme.colors.success;
|
|
169
80
|
}
|
|
170
81
|
|
|
171
82
|
return color;
|
|
172
83
|
};
|
|
173
84
|
|
|
174
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
85
|
+
return /*#__PURE__*/_react.default.createElement(_InputText.default, _extends({
|
|
175
86
|
id: id,
|
|
87
|
+
fullWidth: fullWidth,
|
|
176
88
|
className: className,
|
|
177
|
-
sx: {
|
|
178
|
-
width: width || '240px',
|
|
179
|
-
height: '48px'
|
|
180
|
-
},
|
|
181
89
|
label: label,
|
|
182
90
|
onChange: onChange,
|
|
183
91
|
disabled: disabled,
|
|
184
92
|
error: error,
|
|
93
|
+
helper: helper,
|
|
185
94
|
type: showPassword ? 'text' : 'password',
|
|
186
|
-
helperText:
|
|
187
|
-
|
|
188
|
-
display: 'flex',
|
|
189
|
-
alignItems: 'center'
|
|
190
|
-
}
|
|
191
|
-
}, /*#__PURE__*/_react.default.createElement(_info.ReactComponent, {
|
|
192
|
-
style: {
|
|
193
|
-
marginRight: 'var(--spacing4)'
|
|
194
|
-
},
|
|
195
|
-
fill: themeData.theme.colors.error600
|
|
196
|
-
}), " ", /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
197
|
-
variant: "S",
|
|
198
|
-
color: themeData.theme.colors.error600
|
|
199
|
-
}, error)) : /*#__PURE__*/_react.default.createElement("div", null, validation && /*#__PURE__*/_react.default.createElement("div", {
|
|
200
|
-
style: {
|
|
201
|
-
width: '100%',
|
|
202
|
-
background: '#DBDBDB',
|
|
203
|
-
height: '8px',
|
|
204
|
-
borderRadius: '20px',
|
|
205
|
-
marginTop: 'var(--spacing4)'
|
|
206
|
-
}
|
|
95
|
+
helperText: validation && /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
className: "cbx-inputPassword-validation"
|
|
207
97
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
208
98
|
style: {
|
|
209
99
|
width: "".concat(percentageError, "%"),
|
|
210
|
-
background: getColorPercent(percentageError)
|
|
211
|
-
height: '8px',
|
|
212
|
-
borderRadius: '20px',
|
|
213
|
-
transition: 'all .5s'
|
|
214
|
-
}
|
|
215
|
-
})), helper && /*#__PURE__*/_react.default.createElement("div", {
|
|
216
|
-
style: {
|
|
217
|
-
display: 'flex',
|
|
218
|
-
alignItems: 'center'
|
|
100
|
+
background: getColorPercent(percentageError)
|
|
219
101
|
}
|
|
220
|
-
},
|
|
221
|
-
style: {
|
|
222
|
-
marginRight: 'var(--spacing4)'
|
|
223
|
-
},
|
|
224
|
-
fill: themeData.theme.colors.neutral500
|
|
225
|
-
}), " ", /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
226
|
-
variant: "S"
|
|
227
|
-
}, helper))),
|
|
102
|
+
})),
|
|
228
103
|
InputProps: {
|
|
229
104
|
endAdornment: /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
230
105
|
disabled: disabled,
|
|
231
106
|
"aria-label": "Toggle password visibility",
|
|
232
|
-
|
|
233
|
-
outline: 0
|
|
234
|
-
},
|
|
107
|
+
className: "cbx-inputPassword-icon-button",
|
|
235
108
|
onClick: function onClick() {
|
|
236
109
|
return !disabled && setShowPassword(!showPassword);
|
|
237
110
|
}
|
|
238
111
|
}, showPassword ? /*#__PURE__*/_react.default.createElement(_VisibilityOff.default, {
|
|
112
|
+
className: "cbx-inputPassword-icon-size",
|
|
239
113
|
sx: {
|
|
240
|
-
color: disabled ? '
|
|
114
|
+
color: disabled ? 'var(--gray3)' : 'black'
|
|
241
115
|
}
|
|
242
116
|
}) : /*#__PURE__*/_react.default.createElement(_Visibility.default, {
|
|
117
|
+
className: "cbx-inputPassword-icon-size",
|
|
243
118
|
sx: {
|
|
244
|
-
color: disabled ? '
|
|
119
|
+
color: disabled ? 'var(--gray3)' : 'black'
|
|
245
120
|
}
|
|
246
121
|
}))
|
|
247
122
|
}
|
|
248
123
|
}, props));
|
|
249
124
|
};
|
|
250
125
|
|
|
251
|
-
|
|
252
|
-
|
|
126
|
+
InputPassword.displayName = "InputPassword";
|
|
127
|
+
InputPassword.propTypes = {
|
|
253
128
|
label: _propTypes.default.string,
|
|
254
129
|
helper: _propTypes.default.string,
|
|
255
130
|
width: _propTypes.default.string,
|
|
@@ -261,7 +136,7 @@ InputText.propTypes = {
|
|
|
261
136
|
validation: _propTypes.default.bool,
|
|
262
137
|
percentageError: _propTypes.default.number
|
|
263
138
|
};
|
|
264
|
-
|
|
139
|
+
InputPassword.defaultProps = {
|
|
265
140
|
label: 'Caption',
|
|
266
141
|
helper: '',
|
|
267
142
|
width: '',
|
|
@@ -273,5 +148,5 @@ InputText.defaultProps = {
|
|
|
273
148
|
validation: false,
|
|
274
149
|
percentageError: 0
|
|
275
150
|
};
|
|
276
|
-
var _default =
|
|
151
|
+
var _default = InputPassword;
|
|
277
152
|
exports.default = _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Default = void 0;
|
|
6
|
+
exports.default = exports.Validation = exports.Helper = exports.Error = exports.Disabled = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -25,4 +25,35 @@ var Template = function Template(args) {
|
|
|
25
25
|
Template.displayName = "Template";
|
|
26
26
|
var Default = Template.bind({});
|
|
27
27
|
exports.Default = Default;
|
|
28
|
-
Default.args = {
|
|
28
|
+
Default.args = {
|
|
29
|
+
label: 'password',
|
|
30
|
+
value: 'abc123.'
|
|
31
|
+
};
|
|
32
|
+
var Helper = Template.bind({});
|
|
33
|
+
exports.Helper = Helper;
|
|
34
|
+
Helper.args = {
|
|
35
|
+
label: 'password',
|
|
36
|
+
value: 'abc123.',
|
|
37
|
+
helper: 'Enim anim occaecat'
|
|
38
|
+
};
|
|
39
|
+
var Validation = Template.bind({});
|
|
40
|
+
exports.Validation = Validation;
|
|
41
|
+
Validation.args = {
|
|
42
|
+
label: 'password',
|
|
43
|
+
value: 'abc123.',
|
|
44
|
+
validation: true,
|
|
45
|
+
percentageError: 54
|
|
46
|
+
};
|
|
47
|
+
var Error = Template.bind({});
|
|
48
|
+
exports.Error = Error;
|
|
49
|
+
Error.args = {
|
|
50
|
+
label: 'password',
|
|
51
|
+
value: 'abc123.',
|
|
52
|
+
error: 'Enim anim occaecat'
|
|
53
|
+
};
|
|
54
|
+
var Disabled = Template.bind({});
|
|
55
|
+
exports.Disabled = Disabled;
|
|
56
|
+
Disabled.args = {
|
|
57
|
+
value: 'Occaecat',
|
|
58
|
+
disabled: true
|
|
59
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.cbx-inputText-items-center {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
}
|
|
5
|
+
.cbx-inputText-infoBtn {
|
|
6
|
+
margin-right: var(--spacing4);
|
|
7
|
+
height: 14px;
|
|
8
|
+
line-height: 1.1;
|
|
9
|
+
font-size: 14px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.cbx-inputText-endAdornment {
|
|
13
|
+
margin-right: var(--spacing4);
|
|
14
|
+
margin-top: var(--spacing12);
|
|
15
|
+
margin-bottom: var(--spacing12);
|
|
16
|
+
color: var(--success);
|
|
17
|
+
font-size: 19px;
|
|
18
|
+
}
|
|
@@ -13,17 +13,13 @@ var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
|
13
13
|
|
|
14
14
|
require("../../styles/main.css");
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _info = require("../../assets/img/info.svg");
|
|
16
|
+
require("./InputText.css");
|
|
19
17
|
|
|
20
|
-
var
|
|
18
|
+
var _styled = _interopRequireDefault(require("@mui/material/styles/styled"));
|
|
21
19
|
|
|
22
20
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
23
21
|
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
var _excluded = ["id", "className", "onChange", "label", "disabled", "error", "helper", "endAdornment", "width"];
|
|
22
|
+
var _excluded = ["id", "className", "onChange", "label", "disabled", "error", "helper", "success", "width", "helperText", "fullWidth"];
|
|
27
23
|
|
|
28
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
25
|
|
|
@@ -48,60 +44,85 @@ var CssTextField = (0, _styled.default)(_TextField.default)(function (_ref) {
|
|
|
48
44
|
},
|
|
49
45
|
'& .MuiFormHelperText-root': {
|
|
50
46
|
marginTop: 'var(--spacing4)',
|
|
51
|
-
marginLeft: '0px'
|
|
47
|
+
marginLeft: '0px',
|
|
48
|
+
marginRight: '0px'
|
|
52
49
|
},
|
|
53
50
|
'& .MuiInputBase-input': {
|
|
54
|
-
height: '
|
|
51
|
+
height: '24px',
|
|
52
|
+
lineHeight: 'var(--spacing12)',
|
|
53
|
+
padding: 'var(--spacing12)',
|
|
54
|
+
paddingRight: 'var(--spacing8)'
|
|
55
55
|
},
|
|
56
56
|
'& .MuiFormLabel-root': {
|
|
57
|
-
|
|
58
|
-
top: '-2px'
|
|
57
|
+
top: '-4px'
|
|
59
58
|
},
|
|
60
59
|
'& .Mui-error': {
|
|
61
|
-
color: theme.palette.
|
|
60
|
+
color: theme.palette.error
|
|
62
61
|
},
|
|
63
62
|
'& .MuiInputLabel-shrink': {
|
|
64
63
|
top: '1px'
|
|
65
64
|
},
|
|
66
65
|
'& .MuiOutlinedInput-root': {
|
|
66
|
+
color: theme.palette.gray5,
|
|
67
|
+
paddingRight: 'var(--spacing8)',
|
|
67
68
|
'& fieldset': {
|
|
68
|
-
borderColor: theme.palette.
|
|
69
|
+
borderColor: theme.palette.gray3,
|
|
70
|
+
borderWidth: '1px',
|
|
71
|
+
'& legend': {
|
|
72
|
+
'& span': {
|
|
73
|
+
paddingLeft: 'var(--spacing4)',
|
|
74
|
+
paddingRight: 'var(--spacing4)'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
69
77
|
},
|
|
70
78
|
'&:hover fieldset': {
|
|
71
|
-
borderColor: theme.palette.
|
|
79
|
+
borderColor: theme.palette.gray3,
|
|
72
80
|
borderWidth: '2px'
|
|
73
81
|
},
|
|
74
82
|
'&:active fieldset': {
|
|
75
|
-
borderColor: theme.palette.
|
|
83
|
+
borderColor: theme.palette.gray4,
|
|
76
84
|
borderWidth: '2px'
|
|
77
85
|
},
|
|
78
86
|
'&.Mui-focused fieldset': {
|
|
79
|
-
borderColor: theme.palette.
|
|
80
|
-
borderWidth: '2px'
|
|
81
|
-
|
|
87
|
+
borderColor: theme.palette.gray4,
|
|
88
|
+
borderWidth: '2px'
|
|
89
|
+
},
|
|
90
|
+
'&:focus-visible': {
|
|
91
|
+
outline: 'none',
|
|
92
|
+
'& fieldset': {
|
|
93
|
+
outline: 'none',
|
|
94
|
+
boxShadow: "0 0 0 3px white, 0 0 7px 4px ".concat(theme.palette.primary.main),
|
|
95
|
+
border: "2px solid ".concat(theme.palette.gray4)
|
|
96
|
+
}
|
|
82
97
|
}
|
|
83
98
|
},
|
|
84
99
|
'& .MuiOutlinedInput-root.Mui-error': {
|
|
85
100
|
'& fieldset': {
|
|
86
|
-
borderColor: theme.palette.
|
|
101
|
+
borderColor: theme.palette.error
|
|
87
102
|
},
|
|
88
103
|
'&:hover fieldset': {
|
|
89
|
-
borderColor: theme.palette.
|
|
104
|
+
borderColor: theme.palette.error,
|
|
90
105
|
borderWidth: '2px'
|
|
91
106
|
},
|
|
92
107
|
'&:active fieldset': {
|
|
93
|
-
borderColor: theme.palette.
|
|
108
|
+
borderColor: theme.palette.error,
|
|
94
109
|
borderWidth: '2px'
|
|
95
110
|
},
|
|
96
111
|
'&.Mui-focused fieldset': {
|
|
97
|
-
borderColor: theme.palette.
|
|
112
|
+
borderColor: theme.palette.error,
|
|
113
|
+
borderWidth: '2px'
|
|
114
|
+
},
|
|
115
|
+
'&:focus-visible': {
|
|
116
|
+
// falta revisar esto
|
|
117
|
+
borderColor: theme.palette.gray4,
|
|
98
118
|
borderWidth: '2px',
|
|
99
|
-
boxShadow: "0 0 0 3px white, 0 0 7px 4px ".concat(theme.palette.
|
|
119
|
+
boxShadow: "0 0 0 3px white, 0 0 7px 4px ".concat(theme.palette.primary.main)
|
|
100
120
|
}
|
|
101
121
|
},
|
|
102
122
|
'& .MuiOutlinedInput-root.Mui-disabled': {
|
|
103
123
|
'& fieldset': {
|
|
104
|
-
borderColor: 'rgba(0,0,0,0.38)'
|
|
124
|
+
borderColor: 'rgba(0,0,0,0.38)',
|
|
125
|
+
borderWidth: '1px'
|
|
105
126
|
},
|
|
106
127
|
'&:hover fieldset': {
|
|
107
128
|
borderColor: 'rgba(0,0,0,0.38)',
|
|
@@ -113,8 +134,7 @@ var CssTextField = (0, _styled.default)(_TextField.default)(function (_ref) {
|
|
|
113
134
|
},
|
|
114
135
|
'&.Mui-focused fieldset': {
|
|
115
136
|
borderColor: 'rgba(0,0,0,0.38)',
|
|
116
|
-
borderWidth: '1px'
|
|
117
|
-
boxShadow: '0 0 0 3px white, 0 0 7px 4px rgba(0,0,0,0.38)'
|
|
137
|
+
borderWidth: '1px'
|
|
118
138
|
}
|
|
119
139
|
}
|
|
120
140
|
};
|
|
@@ -128,52 +148,44 @@ var InputText = function InputText(_ref2) {
|
|
|
128
148
|
disabled = _ref2.disabled,
|
|
129
149
|
error = _ref2.error,
|
|
130
150
|
helper = _ref2.helper,
|
|
131
|
-
|
|
151
|
+
success = _ref2.success,
|
|
132
152
|
width = _ref2.width,
|
|
153
|
+
helperText = _ref2.helperText,
|
|
154
|
+
fullWidth = _ref2.fullWidth,
|
|
133
155
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
134
156
|
|
|
135
|
-
var themeData = (0, _CouncilboxThemeContext.useCouncilboxTheme)();
|
|
136
157
|
return /*#__PURE__*/_react.default.createElement(CssTextField, _extends({
|
|
137
158
|
id: id,
|
|
138
159
|
className: className,
|
|
139
160
|
sx: {
|
|
140
|
-
|
|
161
|
+
minWidth: width || '240px',
|
|
141
162
|
height: '48px'
|
|
142
163
|
},
|
|
143
164
|
label: label,
|
|
165
|
+
fullWidth: fullWidth,
|
|
144
166
|
onChange: onChange,
|
|
145
167
|
disabled: disabled,
|
|
146
168
|
error: error,
|
|
147
|
-
helperText: error ? /*#__PURE__*/_react.default.createElement("div", {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
},
|
|
156
|
-
fill: themeData.theme.colors.error600
|
|
157
|
-
}), " ", /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
158
|
-
variant: "S",
|
|
159
|
-
color: themeData.theme.colors.error600
|
|
169
|
+
helperText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, helperText, error ? /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
className: "cbx-inputText-items-center"
|
|
171
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
172
|
+
className: 'cbx-inputText-infoBtn ri-information-line',
|
|
173
|
+
color: 'var(--error)'
|
|
174
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
175
|
+
variant: "XS",
|
|
176
|
+
color: 'var(--error)'
|
|
160
177
|
}, error)) : helper && /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
fill: themeData.theme.colors.neutral500
|
|
170
|
-
}), " ", /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
171
|
-
variant: "S"
|
|
172
|
-
}, helper)),
|
|
178
|
+
className: "cbx-inputText-items-center"
|
|
179
|
+
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
180
|
+
className: 'cbx-inputText-infoBtn ri-information-line'
|
|
181
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
182
|
+
color: !disabled ? 'var(--gray4)' : 'var(--gray3)',
|
|
183
|
+
variant: "XS"
|
|
184
|
+
}, helper))),
|
|
173
185
|
InputProps: {
|
|
174
|
-
endAdornment:
|
|
175
|
-
|
|
176
|
-
})
|
|
186
|
+
endAdornment: success && /*#__PURE__*/_react.default.createElement("i", {
|
|
187
|
+
className: "cbx-inputText-endAdornment ri-check-line"
|
|
188
|
+
})
|
|
177
189
|
}
|
|
178
190
|
}, props));
|
|
179
191
|
};
|
|
@@ -188,7 +200,7 @@ InputText.propTypes = {
|
|
|
188
200
|
onChange: _propTypes.default.func,
|
|
189
201
|
disabled: _propTypes.default.bool,
|
|
190
202
|
error: _propTypes.default.string,
|
|
191
|
-
|
|
203
|
+
success: _propTypes.default.bool
|
|
192
204
|
};
|
|
193
205
|
InputText.defaultProps = {
|
|
194
206
|
label: 'Caption',
|
|
@@ -198,8 +210,7 @@ InputText.defaultProps = {
|
|
|
198
210
|
className: '',
|
|
199
211
|
onChange: undefined,
|
|
200
212
|
disabled: false,
|
|
201
|
-
error: ''
|
|
202
|
-
endAdornment: ''
|
|
213
|
+
error: ''
|
|
203
214
|
};
|
|
204
215
|
var _default = InputText;
|
|
205
216
|
exports.default = _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Default = void 0;
|
|
6
|
+
exports.default = exports.Success = exports.Helper = exports.Error = exports.Disabled = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -25,4 +25,28 @@ var Template = function Template(args) {
|
|
|
25
25
|
Template.displayName = "Template";
|
|
26
26
|
var Default = Template.bind({});
|
|
27
27
|
exports.Default = Default;
|
|
28
|
-
Default.args = {};
|
|
28
|
+
Default.args = {};
|
|
29
|
+
var Helper = Template.bind({});
|
|
30
|
+
exports.Helper = Helper;
|
|
31
|
+
Helper.args = {
|
|
32
|
+
value: 'Occaecat',
|
|
33
|
+
helper: 'Helper'
|
|
34
|
+
};
|
|
35
|
+
var Success = Template.bind({});
|
|
36
|
+
exports.Success = Success;
|
|
37
|
+
Success.args = {
|
|
38
|
+
value: 'Occaecat',
|
|
39
|
+
success: true
|
|
40
|
+
};
|
|
41
|
+
var Disabled = Template.bind({});
|
|
42
|
+
exports.Disabled = Disabled;
|
|
43
|
+
Disabled.args = {
|
|
44
|
+
value: 'Occaecat',
|
|
45
|
+
disabled: true
|
|
46
|
+
};
|
|
47
|
+
var Error = Template.bind({});
|
|
48
|
+
exports.Error = Error;
|
|
49
|
+
Error.args = {
|
|
50
|
+
value: 'Occaecat',
|
|
51
|
+
error: 'Error'
|
|
52
|
+
};
|
|
File without changes
|