@hero-design/rn 7.27.1 → 8.0.0-rc.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 (312) hide show
  1. package/.expo/README.md +15 -0
  2. package/.expo/packager-info.json +10 -0
  3. package/.expo/prebuild/cached-packages.json +4 -0
  4. package/.expo/settings.json +10 -0
  5. package/.expo/xcodebuild-error.log +2 -0
  6. package/.expo/xcodebuild.log +11199 -0
  7. package/.turbo/turbo-build.log +9 -9
  8. package/.turbo/turbo-build:types.log +2 -0
  9. package/.turbo/turbo-build:watch.log +1 -0
  10. package/.turbo/turbo-lint.log +96 -0
  11. package/.turbo/turbo-test.log +909 -0
  12. package/assets/fonts/hero-icons-mobile.ttf +0 -0
  13. package/es/index.js +139 -89
  14. package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
  15. package/lib/index.js +138 -88
  16. package/package.json +4 -4
  17. package/src/components/Alert/index.tsx +43 -31
  18. package/src/components/BottomSheet/Header.tsx +1 -1
  19. package/src/components/BottomSheet/StyledBottomSheet.tsx +1 -1
  20. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +14 -14
  21. package/src/components/Button/Button.tsx +7 -0
  22. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +7 -7
  23. package/src/components/Empty/StyledEmpty.tsx +1 -1
  24. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
  25. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  26. package/src/components/FAB/ActionGroup/index.tsx +1 -1
  27. package/src/components/FAB/__tests__/index.spec.tsx +4 -4
  28. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  29. package/src/components/Icon/IconList.ts +1 -0
  30. package/src/components/Icon/index.tsx +12 -2
  31. package/src/components/List/ListItem.tsx +2 -2
  32. package/src/components/List/StyledListItem.tsx +1 -1
  33. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -2
  34. package/src/components/RichTextEditor/MentionList.tsx +1 -1
  35. package/src/components/RichTextEditor/StyledToolbar.ts +1 -1
  36. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +1 -1
  37. package/src/components/Select/{StyledOptionList.tsx → BaseOptionList.tsx} +6 -6
  38. package/src/components/Select/MultiSelect/Option.tsx +24 -11
  39. package/src/components/Select/MultiSelect/OptionList.tsx +3 -2
  40. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +3 -2
  41. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +47 -21
  42. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +99 -72
  43. package/src/components/Select/MultiSelect/index.tsx +16 -0
  44. package/src/components/Select/SingleSelect/Option.tsx +12 -12
  45. package/src/components/Select/SingleSelect/OptionList.tsx +3 -2
  46. package/src/components/Select/SingleSelect/StyledSingleSelect.tsx +6 -0
  47. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +0 -1
  48. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +32 -16
  49. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +65 -54
  50. package/src/components/Select/SingleSelect/index.tsx +16 -0
  51. package/src/components/Select/StyledSelect.tsx +12 -2
  52. package/src/components/Select/types.ts +1 -0
  53. package/src/components/Switch/index.tsx +9 -1
  54. package/src/components/Tabs/ScrollableTabs.tsx +1 -1
  55. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +9 -3
  56. package/src/components/Tabs/index.tsx +6 -0
  57. package/src/components/Tag/index.tsx +25 -17
  58. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  59. package/src/components/TextInput/__tests__/index.spec.tsx +1 -1
  60. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +7 -7
  61. package/src/components/Toast/ToastContainer.tsx +1 -1
  62. package/src/components/Toast/ToastProvider.tsx +10 -1
  63. package/src/components/Toast/__tests__/ToastContainer.spec.tsx +5 -5
  64. package/src/components/Toast/__tests__/__snapshots__/ToastContainer.spec.tsx.snap +4 -4
  65. package/src/components/Typography/Text/StyledText.tsx +2 -1
  66. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +1 -1
  67. package/src/components/Typography/Text/index.tsx +2 -1
  68. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +26 -18
  69. package/src/theme/components/avatar.ts +1 -1
  70. package/src/theme/components/bottomSheet.ts +5 -5
  71. package/src/theme/components/empty.ts +6 -5
  72. package/src/theme/components/fab.ts +1 -1
  73. package/src/theme/components/select.ts +3 -1
  74. package/src/theme/components/typography.ts +2 -0
  75. package/src/theme/global/colors/global.ts +1 -0
  76. package/src/theme/global/colors/types.ts +1 -0
  77. package/src/theme/global/scale.ts +1 -1
  78. package/src/theme/global/typography.ts +4 -1
  79. package/src/utils/hooks.ts +3 -1
  80. package/types/components/Accordion/AccordionItem.d.ts +0 -0
  81. package/types/components/Accordion/StyledAccordion.d.ts +0 -0
  82. package/types/components/Accordion/index.d.ts +0 -0
  83. package/types/components/Accordion/utils.d.ts +1 -0
  84. package/types/components/Alert/StyledAlert.d.ts +0 -0
  85. package/types/components/Alert/index.d.ts +2 -1
  86. package/types/components/Attachment/StyledAttachment.d.ts +0 -0
  87. package/types/components/Attachment/index.d.ts +0 -0
  88. package/types/components/Avatar/Avatar.d.ts +0 -0
  89. package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
  90. package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
  91. package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
  92. package/types/components/Avatar/StyledAvatar.d.ts +0 -0
  93. package/types/components/Avatar/index.d.ts +0 -0
  94. package/types/components/Badge/Status.d.ts +0 -0
  95. package/types/components/Badge/StyledBadge.d.ts +0 -0
  96. package/types/components/Badge/index.d.ts +0 -0
  97. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  98. package/types/components/BottomNavigation/index.d.ts +0 -0
  99. package/types/components/BottomSheet/Footer.d.ts +0 -0
  100. package/types/components/BottomSheet/Header.d.ts +0 -0
  101. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
  102. package/types/components/BottomSheet/index.d.ts +0 -0
  103. package/types/components/Box/StyledBox.d.ts +0 -0
  104. package/types/components/Box/config.d.ts +0 -0
  105. package/types/components/Box/index.d.ts +0 -0
  106. package/types/components/Box/types.d.ts +0 -0
  107. package/types/components/Button/Button.d.ts +0 -0
  108. package/types/components/Button/IconButton.d.ts +0 -0
  109. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
  110. package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
  111. package/types/components/Button/StyledButton.d.ts +0 -0
  112. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
  113. package/types/components/Button/UtilityButton/index.d.ts +0 -0
  114. package/types/components/Button/index.d.ts +0 -0
  115. package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
  116. package/types/components/Calendar/StyledCalendar.d.ts +0 -0
  117. package/types/components/Calendar/helpers.d.ts +0 -0
  118. package/types/components/Calendar/index.d.ts +0 -0
  119. package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
  120. package/types/components/Card/DataCard/index.d.ts +0 -0
  121. package/types/components/Card/StyledCard.d.ts +0 -0
  122. package/types/components/Card/index.d.ts +0 -0
  123. package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
  124. package/types/components/Checkbox/index.d.ts +0 -0
  125. package/types/components/Collapse/StyledCollapse.d.ts +0 -0
  126. package/types/components/Collapse/index.d.ts +0 -0
  127. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
  128. package/types/components/ContentNavigator/index.d.ts +0 -0
  129. package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
  130. package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
  131. package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
  132. package/types/components/DatePicker/index.d.ts +0 -0
  133. package/types/components/DatePicker/types.d.ts +0 -0
  134. package/types/components/Divider/StyledDivider.d.ts +0 -0
  135. package/types/components/Divider/index.d.ts +0 -0
  136. package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
  137. package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
  138. package/types/components/Drawer/StyledDrawer.d.ts +0 -0
  139. package/types/components/Drawer/index.d.ts +0 -0
  140. package/types/components/Empty/StyledEmpty.d.ts +0 -0
  141. package/types/components/Empty/index.d.ts +0 -0
  142. package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  143. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  144. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  145. package/types/components/FAB/ActionGroup/index.d.ts +0 -0
  146. package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
  147. package/types/components/FAB/FAB.d.ts +0 -0
  148. package/types/components/FAB/StyledFAB.d.ts +0 -0
  149. package/types/components/FAB/index.d.ts +0 -0
  150. package/types/components/Icon/AnimatedIcon.d.ts +0 -0
  151. package/types/components/Icon/HeroIcon/index.d.ts +0 -0
  152. package/types/components/Icon/IconList.d.ts +1 -1
  153. package/types/components/Icon/index.d.ts +1 -1
  154. package/types/components/Icon/utils.d.ts +1 -1
  155. package/types/components/Image/index.d.ts +0 -0
  156. package/types/components/List/BasicListItem.d.ts +0 -0
  157. package/types/components/List/ListItem.d.ts +2 -2
  158. package/types/components/List/StyledBasicListItem.d.ts +0 -0
  159. package/types/components/List/StyledListItem.d.ts +0 -0
  160. package/types/components/List/index.d.ts +0 -0
  161. package/types/components/PinInput/PinCell.d.ts +0 -0
  162. package/types/components/PinInput/StyledPinInput.d.ts +0 -0
  163. package/types/components/PinInput/index.d.ts +0 -0
  164. package/types/components/Progress/ProgressBar.d.ts +0 -0
  165. package/types/components/Progress/ProgressCircle.d.ts +0 -0
  166. package/types/components/Progress/StyledProgressBar.d.ts +0 -0
  167. package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
  168. package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
  169. package/types/components/Progress/constants.d.ts +0 -0
  170. package/types/components/Progress/index.d.ts +0 -0
  171. package/types/components/Progress/types.d.ts +0 -0
  172. package/types/components/Radio/Radio.d.ts +0 -0
  173. package/types/components/Radio/RadioGroup.d.ts +0 -0
  174. package/types/components/Radio/StyledRadio.d.ts +0 -0
  175. package/types/components/Radio/index.d.ts +0 -0
  176. package/types/components/Radio/types.d.ts +0 -0
  177. package/types/components/RefreshControl/index.d.ts +0 -0
  178. package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
  179. package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
  180. package/types/components/RichTextEditor/MentionList.d.ts +0 -0
  181. package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
  182. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
  183. package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
  184. package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
  185. package/types/components/RichTextEditor/constants.d.ts +0 -0
  186. package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
  187. package/types/components/RichTextEditor/index.d.ts +0 -0
  188. package/types/components/RichTextEditor/types.d.ts +0 -0
  189. package/types/components/RichTextEditor/utils/events.d.ts +0 -0
  190. package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
  191. package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
  192. package/types/components/SectionHeading/index.d.ts +0 -0
  193. package/types/components/Select/BaseOptionList.d.ts +12 -0
  194. package/types/components/Select/Footer.d.ts +0 -0
  195. package/types/components/Select/MultiSelect/Option.d.ts +2 -1
  196. package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
  197. package/types/components/Select/MultiSelect/index.d.ts +0 -0
  198. package/types/components/Select/SingleSelect/Option.d.ts +2 -1
  199. package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
  200. package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +1 -0
  201. package/types/components/Select/SingleSelect/index.d.ts +0 -0
  202. package/types/components/Select/StyledOptionList.d.ts +0 -0
  203. package/types/components/Select/StyledSelect.d.ts +3 -2
  204. package/types/components/Select/helpers.d.ts +0 -0
  205. package/types/components/Select/index.d.ts +0 -0
  206. package/types/components/Select/types.d.ts +1 -0
  207. package/types/components/Slider/index.d.ts +0 -0
  208. package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
  209. package/types/components/Spinner/StyledSpinner.d.ts +0 -0
  210. package/types/components/Spinner/index.d.ts +0 -0
  211. package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
  212. package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
  213. package/types/components/Swipeable/index.d.ts +0 -0
  214. package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
  215. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
  216. package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
  217. package/types/components/Switch/StyledSwitch.d.ts +0 -0
  218. package/types/components/Switch/index.d.ts +1 -1
  219. package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
  220. package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
  221. package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
  222. package/types/components/Tabs/StyledTabs.d.ts +0 -0
  223. package/types/components/Tabs/TabWithBadge.d.ts +0 -0
  224. package/types/components/Tabs/index.d.ts +0 -0
  225. package/types/components/Tabs/utils.d.ts +0 -0
  226. package/types/components/Tag/StyledTag.d.ts +0 -0
  227. package/types/components/Tag/index.d.ts +0 -0
  228. package/types/components/TextInput/StyledTextInput.d.ts +0 -0
  229. package/types/components/TextInput/index.d.ts +0 -0
  230. package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
  231. package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
  232. package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
  233. package/types/components/TimePicker/index.d.ts +0 -0
  234. package/types/components/TimePicker/types.d.ts +0 -0
  235. package/types/components/Toast/StyledToast.d.ts +0 -0
  236. package/types/components/Toast/Toast.d.ts +0 -0
  237. package/types/components/Toast/ToastContainer.d.ts +0 -0
  238. package/types/components/Toast/ToastContext.d.ts +0 -0
  239. package/types/components/Toast/ToastProvider.d.ts +1 -1
  240. package/types/components/Toast/index.d.ts +1 -1
  241. package/types/components/Toast/types.d.ts +0 -0
  242. package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
  243. package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
  244. package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
  245. package/types/components/Toolbar/index.d.ts +0 -0
  246. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  247. package/types/components/Typography/Text/index.d.ts +1 -1
  248. package/types/components/Typography/index.d.ts +0 -0
  249. package/types/index.d.ts +0 -0
  250. package/types/testHelpers/renderWithTheme.d.ts +0 -0
  251. package/types/theme/ThemeProvider.d.ts +0 -0
  252. package/types/theme/ThemeSwitcher.d.ts +0 -0
  253. package/types/theme/components/accordion.d.ts +0 -0
  254. package/types/theme/components/alert.d.ts +0 -0
  255. package/types/theme/components/attachment.d.ts +0 -0
  256. package/types/theme/components/avatar.d.ts +0 -0
  257. package/types/theme/components/badge.d.ts +0 -0
  258. package/types/theme/components/bottomNavigation.d.ts +0 -0
  259. package/types/theme/components/bottomSheet.d.ts +0 -0
  260. package/types/theme/components/button.d.ts +0 -0
  261. package/types/theme/components/calendar.d.ts +0 -0
  262. package/types/theme/components/card.d.ts +0 -0
  263. package/types/theme/components/checkbox.d.ts +0 -0
  264. package/types/theme/components/contentNavigator.d.ts +0 -0
  265. package/types/theme/components/datePicker.d.ts +0 -0
  266. package/types/theme/components/divider.d.ts +0 -0
  267. package/types/theme/components/drawer.d.ts +0 -0
  268. package/types/theme/components/empty.d.ts +1 -0
  269. package/types/theme/components/fab.d.ts +0 -0
  270. package/types/theme/components/icon.d.ts +0 -0
  271. package/types/theme/components/image.d.ts +0 -0
  272. package/types/theme/components/list.d.ts +0 -0
  273. package/types/theme/components/pinInput.d.ts +0 -0
  274. package/types/theme/components/progress.d.ts +0 -0
  275. package/types/theme/components/radio.d.ts +0 -0
  276. package/types/theme/components/refreshControl.d.ts +0 -0
  277. package/types/theme/components/richTextEditor.d.ts +0 -0
  278. package/types/theme/components/sectionHeading.d.ts +0 -0
  279. package/types/theme/components/select.d.ts +3 -1
  280. package/types/theme/components/slider.d.ts +0 -0
  281. package/types/theme/components/spinner.d.ts +0 -0
  282. package/types/theme/components/swipeable.d.ts +0 -0
  283. package/types/theme/components/switch.d.ts +0 -0
  284. package/types/theme/components/tabs.d.ts +0 -0
  285. package/types/theme/components/tag.d.ts +0 -0
  286. package/types/theme/components/textInput.d.ts +0 -0
  287. package/types/theme/components/timePicker.d.ts +0 -0
  288. package/types/theme/components/toast.d.ts +0 -0
  289. package/types/theme/components/toolbar.d.ts +0 -0
  290. package/types/theme/components/typography.d.ts +2 -0
  291. package/types/theme/getTheme.d.ts +0 -0
  292. package/types/theme/global/borders.d.ts +0 -0
  293. package/types/theme/global/colors/eBens.d.ts +0 -0
  294. package/types/theme/global/colors/global.d.ts +0 -0
  295. package/types/theme/global/colors/jobs.d.ts +0 -0
  296. package/types/theme/global/colors/legacySystemPalette.d.ts +0 -0
  297. package/types/theme/global/colors/swag.d.ts +0 -0
  298. package/types/theme/global/colors/types.d.ts +1 -0
  299. package/types/theme/global/colors/wallet.d.ts +0 -0
  300. package/types/theme/global/colors/work.d.ts +0 -0
  301. package/types/theme/global/index.d.ts +1 -0
  302. package/types/theme/global/scale.d.ts +0 -0
  303. package/types/theme/global/sizes.d.ts +0 -0
  304. package/types/theme/global/space.d.ts +0 -0
  305. package/types/theme/global/typography.d.ts +1 -0
  306. package/types/theme/index.d.ts +0 -0
  307. package/types/theme/utils.d.ts +2 -0
  308. package/types/types.d.ts +0 -0
  309. package/types/utils/functions.d.ts +0 -0
  310. package/types/utils/helpers.d.ts +0 -0
  311. package/types/utils/hooks.d.ts +0 -0
  312. package/types/utils/scale.d.ts +0 -0
@@ -7,6 +7,7 @@ import type { ReactElement } from 'react';
7
7
  import type { StyleProp, ViewStyle } from 'react-native';
8
8
  import { StyledKnot, StyledWrapper, Variant } from './StyledSwitch';
9
9
  import SelectorSwitch from './SelectorSwitch';
10
+ import { useDeprecation } from '../../utils/hooks';
10
11
 
11
12
  export interface SwitchProps {
12
13
  /**
@@ -50,16 +51,23 @@ const getVariant = ({
50
51
  };
51
52
 
52
53
  const Switch = ({
53
- size = 'medium',
54
+ size: _size,
54
55
  disabled = false,
55
56
  checked = false,
56
57
  onPress,
57
58
  style,
58
59
  testID,
59
60
  }: SwitchProps): ReactElement => {
61
+ const size: SwitchProps['size'] = _size === undefined ? 'medium' : _size;
62
+
60
63
  const theme = useTheme();
61
64
  const variant = getVariant({ disabled, checked });
62
65
 
66
+ useDeprecation(
67
+ "Switch's size prop will be removed in the next major release.",
68
+ _size !== undefined
69
+ );
70
+
63
71
  const offset = checked
64
72
  ? (theme.__hd__.switch.sizes.widths[size] -
65
73
  theme.__hd__.switch.sizes.thumbs[size]) /
@@ -35,7 +35,7 @@ const getTabItem = ({
35
35
  icon={item}
36
36
  testID={`hero-icon-${item}`}
37
37
  size="small"
38
- intent={active ? 'info' : 'text'}
38
+ style={{ color }}
39
39
  />
40
40
  );
41
41
  }
@@ -376,7 +376,9 @@ exports[`Tabs.Scroll renders correctly 1`] = `
376
376
  "color": "#001f23",
377
377
  "fontSize": 20,
378
378
  },
379
- undefined,
379
+ Object {
380
+ "color": "#001f23",
381
+ },
380
382
  ]
381
383
  }
382
384
  testID="hero-icon-speaker-outlined"
@@ -478,7 +480,9 @@ exports[`Tabs.Scroll renders correctly 1`] = `
478
480
  "color": "#001f23",
479
481
  "fontSize": 20,
480
482
  },
481
- undefined,
483
+ Object {
484
+ "color": "#001f23",
485
+ },
482
486
  ]
483
487
  }
484
488
  testID="hero-icon-home-outlined"
@@ -605,7 +609,9 @@ exports[`Tabs.Scroll renders correctly 1`] = `
605
609
  "color": "#001f23",
606
610
  "fontSize": 20,
607
611
  },
608
- undefined,
612
+ Object {
613
+ "color": "#001f23",
614
+ },
609
615
  ]
610
616
  }
611
617
  testID="hero-icon-calendar-dates-outlined"
@@ -20,6 +20,7 @@ import ScrollableTabs from './ScrollableTabs';
20
20
  import TabWithBadge from './TabWithBadge';
21
21
  import type { BadgeConfigType } from './TabWithBadge';
22
22
  import { IconName } from '../Icon';
23
+ import { useDeprecation } from '../../utils/hooks';
23
24
 
24
25
  export type ItemType =
25
26
  | string
@@ -113,6 +114,11 @@ const Tabs = ({
113
114
  swipeEnabled = true,
114
115
  testID: componentTestID,
115
116
  }: TabsProps): JSX.Element => {
117
+ useDeprecation(
118
+ "Tabs' showBadge will be removed in the next major release. Please use badge prop instead.",
119
+ tabs.some((item) => item.showBadge !== undefined)
120
+ );
121
+
116
122
  const theme = useTheme();
117
123
  const insets = useSafeAreaInsets();
118
124
  const pagerViewRef = React.useRef<PagerView>(null);
@@ -1,5 +1,6 @@
1
1
  import React, { ReactElement } from 'react';
2
2
  import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
3
+ import { useDeprecation } from '../../utils/hooks';
3
4
  import { StyledView, StyledText } from './StyledTag';
4
5
 
5
6
  interface TagProps extends ViewProps {
@@ -39,22 +40,29 @@ const Tag = ({
39
40
  style,
40
41
  testID,
41
42
  ...nativeProps
42
- }: TagProps): JSX.Element => (
43
- <StyledView
44
- {...nativeProps}
45
- themeIntent={intent}
46
- themeVariant={variant}
47
- style={style}
48
- testID={testID}
49
- >
50
- {typeof content === 'string' ? (
51
- <StyledText themeIntent={intent} themeVariant={variant}>
52
- {content}
53
- </StyledText>
54
- ) : (
55
- content
56
- )}
57
- </StyledView>
58
- );
43
+ }: TagProps): JSX.Element => {
44
+ useDeprecation(
45
+ "Tag's default intent is deprecated and will be removed in the next major release.\nPlease use primary intent instead.",
46
+ intent !== 'default'
47
+ );
48
+
49
+ return (
50
+ <StyledView
51
+ {...nativeProps}
52
+ themeIntent={intent}
53
+ themeVariant={variant}
54
+ style={style}
55
+ testID={testID}
56
+ >
57
+ {typeof content === 'string' ? (
58
+ <StyledText themeIntent={intent} themeVariant={variant}>
59
+ {content}
60
+ </StyledText>
61
+ ) : (
62
+ content
63
+ )}
64
+ </StyledView>
65
+ );
66
+ };
59
67
 
60
68
  export default Tag;
@@ -1396,7 +1396,7 @@ exports[`TextInput idle renders correctly 1`] = `
1396
1396
  "width": "100%",
1397
1397
  },
1398
1398
  Object {
1399
- "borderColor": "#de350b",
1399
+ "borderColor": "#f46363",
1400
1400
  },
1401
1401
  ]
1402
1402
  }
@@ -38,7 +38,7 @@ describe('TextInput', () => {
38
38
  prefix="dollar-sign"
39
39
  suffix="arrow-down"
40
40
  testID="idle-text-input"
41
- style={{ borderColor: theme.colors.danger }}
41
+ style={{ borderColor: theme.colors.error }}
42
42
  />
43
43
  );
44
44
 
@@ -287,7 +287,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
287
287
  onStartShouldSetResponder={[Function]}
288
288
  style={
289
289
  Object {
290
- "backgroundColor": "#001f23",
290
+ "backgroundColor": "#000000",
291
291
  "bottom": 0,
292
292
  "left": 0,
293
293
  "opacity": 0.48,
@@ -313,8 +313,8 @@ exports[`TimePickerIOS renders correctly 1`] = `
313
313
  "height": 3,
314
314
  "width": 0,
315
315
  },
316
- "shadowOpacity": 0.27,
317
- "shadowRadius": 4.65,
316
+ "shadowOpacity": 0.4,
317
+ "shadowRadius": 16,
318
318
  "transform": Array [
319
319
  Object {
320
320
  "scaleY": 1,
@@ -410,13 +410,13 @@ exports[`TimePickerIOS renders correctly 1`] = `
410
410
  Array [
411
411
  Object {
412
412
  "color": "#001f23",
413
- "fontSize": 20,
413
+ "fontSize": 16,
414
414
  },
415
415
  undefined,
416
416
  ]
417
417
  }
418
418
  themeIntent="text"
419
- themeSize="small"
419
+ themeSize="xsmall"
420
420
  />
421
421
  </View>
422
422
  </View>
@@ -477,8 +477,8 @@ exports[`TimePickerIOS renders correctly 1`] = `
477
477
  "flexDirection": "row",
478
478
  "justifyContent": "flex-end",
479
479
  "minHeight": 64,
480
- "paddingHorizontal": 12,
481
- "paddingVertical": 8,
480
+ "paddingHorizontal": 24,
481
+ "paddingVertical": 16,
482
482
  },
483
483
  undefined,
484
484
  ]
@@ -38,7 +38,7 @@ const SingleToastDisplay = ({
38
38
  const ToastContainer = React.forwardRef<
39
39
  ToastControllerContextType,
40
40
  ToastContainerProps
41
- >(({ displayType = 'single', position = 'top', style }, ref) => {
41
+ >(({ displayType = 'single', position = 'bottom', style }, ref) => {
42
42
  const theme = useTheme();
43
43
  const [toastList, setToastList] = useState<ToastItemProps[]>([]);
44
44
 
@@ -6,6 +6,7 @@ import ToastContainer from './ToastContainer';
6
6
  import { ToastConfigContext, ToastContext } from './ToastContext';
7
7
  import type { ToastControllerContextType } from './ToastContext';
8
8
  import type { ToastContainerProps } from './types';
9
+ import { useDeprecation } from '../../utils/hooks';
9
10
 
10
11
  type ToastProviderProps = {
11
12
  /**
@@ -17,8 +18,16 @@ type ToastProviderProps = {
17
18
  const ToastProvider = ({
18
19
  children,
19
20
  displayType = 'single',
20
- position = 'top',
21
+ position: _position,
21
22
  }: ToastProviderProps) => {
23
+ const position: ToastContainerProps['position'] =
24
+ _position === undefined ? 'bottom' : _position;
25
+
26
+ useDeprecation(
27
+ "Toast's position prop is deprecated and will be removed in the next major release.\nPlease remove it.",
28
+ _position !== undefined
29
+ );
30
+
22
31
  const toastRef = useRef<ToastControllerContextType>(null);
23
32
  // @ts-expect-error: TODO: @tungv Fix this type error
24
33
  const [refState, setRefState] = useState<ToastControllerContextType>(null);
@@ -10,11 +10,11 @@ describe('ToastContainer', () => {
10
10
  });
11
11
 
12
12
  it.each`
13
- displayType | position
14
- ${'single'} | ${'top'}
15
- ${'displayType'} | ${'top'}
16
- ${'single'} | ${'bottom'}
17
- ${'displayType'} | ${'bottom'}
13
+ displayType | position
14
+ ${'single'} | ${'top'}
15
+ ${'stack'} | ${'top'}
16
+ ${'single'} | ${'bottom'}
17
+ ${'stack'} | ${'bottom'}
18
18
  `(
19
19
  'renders correctly with displayType: $displayType, position: $position',
20
20
  ({ displayType, position }) => {
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`ToastContainer renders correctly with displayType: displayType, position: bottom 1`] = `
3
+ exports[`ToastContainer renders correctly with displayType: single, position: bottom 1`] = `
4
4
  <View
5
5
  pointerEvents="box-none"
6
6
  position="bottom"
@@ -23,7 +23,7 @@ exports[`ToastContainer renders correctly with displayType: displayType, positio
23
23
  />
24
24
  `;
25
25
 
26
- exports[`ToastContainer renders correctly with displayType: displayType, position: top 1`] = `
26
+ exports[`ToastContainer renders correctly with displayType: single, position: top 1`] = `
27
27
  <View
28
28
  pointerEvents="box-none"
29
29
  position="top"
@@ -46,7 +46,7 @@ exports[`ToastContainer renders correctly with displayType: displayType, positio
46
46
  />
47
47
  `;
48
48
 
49
- exports[`ToastContainer renders correctly with displayType: single, position: bottom 1`] = `
49
+ exports[`ToastContainer renders correctly with displayType: stack, position: bottom 1`] = `
50
50
  <View
51
51
  pointerEvents="box-none"
52
52
  position="bottom"
@@ -69,7 +69,7 @@ exports[`ToastContainer renders correctly with displayType: single, position: bo
69
69
  />
70
70
  `;
71
71
 
72
- exports[`ToastContainer renders correctly with displayType: single, position: top 1`] = `
72
+ exports[`ToastContainer renders correctly with displayType: stack, position: top 1`] = `
73
73
  <View
74
74
  pointerEvents="box-none"
75
75
  position="top"
@@ -14,7 +14,8 @@ const StyledText = styled(Text)<{
14
14
  | 'large'
15
15
  | 'xlarge'
16
16
  | 'xxxlarge'
17
- | 'xxxxxlarge';
17
+ | 'xxxxxlarge'
18
+ | '7xlarge';
18
19
  themeFontWeight: 'light' | 'regular' | 'semi-bold';
19
20
  themeIntent:
20
21
  | 'body'
@@ -190,7 +190,7 @@ exports[`StyledText has playful typeface style 1`] = `
190
190
  Array [
191
191
  Object {
192
192
  "color": "#001f23",
193
- "fontFamily": "DarkerGrotesque-Regular",
193
+ "fontFamily": "RebondGrotesque-Regular",
194
194
  "fontSize": 14,
195
195
  "letterSpacing": 0.42,
196
196
  "lineHeight": 22,
@@ -21,7 +21,8 @@ export interface TextProps extends NativeTextProps {
21
21
  | 'large'
22
22
  | 'xlarge'
23
23
  | 'xxxlarge'
24
- | 'xxxxxlarge';
24
+ | 'xxxxxlarge'
25
+ | '7xlarge';
25
26
  /**
26
27
  * Font weight of the text.
27
28
  */
@@ -145,7 +145,7 @@ Object {
145
145
  },
146
146
  "bottomSheet": Object {
147
147
  "colors": Object {
148
- "backdrop": "#001f23",
148
+ "backdrop": "#000000",
149
149
  "background": "#ffffff",
150
150
  "shadow": "#001f23",
151
151
  },
@@ -158,8 +158,8 @@ Object {
158
158
  "height": 3,
159
159
  "width": 0,
160
160
  },
161
- "opacity": 0.27,
162
- "radius": 4.65,
161
+ "opacity": 0.4,
162
+ "radius": 16,
163
163
  },
164
164
  "sizes": Object {
165
165
  "closeIcon": 48,
@@ -167,8 +167,8 @@ Object {
167
167
  },
168
168
  "space": Object {
169
169
  "closeIconMargin": 12,
170
- "footerHorizontalPadding": 12,
171
- "footerVerticalPadding": 8,
170
+ "footerHorizontalPadding": 24,
171
+ "footerVerticalPadding": 16,
172
172
  "headerWrapperHorizontalPadding": 16,
173
173
  "headerWrapperVerticalPadding": 8,
174
174
  },
@@ -331,17 +331,18 @@ Object {
331
331
  },
332
332
  "empty": Object {
333
333
  "colors": Object {
334
+ "invertedSubduedText": "#ffffff",
334
335
  "invertedText": "#ffffff",
335
- "subduedText": "#bfc1c5",
336
+ "subduedText": "#4d6265",
336
337
  "text": "#001f23",
337
338
  },
338
339
  "fontSizes": Object {
339
- "description": 16,
340
- "title": 28,
340
+ "description": 18,
341
+ "title": 24,
341
342
  },
342
343
  "fonts": Object {
343
- "description": "BeVietnamPro-Light",
344
- "title": "BeVietnamPro-SemiBold",
344
+ "description": "RebondGrotesque-Regular",
345
+ "title": "RebondGrotesque-SemiBold",
345
346
  },
346
347
  "sizes": Object {
347
348
  "image": 168,
@@ -356,7 +357,7 @@ Object {
356
357
  "colors": Object {
357
358
  "actionItemBackground": "#401960",
358
359
  "actionItemText": "#ffffff",
359
- "backdropBackground": "#001f23",
360
+ "backdropBackground": "#000000",
360
361
  "buttonBackground": "#401960",
361
362
  "headerText": "#ffffff",
362
363
  "icon": "#ffffff",
@@ -607,12 +608,14 @@ Object {
607
608
  },
608
609
  "space": Object {
609
610
  "minimumOptionListHeight": 280,
610
- "optionHorizontalMargin": 12,
611
+ "optionListHorizontalPadding": 12,
611
612
  "optionSpacing": 4,
612
613
  "searchBarBottomSpacing": 8,
613
614
  "searchBarHorizontalSpacing": 16,
614
615
  "searchBarMarginTopSpacing": 8,
615
616
  "sectionSpacing": 12,
617
+ "singleSelectContentPaddingBottom": 16,
618
+ "suffixMarginRight": 12,
616
619
  },
617
620
  },
618
621
  "slider": Object {
@@ -909,6 +912,7 @@ Object {
909
912
  "warning": "#ffa234",
910
913
  },
911
914
  "fontSizes": Object {
915
+ "7xlarge": 42,
912
916
  "large": 16,
913
917
  "medium": 14,
914
918
  "small": 12,
@@ -923,12 +927,13 @@ Object {
923
927
  "semiBold": "BeVietnamPro-SemiBold",
924
928
  },
925
929
  "playful": Object {
926
- "light": "DarkerGrotesque-Light",
927
- "regular": "DarkerGrotesque-Regular",
928
- "semiBold": "DarkerGrotesque-SemiBold",
930
+ "light": "RebondGrotesque-Light",
931
+ "regular": "RebondGrotesque-Regular",
932
+ "semiBold": "RebondGrotesque-SemiBold",
929
933
  },
930
934
  },
931
935
  "lineHeights": Object {
936
+ "7xlarge": 50,
932
937
  "large": 24,
933
938
  "medium": 22,
934
939
  "small": 20,
@@ -1006,6 +1011,7 @@ Object {
1006
1011
  "onSuccessSurface": "#017d6d",
1007
1012
  "onWarningSurface": "#ffa234",
1008
1013
  "outline": "#e8e9ea",
1014
+ "overlayGlobalSurface": "#000000",
1009
1015
  "platformBackground": "#ffffff",
1010
1016
  "pressedSurface": "#664780",
1011
1017
  "primary": "#401960",
@@ -1033,6 +1039,7 @@ Object {
1033
1039
  "warningSurface": "#fff6eb",
1034
1040
  },
1035
1041
  "fontSizes": Object {
1042
+ "7xlarge": 42,
1036
1043
  "large": 16,
1037
1044
  "medium": 14,
1038
1045
  "small": 12,
@@ -1050,12 +1057,13 @@ Object {
1050
1057
  "semiBold": "BeVietnamPro-SemiBold",
1051
1058
  },
1052
1059
  "playful": Object {
1053
- "light": "DarkerGrotesque-Light",
1054
- "regular": "DarkerGrotesque-Regular",
1055
- "semiBold": "DarkerGrotesque-SemiBold",
1060
+ "light": "RebondGrotesque-Light",
1061
+ "regular": "RebondGrotesque-Regular",
1062
+ "semiBold": "RebondGrotesque-SemiBold",
1056
1063
  },
1057
1064
  },
1058
1065
  "lineHeights": Object {
1066
+ "7xlarge": 50,
1059
1067
  "large": 24,
1060
1068
  "medium": 22,
1061
1069
  "small": 20,
@@ -7,7 +7,7 @@ const getAvatarTheme = (theme: GlobalTheme) => {
7
7
  danger: theme.colors.error,
8
8
  success: theme.colors.success,
9
9
  warning: theme.colors.warning,
10
- text: theme.colors.invertedText,
10
+ text: theme.colors.onDarkGlobalSurface,
11
11
  };
12
12
 
13
13
  const sizes = {
@@ -4,7 +4,7 @@ const getBottomSheetTheme = (theme: GlobalTheme) => {
4
4
  const colors = {
5
5
  shadow: theme.colors.primaryOutline,
6
6
  background: theme.colors.defaultGlobalSurface,
7
- backdrop: theme.colors.darkGlobalSurface,
7
+ backdrop: theme.colors.overlayGlobalSurface,
8
8
  };
9
9
 
10
10
  const sizes = {
@@ -16,14 +16,14 @@ const getBottomSheetTheme = (theme: GlobalTheme) => {
16
16
  headerWrapperVerticalPadding: theme.space.small,
17
17
  headerWrapperHorizontalPadding: theme.space.medium,
18
18
  closeIconMargin: theme.space.smallMedium,
19
- footerVerticalPadding: theme.space.small,
20
- footerHorizontalPadding: theme.space.smallMedium,
19
+ footerVerticalPadding: theme.space.medium,
20
+ footerHorizontalPadding: theme.space.large,
21
21
  };
22
22
 
23
23
  const shadows = {
24
24
  offset: { width: 0, height: 3 },
25
- opacity: 0.27,
26
- radius: 4.65,
25
+ opacity: 0.4,
26
+ radius: theme.radii.xlarge,
27
27
  elevation: 10,
28
28
  };
29
29
 
@@ -14,17 +14,18 @@ const getEmptyTheme = (theme: GlobalTheme) => {
14
14
  const colors = {
15
15
  text: theme.colors.onDefaultGlobalSurface,
16
16
  invertedText: theme.colors.onDarkGlobalSurface,
17
- subduedText: theme.colors.disabledOnDefaultGlobalSurface,
17
+ subduedText: theme.colors.mutedOnDefaultGlobalSurface,
18
+ invertedSubduedText: theme.colors.onDarkGlobalSurface,
18
19
  };
19
20
 
20
21
  const fontSizes = {
21
- title: theme.fontSizes.xxxxlarge,
22
- description: theme.fontSizes.large,
22
+ title: theme.fontSizes.xxxlarge,
23
+ description: theme.fontSizes.xlarge,
23
24
  };
24
25
 
25
26
  const fonts = {
26
- title: theme.fonts.neutral.semiBold,
27
- description: theme.fonts.neutral.light,
27
+ title: theme.fonts.playful.semiBold,
28
+ description: theme.fonts.playful.regular,
28
29
  };
29
30
 
30
31
  return { fontSizes, colors, sizes, space, fonts };
@@ -6,7 +6,7 @@ const getFABTheme = (theme: GlobalTheme) => {
6
6
  icon: theme.colors.onPrimary,
7
7
  headerText: theme.colors.onDarkGlobalSurface,
8
8
  actionItemBackground: theme.colors.primary,
9
- backdropBackground: theme.colors.darkGlobalSurface,
9
+ backdropBackground: theme.colors.overlayGlobalSurface,
10
10
  titleText: theme.colors.onDarkGlobalSurface,
11
11
  actionItemText: theme.colors.onPrimary,
12
12
  };
@@ -9,10 +9,12 @@ const getSelectTheme = (theme: GlobalTheme) => {
9
9
  minimumOptionListHeight: theme.space.xxxxlarge * 5,
10
10
  sectionSpacing: theme.space.smallMedium,
11
11
  optionSpacing: theme.space.xsmall,
12
- optionHorizontalMargin: theme.space.smallMedium,
12
+ optionListHorizontalPadding: theme.space.smallMedium,
13
13
  searchBarMarginTopSpacing: theme.space.small,
14
14
  searchBarHorizontalSpacing: theme.space.medium,
15
15
  searchBarBottomSpacing: theme.space.small,
16
+ singleSelectContentPaddingBottom: theme.space.medium,
17
+ suffixMarginRight: theme.space.smallMedium,
16
18
  };
17
19
 
18
20
  const radii = {
@@ -20,6 +20,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
20
20
  xlarge: theme.fontSizes.xlarge,
21
21
  xxxlarge: theme.fontSizes.xxxlarge,
22
22
  xxxxxlarge: theme.fontSizes.xxxxxlarge,
23
+ '7xlarge': theme.fontSizes['7xlarge'],
23
24
  };
24
25
 
25
26
  const lineHeights = {
@@ -29,6 +30,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
29
30
  xlarge: theme.lineHeights.xlarge,
30
31
  xxxlarge: theme.lineHeights.xxxlarge,
31
32
  xxxxxlarge: theme.lineHeights.xxxxxlarge,
33
+ '7xlarge': theme.lineHeights['7xlarge'],
32
34
  };
33
35
 
34
36
  return { colors, fonts: theme.fonts, fontSizes, lineHeights };
@@ -12,6 +12,7 @@ const globalPalette: GlobalSystemPalette = {
12
12
  disabledOnDefaultGlobalSurface: palette.greyLight30,
13
13
  darkGlobalSurface: palette.maasstrichtBlue,
14
14
  onDarkGlobalSurface: palette.white,
15
+ overlayGlobalSurface: palette.black,
15
16
 
16
17
  // Outlines
17
18
  primaryOutline: palette.maasstrichtBlue,
@@ -9,6 +9,7 @@ export type GlobalSystemPalette = {
9
9
  disabledOnDefaultGlobalSurface: string;
10
10
  darkGlobalSurface: string;
11
11
  onDarkGlobalSurface: string;
12
+ overlayGlobalSurface: string;
12
13
 
13
14
  // Outlines
14
15
  primaryOutline: string;
@@ -5,7 +5,7 @@ const BASE_SPACE = 8;
5
5
  const BASE_SIZE = 8;
6
6
 
7
7
  const NEUTRAL_FONT = 'BeVietnamPro';
8
- const PLAYFUL_FONT = 'DarkerGrotesque';
8
+ const PLAYFUL_FONT = 'RebondGrotesque';
9
9
 
10
10
  const BASE_FONT_SIZE = 10;
11
11
 
@@ -12,6 +12,7 @@ interface Fonts {
12
12
  }
13
13
 
14
14
  interface FontSizes {
15
+ '7xlarge': number;
15
16
  xxxxxlarge: number;
16
17
  xxxxlarge: number;
17
18
  xxxlarge: number;
@@ -50,7 +51,7 @@ const getFonts = ({
50
51
  });
51
52
 
52
53
  const getFontSizes = (baseFontSize: number): FontSizes => {
53
- const fontSizes = Array.from(new Array(9));
54
+ const fontSizes = Array.from(new Array(11));
54
55
  fontSizes.forEach((_, index) => {
55
56
  if (index === 0) {
56
57
  fontSizes[0] = baseFontSize;
@@ -60,6 +61,7 @@ const getFontSizes = (baseFontSize: number): FontSizes => {
60
61
  return undefined;
61
62
  });
62
63
  return {
64
+ '7xlarge': scale(fontSizes[10]), // 42
63
65
  xxxxxlarge: scale(fontSizes[8]), // 32
64
66
  xxxxlarge: scale(fontSizes[7]), // 28
65
67
  xxxlarge: scale(fontSizes[6]), // 24
@@ -75,6 +77,7 @@ const getFontSizes = (baseFontSize: number): FontSizes => {
75
77
  const getLineHeights = (fontSizes: FontSizes): LineHeights => {
76
78
  const additionalSpace = 8;
77
79
  return {
80
+ '7xlarge': fontSizes['7xlarge'] + additionalSpace,
78
81
  xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
79
82
  xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
80
83
  xxxlarge: fontSizes.xxxlarge + additionalSpace,
@@ -22,6 +22,8 @@ export function usePropsOrInternalState<T>(
22
22
  export const useDeprecation = (message: string, cond = true) => {
23
23
  useEffect(() => {
24
24
  // eslint-disable-next-line no-console
25
- console.warn(message);
25
+ if (cond) {
26
+ console.warn(message);
27
+ }
26
28
  }, [message, cond]);
27
29
  };
File without changes
File without changes
File without changes