@pareto-engineering/design-system 2.0.0-alpha.58 → 2.0.0-alpha.59
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/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +14 -3
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +1 -1
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +14 -3
- package/package.json +1 -1
- package/src/__snapshots__/Storyshots.test.js.snap +163 -1
- package/src/stories/f/TextareaInput.stories.jsx +18 -0
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +1 -1
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +9 -0
|
@@ -70,7 +70,7 @@ var ChoicesInput = _ref => {
|
|
|
70
70
|
}, options.map(choice => /*#__PURE__*/React.createElement(_common.Choice, _extends({
|
|
71
71
|
key: choice.value,
|
|
72
72
|
name: name,
|
|
73
|
-
id:
|
|
73
|
+
id: name,
|
|
74
74
|
multiple: multiple,
|
|
75
75
|
validate: validate,
|
|
76
76
|
disabled: disabled
|
|
@@ -45,7 +45,8 @@ var TextareaInput = _ref => {
|
|
|
45
45
|
description,
|
|
46
46
|
disabled,
|
|
47
47
|
placeholder,
|
|
48
|
-
autoComplete
|
|
48
|
+
autoComplete,
|
|
49
|
+
resize // ...otherProps
|
|
49
50
|
|
|
50
51
|
} = _ref;
|
|
51
52
|
(0, React.useLayoutEffect)(() => {
|
|
@@ -68,6 +69,9 @@ var TextareaInput = _ref => {
|
|
|
68
69
|
id: textAreaId,
|
|
69
70
|
className: "textarea"
|
|
70
71
|
}, field, {
|
|
72
|
+
style: {
|
|
73
|
+
resize
|
|
74
|
+
},
|
|
71
75
|
placeholder: placeholder,
|
|
72
76
|
rows: rows,
|
|
73
77
|
disabled: disabled,
|
|
@@ -153,12 +157,19 @@ TextareaInput.propTypes = {
|
|
|
153
157
|
/**
|
|
154
158
|
* The autoComplete value that the browser should watch for the input
|
|
155
159
|
*/
|
|
156
|
-
autoComplete: _propTypes.default.string
|
|
160
|
+
autoComplete: _propTypes.default.string,
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Whether to disable or allow only a certain method of resizing the area
|
|
164
|
+
* Textarea docs - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
|
165
|
+
*/
|
|
166
|
+
resize: _propTypes.default.string
|
|
157
167
|
};
|
|
158
168
|
TextareaInput.defaultProps = {
|
|
159
169
|
rows: 3,
|
|
160
170
|
textAreaColor: 'background2',
|
|
161
|
-
disabled: false
|
|
171
|
+
disabled: false,
|
|
172
|
+
resize: 'vertical'
|
|
162
173
|
};
|
|
163
174
|
|
|
164
175
|
var _default = /*#__PURE__*/(0, React.memo)(TextareaInput);
|
|
@@ -29,7 +29,8 @@ const TextareaInput = ({
|
|
|
29
29
|
description,
|
|
30
30
|
disabled,
|
|
31
31
|
placeholder,
|
|
32
|
-
autoComplete
|
|
32
|
+
autoComplete,
|
|
33
|
+
resize // ...otherProps
|
|
33
34
|
|
|
34
35
|
}) => {
|
|
35
36
|
useLayoutEffect(() => {
|
|
@@ -52,6 +53,9 @@ const TextareaInput = ({
|
|
|
52
53
|
id: textAreaId,
|
|
53
54
|
className: "textarea"
|
|
54
55
|
}, field, {
|
|
56
|
+
style: {
|
|
57
|
+
resize
|
|
58
|
+
},
|
|
55
59
|
placeholder: placeholder,
|
|
56
60
|
rows: rows,
|
|
57
61
|
disabled: disabled,
|
|
@@ -137,11 +141,18 @@ TextareaInput.propTypes = {
|
|
|
137
141
|
/**
|
|
138
142
|
* The autoComplete value that the browser should watch for the input
|
|
139
143
|
*/
|
|
140
|
-
autoComplete: PropTypes.string
|
|
144
|
+
autoComplete: PropTypes.string,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Whether to disable or allow only a certain method of resizing the area
|
|
148
|
+
* Textarea docs - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
|
149
|
+
*/
|
|
150
|
+
resize: PropTypes.string
|
|
141
151
|
};
|
|
142
152
|
TextareaInput.defaultProps = {
|
|
143
153
|
rows: 3,
|
|
144
154
|
textAreaColor: 'background2',
|
|
145
|
-
disabled: false
|
|
155
|
+
disabled: false,
|
|
156
|
+
resize: 'vertical'
|
|
146
157
|
};
|
|
147
158
|
export default /*#__PURE__*/memo(TextareaInput);
|
package/package.json
CHANGED
|
@@ -2950,7 +2950,7 @@ exports[`Storyshots a/Timestamp Distance Format 1`] = `
|
|
|
2950
2950
|
className="base timestamp"
|
|
2951
2951
|
onClick={[Function]}
|
|
2952
2952
|
>
|
|
2953
|
-
|
|
2953
|
+
9 days ago
|
|
2954
2954
|
</p>
|
|
2955
2955
|
`;
|
|
2956
2956
|
|
|
@@ -10587,6 +10587,11 @@ exports[`Storyshots f/FormInput Base 1`] = `
|
|
|
10587
10587
|
onBlur={[Function]}
|
|
10588
10588
|
onChange={[Function]}
|
|
10589
10589
|
rows={3}
|
|
10590
|
+
style={
|
|
10591
|
+
Object {
|
|
10592
|
+
"resize": "vertical",
|
|
10593
|
+
}
|
|
10594
|
+
}
|
|
10590
10595
|
/>
|
|
10591
10596
|
</div>
|
|
10592
10597
|
<div
|
|
@@ -10779,6 +10784,11 @@ exports[`Storyshots f/FormInput Disabled Form Input 1`] = `
|
|
|
10779
10784
|
onBlur={[Function]}
|
|
10780
10785
|
onChange={[Function]}
|
|
10781
10786
|
rows={3}
|
|
10787
|
+
style={
|
|
10788
|
+
Object {
|
|
10789
|
+
"resize": "vertical",
|
|
10790
|
+
}
|
|
10791
|
+
}
|
|
10782
10792
|
/>
|
|
10783
10793
|
</div>
|
|
10784
10794
|
<div
|
|
@@ -14011,6 +14021,55 @@ exports[`Storyshots f/fields/TextareaInput Base 1`] = `
|
|
|
14011
14021
|
onBlur={[Function]}
|
|
14012
14022
|
onChange={[Function]}
|
|
14013
14023
|
rows={3}
|
|
14024
|
+
style={
|
|
14025
|
+
Object {
|
|
14026
|
+
"resize": "vertical",
|
|
14027
|
+
}
|
|
14028
|
+
}
|
|
14029
|
+
value=""
|
|
14030
|
+
/>
|
|
14031
|
+
</div>
|
|
14032
|
+
<div
|
|
14033
|
+
className="debugger"
|
|
14034
|
+
>
|
|
14035
|
+
<button
|
|
14036
|
+
className="base button x-main2"
|
|
14037
|
+
onClick={[Function]}
|
|
14038
|
+
type="button"
|
|
14039
|
+
>
|
|
14040
|
+
Open FormDebugger
|
|
14041
|
+
</button>
|
|
14042
|
+
</div>
|
|
14043
|
+
</form>
|
|
14044
|
+
`;
|
|
14045
|
+
|
|
14046
|
+
exports[`Storyshots f/fields/TextareaInput Disable Resize 1`] = `
|
|
14047
|
+
<form
|
|
14048
|
+
action="#"
|
|
14049
|
+
onReset={[Function]}
|
|
14050
|
+
onSubmit={[Function]}
|
|
14051
|
+
>
|
|
14052
|
+
<div
|
|
14053
|
+
className="base text-area-input y-background2"
|
|
14054
|
+
>
|
|
14055
|
+
<label
|
|
14056
|
+
className="base label v50 mb-v x-main2"
|
|
14057
|
+
htmlFor="feedback"
|
|
14058
|
+
>
|
|
14059
|
+
What can we improve on?
|
|
14060
|
+
</label>
|
|
14061
|
+
<textarea
|
|
14062
|
+
className="textarea"
|
|
14063
|
+
disabled={false}
|
|
14064
|
+
name="feedback"
|
|
14065
|
+
onBlur={[Function]}
|
|
14066
|
+
onChange={[Function]}
|
|
14067
|
+
rows={3}
|
|
14068
|
+
style={
|
|
14069
|
+
Object {
|
|
14070
|
+
"resize": "none",
|
|
14071
|
+
}
|
|
14072
|
+
}
|
|
14014
14073
|
value=""
|
|
14015
14074
|
/>
|
|
14016
14075
|
</div>
|
|
@@ -14050,6 +14109,55 @@ exports[`Storyshots f/fields/TextareaInput Disabled 1`] = `
|
|
|
14050
14109
|
onBlur={[Function]}
|
|
14051
14110
|
onChange={[Function]}
|
|
14052
14111
|
rows={3}
|
|
14112
|
+
style={
|
|
14113
|
+
Object {
|
|
14114
|
+
"resize": "vertical",
|
|
14115
|
+
}
|
|
14116
|
+
}
|
|
14117
|
+
value=""
|
|
14118
|
+
/>
|
|
14119
|
+
</div>
|
|
14120
|
+
<div
|
|
14121
|
+
className="debugger"
|
|
14122
|
+
>
|
|
14123
|
+
<button
|
|
14124
|
+
className="base button x-main2"
|
|
14125
|
+
onClick={[Function]}
|
|
14126
|
+
type="button"
|
|
14127
|
+
>
|
|
14128
|
+
Open FormDebugger
|
|
14129
|
+
</button>
|
|
14130
|
+
</div>
|
|
14131
|
+
</form>
|
|
14132
|
+
`;
|
|
14133
|
+
|
|
14134
|
+
exports[`Storyshots f/fields/TextareaInput Horizontal Resize 1`] = `
|
|
14135
|
+
<form
|
|
14136
|
+
action="#"
|
|
14137
|
+
onReset={[Function]}
|
|
14138
|
+
onSubmit={[Function]}
|
|
14139
|
+
>
|
|
14140
|
+
<div
|
|
14141
|
+
className="base text-area-input y-background2"
|
|
14142
|
+
>
|
|
14143
|
+
<label
|
|
14144
|
+
className="base label v50 mb-v x-main2"
|
|
14145
|
+
htmlFor="feedback"
|
|
14146
|
+
>
|
|
14147
|
+
What can we improve on?
|
|
14148
|
+
</label>
|
|
14149
|
+
<textarea
|
|
14150
|
+
className="textarea"
|
|
14151
|
+
disabled={false}
|
|
14152
|
+
name="feedback"
|
|
14153
|
+
onBlur={[Function]}
|
|
14154
|
+
onChange={[Function]}
|
|
14155
|
+
rows={3}
|
|
14156
|
+
style={
|
|
14157
|
+
Object {
|
|
14158
|
+
"resize": "horizontal",
|
|
14159
|
+
}
|
|
14160
|
+
}
|
|
14053
14161
|
value=""
|
|
14054
14162
|
/>
|
|
14055
14163
|
</div>
|
|
@@ -14090,6 +14198,11 @@ exports[`Storyshots f/fields/TextareaInput Placeholder 1`] = `
|
|
|
14090
14198
|
onChange={[Function]}
|
|
14091
14199
|
placeholder="Type your feedback here..."
|
|
14092
14200
|
rows={3}
|
|
14201
|
+
style={
|
|
14202
|
+
Object {
|
|
14203
|
+
"resize": "vertical",
|
|
14204
|
+
}
|
|
14205
|
+
}
|
|
14093
14206
|
value=""
|
|
14094
14207
|
/>
|
|
14095
14208
|
</div>
|
|
@@ -14129,6 +14242,55 @@ exports[`Storyshots f/fields/TextareaInput Validation 1`] = `
|
|
|
14129
14242
|
onBlur={[Function]}
|
|
14130
14243
|
onChange={[Function]}
|
|
14131
14244
|
rows={3}
|
|
14245
|
+
style={
|
|
14246
|
+
Object {
|
|
14247
|
+
"resize": "vertical",
|
|
14248
|
+
}
|
|
14249
|
+
}
|
|
14250
|
+
value=""
|
|
14251
|
+
/>
|
|
14252
|
+
</div>
|
|
14253
|
+
<div
|
|
14254
|
+
className="debugger"
|
|
14255
|
+
>
|
|
14256
|
+
<button
|
|
14257
|
+
className="base button x-main2"
|
|
14258
|
+
onClick={[Function]}
|
|
14259
|
+
type="button"
|
|
14260
|
+
>
|
|
14261
|
+
Open FormDebugger
|
|
14262
|
+
</button>
|
|
14263
|
+
</div>
|
|
14264
|
+
</form>
|
|
14265
|
+
`;
|
|
14266
|
+
|
|
14267
|
+
exports[`Storyshots f/fields/TextareaInput Vertical Resize 1`] = `
|
|
14268
|
+
<form
|
|
14269
|
+
action="#"
|
|
14270
|
+
onReset={[Function]}
|
|
14271
|
+
onSubmit={[Function]}
|
|
14272
|
+
>
|
|
14273
|
+
<div
|
|
14274
|
+
className="base text-area-input y-background2"
|
|
14275
|
+
>
|
|
14276
|
+
<label
|
|
14277
|
+
className="base label v50 mb-v x-main2"
|
|
14278
|
+
htmlFor="feedback"
|
|
14279
|
+
>
|
|
14280
|
+
What can we improve on?
|
|
14281
|
+
</label>
|
|
14282
|
+
<textarea
|
|
14283
|
+
className="textarea"
|
|
14284
|
+
disabled={false}
|
|
14285
|
+
name="feedback"
|
|
14286
|
+
onBlur={[Function]}
|
|
14287
|
+
onChange={[Function]}
|
|
14288
|
+
rows={3}
|
|
14289
|
+
style={
|
|
14290
|
+
Object {
|
|
14291
|
+
"resize": "vertical",
|
|
14292
|
+
}
|
|
14293
|
+
}
|
|
14132
14294
|
value=""
|
|
14133
14295
|
/>
|
|
14134
14296
|
</div>
|
|
@@ -73,3 +73,21 @@ Disabled.args = {
|
|
|
73
73
|
...Base.args,
|
|
74
74
|
disabled:true,
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
export const VerticalResize = Template.bind({})
|
|
78
|
+
VerticalResize.args = {
|
|
79
|
+
...Base.args,
|
|
80
|
+
resize:'vertical',
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const HorizontalResize = Template.bind({})
|
|
84
|
+
HorizontalResize.args = {
|
|
85
|
+
...Base.args,
|
|
86
|
+
resize:'horizontal',
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const DisableResize = Template.bind({})
|
|
90
|
+
DisableResize.args = {
|
|
91
|
+
...Base.args,
|
|
92
|
+
resize:'none',
|
|
93
|
+
}
|
|
@@ -36,6 +36,7 @@ const TextareaInput = ({
|
|
|
36
36
|
disabled,
|
|
37
37
|
placeholder,
|
|
38
38
|
autoComplete,
|
|
39
|
+
resize,
|
|
39
40
|
// ...otherProps
|
|
40
41
|
}) => {
|
|
41
42
|
useLayoutEffect(() => {
|
|
@@ -73,6 +74,7 @@ const TextareaInput = ({
|
|
|
73
74
|
id={textAreaId}
|
|
74
75
|
className="textarea"
|
|
75
76
|
{...field}
|
|
77
|
+
style={{ resize }}
|
|
76
78
|
placeholder={placeholder}
|
|
77
79
|
rows={rows}
|
|
78
80
|
disabled={disabled}
|
|
@@ -160,12 +162,19 @@ TextareaInput.propTypes = {
|
|
|
160
162
|
* The autoComplete value that the browser should watch for the input
|
|
161
163
|
*/
|
|
162
164
|
autoComplete:PropTypes.string,
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Whether to disable or allow only a certain method of resizing the area
|
|
168
|
+
* Textarea docs - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
|
|
169
|
+
*/
|
|
170
|
+
resize:PropTypes.string,
|
|
163
171
|
}
|
|
164
172
|
|
|
165
173
|
TextareaInput.defaultProps = {
|
|
166
174
|
rows :3,
|
|
167
175
|
textAreaColor:'background2',
|
|
168
176
|
disabled :false,
|
|
177
|
+
resize :'vertical',
|
|
169
178
|
}
|
|
170
179
|
|
|
171
180
|
export default memo(TextareaInput)
|