@pareto-engineering/design-system 2.0.0-alpha.13 → 2.0.0-alpha.17
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/BackgroundGradient/styles.scss +2 -2
- 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 +139 -32
- package/dist/cjs/b/Button/styles.scss +43 -18
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
- package/dist/cjs/f/common/Label/Label.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +25 -6
- package/dist/cjs/f/fields/SelectInput/styles.scss +4 -4
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/cjs/f/fields/TextInput/TextInput.js +18 -4
- package/dist/cjs/f/fields/TextInput/styles.scss +4 -4
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +1 -1
- package/dist/es/a/BackgroundGradient/styles.scss +2 -2
- 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 +139 -32
- package/dist/es/b/Button/styles.scss +43 -18
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/es/f/common/Debugger/Debugger.js +1 -1
- package/dist/es/f/common/Label/Label.js +1 -1
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/es/f/fields/SelectInput/SelectInput.js +25 -6
- package/dist/es/f/fields/SelectInput/styles.scss +4 -4
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/es/f/fields/TextInput/TextInput.js +18 -4
- package/dist/es/f/fields/TextInput/styles.scss +4 -4
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +1 -1
- package/package.json +2 -2
- package/src/__snapshots__/Storyshots.test.js.snap +401 -91
- package/src/local.scss +1 -0
- package/src/stories/a/BackgroundGradient.stories.jsx +2 -3
- package/src/stories/a/Conversation.stories.jsx +78 -1
- package/src/stories/b/Button.stories.jsx +5 -4
- package/src/stories/f/SelectInput.stories.jsx +29 -0
- package/src/stories/f/TextInput.stories.jsx +10 -0
- package/src/ui/a/BackgroundGradient/styles.scss +2 -2
- 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 +139 -32
- package/src/ui/b/Button/Button.jsx +2 -1
- package/src/ui/b/Button/styles.scss +43 -18
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
- package/src/ui/f/common/Debugger/Debugger.jsx +1 -1
- package/src/ui/f/common/Label/Label.jsx +1 -1
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +1 -1
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +35 -5
- package/src/ui/f/fields/SelectInput/styles.scss +4 -4
- package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +1 -1
- package/src/ui/f/fields/TextInput/TextInput.jsx +14 -0
- package/src/ui/f/fields/TextInput/styles.scss +4 -4
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +1 -1
|
@@ -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
|
}
|
|
@@ -27,6 +27,8 @@ const SelectInput = ({
|
|
|
27
27
|
name,
|
|
28
28
|
label,
|
|
29
29
|
options,
|
|
30
|
+
validate,
|
|
31
|
+
description,
|
|
30
32
|
disabled,
|
|
31
33
|
// ...otherProps
|
|
32
34
|
}) => {
|
|
@@ -34,7 +36,7 @@ const SelectInput = ({
|
|
|
34
36
|
import('./styles.scss')
|
|
35
37
|
}, [])
|
|
36
38
|
|
|
37
|
-
const [field, meta] = useField(name)
|
|
39
|
+
const [field, meta] = useField({ name, validate })
|
|
38
40
|
|
|
39
41
|
return (
|
|
40
42
|
<div
|
|
@@ -52,18 +54,30 @@ const SelectInput = ({
|
|
|
52
54
|
// {...otherProps}
|
|
53
55
|
>
|
|
54
56
|
<FormLabel className="input-label" name={name}>{label}</FormLabel>
|
|
55
|
-
<select className="input v25 pv-v" {...field} id={name} disabled={disabled}>
|
|
57
|
+
<select className="input v25 pv-v" {...field} value={field.value || ''} id={name} disabled={disabled}>
|
|
56
58
|
{
|
|
57
59
|
options.map((option) => {
|
|
58
60
|
// i.e if option is a string like "blah", return { value: "blah", label: "blah" }
|
|
59
61
|
const newOption = typeof option === 'string' ? { value: option, label: option } : option
|
|
62
|
+
|
|
60
63
|
return (
|
|
61
|
-
<option
|
|
64
|
+
<option
|
|
65
|
+
key={newOption.value}
|
|
66
|
+
value={newOption.value}
|
|
67
|
+
disabled={newOption?.disabled || false}
|
|
68
|
+
>
|
|
69
|
+
{newOption.label}
|
|
70
|
+
</option>
|
|
62
71
|
)
|
|
63
72
|
})
|
|
64
73
|
}
|
|
65
74
|
</select>
|
|
66
|
-
{
|
|
75
|
+
{(description || (meta.touched && meta.error))
|
|
76
|
+
&& (
|
|
77
|
+
<FormDescription isError={!!meta.error} className="v50 mt-v s-1">
|
|
78
|
+
{ meta.error || description }
|
|
79
|
+
</FormDescription>
|
|
80
|
+
)}
|
|
67
81
|
</div>
|
|
68
82
|
)
|
|
69
83
|
}
|
|
@@ -93,12 +107,28 @@ SelectInput.propTypes = {
|
|
|
93
107
|
*/
|
|
94
108
|
label:PropTypes.string,
|
|
95
109
|
|
|
110
|
+
/**
|
|
111
|
+
* The input field validator function
|
|
112
|
+
*/
|
|
113
|
+
validate:PropTypes.func,
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The select input description
|
|
117
|
+
*/
|
|
118
|
+
description:PropTypes.string,
|
|
119
|
+
|
|
96
120
|
/**
|
|
97
121
|
* The options of the select input
|
|
98
122
|
*/
|
|
99
123
|
options:PropTypes.arrayOf(
|
|
100
124
|
PropTypes.oneOfType(
|
|
101
|
-
[
|
|
125
|
+
[
|
|
126
|
+
PropTypes.string,
|
|
127
|
+
PropTypes.shape({
|
|
128
|
+
value :PropTypes.string,
|
|
129
|
+
label :PropTypes.string,
|
|
130
|
+
disabled:PropTypes.bool,
|
|
131
|
+
})],
|
|
102
132
|
),
|
|
103
133
|
),
|
|
104
134
|
/**
|
|
@@ -14,16 +14,16 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
.input-label {
|
|
17
|
-
color: var(--
|
|
17
|
+
color: var(--main2);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.input {
|
|
21
|
-
background: var(--light-
|
|
22
|
-
color: var(--on-
|
|
21
|
+
background: var(--light-background2);
|
|
22
|
+
color: var(--on-background2);
|
|
23
23
|
padding: $default-padding;
|
|
24
24
|
|
|
25
25
|
&:focus {
|
|
26
|
-
background: var(--dark-
|
|
26
|
+
background: var(--dark-background2);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -27,10 +27,12 @@ const TextInput = ({
|
|
|
27
27
|
type,
|
|
28
28
|
name,
|
|
29
29
|
label,
|
|
30
|
+
labelColor,
|
|
30
31
|
validate,
|
|
31
32
|
oneInputLabel,
|
|
32
33
|
description,
|
|
33
34
|
disabled,
|
|
35
|
+
placeholder,
|
|
34
36
|
// ...otherProps
|
|
35
37
|
}) => {
|
|
36
38
|
useLayoutEffect(() => {
|
|
@@ -58,6 +60,7 @@ const TextInput = ({
|
|
|
58
60
|
.filter((e) => e)
|
|
59
61
|
.join(' ')}
|
|
60
62
|
name={name}
|
|
63
|
+
color={labelColor}
|
|
61
64
|
>
|
|
62
65
|
{ label }
|
|
63
66
|
</FormLabel>
|
|
@@ -66,6 +69,7 @@ const TextInput = ({
|
|
|
66
69
|
className={`input ${meta.touched && meta.error ? 'input-border-error' : 'input-border'}`}
|
|
67
70
|
type={type}
|
|
68
71
|
disabled={disabled}
|
|
72
|
+
placeholder={placeholder}
|
|
69
73
|
{...field}
|
|
70
74
|
/>
|
|
71
75
|
{(description || (meta.touched && meta.error))
|
|
@@ -104,6 +108,11 @@ TextInput.propTypes = {
|
|
|
104
108
|
*/
|
|
105
109
|
label:PropTypes.string.isRequired,
|
|
106
110
|
|
|
111
|
+
/**
|
|
112
|
+
* The input label color
|
|
113
|
+
*/
|
|
114
|
+
labelColor:PropTypes.string,
|
|
115
|
+
|
|
107
116
|
/**
|
|
108
117
|
* The type of the input (html)
|
|
109
118
|
*/
|
|
@@ -136,6 +145,11 @@ TextInput.propTypes = {
|
|
|
136
145
|
* Whether the text input should be disabled
|
|
137
146
|
*/
|
|
138
147
|
disabled :PropTypes.bool,
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The placeholder text for the input
|
|
151
|
+
*/
|
|
152
|
+
placeholder:PropTypes.string,
|
|
139
153
|
}
|
|
140
154
|
|
|
141
155
|
TextInput.defaultProps = {
|
|
@@ -10,16 +10,16 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
|
|
12
12
|
.input-label {
|
|
13
|
-
color: var(--
|
|
13
|
+
color: var(--main2);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.input {
|
|
17
|
-
background: var(--light-
|
|
18
|
-
color: var(--on-
|
|
17
|
+
background: var(--light-background2);
|
|
18
|
+
color: var(--on-background2);
|
|
19
19
|
padding: $default-padding;
|
|
20
20
|
|
|
21
21
|
&:focus {
|
|
22
|
-
background: var(--dark-
|
|
22
|
+
background: var(--dark-background2);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|