@hero-design/rn 7.19.0 → 7.20.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 (171) hide show
  1. package/.eslintrc.json +6 -1
  2. package/.turbo/turbo-build.log +2 -2
  3. package/es/index.js +572 -194
  4. package/lib/index.js +572 -193
  5. package/package.json +4 -4
  6. package/src/components/Alert/StyledAlert.tsx +5 -5
  7. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +140 -19
  8. package/src/components/Alert/__tests__/index.spec.tsx +21 -0
  9. package/src/components/Alert/index.tsx +13 -6
  10. package/src/components/Avatar/StyledAvatar.tsx +2 -1
  11. package/src/components/Avatar/index.tsx +2 -1
  12. package/src/components/Box/StyledBox.tsx +54 -0
  13. package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +605 -0
  14. package/src/components/Box/__tests__/helpers.spec.ts +14 -0
  15. package/src/components/Box/__tests__/index.spec.tsx +155 -0
  16. package/src/components/Box/config.ts +201 -0
  17. package/src/components/Box/helpers.ts +10 -0
  18. package/src/components/Box/index.tsx +13 -0
  19. package/src/components/Box/types.ts +38 -0
  20. package/src/components/Calendar/__tests__/index.spec.tsx +13 -17
  21. package/src/components/Card/DataCard/StyledDataCard.tsx +8 -2
  22. package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +1 -0
  23. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +16 -0
  24. package/src/components/Card/DataCard/index.tsx +1 -1
  25. package/src/components/Card/StyledCard.tsx +12 -19
  26. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +147 -0
  27. package/src/components/Card/__tests__/index.spec.tsx +18 -0
  28. package/src/components/Card/index.tsx +6 -1
  29. package/src/components/Drawer/DragableDrawer/helpers.ts +3 -4
  30. package/src/components/FAB/ActionGroup/index.tsx +6 -8
  31. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -8
  32. package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
  33. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  34. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  35. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  36. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +22 -20
  37. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
  38. package/src/components/Spinner/AnimatedSpinner.tsx +7 -7
  39. package/src/components/Spinner/StyledSpinner.tsx +24 -19
  40. package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +1 -1
  41. package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +32 -16
  42. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +14 -12
  43. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +273 -31
  44. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +14 -12
  45. package/src/components/Spinner/index.tsx +10 -2
  46. package/src/components/Tabs/ScrollableTabs.tsx +9 -4
  47. package/src/components/Tabs/StyledScrollableTabs.tsx +6 -5
  48. package/src/components/Tabs/StyledTabs.tsx +6 -0
  49. package/src/components/Tabs/TabWithBadge.tsx +68 -0
  50. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +13 -0
  51. package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +48 -0
  52. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +205 -43
  53. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +165 -0
  54. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +135 -34
  55. package/src/components/Tabs/__tests__/index.spec.tsx +12 -0
  56. package/src/components/Tabs/index.tsx +11 -4
  57. package/src/components/Tag/StyledTag.tsx +1 -11
  58. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +4 -4
  59. package/src/components/Tag/index.tsx +2 -2
  60. package/src/components/TextInput/__tests__/index.spec.tsx +10 -14
  61. package/src/components/Toast/StyledToast.tsx +13 -7
  62. package/src/components/Toast/Toast.tsx +34 -9
  63. package/src/components/Toast/ToastProvider.tsx +15 -12
  64. package/src/components/Toast/__tests__/Toast.spec.tsx +17 -0
  65. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +299 -19
  66. package/src/components/Toast/types.ts +15 -1
  67. package/src/components/Typography/Text/StyledText.tsx +7 -1
  68. package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
  69. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
  70. package/src/components/Typography/Text/index.tsx +7 -1
  71. package/src/index.ts +2 -0
  72. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +76 -23
  73. package/src/theme/components/.eslintrc.json +10 -0
  74. package/src/theme/components/alert.ts +5 -1
  75. package/src/theme/components/avatar.ts +2 -0
  76. package/src/theme/components/card.ts +6 -7
  77. package/src/theme/components/sectionHeading.ts +1 -1
  78. package/src/theme/components/spinner.ts +19 -7
  79. package/src/theme/components/tabs.ts +3 -2
  80. package/src/theme/components/tag.ts +13 -13
  81. package/src/theme/components/toast.ts +17 -3
  82. package/src/theme/components/typography.ts +2 -0
  83. package/src/theme/global/colors/swag.ts +23 -0
  84. package/src/theme/global/colors/types.ts +23 -0
  85. package/src/theme/global/colors/work.ts +5 -0
  86. package/tsconfig.json +4 -15
  87. package/types/components/Accordion/StyledAccordion.d.ts +14 -14
  88. package/types/components/Alert/StyledAlert.d.ts +16 -16
  89. package/types/components/Alert/index.d.ts +1 -1
  90. package/types/components/Avatar/StyledAvatar.d.ts +16 -16
  91. package/types/components/Avatar/index.d.ts +2 -2
  92. package/types/components/Badge/StyledBadge.d.ts +7 -7
  93. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
  94. package/types/components/BottomSheet/Header.d.ts +1 -1
  95. package/types/components/BottomSheet/StyledBottomSheet.d.ts +19 -19
  96. package/types/components/Box/StyledBox.d.ts +15 -0
  97. package/types/components/Box/__tests__/helpers.spec.d.ts +1 -0
  98. package/types/components/Box/__tests__/index.spec.d.ts +1 -0
  99. package/types/components/Box/config.d.ts +170 -0
  100. package/types/components/Box/helpers.d.ts +1 -0
  101. package/types/components/Box/index.d.ts +5 -0
  102. package/types/components/Box/types.d.ts +31 -0
  103. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +7 -7
  104. package/types/components/Button/StyledButton.d.ts +16 -16
  105. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
  106. package/types/components/Calendar/StyledCalendar.d.ts +25 -25
  107. package/types/components/Calendar/helpers.d.ts +2 -2
  108. package/types/components/Card/DataCard/StyledDataCard.d.ts +7 -7
  109. package/types/components/Card/DataCard/index.d.ts +1 -1
  110. package/types/components/Card/StyledCard.d.ts +7 -6
  111. package/types/components/Card/index.d.ts +5 -1
  112. package/types/components/Checkbox/StyledCheckbox.d.ts +10 -10
  113. package/types/components/Collapse/StyledCollapse.d.ts +8 -8
  114. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
  115. package/types/components/DatePicker/StyledDatePicker.d.ts +3 -3
  116. package/types/components/Divider/StyledDivider.d.ts +5 -5
  117. package/types/components/Drawer/StyledDrawer.d.ts +19 -19
  118. package/types/components/Empty/StyledEmpty.d.ts +12 -12
  119. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +11 -11
  120. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +7 -7
  121. package/types/components/FAB/StyledFAB.d.ts +8 -8
  122. package/types/components/Icon/HeroIcon/index.d.ts +3 -3
  123. package/types/components/List/StyledBasicListItem.d.ts +14 -14
  124. package/types/components/List/StyledListItem.d.ts +23 -23
  125. package/types/components/PinInput/StyledPinInput.d.ts +30 -30
  126. package/types/components/Progress/StyledProgressBar.d.ts +5 -5
  127. package/types/components/Progress/StyledProgressCircle.d.ts +18 -18
  128. package/types/components/Radio/StyledRadio.d.ts +9 -9
  129. package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
  130. package/types/components/RichTextEditor/MentionList.d.ts +1 -1
  131. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
  132. package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
  133. package/types/components/RichTextEditor/index.d.ts +2 -2
  134. package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
  135. package/types/components/Select/MultiSelect/Option.d.ts +1 -1
  136. package/types/components/Select/SingleSelect/Option.d.ts +1 -1
  137. package/types/components/Select/StyledSelect.d.ts +11 -11
  138. package/types/components/Select/helpers.d.ts +1 -1
  139. package/types/components/Spinner/AnimatedSpinner.d.ts +3 -1
  140. package/types/components/Spinner/StyledSpinner.d.ts +14 -12
  141. package/types/components/Spinner/index.d.ts +5 -1
  142. package/types/components/Switch/StyledSwitch.d.ts +5 -5
  143. package/types/components/Tabs/StyledScrollableTabs.d.ts +24 -22
  144. package/types/components/Tabs/StyledTabs.d.ts +26 -20
  145. package/types/components/Tabs/TabWithBadge.d.ts +17 -0
  146. package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +1 -0
  147. package/types/components/Tabs/index.d.ts +3 -1
  148. package/types/components/Tag/StyledTag.d.ts +6 -6
  149. package/types/components/Tag/index.d.ts +1 -1
  150. package/types/components/TextInput/StyledTextInput.d.ts +44 -44
  151. package/types/components/TextInput/index.d.ts +5 -5
  152. package/types/components/TimePicker/StyledTimePicker.d.ts +3 -3
  153. package/types/components/Toast/StyledToast.d.ts +19 -18
  154. package/types/components/Toast/types.d.ts +2 -1
  155. package/types/components/Toolbar/StyledToolbar.d.ts +9 -9
  156. package/types/components/Typography/Text/StyledText.d.ts +4 -4
  157. package/types/components/Typography/Text/index.d.ts +1 -1
  158. package/types/index.d.ts +2 -1
  159. package/types/testHelpers/renderWithTheme.d.ts +1 -1
  160. package/types/theme/ThemeSwitcher.d.ts +1 -1
  161. package/types/theme/components/alert.d.ts +5 -1
  162. package/types/theme/components/avatar.d.ts +2 -0
  163. package/types/theme/components/card.d.ts +6 -7
  164. package/types/theme/components/spinner.d.ts +17 -5
  165. package/types/theme/components/tabs.d.ts +1 -0
  166. package/types/theme/components/tag.d.ts +2 -2
  167. package/types/theme/components/toast.d.ts +18 -2
  168. package/types/theme/components/typography.d.ts +2 -0
  169. package/types/theme/global/colors/types.d.ts +17 -0
  170. package/types/theme/global/index.d.ts +17 -0
  171. package/types/utils/hooks.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`StyledSpinnerContainer renders correctly 1`] = `
3
+ exports[`StyledSpinnerContainer renders correctly in medium size 1`] = `
4
4
  <View
5
5
  style={
6
6
  Array [
@@ -39,6 +39,7 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
39
39
  ]
40
40
  }
41
41
  themePosition="top"
42
+ themeSize="medium"
42
43
  >
43
44
  <View
44
45
  collapsable={false}
@@ -46,16 +47,16 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
46
47
  style={
47
48
  Array [
48
49
  Object {
49
- "backgroundColor": "#8505a2",
50
- "borderRadius": 8,
50
+ "backgroundColor": "#795e90",
51
+ "borderRadius": 999,
51
52
  "height": 16,
52
- "opacity": 1,
53
53
  "width": 16,
54
54
  },
55
55
  Object {},
56
56
  ]
57
57
  }
58
58
  themePosition="topLeft"
59
+ themeSize="medium"
59
60
  />
60
61
  <View
61
62
  collapsable={false}
@@ -63,17 +64,17 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
63
64
  style={
64
65
  Array [
65
66
  Object {
66
- "backgroundColor": "#8505a2",
67
- "borderRadius": 8,
67
+ "backgroundColor": "#a08cb0",
68
+ "borderRadius": 999,
68
69
  "height": 16,
69
70
  "marginLeft": 8,
70
- "opacity": 0.7,
71
71
  "width": 16,
72
72
  },
73
73
  Object {},
74
74
  ]
75
75
  }
76
76
  themePosition="topRight"
77
+ themeSize="medium"
77
78
  />
78
79
  </View>
79
80
  <View
@@ -89,6 +90,7 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
89
90
  ]
90
91
  }
91
92
  themePosition="bottom"
93
+ themeSize="medium"
92
94
  >
93
95
  <View
94
96
  collapsable={false}
@@ -96,16 +98,16 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
96
98
  style={
97
99
  Array [
98
100
  Object {
99
- "backgroundColor": "#8505a2",
100
- "borderRadius": 8,
101
+ "backgroundColor": "#d9d1df",
102
+ "borderRadius": 999,
101
103
  "height": 16,
102
- "opacity": 0.5,
103
104
  "width": 16,
104
105
  },
105
106
  Object {},
106
107
  ]
107
108
  }
108
109
  themePosition="bottomLeft"
110
+ themeSize="medium"
109
111
  />
110
112
  <View
111
113
  collapsable={false}
@@ -113,24 +115,156 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
113
115
  style={
114
116
  Array [
115
117
  Object {
116
- "backgroundColor": "#8505a2",
117
- "borderRadius": 8,
118
+ "backgroundColor": "#ece8ef",
119
+ "borderRadius": 999,
118
120
  "height": 16,
119
121
  "marginLeft": 8,
120
- "opacity": 0.3,
121
122
  "width": 16,
122
123
  },
123
124
  Object {},
124
125
  ]
125
126
  }
126
127
  themePosition="bottomRight"
128
+ themeSize="medium"
127
129
  />
128
130
  </View>
129
131
  </View>
130
132
  </View>
131
133
  `;
132
134
 
133
- exports[`StyledSpinnerRow renders correctly when position is bottom 1`] = `
135
+ exports[`StyledSpinnerContainer renders correctly in small size 1`] = `
136
+ <View
137
+ style={
138
+ Array [
139
+ Object {
140
+ "alignItems": "center",
141
+ "height": "100%",
142
+ "justifyContent": "center",
143
+ },
144
+ undefined,
145
+ ]
146
+ }
147
+ >
148
+ <View
149
+ collapsable={false}
150
+ nativeID="animatedComponent"
151
+ style={
152
+ Object {
153
+ "transform": Array [
154
+ Object {
155
+ "rotate": "0deg",
156
+ },
157
+ ],
158
+ }
159
+ }
160
+ >
161
+ <View
162
+ collapsable={false}
163
+ nativeID="animatedComponent"
164
+ style={
165
+ Array [
166
+ Object {
167
+ "flexDirection": "row",
168
+ "marginBottom": 4,
169
+ },
170
+ Object {},
171
+ ]
172
+ }
173
+ themePosition="top"
174
+ themeSize="small"
175
+ >
176
+ <View
177
+ collapsable={false}
178
+ nativeID="animatedComponent"
179
+ style={
180
+ Array [
181
+ Object {
182
+ "backgroundColor": "#795e90",
183
+ "borderRadius": 999,
184
+ "height": 8,
185
+ "width": 8,
186
+ },
187
+ Object {},
188
+ ]
189
+ }
190
+ themePosition="topLeft"
191
+ themeSize="small"
192
+ />
193
+ <View
194
+ collapsable={false}
195
+ nativeID="animatedComponent"
196
+ style={
197
+ Array [
198
+ Object {
199
+ "backgroundColor": "#a08cb0",
200
+ "borderRadius": 999,
201
+ "height": 8,
202
+ "marginLeft": 4,
203
+ "width": 8,
204
+ },
205
+ Object {},
206
+ ]
207
+ }
208
+ themePosition="topRight"
209
+ themeSize="small"
210
+ />
211
+ </View>
212
+ <View
213
+ collapsable={false}
214
+ nativeID="animatedComponent"
215
+ style={
216
+ Array [
217
+ Object {
218
+ "flexDirection": "row",
219
+ "marginBottom": 0,
220
+ },
221
+ Object {},
222
+ ]
223
+ }
224
+ themePosition="bottom"
225
+ themeSize="small"
226
+ >
227
+ <View
228
+ collapsable={false}
229
+ nativeID="animatedComponent"
230
+ style={
231
+ Array [
232
+ Object {
233
+ "backgroundColor": "#d9d1df",
234
+ "borderRadius": 999,
235
+ "height": 8,
236
+ "width": 8,
237
+ },
238
+ Object {},
239
+ ]
240
+ }
241
+ themePosition="bottomLeft"
242
+ themeSize="small"
243
+ />
244
+ <View
245
+ collapsable={false}
246
+ nativeID="animatedComponent"
247
+ style={
248
+ Array [
249
+ Object {
250
+ "backgroundColor": "#ece8ef",
251
+ "borderRadius": 999,
252
+ "height": 8,
253
+ "marginLeft": 4,
254
+ "width": 8,
255
+ },
256
+ Object {},
257
+ ]
258
+ }
259
+ themePosition="bottomRight"
260
+ themeSize="small"
261
+ />
262
+ </View>
263
+ </View>
264
+ </View>
265
+ `;
266
+
267
+ exports[`StyledSpinnerRow renders correctly when position is bottom, and size is medium 1`] = `
134
268
  <View
135
269
  style={
136
270
  Array [
@@ -142,10 +276,27 @@ exports[`StyledSpinnerRow renders correctly when position is bottom 1`] = `
142
276
  ]
143
277
  }
144
278
  themePosition="bottom"
279
+ themeSize="medium"
145
280
  />
146
281
  `;
147
282
 
148
- exports[`StyledSpinnerRow renders correctly when position is top 1`] = `
283
+ exports[`StyledSpinnerRow renders correctly when position is bottom, and size is small 1`] = `
284
+ <View
285
+ style={
286
+ Array [
287
+ Object {
288
+ "flexDirection": "row",
289
+ "marginBottom": 0,
290
+ },
291
+ undefined,
292
+ ]
293
+ }
294
+ themePosition="bottom"
295
+ themeSize="small"
296
+ />
297
+ `;
298
+
299
+ exports[`StyledSpinnerRow renders correctly when position is top, and size is medium 1`] = `
149
300
  <View
150
301
  style={
151
302
  Array [
@@ -157,79 +308,170 @@ exports[`StyledSpinnerRow renders correctly when position is top 1`] = `
157
308
  ]
158
309
  }
159
310
  themePosition="top"
311
+ themeSize="medium"
312
+ />
313
+ `;
314
+
315
+ exports[`StyledSpinnerRow renders correctly when position is top, and size is small 1`] = `
316
+ <View
317
+ style={
318
+ Array [
319
+ Object {
320
+ "flexDirection": "row",
321
+ "marginBottom": 4,
322
+ },
323
+ undefined,
324
+ ]
325
+ }
326
+ themePosition="top"
327
+ themeSize="small"
160
328
  />
161
329
  `;
162
330
 
163
- exports[`StyledSpinnerText renders correctly when position is bottomLeft 1`] = `
331
+ exports[`StyledSpinnerText renders correctly when position is bottomLeft, size is medium 1`] = `
164
332
  <View
165
333
  style={
166
334
  Array [
167
335
  Object {
168
- "backgroundColor": "#8505a2",
169
- "borderRadius": 8,
336
+ "backgroundColor": "#d9d1df",
337
+ "borderRadius": 999,
170
338
  "height": 16,
171
- "opacity": 0.5,
172
339
  "width": 16,
173
340
  },
174
341
  undefined,
175
342
  ]
176
343
  }
177
344
  themePosition="bottomLeft"
345
+ themeSize="medium"
346
+ />
347
+ `;
348
+
349
+ exports[`StyledSpinnerText renders correctly when position is bottomLeft, size is small 1`] = `
350
+ <View
351
+ style={
352
+ Array [
353
+ Object {
354
+ "backgroundColor": "#d9d1df",
355
+ "borderRadius": 999,
356
+ "height": 8,
357
+ "width": 8,
358
+ },
359
+ undefined,
360
+ ]
361
+ }
362
+ themePosition="bottomLeft"
363
+ themeSize="small"
178
364
  />
179
365
  `;
180
366
 
181
- exports[`StyledSpinnerText renders correctly when position is bottomRight 1`] = `
367
+ exports[`StyledSpinnerText renders correctly when position is bottomRight, size is medium 1`] = `
182
368
  <View
183
369
  style={
184
370
  Array [
185
371
  Object {
186
- "backgroundColor": "#8505a2",
187
- "borderRadius": 8,
372
+ "backgroundColor": "#ece8ef",
373
+ "borderRadius": 999,
188
374
  "height": 16,
189
375
  "marginLeft": 8,
190
- "opacity": 0.3,
191
376
  "width": 16,
192
377
  },
193
378
  undefined,
194
379
  ]
195
380
  }
196
381
  themePosition="bottomRight"
382
+ themeSize="medium"
197
383
  />
198
384
  `;
199
385
 
200
- exports[`StyledSpinnerText renders correctly when position is topLeft 1`] = `
386
+ exports[`StyledSpinnerText renders correctly when position is bottomRight, size is small 1`] = `
201
387
  <View
202
388
  style={
203
389
  Array [
204
390
  Object {
205
- "backgroundColor": "#8505a2",
206
- "borderRadius": 8,
391
+ "backgroundColor": "#ece8ef",
392
+ "borderRadius": 999,
393
+ "height": 8,
394
+ "marginLeft": 4,
395
+ "width": 8,
396
+ },
397
+ undefined,
398
+ ]
399
+ }
400
+ themePosition="bottomRight"
401
+ themeSize="small"
402
+ />
403
+ `;
404
+
405
+ exports[`StyledSpinnerText renders correctly when position is topLeft, size is medium 1`] = `
406
+ <View
407
+ style={
408
+ Array [
409
+ Object {
410
+ "backgroundColor": "#795e90",
411
+ "borderRadius": 999,
207
412
  "height": 16,
208
- "opacity": 1,
209
413
  "width": 16,
210
414
  },
211
415
  undefined,
212
416
  ]
213
417
  }
214
418
  themePosition="topLeft"
419
+ themeSize="medium"
215
420
  />
216
421
  `;
217
422
 
218
- exports[`StyledSpinnerText renders correctly when position is topRight 1`] = `
423
+ exports[`StyledSpinnerText renders correctly when position is topLeft, size is small 1`] = `
219
424
  <View
220
425
  style={
221
426
  Array [
222
427
  Object {
223
- "backgroundColor": "#8505a2",
224
- "borderRadius": 8,
428
+ "backgroundColor": "#795e90",
429
+ "borderRadius": 999,
430
+ "height": 8,
431
+ "width": 8,
432
+ },
433
+ undefined,
434
+ ]
435
+ }
436
+ themePosition="topLeft"
437
+ themeSize="small"
438
+ />
439
+ `;
440
+
441
+ exports[`StyledSpinnerText renders correctly when position is topRight, size is medium 1`] = `
442
+ <View
443
+ style={
444
+ Array [
445
+ Object {
446
+ "backgroundColor": "#a08cb0",
447
+ "borderRadius": 999,
225
448
  "height": 16,
226
449
  "marginLeft": 8,
227
- "opacity": 0.7,
228
450
  "width": 16,
229
451
  },
230
452
  undefined,
231
453
  ]
232
454
  }
233
455
  themePosition="topRight"
456
+ themeSize="medium"
457
+ />
458
+ `;
459
+
460
+ exports[`StyledSpinnerText renders correctly when position is topRight, size is small 1`] = `
461
+ <View
462
+ style={
463
+ Array [
464
+ Object {
465
+ "backgroundColor": "#a08cb0",
466
+ "borderRadius": 999,
467
+ "height": 8,
468
+ "marginLeft": 4,
469
+ "width": 8,
470
+ },
471
+ undefined,
472
+ ]
473
+ }
474
+ themePosition="topRight"
475
+ themeSize="small"
234
476
  />
235
477
  `;
@@ -48,6 +48,7 @@ exports[`Spinner renders correctly 1`] = `
48
48
  ]
49
49
  }
50
50
  themePosition="top"
51
+ themeSize="medium"
51
52
  >
52
53
  <View
53
54
  collapsable={false}
@@ -55,16 +56,16 @@ exports[`Spinner renders correctly 1`] = `
55
56
  style={
56
57
  Array [
57
58
  Object {
58
- "backgroundColor": "#8505a2",
59
- "borderRadius": 8,
59
+ "backgroundColor": "#795e90",
60
+ "borderRadius": 999,
60
61
  "height": 16,
61
- "opacity": 1,
62
62
  "width": 16,
63
63
  },
64
64
  Object {},
65
65
  ]
66
66
  }
67
67
  themePosition="topLeft"
68
+ themeSize="medium"
68
69
  />
69
70
  <View
70
71
  collapsable={false}
@@ -72,17 +73,17 @@ exports[`Spinner renders correctly 1`] = `
72
73
  style={
73
74
  Array [
74
75
  Object {
75
- "backgroundColor": "#8505a2",
76
- "borderRadius": 8,
76
+ "backgroundColor": "#a08cb0",
77
+ "borderRadius": 999,
77
78
  "height": 16,
78
79
  "marginLeft": 8,
79
- "opacity": 0.7,
80
80
  "width": 16,
81
81
  },
82
82
  Object {},
83
83
  ]
84
84
  }
85
85
  themePosition="topRight"
86
+ themeSize="medium"
86
87
  />
87
88
  </View>
88
89
  <View
@@ -98,6 +99,7 @@ exports[`Spinner renders correctly 1`] = `
98
99
  ]
99
100
  }
100
101
  themePosition="bottom"
102
+ themeSize="medium"
101
103
  >
102
104
  <View
103
105
  collapsable={false}
@@ -105,16 +107,16 @@ exports[`Spinner renders correctly 1`] = `
105
107
  style={
106
108
  Array [
107
109
  Object {
108
- "backgroundColor": "#8505a2",
109
- "borderRadius": 8,
110
+ "backgroundColor": "#d9d1df",
111
+ "borderRadius": 999,
110
112
  "height": 16,
111
- "opacity": 0.5,
112
113
  "width": 16,
113
114
  },
114
115
  Object {},
115
116
  ]
116
117
  }
117
118
  themePosition="bottomLeft"
119
+ themeSize="medium"
118
120
  />
119
121
  <View
120
122
  collapsable={false}
@@ -122,17 +124,17 @@ exports[`Spinner renders correctly 1`] = `
122
124
  style={
123
125
  Array [
124
126
  Object {
125
- "backgroundColor": "#8505a2",
126
- "borderRadius": 8,
127
+ "backgroundColor": "#ece8ef",
128
+ "borderRadius": 999,
127
129
  "height": 16,
128
130
  "marginLeft": 8,
129
- "opacity": 0.3,
130
131
  "width": 16,
131
132
  },
132
133
  Object {},
133
134
  ]
134
135
  }
135
136
  themePosition="bottomRight"
137
+ themeSize="medium"
136
138
  />
137
139
  </View>
138
140
  </View>
@@ -5,16 +5,24 @@ import { StyledSpinnerContainer, StyledView } from './StyledSpinner';
5
5
  import { AnimatedSpinner } from './AnimatedSpinner';
6
6
 
7
7
  interface SpinnerProps extends ViewProps {
8
+ /**
9
+ * Size of Spinner.
10
+ */
11
+ size?: 'small' | 'medium';
8
12
  /**
9
13
  * Testing id of the component.
10
14
  */
11
15
  testID?: string;
12
16
  }
13
17
 
14
- const Spinner = ({ testID, ...nativeProps }: SpinnerProps): ReactElement => (
18
+ const Spinner = ({
19
+ testID,
20
+ size = 'medium',
21
+ ...nativeProps
22
+ }: SpinnerProps): ReactElement => (
15
23
  <StyledView {...nativeProps}>
16
24
  <StyledSpinnerContainer testID={testID}>
17
- <AnimatedSpinner />
25
+ <AnimatedSpinner size={size} />
18
26
  </StyledSpinnerContainer>
19
27
  </StyledView>
20
28
  );
@@ -17,8 +17,8 @@ import { useAnimatedValueArray } from './utils';
17
17
  import { isHeroIcon } from '../Icon/utils';
18
18
  import Icon from '../Icon';
19
19
  import Typography from '../Typography';
20
- import Badge from '../Badge';
21
20
  import type { ItemType, TabsProps, TabType } from '.';
21
+ import TabWithBadge from './TabWithBadge';
22
22
 
23
23
  const getTabItem = ({
24
24
  item,
@@ -125,7 +125,8 @@ const ScrollableTab = ({
125
125
  testID,
126
126
  activeItem,
127
127
  inactiveItem: originalInactiveItem,
128
- showBadge = false,
128
+ showBadge,
129
+ badge,
129
130
  } = tab;
130
131
  const active = selectedTabKey === key;
131
132
  const activeAnimated = tabsAnims[index];
@@ -153,7 +154,7 @@ const ScrollableTab = ({
153
154
  }}
154
155
  testID={testID}
155
156
  >
156
- <HeaderTabItem>
157
+ <HeaderTabItem isFirstItem={index === 0}>
157
158
  <HeaderTabItemOutlineWrapper>
158
159
  <HeaderTabItemOutline
159
160
  themeActive={active}
@@ -168,7 +169,11 @@ const ScrollableTab = ({
168
169
  />
169
170
  </HeaderTabItemOutlineWrapper>
170
171
  <HeaderTabItemWrapper>
171
- <Badge.Status visible={showBadge}>{tabItem}</Badge.Status>
172
+ <TabWithBadge
173
+ showBadge={showBadge}
174
+ config={badge}
175
+ tabItem={tabItem}
176
+ />
172
177
  </HeaderTabItemWrapper>
173
178
  </HeaderTabItem>
174
179
  </TouchableWithoutFeedback>
@@ -23,13 +23,14 @@ const HeaderTabWrapper = styled(View)<{
23
23
  borderBottomWidth: theme.__hd__.tabs.borderWidths.headerBottom,
24
24
  }));
25
25
 
26
- const HeaderTabItem = styled(Animated.View)(({ theme }) => ({
27
- paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
28
- paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding,
29
- }));
26
+ const HeaderTabItem = styled(Animated.View)<{ isFirstItem?: boolean }>(
27
+ ({ theme, isFirstItem }) => ({
28
+ marginLeft: isFirstItem ? 0 : theme.__hd__.tabs.space.itemMargin,
29
+ paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding,
30
+ })
31
+ );
30
32
 
31
33
  const HeaderTabItemOutlineWrapper = styled(View)(({ theme }) => ({
32
- paddingHorizontal: theme.__hd__.tabs.space.itemHorizontalPadding,
33
34
  paddingVertical: theme.__hd__.tabs.space.itemVerticalPadding,
34
35
  ...StyleSheet.absoluteFillObject,
35
36
  }));
@@ -45,6 +45,11 @@ const StyledIndicator = styled(Animated.View)<{ themeWidth: number }>(
45
45
  })
46
46
  );
47
47
 
48
+ const StyledBadgeWrapper = styled(View)({
49
+ flexDirection: 'row',
50
+ alignItems: 'center',
51
+ });
52
+
48
53
  export {
49
54
  TabContainer,
50
55
  HeaderTabWrapper,
@@ -53,4 +58,5 @@ export {
53
58
  ContentWrapper,
54
59
  TabScreen,
55
60
  StyledIndicator,
61
+ StyledBadgeWrapper,
56
62
  };