@hero-design/rn 8.98.1 → 8.99.1

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 (65) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/CHANGELOG.md +12 -0
  3. package/babel.config.js +4 -1
  4. package/es/index.js +45 -66
  5. package/lib/index.js +45 -66
  6. package/package.json +39 -19
  7. package/src/components/AnimatedScroller/__tests__/__snapshots__/ScrollablesWithFAB.spec.tsx.snap +0 -3
  8. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +52 -52
  9. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +87 -87
  10. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  11. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +2 -4
  12. package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +2 -2
  13. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  14. package/src/components/Radio/Radio.tsx +7 -1
  15. package/src/components/Radio/RadioGroup.tsx +1 -0
  16. package/src/components/Radio/__tests__/Radio.spec.tsx +15 -0
  17. package/src/components/Radio/__tests__/RadioGroup.spec.tsx +27 -0
  18. package/src/components/Radio/types.ts +3 -1
  19. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +1472 -1496
  20. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +2992 -3040
  21. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +1644 -1672
  22. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +2512 -2554
  23. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +6 -6
  24. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +24 -24
  25. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  26. package/src/components/StatusScreens/Empty/__tests__/__snapshots__/index.spec.tsx.snap +120 -0
  27. package/src/components/StatusScreens/Empty/__tests__/index.spec.tsx +21 -1
  28. package/src/components/StatusScreens/Empty/index.tsx +1 -1
  29. package/src/components/StatusScreens/Error/__tests__/__snapshots__/index.spec.tsx.snap +134 -0
  30. package/src/components/StatusScreens/Error/__tests__/index.spec.tsx +14 -0
  31. package/src/components/StatusScreens/Error/index.tsx +1 -1
  32. package/src/components/StatusScreens/Success/__tests__/__snapshots__/index.spec.tsx.snap +134 -0
  33. package/src/components/StatusScreens/Success/__tests__/index.spec.tsx +13 -0
  34. package/src/components/StatusScreens/Success/index.tsx +1 -1
  35. package/src/components/Tabs/ScrollableTabs.tsx +0 -1
  36. package/src/components/Tabs/index.tsx +0 -1
  37. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +2 -2
  38. package/stats/8.98.1/rn-stats.html +3 -1
  39. package/stats/8.99.0/rn-stats.html +4842 -0
  40. package/stats/8.99.1/rn-stats.html +4842 -0
  41. package/testUtils/setup.tsx +0 -1
  42. package/types/components/Accordion/StyledAccordion.d.ts +3 -5
  43. package/types/components/Alert/StyledAlert.d.ts +3 -5
  44. package/types/components/Attachment/StyledAttachment.d.ts +3 -5
  45. package/types/components/Avatar/StyledAvatar.d.ts +3 -5
  46. package/types/components/BottomSheet/StyledBottomSheet.d.ts +3 -5
  47. package/types/components/Button/StyledButton.d.ts +3 -5
  48. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +3 -5
  49. package/types/components/Calendar/StyledCalendar.d.ts +3 -5
  50. package/types/components/Checkbox/StyledCheckbox.d.ts +3 -5
  51. package/types/components/Chip/StyledChip.d.ts +2 -5
  52. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +2 -5
  53. package/types/components/FAB/StyledFAB.d.ts +2 -2
  54. package/types/components/FloatingIsland/StyledFloatingIsland.d.ts +2 -2
  55. package/types/components/List/StyledBasicListItem.d.ts +3 -5
  56. package/types/components/List/StyledListItem.d.ts +3 -5
  57. package/types/components/Radio/Radio.d.ts +6 -1
  58. package/types/components/Radio/types.d.ts +3 -1
  59. package/types/components/RichTextEditor/StyledToolbar.d.ts +3 -5
  60. package/types/components/StatusScreens/Empty/index.d.ts +1 -1
  61. package/types/components/StatusScreens/Error/index.d.ts +1 -1
  62. package/types/components/StatusScreens/Success/index.d.ts +1 -1
  63. package/types/components/Swipeable/StyledSwipeable.d.ts +2 -5
  64. package/types/components/Toast/StyledToast.d.ts +3 -5
  65. package/types/components/Toolbar/StyledToolbar.d.ts +3 -5
@@ -28,7 +28,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
28
28
  "flexDirection": "row",
29
29
  "marginBottom": 8,
30
30
  },
31
- {},
31
+ undefined,
32
32
  ]
33
33
  }
34
34
  themePosition="top"
@@ -45,7 +45,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
45
45
  "opacity": 0.9,
46
46
  "width": 16,
47
47
  },
48
- {},
48
+ undefined,
49
49
  ]
50
50
  }
51
51
  themeIntent="primary"
@@ -64,7 +64,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
64
64
  "opacity": 0.675,
65
65
  "width": 16,
66
66
  },
67
- {},
67
+ undefined,
68
68
  ]
69
69
  }
70
70
  themeIntent="primary"
@@ -80,7 +80,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
80
80
  "flexDirection": "row",
81
81
  "marginBottom": 0,
82
82
  },
83
- {},
83
+ undefined,
84
84
  ]
85
85
  }
86
86
  themePosition="bottom"
@@ -97,7 +97,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
97
97
  "opacity": 0.45,
98
98
  "width": 16,
99
99
  },
100
- {},
100
+ undefined,
101
101
  ]
102
102
  }
103
103
  themeIntent="primary"
@@ -116,7 +116,7 @@ exports[`AnimatedSpinner renders correctly 1`] = `
116
116
  "opacity": 0.225,
117
117
  "width": 16,
118
118
  },
119
- {},
119
+ undefined,
120
120
  ]
121
121
  }
122
122
  themeIntent="primary"
@@ -40,7 +40,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
40
40
  "flexDirection": "row",
41
41
  "marginBottom": 4,
42
42
  },
43
- {},
43
+ undefined,
44
44
  ]
45
45
  }
46
46
  themePosition="top"
@@ -57,7 +57,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
57
57
  "opacity": 0.9,
58
58
  "width": 8,
59
59
  },
60
- {},
60
+ undefined,
61
61
  ]
62
62
  }
63
63
  themeIntent="primary"
@@ -76,7 +76,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
76
76
  "opacity": 0.675,
77
77
  "width": 8,
78
78
  },
79
- {},
79
+ undefined,
80
80
  ]
81
81
  }
82
82
  themeIntent="primary"
@@ -92,7 +92,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
92
92
  "flexDirection": "row",
93
93
  "marginBottom": 0,
94
94
  },
95
- {},
95
+ undefined,
96
96
  ]
97
97
  }
98
98
  themePosition="bottom"
@@ -109,7 +109,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
109
109
  "opacity": 0.45,
110
110
  "width": 8,
111
111
  },
112
- {},
112
+ undefined,
113
113
  ]
114
114
  }
115
115
  themeIntent="primary"
@@ -128,7 +128,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
128
128
  "opacity": 0.225,
129
129
  "width": 8,
130
130
  },
131
- {},
131
+ undefined,
132
132
  ]
133
133
  }
134
134
  themeIntent="primary"
@@ -201,7 +201,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
201
201
  "flexDirection": "row",
202
202
  "marginBottom": 4,
203
203
  },
204
- {},
204
+ undefined,
205
205
  ]
206
206
  }
207
207
  themePosition="top"
@@ -218,7 +218,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
218
218
  "opacity": 0.9,
219
219
  "width": 8,
220
220
  },
221
- {},
221
+ undefined,
222
222
  ]
223
223
  }
224
224
  themeIntent="inverted"
@@ -237,7 +237,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
237
237
  "opacity": 0.675,
238
238
  "width": 8,
239
239
  },
240
- {},
240
+ undefined,
241
241
  ]
242
242
  }
243
243
  themeIntent="inverted"
@@ -253,7 +253,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
253
253
  "flexDirection": "row",
254
254
  "marginBottom": 0,
255
255
  },
256
- {},
256
+ undefined,
257
257
  ]
258
258
  }
259
259
  themePosition="bottom"
@@ -270,7 +270,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
270
270
  "opacity": 0.45,
271
271
  "width": 8,
272
272
  },
273
- {},
273
+ undefined,
274
274
  ]
275
275
  }
276
276
  themeIntent="inverted"
@@ -289,7 +289,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
289
289
  "opacity": 0.225,
290
290
  "width": 8,
291
291
  },
292
- {},
292
+ undefined,
293
293
  ]
294
294
  }
295
295
  themeIntent="inverted"
@@ -362,7 +362,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
362
362
  "flexDirection": "row",
363
363
  "marginBottom": 8,
364
364
  },
365
- {},
365
+ undefined,
366
366
  ]
367
367
  }
368
368
  themePosition="top"
@@ -379,7 +379,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
379
379
  "opacity": 0.9,
380
380
  "width": 16,
381
381
  },
382
- {},
382
+ undefined,
383
383
  ]
384
384
  }
385
385
  themeIntent="primary"
@@ -398,7 +398,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
398
398
  "opacity": 0.675,
399
399
  "width": 16,
400
400
  },
401
- {},
401
+ undefined,
402
402
  ]
403
403
  }
404
404
  themeIntent="primary"
@@ -414,7 +414,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
414
414
  "flexDirection": "row",
415
415
  "marginBottom": 0,
416
416
  },
417
- {},
417
+ undefined,
418
418
  ]
419
419
  }
420
420
  themePosition="bottom"
@@ -431,7 +431,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
431
431
  "opacity": 0.45,
432
432
  "width": 16,
433
433
  },
434
- {},
434
+ undefined,
435
435
  ]
436
436
  }
437
437
  themeIntent="primary"
@@ -450,7 +450,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
450
450
  "opacity": 0.225,
451
451
  "width": 16,
452
452
  },
453
- {},
453
+ undefined,
454
454
  ]
455
455
  }
456
456
  themeIntent="primary"
@@ -523,7 +523,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
523
523
  "flexDirection": "row",
524
524
  "marginBottom": 8,
525
525
  },
526
- {},
526
+ undefined,
527
527
  ]
528
528
  }
529
529
  themePosition="top"
@@ -540,7 +540,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
540
540
  "opacity": 0.9,
541
541
  "width": 16,
542
542
  },
543
- {},
543
+ undefined,
544
544
  ]
545
545
  }
546
546
  themeIntent="inverted"
@@ -559,7 +559,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
559
559
  "opacity": 0.675,
560
560
  "width": 16,
561
561
  },
562
- {},
562
+ undefined,
563
563
  ]
564
564
  }
565
565
  themeIntent="inverted"
@@ -575,7 +575,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
575
575
  "flexDirection": "row",
576
576
  "marginBottom": 0,
577
577
  },
578
- {},
578
+ undefined,
579
579
  ]
580
580
  }
581
581
  themePosition="bottom"
@@ -592,7 +592,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
592
592
  "opacity": 0.45,
593
593
  "width": 16,
594
594
  },
595
- {},
595
+ undefined,
596
596
  ]
597
597
  }
598
598
  themeIntent="inverted"
@@ -611,7 +611,7 @@ exports[`StyledSpinnerContainer renders correctly when intent is $themeIntent, a
611
611
  "opacity": 0.225,
612
612
  "width": 16,
613
613
  },
614
- {},
614
+ undefined,
615
615
  ]
616
616
  }
617
617
  themeIntent="inverted"
@@ -49,7 +49,7 @@ exports[`Spinner renders correctly 1`] = `
49
49
  "flexDirection": "row",
50
50
  "marginBottom": 8,
51
51
  },
52
- {},
52
+ undefined,
53
53
  ]
54
54
  }
55
55
  themePosition="top"
@@ -66,7 +66,7 @@ exports[`Spinner renders correctly 1`] = `
66
66
  "opacity": 0.9,
67
67
  "width": 16,
68
68
  },
69
- {},
69
+ undefined,
70
70
  ]
71
71
  }
72
72
  themeIntent="primary"
@@ -85,7 +85,7 @@ exports[`Spinner renders correctly 1`] = `
85
85
  "opacity": 0.675,
86
86
  "width": 16,
87
87
  },
88
- {},
88
+ undefined,
89
89
  ]
90
90
  }
91
91
  themeIntent="primary"
@@ -101,7 +101,7 @@ exports[`Spinner renders correctly 1`] = `
101
101
  "flexDirection": "row",
102
102
  "marginBottom": 0,
103
103
  },
104
- {},
104
+ undefined,
105
105
  ]
106
106
  }
107
107
  themePosition="bottom"
@@ -118,7 +118,7 @@ exports[`Spinner renders correctly 1`] = `
118
118
  "opacity": 0.45,
119
119
  "width": 16,
120
120
  },
121
- {},
121
+ undefined,
122
122
  ]
123
123
  }
124
124
  themeIntent="primary"
@@ -137,7 +137,7 @@ exports[`Spinner renders correctly 1`] = `
137
137
  "opacity": 0.225,
138
138
  "width": 16,
139
139
  },
140
- {},
140
+ undefined,
141
141
  ]
142
142
  }
143
143
  themeIntent="primary"
@@ -101,6 +101,126 @@ exports[`Empty renders empty state content correctly 1`] = `
101
101
  </View>
102
102
  `;
103
103
 
104
+ exports[`Empty renders empty state content correctly with title is a React Element 1`] = `
105
+ <View
106
+ style={
107
+ {
108
+ "flex": 1,
109
+ }
110
+ }
111
+ >
112
+ <View
113
+ style={
114
+ [
115
+ {
116
+ "alignItems": "center",
117
+ "display": "flex",
118
+ "flex": 1,
119
+ "flexDirection": "column",
120
+ "justifyContent": "center",
121
+ "padding": 16,
122
+ },
123
+ undefined,
124
+ ]
125
+ }
126
+ >
127
+ <Text
128
+ allowFontScaling={false}
129
+ style={
130
+ [
131
+ {
132
+ "color": "#001f23",
133
+ "fontFamily": "Saiga-Medium",
134
+ "fontSize": 24,
135
+ "letterSpacing": 0.24,
136
+ "lineHeight": 32,
137
+ },
138
+ [
139
+ {
140
+ "color": "#001f23",
141
+ "marginBottom": 8,
142
+ "textAlign": "center",
143
+ },
144
+ undefined,
145
+ ],
146
+ ]
147
+ }
148
+ themeIntent="body"
149
+ themeLevel="h4"
150
+ themeTypeface="playful"
151
+ themeVariant="light"
152
+ >
153
+ <Text
154
+ allowFontScaling={false}
155
+ style={
156
+ [
157
+ {
158
+ "color": "#001f23",
159
+ "fontFamily": "BeVietnamPro-Regular",
160
+ "fontSize": 42,
161
+ "letterSpacing": 0,
162
+ "lineHeight": 50,
163
+ },
164
+ undefined,
165
+ ]
166
+ }
167
+ themeIntent="body"
168
+ themeLevel="h1"
169
+ themeTypeface="neutral"
170
+ >
171
+ You have no notification at this time
172
+ </Text>
173
+ </Text>
174
+ <Text
175
+ allowFontScaling={false}
176
+ style={
177
+ [
178
+ {
179
+ "color": "#001f23",
180
+ "fontFamily": "BeVietnamPro-Regular",
181
+ "fontSize": 14,
182
+ "letterSpacing": 0.48,
183
+ "lineHeight": 22,
184
+ },
185
+ [
186
+ {
187
+ "color": "#4d6265",
188
+ "textAlign": "center",
189
+ },
190
+ undefined,
191
+ ],
192
+ ]
193
+ }
194
+ themeIntent="body"
195
+ themeTypeface="neutral"
196
+ themeVariant="small"
197
+ >
198
+ We'll notify you later.
199
+ </Text>
200
+ </View>
201
+ <View
202
+ pointerEvents="box-none"
203
+ position="bottom"
204
+ style={
205
+ [
206
+ {
207
+ "bottom": 0,
208
+ "elevation": 9999,
209
+ "flexDirection": "column-reverse",
210
+ "left": 0,
211
+ "paddingHorizontal": 24,
212
+ "paddingVertical": 16,
213
+ "position": "absolute",
214
+ "right": 0,
215
+ "top": 0,
216
+ },
217
+ undefined,
218
+ ]
219
+ }
220
+ />
221
+ </View>
222
+ `;
223
+
104
224
  exports[`Empty renders empty state with icon correctly 1`] = `
105
225
  <View
106
226
  style={
@@ -3,10 +3,11 @@ import { Image } from 'react-native';
3
3
 
4
4
  import renderWithTheme from '../../../../testHelpers/renderWithTheme';
5
5
  import Empty from '..';
6
+ import Typography from '../../../Typography';
6
7
 
7
8
  describe('Empty', () => {
8
9
  it('renders empty state content correctly', () => {
9
- const { toJSON } = renderWithTheme(
10
+ const { toJSON, getByText } = renderWithTheme(
10
11
  <Empty
11
12
  title="You have no notification at this time"
12
13
  description="We'll notify you later."
@@ -14,6 +15,25 @@ describe('Empty', () => {
14
15
  );
15
16
 
16
17
  expect(toJSON()).toMatchSnapshot();
18
+ expect(getByText('You have no notification at this time')).toBeTruthy();
19
+ expect(getByText("We'll notify you later.")).toBeTruthy();
20
+ });
21
+
22
+ it('renders empty state content correctly with title is a React Element', () => {
23
+ const { toJSON, getByText } = renderWithTheme(
24
+ <Empty
25
+ title={
26
+ <Typography.Title>
27
+ You have no notification at this time
28
+ </Typography.Title>
29
+ }
30
+ description="We'll notify you later."
31
+ />
32
+ );
33
+
34
+ expect(toJSON()).toMatchSnapshot();
35
+ expect(getByText('You have no notification at this time')).toBeTruthy();
36
+ expect(getByText("We'll notify you later.")).toBeTruthy();
17
37
  });
18
38
 
19
39
  it('renders empty state with image correctly', () => {
@@ -23,7 +23,7 @@ interface EmptyProps {
23
23
  /**
24
24
  * Empty's title.
25
25
  */
26
- title: string;
26
+ title: string | ReactElement;
27
27
  /**
28
28
  * Empty's description.
29
29
  */
@@ -904,3 +904,137 @@ exports[`Error renders title only correctly 1`] = `
904
904
  />
905
905
  </View>
906
906
  `;
907
+
908
+ exports[`Error renders title only correctly with title is a React Element 1`] = `
909
+ <View
910
+ style={
911
+ {
912
+ "flex": 1,
913
+ }
914
+ }
915
+ >
916
+ <View
917
+ style={
918
+ [
919
+ {
920
+ "backgroundColor": "#f6f6f7",
921
+ "display": "flex",
922
+ "flex": 1,
923
+ "flexDirection": "column",
924
+ },
925
+ undefined,
926
+ ]
927
+ }
928
+ themeVariant="in-page"
929
+ >
930
+ <View
931
+ style={
932
+ [
933
+ {
934
+ "alignItems": "center",
935
+ "display": "flex",
936
+ "flex": 1,
937
+ "flexDirection": "column",
938
+ "justifyContent": "center",
939
+ "padding": 24,
940
+ },
941
+ undefined,
942
+ ]
943
+ }
944
+ >
945
+ <Text
946
+ allowFontScaling={false}
947
+ style={
948
+ [
949
+ {
950
+ "color": "#001f23",
951
+ "fontFamily": "Saiga-Medium",
952
+ "fontSize": 24,
953
+ "letterSpacing": 0.24,
954
+ "lineHeight": 32,
955
+ },
956
+ [
957
+ {
958
+ "color": "#001f23",
959
+ "marginBottom": 8,
960
+ "textAlign": "center",
961
+ },
962
+ undefined,
963
+ ],
964
+ ]
965
+ }
966
+ themeIntent="body"
967
+ themeLevel="h4"
968
+ themeTypeface="playful"
969
+ >
970
+ <Text
971
+ allowFontScaling={false}
972
+ style={
973
+ [
974
+ {
975
+ "color": "#001f23",
976
+ "fontFamily": "BeVietnamPro-Regular",
977
+ "fontSize": 42,
978
+ "letterSpacing": 0,
979
+ "lineHeight": 50,
980
+ },
981
+ undefined,
982
+ ]
983
+ }
984
+ themeIntent="body"
985
+ themeLevel="h1"
986
+ themeTypeface="neutral"
987
+ >
988
+ We’re sorry, something went wrong
989
+ </Text>
990
+ </Text>
991
+ <Text
992
+ allowFontScaling={false}
993
+ style={
994
+ [
995
+ {
996
+ "color": "#001f23",
997
+ "fontFamily": "Saiga-Regular",
998
+ "fontSize": 18,
999
+ "letterSpacing": 0.54,
1000
+ "lineHeight": 26,
1001
+ },
1002
+ [
1003
+ {
1004
+ "color": "#4d6265",
1005
+ "textAlign": "center",
1006
+ },
1007
+ undefined,
1008
+ ],
1009
+ ]
1010
+ }
1011
+ themeIntent="body"
1012
+ themeTypeface="playful"
1013
+ themeVariant="regular"
1014
+ >
1015
+ Please try again later
1016
+ </Text>
1017
+ </View>
1018
+ </View>
1019
+ <View
1020
+ pointerEvents="box-none"
1021
+ position="bottom"
1022
+ style={
1023
+ [
1024
+ {
1025
+ "bottom": 0,
1026
+ "elevation": 9999,
1027
+ "flexDirection": "column-reverse",
1028
+ "left": 0,
1029
+ "paddingHorizontal": 24,
1030
+ "paddingVertical": 16,
1031
+ "position": "absolute",
1032
+ "right": 0,
1033
+ "top": 0,
1034
+ },
1035
+ undefined,
1036
+ ]
1037
+ }
1038
+ />
1039
+ </View>
1040
+ `;
@@ -4,6 +4,7 @@ import renderWithTheme from '../../../../testHelpers/renderWithTheme';
4
4
  import Error from '..';
5
5
  import Image from '../../../Image';
6
6
  import Portal from '../../../Portal';
7
+ import Typography from '../../../Typography';
7
8
 
8
9
  const title = `We’re sorry, something went wrong`;
9
10
  const description = 'Please try again later';
@@ -18,6 +19,19 @@ describe('Error', () => {
18
19
  expect(getByText(description)).toBeTruthy();
19
20
  expect(toJSON()).toMatchSnapshot();
20
21
  });
22
+
23
+ it('renders title only correctly with title is a React Element', () => {
24
+ const { toJSON, getByText } = renderWithTheme(
25
+ <Error
26
+ title={<Typography.Title>{title}</Typography.Title>}
27
+ description={description}
28
+ />
29
+ );
30
+
31
+ expect(getByText(title)).toBeTruthy();
32
+ expect(getByText(description)).toBeTruthy();
33
+ expect(toJSON()).toMatchSnapshot();
34
+ });
21
35
  it('renders error screen with image correctly', () => {
22
36
  const { toJSON, getByText, getByTestId } = renderWithTheme(
23
37
  <Error title={title} description={description} image="path_to_image" />
@@ -42,7 +42,7 @@ interface ErrorProps extends ViewProps {
42
42
  /**
43
43
  * Title of the error
44
44
  */
45
- title: string;
45
+ title: string | ReactElement;
46
46
  /**
47
47
  * Description of the error
48
48
  */