@occmundial/occ-atomic 2.0.0-beta.9 → 3.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +178 -0
- package/build/Autocomplete/Autocomplete.js +2 -5
- package/build/Autocomplete/Autocomplete.test.js +17 -9
- package/build/Autocomplete/styles.js +5 -5
- package/build/Button/Button.js +28 -7
- package/build/Button/__snapshots__/Button.test.js.snap +4 -4
- package/build/Button/styles.js +4 -4
- package/build/Droplist/Droplist.js +37 -49
- package/build/Droplist/Droplist.test.js +2 -2
- package/build/Droplist/__snapshots__/Droplist.test.js.snap +57 -25
- package/build/Droplist/styles.js +62 -32
- package/build/Fab/Fab.js +81 -0
- package/build/Fab/Fab.test.js +64 -0
- package/build/Fab/__snapshots__/Fab.test.js.snap +17 -0
- package/build/Fab/index.js +18 -0
- package/build/Fab/styles.js +45 -0
- package/build/Pager/Pager.js +15 -7
- package/build/Pager/Pager.test.js +11 -11
- package/build/Pager/__snapshots__/Pager.test.js.snap +12 -9
- package/build/Pager/styles.js +12 -9
- package/build/Radio/Radio.js +8 -1
- package/build/Radio/__snapshots__/Radio.test.js.snap +80 -25
- package/build/Radio/styles.js +84 -25
- package/build/Text/styles.js +2 -1
- package/build/TextField/TextField.js +77 -104
- package/build/TextField/TextField.test.js +7 -15
- package/build/TextField/__snapshots__/TextField.test.js.snap +59 -145
- package/build/TextField/styles.js +81 -149
- package/build/Tip/Tip.js +4 -4
- package/build/Toaster/Toast/Toast.js +4 -4
- package/build/index.js +4 -1
- package/build/plugin/babel.js +1 -1
- package/build/subatomic/icons/occDart.js +2 -2
- package/build/subatomic/icons/occHorizontal.js +2 -2
- package/build/subatomic/icons/occLogo.js +2 -2
- package/build/subatomic/icons/occVertical.js +2 -2
- package/build/subatomic/mappedIcons.js +2 -3
- package/build/tokens/colors.json +38 -11
- package/catalog-info.yaml +13 -0
- package/package.json +1 -1
package/build/Radio/Radio.js
CHANGED
@@ -94,6 +94,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
94
94
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
95
95
|
id: option.trk,
|
96
96
|
key: option.value,
|
97
|
+
tabIndex: -1,
|
97
98
|
"data-testid": option.testId
|
98
99
|
}, option.testId && {
|
99
100
|
'data-value': selected == option.value ? 1 : 0
|
@@ -111,7 +112,7 @@ var Radio = /*#__PURE__*/function (_React$Component) {
|
|
111
112
|
className: "".concat(classes.label).concat(textOverflow ? " ".concat(classes.overflow) : '')
|
112
113
|
}, option.label), option.right && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
113
114
|
tag: "label",
|
114
|
-
|
115
|
+
corpSecondary: true,
|
115
116
|
className: classes.right
|
116
117
|
}, option.right));
|
117
118
|
}));
|
@@ -147,8 +148,14 @@ Radio.propTypes = {
|
|
147
148
|
|
148
149
|
/** Use this prop to overflow the text of the label, adding '...' and the end. */
|
149
150
|
textOverflow: _propTypes["default"].bool,
|
151
|
+
|
152
|
+
/** Id of the component */
|
150
153
|
id: _propTypes["default"].string,
|
154
|
+
|
155
|
+
/** Adds class(es) to each option container */
|
151
156
|
className: _propTypes["default"].string,
|
157
|
+
|
158
|
+
/** Adds style(s) to each option container */
|
152
159
|
style: _propTypes["default"].object
|
153
160
|
};
|
154
161
|
var _default = Radio;
|
@@ -5,39 +5,92 @@ exports[`Radio matches the snapshot 1`] = `ShallowWrapper {}`;
|
|
5
5
|
exports[`Radio styles matches the snapshot 1`] = `
|
6
6
|
Object {
|
7
7
|
"active": Object {
|
8
|
-
"& $radio
|
9
|
-
"
|
10
|
-
"#
|
11
|
-
|
12
|
-
|
8
|
+
"& $radio": Object {
|
9
|
+
"&:after": Object {
|
10
|
+
"background": "#0059CD",
|
11
|
+
},
|
12
|
+
"&:before": Object {
|
13
|
+
"borderColor": "#0059CD",
|
14
|
+
"borderWidth": 2,
|
15
|
+
},
|
13
16
|
},
|
14
17
|
},
|
15
18
|
"cont": Object {
|
16
|
-
"
|
17
|
-
"
|
18
|
-
|
19
|
-
|
19
|
+
"&$active": Object {
|
20
|
+
"&:active": Object {
|
21
|
+
"& $radio:after": Object {
|
22
|
+
"background": "#0047A5",
|
23
|
+
},
|
24
|
+
"& $radio:before": Object {
|
25
|
+
"borderColor": "#0047A5",
|
26
|
+
"borderWidth": "3px",
|
27
|
+
"boxShadow": "initial",
|
28
|
+
},
|
29
|
+
},
|
30
|
+
"&:focus $radio:before": Object {
|
31
|
+
"borderColor": "#0059CD",
|
32
|
+
"boxShadow": undefined,
|
33
|
+
},
|
34
|
+
"&:hover": Object {
|
35
|
+
"& $radio:after": Object {
|
36
|
+
"background": "#0047A5",
|
37
|
+
},
|
38
|
+
"& $radio:before": Object {
|
39
|
+
"borderColor": "#0047A5",
|
40
|
+
"boxShadow": "initial",
|
41
|
+
},
|
42
|
+
},
|
20
43
|
},
|
21
|
-
"&:
|
22
|
-
"
|
44
|
+
"&:not($active)": Object {
|
45
|
+
"&:active $radio:before": Object {
|
46
|
+
"borderColor": "#6C6F89",
|
47
|
+
"borderWidth": "2px",
|
48
|
+
"boxShadow": "initial",
|
49
|
+
},
|
50
|
+
"&:focus $radio:before": Object {
|
51
|
+
"borderColor": "#D3D4DC",
|
52
|
+
"boxShadow": undefined,
|
53
|
+
},
|
54
|
+
"&:hover $radio:before": Object {
|
55
|
+
"borderColor": "#6C6F89",
|
56
|
+
"boxShadow": "initial",
|
57
|
+
},
|
23
58
|
},
|
24
59
|
"alignItems": "start",
|
25
60
|
"boxSizing": "border-box",
|
26
61
|
"cursor": "pointer",
|
27
62
|
"display": "flex",
|
28
63
|
"outline": "0",
|
29
|
-
"paddingBottom":
|
30
|
-
"paddingTop":
|
64
|
+
"paddingBottom": "8px",
|
65
|
+
"paddingTop": "8px",
|
31
66
|
},
|
32
67
|
"disabled": Object {
|
33
|
-
"
|
68
|
+
"& :not($radio)": Object {
|
69
|
+
"opacity": 0.4,
|
70
|
+
},
|
71
|
+
"&$active": Object {
|
72
|
+
"& $radio:after": Object {
|
73
|
+
"background": "#8DA5DA",
|
74
|
+
},
|
75
|
+
"& $radio:before": Object {
|
76
|
+
"borderColor": "#8DA5DA",
|
77
|
+
},
|
78
|
+
},
|
79
|
+
"&:not($active)": Object {
|
80
|
+
"& $radio:after": Object {
|
81
|
+
"background": "#EDEDF1",
|
82
|
+
},
|
83
|
+
"& $radio:before": Object {
|
84
|
+
"background": "#EDEDF1",
|
85
|
+
},
|
86
|
+
},
|
34
87
|
"pointerEvents": "none",
|
35
88
|
},
|
36
89
|
"label": Object {
|
37
90
|
"cursor": "pointer",
|
38
91
|
"flex": "1",
|
39
92
|
"float": "left",
|
40
|
-
"marginLeft":
|
93
|
+
"marginLeft": "8px",
|
41
94
|
},
|
42
95
|
"overflow": Object {
|
43
96
|
"overflow": "hidden",
|
@@ -46,36 +99,38 @@ Object {
|
|
46
99
|
},
|
47
100
|
"radio": Object {
|
48
101
|
"&:after": Object {
|
49
|
-
"background": "
|
102
|
+
"background": "#fff",
|
50
103
|
"borderRadius": "50%",
|
104
|
+
"boxSizing": "border-box",
|
51
105
|
"content": "\\"\\"",
|
52
|
-
"height":
|
106
|
+
"height": 10,
|
53
107
|
"left": "50%",
|
54
108
|
"position": "absolute",
|
55
109
|
"top": "50%",
|
56
110
|
"transform": "translate(-50%, -50%)",
|
57
111
|
"transition": "0.3s all",
|
58
|
-
"width":
|
112
|
+
"width": 10,
|
59
113
|
},
|
60
114
|
"&:before": Object {
|
61
|
-
"background": "#
|
62
|
-
"border": "1px solid #
|
115
|
+
"background": "#fff",
|
116
|
+
"border": "1px solid #D3D4DC",
|
63
117
|
"borderRadius": "50%",
|
118
|
+
"boxSizing": "border-box",
|
64
119
|
"content": "\\"\\"",
|
65
|
-
"height":
|
120
|
+
"height": 20,
|
66
121
|
"left": "50%",
|
67
122
|
"position": "absolute",
|
68
123
|
"top": "50%",
|
69
124
|
"transform": "translate(-50%, -50%)",
|
70
|
-
"width":
|
125
|
+
"width": 20,
|
71
126
|
},
|
72
|
-
"height":
|
127
|
+
"height": "24px",
|
73
128
|
"position": "relative",
|
74
|
-
"width":
|
129
|
+
"width": "24px",
|
75
130
|
},
|
76
131
|
"right": Object {
|
77
132
|
"float": "right",
|
78
|
-
"marginLeft":
|
133
|
+
"marginLeft": "8px",
|
79
134
|
},
|
80
135
|
}
|
81
136
|
`;
|
package/build/Radio/styles.js
CHANGED
@@ -5,76 +5,135 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
11
11
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
13
|
|
14
|
+
var radio = _colors["default"].radio;
|
14
15
|
var _default = {
|
15
16
|
cont: {
|
16
|
-
paddingTop: _spacing["default"]
|
17
|
-
paddingBottom: _spacing["default"]
|
17
|
+
paddingTop: _spacing["default"]['size-2'],
|
18
|
+
paddingBottom: _spacing["default"]['size-2'],
|
18
19
|
boxSizing: 'border-box',
|
19
20
|
display: 'flex',
|
20
21
|
alignItems: 'start',
|
21
22
|
cursor: 'pointer',
|
22
23
|
outline: '0',
|
23
|
-
'
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
'&$active': {
|
25
|
+
'&:focus $radio:before': {
|
26
|
+
borderColor: radio['selected']['border']['default'],
|
27
|
+
boxShadow: _colors["default"]['focus-bright-blue']
|
28
|
+
},
|
29
|
+
'&:hover': {
|
30
|
+
'& $radio:before': {
|
31
|
+
borderColor: radio['selected']['border']['hover'],
|
32
|
+
boxShadow: 'initial'
|
33
|
+
},
|
34
|
+
'& $radio:after': {
|
35
|
+
background: radio['selected']['bg']['hover']
|
36
|
+
}
|
37
|
+
},
|
38
|
+
'&:active': {
|
39
|
+
'& $radio:before': {
|
40
|
+
borderColor: radio['selected']['border']['hover'],
|
41
|
+
borderWidth: '3px',
|
42
|
+
boxShadow: 'initial'
|
43
|
+
},
|
44
|
+
'& $radio:after': {
|
45
|
+
background: radio['selected']['bg']['hover']
|
46
|
+
}
|
47
|
+
}
|
27
48
|
},
|
28
|
-
'&:
|
29
|
-
|
49
|
+
'&:not($active)': {
|
50
|
+
'&:focus $radio:before': {
|
51
|
+
borderColor: radio['unselected']['border']['default'],
|
52
|
+
boxShadow: _colors["default"]['focus-bright-blue']
|
53
|
+
},
|
54
|
+
'&:hover $radio:before': {
|
55
|
+
borderColor: radio['unselected']['border']['hover'],
|
56
|
+
boxShadow: 'initial'
|
57
|
+
},
|
58
|
+
'&:active $radio:before': {
|
59
|
+
borderColor: radio['unselected']['border']['hover'],
|
60
|
+
borderWidth: '2px',
|
61
|
+
boxShadow: 'initial'
|
62
|
+
}
|
30
63
|
}
|
31
64
|
},
|
32
65
|
radio: {
|
33
|
-
width: _spacing["default"]
|
34
|
-
height: _spacing["default"]
|
66
|
+
width: _spacing["default"]['size-5'],
|
67
|
+
height: _spacing["default"]['size-5'],
|
35
68
|
position: 'relative',
|
36
69
|
'&:before': {
|
37
70
|
content: '""',
|
38
|
-
|
39
|
-
|
71
|
+
boxSizing: 'border-box',
|
72
|
+
width: 20,
|
73
|
+
height: 20,
|
40
74
|
borderRadius: '50%',
|
41
75
|
position: 'absolute',
|
42
76
|
top: '50%',
|
43
77
|
left: '50%',
|
44
78
|
transform: 'translate(-50%, -50%)',
|
45
|
-
border: "1px solid ".concat(
|
46
|
-
background:
|
79
|
+
border: "1px solid ".concat(radio['unselected']['border']['default']),
|
80
|
+
background: radio['bg']['default']
|
47
81
|
},
|
48
82
|
'&:after': {
|
49
83
|
content: '""',
|
50
|
-
|
51
|
-
|
84
|
+
boxSizing: 'border-box',
|
85
|
+
width: 10,
|
86
|
+
height: 10,
|
52
87
|
borderRadius: '50%',
|
53
88
|
position: 'absolute',
|
54
89
|
top: '50%',
|
55
90
|
left: '50%',
|
56
91
|
transform: 'translate(-50%, -50%)',
|
57
92
|
transition: '0.3s all',
|
58
|
-
background: '
|
93
|
+
background: radio['bg']['default']
|
59
94
|
}
|
60
95
|
},
|
61
96
|
active: {
|
62
|
-
'& $radio
|
63
|
-
|
97
|
+
'& $radio': {
|
98
|
+
'&:before': {
|
99
|
+
borderWidth: 2,
|
100
|
+
borderColor: radio['selected']['border']['default']
|
101
|
+
},
|
102
|
+
'&:after': {
|
103
|
+
background: radio['selected']['bg']['default']
|
104
|
+
}
|
64
105
|
}
|
65
106
|
},
|
66
107
|
disabled: {
|
67
|
-
|
68
|
-
|
108
|
+
pointerEvents: 'none',
|
109
|
+
'& :not($radio)': {
|
110
|
+
opacity: 0.4
|
111
|
+
},
|
112
|
+
'&$active': {
|
113
|
+
'& $radio:before': {
|
114
|
+
borderColor: radio['selected']['border']['disabled']
|
115
|
+
},
|
116
|
+
'& $radio:after': {
|
117
|
+
background: radio['selected']['bg']['disabled']
|
118
|
+
}
|
119
|
+
},
|
120
|
+
'&:not($active)': {
|
121
|
+
'& $radio:before': {
|
122
|
+
background: radio['bg']['disabled']
|
123
|
+
},
|
124
|
+
'& $radio:after': {
|
125
|
+
background: radio['bg']['disabled']
|
126
|
+
}
|
127
|
+
}
|
69
128
|
},
|
70
129
|
label: {
|
71
|
-
marginLeft: _spacing["default"]
|
130
|
+
marginLeft: _spacing["default"]['size-2'],
|
72
131
|
cursor: 'pointer',
|
73
132
|
"float": 'left',
|
74
133
|
flex: '1'
|
75
134
|
},
|
76
135
|
right: {
|
77
|
-
marginLeft: _spacing["default"]
|
136
|
+
marginLeft: _spacing["default"]['size-2'],
|
78
137
|
"float": 'right'
|
79
138
|
},
|
80
139
|
overflow: {
|
package/build/Text/styles.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports["default"] = void 0;
|
6
|
+
exports["default"] = exports.parseFontValue = void 0;
|
7
7
|
|
8
8
|
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
9
9
|
|
@@ -46,6 +46,7 @@ var parseFontValue = function parseFontValue(font) {
|
|
46
46
|
return "".concat(font.fontWeight, " ").concat(font.fontSize, "/").concat(font.lineHeight, " ").concat(_fonts["default"].body);
|
47
47
|
};
|
48
48
|
|
49
|
+
exports.parseFontValue = parseFontValue;
|
49
50
|
var _default = {
|
50
51
|
text: {
|
51
52
|
letterSpacing: 0,
|
@@ -15,9 +15,9 @@ var _reactTextMask = _interopRequireDefault(require("react-text-mask"));
|
|
15
15
|
|
16
16
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
17
17
|
|
18
|
-
var
|
18
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
19
19
|
|
20
|
-
var
|
20
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
21
21
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
23
23
|
|
@@ -222,12 +222,9 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
222
222
|
type = _this$props7.type,
|
223
223
|
inputClassName = _this$props7.inputClassName,
|
224
224
|
alignRight = _this$props7.alignRight,
|
225
|
-
hjWhitelist = _this$props7.hjWhitelist
|
226
|
-
searchField = _this$props7.searchField;
|
225
|
+
hjWhitelist = _this$props7.hjWhitelist;
|
227
226
|
var className = classes.input;
|
228
|
-
if (searchField) className += " ".concat(classes.searchField);
|
229
227
|
if (iconName) className += " ".concat(classes.hasIcon);
|
230
|
-
if (searchField && iconName) className += " ".concat(classes.searchFieldHasIcon);
|
231
228
|
if (clear) className += " ".concat(classes.hasClear);
|
232
229
|
if (alignRight) className += " ".concat(classes.alignRight);
|
233
230
|
if (type == 'select') className += " ".concat(classes.select);
|
@@ -240,65 +237,54 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
240
237
|
}, {
|
241
238
|
key: "setIconColor",
|
242
239
|
value: function setIconColor() {
|
243
|
-
var
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
disabled = _this$props8.disabled,
|
249
|
-
searchField = _this$props8.searchField,
|
250
|
-
error = _this$props8.error,
|
251
|
-
allowError = _this$props8.allowError;
|
252
|
-
if (disabled) return _colors["default"].grey500;
|
253
|
-
if (status === 'focus' && searchField) return _colors["default"].prim;
|
254
|
-
if (error && (allowError || touched)) return _colors["default"].error;
|
255
|
-
if (status !== 'focus' && searchField && value) return _colors["default"].grey900;
|
256
|
-
return _colors["default"].grey500;
|
240
|
+
var status = this.state.status;
|
241
|
+
var disabled = this.props.disabled;
|
242
|
+
if (disabled) return _colors["default"].icon["default"].disabled;
|
243
|
+
if (status === 'focus') return _colors["default"].icon.brand.bold;
|
244
|
+
return _colors["default"].icon["default"]["default"];
|
257
245
|
}
|
258
246
|
}, {
|
259
247
|
key: "render",
|
260
248
|
value: function render() {
|
261
249
|
var _this2 = this;
|
262
250
|
|
263
|
-
var _this$
|
264
|
-
status = _this$
|
265
|
-
value = _this$
|
266
|
-
touched = _this$
|
267
|
-
showPass = _this$
|
268
|
-
passIconBeingClicked = _this$
|
269
|
-
var _this$
|
270
|
-
classes = _this$
|
271
|
-
input = _this$
|
272
|
-
meta = _this$
|
273
|
-
label = _this$
|
274
|
-
placeholder = _this$
|
275
|
-
counter = _this$
|
276
|
-
maxLength = _this$
|
277
|
-
type = _this$
|
278
|
-
name = _this$
|
279
|
-
options = _this$
|
280
|
-
id = _this$
|
281
|
-
style = _this$
|
282
|
-
disabled = _this$
|
283
|
-
autoFocus = _this$
|
284
|
-
error = _this$
|
285
|
-
assistiveText = _this$
|
286
|
-
clear = _this$
|
287
|
-
iconName = _this$
|
288
|
-
allowError = _this$
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
searchField = _this$props9.searchField,
|
297
|
-
testId = _this$props9.testId;
|
251
|
+
var _this$state = this.state,
|
252
|
+
status = _this$state.status,
|
253
|
+
value = _this$state.value,
|
254
|
+
touched = _this$state.touched,
|
255
|
+
showPass = _this$state.showPass,
|
256
|
+
passIconBeingClicked = _this$state.passIconBeingClicked;
|
257
|
+
var _this$props8 = this.props,
|
258
|
+
classes = _this$props8.classes,
|
259
|
+
input = _this$props8.input,
|
260
|
+
meta = _this$props8.meta,
|
261
|
+
label = _this$props8.label,
|
262
|
+
placeholder = _this$props8.placeholder,
|
263
|
+
counter = _this$props8.counter,
|
264
|
+
maxLength = _this$props8.maxLength,
|
265
|
+
type = _this$props8.type,
|
266
|
+
name = _this$props8.name,
|
267
|
+
options = _this$props8.options,
|
268
|
+
id = _this$props8.id,
|
269
|
+
style = _this$props8.style,
|
270
|
+
disabled = _this$props8.disabled,
|
271
|
+
autoFocus = _this$props8.autoFocus,
|
272
|
+
error = _this$props8.error,
|
273
|
+
assistiveText = _this$props8.assistiveText,
|
274
|
+
clear = _this$props8.clear,
|
275
|
+
iconName = _this$props8.iconName,
|
276
|
+
allowError = _this$props8.allowError,
|
277
|
+
required = _this$props8.required,
|
278
|
+
mask = _this$props8.mask,
|
279
|
+
guide = _this$props8.guide,
|
280
|
+
inputMode = _this$props8.inputMode,
|
281
|
+
disableAutoComplete = _this$props8.disableAutoComplete,
|
282
|
+
pattern = _this$props8.pattern,
|
283
|
+
testId = _this$props8.testId;
|
298
284
|
var realStatus = status;
|
299
285
|
var InputType = type == 'select' ? 'select' : type == 'textarea' ? 'textarea' : 'input';
|
300
286
|
var errorStatus = meta && meta.error && (meta.touched || allowError) || error && (touched || allowError) && !passIconBeingClicked;
|
301
|
-
if (disabled) realStatus = 'disabled';else if (status != 'focus' && errorStatus) realStatus = 'error';
|
287
|
+
if (disabled) realStatus = 'disabled';else if (status != 'focus' && errorStatus) realStatus = 'error';
|
302
288
|
var element, passIcon;
|
303
289
|
var commonProps = {
|
304
290
|
name: name,
|
@@ -344,14 +330,13 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
344
330
|
}, input && input.value ? input.value : value ? value : placeholder));
|
345
331
|
}
|
346
332
|
|
347
|
-
passIcon = /*#__PURE__*/_react["default"].createElement("
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
}));
|
333
|
+
passIcon = /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
334
|
+
theme: "ghostGrey",
|
335
|
+
icon: "eye",
|
336
|
+
size: "md",
|
337
|
+
disabled: true,
|
338
|
+
className: classes.rightButton
|
339
|
+
});
|
355
340
|
} else if (type == 'select') {
|
356
341
|
element = /*#__PURE__*/_react["default"].createElement(InputType, commonProps, /*#__PURE__*/_react["default"].createElement("option", {
|
357
342
|
value: "",
|
@@ -369,7 +354,7 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
369
354
|
value: option.value,
|
370
355
|
disabled: option.disabled
|
371
356
|
}, testId && {
|
372
|
-
'data-testid': "".concat(testId, "__item-").concat(
|
357
|
+
'data-testid': "".concat(testId, "__item-").concat(option.value)
|
373
358
|
}), option.label);
|
374
359
|
}));
|
375
360
|
} else {
|
@@ -399,61 +384,55 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
399
384
|
}, disableAutoComplete && {
|
400
385
|
autoComplete: 'off'
|
401
386
|
}));
|
402
|
-
passIcon = /*#__PURE__*/_react["default"].createElement("
|
387
|
+
passIcon = /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
388
|
+
theme: "ghostGrey",
|
389
|
+
icon: showPass ? 'eye' : 'eye-slash',
|
390
|
+
size: "md",
|
391
|
+
className: classes.rightButton,
|
403
392
|
onMouseDown: this.togglePass,
|
404
393
|
onMouseUp: this.focusInput,
|
405
|
-
onMouseOut: this.outOfPassIcon
|
406
|
-
|
407
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
408
|
-
iconName: showPass ? 'eye' : 'eyeClosed',
|
409
|
-
width: _iconSizes["default"].small,
|
410
|
-
height: _iconSizes["default"].small,
|
411
|
-
colors: showPass ? [_colors["default"].grey900] : [_colors["default"].grey400]
|
412
|
-
}));
|
394
|
+
onMouseOut: this.outOfPassIcon
|
395
|
+
});
|
413
396
|
}
|
414
397
|
|
415
398
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
416
399
|
className: this.setClassName(realStatus),
|
417
400
|
style: style
|
418
|
-
},
|
401
|
+
}, label && /*#__PURE__*/_react["default"].createElement("div", {
|
419
402
|
className: classes.top
|
420
403
|
}, label && /*#__PURE__*/_react["default"].createElement("label", {
|
421
|
-
className:
|
404
|
+
className: classes.label
|
422
405
|
}, label)), /*#__PURE__*/_react["default"].createElement("div", {
|
423
406
|
className: classes.inputWrap
|
424
407
|
}, iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
425
408
|
iconName: iconName,
|
426
|
-
width:
|
427
|
-
height:
|
409
|
+
width: 24,
|
410
|
+
height: 24,
|
428
411
|
className: classes.icon,
|
429
412
|
colors: [this.setIconColor()]
|
430
413
|
}), type == 'select' && /*#__PURE__*/_react["default"].createElement("div", {
|
431
414
|
className: classes.selectIcon
|
432
415
|
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
433
|
-
iconName: "
|
434
|
-
width:
|
435
|
-
height:
|
436
|
-
colors: disabled ? [_colors["default"].
|
437
|
-
})), type == 'password' && passIcon, value && clear && /*#__PURE__*/_react["default"].createElement("
|
438
|
-
|
439
|
-
|
416
|
+
iconName: "chevron-down",
|
417
|
+
width: 24,
|
418
|
+
height: 24,
|
419
|
+
colors: disabled ? [_colors["default"].icon["default"].disabled] : [_colors["default"].icon["default"]["default"]]
|
420
|
+
})), element, type == 'password' && passIcon, value && clear && /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
421
|
+
icon: "x",
|
422
|
+
theme: "ghostGrey",
|
423
|
+
size: "md",
|
424
|
+
className: classes.rightButton,
|
425
|
+
onClick: this.onClear
|
440
426
|
}, testId && {
|
441
427
|
'data-testid': "".concat(testId, "__container-close-icon")
|
442
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
443
|
-
iconName: "close",
|
444
|
-
width: _iconSizes["default"].small,
|
445
|
-
height: _iconSizes["default"].small
|
446
|
-
})), element), (assistiveText || counter && maxLength || lockHeight) && /*#__PURE__*/_react["default"].createElement("div", {
|
428
|
+
}))), (assistiveText || counter && maxLength) && /*#__PURE__*/_react["default"].createElement("div", {
|
447
429
|
className: classes.bottom
|
430
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
431
|
+
className: classes.assistiveTextWrap
|
448
432
|
}, assistiveText && /*#__PURE__*/_react["default"].createElement("label", {
|
449
|
-
className: "".concat(classes.
|
450
|
-
},
|
451
|
-
|
452
|
-
width: _iconSizes["default"].tiny,
|
453
|
-
height: _iconSizes["default"].tiny,
|
454
|
-
className: classes.errorIcon
|
455
|
-
}) : null, ' ', assistiveText), counter && maxLength && /*#__PURE__*/_react["default"].createElement("label", {
|
456
|
-
className: "".concat(classes.label, " ").concat(classes.right, " ").concat(classes.counter)
|
433
|
+
className: "".concat(classes.assistiveText, " ").concat(realStatus == 'error' ? classes.assistiveError : null)
|
434
|
+
}, assistiveText)), counter && maxLength && /*#__PURE__*/_react["default"].createElement("label", {
|
435
|
+
className: "".concat(classes.counter)
|
457
436
|
}, value.length, " / ", maxLength)));
|
458
437
|
}
|
459
438
|
}]);
|
@@ -511,9 +490,6 @@ TextField.propTypes = {
|
|
511
490
|
/** It allows the component to display the error messages even if it hasn't been touched. */
|
512
491
|
allowError: _propTypes["default"].bool,
|
513
492
|
|
514
|
-
/** By default the TextField container would be smaller without a label or an assistive text. lockHeight will maintain the same height as if it had both, label and assistive text. */
|
515
|
-
lockHeight: _propTypes["default"].bool,
|
516
|
-
|
517
493
|
/** Use as a default value. */
|
518
494
|
valueProp: _propTypes["default"].node,
|
519
495
|
|
@@ -583,9 +559,6 @@ TextField.propTypes = {
|
|
583
559
|
/** Regular expression to validate the input content. */
|
584
560
|
pattern: _propTypes["default"].string,
|
585
561
|
|
586
|
-
/** Size of the TextField. */
|
587
|
-
searchField: _propTypes["default"].bool,
|
588
|
-
|
589
562
|
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
590
563
|
testId: _propTypes["default"].string
|
591
564
|
};
|