@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
@@ -0,0 +1,68 @@
1
+ import { useTheme } from '@emotion/react';
2
+ import React, { ReactNode } from 'react';
3
+ import { View } from 'react-native';
4
+ import Badge from '../Badge';
5
+ import { StyledBadgeWrapper } from './StyledTabs';
6
+
7
+ export type StatusBadgeType = {
8
+ type: 'status';
9
+ };
10
+
11
+ export type CounterBadgeType = {
12
+ type: 'counter';
13
+ value: number;
14
+ max?: number;
15
+ };
16
+
17
+ export type BadgeConfigType = StatusBadgeType | CounterBadgeType;
18
+
19
+ interface TabWithBadgeProps {
20
+ showBadge?: boolean;
21
+ config?: BadgeConfigType;
22
+ tabItem: ReactNode;
23
+ }
24
+
25
+ const TabWithBadge = ({ showBadge, config, tabItem }: TabWithBadgeProps) => {
26
+ const theme = useTheme();
27
+
28
+ // Deprecated. To be removed.
29
+ if (showBadge !== undefined) {
30
+ return (
31
+ <Badge.Status
32
+ testID="deprecated-badge"
33
+ visible={showBadge}
34
+ style={{ paddingHorizontal: theme.space.small }}
35
+ >
36
+ {tabItem}
37
+ </Badge.Status>
38
+ );
39
+ }
40
+
41
+ if (!config) return <View>{tabItem}</View>;
42
+
43
+ if (config.type === 'status') {
44
+ return (
45
+ <Badge.Status visible style={{ paddingHorizontal: theme.space.xsmall }}>
46
+ {tabItem}
47
+ </Badge.Status>
48
+ );
49
+ }
50
+
51
+ if (config.type === 'counter') {
52
+ return (
53
+ <StyledBadgeWrapper>
54
+ {tabItem}
55
+ <Badge
56
+ content={config.value}
57
+ max={config.max}
58
+ intent="info"
59
+ style={{ marginLeft: theme.space.xsmall }}
60
+ />
61
+ </StyledBadgeWrapper>
62
+ );
63
+ }
64
+
65
+ return <View>{tabItem}</View>;
66
+ };
67
+
68
+ export default TabWithBadge;
@@ -34,6 +34,16 @@ const TestTabsComponent = (
34
34
  component: <Text>Home Screen</Text>,
35
35
  showBadge: true,
36
36
  },
37
+ {
38
+ key: 'calendar',
39
+ activeItem: 'calendar',
40
+ inactiveItem: 'calendar-dates-outlined',
41
+ component: <Text>Calendar Screen</Text>,
42
+ badge: {
43
+ type: 'counter',
44
+ value: 50,
45
+ },
46
+ },
37
47
  ];
38
48
 
39
49
  return (
@@ -73,6 +83,9 @@ describe('Tabs.Scroll', () => {
73
83
  expect(getByText('Personal Screen')).toBeDefined();
74
84
  fireEvent.press(getByTestId('hero-icon-home-outlined'));
75
85
  expect(getByText('Home Screen')).toBeDefined();
86
+ fireEvent.press(getByTestId('hero-icon-calendar-dates-outlined'));
87
+ expect(getByText('Calendar Screen')).toBeDefined();
88
+ expect(getByText('50')).toBeDefined();
76
89
  fireEvent.press(getByText('Move to Work'));
77
90
  expect(getByText('Work Screen')).toBeDefined();
78
91
  });
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
3
+ import TabWithBadge from '../TabWithBadge';
4
+
5
+ const statusBadge = {
6
+ type: 'status',
7
+ } as const;
8
+
9
+ const counterBadge = {
10
+ type: 'counter',
11
+ value: 10,
12
+ } as const;
13
+
14
+ describe('TabWithBadge', () => {
15
+ it.each`
16
+ showBadge
17
+ ${true}
18
+ ${false}
19
+ `('renders correctly when showBadge prop is available', ({ showBadge }) => {
20
+ const { toJSON } = renderWithTheme(
21
+ <TabWithBadge showBadge={showBadge} tabItem="Tab Item" />
22
+ );
23
+
24
+ expect(toJSON()).toMatchSnapshot();
25
+ });
26
+
27
+ it('renders nothing config is not available', () => {
28
+ const { toJSON } = renderWithTheme(<TabWithBadge tabItem="Tab Item" />);
29
+
30
+ expect(toJSON).toMatchSnapshot();
31
+ });
32
+
33
+ it('renders correctly with status badge config', () => {
34
+ const { toJSON } = renderWithTheme(
35
+ <TabWithBadge config={statusBadge} tabItem="Tab Item" />
36
+ );
37
+
38
+ expect(toJSON()).toMatchSnapshot();
39
+ });
40
+
41
+ it('renders correctly with counter badge config', () => {
42
+ const { toJSON } = renderWithTheme(
43
+ <TabWithBadge config={counterBadge} tabItem="Tab Item" />
44
+ );
45
+
46
+ expect(toJSON()).toMatchSnapshot();
47
+ });
48
+ });
@@ -154,6 +154,18 @@ exports[`Tabs.Scroll renders correctly 1`] = `
154
154
  "key": "home",
155
155
  "showBadge": true,
156
156
  },
157
+ Object {
158
+ "activeItem": "calendar",
159
+ "badge": Object {
160
+ "type": "counter",
161
+ "value": 50,
162
+ },
163
+ "component": <Text>
164
+ Calendar Screen
165
+ </Text>,
166
+ "inactiveItem": "calendar-dates-outlined",
167
+ "key": "calendar",
168
+ },
157
169
  ]
158
170
  }
159
171
  getItem={[Function]}
@@ -191,6 +203,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
191
203
  accessible={true}
192
204
  collapsable={false}
193
205
  focusable={true}
206
+ isFirstItem={true}
194
207
  nativeID="animatedComponent"
195
208
  onClick={[Function]}
196
209
  onResponderGrant={[Function]}
@@ -201,7 +214,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
201
214
  onStartShouldSetResponder={[Function]}
202
215
  style={
203
216
  Object {
204
- "paddingHorizontal": 8,
217
+ "marginLeft": 0,
205
218
  "paddingVertical": 8,
206
219
  }
207
220
  }
@@ -212,7 +225,6 @@ exports[`Tabs.Scroll renders correctly 1`] = `
212
225
  Object {
213
226
  "bottom": 0,
214
227
  "left": 0,
215
- "paddingHorizontal": 8,
216
228
  "paddingVertical": 8,
217
229
  "position": "absolute",
218
230
  "right": 0,
@@ -227,7 +239,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
227
239
  nativeID="animatedComponent"
228
240
  style={
229
241
  Object {
230
- "backgroundColor": "#f3e6f6",
242
+ "backgroundColor": "#ece8ef",
231
243
  "borderRadius": 8,
232
244
  "flex": 1,
233
245
  "transform": Array [
@@ -264,7 +276,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
264
276
  "lineHeight": 22,
265
277
  },
266
278
  Object {
267
- "color": "#8505a2",
279
+ "color": "#001f23",
268
280
  },
269
281
  ]
270
282
  }
@@ -274,28 +286,6 @@ exports[`Tabs.Scroll renders correctly 1`] = `
274
286
  >
275
287
  Work
276
288
  </Text>
277
- <View
278
- collapsable={false}
279
- nativeID="animatedComponent"
280
- style={
281
- Object {
282
- "backgroundColor": "#de350b",
283
- "borderRadius": 999,
284
- "height": 8,
285
- "opacity": 0,
286
- "position": "absolute",
287
- "right": -2,
288
- "top": -2,
289
- "transform": Array [
290
- Object {
291
- "scale": 0.5,
292
- },
293
- ],
294
- "width": 8,
295
- }
296
- }
297
- themeIntent="danger"
298
- />
299
289
  </View>
300
290
  </View>
301
291
  </View>
@@ -315,6 +305,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
315
305
  accessible={true}
316
306
  collapsable={false}
317
307
  focusable={true}
308
+ isFirstItem={false}
318
309
  nativeID="animatedComponent"
319
310
  onClick={[Function]}
320
311
  onResponderGrant={[Function]}
@@ -325,7 +316,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
325
316
  onStartShouldSetResponder={[Function]}
326
317
  style={
327
318
  Object {
328
- "paddingHorizontal": 8,
319
+ "marginLeft": 12,
329
320
  "paddingVertical": 8,
330
321
  }
331
322
  }
@@ -336,7 +327,6 @@ exports[`Tabs.Scroll renders correctly 1`] = `
336
327
  Object {
337
328
  "bottom": 0,
338
329
  "left": 0,
339
- "paddingHorizontal": 8,
340
330
  "paddingVertical": 8,
341
331
  "position": "absolute",
342
332
  "right": 0,
@@ -391,6 +381,108 @@ exports[`Tabs.Scroll renders correctly 1`] = `
391
381
  themeIntent="text"
392
382
  themeSize="small"
393
383
  />
384
+ </View>
385
+ </View>
386
+ </View>
387
+ </View>
388
+ <View
389
+ onLayout={[Function]}
390
+ style={
391
+ Array [
392
+ Object {
393
+ "flexDirection": "row",
394
+ },
395
+ null,
396
+ ]
397
+ }
398
+ >
399
+ <View
400
+ accessible={true}
401
+ collapsable={false}
402
+ focusable={true}
403
+ isFirstItem={false}
404
+ nativeID="animatedComponent"
405
+ onClick={[Function]}
406
+ onResponderGrant={[Function]}
407
+ onResponderMove={[Function]}
408
+ onResponderRelease={[Function]}
409
+ onResponderTerminate={[Function]}
410
+ onResponderTerminationRequest={[Function]}
411
+ onStartShouldSetResponder={[Function]}
412
+ style={
413
+ Object {
414
+ "marginLeft": 12,
415
+ "paddingVertical": 8,
416
+ }
417
+ }
418
+ >
419
+ <View
420
+ style={
421
+ Array [
422
+ Object {
423
+ "bottom": 0,
424
+ "left": 0,
425
+ "paddingVertical": 8,
426
+ "position": "absolute",
427
+ "right": 0,
428
+ "top": 0,
429
+ },
430
+ undefined,
431
+ ]
432
+ }
433
+ >
434
+ <View
435
+ collapsable={false}
436
+ nativeID="animatedComponent"
437
+ style={
438
+ Object {
439
+ "backgroundColor": undefined,
440
+ "borderRadius": 8,
441
+ "flex": 1,
442
+ "transform": Array [
443
+ Object {
444
+ "scaleX": 0,
445
+ },
446
+ ],
447
+ }
448
+ }
449
+ themeActive={false}
450
+ />
451
+ </View>
452
+ <View
453
+ style={
454
+ Array [
455
+ Object {
456
+ "paddingHorizontal": 8,
457
+ "paddingVertical": 4,
458
+ },
459
+ undefined,
460
+ ]
461
+ }
462
+ >
463
+ <View
464
+ style={
465
+ Object {
466
+ "paddingHorizontal": 8,
467
+ }
468
+ }
469
+ testID="deprecated-badge"
470
+ >
471
+ <HeroIcon
472
+ name="home-outlined"
473
+ style={
474
+ Array [
475
+ Object {
476
+ "color": "#001f23",
477
+ "fontSize": 20,
478
+ },
479
+ undefined,
480
+ ]
481
+ }
482
+ testID="hero-icon-home-outlined"
483
+ themeIntent="text"
484
+ themeSize="small"
485
+ />
394
486
  <View
395
487
  collapsable={false}
396
488
  nativeID="animatedComponent"
@@ -399,13 +491,13 @@ exports[`Tabs.Scroll renders correctly 1`] = `
399
491
  "backgroundColor": "#de350b",
400
492
  "borderRadius": 999,
401
493
  "height": 8,
402
- "opacity": 0,
494
+ "opacity": 1,
403
495
  "position": "absolute",
404
496
  "right": -2,
405
497
  "top": -2,
406
498
  "transform": Array [
407
499
  Object {
408
- "scale": 0.5,
500
+ "scale": 1,
409
501
  },
410
502
  ],
411
503
  "width": 8,
@@ -432,6 +524,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
432
524
  accessible={true}
433
525
  collapsable={false}
434
526
  focusable={true}
527
+ isFirstItem={false}
435
528
  nativeID="animatedComponent"
436
529
  onClick={[Function]}
437
530
  onResponderGrant={[Function]}
@@ -442,7 +535,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
442
535
  onStartShouldSetResponder={[Function]}
443
536
  style={
444
537
  Object {
445
- "paddingHorizontal": 8,
538
+ "marginLeft": 12,
446
539
  "paddingVertical": 8,
447
540
  }
448
541
  }
@@ -453,7 +546,6 @@ exports[`Tabs.Scroll renders correctly 1`] = `
453
546
  Object {
454
547
  "bottom": 0,
455
548
  "left": 0,
456
- "paddingHorizontal": 8,
457
549
  "paddingVertical": 8,
458
550
  "position": "absolute",
459
551
  "right": 0,
@@ -492,9 +584,19 @@ exports[`Tabs.Scroll renders correctly 1`] = `
492
584
  ]
493
585
  }
494
586
  >
495
- <View>
587
+ <View
588
+ style={
589
+ Array [
590
+ Object {
591
+ "alignItems": "center",
592
+ "flexDirection": "row",
593
+ },
594
+ undefined,
595
+ ]
596
+ }
597
+ >
496
598
  <HeroIcon
497
- name="home-outlined"
599
+ name="calendar-dates-outlined"
498
600
  style={
499
601
  Array [
500
602
  Object {
@@ -504,7 +606,7 @@ exports[`Tabs.Scroll renders correctly 1`] = `
504
606
  undefined,
505
607
  ]
506
608
  }
507
- testID="hero-icon-home-outlined"
609
+ testID="hero-icon-calendar-dates-outlined"
508
610
  themeIntent="text"
509
611
  themeSize="small"
510
612
  />
@@ -513,23 +615,43 @@ exports[`Tabs.Scroll renders correctly 1`] = `
513
615
  nativeID="animatedComponent"
514
616
  style={
515
617
  Object {
516
- "backgroundColor": "#de350b",
618
+ "alignItems": "center",
619
+ "backgroundColor": "#4568fb",
517
620
  "borderRadius": 999,
518
- "height": 8,
621
+ "height": 20,
622
+ "justifyContent": "center",
623
+ "marginLeft": 4,
624
+ "minWidth": 20,
519
625
  "opacity": 1,
520
- "position": "absolute",
521
- "right": -2,
522
- "top": -2,
626
+ "paddingHorizontal": 8,
523
627
  "transform": Array [
524
628
  Object {
525
629
  "scale": 1,
526
630
  },
527
631
  ],
528
- "width": 8,
529
632
  }
530
633
  }
531
- themeIntent="danger"
532
- />
634
+ themeIntent="info"
635
+ themePadding="wideContent"
636
+ >
637
+ <Text
638
+ style={
639
+ Array [
640
+ Object {
641
+ "color": "#ffffff",
642
+ "fontFamily": "BeVietnamPro-SemiBold",
643
+ "fontSize": 12,
644
+ "includeFontPadding": false,
645
+ "textAlign": "center",
646
+ "textAlignVertical": "center",
647
+ },
648
+ undefined,
649
+ ]
650
+ }
651
+ >
652
+ 50
653
+ </Text>
654
+ </View>
533
655
  </View>
534
656
  </View>
535
657
  </View>
@@ -664,6 +786,46 @@ exports[`Tabs.Scroll renders correctly 1`] = `
664
786
  </Text>
665
787
  </View>
666
788
  </View>
789
+ <View
790
+ collapsable={false}
791
+ style={
792
+ Object {
793
+ "bottom": 0,
794
+ "left": 0,
795
+ "position": "absolute",
796
+ "right": 0,
797
+ "top": 0,
798
+ }
799
+ }
800
+ >
801
+ <View
802
+ accessibilityElementsHidden={true}
803
+ collapsable={false}
804
+ importantForAccessibility="no-hide-descendants"
805
+ pointerEvents="none"
806
+ style={
807
+ Array [
808
+ Object {
809
+ "flex": 1,
810
+ },
811
+ Array [
812
+ undefined,
813
+ Object {
814
+ "bottom": 0,
815
+ "left": 0,
816
+ "position": "absolute",
817
+ "right": 0,
818
+ "top": 0,
819
+ },
820
+ ],
821
+ ]
822
+ }
823
+ >
824
+ <Text>
825
+ Calendar Screen
826
+ </Text>
827
+ </View>
828
+ </View>
667
829
  </RNCViewPager>
668
830
  </View>
669
831
  </RNCSafeAreaProvider>
@@ -0,0 +1,165 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`TabWithBadge renders correctly when showBadge prop is available 1`] = `
4
+ <View
5
+ style={
6
+ Object {
7
+ "paddingHorizontal": 8,
8
+ }
9
+ }
10
+ testID="deprecated-badge"
11
+ >
12
+ Tab Item
13
+ <View
14
+ collapsable={false}
15
+ nativeID="animatedComponent"
16
+ style={
17
+ Object {
18
+ "backgroundColor": "#de350b",
19
+ "borderRadius": 999,
20
+ "height": 8,
21
+ "opacity": 1,
22
+ "position": "absolute",
23
+ "right": -2,
24
+ "top": -2,
25
+ "transform": Array [
26
+ Object {
27
+ "scale": 1,
28
+ },
29
+ ],
30
+ "width": 8,
31
+ }
32
+ }
33
+ themeIntent="danger"
34
+ />
35
+ </View>
36
+ `;
37
+
38
+ exports[`TabWithBadge renders correctly when showBadge prop is available 2`] = `
39
+ <View
40
+ style={
41
+ Object {
42
+ "paddingHorizontal": 8,
43
+ }
44
+ }
45
+ testID="deprecated-badge"
46
+ >
47
+ Tab Item
48
+ <View
49
+ collapsable={false}
50
+ nativeID="animatedComponent"
51
+ style={
52
+ Object {
53
+ "backgroundColor": "#de350b",
54
+ "borderRadius": 999,
55
+ "height": 8,
56
+ "opacity": 0,
57
+ "position": "absolute",
58
+ "right": -2,
59
+ "top": -2,
60
+ "transform": Array [
61
+ Object {
62
+ "scale": 0.5,
63
+ },
64
+ ],
65
+ "width": 8,
66
+ }
67
+ }
68
+ themeIntent="danger"
69
+ />
70
+ </View>
71
+ `;
72
+
73
+ exports[`TabWithBadge renders correctly with counter badge config 1`] = `
74
+ <View
75
+ style={
76
+ Array [
77
+ Object {
78
+ "alignItems": "center",
79
+ "flexDirection": "row",
80
+ },
81
+ undefined,
82
+ ]
83
+ }
84
+ >
85
+ Tab Item
86
+ <View
87
+ collapsable={false}
88
+ nativeID="animatedComponent"
89
+ style={
90
+ Object {
91
+ "alignItems": "center",
92
+ "backgroundColor": "#4568fb",
93
+ "borderRadius": 999,
94
+ "height": 20,
95
+ "justifyContent": "center",
96
+ "marginLeft": 4,
97
+ "minWidth": 20,
98
+ "opacity": 1,
99
+ "paddingHorizontal": 8,
100
+ "transform": Array [
101
+ Object {
102
+ "scale": 1,
103
+ },
104
+ ],
105
+ }
106
+ }
107
+ themeIntent="info"
108
+ themePadding="wideContent"
109
+ >
110
+ <Text
111
+ style={
112
+ Array [
113
+ Object {
114
+ "color": "#ffffff",
115
+ "fontFamily": "BeVietnamPro-SemiBold",
116
+ "fontSize": 12,
117
+ "includeFontPadding": false,
118
+ "textAlign": "center",
119
+ "textAlignVertical": "center",
120
+ },
121
+ undefined,
122
+ ]
123
+ }
124
+ >
125
+ 10
126
+ </Text>
127
+ </View>
128
+ </View>
129
+ `;
130
+
131
+ exports[`TabWithBadge renders correctly with status badge config 1`] = `
132
+ <View
133
+ style={
134
+ Object {
135
+ "paddingHorizontal": 4,
136
+ }
137
+ }
138
+ >
139
+ Tab Item
140
+ <View
141
+ collapsable={false}
142
+ nativeID="animatedComponent"
143
+ style={
144
+ Object {
145
+ "backgroundColor": "#de350b",
146
+ "borderRadius": 999,
147
+ "height": 8,
148
+ "opacity": 1,
149
+ "position": "absolute",
150
+ "right": -2,
151
+ "top": -2,
152
+ "transform": Array [
153
+ Object {
154
+ "scale": 1,
155
+ },
156
+ ],
157
+ "width": 8,
158
+ }
159
+ }
160
+ themeIntent="danger"
161
+ />
162
+ </View>
163
+ `;
164
+
165
+ exports[`TabWithBadge renders nothing config is not available 1`] = `[Function]`;