@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
|
@@ -77,6 +77,7 @@ const Navigator = ({
|
|
|
77
77
|
setNextStepIndex(stepsForward)
|
|
78
78
|
}
|
|
79
79
|
}}
|
|
80
|
+
isCompact
|
|
80
81
|
>
|
|
81
82
|
Next
|
|
82
83
|
</Button>
|
|
@@ -140,8 +141,8 @@ Navigator.propTypes = {
|
|
|
140
141
|
|
|
141
142
|
Navigator.defaultProps = {
|
|
142
143
|
canMoveForward:true,
|
|
143
|
-
previousColor :'
|
|
144
|
-
nextColor :'
|
|
144
|
+
previousColor :'main2',
|
|
145
|
+
nextColor :'main2',
|
|
145
146
|
stepsForward :1,
|
|
146
147
|
stepsBackwards:1,
|
|
147
148
|
}
|
|
@@ -14,7 +14,7 @@ $class-navigator:navigator;
|
|
|
14
14
|
$default-sidebar-width:minmax(250px, 330px);
|
|
15
15
|
$default-border:none;//2px solid var(--grid);
|
|
16
16
|
$default-border-radius:var(--theme-border-radius);
|
|
17
|
-
$default-content-background:var(--
|
|
17
|
+
$default-content-background: var(--background1);
|
|
18
18
|
$default-padding:var(--u);
|
|
19
19
|
|
|
20
20
|
$mobile-content-margin:6em;
|
|
@@ -61,7 +61,6 @@ $mobile-content-margin:6em;
|
|
|
61
61
|
|
|
62
62
|
//.#{$class-main-container} {
|
|
63
63
|
main {
|
|
64
|
-
background: var(--dark-y);
|
|
65
64
|
overflow: hidden;
|
|
66
65
|
position: relative;
|
|
67
66
|
|
|
@@ -79,7 +78,7 @@ $mobile-content-margin:6em;
|
|
|
79
78
|
.#{bem.$element-content} {
|
|
80
79
|
background: $default-content-background;
|
|
81
80
|
|
|
82
|
-
border:
|
|
81
|
+
border: var(--theme-border);
|
|
83
82
|
border-radius: $default-border-radius;
|
|
84
83
|
max-width: 600px;
|
|
85
84
|
padding: $default-padding;
|
|
@@ -108,8 +107,9 @@ $mobile-content-margin:6em;
|
|
|
108
107
|
|
|
109
108
|
.#{$class-horizontal-menu} {
|
|
110
109
|
background: $default-content-background;
|
|
111
|
-
border-bottom:
|
|
110
|
+
border-bottom: var(--theme-border);
|
|
112
111
|
color: var(--heading);
|
|
112
|
+
z-index: 1;
|
|
113
113
|
|
|
114
114
|
.#{bem.$element-content} {
|
|
115
115
|
display: grid;
|
|
@@ -124,6 +124,11 @@ $mobile-content-margin:6em;
|
|
|
124
124
|
|
|
125
125
|
.left {
|
|
126
126
|
text-align: left;
|
|
127
|
+
|
|
128
|
+
.prev-button {
|
|
129
|
+
font-family: var(--theme-default-paragraph);
|
|
130
|
+
font-size: calc(var(--s2) * 1em);
|
|
131
|
+
}
|
|
127
132
|
}
|
|
128
133
|
|
|
129
134
|
.right {
|
|
@@ -210,6 +215,7 @@ $mobile-content-margin:6em;
|
|
|
210
215
|
|
|
211
216
|
.next {
|
|
212
217
|
flex-grow: 1;
|
|
218
|
+
justify-content: flex-end;
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
221
|
}
|
|
@@ -147,8 +147,8 @@ ChoicesInput.propTypes = {
|
|
|
147
147
|
ChoicesInput.defaultProps = {
|
|
148
148
|
gridColumnsMobile :2,
|
|
149
149
|
gridColumnsDesktop:3,
|
|
150
|
-
color :'
|
|
151
|
-
colorChecked :'
|
|
150
|
+
color :'background2',
|
|
151
|
+
colorChecked :'main2',
|
|
152
152
|
disabled :false,
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -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
|
}
|
|
@@ -128,8 +128,8 @@ Rating.propTypes = {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
Rating.defaultProps = {
|
|
131
|
-
activeBackgroundColor :'
|
|
132
|
-
inactiveBackgroundColor:'
|
|
131
|
+
activeBackgroundColor :'main1',
|
|
132
|
+
inactiveBackgroundColor:'background2',
|
|
133
133
|
showRatingValue :false,
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -26,7 +26,10 @@ const SelectInput = ({
|
|
|
26
26
|
style,
|
|
27
27
|
name,
|
|
28
28
|
label,
|
|
29
|
+
color,
|
|
29
30
|
options,
|
|
31
|
+
validate,
|
|
32
|
+
description,
|
|
30
33
|
disabled,
|
|
31
34
|
// ...otherProps
|
|
32
35
|
}) => {
|
|
@@ -34,7 +37,7 @@ const SelectInput = ({
|
|
|
34
37
|
import('./styles.scss')
|
|
35
38
|
}, [])
|
|
36
39
|
|
|
37
|
-
const [field, meta] = useField(name)
|
|
40
|
+
const [field, meta] = useField({ name, validate })
|
|
38
41
|
|
|
39
42
|
return (
|
|
40
43
|
<div
|
|
@@ -45,6 +48,7 @@ const SelectInput = ({
|
|
|
45
48
|
|
|
46
49
|
componentClassName,
|
|
47
50
|
userClassName,
|
|
51
|
+
`y-${color}`,
|
|
48
52
|
]
|
|
49
53
|
.filter((e) => e)
|
|
50
54
|
.join(' ')}
|
|
@@ -52,18 +56,31 @@ const SelectInput = ({
|
|
|
52
56
|
// {...otherProps}
|
|
53
57
|
>
|
|
54
58
|
<FormLabel className="input-label" name={name}>{label}</FormLabel>
|
|
55
|
-
<select className="input
|
|
59
|
+
<select className="input" {...field} value={field.value || ''} id={name} disabled={disabled}>
|
|
56
60
|
{
|
|
57
61
|
options.map((option) => {
|
|
58
62
|
// i.e if option is a string like "blah", return { value: "blah", label: "blah" }
|
|
59
63
|
const newOption = typeof option === 'string' ? { value: option, label: option } : option
|
|
64
|
+
|
|
60
65
|
return (
|
|
61
|
-
<option
|
|
66
|
+
<option
|
|
67
|
+
key={newOption.value}
|
|
68
|
+
value={newOption.value}
|
|
69
|
+
disabled={newOption?.disabled || false}
|
|
70
|
+
selected={newOption?.disabled || true}
|
|
71
|
+
>
|
|
72
|
+
{newOption.label}
|
|
73
|
+
</option>
|
|
62
74
|
)
|
|
63
75
|
})
|
|
64
76
|
}
|
|
65
77
|
</select>
|
|
66
|
-
{
|
|
78
|
+
{(description || (meta.touched && meta.error))
|
|
79
|
+
&& (
|
|
80
|
+
<FormDescription isError={!!meta.error} className="v50 mt-v s-1">
|
|
81
|
+
{ meta.error || description }
|
|
82
|
+
</FormDescription>
|
|
83
|
+
)}
|
|
67
84
|
</div>
|
|
68
85
|
)
|
|
69
86
|
}
|
|
@@ -93,22 +110,44 @@ SelectInput.propTypes = {
|
|
|
93
110
|
*/
|
|
94
111
|
label:PropTypes.string,
|
|
95
112
|
|
|
113
|
+
/**
|
|
114
|
+
* The input field validator function
|
|
115
|
+
*/
|
|
116
|
+
validate:PropTypes.func,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The select input description
|
|
120
|
+
*/
|
|
121
|
+
description:PropTypes.string,
|
|
122
|
+
|
|
96
123
|
/**
|
|
97
124
|
* The options of the select input
|
|
98
125
|
*/
|
|
99
126
|
options:PropTypes.arrayOf(
|
|
100
127
|
PropTypes.oneOfType(
|
|
101
|
-
[
|
|
128
|
+
[
|
|
129
|
+
PropTypes.string,
|
|
130
|
+
PropTypes.shape({
|
|
131
|
+
value :PropTypes.string,
|
|
132
|
+
label :PropTypes.string,
|
|
133
|
+
disabled:PropTypes.bool,
|
|
134
|
+
})],
|
|
102
135
|
),
|
|
103
136
|
),
|
|
104
137
|
/**
|
|
105
138
|
* Whether the select input should be disabled
|
|
106
139
|
*/
|
|
107
140
|
disabled:PropTypes.bool,
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The color of the select input
|
|
144
|
+
*/
|
|
145
|
+
color:PropTypes.string,
|
|
108
146
|
}
|
|
109
147
|
|
|
110
148
|
SelectInput.defaultProps = {
|
|
111
149
|
disabled:false,
|
|
150
|
+
color :'background2',
|
|
112
151
|
}
|
|
113
152
|
|
|
114
153
|
export default 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
|
}
|
|
@@ -27,10 +27,13 @@ const TextInput = ({
|
|
|
27
27
|
type,
|
|
28
28
|
name,
|
|
29
29
|
label,
|
|
30
|
+
color,
|
|
31
|
+
labelColor,
|
|
30
32
|
validate,
|
|
31
33
|
oneInputLabel,
|
|
32
34
|
description,
|
|
33
35
|
disabled,
|
|
36
|
+
placeholder,
|
|
34
37
|
// ...otherProps
|
|
35
38
|
}) => {
|
|
36
39
|
useLayoutEffect(() => {
|
|
@@ -46,6 +49,7 @@ const TextInput = ({
|
|
|
46
49
|
baseClassName,
|
|
47
50
|
componentClassName,
|
|
48
51
|
userClassName,
|
|
52
|
+
`y-${color}`,
|
|
49
53
|
]
|
|
50
54
|
.filter((e) => e)
|
|
51
55
|
.join(' ')}
|
|
@@ -53,19 +57,20 @@ const TextInput = ({
|
|
|
53
57
|
// {...otherProps}
|
|
54
58
|
>
|
|
55
59
|
<FormLabel
|
|
56
|
-
className={[
|
|
57
|
-
'input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
|
|
60
|
+
className={[oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
|
|
58
61
|
.filter((e) => e)
|
|
59
62
|
.join(' ')}
|
|
60
63
|
name={name}
|
|
64
|
+
color={labelColor}
|
|
61
65
|
>
|
|
62
66
|
{ label }
|
|
63
67
|
</FormLabel>
|
|
64
68
|
<input
|
|
65
69
|
id={name}
|
|
66
|
-
className=
|
|
70
|
+
className="input"
|
|
67
71
|
type={type}
|
|
68
72
|
disabled={disabled}
|
|
73
|
+
placeholder={placeholder}
|
|
69
74
|
{...field}
|
|
70
75
|
/>
|
|
71
76
|
{(description || (meta.touched && meta.error))
|
|
@@ -104,6 +109,11 @@ TextInput.propTypes = {
|
|
|
104
109
|
*/
|
|
105
110
|
label:PropTypes.string.isRequired,
|
|
106
111
|
|
|
112
|
+
/**
|
|
113
|
+
* The input label color
|
|
114
|
+
*/
|
|
115
|
+
labelColor:PropTypes.string,
|
|
116
|
+
|
|
107
117
|
/**
|
|
108
118
|
* The type of the input (html)
|
|
109
119
|
*/
|
|
@@ -136,10 +146,21 @@ TextInput.propTypes = {
|
|
|
136
146
|
* Whether the text input should be disabled
|
|
137
147
|
*/
|
|
138
148
|
disabled :PropTypes.bool,
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The placeholder text for the input
|
|
152
|
+
*/
|
|
153
|
+
placeholder:PropTypes.string,
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The text input color
|
|
157
|
+
*/
|
|
158
|
+
color:PropTypes.string,
|
|
139
159
|
}
|
|
140
160
|
|
|
141
161
|
TextInput.defaultProps = {
|
|
142
162
|
type :'text',
|
|
163
|
+
color :'background2',
|
|
143
164
|
disabled:false,
|
|
144
165
|
}
|
|
145
166
|
|
|
@@ -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
|
}
|
|
@@ -34,6 +34,7 @@ const TextareaInput = ({
|
|
|
34
34
|
labelColor,
|
|
35
35
|
description,
|
|
36
36
|
disabled,
|
|
37
|
+
placeholder,
|
|
37
38
|
// ...otherProps
|
|
38
39
|
}) => {
|
|
39
40
|
useLayoutEffect(() => {
|
|
@@ -51,8 +52,7 @@ const TextareaInput = ({
|
|
|
51
52
|
|
|
52
53
|
componentClassName,
|
|
53
54
|
userClassName,
|
|
54
|
-
`
|
|
55
|
-
`y-${labelColor}`,
|
|
55
|
+
`y-${textAreaColor}`,
|
|
56
56
|
]
|
|
57
57
|
.filter((e) => e)
|
|
58
58
|
.join(' ')}
|
|
@@ -60,18 +60,19 @@ const TextareaInput = ({
|
|
|
60
60
|
// {...otherProps}
|
|
61
61
|
>
|
|
62
62
|
<FormLabel
|
|
63
|
-
className={[
|
|
64
|
-
'c-y', labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
|
|
63
|
+
className={[labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
|
|
65
64
|
.filter((e) => e)
|
|
66
65
|
.join(' ')}
|
|
67
66
|
name={name}
|
|
67
|
+
color={labelColor}
|
|
68
68
|
>
|
|
69
69
|
{ label }
|
|
70
70
|
</FormLabel>
|
|
71
71
|
<textarea
|
|
72
72
|
id={textAreaId}
|
|
73
|
-
className=
|
|
73
|
+
className="textarea"
|
|
74
74
|
{...field}
|
|
75
|
+
placeholder={placeholder}
|
|
75
76
|
rows={rows}
|
|
76
77
|
disabled={disabled}
|
|
77
78
|
>
|
|
@@ -123,36 +124,46 @@ TextareaInput.propTypes = {
|
|
|
123
124
|
* If the text area depends on it's label's text as the default description
|
|
124
125
|
*/
|
|
125
126
|
labelAsDescription:PropTypes.bool,
|
|
127
|
+
|
|
126
128
|
/**
|
|
127
129
|
* The textarea id
|
|
128
130
|
*/
|
|
129
|
-
textAreaId
|
|
131
|
+
textAreaId:PropTypes.string,
|
|
132
|
+
|
|
130
133
|
/**
|
|
131
134
|
* The number of rows int the text area
|
|
132
135
|
*/
|
|
133
|
-
rows
|
|
136
|
+
rows:PropTypes.number,
|
|
137
|
+
|
|
134
138
|
/**
|
|
135
139
|
* Text area base color
|
|
136
140
|
*/
|
|
137
|
-
textAreaColor
|
|
141
|
+
textAreaColor:PropTypes.string,
|
|
142
|
+
|
|
138
143
|
/**
|
|
139
144
|
* Label base color
|
|
140
145
|
*/
|
|
141
|
-
labelColor
|
|
146
|
+
labelColor:PropTypes.string,
|
|
147
|
+
|
|
142
148
|
/**
|
|
143
149
|
* Text area description
|
|
144
150
|
*/
|
|
145
|
-
description
|
|
151
|
+
description:PropTypes.string,
|
|
152
|
+
|
|
146
153
|
/**
|
|
147
154
|
* Whether the text area should be disabled
|
|
148
155
|
*/
|
|
149
|
-
disabled
|
|
156
|
+
disabled:PropTypes.bool,
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The textarea placeholder text
|
|
160
|
+
*/
|
|
161
|
+
placeholder:PropTypes.string,
|
|
150
162
|
}
|
|
151
163
|
|
|
152
164
|
TextareaInput.defaultProps = {
|
|
153
165
|
rows :3,
|
|
154
|
-
textAreaColor:'
|
|
155
|
-
labelColor :'main1',
|
|
166
|
+
textAreaColor:'background2',
|
|
156
167
|
disabled :false,
|
|
157
168
|
}
|
|
158
169
|
|
|
@@ -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
|
+
}
|
package/src/ui/f/fields/index.js
CHANGED
|
@@ -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/src/ui/form-reset.scss
CHANGED
package/src/ui/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%;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import { Formik, Form } from 'formik'
|
|
4
|
-
|
|
5
|
-
import { CheckboxInput, FormDebugger } from 'ui'
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title :'f/fields/CheckboxInput',
|
|
9
|
-
component :CheckboxInput,
|
|
10
|
-
subcomponents:{
|
|
11
|
-
// Item:CheckboxInput.Item
|
|
12
|
-
},
|
|
13
|
-
decorators:[
|
|
14
|
-
(storyfn) => (
|
|
15
|
-
<Formik
|
|
16
|
-
initialValues={{ businessTypes: [] }}
|
|
17
|
-
>
|
|
18
|
-
<Form>
|
|
19
|
-
{ storyfn() }
|
|
20
|
-
</Form>
|
|
21
|
-
</Formik>
|
|
22
|
-
),
|
|
23
|
-
],
|
|
24
|
-
argTypes:{
|
|
25
|
-
backgroundColor:{ control: 'color' },
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const Base = () => (
|
|
30
|
-
<div className="y-background b-y">
|
|
31
|
-
<CheckboxInput value="Business to customer" name="businessTypes">Business to customer</CheckboxInput>
|
|
32
|
-
<CheckboxInput value="Business to business" name="businessTypes">Business to business</CheckboxInput>
|
|
33
|
-
<CheckboxInput value="E-commerce" name="businessTypes">E-commerce</CheckboxInput>
|
|
34
|
-
<CheckboxInput value="Marketplace" name="businessTypes">Marketplace</CheckboxInput>
|
|
35
|
-
<FormDebugger />
|
|
36
|
-
</div>
|
|
37
|
-
)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import { Formik, Form } from 'formik'
|
|
4
|
-
|
|
5
|
-
import { RadioInput, FormDebugger } from 'ui'
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title :'f/fields/RadioInput',
|
|
9
|
-
component :RadioInput,
|
|
10
|
-
subcomponents:{
|
|
11
|
-
// Item:RadioInput.Item
|
|
12
|
-
},
|
|
13
|
-
decorators:[
|
|
14
|
-
(storyfn) => (
|
|
15
|
-
<Formik
|
|
16
|
-
initialValues={{ companySize: '' }}
|
|
17
|
-
>
|
|
18
|
-
<Form>
|
|
19
|
-
{ storyfn() }
|
|
20
|
-
</Form>
|
|
21
|
-
</Formik>
|
|
22
|
-
),
|
|
23
|
-
],
|
|
24
|
-
argTypes:{
|
|
25
|
-
backgroundColor:{ control: 'color' },
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const Base = () => (
|
|
30
|
-
<>
|
|
31
|
-
<RadioInput value="1-3" name="companySize">1-3</RadioInput>
|
|
32
|
-
<RadioInput value="4-7" name="companySize">4-7</RadioInput>
|
|
33
|
-
<RadioInput value="8-10" name="companySize">8-10</RadioInput>
|
|
34
|
-
<RadioInput value="11-20" name="companySize">11-20</RadioInput>
|
|
35
|
-
<FormDebugger />
|
|
36
|
-
</>
|
|
37
|
-
)
|