@hero-design/rn 8.22.0-alpha.0 → 8.23.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 (295) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/.turbo/turbo-publish:npm.log +0 -9
  3. package/es/index.js +283 -91
  4. package/lib/index.js +283 -90
  5. package/package.json +5 -5
  6. package/src/components/Alert/index.tsx +6 -0
  7. package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  8. package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
  9. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +180 -138
  10. package/src/components/FAB/FAB.tsx +17 -12
  11. package/src/components/FAB/StyledFAB.tsx +13 -4
  12. package/src/components/FAB/__tests__/__snapshots__/StyledFAB.spec.tsx.snap +13 -21
  13. package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +214 -151
  14. package/src/components/List/ListItem.tsx +12 -8
  15. package/src/components/Success/StyledSuccess.tsx +87 -0
  16. package/src/components/Success/__tests__/__snapshots__/index.spec.tsx.snap +497 -0
  17. package/src/components/Success/__tests__/index.spec.tsx +78 -0
  18. package/src/components/Success/index.tsx +129 -0
  19. package/src/components/Tag/StyledTag.tsx +1 -1
  20. package/src/components/Tag/__tests__/Tag.spec.tsx +22 -71
  21. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +106 -53
  22. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +265 -0
  23. package/src/components/TextInput/__tests__/index.spec.tsx +29 -0
  24. package/src/components/TextInput/index.tsx +6 -1
  25. package/src/index.ts +2 -0
  26. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +43 -3
  27. package/src/theme/components/empty.ts +1 -1
  28. package/src/theme/components/error.ts +1 -1
  29. package/src/theme/components/fab.ts +18 -1
  30. package/src/theme/components/success.ts +40 -0
  31. package/src/theme/components/tag.ts +1 -1
  32. package/src/theme/getTheme.ts +3 -0
  33. package/src/theme/global/colors/__tests__/__snapshots__/globalDark.spec.ts.snap +19 -19
  34. package/src/theme/global/colors/__tests__/__snapshots__/swagDark.spec.ts.snap +19 -19
  35. package/src/theme/global/colors/globalDark.ts +24 -24
  36. package/src/utils/hooks.ts +1 -1
  37. package/types/components/Accordion/AccordionItem.d.ts +0 -0
  38. package/types/components/Accordion/StyledAccordion.d.ts +0 -0
  39. package/types/components/Accordion/index.d.ts +0 -0
  40. package/types/components/Alert/StyledAlert.d.ts +0 -0
  41. package/types/components/Alert/index.d.ts +0 -0
  42. package/types/components/Attachment/StyledAttachment.d.ts +0 -0
  43. package/types/components/Attachment/index.d.ts +0 -0
  44. package/types/components/Avatar/Avatar.d.ts +0 -0
  45. package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +0 -0
  46. package/types/components/Avatar/AvatarStack/index.d.ts +0 -0
  47. package/types/components/Avatar/AvatarStack/utils.d.ts +0 -0
  48. package/types/components/Avatar/StyledAvatar.d.ts +0 -0
  49. package/types/components/Avatar/index.d.ts +0 -0
  50. package/types/components/Badge/Status.d.ts +0 -0
  51. package/types/components/Badge/StyledBadge.d.ts +0 -0
  52. package/types/components/Badge/index.d.ts +0 -0
  53. package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +0 -0
  54. package/types/components/BottomNavigation/index.d.ts +0 -0
  55. package/types/components/BottomSheet/BottomSheetContext.d.ts +0 -0
  56. package/types/components/BottomSheet/Footer.d.ts +0 -0
  57. package/types/components/BottomSheet/Header.d.ts +0 -0
  58. package/types/components/BottomSheet/ScrollView.d.ts +0 -0
  59. package/types/components/BottomSheet/StyledBottomSheet.d.ts +0 -0
  60. package/types/components/BottomSheet/index.d.ts +0 -0
  61. package/types/components/Box/StyledBox.d.ts +0 -0
  62. package/types/components/Box/config.d.ts +0 -0
  63. package/types/components/Box/index.d.ts +0 -0
  64. package/types/components/Box/types.d.ts +0 -0
  65. package/types/components/Button/Button.d.ts +0 -0
  66. package/types/components/Button/IconButton.d.ts +0 -0
  67. package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +0 -0
  68. package/types/components/Button/LoadingIndicator/index.d.ts +0 -0
  69. package/types/components/Button/StyledButton.d.ts +0 -0
  70. package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +0 -0
  71. package/types/components/Button/UtilityButton/index.d.ts +0 -0
  72. package/types/components/Button/index.d.ts +0 -0
  73. package/types/components/Calendar/CalendarRowItem.d.ts +0 -0
  74. package/types/components/Calendar/StyledCalendar.d.ts +0 -0
  75. package/types/components/Calendar/helpers.d.ts +0 -0
  76. package/types/components/Calendar/index.d.ts +0 -0
  77. package/types/components/Card/DataCard/StyledDataCard.d.ts +0 -0
  78. package/types/components/Card/DataCard/index.d.ts +0 -0
  79. package/types/components/Card/StyledCard.d.ts +0 -0
  80. package/types/components/Card/index.d.ts +0 -0
  81. package/types/components/Carousel/CardCarousel.d.ts +0 -0
  82. package/types/components/Carousel/CarouselItem.d.ts +0 -0
  83. package/types/components/Carousel/StyledCardCarousel.d.ts +0 -0
  84. package/types/components/Carousel/StyledCarousel.d.ts +0 -0
  85. package/types/components/Carousel/contants.d.ts +0 -0
  86. package/types/components/Carousel/index.d.ts +0 -0
  87. package/types/components/Carousel/types.d.ts +0 -0
  88. package/types/components/Checkbox/StyledCheckbox.d.ts +0 -0
  89. package/types/components/Checkbox/index.d.ts +0 -0
  90. package/types/components/Collapse/StyledCollapse.d.ts +0 -0
  91. package/types/components/Collapse/index.d.ts +0 -0
  92. package/types/components/ContentNavigator/StyledContentNavigator.d.ts +0 -0
  93. package/types/components/ContentNavigator/index.d.ts +0 -0
  94. package/types/components/DatePicker/DatePickerAndroid.d.ts +0 -0
  95. package/types/components/DatePicker/DatePickerCalendar.d.ts +0 -0
  96. package/types/components/DatePicker/DatePickerIOS.d.ts +0 -0
  97. package/types/components/DatePicker/StyledDatePicker.d.ts +0 -0
  98. package/types/components/DatePicker/index.d.ts +0 -0
  99. package/types/components/DatePicker/types.d.ts +0 -0
  100. package/types/components/Divider/StyledDivider.d.ts +0 -0
  101. package/types/components/Divider/index.d.ts +0 -0
  102. package/types/components/Drawer/DragableDrawer/helpers.d.ts +0 -0
  103. package/types/components/Drawer/DragableDrawer/index.d.ts +0 -0
  104. package/types/components/Drawer/StyledDrawer.d.ts +0 -0
  105. package/types/components/Drawer/index.d.ts +0 -0
  106. package/types/components/Empty/StyledEmpty.d.ts +0 -0
  107. package/types/components/Empty/index.d.ts +0 -0
  108. package/types/components/Error/StyledError.d.ts +0 -0
  109. package/types/components/Error/index.d.ts +0 -0
  110. package/types/components/FAB/ActionGroup/ActionItem.d.ts +0 -0
  111. package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +0 -0
  112. package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +0 -0
  113. package/types/components/FAB/ActionGroup/index.d.ts +0 -0
  114. package/types/components/FAB/AnimatedFABIcon.d.ts +0 -0
  115. package/types/components/FAB/FAB.d.ts +0 -0
  116. package/types/components/FAB/StyledFAB.d.ts +7 -3
  117. package/types/components/FAB/index.d.ts +0 -0
  118. package/types/components/Icon/AnimatedIcon.d.ts +0 -0
  119. package/types/components/Icon/HeroIcon/index.d.ts +0 -0
  120. package/types/components/Icon/IconList.d.ts +0 -0
  121. package/types/components/Icon/index.d.ts +0 -0
  122. package/types/components/Icon/utils.d.ts +0 -0
  123. package/types/components/Image/index.d.ts +0 -0
  124. package/types/components/List/BasicListItem.d.ts +0 -0
  125. package/types/components/List/ListItem.d.ts +0 -0
  126. package/types/components/List/StyledBasicListItem.d.ts +0 -0
  127. package/types/components/List/StyledListItem.d.ts +0 -0
  128. package/types/components/List/index.d.ts +0 -0
  129. package/types/components/PageControl/StyledPageControl.d.ts +0 -0
  130. package/types/components/PageControl/index.d.ts +0 -0
  131. package/types/components/PinInput/PinCell.d.ts +0 -0
  132. package/types/components/PinInput/StyledPinInput.d.ts +0 -0
  133. package/types/components/PinInput/index.d.ts +0 -0
  134. package/types/components/Progress/ProgressBar.d.ts +0 -0
  135. package/types/components/Progress/ProgressCircle.d.ts +0 -0
  136. package/types/components/Progress/StyledProgressBar.d.ts +0 -0
  137. package/types/components/Progress/StyledProgressCircle.d.ts +0 -0
  138. package/types/components/Progress/__tests__/index.spec.d.ts +0 -0
  139. package/types/components/Progress/constants.d.ts +0 -0
  140. package/types/components/Progress/index.d.ts +0 -0
  141. package/types/components/Progress/types.d.ts +0 -0
  142. package/types/components/Radio/Radio.d.ts +0 -0
  143. package/types/components/Radio/RadioGroup.d.ts +0 -0
  144. package/types/components/Radio/StyledRadio.d.ts +0 -0
  145. package/types/components/Radio/index.d.ts +0 -0
  146. package/types/components/Radio/types.d.ts +0 -0
  147. package/types/components/RefreshControl/index.d.ts +0 -0
  148. package/types/components/RichTextEditor/EditorEvent.d.ts +0 -0
  149. package/types/components/RichTextEditor/EditorToolbar.d.ts +0 -0
  150. package/types/components/RichTextEditor/MentionList.d.ts +0 -0
  151. package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -0
  152. package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +0 -0
  153. package/types/components/RichTextEditor/StyledToolbar.d.ts +0 -0
  154. package/types/components/RichTextEditor/__mocks__/heroEditorApp.d.ts +0 -0
  155. package/types/components/RichTextEditor/constants.d.ts +0 -0
  156. package/types/components/RichTextEditor/heroEditorApp.d.ts +0 -0
  157. package/types/components/RichTextEditor/index.d.ts +0 -0
  158. package/types/components/RichTextEditor/types.d.ts +0 -0
  159. package/types/components/RichTextEditor/utils/events.d.ts +0 -0
  160. package/types/components/RichTextEditor/utils/rnWebView.d.ts +0 -0
  161. package/types/components/SectionHeading/StyledHeading.d.ts +0 -0
  162. package/types/components/SectionHeading/index.d.ts +0 -0
  163. package/types/components/Select/BaseOptionList.d.ts +0 -0
  164. package/types/components/Select/Footer.d.ts +0 -0
  165. package/types/components/Select/MultiSelect/Option.d.ts +0 -0
  166. package/types/components/Select/MultiSelect/OptionList.d.ts +0 -0
  167. package/types/components/Select/MultiSelect/index.d.ts +0 -0
  168. package/types/components/Select/SingleSelect/Option.d.ts +0 -0
  169. package/types/components/Select/SingleSelect/OptionList.d.ts +0 -0
  170. package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +0 -0
  171. package/types/components/Select/SingleSelect/index.d.ts +0 -0
  172. package/types/components/Select/StyledSelect.d.ts +0 -0
  173. package/types/components/Select/helpers.d.ts +0 -0
  174. package/types/components/Select/index.d.ts +0 -0
  175. package/types/components/Select/types.d.ts +0 -0
  176. package/types/components/Skeleton/StyledSkeleton.d.ts +0 -0
  177. package/types/components/Skeleton/index.d.ts +0 -0
  178. package/types/components/Slider/index.d.ts +0 -0
  179. package/types/components/Spinner/AnimatedSpinner.d.ts +0 -0
  180. package/types/components/Spinner/StyledSpinner.d.ts +0 -0
  181. package/types/components/Spinner/index.d.ts +0 -0
  182. package/types/components/Success/StyledSuccess.d.ts +54 -0
  183. package/types/components/Success/index.d.ts +42 -0
  184. package/types/components/Swipeable/StyledSwipeable.d.ts +0 -0
  185. package/types/components/Swipeable/SwipeableAction.d.ts +0 -0
  186. package/types/components/Swipeable/index.d.ts +0 -0
  187. package/types/components/Switch/SelectorSwitch/Option.d.ts +0 -0
  188. package/types/components/Switch/SelectorSwitch/StyledSelectorSwitch.d.ts +0 -0
  189. package/types/components/Switch/SelectorSwitch/index.d.ts +0 -0
  190. package/types/components/Switch/StyledSwitch.d.ts +0 -0
  191. package/types/components/Switch/index.d.ts +0 -0
  192. package/types/components/Tabs/ActiveTabIndicator.d.ts +0 -0
  193. package/types/components/Tabs/ScrollableTabs.d.ts +0 -0
  194. package/types/components/Tabs/StyledScrollableTabs.d.ts +0 -0
  195. package/types/components/Tabs/StyledTabs.d.ts +0 -0
  196. package/types/components/Tabs/TabWithBadge.d.ts +0 -0
  197. package/types/components/Tabs/index.d.ts +0 -0
  198. package/types/components/Tabs/utils.d.ts +0 -0
  199. package/types/components/Tag/StyledTag.d.ts +0 -0
  200. package/types/components/Tag/index.d.ts +0 -0
  201. package/types/components/TextInput/StyledTextInput.d.ts +0 -0
  202. package/types/components/TextInput/index.d.ts +5 -1
  203. package/types/components/TimePicker/StyledTimePicker.d.ts +0 -0
  204. package/types/components/TimePicker/TimePickerAndroid.d.ts +0 -0
  205. package/types/components/TimePicker/TimePickerIOS.d.ts +0 -0
  206. package/types/components/TimePicker/index.d.ts +0 -0
  207. package/types/components/TimePicker/types.d.ts +0 -0
  208. package/types/components/Toast/StyledToast.d.ts +0 -0
  209. package/types/components/Toast/Toast.d.ts +0 -0
  210. package/types/components/Toast/ToastContainer.d.ts +0 -0
  211. package/types/components/Toast/ToastContext.d.ts +0 -0
  212. package/types/components/Toast/ToastProvider.d.ts +0 -0
  213. package/types/components/Toast/index.d.ts +0 -0
  214. package/types/components/Toast/types.d.ts +0 -0
  215. package/types/components/Toolbar/StyledToolbar.d.ts +0 -0
  216. package/types/components/Toolbar/ToolbarGroup.d.ts +0 -0
  217. package/types/components/Toolbar/ToolbarItem.d.ts +0 -0
  218. package/types/components/Toolbar/index.d.ts +0 -0
  219. package/types/components/Typography/Text/StyledText.d.ts +0 -0
  220. package/types/components/Typography/Text/index.d.ts +0 -0
  221. package/types/components/Typography/index.d.ts +0 -0
  222. package/types/index.d.ts +2 -1
  223. package/types/testHelpers/renderWithTheme.d.ts +0 -0
  224. package/types/theme/ThemeProvider.d.ts +0 -0
  225. package/types/theme/ThemeSwitcher.d.ts +0 -0
  226. package/types/theme/components/accordion.d.ts +0 -0
  227. package/types/theme/components/alert.d.ts +0 -0
  228. package/types/theme/components/attachment.d.ts +0 -0
  229. package/types/theme/components/avatar.d.ts +0 -0
  230. package/types/theme/components/badge.d.ts +0 -0
  231. package/types/theme/components/bottomNavigation.d.ts +0 -0
  232. package/types/theme/components/bottomSheet.d.ts +0 -0
  233. package/types/theme/components/button.d.ts +0 -0
  234. package/types/theme/components/calendar.d.ts +0 -0
  235. package/types/theme/components/card.d.ts +0 -0
  236. package/types/theme/components/cardCarousel.d.ts +0 -0
  237. package/types/theme/components/carousel.d.ts +0 -0
  238. package/types/theme/components/checkbox.d.ts +0 -0
  239. package/types/theme/components/contentNavigator.d.ts +0 -0
  240. package/types/theme/components/datePicker.d.ts +0 -0
  241. package/types/theme/components/divider.d.ts +0 -0
  242. package/types/theme/components/drawer.d.ts +0 -0
  243. package/types/theme/components/empty.d.ts +0 -0
  244. package/types/theme/components/error.d.ts +0 -0
  245. package/types/theme/components/fab.d.ts +10 -0
  246. package/types/theme/components/icon.d.ts +0 -0
  247. package/types/theme/components/image.d.ts +0 -0
  248. package/types/theme/components/list.d.ts +0 -0
  249. package/types/theme/components/pageControl.d.ts +0 -0
  250. package/types/theme/components/pinInput.d.ts +0 -0
  251. package/types/theme/components/progress.d.ts +0 -0
  252. package/types/theme/components/radio.d.ts +0 -0
  253. package/types/theme/components/refreshControl.d.ts +0 -0
  254. package/types/theme/components/richTextEditor.d.ts +0 -0
  255. package/types/theme/components/sectionHeading.d.ts +0 -0
  256. package/types/theme/components/select.d.ts +0 -0
  257. package/types/theme/components/skeleton.d.ts +0 -0
  258. package/types/theme/components/slider.d.ts +0 -0
  259. package/types/theme/components/spinner.d.ts +0 -0
  260. package/types/theme/components/success.d.ts +32 -0
  261. package/types/theme/components/swipeable.d.ts +0 -0
  262. package/types/theme/components/switch.d.ts +0 -0
  263. package/types/theme/components/tabs.d.ts +0 -0
  264. package/types/theme/components/tag.d.ts +0 -0
  265. package/types/theme/components/textInput.d.ts +0 -0
  266. package/types/theme/components/timePicker.d.ts +0 -0
  267. package/types/theme/components/toast.d.ts +0 -0
  268. package/types/theme/components/toolbar.d.ts +0 -0
  269. package/types/theme/components/typography.d.ts +0 -0
  270. package/types/theme/getTheme.d.ts +2 -0
  271. package/types/theme/global/borders.d.ts +0 -0
  272. package/types/theme/global/colors/eBens.d.ts +0 -0
  273. package/types/theme/global/colors/global.d.ts +0 -0
  274. package/types/theme/global/colors/globalDark.d.ts +0 -0
  275. package/types/theme/global/colors/jobs.d.ts +0 -0
  276. package/types/theme/global/colors/swag.d.ts +0 -0
  277. package/types/theme/global/colors/swagDark.d.ts +0 -0
  278. package/types/theme/global/colors/types.d.ts +0 -0
  279. package/types/theme/global/colors/wallet.d.ts +0 -0
  280. package/types/theme/global/colors/work.d.ts +0 -0
  281. package/types/theme/global/index.d.ts +0 -0
  282. package/types/theme/global/scale.d.ts +0 -0
  283. package/types/theme/global/sizes.d.ts +0 -0
  284. package/types/theme/global/space.d.ts +0 -0
  285. package/types/theme/global/typography.d.ts +0 -0
  286. package/types/theme/index.d.ts +0 -0
  287. package/types/types.d.ts +0 -0
  288. package/types/utils/functions.d.ts +0 -0
  289. package/types/utils/helpers.d.ts +0 -0
  290. package/types/utils/hooks.d.ts +0 -0
  291. package/types/utils/scale.d.ts +0 -0
  292. package/.turbo/turbo-build:types.log +0 -2
  293. package/.turbo/turbo-lint.log +0 -146
  294. package/.turbo/turbo-test.log +0 -451
  295. package/.turbo/turbo-type-check.log +0 -2
@@ -2692,6 +2692,271 @@ exports[`TextInput max length renders correctly 1`] = `
2692
2692
  </View>
2693
2693
  `;
2694
2694
 
2695
+ exports[`TextInput max length renders correctly with hide character count 1`] = `
2696
+ <View
2697
+ pointerEvents="auto"
2698
+ style={
2699
+ Array [
2700
+ Object {
2701
+ "marginTop": 8,
2702
+ "width": "100%",
2703
+ },
2704
+ undefined,
2705
+ ]
2706
+ }
2707
+ >
2708
+ <View
2709
+ style={
2710
+ Array [
2711
+ Object {
2712
+ "alignItems": "center",
2713
+ "backgroundColor": "#ffffff",
2714
+ "borderRadius": 8,
2715
+ "flexDirection": "row",
2716
+ "padding": 16,
2717
+ },
2718
+ undefined,
2719
+ ]
2720
+ }
2721
+ >
2722
+ <View
2723
+ style={
2724
+ Array [
2725
+ Object {
2726
+ "borderColor": "#de350b",
2727
+ "borderRadius": 8,
2728
+ "borderWidth": 1,
2729
+ "bottom": 0,
2730
+ "left": 0,
2731
+ "position": "absolute",
2732
+ "right": 0,
2733
+ "top": 0,
2734
+ },
2735
+ Array [
2736
+ Object {
2737
+ "backgroundColor": "#ffffff",
2738
+ },
2739
+ undefined,
2740
+ ],
2741
+ ]
2742
+ }
2743
+ testID="text-input-border"
2744
+ themeFocused={false}
2745
+ themeVariant="error"
2746
+ />
2747
+ <View
2748
+ pointerEvents="none"
2749
+ style={
2750
+ Array [
2751
+ Object {
2752
+ "backgroundColor": "#ffffff",
2753
+ "flexDirection": "row",
2754
+ "left": 16,
2755
+ "paddingHorizontal": 4,
2756
+ "position": "absolute",
2757
+ "top": -10,
2758
+ "zIndex": 1,
2759
+ },
2760
+ Object {
2761
+ "backgroundColor": "#ffffff",
2762
+ },
2763
+ ]
2764
+ }
2765
+ testID="label-container"
2766
+ >
2767
+ <Text
2768
+ allowFontScaling={false}
2769
+ style={
2770
+ Array [
2771
+ Object {
2772
+ "color": "#001f23",
2773
+ "fontFamily": "BeVietnamPro-Regular",
2774
+ "fontSize": 12,
2775
+ "letterSpacing": 0.36,
2776
+ "lineHeight": 20,
2777
+ },
2778
+ Array [
2779
+ Object {
2780
+ "color": "#de350b",
2781
+ },
2782
+ undefined,
2783
+ ],
2784
+ ]
2785
+ }
2786
+ themeFontSize="small"
2787
+ themeFontWeight="regular"
2788
+ themeIntent="body"
2789
+ themeTypeface="neutral"
2790
+ themeVariant="error"
2791
+ >
2792
+ *
2793
+ </Text>
2794
+ <Text
2795
+ allowFontScaling={false}
2796
+ style={
2797
+ Array [
2798
+ Object {
2799
+ "color": "#001f23",
2800
+ "fontFamily": "BeVietnamPro-Regular",
2801
+ "fontSize": 12,
2802
+ "letterSpacing": 0.36,
2803
+ "lineHeight": 20,
2804
+ },
2805
+ Array [
2806
+ Object {
2807
+ "color": "#001f23",
2808
+ },
2809
+ Object {
2810
+ "backgroundColor": "#ffffff",
2811
+ },
2812
+ ],
2813
+ ]
2814
+ }
2815
+ testID="input-label"
2816
+ themeFontSize="small"
2817
+ themeFontWeight="regular"
2818
+ themeIntent="body"
2819
+ themeTypeface="neutral"
2820
+ themeVariant="error"
2821
+ >
2822
+ Shout out
2823
+ </Text>
2824
+ </View>
2825
+ <View
2826
+ style={
2827
+ Array [
2828
+ Object {
2829
+ "alignItems": "center",
2830
+ "alignSelf": "stretch",
2831
+ "flexDirection": "row",
2832
+ "flexGrow": 2,
2833
+ "flexShrink": 1,
2834
+ },
2835
+ undefined,
2836
+ ]
2837
+ }
2838
+ >
2839
+ <TextInput
2840
+ accessibilityState={
2841
+ Object {
2842
+ "disabled": false,
2843
+ }
2844
+ }
2845
+ allowFontScaling={false}
2846
+ editable={true}
2847
+ maxLength={255}
2848
+ multiline={true}
2849
+ onBlur={[Function]}
2850
+ onChangeText={[Function]}
2851
+ onFocus={[Function]}
2852
+ placeholder=" "
2853
+ style={
2854
+ Array [
2855
+ Object {
2856
+ "alignSelf": "stretch",
2857
+ "flexGrow": 2,
2858
+ "fontSize": 14,
2859
+ "marginHorizontal": 8,
2860
+ "paddingVertical": 0,
2861
+ "textAlignVertical": "center",
2862
+ },
2863
+ Object {
2864
+ "backgroundColor": "#ffffff",
2865
+ "color": "#001f23",
2866
+ },
2867
+ ]
2868
+ }
2869
+ testID="text-input"
2870
+ value="shout out Tung Van"
2871
+ />
2872
+ </View>
2873
+ </View>
2874
+ <View
2875
+ style={
2876
+ Array [
2877
+ Object {
2878
+ "minHeight": 16,
2879
+ "paddingLeft": 16,
2880
+ },
2881
+ undefined,
2882
+ ]
2883
+ }
2884
+ >
2885
+ <View
2886
+ style={
2887
+ Array [
2888
+ Object {
2889
+ "flexDirection": "row",
2890
+ "justifyContent": "space-between",
2891
+ },
2892
+ undefined,
2893
+ ]
2894
+ }
2895
+ >
2896
+ <View
2897
+ style={
2898
+ Array [
2899
+ Object {
2900
+ "alignItems": "center",
2901
+ "flex": 1,
2902
+ "flexDirection": "row",
2903
+ "flexGrow": 4,
2904
+ "marginRight": 4,
2905
+ },
2906
+ undefined,
2907
+ ]
2908
+ }
2909
+ >
2910
+ <HeroIcon
2911
+ name="circle-info"
2912
+ style={
2913
+ Array [
2914
+ Object {
2915
+ "color": "#de350b",
2916
+ "fontSize": 16,
2917
+ },
2918
+ undefined,
2919
+ ]
2920
+ }
2921
+ testID="input-error-icon"
2922
+ themeIntent="danger"
2923
+ themeSize="xsmall"
2924
+ />
2925
+ <Text
2926
+ allowFontScaling={false}
2927
+ style={
2928
+ Array [
2929
+ Object {
2930
+ "color": "#001f23",
2931
+ "fontFamily": "BeVietnamPro-Regular",
2932
+ "fontSize": 14,
2933
+ "letterSpacing": 0.42,
2934
+ "lineHeight": 22,
2935
+ },
2936
+ Array [
2937
+ Object {
2938
+ "color": "#de350b",
2939
+ "fontSize": 12,
2940
+ "marginLeft": 4,
2941
+ },
2942
+ undefined,
2943
+ ],
2944
+ ]
2945
+ }
2946
+ testID="input-error-message"
2947
+ themeFontSize="medium"
2948
+ themeFontWeight="regular"
2949
+ themeIntent="body"
2950
+ themeTypeface="neutral"
2951
+ >
2952
+ must not exceed character limit
2953
+ </Text>
2954
+ </View>
2955
+ </View>
2956
+ </View>
2957
+ </View>
2958
+ `;
2959
+
2695
2960
  exports[`TextInput placeholder TextInput is idle renders correctly 1`] = `
2696
2961
  <View
2697
2962
  pointerEvents="auto"
@@ -250,6 +250,35 @@ describe('TextInput', () => {
250
250
 
251
251
  expect(getByTestId('text-input')).not.toHaveProp('multiline', 'true');
252
252
  });
253
+
254
+ it('renders correctly with hide character count', () => {
255
+ const {
256
+ toJSON,
257
+ queryAllByTestId,
258
+ queryAllByText,
259
+ queryAllByDisplayValue,
260
+ getByTestId,
261
+ } = renderWithTheme(
262
+ <TextInput
263
+ label="Shout out"
264
+ value="shout out Tung Van"
265
+ required
266
+ maxLength={255}
267
+ multiline
268
+ error="must not exceed character limit"
269
+ hideCharacterCount
270
+ />
271
+ );
272
+
273
+ expect(toJSON()).toMatchSnapshot();
274
+ expect(queryAllByText('Shout out')).toHaveLength(1);
275
+ expect(queryAllByDisplayValue('shout out Tung Van')).toHaveLength(1);
276
+ expect(queryAllByText('18/255')).toHaveLength(0);
277
+ expect(queryAllByTestId('input-label')).toHaveLength(1);
278
+ expect(queryAllByTestId('text-input')).toHaveLength(1);
279
+
280
+ expect(getByTestId('text-input')).not.toHaveProp('multiline', 'true');
281
+ });
253
282
  });
254
283
 
255
284
  describe('disabled', () => {
@@ -94,6 +94,10 @@ export interface TextInputProps extends NativeTextInputProps {
94
94
  * If the max length is set, the input will display the current length and the max length.
95
95
  * */
96
96
  maxLength?: number;
97
+ /**
98
+ * Whether to hide the character count.
99
+ * */
100
+ hideCharacterCount?: boolean;
97
101
  /**
98
102
  * The helper text to display.
99
103
  */
@@ -157,6 +161,7 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
157
161
  disabled = false,
158
162
  loading = false,
159
163
  maxLength,
164
+ hideCharacterCount = false,
160
165
  helpText,
161
166
  value,
162
167
  defaultValue,
@@ -181,7 +186,7 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
181
186
  isEmptyValue,
182
187
  });
183
188
 
184
- const shouldShowMaxLength = maxLength !== undefined;
189
+ const shouldShowMaxLength = maxLength !== undefined && !hideCharacterCount;
185
190
 
186
191
  const theme = useTheme();
187
192
 
package/src/index.ts CHANGED
@@ -46,6 +46,7 @@ import Radio from './components/Radio';
46
46
  import SectionHeading from './components/SectionHeading';
47
47
  import Select from './components/Select';
48
48
  import Skeleton from './components/Skeleton';
49
+ import Success from './components/Success';
49
50
  import Switch from './components/Switch';
50
51
  import Tabs from './components/Tabs';
51
52
  import Tag from './components/Tag';
@@ -107,6 +108,7 @@ export {
107
108
  Radio,
108
109
  SectionHeading,
109
110
  Select,
111
+ Success,
110
112
  Switch,
111
113
  Tabs,
112
114
  Tag,
@@ -417,7 +417,7 @@ Object {
417
417
  },
418
418
  "space": Object {
419
419
  "imageMargin": 24,
420
- "titleMargin": 16,
420
+ "titleMargin": 8,
421
421
  "wrapperPadding": 16,
422
422
  },
423
423
  },
@@ -446,7 +446,7 @@ Object {
446
446
  "wrapperHorizontalPadding": 16,
447
447
  "wrapperVerticalPadding": 48,
448
448
  },
449
- "imageMarginBottom": 32,
449
+ "imageMarginBottom": 24,
450
450
  "titleMarginBottom": 8,
451
451
  "wrapperPadding": 24,
452
452
  },
@@ -461,6 +461,7 @@ Object {
461
461
  "buttonPressedBackground": "#664780",
462
462
  "headerText": "#001f23",
463
463
  "icon": "#ffffff",
464
+ "shadow": "#001f23",
464
465
  "titleText": "#ffffff",
465
466
  },
466
467
  "fontSizes": Object {
@@ -482,6 +483,15 @@ Object {
482
483
  "radii": Object {
483
484
  "actionItem": 999,
484
485
  },
486
+ "shadows": Object {
487
+ "elevation": 2,
488
+ "offset": Object {
489
+ "height": 2,
490
+ "width": 0,
491
+ },
492
+ "opacity": 0.12,
493
+ "radius": 8,
494
+ },
485
495
  "sizes": Object {
486
496
  "height": 64,
487
497
  "width": 64,
@@ -783,6 +793,36 @@ Object {
783
793
  },
784
794
  },
785
795
  },
796
+ "success": Object {
797
+ "colors": Object {
798
+ "description": "#4d6265",
799
+ "fullScreenBackground": "#ccd2d3",
800
+ "inPageBackground": "#f6f6f7",
801
+ "title": "#001f23",
802
+ },
803
+ "fontSizes": Object {
804
+ "description": 18,
805
+ "title": 24,
806
+ },
807
+ "fonts": Object {
808
+ "description": "RebondGrotesque",
809
+ "title": "RebondGrotesque-SemiBold",
810
+ },
811
+ "sizes": Object {
812
+ "image": 176,
813
+ },
814
+ "space": Object {
815
+ "button": Object {
816
+ "margin": 16,
817
+ "padding": 16,
818
+ "wrapperHorizontalPadding": 16,
819
+ "wrapperVerticalPadding": 48,
820
+ },
821
+ "imageMarginBottom": 32,
822
+ "titleMarginBottom": 8,
823
+ "wrapperPadding": 24,
824
+ },
825
+ },
786
826
  "swipeable": Object {
787
827
  "colors": Object {
788
828
  "danger": "#f46363",
@@ -864,7 +904,7 @@ Object {
864
904
  "dangerBackground": "#fcebe7",
865
905
  "info": "#4568fb",
866
906
  "infoBackground": "#ecf0ff",
867
- "primary": "#401960",
907
+ "primary": "#001f23",
868
908
  "primaryBackground": undefined,
869
909
  "success": "#017d6d",
870
910
  "successBackground": "#f0fef4",
@@ -2,7 +2,7 @@ import type { GlobalTheme } from '../global';
2
2
 
3
3
  const getEmptyTheme = (theme: GlobalTheme) => {
4
4
  const space = {
5
- titleMargin: theme.space.medium,
5
+ titleMargin: theme.space.small,
6
6
  imageMargin: theme.space.large,
7
7
  wrapperPadding: theme.space.medium,
8
8
  };
@@ -3,7 +3,7 @@ import type { GlobalTheme } from '../global';
3
3
  const getErrorTheme = (theme: GlobalTheme) => {
4
4
  const space = {
5
5
  titleMarginBottom: theme.space.small,
6
- imageMarginBottom: theme.space.xlarge,
6
+ imageMarginBottom: theme.space.large,
7
7
  wrapperPadding: theme.space.large,
8
8
  button: {
9
9
  wrapperHorizontalPadding: theme.space.medium,
@@ -11,6 +11,7 @@ const getFABTheme = (theme: GlobalTheme) => {
11
11
  backdropBackground: theme.colors.overlayGlobalSurface,
12
12
  titleText: theme.colors.onPrimary,
13
13
  actionItemText: theme.colors.onPrimary,
14
+ shadow: theme.colors.primaryOutline,
14
15
  };
15
16
 
16
17
  const sizes = {
@@ -37,6 +38,13 @@ const getFABTheme = (theme: GlobalTheme) => {
37
38
  icon: theme.lineHeights.large,
38
39
  };
39
40
 
41
+ const shadows = {
42
+ offset: { width: 0, height: 2 },
43
+ opacity: 0.12,
44
+ radius: theme.radii.medium,
45
+ elevation: 2,
46
+ };
47
+
40
48
  const space = {
41
49
  actionItemPaddingLeft: theme.space.medium,
42
50
  actionItemPaddingRight: theme.space.medium,
@@ -58,7 +66,16 @@ const getFABTheme = (theme: GlobalTheme) => {
58
66
  actionItem: theme.radii.rounded,
59
67
  };
60
68
 
61
- return { radii, fonts, fontSizes, colors, sizes, lineHeights, space };
69
+ return {
70
+ radii,
71
+ fonts,
72
+ fontSizes,
73
+ colors,
74
+ sizes,
75
+ lineHeights,
76
+ shadows,
77
+ space,
78
+ };
62
79
  };
63
80
 
64
81
  export default getFABTheme;
@@ -0,0 +1,40 @@
1
+ import type { GlobalTheme } from '../global';
2
+
3
+ const getSuccessTheme = (theme: GlobalTheme) => {
4
+ const space = {
5
+ titleMarginBottom: theme.space.small,
6
+ imageMarginBottom: theme.space.xlarge,
7
+ wrapperPadding: theme.space.large,
8
+ button: {
9
+ wrapperHorizontalPadding: theme.space.medium,
10
+ wrapperVerticalPadding: theme.space.xxxlarge,
11
+ margin: theme.space.medium,
12
+ padding: theme.space.medium,
13
+ },
14
+ };
15
+
16
+ const sizes = {
17
+ image: theme.sizes['19xlarge'],
18
+ };
19
+
20
+ const colors = {
21
+ title: theme.colors.onDefaultGlobalSurface,
22
+ description: theme.colors.mutedOnDefaultGlobalSurface,
23
+ fullScreenBackground: theme.colors.decorativePrimarySurface,
24
+ inPageBackground: theme.colors.neutralGlobalSurface,
25
+ };
26
+
27
+ const fontSizes = {
28
+ title: theme.fontSizes.xxxlarge,
29
+ description: theme.fontSizes.xlarge,
30
+ };
31
+
32
+ const fonts = {
33
+ title: theme.fonts.playful.semiBold,
34
+ description: theme.fonts.playful.regular,
35
+ };
36
+
37
+ return { fontSizes, colors, sizes, space, fonts };
38
+ };
39
+
40
+ export default getSuccessTheme;
@@ -6,7 +6,7 @@ const getTagTheme = (theme: GlobalTheme) => {
6
6
  };
7
7
 
8
8
  const colors = {
9
- primary: theme.colors.primary,
9
+ primary: theme.colors.onDefaultGlobalSurface,
10
10
  primaryBackground: undefined,
11
11
  info: theme.colors.onInfoSurface,
12
12
  infoBackground: theme.colors.infoSurface,
@@ -34,6 +34,7 @@ import getSelectTheme from './components/select';
34
34
  import getSkeletonTheme from './components/skeleton';
35
35
  import getSliderTheme from './components/slider';
36
36
  import getSpinnerTheme from './components/spinner';
37
+ import getSuccessTheme from './components/success';
37
38
  import getSwipeableTheme from './components/swipeable';
38
39
  import getSwitchTheme from './components/switch';
39
40
  import getTabsTheme from './components/tabs';
@@ -82,6 +83,7 @@ type Theme = GlobalTheme & {
82
83
  skeleton: ReturnType<typeof getSkeletonTheme>;
83
84
  slider: ReturnType<typeof getSliderTheme>;
84
85
  spinner: ReturnType<typeof getSpinnerTheme>;
86
+ success: ReturnType<typeof getSuccessTheme>;
85
87
  swipeable: ReturnType<typeof getSwipeableTheme>;
86
88
  switch: ReturnType<typeof getSwitchTheme>;
87
89
  tabs: ReturnType<typeof getTabsTheme>;
@@ -136,6 +138,7 @@ const getTheme = (
136
138
  skeleton: getSkeletonTheme(globalTheme),
137
139
  slider: getSliderTheme(globalTheme),
138
140
  spinner: getSpinnerTheme(globalTheme),
141
+ success: getSuccessTheme(globalTheme),
139
142
  swipeable: getSwipeableTheme(globalTheme),
140
143
  switch: getSwitchTheme(globalTheme),
141
144
  tabs: getTabsTheme(globalTheme),
@@ -2,38 +2,38 @@
2
2
 
3
3
  exports[`globalDark returns correct theme object 1`] = `
4
4
  Object {
5
- "archived": "#abacaf",
6
- "archivedSurface": "#f1f2f3",
5
+ "archived": "#68686d",
6
+ "archivedSurface": "#344348",
7
7
  "darkGlobalSurface": "#ffffff",
8
8
  "defaultGlobalSurface": "#001f23",
9
9
  "disabledOnDefaultGlobalSurface": "#82858a",
10
10
  "disabledOutline": "#82858a",
11
- "error": "#f46363",
12
- "errorSurface": "#fcebe7",
11
+ "error": "#c8300a",
12
+ "errorSurface": "#6f2a17",
13
13
  "inactiveOnDefaultGlobalSurface": "#99a5a7",
14
14
  "inactiveOutline": "#99a5a7",
15
- "info": "#b5c3fd",
16
- "infoSurface": "#ecf0ff",
17
- "mutedArchived": "#bcbdbf",
18
- "mutedError": "#f68282",
19
- "mutedInfo": "#c4cffd",
15
+ "info": "#3e5ee2",
16
+ "infoSurface": "#23438f",
17
+ "mutedArchived": "#b2b3b5",
18
+ "mutedError": "#e55d3c",
19
+ "mutedInfo": "#6a86fc",
20
20
  "mutedOnDefaultGlobalSurface": "#b3bcbd",
21
- "mutedSuccess": "#7bd897",
22
- "mutedWarning": "#ffcb8d",
21
+ "mutedSuccess": "#34978a",
22
+ "mutedWarning": "#b7864e",
23
23
  "neutralGlobalSurface": "#264144",
24
- "onArchivedSurface": "#737479",
24
+ "onArchivedSurface": "#acacaf",
25
25
  "onDarkGlobalSurface": "#001f23",
26
26
  "onDefaultGlobalSurface": "#ffffff",
27
- "onErrorSurface": "#de350b",
28
- "onInfoSurface": "#4568fb",
29
- "onSuccessSurface": "#017d6d",
27
+ "onErrorSurface": "#f89076",
28
+ "onInfoSurface": "#a1b5fc",
29
+ "onSuccessSurface": "#01cbb0",
30
30
  "onWarningSurface": "#ffa234",
31
31
  "overlayGlobalSurface": "#727478",
32
32
  "primaryOutline": "#ffffff",
33
33
  "secondaryOutline": "#193539",
34
- "success": "#5ace7d",
35
- "successSurface": "#f0fef4",
36
- "warning": "#ffbe71",
37
- "warningSurface": "#fff6eb",
34
+ "success": "#017162",
35
+ "successSurface": "#004e48",
36
+ "warning": "#a56822",
37
+ "warningSurface": "#4d4628",
38
38
  }
39
39
  `;