ferns-ui 1.7.0 → 1.8.0

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.
Files changed (42) hide show
  1. package/dist/Common.d.ts +42 -0
  2. package/dist/DateTimeField.test.js +5 -9
  3. package/dist/DateTimeField.test.js.map +1 -1
  4. package/dist/Icon.js +2 -1
  5. package/dist/Icon.js.map +1 -1
  6. package/dist/Modal.js +21 -6
  7. package/dist/Modal.js.map +1 -1
  8. package/dist/SelectBadge.d.ts +3 -0
  9. package/dist/SelectBadge.js +180 -0
  10. package/dist/SelectBadge.js.map +1 -0
  11. package/dist/TextArea.test.d.ts +1 -0
  12. package/dist/TextArea.test.js +146 -0
  13. package/dist/TextArea.test.js.map +1 -0
  14. package/dist/TextField.test.d.ts +1 -0
  15. package/dist/TextField.test.js +251 -0
  16. package/dist/TextField.test.js.map +1 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +1 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/test-utils.d.ts +97 -0
  21. package/dist/test-utils.js +23 -0
  22. package/dist/test-utils.js.map +1 -0
  23. package/dist/useStoredState.d.ts +1 -1
  24. package/dist/useStoredState.js +19 -4
  25. package/dist/useStoredState.js.map +1 -1
  26. package/dist/useStoredState.test.d.ts +1 -0
  27. package/dist/useStoredState.test.js +93 -0
  28. package/dist/useStoredState.test.js.map +1 -0
  29. package/package.json +1 -1
  30. package/src/Common.ts +43 -0
  31. package/src/DateTimeField.test.tsx +5 -10
  32. package/src/Icon.tsx +1 -1
  33. package/src/Modal.tsx +24 -6
  34. package/src/SelectBadge.tsx +279 -0
  35. package/src/TextArea.test.tsx +271 -0
  36. package/src/TextField.test.tsx +442 -0
  37. package/src/__snapshots__/TextArea.test.tsx.snap +424 -0
  38. package/src/__snapshots__/TextField.test.tsx.snap +481 -0
  39. package/src/index.tsx +1 -0
  40. package/src/test-utils.tsx +26 -0
  41. package/src/useStoredState.test.tsx +134 -0
  42. package/src/useStoredState.ts +21 -5
@@ -0,0 +1,424 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`TextArea snapshots should match snapshot when disabled 1`] = `
4
+ <View
5
+ style={
6
+ {
7
+ "flexDirection": "column",
8
+ "width": "100%",
9
+ }
10
+ }
11
+ >
12
+ <Text
13
+ style={
14
+ {
15
+ "color": "#1C1C1C",
16
+ "fontSize": 14,
17
+ "fontWeight": 600,
18
+ "lineHeight": 22.4,
19
+ }
20
+ }
21
+ >
22
+ Disabled TextArea
23
+ </Text>
24
+ <View
25
+ style={
26
+ {
27
+ "alignItems": "center",
28
+ "backgroundColor": "#D9D9D9",
29
+ "borderColor": "#4E4E4E",
30
+ "borderRadius": 4,
31
+ "borderWidth": 1,
32
+ "flexDirection": "row",
33
+ "overflow": "hidden",
34
+ "paddingHorizontal": 12,
35
+ "paddingVertical": 8,
36
+ }
37
+ }
38
+ >
39
+ <TextInput
40
+ accessibilityHint="Enter text here"
41
+ accessibilityState={
42
+ {
43
+ "disabled": true,
44
+ }
45
+ }
46
+ aria-label="Text input field"
47
+ autoCapitalize="sentences"
48
+ autoCorrect={true}
49
+ blurOnSubmit={true}
50
+ keyboardType="default"
51
+ multiline={true}
52
+ numberOfLines={1}
53
+ onBlur={[Function]}
54
+ onChangeText={[MockFunction]}
55
+ onContentSizeChange={[Function]}
56
+ onFocus={[Function]}
57
+ onSubmitEditing={[Function]}
58
+ placeholderTextColor="#686868"
59
+ readOnly={true}
60
+ secureTextEntry={false}
61
+ style={
62
+ {
63
+ "color": "#1C1C1C",
64
+ "flex": 1,
65
+ "fontFamily": "text",
66
+ "fontSize": 16,
67
+ "gap": 10,
68
+ "height": 40,
69
+ "paddingVertical": 0,
70
+ "width": "100%",
71
+ }
72
+ }
73
+ textContentType="none"
74
+ underlineColorAndroid="transparent"
75
+ value="disabled content"
76
+ />
77
+ </View>
78
+ </View>
79
+ `;
80
+
81
+ exports[`TextArea snapshots should match snapshot with all props 1`] = `
82
+ <View
83
+ style={
84
+ {
85
+ "flexDirection": "column",
86
+ "width": "100%",
87
+ }
88
+ }
89
+ >
90
+ <Text
91
+ style={
92
+ {
93
+ "color": "#1C1C1C",
94
+ "fontSize": 14,
95
+ "fontWeight": 600,
96
+ "lineHeight": 22.4,
97
+ }
98
+ }
99
+ >
100
+ Description
101
+ </Text>
102
+ <View
103
+ style={
104
+ {
105
+ "alignItems": "center",
106
+ "backgroundColor": "#FFFFFF",
107
+ "borderColor": "#9A9A9A",
108
+ "borderRadius": 4,
109
+ "borderWidth": 1,
110
+ "flexDirection": "row",
111
+ "overflow": "hidden",
112
+ "paddingHorizontal": 12,
113
+ "paddingVertical": 8,
114
+ }
115
+ }
116
+ >
117
+ <TextInput
118
+ accessibilityHint="Enter text here"
119
+ accessibilityState={
120
+ {
121
+ "disabled": false,
122
+ }
123
+ }
124
+ aria-label="Text input field"
125
+ autoCapitalize="sentences"
126
+ autoCorrect={true}
127
+ blurOnSubmit={true}
128
+ keyboardType="default"
129
+ multiline={true}
130
+ numberOfLines={5}
131
+ onBlur={[Function]}
132
+ onChangeText={[MockFunction]}
133
+ onContentSizeChange={[Function]}
134
+ onFocus={[Function]}
135
+ onSubmitEditing={[Function]}
136
+ placeholder="Enter description"
137
+ placeholderTextColor="#686868"
138
+ readOnly={false}
139
+ secureTextEntry={false}
140
+ style={
141
+ {
142
+ "color": "#1C1C1C",
143
+ "flex": 1,
144
+ "fontFamily": "text",
145
+ "fontSize": 16,
146
+ "gap": 10,
147
+ "height": 200,
148
+ "paddingVertical": 0,
149
+ "width": "100%",
150
+ }
151
+ }
152
+ textContentType="none"
153
+ underlineColorAndroid="transparent"
154
+ value="test content"
155
+ />
156
+ </View>
157
+ <View
158
+ style={
159
+ {
160
+ "marginTop": 2,
161
+ }
162
+ }
163
+ >
164
+ <Text
165
+ style={
166
+ {
167
+ "color": "#1C1C1C",
168
+ "fontSize": 12,
169
+ "lineHeight": 16,
170
+ }
171
+ }
172
+ >
173
+ Maximum 500 characters
174
+ </Text>
175
+ </View>
176
+ </View>
177
+ `;
178
+
179
+ exports[`TextArea snapshots should match snapshot with default props 1`] = `
180
+ <View
181
+ style={
182
+ {
183
+ "flexDirection": "column",
184
+ "width": "100%",
185
+ }
186
+ }
187
+ >
188
+ <View
189
+ style={
190
+ {
191
+ "alignItems": "center",
192
+ "backgroundColor": "#FFFFFF",
193
+ "borderColor": "#9A9A9A",
194
+ "borderRadius": 4,
195
+ "borderWidth": 1,
196
+ "flexDirection": "row",
197
+ "overflow": "hidden",
198
+ "paddingHorizontal": 12,
199
+ "paddingVertical": 8,
200
+ }
201
+ }
202
+ >
203
+ <TextInput
204
+ accessibilityHint="Enter text here"
205
+ accessibilityState={
206
+ {
207
+ "disabled": undefined,
208
+ }
209
+ }
210
+ aria-label="Text input field"
211
+ autoCapitalize="sentences"
212
+ autoCorrect={true}
213
+ blurOnSubmit={true}
214
+ keyboardType="default"
215
+ multiline={true}
216
+ numberOfLines={1}
217
+ onBlur={[Function]}
218
+ onChangeText={[MockFunction]}
219
+ onContentSizeChange={[Function]}
220
+ onFocus={[Function]}
221
+ onSubmitEditing={[Function]}
222
+ placeholderTextColor="#686868"
223
+ secureTextEntry={false}
224
+ style={
225
+ {
226
+ "color": "#1C1C1C",
227
+ "flex": 1,
228
+ "fontFamily": "text",
229
+ "fontSize": 16,
230
+ "gap": 10,
231
+ "height": 40,
232
+ "paddingVertical": 0,
233
+ "width": "100%",
234
+ }
235
+ }
236
+ textContentType="none"
237
+ underlineColorAndroid="transparent"
238
+ value="test content"
239
+ />
240
+ </View>
241
+ </View>
242
+ `;
243
+
244
+ exports[`TextArea snapshots should match snapshot with error state 1`] = `
245
+ <View
246
+ style={
247
+ {
248
+ "flexDirection": "column",
249
+ "width": "100%",
250
+ }
251
+ }
252
+ >
253
+ <Text
254
+ style={
255
+ {
256
+ "color": "#1C1C1C",
257
+ "fontSize": 14,
258
+ "fontWeight": 600,
259
+ "lineHeight": 22.4,
260
+ }
261
+ }
262
+ >
263
+ Error TextArea
264
+ </Text>
265
+ <View
266
+ style={
267
+ {
268
+ "alignItems": "center",
269
+ "flexDirection": "row",
270
+ "marginVertical": 2,
271
+ }
272
+ }
273
+ >
274
+ <View
275
+ style={
276
+ {
277
+ "marginLeft": 4,
278
+ }
279
+ }
280
+ >
281
+ <Text
282
+ style={
283
+ {
284
+ "color": "#BD1111",
285
+ "fontSize": 12,
286
+ }
287
+ }
288
+ >
289
+ This field is required
290
+ </Text>
291
+ </View>
292
+ </View>
293
+ <View
294
+ style={
295
+ {
296
+ "alignItems": "center",
297
+ "backgroundColor": "#FFFFFF",
298
+ "borderColor": "#D33232",
299
+ "borderRadius": 4,
300
+ "borderWidth": 1,
301
+ "flexDirection": "row",
302
+ "overflow": "hidden",
303
+ "paddingHorizontal": 12,
304
+ "paddingVertical": 8,
305
+ }
306
+ }
307
+ >
308
+ <TextInput
309
+ accessibilityHint="Enter text here"
310
+ accessibilityState={
311
+ {
312
+ "disabled": undefined,
313
+ }
314
+ }
315
+ aria-label="Text input field"
316
+ autoCapitalize="sentences"
317
+ autoCorrect={true}
318
+ blurOnSubmit={true}
319
+ keyboardType="default"
320
+ multiline={true}
321
+ numberOfLines={1}
322
+ onBlur={[Function]}
323
+ onChangeText={[MockFunction]}
324
+ onContentSizeChange={[Function]}
325
+ onFocus={[Function]}
326
+ onSubmitEditing={[Function]}
327
+ placeholderTextColor="#686868"
328
+ secureTextEntry={false}
329
+ style={
330
+ {
331
+ "color": "#1C1C1C",
332
+ "flex": 1,
333
+ "fontFamily": "text",
334
+ "fontSize": 16,
335
+ "gap": 10,
336
+ "height": 40,
337
+ "paddingVertical": 0,
338
+ "width": "100%",
339
+ }
340
+ }
341
+ textContentType="none"
342
+ underlineColorAndroid="transparent"
343
+ value=""
344
+ />
345
+ </View>
346
+ </View>
347
+ `;
348
+
349
+ exports[`TextArea snapshots should match snapshot with multiline content 1`] = `
350
+ <View
351
+ style={
352
+ {
353
+ "flexDirection": "column",
354
+ "width": "100%",
355
+ }
356
+ }
357
+ >
358
+ <Text
359
+ style={
360
+ {
361
+ "color": "#1C1C1C",
362
+ "fontSize": 14,
363
+ "fontWeight": 600,
364
+ "lineHeight": 22.4,
365
+ }
366
+ }
367
+ >
368
+ Multiline Content
369
+ </Text>
370
+ <View
371
+ style={
372
+ {
373
+ "alignItems": "center",
374
+ "backgroundColor": "#FFFFFF",
375
+ "borderColor": "#9A9A9A",
376
+ "borderRadius": 4,
377
+ "borderWidth": 1,
378
+ "flexDirection": "row",
379
+ "overflow": "hidden",
380
+ "paddingHorizontal": 12,
381
+ "paddingVertical": 8,
382
+ }
383
+ }
384
+ >
385
+ <TextInput
386
+ accessibilityHint="Enter text here"
387
+ accessibilityState={
388
+ {
389
+ "disabled": undefined,
390
+ }
391
+ }
392
+ aria-label="Text input field"
393
+ autoCapitalize="sentences"
394
+ autoCorrect={true}
395
+ blurOnSubmit={true}
396
+ keyboardType="default"
397
+ multiline={true}
398
+ numberOfLines={4}
399
+ onBlur={[Function]}
400
+ onChangeText={[MockFunction]}
401
+ onContentSizeChange={[Function]}
402
+ onFocus={[Function]}
403
+ onSubmitEditing={[Function]}
404
+ placeholderTextColor="#686868"
405
+ secureTextEntry={false}
406
+ style={
407
+ {
408
+ "color": "#1C1C1C",
409
+ "flex": 1,
410
+ "fontFamily": "text",
411
+ "fontSize": 16,
412
+ "gap": 10,
413
+ "height": 160,
414
+ "paddingVertical": 0,
415
+ "width": "100%",
416
+ }
417
+ }
418
+ textContentType="none"
419
+ underlineColorAndroid="transparent"
420
+ value="Line 1\\nLine 2\\nLine 3"
421
+ />
422
+ </View>
423
+ </View>
424
+ `;