@hero-design/rn 8.33.1 → 8.34.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 (202) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/assets/fonts/hero-icons-mobile.ttf +0 -0
  3. package/es/index.js +868 -655
  4. package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
  5. package/lib/index.js +871 -656
  6. package/package.json +8 -7
  7. package/rollup.config.js +1 -0
  8. package/src/components/Accordion/AccordionItem.tsx +1 -3
  9. package/src/components/Accordion/__tests__/AccordionItem.spec.tsx +5 -5
  10. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +26 -34
  11. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +36 -48
  12. package/src/components/Accordion/__tests__/index.spec.tsx +2 -2
  13. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +26 -39
  14. package/src/components/Alert/__tests__/index.spec.tsx +8 -2
  15. package/src/components/Alert/index.tsx +2 -2
  16. package/src/components/Attachment/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
  17. package/src/components/Attachment/index.tsx +3 -1
  18. package/src/components/Badge/StyledBadge.tsx +1 -4
  19. package/src/components/Badge/__tests__/Status.spec.tsx +1 -1
  20. package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +18 -48
  21. package/src/components/Badge/__tests__/__snapshots__/Status.spec.tsx.snap +2 -3
  22. package/src/components/BottomNavigation/StyledBottomNavigation.tsx +1 -1
  23. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +4 -12
  24. package/src/components/BottomNavigation/index.tsx +0 -1
  25. package/src/components/BottomSheet/Header.tsx +1 -3
  26. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
  27. package/src/components/Button/Button.tsx +34 -11
  28. package/src/components/Button/StyledButton.tsx +45 -38
  29. package/src/components/Button/UtilityButton/StyledUtilityButton.tsx +2 -4
  30. package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +8 -14
  31. package/src/components/Button/__tests__/StyledButton.spec.tsx +12 -6
  32. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +66 -90
  33. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +56 -86
  34. package/src/components/Calendar/CalendarRowItem.tsx +5 -2
  35. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +10 -15
  36. package/src/components/Calendar/index.tsx +1 -1
  37. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +12 -18
  38. package/src/components/Card/__tests__/index.spec.tsx +1 -1
  39. package/src/components/Carousel/CardCarousel.tsx +2 -0
  40. package/src/components/Carousel/CarouselItem.tsx +4 -4
  41. package/src/components/Carousel/StyledCarousel.tsx +1 -4
  42. package/src/components/Carousel/__tests__/CardCarousel.spec.tsx +18 -18
  43. package/src/components/Carousel/__tests__/__snapshots__/CardCarousel.spec.tsx.snap +24 -20
  44. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +99 -165
  45. package/src/components/Checkbox/StyledCheckbox.tsx +1 -1
  46. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +8 -12
  47. package/src/components/Checkbox/index.tsx +1 -1
  48. package/src/components/ContentNavigator/StyledContentNavigator.tsx +1 -6
  49. package/src/components/ContentNavigator/__tests__/StyledContentNavigator.spec.tsx +1 -9
  50. package/src/components/ContentNavigator/__tests__/__snapshots__/StyledContentNavigator.spec.tsx.snap +0 -29
  51. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +124 -17
  52. package/src/components/ContentNavigator/__tests__/index.spec.tsx +16 -0
  53. package/src/components/ContentNavigator/index.tsx +30 -9
  54. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +12 -18
  55. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +4 -6
  56. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +4 -6
  57. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +13 -18
  58. package/src/components/Empty/StyledEmpty.tsx +2 -6
  59. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +22 -36
  60. package/src/components/Empty/index.tsx +4 -2
  61. package/src/components/Error/StyledError.tsx +2 -8
  62. package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +44 -76
  63. package/src/components/Error/index.tsx +6 -2
  64. package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +1 -4
  65. package/src/components/FAB/ActionGroup/StyledActionItem.tsx +1 -5
  66. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +54 -116
  67. package/src/components/FAB/ActionGroup/index.tsx +1 -1
  68. package/src/components/FAB/StyledFAB.tsx +1 -4
  69. package/src/components/FAB/__tests__/StyledFAB.spec.tsx +1 -1
  70. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +2 -3
  71. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +4 -8
  72. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  73. package/src/components/Icon/IconList.ts +2 -0
  74. package/src/components/List/BasicListItem.tsx +2 -6
  75. package/src/components/List/ListItem.tsx +3 -5
  76. package/src/components/List/__tests__/ListItem.spec.tsx +4 -4
  77. package/src/components/List/__tests__/StyledBasicListItem.spec.tsx +3 -1
  78. package/src/components/List/__tests__/StyledListItem.spec.tsx +3 -1
  79. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +4 -10
  80. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +23 -37
  81. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +8 -12
  82. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +8 -12
  83. package/src/components/Modal/ModalContentWrapper.tsx +112 -0
  84. package/src/components/Modal/ModalPresenter/ModalPresenter.tsx +135 -0
  85. package/src/components/Modal/ModalPresenter/index.tsx +9 -0
  86. package/src/components/Modal/ModalProvider.tsx +8 -0
  87. package/src/components/Modal/__tests__/ModalContentWrapper.spec.tsx +25 -0
  88. package/src/components/Modal/__tests__/ModalPresenter.spec.tsx +57 -0
  89. package/src/components/Modal/__tests__/__snapshots__/ModalContentWrapper.spec.tsx.snap +35 -0
  90. package/src/components/Modal/__tests__/__snapshots__/ModalPresenter.spec.tsx.snap +55 -0
  91. package/src/components/Modal/__tests__/index.spec.tsx +50 -0
  92. package/src/components/Modal/index.tsx +121 -0
  93. package/src/components/PageControl/index.tsx +0 -1
  94. package/src/components/PinInput/PinCell.tsx +3 -1
  95. package/src/components/PinInput/StyledPinInput.tsx +2 -7
  96. package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +25 -45
  97. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +18 -34
  98. package/src/components/PinInput/index.tsx +2 -0
  99. package/src/components/Progress/ProgressCircle.tsx +1 -3
  100. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +3 -6
  101. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +2 -4
  102. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +3 -6
  103. package/src/components/RichTextEditor/RichTextEditor.tsx +7 -11
  104. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +16 -24
  105. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
  106. package/src/components/SectionHeading/__tests__/index.spec.tsx +3 -1
  107. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -2
  108. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +12 -24
  109. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +86 -130
  110. package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +6 -10
  111. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -2
  112. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +12 -24
  113. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +49 -79
  114. package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +5 -9
  115. package/src/components/Success/StyledSuccess.tsx +2 -6
  116. package/src/components/Success/__tests__/__snapshots__/index.spec.tsx.snap +40 -64
  117. package/src/components/Success/index.tsx +3 -1
  118. package/src/components/Swipeable/__tests__/SwipeableAction.spec.tsx +2 -2
  119. package/src/components/Swipeable/__tests__/__snapshots__/SwipeableAction.spec.tsx.snap +6 -9
  120. package/src/components/Swipeable/__tests__/__snapshots__/index.spec.tsx.snap +2 -3
  121. package/src/components/Swipeable/__tests__/index.spec.tsx +6 -4
  122. package/src/components/Switch/SelectorSwitch/Option.tsx +1 -1
  123. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/Option.spec.tsx.snap +1 -2
  124. package/src/components/Switch/SelectorSwitch/__tests__/__snapshots__/index.spec.tsx.snap +1 -2
  125. package/src/components/Tabs/ScrollableTabsHeader.tsx +3 -3
  126. package/src/components/Tabs/__tests__/SceneView.spec.tsx +4 -4
  127. package/src/components/Tabs/__tests__/__snapshots__/SceneView.spec.tsx.snap +6 -9
  128. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +33 -60
  129. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabsHeader.spec.tsx.snap +7 -13
  130. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +3 -8
  131. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +45 -81
  132. package/src/components/Tabs/index.tsx +3 -3
  133. package/src/components/Tag/StyledTag.tsx +1 -4
  134. package/src/components/Tag/__tests__/Tag.spec.tsx +5 -1
  135. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +47 -93
  136. package/src/components/Tag/index.tsx +5 -1
  137. package/src/components/TextInput/StyledTextInput.tsx +8 -16
  138. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +72 -134
  139. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +145 -257
  140. package/src/components/TextInput/index.tsx +2 -3
  141. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +12 -23
  142. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +21 -35
  143. package/src/components/Toast/Toast.tsx +6 -5
  144. package/src/components/Toast/ToastContainer.tsx +2 -0
  145. package/src/components/Toast/__tests__/Toast.spec.tsx +5 -1
  146. package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +26 -39
  147. package/src/components/Toolbar/StyledToolbar.tsx +1 -1
  148. package/src/components/Toolbar/ToolbarItem.tsx +4 -6
  149. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -18
  150. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +14 -21
  151. package/src/index.ts +2 -0
  152. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +4 -0
  153. package/src/theme/components/badge.ts +15 -0
  154. package/src/theme/components/button.ts +16 -0
  155. package/src/theme/components/carousel.ts +15 -0
  156. package/src/theme/components/empty.ts +12 -0
  157. package/src/theme/components/error.ts +16 -0
  158. package/src/theme/components/fab.ts +11 -0
  159. package/src/theme/components/pinInput.ts +15 -0
  160. package/src/theme/components/success.ts +12 -0
  161. package/src/theme/components/tag.ts +16 -0
  162. package/src/theme/components/textInput.ts +1 -0
  163. package/src/theme/getTheme.ts +18 -18
  164. package/testUtils/setup.tsx +24 -0
  165. package/types/components/Badge/StyledBadge.d.ts +1 -1
  166. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +1 -1
  167. package/types/components/Button/StyledButton.d.ts +12 -5
  168. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +1 -1
  169. package/types/components/Carousel/StyledCarousel.d.ts +1 -1
  170. package/types/components/Checkbox/StyledCheckbox.d.ts +1 -1
  171. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +1 -5
  172. package/types/components/Empty/StyledEmpty.d.ts +2 -2
  173. package/types/components/Error/StyledError.d.ts +2 -2
  174. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +2 -2
  175. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +1 -1
  176. package/types/components/FAB/StyledFAB.d.ts +1 -1
  177. package/types/components/Icon/IconList.d.ts +1 -1
  178. package/types/components/Icon/index.d.ts +1 -1
  179. package/types/components/Icon/utils.d.ts +1 -1
  180. package/types/components/Modal/ModalContentWrapper.d.ts +16 -0
  181. package/types/components/Modal/ModalPresenter/ModalPresenter.d.ts +34 -0
  182. package/types/components/Modal/ModalPresenter/index.d.ts +3 -0
  183. package/types/components/Modal/ModalProvider.d.ts +5 -0
  184. package/types/components/Modal/index.d.ts +33 -0
  185. package/types/components/PinInput/StyledPinInput.d.ts +2 -2
  186. package/types/components/RichTextEditor/RichTextEditor.d.ts +2 -2
  187. package/types/components/Success/StyledSuccess.d.ts +2 -2
  188. package/types/components/Tag/StyledTag.d.ts +1 -1
  189. package/types/components/TextInput/StyledTextInput.d.ts +7 -10
  190. package/types/components/Toolbar/StyledToolbar.d.ts +1 -1
  191. package/types/index.d.ts +2 -1
  192. package/types/theme/components/badge.d.ts +15 -0
  193. package/types/theme/components/button.d.ts +14 -0
  194. package/types/theme/components/carousel.d.ts +15 -0
  195. package/types/theme/components/empty.d.ts +11 -0
  196. package/types/theme/components/error.d.ts +15 -0
  197. package/types/theme/components/fab.d.ts +11 -0
  198. package/types/theme/components/pinInput.d.ts +15 -0
  199. package/types/theme/components/success.d.ts +11 -0
  200. package/types/theme/components/tag.d.ts +15 -0
  201. package/types/theme/components/textInput.d.ts +1 -0
  202. package/types/theme/getTheme.d.ts +18 -18
@@ -161,7 +161,7 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is false
161
161
  "color": "#001f23",
162
162
  "fontFamily": "BeVietnamPro-Regular",
163
163
  "fontSize": 14,
164
- "letterSpacing": 0.42,
164
+ "letterSpacing": 0.48,
165
165
  "lineHeight": 22,
166
166
  },
167
167
  Array [
@@ -173,10 +173,9 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is false
173
173
  ],
174
174
  ]
175
175
  }
176
- themeFontSize="medium"
177
- themeFontWeight="regular"
178
176
  themeIntent="body"
179
177
  themeTypeface="neutral"
178
+ themeVariant="small"
180
179
  >
181
180
  Please agree to our privacy policy
182
181
  </Text>
@@ -246,7 +245,7 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is true 1
246
245
  "color": "#001f23",
247
246
  "fontFamily": "BeVietnamPro-Regular",
248
247
  "fontSize": 14,
249
- "letterSpacing": 0.42,
248
+ "letterSpacing": 0.48,
250
249
  "lineHeight": 22,
251
250
  },
252
251
  Array [
@@ -258,10 +257,9 @@ exports[`Checkbox renders correctly when disabled is false, withBorder is true 1
258
257
  ],
259
258
  ]
260
259
  }
261
- themeFontSize="medium"
262
- themeFontWeight="regular"
263
260
  themeIntent="body"
264
261
  themeTypeface="neutral"
262
+ themeVariant="small"
265
263
  >
266
264
  Please agree to our privacy policy
267
265
  </Text>
@@ -327,7 +325,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
327
325
  "color": "#4d6265",
328
326
  "fontFamily": "BeVietnamPro-Regular",
329
327
  "fontSize": 14,
330
- "letterSpacing": 0.42,
328
+ "letterSpacing": 0.48,
331
329
  "lineHeight": 22,
332
330
  },
333
331
  Array [
@@ -339,10 +337,9 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is false 1
339
337
  ],
340
338
  ]
341
339
  }
342
- themeFontSize="medium"
343
- themeFontWeight="regular"
344
340
  themeIntent="subdued"
345
341
  themeTypeface="neutral"
342
+ themeVariant="small"
346
343
  >
347
344
  Please agree to our privacy policy
348
345
  </Text>
@@ -412,7 +409,7 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
412
409
  "color": "#4d6265",
413
410
  "fontFamily": "BeVietnamPro-Regular",
414
411
  "fontSize": 14,
415
- "letterSpacing": 0.42,
412
+ "letterSpacing": 0.48,
416
413
  "lineHeight": 22,
417
414
  },
418
415
  Array [
@@ -424,10 +421,9 @@ exports[`Checkbox renders correctly when disabled is true, withBorder is true 1`
424
421
  ],
425
422
  ]
426
423
  }
427
- themeFontSize="medium"
428
- themeFontWeight="regular"
429
424
  themeIntent="subdued"
430
425
  themeTypeface="neutral"
426
+ themeVariant="small"
431
427
  >
432
428
  Please agree to our privacy policy
433
429
  </Text>
@@ -57,7 +57,7 @@ const Checkbox = ({
57
57
  testID={testID}
58
58
  >
59
59
  {!!description && (
60
- <StyledDescription intent={disabled ? 'subdued' : 'body'}>
60
+ <StyledDescription intent={disabled ? 'subdued' : 'body'} variant="small">
61
61
  {description}
62
62
  </StyledDescription>
63
63
  )}
@@ -1,6 +1,5 @@
1
1
  import { View } from 'react-native';
2
2
  import styled from '@emotion/native';
3
- import Typography from '../Typography';
4
3
 
5
4
  const Wrapper = styled(View)(() => ({
6
5
  flex: 1,
@@ -8,8 +7,4 @@ const Wrapper = styled(View)(() => ({
8
7
  justifyContent: 'space-between',
9
8
  }));
10
9
 
11
- const Value = styled(Typography.Text)(({ theme }) => ({
12
- paddingHorizontal: theme.__hd__.contentNavigator.space.valueHorizontalPadding,
13
- }));
14
-
15
- export { Wrapper, Value };
10
+ export { Wrapper };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import renderWithTheme from '../../../testHelpers/renderWithTheme';
3
- import { Value, Wrapper } from '../StyledContentNavigator';
3
+ import { Wrapper } from '../StyledContentNavigator';
4
4
 
5
5
  describe('Wrapper', () => {
6
6
  it('has correct style', () => {
@@ -9,11 +9,3 @@ describe('Wrapper', () => {
9
9
  expect(toJSON()).toMatchSnapshot();
10
10
  });
11
11
  });
12
-
13
- describe('Value', () => {
14
- it('has correct style', () => {
15
- const { toJSON } = renderWithTheme(<Value>Text</Value>);
16
-
17
- expect(toJSON()).toMatchSnapshot();
18
- });
19
- });
@@ -1,34 +1,5 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Value has correct style 1`] = `
4
- <Text
5
- allowFontScaling={false}
6
- style={
7
- Array [
8
- Object {
9
- "color": "#001f23",
10
- "fontFamily": "BeVietnamPro-Regular",
11
- "fontSize": 14,
12
- "letterSpacing": 0.42,
13
- "lineHeight": 22,
14
- },
15
- Array [
16
- Object {
17
- "paddingHorizontal": 8,
18
- },
19
- undefined,
20
- ],
21
- ]
22
- }
23
- themeFontSize="medium"
24
- themeFontWeight="regular"
25
- themeIntent="body"
26
- themeTypeface="neutral"
27
- >
28
- Text
29
- </Text>
30
- `;
31
-
32
3
  exports[`Wrapper has correct style 1`] = `
33
4
  <View
34
5
  style={
@@ -59,22 +59,18 @@ exports[`rendering renders correctly 1`] = `
59
59
  "color": "#001f23",
60
60
  "fontFamily": "BeVietnamPro-SemiBold",
61
61
  "fontSize": 14,
62
- "letterSpacing": 0.42,
62
+ "letterSpacing": 0.24,
63
63
  "lineHeight": 22,
64
64
  },
65
- Array [
66
- Object {
67
- "paddingHorizontal": 8,
68
- },
69
- undefined,
70
- ],
65
+ Object {
66
+ "paddingHorizontal": 8,
67
+ },
71
68
  ]
72
69
  }
73
70
  testID="content-navigator-value"
74
- themeFontSize="medium"
75
- themeFontWeight="semi-bold"
76
71
  themeIntent="body"
77
72
  themeTypeface="neutral"
73
+ themeVariant="small-bold"
78
74
  >
79
75
  20
80
76
  </Text>
@@ -178,21 +174,132 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
178
174
  "color": "#001f23",
179
175
  "fontFamily": "BeVietnamPro-SemiBold",
180
176
  "fontSize": 14,
181
- "letterSpacing": 0.42,
177
+ "letterSpacing": 0.24,
182
178
  "lineHeight": 22,
183
179
  },
180
+ Object {
181
+ "paddingHorizontal": 8,
182
+ },
183
+ ]
184
+ }
185
+ testID="content-navigator-value"
186
+ themeIntent="body"
187
+ themeTypeface="neutral"
188
+ themeVariant="small-bold"
189
+ >
190
+ 20
191
+ </Text>
192
+ <View
193
+ accessibilityState={
194
+ Object {
195
+ "disabled": true,
196
+ }
197
+ }
198
+ accessible={true}
199
+ collapsable={false}
200
+ focusable={true}
201
+ onClick={[Function]}
202
+ onResponderGrant={[Function]}
203
+ onResponderMove={[Function]}
204
+ onResponderRelease={[Function]}
205
+ onResponderTerminate={[Function]}
206
+ onResponderTerminationRequest={[Function]}
207
+ onStartShouldSetResponder={[Function]}
208
+ style={
209
+ Object {
210
+ "opacity": 1,
211
+ }
212
+ }
213
+ testID="next-icon-button"
214
+ >
215
+ <HeroIcon
216
+ name="arrow-right"
217
+ style={
184
218
  Array [
185
219
  Object {
186
- "paddingHorizontal": 8,
220
+ "color": "#bfc1c5",
221
+ "fontSize": 24,
187
222
  },
188
223
  undefined,
189
- ],
224
+ ]
225
+ }
226
+ themeIntent="disabled-text"
227
+ themeSize="medium"
228
+ />
229
+ </View>
230
+ </View>
231
+ `;
232
+
233
+ exports[`rendering renders correctly with large 1`] = `
234
+ <View
235
+ style={
236
+ Array [
237
+ Object {
238
+ "flex": 1,
239
+ "flexDirection": "row",
240
+ "justifyContent": "space-between",
241
+ },
242
+ undefined,
243
+ ]
244
+ }
245
+ >
246
+ <View
247
+ accessibilityState={
248
+ Object {
249
+ "disabled": false,
250
+ }
251
+ }
252
+ accessible={true}
253
+ collapsable={false}
254
+ focusable={true}
255
+ onClick={[Function]}
256
+ onResponderGrant={[Function]}
257
+ onResponderMove={[Function]}
258
+ onResponderRelease={[Function]}
259
+ onResponderTerminate={[Function]}
260
+ onResponderTerminationRequest={[Function]}
261
+ onStartShouldSetResponder={[Function]}
262
+ style={
263
+ Object {
264
+ "opacity": 1,
265
+ }
266
+ }
267
+ testID="previous-icon-button"
268
+ >
269
+ <HeroIcon
270
+ name="arrow-left"
271
+ style={
272
+ Array [
273
+ Object {
274
+ "color": "#001f23",
275
+ "fontSize": 24,
276
+ },
277
+ undefined,
278
+ ]
279
+ }
280
+ themeIntent="text"
281
+ themeSize="medium"
282
+ />
283
+ </View>
284
+ <Text
285
+ allowFontScaling={false}
286
+ style={
287
+ Array [
288
+ Object {
289
+ "color": "#001f23",
290
+ "fontFamily": "BeVietnamPro-SemiBold",
291
+ "fontSize": 18,
292
+ "letterSpacing": 0.24,
293
+ "lineHeight": 28,
294
+ },
295
+ Object {
296
+ "paddingHorizontal": 8,
297
+ },
190
298
  ]
191
299
  }
192
300
  testID="content-navigator-value"
193
- themeFontSize="medium"
194
- themeFontWeight="semi-bold"
195
301
  themeIntent="body"
302
+ themeLevel="h5"
196
303
  themeTypeface="neutral"
197
304
  >
198
305
  20
@@ -200,7 +307,7 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
200
307
  <View
201
308
  accessibilityState={
202
309
  Object {
203
- "disabled": true,
310
+ "disabled": false,
204
311
  }
205
312
  }
206
313
  accessible={true}
@@ -225,13 +332,13 @@ exports[`rendering renders correctly when icon buttons are disabled 1`] = `
225
332
  style={
226
333
  Array [
227
334
  Object {
228
- "color": "#bfc1c5",
335
+ "color": "#001f23",
229
336
  "fontSize": 24,
230
337
  },
231
338
  undefined,
232
339
  ]
233
340
  }
234
- themeIntent="disabled-text"
341
+ themeIntent="text"
235
342
  themeSize="medium"
236
343
  />
237
344
  </View>
@@ -33,6 +33,22 @@ describe('rendering', () => {
33
33
  expect(getByText('20')).toBeDefined();
34
34
  expect(toJSON()).toMatchSnapshot();
35
35
  });
36
+
37
+ it('renders correctly with large', () => {
38
+ const { toJSON, getByText, queryAllByTestId } = renderWithTheme(
39
+ <ContentNavigator
40
+ value={20}
41
+ onPreviousPress={jest.fn()}
42
+ onNextPress={jest.fn()}
43
+ fontSize="large"
44
+ />
45
+ );
46
+
47
+ expect(getByText('20')).toBeDefined();
48
+ expect(toJSON()).toMatchSnapshot();
49
+ expect(queryAllByTestId('previous-icon-button')).toHaveLength(1);
50
+ expect(queryAllByTestId('next-icon-button')).toHaveLength(1);
51
+ });
36
52
  });
37
53
 
38
54
  describe('behavior', () => {
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { StyleProp, ViewStyle } from 'react-native';
4
- import { Value, Wrapper } from './StyledContentNavigator';
4
+ import { Wrapper } from './StyledContentNavigator';
5
5
  import Button from '../Button';
6
+ import Typography from '../Typography';
7
+ import { useTheme } from '../../theme';
6
8
 
7
9
  interface ContentNavigatorProps {
8
10
  /**
@@ -54,6 +56,7 @@ function ContentNavigator({
54
56
  testID,
55
57
  style,
56
58
  }: ContentNavigatorProps) {
59
+ const theme = useTheme();
57
60
  return (
58
61
  <Wrapper testID={testID} style={style}>
59
62
  <Button.Icon
@@ -62,14 +65,32 @@ function ContentNavigator({
62
65
  disabled={previousDisabled}
63
66
  testID="previous-icon-button"
64
67
  />
65
- <Value
66
- fontWeight="semi-bold"
67
- fontSize={fontSize}
68
- onPress={onPress}
69
- testID="content-navigator-value"
70
- >
71
- {value}
72
- </Value>
68
+ {fontSize === 'medium' ? (
69
+ <Typography.Body
70
+ style={{
71
+ paddingHorizontal:
72
+ theme.__hd__.contentNavigator.space.valueHorizontalPadding,
73
+ }}
74
+ variant="small-bold"
75
+ onPress={onPress}
76
+ testID="content-navigator-value"
77
+ >
78
+ {value}
79
+ </Typography.Body>
80
+ ) : (
81
+ <Typography.Title
82
+ style={{
83
+ paddingHorizontal:
84
+ theme.__hd__.contentNavigator.space.valueHorizontalPadding,
85
+ }}
86
+ level="h5"
87
+ onPress={onPress}
88
+ testID="content-navigator-value"
89
+ >
90
+ {value}
91
+ </Typography.Title>
92
+ )}
93
+
73
94
  <Button.Icon
74
95
  icon="arrow-right"
75
96
  onPress={onNextPress}
@@ -105,14 +105,13 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
105
105
  Object {
106
106
  "color": "#001f23",
107
107
  "fontFamily": "BeVietnamPro-Regular",
108
- "fontSize": 14,
109
- "letterSpacing": 0.42,
110
- "lineHeight": 22,
108
+ "fontSize": 12,
109
+ "letterSpacing": 0.48,
110
+ "lineHeight": 16,
111
111
  },
112
112
  Array [
113
113
  Object {
114
114
  "color": "#001f23",
115
- "fontSize": 12,
116
115
  "lineHeight": 12,
117
116
  },
118
117
  Object {
@@ -122,11 +121,9 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
122
121
  ]
123
122
  }
124
123
  testID="input-label"
125
- themeFontSize="medium"
126
124
  themeFontWeight="regular"
127
125
  themeIntent="body"
128
126
  themeState="filled"
129
- themeTypeface="neutral"
130
127
  >
131
128
  Start date
132
129
  </Text>
@@ -203,6 +200,7 @@ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
203
200
  Object {
204
201
  "minHeight": 16,
205
202
  "paddingLeft": 16,
203
+ "paddingTop": 2,
206
204
  },
207
205
  undefined,
208
206
  ]
@@ -330,14 +328,13 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
330
328
  Object {
331
329
  "color": "#001f23",
332
330
  "fontFamily": "BeVietnamPro-Regular",
333
- "fontSize": 14,
334
- "letterSpacing": 0.42,
335
- "lineHeight": 22,
331
+ "fontSize": 12,
332
+ "letterSpacing": 0.48,
333
+ "lineHeight": 16,
336
334
  },
337
335
  Array [
338
336
  Object {
339
337
  "color": "#001f23",
340
- "fontSize": 12,
341
338
  "lineHeight": 12,
342
339
  },
343
340
  Object {
@@ -347,11 +344,9 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
347
344
  ]
348
345
  }
349
346
  testID="input-label"
350
- themeFontSize="medium"
351
347
  themeFontWeight="regular"
352
348
  themeIntent="body"
353
349
  themeState="filled"
354
- themeTypeface="neutral"
355
350
  >
356
351
  Start date
357
352
  </Text>
@@ -428,6 +423,7 @@ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
428
423
  Object {
429
424
  "minHeight": 16,
430
425
  "paddingLeft": 16,
426
+ "paddingTop": 2,
431
427
  },
432
428
  undefined,
433
429
  ]
@@ -561,14 +557,13 @@ exports[`DatePicker renders variant Calendar 1`] = `
561
557
  Object {
562
558
  "color": "#001f23",
563
559
  "fontFamily": "BeVietnamPro-Regular",
564
- "fontSize": 14,
565
- "letterSpacing": 0.42,
566
- "lineHeight": 22,
560
+ "fontSize": 12,
561
+ "letterSpacing": 0.48,
562
+ "lineHeight": 16,
567
563
  },
568
564
  Array [
569
565
  Object {
570
566
  "color": "#001f23",
571
- "fontSize": 12,
572
567
  "lineHeight": 12,
573
568
  },
574
569
  Object {
@@ -578,11 +573,9 @@ exports[`DatePicker renders variant Calendar 1`] = `
578
573
  ]
579
574
  }
580
575
  testID="input-label"
581
- themeFontSize="medium"
582
576
  themeFontWeight="regular"
583
577
  themeIntent="body"
584
578
  themeState="filled"
585
- themeTypeface="neutral"
586
579
  >
587
580
  Start date
588
581
  </Text>
@@ -659,6 +652,7 @@ exports[`DatePicker renders variant Calendar 1`] = `
659
652
  Object {
660
653
  "minHeight": 16,
661
654
  "paddingLeft": 16,
655
+ "paddingTop": 2,
662
656
  },
663
657
  undefined,
664
658
  ]
@@ -105,14 +105,13 @@ exports[`DatePickerAndroid renders correctly 1`] = `
105
105
  Object {
106
106
  "color": "#001f23",
107
107
  "fontFamily": "BeVietnamPro-Regular",
108
- "fontSize": 14,
109
- "letterSpacing": 0.42,
110
- "lineHeight": 22,
108
+ "fontSize": 12,
109
+ "letterSpacing": 0.48,
110
+ "lineHeight": 16,
111
111
  },
112
112
  Array [
113
113
  Object {
114
114
  "color": "#001f23",
115
- "fontSize": 12,
116
115
  "lineHeight": 12,
117
116
  },
118
117
  Object {
@@ -122,11 +121,9 @@ exports[`DatePickerAndroid renders correctly 1`] = `
122
121
  ]
123
122
  }
124
123
  testID="input-label"
125
- themeFontSize="medium"
126
124
  themeFontWeight="regular"
127
125
  themeIntent="body"
128
126
  themeState="filled"
129
- themeTypeface="neutral"
130
127
  >
131
128
  Start date
132
129
  </Text>
@@ -203,6 +200,7 @@ exports[`DatePickerAndroid renders correctly 1`] = `
203
200
  Object {
204
201
  "minHeight": 16,
205
202
  "paddingLeft": 16,
203
+ "paddingTop": 2,
206
204
  },
207
205
  undefined,
208
206
  ]
@@ -105,14 +105,13 @@ exports[`DatePickerCalendar renders correctly 1`] = `
105
105
  Object {
106
106
  "color": "#001f23",
107
107
  "fontFamily": "BeVietnamPro-Regular",
108
- "fontSize": 14,
109
- "letterSpacing": 0.42,
110
- "lineHeight": 22,
108
+ "fontSize": 12,
109
+ "letterSpacing": 0.48,
110
+ "lineHeight": 16,
111
111
  },
112
112
  Array [
113
113
  Object {
114
114
  "color": "#001f23",
115
- "fontSize": 12,
116
115
  "lineHeight": 12,
117
116
  },
118
117
  Object {
@@ -122,11 +121,9 @@ exports[`DatePickerCalendar renders correctly 1`] = `
122
121
  ]
123
122
  }
124
123
  testID="input-label"
125
- themeFontSize="medium"
126
124
  themeFontWeight="regular"
127
125
  themeIntent="body"
128
126
  themeState="filled"
129
- themeTypeface="neutral"
130
127
  >
131
128
  Start date
132
129
  </Text>
@@ -203,6 +200,7 @@ exports[`DatePickerCalendar renders correctly 1`] = `
203
200
  Object {
204
201
  "minHeight": 16,
205
202
  "paddingLeft": 16,
203
+ "paddingTop": 2,
206
204
  },
207
205
  undefined,
208
206
  ]