@pareto-engineering/design-system 2.0.0-alpha.22 → 2.0.0-alpha.23
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/cjs/b/Button/styles.scss +1 -1
- package/dist/cjs/f/common/Label/styles.scss +1 -1
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +13 -5
- package/dist/cjs/f/fields/SelectInput/styles.scss +13 -8
- package/dist/cjs/f/fields/TextInput/TextInput.js +10 -3
- package/dist/cjs/f/fields/TextInput/styles.scss +16 -3
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +3 -3
- package/dist/cjs/f/fields/TextareaInput/styles.scss +19 -6
- package/dist/cjs/f/fields/index.js +0 -24
- package/dist/cjs/form-reset.scss +1 -1
- package/dist/es/b/Button/styles.scss +1 -1
- package/dist/es/f/common/Label/styles.scss +1 -1
- package/dist/es/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/es/f/fields/SelectInput/SelectInput.js +13 -5
- package/dist/es/f/fields/SelectInput/styles.scss +13 -8
- package/dist/es/f/fields/TextInput/TextInput.js +10 -3
- package/dist/es/f/fields/TextInput/styles.scss +16 -3
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +3 -3
- package/dist/es/f/fields/TextareaInput/styles.scss +19 -6
- package/dist/es/f/fields/index.js +0 -3
- package/dist/es/form-reset.scss +1 -1
- package/package.json +2 -2
- package/src/__snapshots__/Storyshots.test.js.snap +124 -378
- package/src/stories/f/SelectInput.stories.jsx +10 -8
- package/src/stories/f/TextInput.stories.jsx +7 -6
- package/src/stories/f/TextareaInput.stories.jsx +4 -4
- package/src/ui/b/Button/styles.scss +1 -1
- package/src/ui/f/common/Label/styles.scss +1 -1
- package/src/ui/f/fields/ChoicesInput/styles.scss +17 -2
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +10 -1
- package/src/ui/f/fields/SelectInput/styles.scss +13 -8
- package/src/ui/f/fields/TextInput/TextInput.jsx +9 -1
- package/src/ui/f/fields/TextInput/styles.scss +16 -3
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +3 -3
- package/src/ui/f/fields/TextareaInput/styles.scss +19 -6
- package/src/ui/f/fields/index.js +0 -3
- package/src/ui/form-reset.scss +1 -1
- package/src/stories/f/CheckboxInput.stories.jsx +0 -37
- package/src/stories/f/RadioInput.stories.jsx +0 -37
- package/src/stories/f/TaskRecommendationInput.stories.jsx +0 -38
- package/src/ui/f/fields/CheckboxInput/CheckboxInput.jsx +0 -107
- package/src/ui/f/fields/CheckboxInput/index.js +0 -2
- package/src/ui/f/fields/CheckboxInput/styles.scss +0 -28
- package/src/ui/f/fields/RadioInput/RadioInput.jsx +0 -112
- package/src/ui/f/fields/RadioInput/index.js +0 -2
- package/src/ui/f/fields/RadioInput/styles.scss +0 -26
- package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +0 -130
- package/src/ui/f/fields/TaskRecommendationInput/index.js +0 -2
- package/src/ui/f/fields/TaskRecommendationInput/styles.scss +0 -41
|
@@ -16,7 +16,7 @@ $default-animation-time: .3s;
|
|
|
16
16
|
color: var(--on-x, var(--on-#{$default-color}));
|
|
17
17
|
display: inline-flex;
|
|
18
18
|
font-family: var(--theme-default-paragraph);
|
|
19
|
-
font-weight:
|
|
19
|
+
font-weight: 400;
|
|
20
20
|
justify-content: space-between;
|
|
21
21
|
padding: $default-padding;
|
|
22
22
|
transition: all .25s;
|
|
@@ -29,10 +29,21 @@ $default-transition:all .3s;
|
|
|
29
29
|
z-index: -1;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
input:disabled + label {
|
|
33
|
+
background-color: var(--dark-x);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
input:not(:disabled) + label {
|
|
37
|
+
&:hover {
|
|
38
|
+
border-color: var(--light-y);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
label {
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
border: var(--theme-border-style) var(--dark-x);
|
|
44
|
+
background: var(--light-x);
|
|
35
45
|
color: var(--on-x);
|
|
46
|
+
border-radius: var(--theme-border-radius);
|
|
36
47
|
display: block;
|
|
37
48
|
height: 100%;
|
|
38
49
|
padding: $default-padding;
|
|
@@ -44,6 +55,10 @@ $default-transition:all .3s;
|
|
|
44
55
|
input:checked + label {
|
|
45
56
|
background: var(--y);
|
|
46
57
|
color: var(--on-y);
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
border-color: var(--y);
|
|
61
|
+
}
|
|
47
62
|
}
|
|
48
63
|
}
|
|
49
64
|
}
|
|
@@ -37,6 +37,7 @@ var SelectInput = _ref => {
|
|
|
37
37
|
style,
|
|
38
38
|
name,
|
|
39
39
|
label,
|
|
40
|
+
color,
|
|
40
41
|
options,
|
|
41
42
|
validate,
|
|
42
43
|
description,
|
|
@@ -52,14 +53,14 @@ var SelectInput = _ref => {
|
|
|
52
53
|
});
|
|
53
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
54
55
|
id: id,
|
|
55
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
56
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(color)].filter(e => e).join(' '),
|
|
56
57
|
style: style // {...otherProps}
|
|
57
58
|
|
|
58
59
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
59
60
|
className: "input-label",
|
|
60
61
|
name: name
|
|
61
62
|
}, label), /*#__PURE__*/React.createElement("select", _extends({
|
|
62
|
-
className: "input
|
|
63
|
+
className: "input"
|
|
63
64
|
}, field, {
|
|
64
65
|
value: field.value || '',
|
|
65
66
|
id: name,
|
|
@@ -73,7 +74,8 @@ var SelectInput = _ref => {
|
|
|
73
74
|
return /*#__PURE__*/React.createElement("option", {
|
|
74
75
|
key: newOption.value,
|
|
75
76
|
value: newOption.value,
|
|
76
|
-
disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false
|
|
77
|
+
disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false,
|
|
78
|
+
selected: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || true
|
|
77
79
|
}, newOption.label);
|
|
78
80
|
})), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
79
81
|
isError: !!meta.error,
|
|
@@ -129,10 +131,16 @@ SelectInput.propTypes = {
|
|
|
129
131
|
/**
|
|
130
132
|
* Whether the select input should be disabled
|
|
131
133
|
*/
|
|
132
|
-
disabled: _propTypes.default.bool
|
|
134
|
+
disabled: _propTypes.default.bool,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The color of the select input
|
|
138
|
+
*/
|
|
139
|
+
color: _propTypes.default.string
|
|
133
140
|
};
|
|
134
141
|
SelectInput.defaultProps = {
|
|
135
|
-
disabled: false
|
|
142
|
+
disabled: false,
|
|
143
|
+
color: 'background2'
|
|
136
144
|
};
|
|
137
145
|
|
|
138
146
|
var _default = /*#__PURE__*/(0, React.memo)(SelectInput);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@use "../../../form.scss";
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
$default-padding: 0.75em
|
|
8
|
+
$default-padding: 0.75em;
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
.#{bem.$base}.select-input {
|
|
@@ -13,17 +13,22 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
.input-label {
|
|
17
|
-
color: var(--main2);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
.input {
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
18
|
+
background: var(--light-y);
|
|
19
|
+
color:var(--on-y);
|
|
23
20
|
padding: $default-padding;
|
|
24
21
|
|
|
22
|
+
&:not(:disabled):hover{
|
|
23
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:disabled {
|
|
27
|
+
background-color: var(--dark-y);
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
&:focus {
|
|
26
|
-
background: var(--
|
|
31
|
+
background: var(--y);
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
}
|
|
@@ -38,6 +38,7 @@ var TextInput = _ref => {
|
|
|
38
38
|
type,
|
|
39
39
|
name,
|
|
40
40
|
label,
|
|
41
|
+
color,
|
|
41
42
|
labelColor,
|
|
42
43
|
validate,
|
|
43
44
|
oneInputLabel,
|
|
@@ -55,7 +56,7 @@ var TextInput = _ref => {
|
|
|
55
56
|
});
|
|
56
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
57
58
|
id: id,
|
|
58
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
59
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(color)].filter(e => e).join(' '),
|
|
59
60
|
style: style // {...otherProps}
|
|
60
61
|
|
|
61
62
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
@@ -64,7 +65,7 @@ var TextInput = _ref => {
|
|
|
64
65
|
color: labelColor
|
|
65
66
|
}, label), /*#__PURE__*/React.createElement("input", _extends({
|
|
66
67
|
id: name,
|
|
67
|
-
className: "input
|
|
68
|
+
className: "input",
|
|
68
69
|
type: type,
|
|
69
70
|
disabled: disabled,
|
|
70
71
|
placeholder: placeholder
|
|
@@ -133,10 +134,16 @@ TextInput.propTypes = {
|
|
|
133
134
|
/**
|
|
134
135
|
* The placeholder text for the input
|
|
135
136
|
*/
|
|
136
|
-
placeholder: _propTypes.default.string
|
|
137
|
+
placeholder: _propTypes.default.string,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The text input color
|
|
141
|
+
*/
|
|
142
|
+
color: _propTypes.default.string
|
|
137
143
|
};
|
|
138
144
|
TextInput.defaultProps = {
|
|
139
145
|
type: 'text',
|
|
146
|
+
color: 'background2',
|
|
140
147
|
disabled: false
|
|
141
148
|
};
|
|
142
149
|
|
|
@@ -10,12 +10,25 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
|
|
12
12
|
.input {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
14
|
+
background: var(--light-y);
|
|
15
|
+
color: var(--on-y);
|
|
15
16
|
padding: $default-padding;
|
|
16
17
|
|
|
18
|
+
&::placeholder{
|
|
19
|
+
color: var(--metadata);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:not(:disabled):hover{
|
|
23
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:disabled {
|
|
27
|
+
background-color: var(--dark-y);
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
&:focus {
|
|
18
|
-
background: var(--
|
|
31
|
+
background: var(--light-background4);
|
|
19
32
|
}
|
|
20
33
|
}
|
|
21
34
|
}
|
|
@@ -56,7 +56,7 @@ var TextareaInput = _ref => {
|
|
|
56
56
|
});
|
|
57
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
58
58
|
id: id,
|
|
59
|
-
className: [baseClassName, componentClassName, userClassName, "
|
|
59
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(textAreaColor)].filter(e => e).join(' '),
|
|
60
60
|
style: style // {...otherProps}
|
|
61
61
|
|
|
62
62
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
@@ -65,7 +65,7 @@ var TextareaInput = _ref => {
|
|
|
65
65
|
color: labelColor
|
|
66
66
|
}, label), /*#__PURE__*/React.createElement("textarea", _extends({
|
|
67
67
|
id: textAreaId,
|
|
68
|
-
className: "textarea
|
|
68
|
+
className: "textarea"
|
|
69
69
|
}, field, {
|
|
70
70
|
placeholder: placeholder,
|
|
71
71
|
rows: rows,
|
|
@@ -149,7 +149,7 @@ TextareaInput.propTypes = {
|
|
|
149
149
|
};
|
|
150
150
|
TextareaInput.defaultProps = {
|
|
151
151
|
rows: 3,
|
|
152
|
-
textAreaColor: '
|
|
152
|
+
textAreaColor: 'background2',
|
|
153
153
|
disabled: false
|
|
154
154
|
};
|
|
155
155
|
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
@use "@pareto-engineering/bem";
|
|
3
3
|
|
|
4
|
+
$default-padding: .5em;
|
|
5
|
+
|
|
4
6
|
.#{bem.$base}.text-area-input{
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
9
|
|
|
8
10
|
.textarea {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
12
|
+
background: var(--light-y);
|
|
13
|
+
color: var(--on-y);
|
|
14
|
+
padding: $default-padding;
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
&::placeholder{
|
|
17
|
+
color: var(--metadata);
|
|
14
18
|
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
19
|
|
|
20
|
+
&:not(:disabled):hover{
|
|
21
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
22
|
+
}
|
|
18
23
|
|
|
24
|
+
&:disabled {
|
|
25
|
+
background-color: var(--dark-y);
|
|
26
|
+
}
|
|
19
27
|
|
|
28
|
+
&:focus {
|
|
29
|
+
background: var(--light-background4);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -15,24 +15,6 @@ Object.defineProperty(exports, "SelectInput", {
|
|
|
15
15
|
return _SelectInput.SelectInput;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "RadioInput", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _RadioInput.RadioInput;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "CheckboxInput", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _CheckboxInput.CheckboxInput;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "TaskRecommendationInput", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _TaskRecommendationInput.TaskRecommendationInput;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
18
|
Object.defineProperty(exports, "ChoicesInput", {
|
|
37
19
|
enumerable: true,
|
|
38
20
|
get: function get() {
|
|
@@ -56,12 +38,6 @@ var _TextInput = require("./TextInput");
|
|
|
56
38
|
|
|
57
39
|
var _SelectInput = require("./SelectInput");
|
|
58
40
|
|
|
59
|
-
var _RadioInput = require("./RadioInput");
|
|
60
|
-
|
|
61
|
-
var _CheckboxInput = require("./CheckboxInput");
|
|
62
|
-
|
|
63
|
-
var _TaskRecommendationInput = require("./TaskRecommendationInput");
|
|
64
|
-
|
|
65
41
|
var _ChoicesInput = require("./ChoicesInput");
|
|
66
42
|
|
|
67
43
|
var _TextareaInput = require("./TextareaInput");
|
package/dist/cjs/form-reset.scss
CHANGED
|
@@ -16,7 +16,7 @@ $default-animation-time: .3s;
|
|
|
16
16
|
color: var(--on-x, var(--on-#{$default-color}));
|
|
17
17
|
display: inline-flex;
|
|
18
18
|
font-family: var(--theme-default-paragraph);
|
|
19
|
-
font-weight:
|
|
19
|
+
font-weight: 400;
|
|
20
20
|
justify-content: space-between;
|
|
21
21
|
padding: $default-padding;
|
|
22
22
|
transition: all .25s;
|
|
@@ -29,10 +29,21 @@ $default-transition:all .3s;
|
|
|
29
29
|
z-index: -1;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
input:disabled + label {
|
|
33
|
+
background-color: var(--dark-x);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
input:not(:disabled) + label {
|
|
37
|
+
&:hover {
|
|
38
|
+
border-color: var(--light-y);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
label {
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
border: var(--theme-border-style) var(--dark-x);
|
|
44
|
+
background: var(--light-x);
|
|
35
45
|
color: var(--on-x);
|
|
46
|
+
border-radius: var(--theme-border-radius);
|
|
36
47
|
display: block;
|
|
37
48
|
height: 100%;
|
|
38
49
|
padding: $default-padding;
|
|
@@ -44,6 +55,10 @@ $default-transition:all .3s;
|
|
|
44
55
|
input:checked + label {
|
|
45
56
|
background: var(--y);
|
|
46
57
|
color: var(--on-y);
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
border-color: var(--y);
|
|
61
|
+
}
|
|
47
62
|
}
|
|
48
63
|
}
|
|
49
64
|
}
|
|
@@ -20,6 +20,7 @@ const SelectInput = ({
|
|
|
20
20
|
style,
|
|
21
21
|
name,
|
|
22
22
|
label,
|
|
23
|
+
color,
|
|
23
24
|
options,
|
|
24
25
|
validate,
|
|
25
26
|
description,
|
|
@@ -35,14 +36,14 @@ const SelectInput = ({
|
|
|
35
36
|
});
|
|
36
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
37
38
|
id: id,
|
|
38
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
39
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
39
40
|
style: style // {...otherProps}
|
|
40
41
|
|
|
41
42
|
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
42
43
|
className: "input-label",
|
|
43
44
|
name: name
|
|
44
45
|
}, label), /*#__PURE__*/React.createElement("select", _extends({
|
|
45
|
-
className: "input
|
|
46
|
+
className: "input"
|
|
46
47
|
}, field, {
|
|
47
48
|
value: field.value || '',
|
|
48
49
|
id: name,
|
|
@@ -56,7 +57,8 @@ const SelectInput = ({
|
|
|
56
57
|
return /*#__PURE__*/React.createElement("option", {
|
|
57
58
|
key: newOption.value,
|
|
58
59
|
value: newOption.value,
|
|
59
|
-
disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false
|
|
60
|
+
disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false,
|
|
61
|
+
selected: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || true
|
|
60
62
|
}, newOption.label);
|
|
61
63
|
})), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
|
|
62
64
|
isError: !!meta.error,
|
|
@@ -112,9 +114,15 @@ SelectInput.propTypes = {
|
|
|
112
114
|
/**
|
|
113
115
|
* Whether the select input should be disabled
|
|
114
116
|
*/
|
|
115
|
-
disabled: PropTypes.bool
|
|
117
|
+
disabled: PropTypes.bool,
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The color of the select input
|
|
121
|
+
*/
|
|
122
|
+
color: PropTypes.string
|
|
116
123
|
};
|
|
117
124
|
SelectInput.defaultProps = {
|
|
118
|
-
disabled: false
|
|
125
|
+
disabled: false,
|
|
126
|
+
color: 'background2'
|
|
119
127
|
};
|
|
120
128
|
export default /*#__PURE__*/memo(SelectInput);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@use "../../../form.scss";
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
$default-padding: 0.75em
|
|
8
|
+
$default-padding: 0.75em;
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
.#{bem.$base}.select-input {
|
|
@@ -13,17 +13,22 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
.input-label {
|
|
17
|
-
color: var(--main2);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
.input {
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
18
|
+
background: var(--light-y);
|
|
19
|
+
color:var(--on-y);
|
|
23
20
|
padding: $default-padding;
|
|
24
21
|
|
|
22
|
+
&:not(:disabled):hover{
|
|
23
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:disabled {
|
|
27
|
+
background-color: var(--dark-y);
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
&:focus {
|
|
26
|
-
background: var(--
|
|
31
|
+
background: var(--y);
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
}
|
|
@@ -21,6 +21,7 @@ const TextInput = ({
|
|
|
21
21
|
type,
|
|
22
22
|
name,
|
|
23
23
|
label,
|
|
24
|
+
color,
|
|
24
25
|
labelColor,
|
|
25
26
|
validate,
|
|
26
27
|
oneInputLabel,
|
|
@@ -38,7 +39,7 @@ const TextInput = ({
|
|
|
38
39
|
});
|
|
39
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
40
41
|
id: id,
|
|
41
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
42
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
42
43
|
style: style // {...otherProps}
|
|
43
44
|
|
|
44
45
|
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
@@ -47,7 +48,7 @@ const TextInput = ({
|
|
|
47
48
|
color: labelColor
|
|
48
49
|
}, label), /*#__PURE__*/React.createElement("input", _extends({
|
|
49
50
|
id: name,
|
|
50
|
-
className:
|
|
51
|
+
className: "input",
|
|
51
52
|
type: type,
|
|
52
53
|
disabled: disabled,
|
|
53
54
|
placeholder: placeholder
|
|
@@ -116,10 +117,16 @@ TextInput.propTypes = {
|
|
|
116
117
|
/**
|
|
117
118
|
* The placeholder text for the input
|
|
118
119
|
*/
|
|
119
|
-
placeholder: PropTypes.string
|
|
120
|
+
placeholder: PropTypes.string,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The text input color
|
|
124
|
+
*/
|
|
125
|
+
color: PropTypes.string
|
|
120
126
|
};
|
|
121
127
|
TextInput.defaultProps = {
|
|
122
128
|
type: 'text',
|
|
129
|
+
color: 'background2',
|
|
123
130
|
disabled: false
|
|
124
131
|
};
|
|
125
132
|
export default /*#__PURE__*/memo(TextInput);
|
|
@@ -10,12 +10,25 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
|
|
12
12
|
.input {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
14
|
+
background: var(--light-y);
|
|
15
|
+
color: var(--on-y);
|
|
15
16
|
padding: $default-padding;
|
|
16
17
|
|
|
18
|
+
&::placeholder{
|
|
19
|
+
color: var(--metadata);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:not(:disabled):hover{
|
|
23
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:disabled {
|
|
27
|
+
background-color: var(--dark-y);
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
&:focus {
|
|
18
|
-
background: var(--
|
|
31
|
+
background: var(--light-background4);
|
|
19
32
|
}
|
|
20
33
|
}
|
|
21
34
|
}
|
|
@@ -40,7 +40,7 @@ const TextareaInput = ({
|
|
|
40
40
|
});
|
|
41
41
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
42
|
id: id,
|
|
43
|
-
className: [baseClassName, componentClassName, userClassName, `
|
|
43
|
+
className: [baseClassName, componentClassName, userClassName, `y-${textAreaColor}`].filter(e => e).join(' '),
|
|
44
44
|
style: style // {...otherProps}
|
|
45
45
|
|
|
46
46
|
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
@@ -49,7 +49,7 @@ const TextareaInput = ({
|
|
|
49
49
|
color: labelColor
|
|
50
50
|
}, label), /*#__PURE__*/React.createElement("textarea", _extends({
|
|
51
51
|
id: textAreaId,
|
|
52
|
-
className:
|
|
52
|
+
className: "textarea"
|
|
53
53
|
}, field, {
|
|
54
54
|
placeholder: placeholder,
|
|
55
55
|
rows: rows,
|
|
@@ -133,7 +133,7 @@ TextareaInput.propTypes = {
|
|
|
133
133
|
};
|
|
134
134
|
TextareaInput.defaultProps = {
|
|
135
135
|
rows: 3,
|
|
136
|
-
textAreaColor: '
|
|
136
|
+
textAreaColor: 'background2',
|
|
137
137
|
disabled: false
|
|
138
138
|
};
|
|
139
139
|
export default /*#__PURE__*/memo(TextareaInput);
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
@use "@pareto-engineering/bem";
|
|
3
3
|
|
|
4
|
+
$default-padding: .5em;
|
|
5
|
+
|
|
4
6
|
.#{bem.$base}.text-area-input{
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
9
|
|
|
8
10
|
.textarea {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
12
|
+
background: var(--light-y);
|
|
13
|
+
color: var(--on-y);
|
|
14
|
+
padding: $default-padding;
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
&::placeholder{
|
|
17
|
+
color: var(--metadata);
|
|
14
18
|
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
19
|
|
|
20
|
+
&:not(:disabled):hover{
|
|
21
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
22
|
+
}
|
|
18
23
|
|
|
24
|
+
&:disabled {
|
|
25
|
+
background-color: var(--dark-y);
|
|
26
|
+
}
|
|
19
27
|
|
|
28
|
+
&:focus {
|
|
29
|
+
background: var(--light-background4);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
export { TextInput } from "./TextInput";
|
|
2
2
|
export { SelectInput } from "./SelectInput";
|
|
3
|
-
export { RadioInput } from "./RadioInput";
|
|
4
|
-
export { CheckboxInput } from "./CheckboxInput";
|
|
5
|
-
export { TaskRecommendationInput } from "./TaskRecommendationInput";
|
|
6
3
|
export { ChoicesInput } from "./ChoicesInput";
|
|
7
4
|
export { TextareaInput } from "./TextareaInput";
|
|
8
5
|
export { RatingsInput } from "./RatingsInput";
|
package/dist/es/form-reset.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pareto-engineering/design-system",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.23",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"stylelint-config-palantir": "^5.1.0"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@pareto-engineering/assets": "^2.0.0-alpha.
|
|
82
|
+
"@pareto-engineering/assets": "^2.0.0-alpha.10",
|
|
83
83
|
"@pareto-engineering/bem": "^0.1.5",
|
|
84
84
|
"@pareto-engineering/styles": "^2.0.0-alpha.8",
|
|
85
85
|
"date-fns": "^2.22.1",
|