@hero-design/rn 8.0.0-rc.0 → 8.0.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 (325) hide show
  1. package/.eslintrc.js +2 -1
  2. package/.turbo/turbo-build.log +9 -9
  3. package/assets/fonts/{RebondGrotesque-Regular.otf → RebondGrotesque.otf} +0 -0
  4. package/assets/fonts/hero-icons-mobile.ttf +0 -0
  5. package/es/index.js +437 -617
  6. package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
  7. package/lib/index.js +436 -616
  8. package/package.json +9 -7
  9. package/src/components/Alert/StyledAlert.tsx +2 -3
  10. package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +6 -12
  11. package/src/components/Alert/index.tsx +3 -23
  12. package/src/components/BottomSheet/StyledBottomSheet.tsx +0 -1
  13. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +4 -6
  14. package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +4 -26
  15. package/src/components/Button/Button.tsx +7 -16
  16. package/src/components/Button/StyledButton.tsx +0 -46
  17. package/src/components/Button/__tests__/Button.spec.tsx +10 -11
  18. package/src/components/Button/__tests__/StyledButton.spec.tsx +0 -3
  19. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +0 -91
  20. package/src/components/Card/StyledCard.tsx +2 -11
  21. package/src/components/Card/__tests__/StyledCard.spec.tsx +2 -14
  22. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -32
  23. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +0 -4
  24. package/src/components/Card/__tests__/index.spec.tsx +1 -13
  25. package/src/components/Card/index.tsx +5 -26
  26. package/src/components/DatePicker/DatePickerAndroid.tsx +4 -0
  27. package/src/components/DatePicker/DatePickerIOS.tsx +9 -11
  28. package/src/components/DatePicker/__tests__/DatePicker.spec.tsx +4 -0
  29. package/src/components/DatePicker/__tests__/DatePickerAndroid.spec.tsx +4 -0
  30. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +3 -0
  31. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +31 -12
  32. package/src/components/DatePicker/types.ts +8 -0
  33. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  34. package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
  35. package/src/components/Icon/IconList.ts +0 -8
  36. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +5 -7
  37. package/src/components/Progress/ProgressCircle.tsx +1 -1
  38. package/src/components/Select/Footer.tsx +2 -7
  39. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +120 -50
  40. package/src/components/Select/MultiSelect/index.tsx +1 -20
  41. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +5 -0
  42. package/src/components/Select/SingleSelect/index.tsx +5 -24
  43. package/src/components/Select/StyledSelect.tsx +1 -12
  44. package/src/components/Select/types.ts +1 -11
  45. package/src/components/Switch/StyledSwitch.tsx +7 -12
  46. package/src/components/Switch/__tests__/StyledSwitch.spec.tsx +2 -2
  47. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +10 -15
  48. package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +8 -12
  49. package/src/components/Switch/index.tsx +6 -22
  50. package/src/components/Tabs/ScrollableTabs.tsx +1 -6
  51. package/src/components/Tabs/TabWithBadge.tsx +1 -15
  52. package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +3 -1
  53. package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +0 -12
  54. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +4 -3
  55. package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +0 -70
  56. package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +1 -2
  57. package/src/components/Tabs/__tests__/index.spec.tsx +3 -1
  58. package/src/components/Tabs/index.tsx +12 -24
  59. package/src/components/Tag/StyledTag.tsx +0 -1
  60. package/src/components/Tag/__tests__/Tag.spec.tsx +0 -9
  61. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +0 -40
  62. package/src/components/Tag/index.tsx +3 -16
  63. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +12 -0
  64. package/src/components/TextInput/__tests__/index.spec.tsx +4 -2
  65. package/src/components/TextInput/index.tsx +7 -1
  66. package/src/components/TimePicker/TimePickerIOS.tsx +5 -11
  67. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +1 -0
  68. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +31 -12
  69. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +1 -1
  70. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +9 -72
  71. package/src/theme/components/bottomSheet.ts +2 -3
  72. package/src/theme/components/select.ts +1 -5
  73. package/src/theme/components/switch.ts +4 -14
  74. package/src/theme/components/tag.ts +0 -2
  75. package/src/theme/global/colors/swag.ts +1 -20
  76. package/src/theme/global/colors/types.ts +1 -58
  77. package/src/theme/global/typography.ts +1 -1
  78. package/src/utils/hooks.ts +1 -1
  79. package/types/components/Accordion/AccordionItem.d.ts +0 -0
  80. package/types/components/Accordion/StyledAccordion.d.ts +0 -0
  81. package/types/components/Accordion/index.d.ts +0 -0
  82. package/types/components/Alert/StyledAlert.d.ts +0 -1
  83. package/types/components/Alert/index.d.ts +1 -6
  84. package/types/components/Attachment/StyledAttachment.d.ts +0 -0
  85. package/types/components/Attachment/index.d.ts +0 -0
  86. package/types/components/Avatar/Avatar.d.ts +0 -0
  87. package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
  88. package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
  89. package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
  90. package/types/components/Avatar/StyledAvatar.d.ts +0 -0
  91. package/types/components/Avatar/index.d.ts +0 -0
  92. package/types/components/Badge/Status.d.ts +0 -0
  93. package/types/components/Badge/StyledBadge.d.ts +0 -0
  94. package/types/components/Badge/index.d.ts +0 -0
  95. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  96. package/types/components/BottomNavigation/index.d.ts +0 -0
  97. package/types/components/BottomSheet/Footer.d.ts +0 -0
  98. package/types/components/BottomSheet/Header.d.ts +0 -0
  99. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
  100. package/types/components/BottomSheet/index.d.ts +0 -0
  101. package/types/components/Box/StyledBox.d.ts +0 -0
  102. package/types/components/Box/config.d.ts +0 -0
  103. package/types/components/Box/index.d.ts +0 -0
  104. package/types/components/Box/types.d.ts +0 -0
  105. package/types/components/Button/Button.d.ts +2 -3
  106. package/types/components/Button/IconButton.d.ts +0 -0
  107. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
  108. package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
  109. package/types/components/Button/StyledButton.d.ts +1 -1
  110. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
  111. package/types/components/Button/UtilityButton/index.d.ts +0 -0
  112. package/types/components/Button/index.d.ts +0 -0
  113. package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
  114. package/types/components/Calendar/StyledCalendar.d.ts +0 -0
  115. package/types/components/Calendar/helpers.d.ts +0 -0
  116. package/types/components/Calendar/index.d.ts +0 -0
  117. package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
  118. package/types/components/Card/DataCard/index.d.ts +0 -0
  119. package/types/components/Card/StyledCard.d.ts +1 -8
  120. package/types/components/Card/index.d.ts +2 -8
  121. package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
  122. package/types/components/Checkbox/index.d.ts +0 -0
  123. package/types/components/Collapse/StyledCollapse.d.ts +0 -0
  124. package/types/components/Collapse/index.d.ts +0 -0
  125. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
  126. package/types/components/ContentNavigator/index.d.ts +0 -0
  127. package/types/components/DatePicker/DatePickerAndroid.d.ts +1 -1
  128. package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
  129. package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
  130. package/types/components/DatePicker/index.d.ts +0 -0
  131. package/types/components/DatePicker/types.d.ts +8 -0
  132. package/types/components/Divider/StyledDivider.d.ts +0 -0
  133. package/types/components/Divider/index.d.ts +0 -0
  134. package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
  135. package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
  136. package/types/components/Drawer/StyledDrawer.d.ts +0 -0
  137. package/types/components/Drawer/index.d.ts +0 -0
  138. package/types/components/Empty/StyledEmpty.d.ts +0 -0
  139. package/types/components/Empty/index.d.ts +0 -0
  140. package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  141. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  142. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  143. package/types/components/FAB/ActionGroup/index.d.ts +0 -0
  144. package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
  145. package/types/components/FAB/FAB.d.ts +0 -0
  146. package/types/components/FAB/StyledFAB.d.ts +0 -0
  147. package/types/components/FAB/index.d.ts +0 -0
  148. package/types/components/Icon/AnimatedIcon.d.ts +0 -0
  149. package/types/components/Icon/HeroIcon/index.d.ts +0 -0
  150. package/types/components/Icon/IconList.d.ts +1 -1
  151. package/types/components/Icon/index.d.ts +1 -1
  152. package/types/components/Icon/utils.d.ts +1 -1
  153. package/types/components/Image/index.d.ts +0 -0
  154. package/types/components/List/BasicListItem.d.ts +0 -0
  155. package/types/components/List/ListItem.d.ts +0 -0
  156. package/types/components/List/StyledBasicListItem.d.ts +0 -0
  157. package/types/components/List/StyledListItem.d.ts +0 -0
  158. package/types/components/List/index.d.ts +0 -0
  159. package/types/components/PinInput/PinCell.d.ts +0 -0
  160. package/types/components/PinInput/StyledPinInput.d.ts +0 -0
  161. package/types/components/PinInput/index.d.ts +0 -0
  162. package/types/components/Progress/ProgressBar.d.ts +0 -0
  163. package/types/components/Progress/ProgressCircle.d.ts +0 -0
  164. package/types/components/Progress/StyledProgressBar.d.ts +0 -0
  165. package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
  166. package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
  167. package/types/components/Progress/constants.d.ts +0 -0
  168. package/types/components/Progress/index.d.ts +0 -0
  169. package/types/components/Progress/types.d.ts +0 -0
  170. package/types/components/Radio/Radio.d.ts +0 -0
  171. package/types/components/Radio/RadioGroup.d.ts +0 -0
  172. package/types/components/Radio/StyledRadio.d.ts +0 -0
  173. package/types/components/Radio/index.d.ts +0 -0
  174. package/types/components/Radio/types.d.ts +0 -0
  175. package/types/components/RefreshControl/index.d.ts +0 -0
  176. package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
  177. package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
  178. package/types/components/RichTextEditor/MentionList.d.ts +0 -0
  179. package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
  180. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
  181. package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
  182. package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
  183. package/types/components/RichTextEditor/constants.d.ts +0 -0
  184. package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
  185. package/types/components/RichTextEditor/index.d.ts +0 -0
  186. package/types/components/RichTextEditor/types.d.ts +0 -0
  187. package/types/components/RichTextEditor/utils/events.d.ts +0 -0
  188. package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
  189. package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
  190. package/types/components/SectionHeading/index.d.ts +0 -0
  191. package/types/components/Select/BaseOptionList.d.ts +0 -0
  192. package/types/components/Select/Footer.d.ts +0 -0
  193. package/types/components/Select/MultiSelect/Option.d.ts +0 -0
  194. package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
  195. package/types/components/Select/MultiSelect/index.d.ts +1 -1
  196. package/types/components/Select/SingleSelect/Option.d.ts +0 -0
  197. package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
  198. package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
  199. package/types/components/Select/SingleSelect/index.d.ts +1 -1
  200. package/types/components/Select/StyledSelect.d.ts +1 -5
  201. package/types/components/Select/helpers.d.ts +0 -0
  202. package/types/components/Select/index.d.ts +1 -1
  203. package/types/components/Select/types.d.ts +1 -11
  204. package/types/components/Slider/index.d.ts +0 -0
  205. package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
  206. package/types/components/Spinner/StyledSpinner.d.ts +0 -0
  207. package/types/components/Spinner/index.d.ts +0 -0
  208. package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
  209. package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
  210. package/types/components/Swipeable/index.d.ts +0 -0
  211. package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
  212. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
  213. package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
  214. package/types/components/Switch/StyledSwitch.d.ts +0 -4
  215. package/types/components/Switch/index.d.ts +1 -6
  216. package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
  217. package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
  218. package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
  219. package/types/components/Tabs/StyledTabs.d.ts +0 -0
  220. package/types/components/Tabs/TabWithBadge.d.ts +1 -2
  221. package/types/components/Tabs/index.d.ts +2 -3
  222. package/types/components/Tabs/utils.d.ts +0 -0
  223. package/types/components/Tag/StyledTag.d.ts +1 -1
  224. package/types/components/Tag/index.d.ts +2 -2
  225. package/types/components/TextInput/StyledTextInput.d.ts +0 -0
  226. package/types/components/TextInput/index.d.ts +0 -0
  227. package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
  228. package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
  229. package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
  230. package/types/components/TimePicker/index.d.ts +0 -0
  231. package/types/components/TimePicker/types.d.ts +0 -0
  232. package/types/components/Toast/StyledToast.d.ts +0 -0
  233. package/types/components/Toast/Toast.d.ts +0 -0
  234. package/types/components/Toast/ToastContainer.d.ts +0 -0
  235. package/types/components/Toast/ToastContext.d.ts +0 -0
  236. package/types/components/Toast/ToastProvider.d.ts +0 -0
  237. package/types/components/Toast/index.d.ts +0 -0
  238. package/types/components/Toast/types.d.ts +0 -0
  239. package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
  240. package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
  241. package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
  242. package/types/components/Toolbar/index.d.ts +0 -0
  243. package/types/components/Typography/Text/StyledText.d.ts +0 -0
  244. package/types/components/Typography/Text/index.d.ts +0 -0
  245. package/types/components/Typography/index.d.ts +0 -0
  246. package/types/index.d.ts +0 -0
  247. package/types/testHelpers/renderWithTheme.d.ts +0 -0
  248. package/types/theme/ThemeProvider.d.ts +0 -0
  249. package/types/theme/ThemeSwitcher.d.ts +0 -0
  250. package/types/theme/components/accordion.d.ts +0 -0
  251. package/types/theme/components/alert.d.ts +0 -0
  252. package/types/theme/components/attachment.d.ts +0 -0
  253. package/types/theme/components/avatar.d.ts +0 -0
  254. package/types/theme/components/badge.d.ts +0 -0
  255. package/types/theme/components/bottomNavigation.d.ts +0 -0
  256. package/types/theme/components/bottomSheet.d.ts +0 -1
  257. package/types/theme/components/button.d.ts +0 -0
  258. package/types/theme/components/calendar.d.ts +0 -0
  259. package/types/theme/components/card.d.ts +0 -0
  260. package/types/theme/components/checkbox.d.ts +0 -0
  261. package/types/theme/components/contentNavigator.d.ts +0 -0
  262. package/types/theme/components/datePicker.d.ts +0 -0
  263. package/types/theme/components/divider.d.ts +0 -0
  264. package/types/theme/components/drawer.d.ts +0 -0
  265. package/types/theme/components/empty.d.ts +0 -0
  266. package/types/theme/components/fab.d.ts +0 -0
  267. package/types/theme/components/icon.d.ts +0 -0
  268. package/types/theme/components/image.d.ts +0 -0
  269. package/types/theme/components/list.d.ts +0 -0
  270. package/types/theme/components/pinInput.d.ts +0 -0
  271. package/types/theme/components/progress.d.ts +0 -0
  272. package/types/theme/components/radio.d.ts +0 -0
  273. package/types/theme/components/refreshControl.d.ts +0 -0
  274. package/types/theme/components/richTextEditor.d.ts +0 -0
  275. package/types/theme/components/sectionHeading.d.ts +0 -0
  276. package/types/theme/components/select.d.ts +0 -3
  277. package/types/theme/components/slider.d.ts +0 -0
  278. package/types/theme/components/spinner.d.ts +0 -0
  279. package/types/theme/components/swipeable.d.ts +0 -0
  280. package/types/theme/components/switch.d.ts +4 -14
  281. package/types/theme/components/tabs.d.ts +0 -0
  282. package/types/theme/components/tag.d.ts +0 -2
  283. package/types/theme/components/textInput.d.ts +0 -0
  284. package/types/theme/components/timePicker.d.ts +0 -0
  285. package/types/theme/components/toast.d.ts +0 -0
  286. package/types/theme/components/toolbar.d.ts +0 -0
  287. package/types/theme/components/typography.d.ts +0 -0
  288. package/types/theme/getTheme.d.ts +0 -0
  289. package/types/theme/global/borders.d.ts +0 -0
  290. package/types/theme/global/colors/eBens.d.ts +0 -0
  291. package/types/theme/global/colors/global.d.ts +0 -0
  292. package/types/theme/global/colors/jobs.d.ts +0 -0
  293. package/types/theme/global/colors/swag.d.ts +0 -0
  294. package/types/theme/global/colors/types.d.ts +1 -52
  295. package/types/theme/global/colors/wallet.d.ts +0 -0
  296. package/types/theme/global/colors/work.d.ts +0 -0
  297. package/types/theme/global/index.d.ts +0 -47
  298. package/types/theme/global/scale.d.ts +0 -0
  299. package/types/theme/global/sizes.d.ts +0 -0
  300. package/types/theme/global/space.d.ts +0 -0
  301. package/types/theme/global/typography.d.ts +0 -0
  302. package/types/theme/index.d.ts +0 -0
  303. package/types/types.d.ts +0 -0
  304. package/types/utils/functions.d.ts +0 -0
  305. package/types/utils/helpers.d.ts +0 -0
  306. package/types/utils/hooks.d.ts +0 -0
  307. package/types/utils/scale.d.ts +0 -0
  308. package/.expo/README.md +0 -15
  309. package/.expo/packager-info.json +0 -10
  310. package/.expo/prebuild/cached-packages.json +0 -4
  311. package/.expo/settings.json +0 -10
  312. package/.expo/xcodebuild-error.log +0 -2
  313. package/.expo/xcodebuild.log +0 -11199
  314. package/.turbo/turbo-build:types.log +0 -2
  315. package/.turbo/turbo-build:watch.log +0 -1
  316. package/.turbo/turbo-lint.log +0 -96
  317. package/.turbo/turbo-test.log +0 -909
  318. package/src/components/Select/__tests__/StyledSelect.spec.tsx +0 -14
  319. package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +0 -29
  320. package/src/theme/__tests__/ensureCompatibleWithV7.spec.tsx +0 -13
  321. package/src/theme/global/colors/legacySystemPalette.ts +0 -53
  322. package/types/components/Accordion/utils.d.ts +0 -1
  323. package/types/components/Select/StyledOptionList.d.ts +0 -12
  324. package/types/theme/global/colors/legacySystemPalette.d.ts +0 -3
  325. package/types/theme/utils.d.ts +0 -2
@@ -8,11 +8,10 @@ exports[`StyledKnot renders correct style 1`] = `
8
8
  Object {
9
9
  "backgroundColor": "#ffffff",
10
10
  "borderRadius": 999,
11
- "height": 24,
12
- "width": 24,
11
+ "height": 16,
12
+ "width": 16,
13
13
  }
14
14
  }
15
- themeSize="medium"
16
15
  />
17
16
  `;
18
17
 
@@ -24,15 +23,14 @@ exports[`StyledWrapper renders correct style with variant checked 1`] = `
24
23
  "backgroundColor": "#401960",
25
24
  "borderRadius": 999,
26
25
  "display": "flex",
27
- "height": 32,
26
+ "height": 24,
28
27
  "justifyContent": "center",
29
28
  "paddingHorizontal": 4,
30
- "width": 64,
29
+ "width": 48,
31
30
  },
32
31
  undefined,
33
32
  ]
34
33
  }
35
- themeSize="medium"
36
34
  themeVariant="checked"
37
35
  />
38
36
  `;
@@ -45,15 +43,14 @@ exports[`StyledWrapper renders correct style with variant disabled-checked 1`] =
45
43
  "backgroundColor": "#ece8ef",
46
44
  "borderRadius": 999,
47
45
  "display": "flex",
48
- "height": 32,
46
+ "height": 24,
49
47
  "justifyContent": "center",
50
48
  "paddingHorizontal": 4,
51
- "width": 64,
49
+ "width": 48,
52
50
  },
53
51
  undefined,
54
52
  ]
55
53
  }
56
- themeSize="medium"
57
54
  themeVariant="disabled-checked"
58
55
  />
59
56
  `;
@@ -66,15 +63,14 @@ exports[`StyledWrapper renders correct style with variant disabled-unchecked 1`]
66
63
  "backgroundColor": "#bfc1c5",
67
64
  "borderRadius": 999,
68
65
  "display": "flex",
69
- "height": 32,
66
+ "height": 24,
70
67
  "justifyContent": "center",
71
68
  "paddingHorizontal": 4,
72
- "width": 64,
69
+ "width": 48,
73
70
  },
74
71
  undefined,
75
72
  ]
76
73
  }
77
- themeSize="medium"
78
74
  themeVariant="disabled-unchecked"
79
75
  />
80
76
  `;
@@ -87,15 +83,14 @@ exports[`StyledWrapper renders correct style with variant unchecked 1`] = `
87
83
  "backgroundColor": "#808f91",
88
84
  "borderRadius": 999,
89
85
  "display": "flex",
90
- "height": 32,
86
+ "height": 24,
91
87
  "justifyContent": "center",
92
88
  "paddingHorizontal": 4,
93
- "width": 64,
89
+ "width": 48,
94
90
  },
95
91
  undefined,
96
92
  ]
97
93
  }
98
- themeSize="medium"
99
94
  themeVariant="unchecked"
100
95
  />
101
96
  `;
@@ -22,16 +22,15 @@ exports[`Switch renders correctly 1`] = `
22
22
  "backgroundColor": "#808f91",
23
23
  "borderRadius": 999,
24
24
  "display": "flex",
25
- "height": 32,
25
+ "height": 24,
26
26
  "justifyContent": "center",
27
27
  "paddingHorizontal": 4,
28
- "width": 64,
28
+ "width": 48,
29
29
  },
30
30
  undefined,
31
31
  ]
32
32
  }
33
33
  testID="switch"
34
- themeSize="medium"
35
34
  themeVariant="unchecked"
36
35
  >
37
36
  <View
@@ -41,12 +40,11 @@ exports[`Switch renders correctly 1`] = `
41
40
  Object {
42
41
  "backgroundColor": "#ffffff",
43
42
  "borderRadius": 999,
44
- "height": 24,
43
+ "height": 16,
45
44
  "left": 0,
46
- "width": 24,
45
+ "width": 16,
47
46
  }
48
47
  }
49
- themeSize="medium"
50
48
  />
51
49
  </View>
52
50
  `;
@@ -73,16 +71,15 @@ exports[`Switch trigger press function correctly 1`] = `
73
71
  "backgroundColor": "#808f91",
74
72
  "borderRadius": 999,
75
73
  "display": "flex",
76
- "height": 32,
74
+ "height": 24,
77
75
  "justifyContent": "center",
78
76
  "paddingHorizontal": 4,
79
- "width": 64,
77
+ "width": 48,
80
78
  },
81
79
  undefined,
82
80
  ]
83
81
  }
84
82
  testID="switch"
85
- themeSize="medium"
86
83
  themeVariant="unchecked"
87
84
  >
88
85
  <View
@@ -92,12 +89,11 @@ exports[`Switch trigger press function correctly 1`] = `
92
89
  Object {
93
90
  "backgroundColor": "#ffffff",
94
91
  "borderRadius": 999,
95
- "height": 24,
92
+ "height": 16,
96
93
  "left": 0,
97
- "width": 24,
94
+ "width": 16,
98
95
  }
99
96
  }
100
- themeSize="medium"
101
97
  />
102
98
  </View>
103
99
  `;
@@ -1,13 +1,12 @@
1
1
  import { useTheme } from '@emotion/react';
2
- import React, { useState, useEffect } from 'react';
2
+ import React, { useEffect, useState } from 'react';
3
3
 
4
4
  import { Animated, Easing, TouchableWithoutFeedback } from 'react-native';
5
5
 
6
6
  import type { ReactElement } from 'react';
7
7
  import type { StyleProp, ViewStyle } from 'react-native';
8
- import { StyledKnot, StyledWrapper, Variant } from './StyledSwitch';
9
8
  import SelectorSwitch from './SelectorSwitch';
10
- import { useDeprecation } from '../../utils/hooks';
9
+ import { StyledKnot, StyledWrapper, Variant } from './StyledSwitch';
11
10
 
12
11
  export interface SwitchProps {
13
12
  /**
@@ -22,11 +21,6 @@ export interface SwitchProps {
22
21
  * Event handler.
23
22
  */
24
23
  onPress?: () => void;
25
- /**
26
- * Size of the switch
27
- * size is deprecated and will be removed in the next major release.
28
- */
29
- size?: 'small' | 'medium';
30
24
  /**
31
25
  * Additional style.
32
26
  */
@@ -51,28 +45,18 @@ const getVariant = ({
51
45
  };
52
46
 
53
47
  const Switch = ({
54
- size: _size,
55
48
  disabled = false,
56
49
  checked = false,
57
50
  onPress,
58
51
  style,
59
52
  testID,
60
53
  }: SwitchProps): ReactElement => {
61
- const size: SwitchProps['size'] = _size === undefined ? 'medium' : _size;
62
-
63
54
  const theme = useTheme();
64
55
  const variant = getVariant({ disabled, checked });
65
56
 
66
- useDeprecation(
67
- "Switch's size prop will be removed in the next major release.",
68
- _size !== undefined
69
- );
70
-
71
57
  const offset = checked
72
- ? (theme.__hd__.switch.sizes.widths[size] -
73
- theme.__hd__.switch.sizes.thumbs[size]) /
74
- 2 +
75
- theme.__hd__.switch.sizes.thumbs[size] / 2
58
+ ? (theme.__hd__.switch.sizes.width - theme.__hd__.switch.sizes.thumb) / 2 +
59
+ theme.__hd__.switch.sizes.thumb / 2
76
60
  : 0;
77
61
 
78
62
  const [animatedOffset] = useState(() => new Animated.Value(offset));
@@ -90,8 +74,8 @@ const Switch = ({
90
74
  onPress={onPress}
91
75
  disabled={disabled}
92
76
  >
93
- <StyledWrapper themeVariant={variant} themeSize={size} style={style}>
94
- <StyledKnot themeSize={size} style={{ left: animatedOffset }} />
77
+ <StyledWrapper themeVariant={variant} style={style}>
78
+ <StyledKnot style={{ left: animatedOffset }} />
95
79
  </StyledWrapper>
96
80
  </TouchableWithoutFeedback>
97
81
  );
@@ -130,7 +130,6 @@ const ScrollableTab = ({
130
130
  testID,
131
131
  activeItem,
132
132
  inactiveItem: originalInactiveItem,
133
- showBadge,
134
133
  badge,
135
134
  } = tab;
136
135
  const active = selectedTabKey === key;
@@ -174,11 +173,7 @@ const ScrollableTab = ({
174
173
  />
175
174
  </HeaderTabItemOutlineWrapper>
176
175
  <HeaderTabItemWrapper>
177
- <TabWithBadge
178
- showBadge={showBadge}
179
- config={badge}
180
- tabItem={tabItem}
181
- />
176
+ <TabWithBadge config={badge} tabItem={tabItem} />
182
177
  </HeaderTabItemWrapper>
183
178
  </HeaderTabItem>
184
179
  </TouchableWithoutFeedback>
@@ -17,27 +17,13 @@ export type CounterBadgeType = {
17
17
  export type BadgeConfigType = StatusBadgeType | CounterBadgeType;
18
18
 
19
19
  interface TabWithBadgeProps {
20
- showBadge?: boolean;
21
20
  config?: BadgeConfigType;
22
21
  tabItem: ReactNode;
23
22
  }
24
23
 
25
- const TabWithBadge = ({ showBadge, config, tabItem }: TabWithBadgeProps) => {
24
+ const TabWithBadge = ({ config, tabItem }: TabWithBadgeProps) => {
26
25
  const theme = useTheme();
27
26
 
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
27
  if (!config) return <View>{tabItem}</View>;
42
28
 
43
29
  if (config.type === 'status') {
@@ -32,7 +32,9 @@ const TestTabsComponent = (
32
32
  activeItem: 'home',
33
33
  inactiveItem: 'home-outlined',
34
34
  component: <Text>Home Screen</Text>,
35
- showBadge: true,
35
+ badge: {
36
+ type: 'status',
37
+ },
36
38
  },
37
39
  {
38
40
  key: 'calendar',
@@ -12,18 +12,6 @@ const counterBadge = {
12
12
  } as const;
13
13
 
14
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
15
  it('renders nothing config is not available', () => {
28
16
  const { toJSON } = renderWithTheme(<TabWithBadge tabItem="Tab Item" />);
29
17
 
@@ -148,12 +148,14 @@ exports[`Tabs.Scroll renders correctly 1`] = `
148
148
  },
149
149
  Object {
150
150
  "activeItem": "home",
151
+ "badge": Object {
152
+ "type": "status",
153
+ },
151
154
  "component": <Text>
152
155
  Home Screen
153
156
  </Text>,
154
157
  "inactiveItem": "home-outlined",
155
158
  "key": "home",
156
- "showBadge": true,
157
159
  },
158
160
  Object {
159
161
  "activeItem": "calendar",
@@ -467,10 +469,9 @@ exports[`Tabs.Scroll renders correctly 1`] = `
467
469
  <View
468
470
  style={
469
471
  Object {
470
- "paddingHorizontal": 8,
472
+ "paddingHorizontal": 4,
471
473
  }
472
474
  }
473
- testID="deprecated-badge"
474
475
  >
475
476
  <HeroIcon
476
477
  name="home-outlined"
@@ -1,75 +1,5 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
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
3
  exports[`TabWithBadge renders correctly with counter badge config 1`] = `
74
4
  <View
75
5
  style={
@@ -253,10 +253,9 @@ exports[`Tabs renders correctly 1`] = `
253
253
  <View
254
254
  style={
255
255
  Object {
256
- "paddingHorizontal": 8,
256
+ "paddingHorizontal": 4,
257
257
  }
258
258
  }
259
- testID="deprecated-badge"
260
259
  >
261
260
  <Text
262
261
  numberOfLines={1}
@@ -30,7 +30,9 @@ const TestTabsComponent = (
30
30
  key: 'home',
31
31
  activeItem: 'Home',
32
32
  component: <Text>Home Screen</Text>,
33
- showBadge: true,
33
+ badge: {
34
+ type: 'status',
35
+ },
34
36
  },
35
37
  {
36
38
  key: 'wallet',
@@ -1,26 +1,25 @@
1
- import React, { useEffect } from 'react';
2
- import { Animated, TouchableWithoutFeedback, View } from 'react-native';
3
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
1
  import { useTheme } from '@emotion/react';
5
- import PagerView from 'react-native-pager-view';
6
2
  import type { ReactNode } from 'react';
7
- import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
3
+ import React, { useEffect } from 'react';
4
+ import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
5
+ import { Animated, TouchableWithoutFeedback, View } from 'react-native';
8
6
  import type { PagerViewOnPageScrollEventData } from 'react-native-pager-view';
7
+ import PagerView from 'react-native-pager-view';
8
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
9
+ import { IconName } from '../Icon';
9
10
  import Typography from '../Typography';
11
+ import ActiveTabIndicator from './ActiveTabIndicator';
12
+ import ScrollableTabs from './ScrollableTabs';
10
13
  import {
11
14
  ContentWrapper,
12
- HeaderTabWrapper,
15
+ HeaderTab,
13
16
  HeaderTabItem,
17
+ HeaderTabWrapper,
14
18
  TabContainer,
15
19
  TabScreen,
16
- HeaderTab,
17
20
  } from './StyledTabs';
18
- import ActiveTabIndicator from './ActiveTabIndicator';
19
- import ScrollableTabs from './ScrollableTabs';
20
- import TabWithBadge from './TabWithBadge';
21
21
  import type { BadgeConfigType } from './TabWithBadge';
22
- import { IconName } from '../Icon';
23
- import { useDeprecation } from '../../utils/hooks';
22
+ import TabWithBadge from './TabWithBadge';
24
23
 
25
24
  export type ItemType =
26
25
  | string
@@ -33,7 +32,6 @@ export type TabType = {
33
32
  inactiveItem?: ItemType;
34
33
  component: ReactNode;
35
34
  testID?: string;
36
- showBadge?: boolean;
37
35
  badge?: BadgeConfigType;
38
36
  };
39
37
 
@@ -114,11 +112,6 @@ const Tabs = ({
114
112
  swipeEnabled = true,
115
113
  testID: componentTestID,
116
114
  }: 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
-
122
115
  const theme = useTheme();
123
116
  const insets = useSafeAreaInsets();
124
117
  const pagerViewRef = React.useRef<PagerView>(null);
@@ -157,7 +150,6 @@ const Tabs = ({
157
150
  testID,
158
151
  activeItem,
159
152
  inactiveItem: originalInactiveItem,
160
- showBadge,
161
153
  badge,
162
154
  } = tab;
163
155
 
@@ -178,11 +170,7 @@ const Tabs = ({
178
170
  testID={testID}
179
171
  >
180
172
  <HeaderTabItem>
181
- <TabWithBadge
182
- showBadge={showBadge}
183
- config={badge}
184
- tabItem={tabItem}
185
- />
173
+ <TabWithBadge config={badge} tabItem={tabItem} />
186
174
  </HeaderTabItem>
187
175
  </TouchableWithoutFeedback>
188
176
  );
@@ -3,7 +3,6 @@ import styled from '@emotion/native';
3
3
  import { Theme } from '../../theme';
4
4
 
5
5
  type ThemeIntent =
6
- | 'default'
7
6
  | 'primary'
8
7
  | 'info'
9
8
  | 'success'
@@ -40,15 +40,6 @@ describe('Tag', () => {
40
40
  expect(getByText('INFO')).toBeDefined();
41
41
  });
42
42
 
43
- it('has default style when intent is default', () => {
44
- const { getByText, toJSON } = renderWithTheme(
45
- <Tag content="DEFAULT" intent="default" />
46
- );
47
-
48
- expect(toJSON()).toMatchSnapshot();
49
- expect(getByText('DEFAULT')).toBeDefined();
50
- });
51
-
52
43
  it('has archived style when intent is archived', () => {
53
44
  const { getByText, toJSON } = renderWithTheme(
54
45
  <Tag content="ARCHIVED" intent="archived" />
@@ -120,46 +120,6 @@ exports[`Tag has danger style when intent is danger 1`] = `
120
120
  </View>
121
121
  `;
122
122
 
123
- exports[`Tag has default style when intent is default 1`] = `
124
- <View
125
- style={
126
- Array [
127
- Object {
128
- "backgroundColor": undefined,
129
- "borderColor": "#001f23",
130
- "borderRadius": 4,
131
- "borderWidth": 1,
132
- "paddingHorizontal": 8,
133
- "paddingVertical": 2,
134
- },
135
- undefined,
136
- ]
137
- }
138
- themeIntent="default"
139
- themeVariant="outlined"
140
- >
141
- <Text
142
- style={
143
- Array [
144
- Object {
145
- "color": "#001f23",
146
- "fontFamily": "BeVietnamPro-SemiBold",
147
- "fontSize": 12,
148
- "includeFontPadding": false,
149
- "textAlign": "center",
150
- "textAlignVertical": "center",
151
- },
152
- undefined,
153
- ]
154
- }
155
- themeIntent="default"
156
- themeVariant="outlined"
157
- >
158
- DEFAULT
159
- </Text>
160
- </View>
161
- `;
162
-
163
123
  exports[`Tag has info style when intent is info 1`] = `
164
124
  <View
165
125
  style={
@@ -1,7 +1,6 @@
1
1
  import React, { ReactElement } from 'react';
2
- import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
3
- import { useDeprecation } from '../../utils/hooks';
4
- import { StyledView, StyledText } from './StyledTag';
2
+ import type { StyleProp, ViewProps, ViewStyle } from 'react-native';
3
+ import { StyledText, StyledView } from './StyledTag';
5
4
 
6
5
  interface TagProps extends ViewProps {
7
6
  /**
@@ -11,14 +10,7 @@ interface TagProps extends ViewProps {
11
10
  /**
12
11
  * Visual intent color to apply to Tag.
13
12
  */
14
- intent?:
15
- | 'primary'
16
- | 'default' // Will be deprecated in the future
17
- | 'info'
18
- | 'success'
19
- | 'warning'
20
- | 'danger'
21
- | 'archived';
13
+ intent?: 'primary' | 'info' | 'success' | 'warning' | 'danger' | 'archived';
22
14
  /**
23
15
  * Tag variant.
24
16
  */
@@ -41,11 +33,6 @@ const Tag = ({
41
33
  testID,
42
34
  ...nativeProps
43
35
  }: 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
36
  return (
50
37
  <StyledView
51
38
  {...nativeProps}