@xhsreds/reds-rn-next 0.1.2 → 0.1.3

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 (196) hide show
  1. package/benchmarks/out.json +900 -820
  2. package/coverage/.tmp/coverage-0.json +1 -1
  3. package/coverage/.tmp/coverage-1.json +1 -1
  4. package/coverage/.tmp/coverage-10.json +1 -1
  5. package/coverage/.tmp/coverage-11.json +1 -1
  6. package/coverage/.tmp/coverage-12.json +1 -1
  7. package/coverage/.tmp/coverage-13.json +1 -1
  8. package/coverage/.tmp/coverage-14.json +1 -1
  9. package/coverage/.tmp/coverage-15.json +1 -1
  10. package/coverage/.tmp/coverage-16.json +1 -1
  11. package/coverage/.tmp/coverage-17.json +1 -1
  12. package/coverage/.tmp/coverage-18.json +1 -1
  13. package/coverage/.tmp/coverage-19.json +1 -1
  14. package/coverage/.tmp/coverage-2.json +1 -1
  15. package/coverage/.tmp/coverage-20.json +1 -1
  16. package/coverage/.tmp/coverage-21.json +1 -1
  17. package/coverage/.tmp/coverage-22.json +1 -1
  18. package/coverage/.tmp/coverage-23.json +1 -1
  19. package/coverage/.tmp/coverage-24.json +1 -1
  20. package/coverage/.tmp/coverage-25.json +1 -1
  21. package/coverage/.tmp/coverage-26.json +1 -1
  22. package/coverage/.tmp/coverage-27.json +1 -1
  23. package/coverage/.tmp/coverage-28.json +1 -1
  24. package/coverage/.tmp/coverage-29.json +1 -0
  25. package/coverage/.tmp/coverage-3.json +1 -1
  26. package/coverage/.tmp/coverage-30.json +1 -0
  27. package/coverage/.tmp/coverage-31.json +1 -0
  28. package/coverage/.tmp/coverage-4.json +1 -1
  29. package/coverage/.tmp/coverage-5.json +1 -1
  30. package/coverage/.tmp/coverage-6.json +1 -1
  31. package/coverage/.tmp/coverage-7.json +1 -1
  32. package/coverage/.tmp/coverage-8.json +1 -1
  33. package/coverage/.tmp/coverage-9.json +1 -1
  34. package/lib/cjs/_chunks/CkkZzOy_.js +23 -0
  35. package/lib/cjs/_chunks/CkkZzOy_.js.map +1 -0
  36. package/lib/cjs/_chunks/RPaDcSae.js +20 -0
  37. package/lib/cjs/_chunks/RPaDcSae.js.map +1 -0
  38. package/lib/cjs/_chunks/bwo-gq0b.js +66 -0
  39. package/lib/cjs/_chunks/bwo-gq0b.js.map +1 -0
  40. package/lib/cjs/components/ActionSheets/ActionSheets.js +99 -0
  41. package/lib/cjs/components/ActionSheets/ActionSheets.js.map +1 -0
  42. package/lib/cjs/components/ActionSheets/index.js +37 -0
  43. package/lib/cjs/components/ActionSheets/index.js.map +1 -0
  44. package/lib/cjs/components/ActionSheets/interface/index.js +9 -0
  45. package/lib/cjs/components/ActionSheets/interface/index.js.map +1 -0
  46. package/lib/cjs/components/ActionSheets/styles.js +59 -0
  47. package/lib/cjs/components/ActionSheets/styles.js.map +1 -0
  48. package/lib/cjs/components/AvatarGroup/AvatarGroup.js +10 -4
  49. package/lib/cjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
  50. package/lib/cjs/components/AvatarGroup/index.js +17 -11
  51. package/lib/cjs/components/AvatarGroup/index.js.map +1 -1
  52. package/lib/cjs/components/ImagePreview/ImagePreview.js +11 -5
  53. package/lib/cjs/components/ImagePreview/ImagePreview.js.map +1 -1
  54. package/lib/cjs/components/ImagePreview/index.js +18 -12
  55. package/lib/cjs/components/ImagePreview/index.js.map +1 -1
  56. package/lib/cjs/components/List/ListItem/ListItem.js +11 -5
  57. package/lib/cjs/components/List/ListItem/ListItem.js.map +1 -1
  58. package/lib/cjs/components/List/index.js +16 -10
  59. package/lib/cjs/components/List/index.js.map +1 -1
  60. package/lib/cjs/components/Picker/Picker.js +6 -1
  61. package/lib/cjs/components/Picker/Picker.js.map +1 -1
  62. package/lib/cjs/components/Picker/index.js +6 -1
  63. package/lib/cjs/components/Picker/index.js.map +1 -1
  64. package/lib/cjs/components/Sheets/Sheets.js +168 -16
  65. package/lib/cjs/components/Sheets/Sheets.js.map +1 -1
  66. package/lib/cjs/components/Sheets/index.js +9 -3
  67. package/lib/cjs/components/Sheets/index.js.map +1 -1
  68. package/lib/cjs/components/Sheets/interface/index.js +6 -1
  69. package/lib/cjs/components/Sheets/interface/index.js.map +1 -1
  70. package/lib/cjs/components/Sheets/styles.js +39 -11
  71. package/lib/cjs/components/Sheets/styles.js.map +1 -1
  72. package/lib/cjs/components/Silder/Silder.js +71 -0
  73. package/lib/cjs/components/Silder/Silder.js.map +1 -0
  74. package/lib/cjs/components/Silder/index.js +18 -0
  75. package/lib/cjs/components/Silder/index.js.map +1 -0
  76. package/lib/cjs/components/Silder/interface/index.js +9 -0
  77. package/lib/cjs/components/Silder/interface/index.js.map +1 -0
  78. package/lib/cjs/components/Silder/styles.js +29 -0
  79. package/lib/cjs/components/Silder/styles.js.map +1 -0
  80. package/lib/cjs/components/TabBar/TabBar.js +10 -10
  81. package/lib/cjs/components/TabBar/TabBar.js.map +1 -1
  82. package/lib/cjs/index.js +12 -2
  83. package/lib/cjs/index.js.map +1 -1
  84. package/lib/esm/_chunks/BJ2Kj1Vd.js +58 -0
  85. package/lib/esm/_chunks/BJ2Kj1Vd.js.map +1 -0
  86. package/lib/esm/_chunks/DHJk9lIr.js +19 -0
  87. package/lib/esm/_chunks/DHJk9lIr.js.map +1 -0
  88. package/lib/esm/_chunks/RRfNwNcs.js +17 -0
  89. package/lib/esm/_chunks/RRfNwNcs.js.map +1 -0
  90. package/lib/esm/components/ActionSheets/ActionSheets.js +95 -0
  91. package/lib/esm/components/ActionSheets/ActionSheets.js.map +1 -0
  92. package/lib/esm/components/ActionSheets/index.js +31 -0
  93. package/lib/esm/components/ActionSheets/index.js.map +1 -0
  94. package/lib/esm/components/ActionSheets/interface/index.js +2 -0
  95. package/lib/esm/components/ActionSheets/interface/index.js.map +1 -0
  96. package/lib/esm/components/ActionSheets/styles.js +55 -0
  97. package/lib/esm/components/ActionSheets/styles.js.map +1 -0
  98. package/lib/esm/components/AvatarGroup/AvatarGroup.js +10 -4
  99. package/lib/esm/components/AvatarGroup/AvatarGroup.js.map +1 -1
  100. package/lib/esm/components/AvatarGroup/index.js +17 -11
  101. package/lib/esm/components/AvatarGroup/index.js.map +1 -1
  102. package/lib/esm/components/ImagePreview/ImagePreview.js +11 -5
  103. package/lib/esm/components/ImagePreview/ImagePreview.js.map +1 -1
  104. package/lib/esm/components/ImagePreview/index.js +18 -12
  105. package/lib/esm/components/ImagePreview/index.js.map +1 -1
  106. package/lib/esm/components/List/ListItem/ListItem.js +11 -5
  107. package/lib/esm/components/List/ListItem/ListItem.js.map +1 -1
  108. package/lib/esm/components/List/index.js +16 -10
  109. package/lib/esm/components/List/index.js.map +1 -1
  110. package/lib/esm/components/Picker/Picker.js +6 -1
  111. package/lib/esm/components/Picker/Picker.js.map +1 -1
  112. package/lib/esm/components/Picker/index.js +6 -1
  113. package/lib/esm/components/Picker/index.js.map +1 -1
  114. package/lib/esm/components/Sheets/Sheets.js +170 -18
  115. package/lib/esm/components/Sheets/Sheets.js.map +1 -1
  116. package/lib/esm/components/Sheets/index.js +9 -3
  117. package/lib/esm/components/Sheets/index.js.map +1 -1
  118. package/lib/esm/components/Sheets/interface/index.js +1 -1
  119. package/lib/esm/components/Sheets/styles.js +39 -11
  120. package/lib/esm/components/Sheets/styles.js.map +1 -1
  121. package/lib/esm/components/Silder/Silder.js +67 -0
  122. package/lib/esm/components/Silder/Silder.js.map +1 -0
  123. package/lib/esm/components/Silder/index.js +12 -0
  124. package/lib/esm/components/Silder/index.js.map +1 -0
  125. package/lib/esm/components/Silder/interface/index.js +3 -0
  126. package/lib/esm/components/Silder/interface/index.js.map +1 -0
  127. package/lib/esm/components/Silder/styles.js +25 -0
  128. package/lib/esm/components/Silder/styles.js.map +1 -0
  129. package/lib/esm/components/TabBar/TabBar.js +10 -10
  130. package/lib/esm/components/TabBar/TabBar.js.map +1 -1
  131. package/lib/esm/index.js +8 -2
  132. package/lib/esm/index.js.map +1 -1
  133. package/lib/types/components/ActionSheets/ActionSheets.d.ts +10 -0
  134. package/lib/types/components/ActionSheets/demo/index.d.ts +2 -0
  135. package/lib/types/components/ActionSheets/index.d.ts +4 -0
  136. package/lib/types/components/ActionSheets/interface/index.d.ts +23 -0
  137. package/lib/types/components/ActionSheets/styles.d.ts +51 -0
  138. package/lib/types/components/ActionSheets/test/index.bench.d.ts +1 -0
  139. package/lib/types/components/ActionSheets/test/index.test.d.ts +1 -0
  140. package/lib/types/components/ActionSheets/test/paper.bench.d.ts +1 -0
  141. package/lib/types/components/FAB/test/paper.bench.d.ts +1 -0
  142. package/lib/types/components/Sheets/Sheets.d.ts +17 -1
  143. package/lib/types/components/Sheets/interface/index.d.ts +45 -0
  144. package/lib/types/components/Sheets/styles.d.ts +38 -9
  145. package/lib/types/components/Sheets/test/index.test.d.ts +1 -1
  146. package/lib/types/components/Silder/Silder.d.ts +13 -0
  147. package/lib/types/components/Silder/demo/index.d.ts +2 -0
  148. package/lib/types/components/Silder/index.d.ts +4 -0
  149. package/lib/types/components/Silder/interface/index.d.ts +19 -0
  150. package/lib/types/components/Silder/styles.d.ts +20 -0
  151. package/lib/types/components/Silder/test/index.bench.d.ts +1 -0
  152. package/lib/types/components/Silder/test/index.test.d.ts +1 -0
  153. package/lib/types/index.d.ts +2 -0
  154. package/package.json +2 -3
  155. package/src/components/ActionSheets/ActionSheets.tsx +66 -0
  156. package/src/components/ActionSheets/demo/index.tsx +65 -0
  157. package/src/components/ActionSheets/doc/index.mdx +24 -0
  158. package/src/components/ActionSheets/index.ts +5 -0
  159. package/src/components/ActionSheets/interface/index.ts +27 -0
  160. package/src/components/ActionSheets/styles.ts +54 -0
  161. package/src/components/ActionSheets/test/index.bench.tsx +13 -0
  162. package/src/components/ActionSheets/test/index.test.tsx +81 -0
  163. package/src/components/ActionSheets/test/paper.bench.tsx +17 -0
  164. package/src/components/Avatar/test/__snapshots__/index.test.tsx.snap +32 -0
  165. package/src/components/Avatar/test/paper.bench.tsx +1 -1
  166. package/src/components/Button/test/__snapshots__/index.test.tsx.snap +0 -10
  167. package/src/components/Divider/test/__snapshots__/index.test.tsx.snap +420 -6
  168. package/src/components/Divider/test/index.test.tsx +43 -35
  169. package/src/components/FAB/test/__snapshots__/index.test.tsx.snap +0 -2
  170. package/src/components/FAB/test/paper.bench.tsx +12 -0
  171. package/src/components/Picker/test/index.test.tsx +17 -25
  172. package/src/components/Progress/test/__snapshots__/index.test.tsx.snap +332 -3
  173. package/src/components/Progress/test/index.test.tsx +29 -19
  174. package/src/components/PullRefresh/test/index.bench.tsx +1 -1
  175. package/src/components/Sheets/Sheets.tsx +293 -20
  176. package/src/components/Sheets/demo/index.tsx +191 -14
  177. package/src/components/Sheets/doc/index.mdx +16 -5
  178. package/src/components/Sheets/interface/index.ts +50 -0
  179. package/src/components/Sheets/styles.ts +38 -10
  180. package/src/components/Sheets/test/index.test.tsx +71 -48
  181. package/src/components/Sheets/test/paper.bench.tsx +1 -1
  182. package/src/components/Silder/Silder.tsx +49 -0
  183. package/src/components/Silder/demo/index.tsx +53 -0
  184. package/src/components/Silder/doc/index.mdx +26 -0
  185. package/src/components/Silder/index.ts +5 -0
  186. package/src/components/Silder/interface/index.ts +20 -0
  187. package/src/components/Silder/styles.ts +24 -0
  188. package/src/components/Silder/test/index.bench.tsx +13 -0
  189. package/src/components/Silder/test/index.test.tsx +18 -0
  190. package/src/components/TabBar/TabBar.tsx +17 -17
  191. package/src/components/Toast/test/paper.bench.tsx +9 -5
  192. package/src/index.ts +2 -0
  193. package/lib/cjs/_chunks/DIhBCUjt.js +0 -17
  194. package/lib/cjs/_chunks/DIhBCUjt.js.map +0 -1
  195. package/lib/esm/_chunks/B3_9dzWY.js +0 -14
  196. package/lib/esm/_chunks/B3_9dzWY.js.map +0 -1
@@ -1,6 +1,101 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`Divider Component > applies custom styles based on size prop 1`] = `
4
+ <View
5
+ style={
6
+ [
7
+ {
8
+ "position": "relative",
9
+ },
10
+ {
11
+ "color": "rgba(0, 0, 0, 0.45)",
12
+ "fontSize": 12,
13
+ "fontWeight": "400",
14
+ },
15
+ ]
16
+ }
17
+ >
18
+ <View
19
+ style={
20
+ {
21
+ "alignItems": "center",
22
+ "alignSelf": "center",
23
+ "backgroundColor": "#fff",
24
+ "flexDirection": "row",
25
+ "left": undefined,
26
+ "lineHeight": 18,
27
+ "paddingHorizontal": 16,
28
+ "paddingVertical": 0,
29
+ "position": "absolute",
30
+ "right": undefined,
31
+ "top": 0,
32
+ }
33
+ }
34
+ >
35
+ <View
36
+ style={
37
+ {
38
+ "borderColor": "rgba(0, 0, 0, 0.2)",
39
+ "borderStyle": "solid",
40
+ "borderTopWidth": 0.5,
41
+ "marginRight": 8,
42
+ "width": 12,
43
+ }
44
+ }
45
+ />
46
+ <Text
47
+ style={
48
+ {
49
+ "color": "rgba(0, 0, 0, 0.45)",
50
+ "fontSize": 12,
51
+ "fontWeight": "400",
52
+ }
53
+ }
54
+ >
55
+ Divider
56
+ </Text>
57
+ <View
58
+ style={
59
+ {
60
+ "borderColor": "rgba(0, 0, 0, 0.2)",
61
+ "borderStyle": "solid",
62
+ "borderTopWidth": 0.5,
63
+ "marginLeft": 8,
64
+ "width": 12,
65
+ }
66
+ }
67
+ />
68
+ </View>
69
+ </View>
70
+ `;
71
+
72
+ exports[`Divider Component > applies the correct styles based on custom border number 1`] = `
73
+ <View
74
+ style={
75
+ [
76
+ {
77
+ "position": "relative",
78
+ },
79
+ undefined,
80
+ ]
81
+ }
82
+ />
83
+ `;
84
+
85
+ exports[`Divider Component > applies the correct styles based on custom margin 1`] = `
86
+ <View
87
+ style={
88
+ [
89
+ {
90
+ "position": "relative",
91
+ },
92
+ undefined,
93
+ ]
94
+ }
95
+ />
96
+ `;
97
+
98
+ exports[`Divider Component > applies the correct styles based on custom size 1`] = `
4
99
  <View
5
100
  style={
6
101
  [
@@ -33,7 +128,37 @@ exports[`Divider Component > applies the correct styles for direction 1`] = `
33
128
  },
34
129
  ]
35
130
  }
36
- />
131
+ >
132
+ <View
133
+ style={
134
+ {
135
+ "alignItems": "center",
136
+ "alignSelf": "center",
137
+ "backgroundColor": "#fff",
138
+ "flexDirection": "row",
139
+ "left": undefined,
140
+ "lineHeight": 18,
141
+ "paddingHorizontal": 16,
142
+ "paddingVertical": 0,
143
+ "position": "absolute",
144
+ "right": undefined,
145
+ "top": -9,
146
+ }
147
+ }
148
+ >
149
+ <Text
150
+ style={
151
+ {
152
+ "color": "rgba(0, 0, 0, 0.45)",
153
+ "fontSize": 12,
154
+ "fontWeight": "400",
155
+ }
156
+ }
157
+ >
158
+ Divider
159
+ </Text>
160
+ </View>
161
+ </View>
37
162
  `;
38
163
 
39
164
  exports[`Divider Component > applies the correct styles for direction 2`] = `
@@ -74,7 +199,59 @@ exports[`Divider Component > applies the correct styles for direction 3`] = `
74
199
  },
75
200
  ]
76
201
  }
77
- />
202
+ >
203
+ <View
204
+ style={
205
+ {
206
+ "alignItems": "center",
207
+ "alignSelf": "center",
208
+ "backgroundColor": "#fff",
209
+ "flexDirection": "row",
210
+ "left": undefined,
211
+ "lineHeight": 18,
212
+ "paddingHorizontal": 16,
213
+ "paddingVertical": 0,
214
+ "position": "absolute",
215
+ "right": undefined,
216
+ "top": 0,
217
+ }
218
+ }
219
+ >
220
+ <View
221
+ style={
222
+ {
223
+ "borderColor": "rgba(0, 0, 0, 0.2)",
224
+ "borderStyle": "solid",
225
+ "borderTopWidth": 0.5,
226
+ "marginRight": 8,
227
+ "width": 12,
228
+ }
229
+ }
230
+ />
231
+ <Text
232
+ style={
233
+ {
234
+ "color": "rgba(0, 0, 0, 0.45)",
235
+ "fontSize": 12,
236
+ "fontWeight": "400",
237
+ }
238
+ }
239
+ >
240
+ Divider
241
+ </Text>
242
+ <View
243
+ style={
244
+ {
245
+ "borderColor": "rgba(0, 0, 0, 0.2)",
246
+ "borderStyle": "solid",
247
+ "borderTopWidth": 0.5,
248
+ "marginLeft": 8,
249
+ "width": 12,
250
+ }
251
+ }
252
+ />
253
+ </View>
254
+ </View>
78
255
  `;
79
256
 
80
257
  exports[`Divider Component > applies the correct styles for direction 4`] = `
@@ -91,7 +268,59 @@ exports[`Divider Component > applies the correct styles for direction 4`] = `
91
268
  },
92
269
  ]
93
270
  }
94
- />
271
+ >
272
+ <View
273
+ style={
274
+ {
275
+ "alignItems": "center",
276
+ "alignSelf": "center",
277
+ "backgroundColor": "#fff",
278
+ "flexDirection": "row",
279
+ "left": undefined,
280
+ "lineHeight": 18,
281
+ "paddingHorizontal": 16,
282
+ "paddingVertical": 0,
283
+ "position": "absolute",
284
+ "right": undefined,
285
+ "top": 0,
286
+ }
287
+ }
288
+ >
289
+ <View
290
+ style={
291
+ {
292
+ "borderColor": "rgba(51, 51, 51, .3)",
293
+ "borderStyle": "solid",
294
+ "borderTopWidth": 0.5,
295
+ "marginRight": 8,
296
+ "width": 12,
297
+ }
298
+ }
299
+ />
300
+ <Text
301
+ style={
302
+ {
303
+ "color": "rgba(51, 51, 51, .3)",
304
+ "fontSize": 12,
305
+ "fontWeight": "400",
306
+ }
307
+ }
308
+ >
309
+ Divider
310
+ </Text>
311
+ <View
312
+ style={
313
+ {
314
+ "borderColor": "rgba(51, 51, 51, .3)",
315
+ "borderStyle": "solid",
316
+ "borderTopWidth": 0.5,
317
+ "marginLeft": 8,
318
+ "width": 12,
319
+ }
320
+ }
321
+ />
322
+ </View>
323
+ </View>
95
324
  `;
96
325
 
97
326
  exports[`Divider Component > applies the correct styles for orientation 1`] = `
@@ -101,7 +330,11 @@ exports[`Divider Component > applies the correct styles for orientation 1`] = `
101
330
  {
102
331
  "position": "relative",
103
332
  },
104
- undefined,
333
+ {
334
+ "color": "rgba(0, 0, 0, 0.45)",
335
+ "fontSize": 12,
336
+ "fontWeight": "400",
337
+ },
105
338
  ]
106
339
  }
107
340
  >
@@ -122,6 +355,17 @@ exports[`Divider Component > applies the correct styles for orientation 1`] = `
122
355
  }
123
356
  }
124
357
  >
358
+ <View
359
+ style={
360
+ {
361
+ "borderColor": "rgba(0, 0, 0, 0.2)",
362
+ "borderStyle": "solid",
363
+ "borderTopWidth": 0.5,
364
+ "marginRight": 8,
365
+ "width": 12,
366
+ }
367
+ }
368
+ />
125
369
  <Text
126
370
  style={
127
371
  {
@@ -133,6 +377,17 @@ exports[`Divider Component > applies the correct styles for orientation 1`] = `
133
377
  >
134
378
  Divider
135
379
  </Text>
380
+ <View
381
+ style={
382
+ {
383
+ "borderColor": "rgba(0, 0, 0, 0.2)",
384
+ "borderStyle": "solid",
385
+ "borderTopWidth": 0.5,
386
+ "marginLeft": 8,
387
+ "width": 12,
388
+ }
389
+ }
390
+ />
136
391
  </View>
137
392
  </View>
138
393
  `;
@@ -144,7 +399,11 @@ exports[`Divider Component > applies the correct styles for orientation 2`] = `
144
399
  {
145
400
  "position": "relative",
146
401
  },
147
- undefined,
402
+ {
403
+ "color": "rgba(0, 0, 0, 0.45)",
404
+ "fontSize": 12,
405
+ "fontWeight": "400",
406
+ },
148
407
  ]
149
408
  }
150
409
  >
@@ -165,6 +424,17 @@ exports[`Divider Component > applies the correct styles for orientation 2`] = `
165
424
  }
166
425
  }
167
426
  >
427
+ <View
428
+ style={
429
+ {
430
+ "borderColor": "rgba(0, 0, 0, 0.2)",
431
+ "borderStyle": "solid",
432
+ "borderTopWidth": 0.5,
433
+ "marginRight": 8,
434
+ "width": 12,
435
+ }
436
+ }
437
+ />
168
438
  <Text
169
439
  style={
170
440
  {
@@ -176,6 +446,17 @@ exports[`Divider Component > applies the correct styles for orientation 2`] = `
176
446
  >
177
447
  Divider
178
448
  </Text>
449
+ <View
450
+ style={
451
+ {
452
+ "borderColor": "rgba(0, 0, 0, 0.2)",
453
+ "borderStyle": "solid",
454
+ "borderTopWidth": 0.5,
455
+ "marginLeft": 8,
456
+ "width": 12,
457
+ }
458
+ }
459
+ />
179
460
  </View>
180
461
  </View>
181
462
  `;
@@ -187,7 +468,11 @@ exports[`Divider Component > applies the correct styles for orientation 3`] = `
187
468
  {
188
469
  "position": "relative",
189
470
  },
190
- undefined,
471
+ {
472
+ "color": "rgba(0, 0, 0, 0.45)",
473
+ "fontSize": 12,
474
+ "fontWeight": "400",
475
+ },
191
476
  ]
192
477
  }
193
478
  >
@@ -208,6 +493,17 @@ exports[`Divider Component > applies the correct styles for orientation 3`] = `
208
493
  }
209
494
  }
210
495
  >
496
+ <View
497
+ style={
498
+ {
499
+ "borderColor": "rgba(0, 0, 0, 0.2)",
500
+ "borderStyle": "solid",
501
+ "borderTopWidth": 0.5,
502
+ "marginRight": 8,
503
+ "width": 12,
504
+ }
505
+ }
506
+ />
211
507
  <Text
212
508
  style={
213
509
  {
@@ -219,6 +515,124 @@ exports[`Divider Component > applies the correct styles for orientation 3`] = `
219
515
  >
220
516
  Divider
221
517
  </Text>
518
+ <View
519
+ style={
520
+ {
521
+ "borderColor": "rgba(0, 0, 0, 0.2)",
522
+ "borderStyle": "solid",
523
+ "borderTopWidth": 0.5,
524
+ "marginLeft": 8,
525
+ "width": 12,
526
+ }
527
+ }
528
+ />
222
529
  </View>
223
530
  </View>
224
531
  `;
532
+
533
+ exports[`Divider Component > renders correctly with custom color 1`] = `
534
+ <View
535
+ style={
536
+ [
537
+ {
538
+ "position": "relative",
539
+ },
540
+ undefined,
541
+ ]
542
+ }
543
+ />
544
+ `;
545
+
546
+ exports[`Divider Component > renders correctly with default props 1`] = `
547
+ <View
548
+ style={
549
+ [
550
+ {
551
+ "position": "relative",
552
+ },
553
+ undefined,
554
+ ]
555
+ }
556
+ />
557
+ `;
558
+
559
+ exports[`Divider Component > renders correctly with horizontal direction 1`] = `
560
+ <View
561
+ style={
562
+ [
563
+ {
564
+ "position": "relative",
565
+ },
566
+ {
567
+ "borderBottomColor": "rgba(0, 0, 0, 0.2)",
568
+ "borderBottomWidth": 0.5,
569
+ "borderLeftColor": undefined,
570
+ "borderLeftWidth": 0,
571
+ "borderStyle": "solid",
572
+ "marginHorizontal": 0,
573
+ "marginVertical": 20,
574
+ "position": "relative",
575
+ "width": undefined,
576
+ },
577
+ ]
578
+ }
579
+ />
580
+ `;
581
+
582
+ exports[`Divider Component > renders correctly with primary direction 1`] = `
583
+ <View
584
+ style={
585
+ [
586
+ {
587
+ "position": "relative",
588
+ },
589
+ {
590
+ "color": "rgba(0, 0, 0, 0.45)",
591
+ "fontSize": 12,
592
+ "fontWeight": "400",
593
+ },
594
+ ]
595
+ }
596
+ />
597
+ `;
598
+
599
+ exports[`Divider Component > renders correctly with secondary direction 1`] = `
600
+ <View
601
+ style={
602
+ [
603
+ {
604
+ "position": "relative",
605
+ },
606
+ {
607
+ "color": "rgba(51, 51, 51, .3)",
608
+ "fontSize": 12,
609
+ "fontWeight": "400",
610
+ },
611
+ ]
612
+ }
613
+ />
614
+ `;
615
+
616
+ exports[`Divider Component > renders correctly with vertical direction 1`] = `
617
+ <View
618
+ style={
619
+ [
620
+ {
621
+ "position": "relative",
622
+ },
623
+ {
624
+ "borderBottomColor": undefined,
625
+ "borderBottomWidth": 0,
626
+ "borderLeftColor": "rgba(0, 0, 0, 0.2)",
627
+ "borderLeftWidth": 0.5,
628
+ "borderStyle": "solid",
629
+ "height": 18,
630
+ "marginHorizontal": 12,
631
+ "marginVertical": 0,
632
+ "position": "relative",
633
+ "width": "auto",
634
+ },
635
+ ]
636
+ }
637
+ />
638
+ `;
@@ -1,58 +1,66 @@
1
1
  import React from "react";
2
2
  import { render } from "@testing-library/react-native";
3
3
  import { describe, it, expect } from "vitest";
4
- import Divider from "../index";
5
- import { lightColor } from "@xhs/reds-token-next";
4
+ import Divider from "../Divider";
6
5
 
7
6
  describe("Divider Component", () => {
8
7
  it("renders correctly with default props", () => {
9
- const { getByText } = render(<Divider>Default Divider</Divider>);
10
- expect(getByText("Default Divider")).toBeTruthy();
8
+ const { toJSON } = render(<Divider />);
9
+ expect(toJSON()).toMatchSnapshot();
10
+ });
11
+
12
+ it("renders correctly with horizontal direction", () => {
13
+ const { toJSON } = render(<Divider direction="horizontal" />);
14
+ expect(toJSON()).toMatchSnapshot();
11
15
  });
12
16
 
13
- it("applies the correct styles for direction", () => {
14
- const directions = ["horizontal", "vertical", "primary", "secondary"];
15
- directions.forEach((direction) => {
16
- const { toJSON } = render(<Divider direction={direction as any}>Divider</Divider>);
17
- expect(toJSON()).toMatchSnapshot();
18
- });
17
+ it("renders correctly with vertical direction", () => {
18
+ const { toJSON } = render(<Divider direction="vertical" />);
19
+ expect(toJSON()).toMatchSnapshot();
20
+ });
21
+
22
+ it("renders correctly with primary direction", () => {
23
+ const { toJSON } = render(<Divider direction="primary" />);
24
+ expect(toJSON()).toMatchSnapshot();
19
25
  });
20
26
 
21
- it("applies the correct styles for orientation", () => {
22
- const orientations = ["left", "center", "right"];
23
- orientations.forEach((orientation) => {
24
- const { toJSON } = render(<Divider orientation={orientation as any}>Divider</Divider>);
25
- expect(toJSON()).toMatchSnapshot();
26
- });
27
+ it("renders correctly with secondary direction", () => {
28
+ const { toJSON } = render(<Divider direction="secondary" />);
29
+ expect(toJSON()).toMatchSnapshot();
27
30
  });
28
31
 
29
- it("applies custom styles based on size prop", () => {
30
- const size = 5;
31
- const { toJSON } = render(<Divider size={size}>Divider</Divider>);
32
+ it("renders correctly with custom color", () => {
33
+ const { toJSON } = render(<Divider color="red" />);
32
34
  expect(toJSON()).toMatchSnapshot();
33
35
  });
34
36
 
35
- it("does not show text slot when direction is vertical", () => {
36
- const { queryByText } = render(<Divider direction="vertical">Vertical Divider</Divider>);
37
- const text = queryByText("Vertical Divider");
38
- expect(text).toBeNull();
37
+ it("renders correctly with left orientation", () => {
38
+ const { getByText } = render(<Divider orientation="left">Left Oriented Text</Divider>);
39
+ expect(getByText("Left Oriented Text")).toBeTruthy();
40
+ });
41
+
42
+ it("renders correctly with center orientation", () => {
43
+ const { getByText } = render(<Divider orientation="center">Center Oriented Text</Divider>);
44
+ expect(getByText("Center Oriented Text")).toBeTruthy();
45
+ });
46
+
47
+ it("renders correctly with right orientation", () => {
48
+ const { getByText } = render(<Divider orientation="right">Right Oriented Text</Divider>);
49
+ expect(getByText("Right Oriented Text")).toBeTruthy();
39
50
  });
40
51
 
41
- it("renders text slot when direction is horizontal", () => {
42
- const { getByText } = render(<Divider direction="horizontal">Horizontal Divider</Divider>);
43
- const text = getByText("Horizontal Divider");
44
- expect(text).toBeTruthy();
52
+ it("applies the correct styles based on custom margin", () => {
53
+ const { toJSON } = render(<Divider margin={[10, 20]} />);
54
+ expect(toJSON()).toMatchSnapshot();
45
55
  });
46
56
 
47
- it("renders correctly with both text and primary direction", () => {
48
- const { getByText } = render(<Divider direction="primary">Primary Divider</Divider>);
49
- const text = getByText("Primary Divider");
50
- expect(text).toBeTruthy();
57
+ it("applies the correct styles based on custom size", () => {
58
+ const { toJSON } = render(<Divider size={50} />);
59
+ expect(toJSON()).toMatchSnapshot();
51
60
  });
52
61
 
53
- it("renders correctly with both text and secondary direction", () => {
54
- const { getByText } = render(<Divider direction="secondary">Secondary Divider</Divider>);
55
- const text = getByText("Secondary Divider");
56
- expect(text).toBeTruthy();
62
+ it("applies the correct styles based on custom border number", () => {
63
+ const { toJSON } = render(<Divider stroke={2} />);
64
+ expect(toJSON()).toMatchSnapshot();
57
65
  });
58
66
  });
@@ -70,7 +70,6 @@ exports[`FAB Component > should apply position styles correctly 1`] = `
70
70
  "backgroundColor": "rgba(255, 36, 66, 1)",
71
71
  "borderColor": "rgba(255, 36, 66, 1)",
72
72
  },
73
- {},
74
73
  ]
75
74
  }
76
75
  >
@@ -168,7 +167,6 @@ exports[`FAB Component > should update boxWidth on layout change 1`] = `
168
167
  "backgroundColor": "rgba(255, 36, 66, 1)",
169
168
  "borderColor": "rgba(255, 36, 66, 1)",
170
169
  },
171
- {},
172
170
  ]
173
171
  }
174
172
  >
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { describe } from "vitest";
3
+ // @ts-ignore
4
+ import { redsBench } from "~root/utils/redsBench";
5
+ import { FAB } from "react-native-paper";
6
+ import { render } from "@testing-library/react-native";
7
+
8
+ describe("render", () => {
9
+ redsBench("paper", async () => {
10
+ render(<FAB icon="plus" onPress={() => console.log("Pressed")} />);
11
+ });
12
+ });