@hero-design/rn 7.22.2 → 7.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 (249) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/es/index.js +2395 -1880
  3. package/lib/index.js +2395 -1878
  4. package/package.json +6 -6
  5. package/src/components/Accordion/AccordionItem.tsx +1 -1
  6. package/src/components/Accordion/__tests__/__snapshots__/AccordionItem.spec.tsx.snap +8 -8
  7. package/src/components/Accordion/__tests__/__snapshots__/index.spec.tsx.snap +12 -12
  8. package/src/components/Avatar/__tests__/__snapshots__/StyledAvatar.spec.tsx.snap +3 -3
  9. package/src/components/Avatar/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  10. package/src/components/BottomNavigation/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  11. package/src/components/Box/StyledBox.tsx +1 -2
  12. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +2 -2
  13. package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +6 -6
  14. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +24 -24
  15. package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +6 -6
  16. package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +3 -3
  17. package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  18. package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +1 -1
  19. package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  20. package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +2 -2
  21. package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +5 -5
  22. package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
  23. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +18 -4
  24. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +19 -5
  25. package/src/components/Drawer/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  26. package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
  27. package/src/components/Icon/HeroIcon/index.tsx +2 -0
  28. package/src/components/Icon/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  29. package/src/components/Icon/index.tsx +1 -0
  30. package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +2 -2
  31. package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +12 -12
  32. package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +2 -2
  33. package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +4 -4
  34. package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +6 -6
  35. package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +21 -21
  36. package/src/components/Progress/__tests__/__snapshots__/index.spec.js.snap +5 -5
  37. package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +1 -1
  38. package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +1 -1
  39. package/src/components/RefreshControl/__tests__/__snapshots__/index.spec.tsx.snap +69 -0
  40. package/src/components/RefreshControl/__tests__/index.spec.tsx +55 -0
  41. package/src/components/RefreshControl/index.tsx +23 -0
  42. package/src/components/RichTextEditor/MentionList.tsx +25 -4
  43. package/src/components/RichTextEditor/RichTextEditor.tsx +3 -1
  44. package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +1 -1
  45. package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +6 -6
  46. package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +38 -10
  47. package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +1 -1
  48. package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -1
  49. package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +13 -9
  50. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +108 -38
  51. package/src/components/Select/MultiSelect/index.tsx +1 -1
  52. package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +1 -1
  53. package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +12 -8
  54. package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +99 -29
  55. package/src/components/Select/SingleSelect/index.tsx +1 -1
  56. package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +1 -1
  57. package/src/components/Select/types.ts +1 -3
  58. package/src/components/Slider/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  59. package/src/components/Spinner/StyledSpinner.tsx +8 -4
  60. package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +8 -4
  61. package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +32 -16
  62. package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +8 -4
  63. package/src/components/Switch/__tests__/__snapshots__/StyledSwitch.spec.tsx.snap +3 -3
  64. package/src/components/Tabs/ScrollableTabs.tsx +2 -5
  65. package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +1 -1
  66. package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +1 -1
  67. package/src/components/TextInput/StyledTextInput.tsx +16 -11
  68. package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +3 -3
  69. package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +46 -28
  70. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +246 -64
  71. package/src/components/TextInput/index.tsx +21 -4
  72. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +18 -4
  73. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +19 -5
  74. package/src/components/Toast/ToastProvider.tsx +2 -4
  75. package/src/components/Toast/__tests__/index.spec.tsx +138 -0
  76. package/src/components/Toolbar/ToolbarItem.tsx +1 -1
  77. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarGroup.spec.tsx.snap +12 -12
  78. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.spec.tsx.snap +6 -6
  79. package/src/components/Typography/Text/StyledText.tsx +1 -0
  80. package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +3 -3
  81. package/src/components/Typography/Text/index.tsx +1 -0
  82. package/src/index.ts +4 -0
  83. package/src/theme/ThemeSwitcher.tsx +9 -2
  84. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +101 -88
  85. package/src/theme/components/accordion.ts +1 -1
  86. package/src/theme/components/alert.ts +4 -4
  87. package/src/theme/components/avatar.ts +2 -2
  88. package/src/theme/components/badge.ts +6 -6
  89. package/src/theme/components/bottomNavigation.ts +2 -2
  90. package/src/theme/components/bottomSheet.ts +3 -3
  91. package/src/theme/components/button.ts +20 -20
  92. package/src/theme/components/calendar.ts +4 -4
  93. package/src/theme/components/card.ts +5 -5
  94. package/src/theme/components/checkbox.ts +1 -1
  95. package/src/theme/components/divider.ts +1 -1
  96. package/src/theme/components/drawer.ts +4 -4
  97. package/src/theme/components/empty.ts +3 -4
  98. package/src/theme/components/fab.ts +7 -7
  99. package/src/theme/components/icon.ts +4 -3
  100. package/src/theme/components/list.ts +6 -7
  101. package/src/theme/components/pinInput.ts +4 -4
  102. package/src/theme/components/progress.ts +3 -3
  103. package/src/theme/components/refreshControl.ts +11 -0
  104. package/src/theme/components/richTextEditor.ts +9 -8
  105. package/src/theme/components/sectionHeading.ts +1 -1
  106. package/src/theme/components/select.ts +1 -1
  107. package/src/theme/components/slider.ts +3 -3
  108. package/src/theme/components/spinner.ts +1 -4
  109. package/src/theme/components/switch.ts +7 -7
  110. package/src/theme/components/tabs.ts +5 -5
  111. package/src/theme/components/tag.ts +12 -12
  112. package/src/theme/components/textInput.ts +38 -38
  113. package/src/theme/components/toast.ts +6 -6
  114. package/src/theme/components/toolbar.ts +3 -2
  115. package/src/theme/components/typography.ts +4 -3
  116. package/src/theme/getTheme.ts +3 -0
  117. package/src/theme/global/colors/global.ts +32 -0
  118. package/src/theme/global/colors/jobs.ts +18 -0
  119. package/src/theme/global/colors/legacySystemPalette.ts +53 -0
  120. package/src/theme/global/colors/swag.ts +21 -35
  121. package/src/theme/global/colors/types.ts +46 -27
  122. package/src/theme/global/colors/work.ts +10 -9
  123. package/src/theme/global/index.ts +8 -1
  124. package/src/theme/index.ts +6 -1
  125. package/src/utils/__tests__/helpers.spec.ts +27 -0
  126. package/src/utils/helpers.ts +21 -0
  127. package/tsconfig.prod.json +4 -0
  128. package/types/components/Icon/HeroIcon/index.d.ts +1 -1
  129. package/types/components/Icon/index.d.ts +1 -1
  130. package/types/components/RefreshControl/index.d.ts +5 -0
  131. package/types/components/RichTextEditor/MentionList.d.ts +7 -3
  132. package/types/components/RichTextEditor/index.d.ts +1 -1
  133. package/types/components/Select/types.d.ts +1 -3
  134. package/types/components/TextInput/StyledTextInput.d.ts +9 -3
  135. package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
  136. package/types/components/Typography/Text/StyledText.d.ts +1 -1
  137. package/types/components/Typography/Text/index.d.ts +1 -1
  138. package/types/index.d.ts +3 -2
  139. package/types/theme/ThemeSwitcher.d.ts +1 -1
  140. package/types/theme/components/empty.d.ts +0 -1
  141. package/types/theme/components/icon.d.ts +1 -0
  142. package/types/theme/components/refreshControl.d.ts +7 -0
  143. package/types/theme/components/richTextEditor.d.ts +4 -3
  144. package/types/theme/components/spinner.d.ts +1 -4
  145. package/types/theme/components/toolbar.d.ts +1 -0
  146. package/types/theme/components/typography.d.ts +1 -0
  147. package/types/theme/getTheme.d.ts +2 -0
  148. package/types/theme/global/colors/global.d.ts +3 -0
  149. package/types/theme/global/colors/jobs.d.ts +3 -0
  150. package/types/theme/global/colors/legacySystemPalette.d.ts +3 -0
  151. package/types/theme/global/colors/types.d.ts +41 -21
  152. package/types/theme/global/index.d.ts +30 -21
  153. package/types/theme/index.d.ts +2 -2
  154. package/types/utils/helpers.d.ts +2 -0
  155. package/src/components/Box/__tests__/helpers.spec.ts +0 -14
  156. package/src/components/Box/helpers.ts +0 -10
  157. package/types/components/Accordion/__tests__/AccordionItem.spec.d.ts +0 -1
  158. package/types/components/Accordion/__tests__/StyledAccordion.spec.d.ts +0 -1
  159. package/types/components/Accordion/__tests__/index.spec.d.ts +0 -1
  160. package/types/components/Alert/__tests__/index.spec.d.ts +0 -1
  161. package/types/components/Avatar/__tests__/StyledAvatar.spec.d.ts +0 -1
  162. package/types/components/Avatar/__tests__/index.spec.d.ts +0 -1
  163. package/types/components/Badge/__tests__/Badge.spec.d.ts +0 -1
  164. package/types/components/Badge/__tests__/Status.spec.d.ts +0 -1
  165. package/types/components/BottomNavigation/__tests__/index.spec.d.ts +0 -1
  166. package/types/components/BottomSheet/__tests__/index.spec.d.ts +0 -1
  167. package/types/components/Box/__tests__/helpers.spec.d.ts +0 -1
  168. package/types/components/Box/__tests__/index.spec.d.ts +0 -1
  169. package/types/components/Box/helpers.d.ts +0 -1
  170. package/types/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.d.ts +0 -1
  171. package/types/components/Button/LoadingIndicator/__tests__/index.spec.d.ts +0 -1
  172. package/types/components/Button/UtilityButton/__tests__/index.spec.d.ts +0 -1
  173. package/types/components/Button/__tests__/Button.spec.d.ts +0 -1
  174. package/types/components/Button/__tests__/IconButton.spec.d.ts +0 -1
  175. package/types/components/Button/__tests__/StyledButton.spec.d.ts +0 -1
  176. package/types/components/Calendar/__tests__/CalendarRowItem.spec.d.ts +0 -1
  177. package/types/components/Calendar/__tests__/helper.spec.d.ts +0 -1
  178. package/types/components/Calendar/__tests__/index.spec.d.ts +0 -1
  179. package/types/components/Card/DataCard/__tests__/StyledDataCard.spec.d.ts +0 -1
  180. package/types/components/Card/DataCard/__tests__/index.spec.d.ts +0 -1
  181. package/types/components/Card/__tests__/StyledCard.spec.d.ts +0 -1
  182. package/types/components/Card/__tests__/index.spec.d.ts +0 -1
  183. package/types/components/Checkbox/__tests__/StyledCheckbox.spec.d.ts +0 -1
  184. package/types/components/Checkbox/__tests__/index.spec.d.ts +0 -1
  185. package/types/components/Collapse/__tests__/StyledCollapse.spec.d.ts +0 -1
  186. package/types/components/Collapse/__tests__/index.spec.d.ts +0 -1
  187. package/types/components/ContentNavigator/__tests__/StyledContentNavigator.spec.d.ts +0 -1
  188. package/types/components/ContentNavigator/__tests__/index.spec.d.ts +0 -1
  189. package/types/components/DatePicker/__tests__/DatePicker.spec.d.ts +0 -1
  190. package/types/components/DatePicker/__tests__/DatePickerAndroid.spec.d.ts +0 -1
  191. package/types/components/DatePicker/__tests__/DatePickerIOS.spec.d.ts +0 -1
  192. package/types/components/Divider/__tests__/StyledDivider.spec.d.ts +0 -1
  193. package/types/components/Drawer/DragableDrawer/__tests__/helpers.spec.d.ts +0 -1
  194. package/types/components/Drawer/DragableDrawer/__tests__/index.spec.d.ts +0 -1
  195. package/types/components/Drawer/__tests__/index.spec.d.ts +0 -1
  196. package/types/components/Empty/__tests__/index.spec.d.ts +0 -1
  197. package/types/components/FAB/ActionGroup/__tests__/index.spec.d.ts +0 -1
  198. package/types/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts +0 -1
  199. package/types/components/FAB/__tests__/StyledFAB.spec.d.ts +0 -1
  200. package/types/components/FAB/__tests__/index.spec.d.ts +0 -1
  201. package/types/components/Icon/__tests__/index.spec.d.ts +0 -1
  202. package/types/components/Image/__tests__/index.spec.d.ts +0 -1
  203. package/types/components/List/__tests__/BasicListItem.spec.d.ts +0 -1
  204. package/types/components/List/__tests__/ListItem.spec.d.ts +0 -1
  205. package/types/components/List/__tests__/StyledBasicListItem.spec.d.ts +0 -1
  206. package/types/components/List/__tests__/StyledListItem.spec.d.ts +0 -1
  207. package/types/components/PinInput/__tests__/PinCell.spec.d.ts +0 -1
  208. package/types/components/PinInput/__tests__/StyledPinInput.spec.d.ts +0 -1
  209. package/types/components/PinInput/__tests__/index.spec.d.ts +0 -1
  210. package/types/components/Radio/__tests__/Radio.spec.d.ts +0 -1
  211. package/types/components/Radio/__tests__/RadioGroup.spec.d.ts +0 -1
  212. package/types/components/RichTextEditor/__tests__/EditorToolbar.spec.d.ts +0 -1
  213. package/types/components/RichTextEditor/__tests__/MentionList.spec.d.ts +0 -1
  214. package/types/components/RichTextEditor/__tests__/RichTextEditor.spec.d.ts +0 -1
  215. package/types/components/SectionHeading/__tests__/StyledHeading.spec.d.ts +0 -1
  216. package/types/components/SectionHeading/__tests__/index.spec.d.ts +0 -1
  217. package/types/components/Select/MultiSelect/__tests__/Option.spec.d.ts +0 -1
  218. package/types/components/Select/MultiSelect/__tests__/OptionList.spec.d.ts +0 -1
  219. package/types/components/Select/MultiSelect/__tests__/index.spec.d.ts +0 -1
  220. package/types/components/Select/SingleSelect/__tests__/Option.spec.d.ts +0 -1
  221. package/types/components/Select/SingleSelect/__tests__/OptionList.spec.d.ts +0 -1
  222. package/types/components/Select/SingleSelect/__tests__/index.spec.d.ts +0 -1
  223. package/types/components/Select/__tests__/StyledSelect.spec.d.ts +0 -1
  224. package/types/components/Select/__tests__/helpers.spec.d.ts +0 -1
  225. package/types/components/Slider/__tests__/index.spec.d.ts +0 -1
  226. package/types/components/Spinner/__tests__/AnimatedSpinner.spec.d.ts +0 -1
  227. package/types/components/Spinner/__tests__/StyledSpinner.spec.d.ts +0 -1
  228. package/types/components/Spinner/__tests__/index.spec.d.ts +0 -1
  229. package/types/components/Switch/SelectorSwitch/__tests__/Option.spec.d.ts +0 -1
  230. package/types/components/Switch/SelectorSwitch/__tests__/index.spec.d.ts +0 -1
  231. package/types/components/Switch/__tests__/StyledSwitch.spec.d.ts +0 -1
  232. package/types/components/Switch/__tests__/index.spec.d.ts +0 -1
  233. package/types/components/Tabs/__tests__/ScrollableTabs.spec.d.ts +0 -1
  234. package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +0 -1
  235. package/types/components/Tabs/__tests__/index.spec.d.ts +0 -1
  236. package/types/components/Tag/__tests__/Tag.spec.d.ts +0 -1
  237. package/types/components/TextInput/__tests__/StyledTextInput.spec.d.ts +0 -1
  238. package/types/components/TextInput/__tests__/index.spec.d.ts +0 -1
  239. package/types/components/TimePicker/__tests__/TimePicker.spec.d.ts +0 -1
  240. package/types/components/TimePicker/__tests__/TimePickerAndroid.spec.d.ts +0 -1
  241. package/types/components/TimePicker/__tests__/TimePickerIOS.spec.d.ts +0 -1
  242. package/types/components/Toast/__tests__/Toast.spec.d.ts +0 -1
  243. package/types/components/Toast/__tests__/ToastContainer.spec.d.ts +0 -1
  244. package/types/components/Toolbar/__tests__/ToolbarGroup.spec.d.ts +0 -1
  245. package/types/components/Toolbar/__tests__/ToolbarItem.spec.d.ts +0 -1
  246. package/types/components/Typography/Text/__tests__/StyledText.spec.d.ts +0 -1
  247. package/types/components/Typography/Text/__tests__/index.spec.d.ts +0 -1
  248. package/types/theme/__tests__/index.spec.d.ts +0 -1
  249. package/types/utils/__tests__/scale.spec.d.ts +0 -1
@@ -26,16 +26,12 @@ exports[`TimePickerAndroid renders correctly 1`] = `
26
26
  style={
27
27
  Array [
28
28
  Object {
29
- "borderColor": "#001f23",
30
- "borderRadius": 8,
31
- "borderWidth": 1,
32
29
  "marginVertical": 8,
33
30
  "width": "100%",
34
31
  },
35
32
  undefined,
36
33
  ]
37
34
  }
38
- themeVariant="filled"
39
35
  >
40
36
  <View
41
37
  style={
@@ -49,6 +45,24 @@ exports[`TimePickerAndroid renders correctly 1`] = `
49
45
  ]
50
46
  }
51
47
  >
48
+ <View
49
+ style={
50
+ Array [
51
+ Object {
52
+ "borderColor": "#001f23",
53
+ "borderRadius": 8,
54
+ "borderWidth": 1,
55
+ "bottom": 0,
56
+ "left": 0,
57
+ "position": "absolute",
58
+ "right": 0,
59
+ "top": 0,
60
+ },
61
+ undefined,
62
+ ]
63
+ }
64
+ themeVariant="filled"
65
+ />
52
66
  <View
53
67
  pointerEvents="none"
54
68
  style={
@@ -26,16 +26,12 @@ exports[`TimePickerIOS renders correctly 1`] = `
26
26
  style={
27
27
  Array [
28
28
  Object {
29
- "borderColor": "#001f23",
30
- "borderRadius": 8,
31
- "borderWidth": 1,
32
29
  "marginVertical": 8,
33
30
  "width": "100%",
34
31
  },
35
32
  undefined,
36
33
  ]
37
34
  }
38
- themeVariant="filled"
39
35
  >
40
36
  <View
41
37
  style={
@@ -49,6 +45,24 @@ exports[`TimePickerIOS renders correctly 1`] = `
49
45
  ]
50
46
  }
51
47
  >
48
+ <View
49
+ style={
50
+ Array [
51
+ Object {
52
+ "borderColor": "#001f23",
53
+ "borderRadius": 8,
54
+ "borderWidth": 1,
55
+ "bottom": 0,
56
+ "left": 0,
57
+ "position": "absolute",
58
+ "right": 0,
59
+ "top": 0,
60
+ },
61
+ undefined,
62
+ ]
63
+ }
64
+ themeVariant="filled"
65
+ />
52
66
  <View
53
67
  pointerEvents="none"
54
68
  style={
@@ -488,7 +502,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
488
502
  style={
489
503
  Array [
490
504
  Object {
491
- "color": "#8505a2",
505
+ "color": "#001f23",
492
506
  "fontFamily": "BeVietnamPro-SemiBold",
493
507
  "fontSize": 16,
494
508
  "letterSpacing": 0.48,
@@ -20,9 +20,7 @@ const ToastProvider = ({
20
20
  position = 'top',
21
21
  }: ToastProviderProps) => {
22
22
  const toastRef = useRef<ToastControllerContextType>(null);
23
- const [refState, setRefState] = useState<ToastControllerContextType>(
24
- {} as ToastControllerContextType
25
- );
23
+ const [refState, setRefState] = useState<ToastControllerContextType>(null);
26
24
 
27
25
  useEffect(() => {
28
26
  if (toastRef.current) {
@@ -38,7 +36,7 @@ const ToastProvider = ({
38
36
  return (
39
37
  <ToastContext.Provider value={refState}>
40
38
  <View style={{ flex: 1 }}>
41
- {children}
39
+ {refState ? children : null}
42
40
  <ToastConfigContext.Provider value={config}>
43
41
  <ToastContainer
44
42
  ref={toastRef}
@@ -0,0 +1,138 @@
1
+ import { fireEvent, waitFor } from '@testing-library/react-native';
2
+ import React, { useEffect, useState } from 'react';
3
+ import { Button, View } from 'react-native';
4
+ import Toast from '..';
5
+ import renderWithTheme from '../../../testHelpers/renderWithTheme';
6
+
7
+ describe('Toast', () => {
8
+ it(`"show" Toast when called correctly`, async () => {
9
+ const Component = () => {
10
+ const toast = Toast.useToast();
11
+
12
+ useEffect(() => {
13
+ toast.show({
14
+ content: 'Your timesheet has been deleted.',
15
+ intent: 'warning',
16
+ variant: 'round',
17
+ duration: 50,
18
+ });
19
+ }, []);
20
+
21
+ return <View>Hello world</View>;
22
+ };
23
+
24
+ const { queryByText } = renderWithTheme(
25
+ <Toast.Provider>
26
+ <Component />
27
+ </Toast.Provider>
28
+ );
29
+
30
+ expect(queryByText('Your timesheet has been deleted.')).toBeTruthy();
31
+ await waitFor(() =>
32
+ expect(queryByText('Your timesheet has been deleted.')).toBeFalsy()
33
+ );
34
+ });
35
+
36
+ it(`"show" Toast when called correctly`, async () => {
37
+ const Component = () => {
38
+ const toast = Toast.useToast();
39
+
40
+ return (
41
+ <View>
42
+ <Button
43
+ title="Show Toast"
44
+ onPress={() =>
45
+ toast.show({
46
+ content: 'Your timesheet has been deleted.',
47
+ intent: 'warning',
48
+ variant: 'round',
49
+ duration: 50,
50
+ })
51
+ }
52
+ />
53
+ </View>
54
+ );
55
+ };
56
+
57
+ const { queryByText } = renderWithTheme(
58
+ <Toast.Provider>
59
+ <Component />
60
+ </Toast.Provider>
61
+ );
62
+
63
+ fireEvent.press(queryByText('Show Toast'));
64
+ expect(queryByText('Your timesheet has been deleted.')).toBeTruthy();
65
+ await waitFor(() =>
66
+ expect(queryByText('Your timesheet has been deleted.')).toBeFalsy()
67
+ );
68
+ });
69
+
70
+ it(`"hide" method works correctly`, () => {
71
+ const Component = () => {
72
+ const toast = Toast.useToast();
73
+ const [id, setId] = useState(null);
74
+
75
+ useEffect(() => {
76
+ const toastId = toast.show({
77
+ content: 'Your timesheet has been deleted.',
78
+ intent: 'warning',
79
+ variant: 'round',
80
+ });
81
+ setId(toastId);
82
+ }, []);
83
+
84
+ return (
85
+ <View>
86
+ <Button title="Hide Toast" onPress={() => toast.hide(id)} />
87
+ </View>
88
+ );
89
+ };
90
+
91
+ const { queryByText } = renderWithTheme(
92
+ <Toast.Provider>
93
+ <Component />
94
+ </Toast.Provider>
95
+ );
96
+
97
+ expect(queryByText('Your timesheet has been deleted.')).toBeTruthy();
98
+ fireEvent.press(queryByText('Hide Toast'));
99
+ expect(queryByText('Your timesheet has been deleted.')).toBeFalsy();
100
+ });
101
+
102
+ it(`"clearAll" method works correctly`, () => {
103
+ const Component = () => {
104
+ const toast = Toast.useToast();
105
+
106
+ useEffect(() => {
107
+ toast.show({
108
+ content: 'Your timesheet has been deleted.',
109
+ intent: 'warning',
110
+ variant: 'round',
111
+ });
112
+ toast.show({
113
+ content: 'No more timesheet available.',
114
+ intent: 'warning',
115
+ variant: 'round',
116
+ });
117
+ });
118
+
119
+ return (
120
+ <View>
121
+ <Button title="Clear all Toast" onPress={() => toast.clearAll()} />
122
+ </View>
123
+ );
124
+ };
125
+
126
+ const { queryByText } = renderWithTheme(
127
+ <Toast.Provider displayType="stack">
128
+ <Component />
129
+ </Toast.Provider>
130
+ );
131
+
132
+ expect(queryByText('Your timesheet has been deleted.')).toBeTruthy();
133
+ expect(queryByText('No more timesheet available.')).toBeTruthy();
134
+ fireEvent.press(queryByText('Clear all Toast'));
135
+ expect(queryByText('Your timesheet has been deleted.')).toBeFalsy();
136
+ expect(queryByText('No more timesheet available.')).toBeFalsy();
137
+ });
138
+ });
@@ -8,7 +8,7 @@ export interface ToolbarItemProps {
8
8
  /**
9
9
  * Visual intent of the toolbar item.
10
10
  */
11
- intent?: 'primary' | 'info' | 'success' | 'danger' | 'warning';
11
+ intent?: 'primary' | 'secondary' | 'info' | 'success' | 'danger' | 'warning';
12
12
  /**
13
13
  * Icon of the toolbar item.
14
14
  */
@@ -41,7 +41,7 @@ exports[`ToolbarGroup renders correctly with when align is center 1`] = `
41
41
  style={
42
42
  Array [
43
43
  Object {
44
- "color": "#8505a2",
44
+ "color": "#001f23",
45
45
  "fontSize": 24,
46
46
  },
47
47
  undefined,
@@ -55,7 +55,7 @@ exports[`ToolbarGroup renders correctly with when align is center 1`] = `
55
55
  style={
56
56
  Array [
57
57
  Object {
58
- "color": "#8505a2",
58
+ "color": "#001f23",
59
59
  "fontFamily": "BeVietnamPro-SemiBold",
60
60
  "fontSize": 12,
61
61
  "letterSpacing": 0.36,
@@ -97,7 +97,7 @@ exports[`ToolbarGroup renders correctly with when align is center 1`] = `
97
97
  style={
98
98
  Array [
99
99
  Object {
100
- "color": "#8505a2",
100
+ "color": "#001f23",
101
101
  "fontSize": 24,
102
102
  },
103
103
  undefined,
@@ -111,7 +111,7 @@ exports[`ToolbarGroup renders correctly with when align is center 1`] = `
111
111
  style={
112
112
  Array [
113
113
  Object {
114
- "color": "#8505a2",
114
+ "color": "#001f23",
115
115
  "fontFamily": "BeVietnamPro-SemiBold",
116
116
  "fontSize": 12,
117
117
  "letterSpacing": 0.36,
@@ -171,7 +171,7 @@ exports[`ToolbarGroup renders correctly with when align is left 1`] = `
171
171
  style={
172
172
  Array [
173
173
  Object {
174
- "color": "#8505a2",
174
+ "color": "#001f23",
175
175
  "fontSize": 24,
176
176
  },
177
177
  undefined,
@@ -185,7 +185,7 @@ exports[`ToolbarGroup renders correctly with when align is left 1`] = `
185
185
  style={
186
186
  Array [
187
187
  Object {
188
- "color": "#8505a2",
188
+ "color": "#001f23",
189
189
  "fontFamily": "BeVietnamPro-SemiBold",
190
190
  "fontSize": 12,
191
191
  "letterSpacing": 0.36,
@@ -227,7 +227,7 @@ exports[`ToolbarGroup renders correctly with when align is left 1`] = `
227
227
  style={
228
228
  Array [
229
229
  Object {
230
- "color": "#8505a2",
230
+ "color": "#001f23",
231
231
  "fontSize": 24,
232
232
  },
233
233
  undefined,
@@ -241,7 +241,7 @@ exports[`ToolbarGroup renders correctly with when align is left 1`] = `
241
241
  style={
242
242
  Array [
243
243
  Object {
244
- "color": "#8505a2",
244
+ "color": "#001f23",
245
245
  "fontFamily": "BeVietnamPro-SemiBold",
246
246
  "fontSize": 12,
247
247
  "letterSpacing": 0.36,
@@ -301,7 +301,7 @@ exports[`ToolbarGroup renders correctly with when align is right 1`] = `
301
301
  style={
302
302
  Array [
303
303
  Object {
304
- "color": "#8505a2",
304
+ "color": "#001f23",
305
305
  "fontSize": 24,
306
306
  },
307
307
  undefined,
@@ -315,7 +315,7 @@ exports[`ToolbarGroup renders correctly with when align is right 1`] = `
315
315
  style={
316
316
  Array [
317
317
  Object {
318
- "color": "#8505a2",
318
+ "color": "#001f23",
319
319
  "fontFamily": "BeVietnamPro-SemiBold",
320
320
  "fontSize": 12,
321
321
  "letterSpacing": 0.36,
@@ -357,7 +357,7 @@ exports[`ToolbarGroup renders correctly with when align is right 1`] = `
357
357
  style={
358
358
  Array [
359
359
  Object {
360
- "color": "#8505a2",
360
+ "color": "#001f23",
361
361
  "fontSize": 24,
362
362
  },
363
363
  undefined,
@@ -371,7 +371,7 @@ exports[`ToolbarGroup renders correctly with when align is right 1`] = `
371
371
  style={
372
372
  Array [
373
373
  Object {
374
- "color": "#8505a2",
374
+ "color": "#001f23",
375
375
  "fontFamily": "BeVietnamPro-SemiBold",
376
376
  "fontSize": 12,
377
377
  "letterSpacing": 0.36,
@@ -27,7 +27,7 @@ exports[`ToolbarItems renders correctly when disabled 1`] = `
27
27
  style={
28
28
  Array [
29
29
  Object {
30
- "color": "#808f91",
30
+ "color": "#4d6265",
31
31
  "fontSize": 24,
32
32
  },
33
33
  undefined,
@@ -41,7 +41,7 @@ exports[`ToolbarItems renders correctly when disabled 1`] = `
41
41
  style={
42
42
  Array [
43
43
  Object {
44
- "color": "#808f91",
44
+ "color": "#4d6265",
45
45
  "fontFamily": "BeVietnamPro-SemiBold",
46
46
  "fontSize": 12,
47
47
  "letterSpacing": 0.36,
@@ -145,7 +145,7 @@ exports[`ToolbarItems renders correctly when intent is info 1`] = `
145
145
  style={
146
146
  Array [
147
147
  Object {
148
- "color": "#4568fb",
148
+ "color": "#b5c3fd",
149
149
  "fontSize": 24,
150
150
  },
151
151
  undefined,
@@ -159,7 +159,7 @@ exports[`ToolbarItems renders correctly when intent is info 1`] = `
159
159
  style={
160
160
  Array [
161
161
  Object {
162
- "color": "#4568fb",
162
+ "color": "#b5c3fd",
163
163
  "fontFamily": "BeVietnamPro-SemiBold",
164
164
  "fontSize": 12,
165
165
  "letterSpacing": 0.36,
@@ -204,7 +204,7 @@ exports[`ToolbarItems renders correctly when intent is primary 1`] = `
204
204
  style={
205
205
  Array [
206
206
  Object {
207
- "color": "#8505a2",
207
+ "color": "#001f23",
208
208
  "fontSize": 24,
209
209
  },
210
210
  undefined,
@@ -218,7 +218,7 @@ exports[`ToolbarItems renders correctly when intent is primary 1`] = `
218
218
  style={
219
219
  Array [
220
220
  Object {
221
- "color": "#8505a2",
221
+ "color": "#001f23",
222
222
  "fontFamily": "BeVietnamPro-SemiBold",
223
223
  "fontSize": 12,
224
224
  "letterSpacing": 0.36,
@@ -20,6 +20,7 @@ const StyledText = styled(Text)<{
20
20
  | 'body'
21
21
  | 'subdued'
22
22
  | 'primary'
23
+ | 'secondary'
23
24
  | 'success'
24
25
  | 'info'
25
26
  | 'warning'
@@ -49,7 +49,7 @@ exports[`StyledText has info intent style 1`] = `
49
49
  style={
50
50
  Array [
51
51
  Object {
52
- "color": "#4568fb",
52
+ "color": "#b5c3fd",
53
53
  "fontFamily": "BeVietnamPro-Regular",
54
54
  "fontSize": 14,
55
55
  "letterSpacing": 0.42,
@@ -159,7 +159,7 @@ exports[`StyledText has primary intent style 1`] = `
159
159
  style={
160
160
  Array [
161
161
  Object {
162
- "color": "#8505a2",
162
+ "color": "#001f23",
163
163
  "fontFamily": "BeVietnamPro-Regular",
164
164
  "fontSize": 14,
165
165
  "letterSpacing": 0.42,
@@ -247,7 +247,7 @@ exports[`StyledText has subdued intent style 1`] = `
247
247
  style={
248
248
  Array [
249
249
  Object {
250
- "color": "#808f91",
250
+ "color": "#4d6265",
251
251
  "fontFamily": "BeVietnamPro-Regular",
252
252
  "fontSize": 14,
253
253
  "letterSpacing": 0.42,
@@ -33,6 +33,7 @@ export interface TextProps extends NativeTextProps {
33
33
  | 'body'
34
34
  | 'subdued'
35
35
  | 'primary'
36
+ | 'secondary'
36
37
  | 'success'
37
38
  | 'info'
38
39
  | 'warning'
package/src/index.ts CHANGED
@@ -4,6 +4,7 @@ import theme, {
4
4
  useTheme,
5
5
  swagSystemPalette,
6
6
  workSystemPalette,
7
+ jobsSystemPalette,
7
8
  } from './theme';
8
9
  import { scale } from './utils/scale';
9
10
 
@@ -43,6 +44,7 @@ import TimePicker from './components/TimePicker';
43
44
  import Toast from './components/Toast';
44
45
  import Toolbar from './components/Toolbar';
45
46
  import Typography from './components/Typography';
47
+ import RefreshControl from './components/RefreshControl';
46
48
  import RichTextEditor from './components/RichTextEditor';
47
49
 
48
50
  export {
@@ -53,6 +55,7 @@ export {
53
55
  ThemeProvider,
54
56
  swagSystemPalette,
55
57
  workSystemPalette,
58
+ jobsSystemPalette,
56
59
  Accordion,
57
60
  Alert,
58
61
  Avatar,
@@ -89,6 +92,7 @@ export {
89
92
  Toast,
90
93
  Toolbar,
91
94
  Typography,
95
+ RefreshControl,
92
96
  RichTextEditor,
93
97
  };
94
98
 
@@ -1,10 +1,15 @@
1
1
  import React, { useMemo } from 'react';
2
2
 
3
3
  import getTheme from './getTheme';
4
- import { defaultScale, swagSystemPalette, workSystemPalette } from './global';
4
+ import {
5
+ defaultScale,
6
+ swagSystemPalette,
7
+ workSystemPalette,
8
+ jobsSystemPalette,
9
+ } from './global';
5
10
  import ThemeProvider from './ThemeProvider';
6
11
 
7
- type ThemeName = 'swag' | 'work';
12
+ type ThemeName = 'swag' | 'work' | 'jobs';
8
13
 
9
14
  const ThemeSwitcher = ({
10
15
  name = 'swag',
@@ -19,6 +24,8 @@ const ThemeSwitcher = ({
19
24
  return getTheme(defaultScale, swagSystemPalette);
20
25
  case 'work':
21
26
  return getTheme(defaultScale, workSystemPalette);
27
+ case 'jobs':
28
+ return getTheme(defaultScale, jobsSystemPalette);
22
29
  }
23
30
  }, [name]);
24
31
  return <ThemeProvider theme={theme}>{children}</ThemeProvider>;