@pareto-engineering/design-system 2.0.0-alpha.2 → 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/a/AnimatedCounter/AnimatedCounter.js +16 -29
- package/dist/cjs/a/AnimatedCounter/styles.scss +3 -11
- package/dist/cjs/a/BackgroundGradient/BackgroundGradient.js +77 -0
- package/dist/cjs/a/BackgroundGradient/index.js +15 -0
- package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
- package/dist/cjs/a/Conversation/Conversation.js +15 -8
- package/dist/cjs/a/Conversation/common/Message/Message.js +33 -6
- package/dist/cjs/a/Conversation/styles.scss +129 -32
- package/dist/cjs/a/OvalIllustration/OvalIllustration.js +133 -0
- package/dist/cjs/a/OvalIllustration/index.js +15 -0
- package/dist/cjs/a/OvalIllustration/styles.scss +102 -0
- package/dist/cjs/a/People/People.js +15 -7
- package/dist/cjs/a/People/common/Person/Person.js +11 -4
- package/dist/cjs/a/People/styles.scss +13 -15
- package/dist/cjs/a/Shapes/Shapes.js +171 -0
- package/dist/cjs/a/Shapes/index.js +15 -0
- package/dist/cjs/a/Shapes/styles.scss +255 -0
- package/dist/cjs/a/SnapScroller/SnapScroller.js +77 -0
- package/dist/cjs/a/SnapScroller/index.js +15 -0
- package/dist/cjs/a/SnapScroller/styles.scss +38 -0
- package/dist/cjs/a/TeamInfo/styles.scss +2 -2
- package/dist/cjs/a/index.js +33 -1
- package/dist/cjs/b/Button/Button.js +10 -4
- package/dist/cjs/b/Button/styles.scss +83 -19
- package/dist/cjs/b/Metrics/Metrics.js +89 -0
- package/dist/cjs/b/Metrics/index.js +15 -0
- package/dist/cjs/b/Metrics/styles.scss +91 -0
- package/dist/cjs/b/Page/common/Section/Section.js +56 -5
- package/dist/cjs/b/Page/styles.scss +8 -2
- package/dist/cjs/b/QuestionDropdown/styles.scss +1 -1
- package/dist/cjs/b/index.js +9 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +4 -4
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/cjs/c/ContentSlides/styles.scss +10 -4
- package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
- package/dist/cjs/f/common/Label/Label.js +1 -1
- package/dist/cjs/f/common/Label/styles.scss +1 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +2 -2
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +37 -10
- package/dist/cjs/f/fields/SelectInput/styles.scss +13 -8
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/cjs/f/fields/TextInput/TextInput.js +28 -7
- package/dist/cjs/f/fields/TextInput/styles.scss +16 -7
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -8
- 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/cjs/form.scss +1 -1
- package/dist/es/a/AnimatedCounter/AnimatedCounter.js +17 -30
- package/dist/es/a/AnimatedCounter/styles.scss +3 -11
- package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
- package/dist/es/a/BackgroundGradient/index.js +2 -0
- package/dist/es/a/BackgroundGradient/styles.scss +16 -0
- package/dist/es/a/Conversation/Conversation.js +15 -8
- package/dist/es/a/Conversation/common/Message/Message.js +33 -6
- package/dist/es/a/Conversation/styles.scss +129 -32
- package/dist/es/a/OvalIllustration/OvalIllustration.js +111 -0
- package/dist/es/a/OvalIllustration/index.js +2 -0
- package/dist/es/a/OvalIllustration/styles.scss +102 -0
- package/dist/es/a/People/People.js +14 -7
- package/dist/es/a/People/common/Person/Person.js +11 -4
- package/dist/es/a/People/styles.scss +13 -15
- package/dist/es/a/Shapes/Shapes.js +149 -0
- package/dist/es/a/Shapes/index.js +2 -0
- package/dist/es/a/Shapes/styles.scss +255 -0
- package/dist/es/a/SnapScroller/SnapScroller.js +61 -0
- package/dist/es/a/SnapScroller/index.js +2 -0
- package/dist/es/a/SnapScroller/styles.scss +38 -0
- package/dist/es/a/TeamInfo/styles.scss +2 -2
- package/dist/es/a/index.js +5 -1
- package/dist/es/b/Button/Button.js +8 -2
- package/dist/es/b/Button/styles.scss +83 -19
- package/dist/es/b/Metrics/Metrics.js +72 -0
- package/dist/es/b/Metrics/index.js +2 -0
- package/dist/es/b/Metrics/styles.scss +91 -0
- package/dist/es/b/Page/common/Section/Section.js +55 -4
- package/dist/es/b/Page/styles.scss +8 -2
- package/dist/es/b/QuestionDropdown/styles.scss +1 -1
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +4 -4
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/es/c/ContentSlides/styles.scss +10 -4
- package/dist/es/f/common/Debugger/Debugger.js +1 -1
- package/dist/es/f/common/Label/Label.js +1 -1
- package/dist/es/f/common/Label/styles.scss +1 -1
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +2 -2
- package/dist/es/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
- package/dist/es/f/fields/SelectInput/SelectInput.js +37 -10
- package/dist/es/f/fields/SelectInput/styles.scss +13 -8
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/es/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/es/f/fields/TextInput/TextInput.js +28 -7
- package/dist/es/f/fields/TextInput/styles.scss +16 -7
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -8
- 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/dist/es/form.scss +1 -1
- package/package.json +3 -3
- package/src/__snapshots__/Storyshots.test.js.snap +6050 -812
- package/src/local.scss +4 -0
- package/src/stories/a/AnimatedCounter.stories.jsx +9 -5
- package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
- package/src/stories/a/ContentCard.stories.jsx +1 -1
- package/src/stories/a/Conversation.stories.jsx +78 -1
- package/src/stories/a/OvalIllustration.stories.jsx +59 -0
- package/src/stories/a/People.stories.jsx +25 -1
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/a/Quote.stories.jsx +1 -1
- package/src/stories/a/Shapes.stories.jsx +143 -0
- package/src/stories/a/SnapScroller.stories.jsx +98 -0
- package/src/stories/a/Spinner.stories.jsx +1 -1
- package/src/stories/b/Button.stories.jsx +83 -54
- package/src/stories/b/Metrics.stories.jsx +62 -0
- package/src/stories/b/Page.stories.jsx +51 -1
- package/src/stories/b/ThemeSelector.stories.jsx +1 -1
- package/src/stories/b/Title.stories.jsx +1 -1
- package/src/stories/c/ContentSlides.stories.jsx +154 -2
- package/src/stories/colors.js +5 -3
- package/src/stories/f/SelectInput.stories.jsx +36 -5
- package/src/stories/f/TextInput.stories.jsx +16 -5
- package/src/stories/f/TextareaInput.stories.jsx +42 -6
- package/src/ui/a/AnimatedCounter/AnimatedCounter.jsx +21 -27
- package/src/ui/a/AnimatedCounter/styles.scss +3 -11
- package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
- package/src/ui/a/BackgroundGradient/index.js +2 -0
- package/src/ui/a/BackgroundGradient/styles.scss +16 -0
- package/src/ui/a/Conversation/Conversation.jsx +15 -7
- package/src/ui/a/Conversation/common/Message/Message.jsx +40 -7
- package/src/ui/a/Conversation/styles.scss +129 -32
- package/src/ui/a/OvalIllustration/OvalIllustration.jsx +134 -0
- package/src/ui/a/OvalIllustration/index.js +2 -0
- package/src/ui/a/OvalIllustration/styles.scss +102 -0
- package/src/ui/a/People/People.jsx +12 -4
- package/src/ui/a/People/common/Person/Person.jsx +7 -1
- package/src/ui/a/People/styles.scss +13 -15
- package/src/ui/a/Shapes/Shapes.jsx +191 -0
- package/src/ui/a/Shapes/index.js +2 -0
- package/src/ui/a/Shapes/styles.scss +255 -0
- package/src/ui/a/SnapScroller/SnapScroller.jsx +83 -0
- package/src/ui/a/SnapScroller/index.js +2 -0
- package/src/ui/a/SnapScroller/styles.scss +38 -0
- package/src/ui/a/TeamInfo/styles.scss +2 -2
- package/src/ui/a/index.js +4 -0
- package/src/ui/b/Button/Button.jsx +9 -1
- package/src/ui/b/Button/styles.scss +83 -19
- package/src/ui/b/Metrics/Metrics.jsx +93 -0
- package/src/ui/b/Metrics/index.js +2 -0
- package/src/ui/b/Metrics/styles.scss +91 -0
- package/src/ui/b/Page/common/Section/Section.jsx +68 -2
- package/src/ui/b/Page/styles.scss +8 -2
- package/src/ui/b/QuestionDropdown/styles.scss +1 -1
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +4 -4
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
- package/src/ui/c/ContentSlides/styles.scss +10 -4
- package/src/ui/f/common/Debugger/Debugger.jsx +1 -1
- package/src/ui/f/common/Label/Label.jsx +1 -1
- package/src/ui/f/common/Label/styles.scss +1 -1
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +2 -2
- package/src/ui/f/fields/ChoicesInput/styles.scss +17 -2
- package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +2 -2
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +44 -5
- package/src/ui/f/fields/SelectInput/styles.scss +13 -8
- package/src/ui/f/fields/TextInput/TextInput.jsx +24 -3
- package/src/ui/f/fields/TextInput/styles.scss +16 -7
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +24 -13
- 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/ui/form.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 -37
|
@@ -128,8 +128,8 @@ ChoicesInput.propTypes = {
|
|
|
128
128
|
ChoicesInput.defaultProps = {
|
|
129
129
|
gridColumnsMobile: 2,
|
|
130
130
|
gridColumnsDesktop: 3,
|
|
131
|
-
color: '
|
|
132
|
-
colorChecked: '
|
|
131
|
+
color: 'background2',
|
|
132
|
+
colorChecked: 'main2',
|
|
133
133
|
disabled: false
|
|
134
134
|
};
|
|
135
135
|
export default /*#__PURE__*/memo(ChoicesInput);
|
|
@@ -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
|
}
|
|
@@ -104,8 +104,8 @@ Rating.propTypes = {
|
|
|
104
104
|
showRatingValue: PropTypes.bool
|
|
105
105
|
};
|
|
106
106
|
Rating.defaultProps = {
|
|
107
|
-
activeBackgroundColor: '
|
|
108
|
-
inactiveBackgroundColor: '
|
|
107
|
+
activeBackgroundColor: 'main1',
|
|
108
|
+
inactiveBackgroundColor: 'background2',
|
|
109
109
|
showRatingValue: false
|
|
110
110
|
};
|
|
111
111
|
export default Rating;
|
|
@@ -20,25 +20,32 @@ const SelectInput = ({
|
|
|
20
20
|
style,
|
|
21
21
|
name,
|
|
22
22
|
label,
|
|
23
|
+
color,
|
|
23
24
|
options,
|
|
25
|
+
validate,
|
|
26
|
+
description,
|
|
24
27
|
disabled // ...otherProps
|
|
25
28
|
|
|
26
29
|
}) => {
|
|
27
30
|
useLayoutEffect(() => {
|
|
28
31
|
import("./styles.scss");
|
|
29
32
|
}, []);
|
|
30
|
-
const [field, meta] = useField(
|
|
33
|
+
const [field, meta] = useField({
|
|
34
|
+
name,
|
|
35
|
+
validate
|
|
36
|
+
});
|
|
31
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
32
38
|
id: id,
|
|
33
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
39
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
34
40
|
style: style // {...otherProps}
|
|
35
41
|
|
|
36
42
|
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
37
43
|
className: "input-label",
|
|
38
44
|
name: name
|
|
39
45
|
}, label), /*#__PURE__*/React.createElement("select", _extends({
|
|
40
|
-
className: "input
|
|
46
|
+
className: "input"
|
|
41
47
|
}, field, {
|
|
48
|
+
value: field.value || '',
|
|
42
49
|
id: name,
|
|
43
50
|
disabled: disabled
|
|
44
51
|
}), options.map(option => {
|
|
@@ -49,11 +56,14 @@ const SelectInput = ({
|
|
|
49
56
|
} : option;
|
|
50
57
|
return /*#__PURE__*/React.createElement("option", {
|
|
51
58
|
key: newOption.value,
|
|
52
|
-
value: newOption.value
|
|
59
|
+
value: newOption.value,
|
|
60
|
+
disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false,
|
|
61
|
+
selected: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || true
|
|
53
62
|
}, newOption.label);
|
|
54
|
-
})), meta.
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
})), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
|
|
64
|
+
isError: !!meta.error,
|
|
65
|
+
className: "v50 mt-v s-1"
|
|
66
|
+
}, meta.error || description));
|
|
57
67
|
};
|
|
58
68
|
|
|
59
69
|
SelectInput.propTypes = {
|
|
@@ -82,20 +92,37 @@ SelectInput.propTypes = {
|
|
|
82
92
|
*/
|
|
83
93
|
label: PropTypes.string,
|
|
84
94
|
|
|
95
|
+
/**
|
|
96
|
+
* The input field validator function
|
|
97
|
+
*/
|
|
98
|
+
validate: PropTypes.func,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The select input description
|
|
102
|
+
*/
|
|
103
|
+
description: PropTypes.string,
|
|
104
|
+
|
|
85
105
|
/**
|
|
86
106
|
* The options of the select input
|
|
87
107
|
*/
|
|
88
108
|
options: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
89
109
|
value: PropTypes.string,
|
|
90
|
-
label: PropTypes.string
|
|
110
|
+
label: PropTypes.string,
|
|
111
|
+
disabled: PropTypes.bool
|
|
91
112
|
})])),
|
|
92
113
|
|
|
93
114
|
/**
|
|
94
115
|
* Whether the select input should be disabled
|
|
95
116
|
*/
|
|
96
|
-
disabled: PropTypes.bool
|
|
117
|
+
disabled: PropTypes.bool,
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The color of the select input
|
|
121
|
+
*/
|
|
122
|
+
color: PropTypes.string
|
|
97
123
|
};
|
|
98
124
|
SelectInput.defaultProps = {
|
|
99
|
-
disabled: false
|
|
125
|
+
disabled: false,
|
|
126
|
+
color: 'background2'
|
|
100
127
|
};
|
|
101
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(--main1);
|
|
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
|
}
|
|
@@ -43,7 +43,7 @@ const TaskRecommendationInput = ({
|
|
|
43
43
|
}, /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
className: "v1 p-v task"
|
|
45
45
|
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
46
|
-
className: `uc mb-v ${isOptionSelected ?
|
|
46
|
+
className: `uc mb-v ${isOptionSelected ? styleNames.modifierActive : ''}`,
|
|
47
47
|
name: name
|
|
48
48
|
}, label), /*#__PURE__*/React.createElement("input", _extends({}, field, {
|
|
49
49
|
value: value,
|
|
@@ -21,10 +21,13 @@ const TextInput = ({
|
|
|
21
21
|
type,
|
|
22
22
|
name,
|
|
23
23
|
label,
|
|
24
|
+
color,
|
|
25
|
+
labelColor,
|
|
24
26
|
validate,
|
|
25
27
|
oneInputLabel,
|
|
26
28
|
description,
|
|
27
|
-
disabled
|
|
29
|
+
disabled,
|
|
30
|
+
placeholder // ...otherProps
|
|
28
31
|
|
|
29
32
|
}) => {
|
|
30
33
|
useLayoutEffect(() => {
|
|
@@ -36,17 +39,19 @@ const TextInput = ({
|
|
|
36
39
|
});
|
|
37
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
38
41
|
id: id,
|
|
39
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
42
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`].filter(e => e).join(' '),
|
|
40
43
|
style: style // {...otherProps}
|
|
41
44
|
|
|
42
45
|
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
43
|
-
className: [
|
|
44
|
-
name: name
|
|
46
|
+
className: [oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
|
|
47
|
+
name: name,
|
|
48
|
+
color: labelColor
|
|
45
49
|
}, label), /*#__PURE__*/React.createElement("input", _extends({
|
|
46
50
|
id: name,
|
|
47
|
-
className:
|
|
51
|
+
className: "input",
|
|
48
52
|
type: type,
|
|
49
|
-
disabled: disabled
|
|
53
|
+
disabled: disabled,
|
|
54
|
+
placeholder: placeholder
|
|
50
55
|
}, field)), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
|
|
51
56
|
isError: !!meta.error,
|
|
52
57
|
className: "v50 mt-v s-1"
|
|
@@ -79,6 +84,11 @@ TextInput.propTypes = {
|
|
|
79
84
|
*/
|
|
80
85
|
label: PropTypes.string.isRequired,
|
|
81
86
|
|
|
87
|
+
/**
|
|
88
|
+
* The input label color
|
|
89
|
+
*/
|
|
90
|
+
labelColor: PropTypes.string,
|
|
91
|
+
|
|
82
92
|
/**
|
|
83
93
|
* The type of the input (html)
|
|
84
94
|
*/
|
|
@@ -102,10 +112,21 @@ TextInput.propTypes = {
|
|
|
102
112
|
/**
|
|
103
113
|
* Whether the text input should be disabled
|
|
104
114
|
*/
|
|
105
|
-
disabled: PropTypes.bool
|
|
115
|
+
disabled: PropTypes.bool,
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The placeholder text for the input
|
|
119
|
+
*/
|
|
120
|
+
placeholder: PropTypes.string,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The text input color
|
|
124
|
+
*/
|
|
125
|
+
color: PropTypes.string
|
|
106
126
|
};
|
|
107
127
|
TextInput.defaultProps = {
|
|
108
128
|
type: 'text',
|
|
129
|
+
color: 'background2',
|
|
109
130
|
disabled: false
|
|
110
131
|
};
|
|
111
132
|
export default /*#__PURE__*/memo(TextInput);
|
|
@@ -9,17 +9,26 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
|
|
12
|
-
.input-label {
|
|
13
|
-
color: var(--main1);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
12
|
.input {
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
14
|
+
background: var(--light-y);
|
|
15
|
+
color: var(--on-y);
|
|
19
16
|
padding: $default-padding;
|
|
20
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
|
+
|
|
21
30
|
&:focus {
|
|
22
|
-
background: var(--
|
|
31
|
+
background: var(--light-background4);
|
|
23
32
|
}
|
|
24
33
|
}
|
|
25
34
|
}
|
|
@@ -27,7 +27,8 @@ const TextareaInput = ({
|
|
|
27
27
|
textAreaColor,
|
|
28
28
|
labelColor,
|
|
29
29
|
description,
|
|
30
|
-
disabled
|
|
30
|
+
disabled,
|
|
31
|
+
placeholder // ...otherProps
|
|
31
32
|
|
|
32
33
|
}) => {
|
|
33
34
|
useLayoutEffect(() => {
|
|
@@ -39,16 +40,18 @@ const TextareaInput = ({
|
|
|
39
40
|
});
|
|
40
41
|
return /*#__PURE__*/React.createElement("div", {
|
|
41
42
|
id: id,
|
|
42
|
-
className: [baseClassName, componentClassName, userClassName, `
|
|
43
|
+
className: [baseClassName, componentClassName, userClassName, `y-${textAreaColor}`].filter(e => e).join(' '),
|
|
43
44
|
style: style // {...otherProps}
|
|
44
45
|
|
|
45
46
|
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
46
|
-
className: [
|
|
47
|
-
name: name
|
|
47
|
+
className: [labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
|
|
48
|
+
name: name,
|
|
49
|
+
color: labelColor
|
|
48
50
|
}, label), /*#__PURE__*/React.createElement("textarea", _extends({
|
|
49
51
|
id: textAreaId,
|
|
50
|
-
className:
|
|
52
|
+
className: "textarea"
|
|
51
53
|
}, field, {
|
|
54
|
+
placeholder: placeholder,
|
|
52
55
|
rows: rows,
|
|
53
56
|
disabled: disabled
|
|
54
57
|
})), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
|
|
@@ -121,12 +124,16 @@ TextareaInput.propTypes = {
|
|
|
121
124
|
/**
|
|
122
125
|
* Whether the text area should be disabled
|
|
123
126
|
*/
|
|
124
|
-
disabled: PropTypes.bool
|
|
127
|
+
disabled: PropTypes.bool,
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The textarea placeholder text
|
|
131
|
+
*/
|
|
132
|
+
placeholder: PropTypes.string
|
|
125
133
|
};
|
|
126
134
|
TextareaInput.defaultProps = {
|
|
127
135
|
rows: 3,
|
|
128
|
-
textAreaColor: '
|
|
129
|
-
labelColor: 'main1',
|
|
136
|
+
textAreaColor: 'background2',
|
|
130
137
|
disabled: false
|
|
131
138
|
};
|
|
132
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/dist/es/form.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use "form-reset.scss";
|
|
2
2
|
|
|
3
|
-
$form-input-border-bottom: 1px solid var(--dark-
|
|
3
|
+
$form-input-border-bottom: 1px solid var(--dark-background1);
|
|
4
4
|
$form-input-on-focus-border-bottom: 1px solid var(--light-main1);
|
|
5
5
|
$form-input-on-error-border-bottom: 1px solid var(--error);
|
|
6
6
|
$label-input-heigth-width: 100%;
|
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,9 +79,9 @@
|
|
|
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
|
-
"@pareto-engineering/styles": "^2.0.0-alpha.
|
|
84
|
+
"@pareto-engineering/styles": "^2.0.0-alpha.8",
|
|
85
85
|
"date-fns": "^2.22.1",
|
|
86
86
|
"formik": "^2.2.9",
|
|
87
87
|
"hamburgers": "^1.1.3",
|