@jobber/components-native 0.84.4-match-mobi-55ef4ec.7 → 0.84.4-match-mobi-540af48.10

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 (313) hide show
  1. package/dist/package.json +26 -15
  2. package/dist/src/ActionItem/ActionItemGroup.js +1 -1
  3. package/dist/src/AutoLink/components/Link/Link.js +1 -1
  4. package/dist/src/Banner/Banner.js +2 -0
  5. package/dist/src/Banner/components/BannerIcon/BannerIcon.style.js +3 -0
  6. package/dist/src/BottomSheet/BottomSheet.js +58 -32
  7. package/dist/src/BottomSheet/BottomSheet.style.js +8 -9
  8. package/dist/src/BottomSheet/hooks/useBottomSheetBackHandler.js +26 -0
  9. package/dist/src/Button/components/InternalButtonLoading/InternalButtonLoading.js +0 -1
  10. package/dist/src/ButtonGroup/ButtonGroup.js +1 -1
  11. package/dist/src/Chip/Chip.js +12 -1
  12. package/dist/src/Chip/Chip.style.js +1 -1
  13. package/dist/src/Content/ContentHorizontal.style.js +15 -0
  14. package/dist/src/Content/ContentSpaceAround.style.js +15 -0
  15. package/dist/src/Content/ContentVertical.style.js +15 -0
  16. package/dist/src/ContentOverlay/ContentOverlay.js +5 -7
  17. package/dist/src/ContentOverlay/UNSAFE_WrappedModalize.js +23 -0
  18. package/dist/src/ErrorMessageWrapper/context/ErrorMessageProvider.js +1 -1
  19. package/dist/src/Form/Form.js +5 -2
  20. package/dist/src/Form/components/FormCache/FormCache.js +1 -0
  21. package/dist/src/Form/components/FormMessageBanner/FormMessageBanner.js +1 -1
  22. package/dist/src/Form/context/AtlantisFormContext.js +1 -0
  23. package/dist/src/Form/hooks/useInternalForm.js +6 -3
  24. package/dist/src/FormatFile/components/MediaView/MediaView.js +22 -5
  25. package/dist/src/FormatFile/utils/createUseCreateThumbnail.js +1 -1
  26. package/dist/src/InputCurrency/InputCurrency.js +42 -30
  27. package/dist/src/InputDate/InputDate.js +2 -2
  28. package/dist/src/InputEmail/InputEmail.js +12 -4
  29. package/dist/src/InputFieldWrapper/InputFieldWrapper.js +14 -12
  30. package/dist/src/InputFieldWrapper/InputFieldWrapper.style.js +1 -1
  31. package/dist/src/InputFieldWrapper/components/Prefix/Prefix.js +5 -2
  32. package/dist/src/InputFieldWrapper/components/Suffix/Suffix.js +5 -2
  33. package/dist/src/InputNumber/InputNumber.js +10 -4
  34. package/dist/src/InputPressable/InputPressable.js +20 -8
  35. package/dist/src/InputPressable/InputPressable.style.js +3 -0
  36. package/dist/src/InputSearch/InputSearch.js +1 -1
  37. package/dist/src/InputText/InputText.js +24 -13
  38. package/dist/src/InputText/InputText.style.js +4 -0
  39. package/dist/src/InputTime/InputTime.js +2 -2
  40. package/dist/src/Menu/Menu.js +2 -2
  41. package/dist/src/ProgressBar/ProgressBar.js +10 -6
  42. package/dist/src/ProgressBar/ProgressBarInner.js +3 -12
  43. package/dist/src/ProgressBar/ProgressBarStepped.js +7 -2
  44. package/dist/src/Select/Select.style.js +1 -0
  45. package/dist/src/Select/components/SelectPressable/SelectPressable.js +1 -1
  46. package/dist/src/StatusLabel/StatusLabel.style.js +2 -2
  47. package/dist/src/Switch/components/BaseSwitch/BaseSwitch.js +7 -1
  48. package/dist/src/Typography/Typography.js +16 -5
  49. package/dist/src/hooks/useAtlantisI18n/locales/en.json +1 -0
  50. package/dist/src/hooks/useAtlantisI18n/locales/es.json +1 -0
  51. package/dist/src/hooks/useFormController.js +6 -15
  52. package/dist/tsconfig.build.json +7 -0
  53. package/dist/tsconfig.build.tsbuildinfo +1 -0
  54. package/dist/tsconfig.json +4 -6
  55. package/dist/types/src/ActionItem/ActionItem.d.ts +2 -1
  56. package/dist/types/src/ActionItem/ActionItemGroup.d.ts +2 -1
  57. package/dist/types/src/ActionItem/components/ActionItemContainer.d.ts +2 -1
  58. package/dist/types/src/ActionLabel/ActionLabel.d.ts +4 -3
  59. package/dist/types/src/ActivityIndicator/ActivityIndicator.d.ts +2 -1
  60. package/dist/types/src/AutoLink/AutoLink.d.ts +2 -1
  61. package/dist/types/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.d.ts +2 -1
  62. package/dist/types/src/AutoLink/components/Link/Link.d.ts +2 -1
  63. package/dist/types/src/Banner/Banner.d.ts +2 -1
  64. package/dist/types/src/Banner/components/BannerIcon/BannerIcon.d.ts +2 -1
  65. package/dist/types/src/Banner/components/BannerIcon/BannerIcon.style.d.ts +3 -0
  66. package/dist/types/src/Banner/types.d.ts +1 -1
  67. package/dist/types/src/BottomSheet/BottomSheet.d.ts +7 -3
  68. package/dist/types/src/BottomSheet/BottomSheet.style.d.ts +7 -14
  69. package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +2 -1
  70. package/dist/types/src/BottomSheet/hooks/useBottomSheetBackHandler.d.ts +8 -0
  71. package/dist/types/src/Button/Button.d.ts +2 -1
  72. package/dist/types/src/Button/components/InternalButtonLoading/InternalButtonLoading.d.ts +1 -1
  73. package/dist/types/src/ButtonGroup/ButtonGroup.d.ts +2 -1
  74. package/dist/types/src/ButtonGroup/ButtonGroupAction.d.ts +4 -3
  75. package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +3 -2
  76. package/dist/types/src/Card/Card.d.ts +2 -1
  77. package/dist/types/src/Card/components/InternalCardHeader.d.ts +2 -1
  78. package/dist/types/src/Checkbox/Checkbox.d.ts +2 -1
  79. package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -1
  80. package/dist/types/src/Chip/Chip.d.ts +2 -1
  81. package/dist/types/src/Content/Content.d.ts +3 -2
  82. package/dist/types/src/Content/ContentHorizontal.style.d.ts +15 -0
  83. package/dist/types/src/Content/ContentSpaceAround.style.d.ts +15 -0
  84. package/dist/types/src/Content/ContentVertical.style.d.ts +15 -0
  85. package/dist/types/src/ContentOverlay/ContentOverlay.d.ts +1 -1
  86. package/dist/types/src/ContentOverlay/UNSAFE_WrappedModalize.d.ts +3 -0
  87. package/dist/types/src/Disclosure/Disclosure.d.ts +1 -1
  88. package/dist/types/src/Divider/Divider.d.ts +2 -1
  89. package/dist/types/src/EmptyState/EmptyState.d.ts +2 -1
  90. package/dist/types/src/ErrorMessageWrapper/ErrorMessageWrapper.d.ts +2 -1
  91. package/dist/types/src/ErrorMessageWrapper/context/ErrorMessageProvider.d.ts +2 -1
  92. package/dist/types/src/ErrorMessageWrapper/context/types.d.ts +1 -1
  93. package/dist/types/src/Flex/Flex.d.ts +2 -1
  94. package/dist/types/src/Form/Form.d.ts +2 -1
  95. package/dist/types/src/Form/components/FormActionBar/FormActionBar.d.ts +3 -2
  96. package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -2
  97. package/dist/types/src/Form/components/FormCache/FormCache.d.ts +4 -3
  98. package/dist/types/src/Form/components/FormErrorBanner/FormErrorBanner.d.ts +2 -1
  99. package/dist/types/src/Form/components/FormMask/FormMask.d.ts +2 -1
  100. package/dist/types/src/Form/components/FormMessage/FormMessage.d.ts +2 -1
  101. package/dist/types/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +2 -1
  102. package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +2 -1
  103. package/dist/types/src/Form/components/FormSaveButton/FormSaveButton.d.ts +2 -1
  104. package/dist/types/src/Form/context/AtlantisFormContext.d.ts +2 -1
  105. package/dist/types/src/Form/context/types.d.ts +5 -4
  106. package/dist/types/src/Form/hooks/useFormViewRefs.d.ts +2 -2
  107. package/dist/types/src/Form/hooks/useInternalForm.d.ts +7 -7
  108. package/dist/types/src/Form/types.d.ts +13 -7
  109. package/dist/types/src/FormField/FormField.d.ts +1 -1
  110. package/dist/types/src/FormatFile/FormatFile.d.ts +2 -1
  111. package/dist/types/src/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +2 -1
  112. package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +2 -1
  113. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +3 -2
  114. package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +2 -1
  115. package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +2 -1
  116. package/dist/types/src/Heading/Heading.d.ts +4 -3
  117. package/dist/types/src/Icon/Icon.d.ts +2 -1
  118. package/dist/types/src/IconButton/IconButton.d.ts +1 -1
  119. package/dist/types/src/InputCurrency/InputCurrency.d.ts +2 -1
  120. package/dist/types/src/InputDate/InputDate.d.ts +4 -2
  121. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +9 -2
  122. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.style.d.ts +1 -1
  123. package/dist/types/src/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +2 -1
  124. package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +4 -4
  125. package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +4 -4
  126. package/dist/types/src/InputPressable/InputPressable.d.ts +9 -1
  127. package/dist/types/src/InputPressable/InputPressable.style.d.ts +3 -0
  128. package/dist/types/src/InputSearch/InputSearch.d.ts +1 -1
  129. package/dist/types/src/InputSearch/components/FilterButton.d.ts +2 -1
  130. package/dist/types/src/InputText/InputText.d.ts +11 -3
  131. package/dist/types/src/InputText/InputText.style.d.ts +4 -0
  132. package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +2 -1
  133. package/dist/types/src/InputTime/InputTime.d.ts +4 -2
  134. package/dist/types/src/Menu/Menu.d.ts +2 -1
  135. package/dist/types/src/Menu/components/MenuOption/MenuOption.d.ts +2 -1
  136. package/dist/types/src/Menu/components/Overlay/Overlay.d.ts +2 -1
  137. package/dist/types/src/Menu/types.d.ts +6 -1
  138. package/dist/types/src/ProgressBar/ProgressBar.d.ts +2 -1
  139. package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +5 -1
  140. package/dist/types/src/ProgressBar/ProgressBarStepped.d.ts +3 -1
  141. package/dist/types/src/ProgressBar/types.d.ts +20 -0
  142. package/dist/types/src/Select/Select.d.ts +3 -2
  143. package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +2 -1
  144. package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +2 -1
  145. package/dist/types/src/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +2 -1
  146. package/dist/types/src/Select/components/SelectPressable/SelectPressable.d.ts +2 -1
  147. package/dist/types/src/StatusLabel/StatusLabel.d.ts +2 -1
  148. package/dist/types/src/StatusLabel/StatusLabel.style.d.ts +1 -1
  149. package/dist/types/src/Switch/Switch.d.ts +2 -1
  150. package/dist/types/src/Switch/components/BaseSwitch/BaseSwitch.d.ts +2 -1
  151. package/dist/types/src/Text/Text.d.ts +4 -3
  152. package/dist/types/src/TextList/TextList.d.ts +2 -1
  153. package/dist/types/src/ThumbnailList/ThumbnailList.d.ts +2 -1
  154. package/dist/types/src/Toast/Toast.d.ts +2 -1
  155. package/dist/types/src/Typography/Typography.d.ts +3 -3
  156. package/dist/types/src/Typography/TypographyGestureDetector.d.ts +2 -1
  157. package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +1 -1
  158. package/package.json +26 -15
  159. package/src/ActionItem/ActionItem.tsx +1 -1
  160. package/src/ActionItem/ActionItemGroup.tsx +1 -3
  161. package/src/ActionItem/components/ActionItemContainer.tsx +1 -1
  162. package/src/ActionLabel/ActionLabel.test.tsx +12 -0
  163. package/src/ActionLabel/ActionLabel.tsx +3 -3
  164. package/src/ActionLabel/__snapshots__/ActionLabel.test.tsx.snap +66 -0
  165. package/src/ActivityIndicator/ActivityIndicator.tsx +1 -3
  166. package/src/AtlantisContext/AtlantisContext.test.tsx +1 -1
  167. package/src/AtlantisThemeContext/AtlantisThemeContext.test.tsx +5 -5
  168. package/src/AutoLink/AutoLink.test.tsx +2 -4
  169. package/src/AutoLink/AutoLink.tsx +1 -1
  170. package/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.tsx +1 -1
  171. package/src/AutoLink/components/Link/Link.tsx +1 -5
  172. package/src/Banner/Banner.test.tsx +12 -0
  173. package/src/Banner/Banner.tsx +4 -2
  174. package/src/Banner/components/BannerIcon/BannerIcon.style.ts +3 -0
  175. package/src/Banner/components/BannerIcon/BannerIcon.tsx +1 -1
  176. package/src/Banner/types.ts +1 -1
  177. package/src/BottomSheet/BottomSheet.stories.tsx +128 -0
  178. package/src/BottomSheet/BottomSheet.style.ts +7 -14
  179. package/src/BottomSheet/BottomSheet.test.tsx +34 -39
  180. package/src/BottomSheet/BottomSheet.tsx +112 -92
  181. package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +1 -1
  182. package/src/BottomSheet/hooks/useBottomSheetBackHandler.test.ts +90 -0
  183. package/src/BottomSheet/hooks/useBottomSheetBackHandler.ts +41 -0
  184. package/src/Button/Button.tsx +1 -1
  185. package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -2
  186. package/src/ButtonGroup/ButtonGroup.test.tsx +13 -11
  187. package/src/ButtonGroup/ButtonGroup.tsx +2 -2
  188. package/src/ButtonGroup/ButtonGroupAction.tsx +4 -4
  189. package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +2 -2
  190. package/src/Card/Card.tsx +1 -1
  191. package/src/Card/components/InternalCardHeader.tsx +1 -1
  192. package/src/Checkbox/Checkbox.test.tsx +118 -1
  193. package/src/Checkbox/Checkbox.tsx +2 -2
  194. package/src/Checkbox/CheckboxGroup.test.tsx +3 -7
  195. package/src/Checkbox/CheckboxGroup.tsx +2 -2
  196. package/src/Chip/Chip.style.ts +1 -1
  197. package/src/Chip/Chip.tsx +20 -2
  198. package/src/Content/Content.tsx +7 -2
  199. package/src/Content/ContentHorizontal.style.ts +20 -0
  200. package/src/Content/ContentSpaceAround.style.ts +20 -0
  201. package/src/Content/ContentVertical.style.ts +20 -0
  202. package/src/ContentOverlay/ContentOverlay.test.tsx +34 -27
  203. package/src/ContentOverlay/ContentOverlay.tsx +7 -7
  204. package/src/ContentOverlay/UNSAFE_WrappedModalize.tsx +41 -0
  205. package/src/ContentOverlay/hooks/useKeyboardVisibility.test.ts +7 -7
  206. package/src/ContentOverlay/hooks/useViewLayoutHeight.test.ts +1 -1
  207. package/src/Disclosure/Disclosure.tsx +1 -1
  208. package/src/Divider/Divider.tsx +1 -1
  209. package/src/EmptyState/EmptyState.test.tsx +29 -42
  210. package/src/EmptyState/EmptyState.tsx +1 -1
  211. package/src/ErrorMessageWrapper/ErrorMessageWrapper.tsx +1 -1
  212. package/src/ErrorMessageWrapper/context/ErrorMessageProvider.tsx +3 -5
  213. package/src/ErrorMessageWrapper/context/types.ts +1 -1
  214. package/src/Flex/Flex.tsx +2 -2
  215. package/src/Form/Form.test.tsx +145 -2
  216. package/src/Form/Form.tsx +8 -1
  217. package/src/Form/components/FormActionBar/FormActionBar.tsx +3 -3
  218. package/src/Form/components/FormBody/FormBody.tsx +3 -3
  219. package/src/Form/components/FormCache/FormCache.tsx +5 -4
  220. package/src/Form/components/FormErrorBanner/FormErrorBanner.tsx +1 -1
  221. package/src/Form/components/FormMask/FormMask.tsx +1 -1
  222. package/src/Form/components/FormMessage/FormMessage.test.tsx +40 -27
  223. package/src/Form/components/FormMessage/FormMessage.tsx +1 -1
  224. package/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.tsx +1 -1
  225. package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -3
  226. package/src/Form/components/FormSaveButton/FormSaveButton.test.tsx +2 -2
  227. package/src/Form/components/FormSaveButton/FormSaveButton.tsx +1 -1
  228. package/src/Form/context/AtlantisFormContext.test.tsx +1 -1
  229. package/src/Form/context/AtlantisFormContext.tsx +1 -0
  230. package/src/Form/context/types.ts +5 -4
  231. package/src/Form/hooks/useFormViewRefs.ts +4 -5
  232. package/src/Form/hooks/useInternalForm.ts +14 -6
  233. package/src/Form/hooks/useScrollToError/useScrollToError.test.tsx +2 -1
  234. package/src/Form/types.ts +14 -8
  235. package/src/FormField/FormField.tsx +1 -1
  236. package/src/FormatFile/FormatFile.test.tsx +21 -21
  237. package/src/FormatFile/FormatFile.tsx +3 -3
  238. package/src/FormatFile/components/ErrorIcon/ErrorIcon.tsx +1 -1
  239. package/src/FormatFile/components/FileView/FileView.tsx +1 -1
  240. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.test.tsx +14 -14
  241. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +2 -2
  242. package/src/FormatFile/components/MediaView/MediaView.test.tsx +283 -0
  243. package/src/FormatFile/components/MediaView/MediaView.tsx +28 -7
  244. package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +1 -1
  245. package/src/FormatFile/utils/createUseCreateThumbnail.ts +1 -1
  246. package/src/Glimmer/Glimmer.test.tsx +2 -2
  247. package/src/Heading/Heading.test.tsx +13 -0
  248. package/src/Heading/Heading.tsx +3 -3
  249. package/src/Heading/__snapshots__/Heading.test.tsx.snap +65 -0
  250. package/src/Icon/Icon.tsx +1 -1
  251. package/src/Icon/__snapshots__/Icon.test.tsx.snap +7 -0
  252. package/src/IconButton/IconButton.tsx +1 -1
  253. package/src/InputCurrency/InputCurrency.tsx +72 -58
  254. package/src/InputDate/InputDate.tsx +7 -3
  255. package/src/InputEmail/InputEmail.tsx +15 -8
  256. package/src/InputFieldWrapper/InputFieldWrapper.style.ts +1 -1
  257. package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +48 -1
  258. package/src/InputFieldWrapper/InputFieldWrapper.tsx +39 -29
  259. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -1
  260. package/src/InputFieldWrapper/components/Prefix/Prefix.test.tsx +8 -16
  261. package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +8 -6
  262. package/src/InputFieldWrapper/components/Suffix/Suffix.test.tsx +2 -4
  263. package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +8 -6
  264. package/src/InputNumber/InputNumber.tsx +11 -7
  265. package/src/InputPassword/InputPassword.tsx +1 -1
  266. package/src/InputPressable/InputPressable.style.ts +4 -0
  267. package/src/InputPressable/InputPressable.test.tsx +75 -1
  268. package/src/InputPressable/InputPressable.tsx +34 -8
  269. package/src/InputSearch/InputSearch.tsx +2 -1
  270. package/src/InputSearch/components/FilterButton.tsx +1 -1
  271. package/src/InputText/InputText.style.ts +5 -0
  272. package/src/InputText/InputText.test.tsx +190 -1
  273. package/src/InputText/InputText.tsx +37 -20
  274. package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
  275. package/src/InputTime/InputTime.tsx +7 -3
  276. package/src/Menu/Menu.tsx +3 -3
  277. package/src/Menu/components/MenuOption/MenuOption.tsx +1 -1
  278. package/src/Menu/components/Overlay/Overlay.tsx +1 -1
  279. package/src/Menu/types.ts +7 -1
  280. package/src/ProgressBar/ProgressBar.test.tsx +109 -0
  281. package/src/ProgressBar/ProgressBar.tsx +18 -2
  282. package/src/ProgressBar/ProgressBarInner.tsx +8 -11
  283. package/src/ProgressBar/ProgressBarStepped.tsx +12 -1
  284. package/src/ProgressBar/__snapshots__/ProgressBar.test.tsx.snap +14 -0
  285. package/src/ProgressBar/types.ts +22 -0
  286. package/src/Select/Select.style.ts +1 -0
  287. package/src/Select/Select.tsx +2 -2
  288. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.tsx +1 -1
  289. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.tsx +1 -1
  290. package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -1
  291. package/src/Select/components/SelectPressable/SelectPressable.tsx +1 -4
  292. package/src/StatusLabel/StatusLabel.style.ts +2 -2
  293. package/src/StatusLabel/StatusLabel.tsx +1 -1
  294. package/src/StatusLabel/__snapshots__/StatusLabel.test.tsx.snap +14 -14
  295. package/src/Switch/Switch.tsx +1 -1
  296. package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +8 -2
  297. package/src/Text/Text.test.tsx +10 -0
  298. package/src/Text/Text.tsx +3 -3
  299. package/src/Text/__snapshots__/Text.test.tsx.snap +66 -0
  300. package/src/TextList/TextList.tsx +1 -1
  301. package/src/ThumbnailList/ThumbnailList.test.tsx +5 -5
  302. package/src/ThumbnailList/ThumbnailList.tsx +1 -1
  303. package/src/ThumbnailList/__snapshots__/ThumbnailList.test.tsx.snap +199 -1
  304. package/src/Toast/Toast.tsx +2 -2
  305. package/src/Typography/Typography.test.tsx +61 -0
  306. package/src/Typography/Typography.tsx +25 -9
  307. package/src/Typography/TypographyGestureDetector.tsx +1 -3
  308. package/src/Typography/__snapshots__/Typography.test.tsx.snap +222 -0
  309. package/src/hooks/useAtlantisI18n/locales/en.json +1 -0
  310. package/src/hooks/useAtlantisI18n/locales/es.json +1 -0
  311. package/src/hooks/useFormController.ts +7 -14
  312. package/src/utils/test/MockSafeAreaProvider.tsx +1 -1
  313. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -18,7 +18,7 @@ export function Banner({
18
18
  type,
19
19
  children,
20
20
  icon,
21
- }: BannerProps): JSX.Element {
21
+ }: BannerProps) {
22
22
  const bannerIcon = icon || getBannerIcon(type);
23
23
 
24
24
  const shouldFlow =
@@ -60,7 +60,7 @@ export function Banner({
60
60
  );
61
61
  }
62
62
 
63
- function BannerChildren({ children }: PropsWithChildren): JSX.Element {
63
+ function BannerChildren({ children }: PropsWithChildren) {
64
64
  if (!children) return <></>;
65
65
 
66
66
  if (children && typeof children === "string") {
@@ -97,5 +97,7 @@ function getBannerIcon(type: BannerTypes): IconNames | undefined {
97
97
  return "help";
98
98
  case "error":
99
99
  return "alert";
100
+ case "success":
101
+ return "checkmark";
100
102
  }
101
103
  }
@@ -15,5 +15,8 @@ export const useStyles = buildThemedStyles(tokens => {
15
15
  notice: {
16
16
  backgroundColor: tokens["color-informative"],
17
17
  },
18
+ success: {
19
+ backgroundColor: tokens["color-success"],
20
+ },
18
21
  };
19
22
  });
@@ -10,7 +10,7 @@ export interface BannerIconProps {
10
10
  readonly type: BannerTypes;
11
11
  }
12
12
 
13
- export function BannerIcon({ icon, type }: BannerIconProps): JSX.Element {
13
+ export function BannerIcon({ icon, type }: BannerIconProps) {
14
14
  const styles = useStyles();
15
15
 
16
16
  return (
@@ -2,7 +2,7 @@ import type { IconNames } from "@jobber/design";
2
2
  import type { ReactElement } from "react";
3
3
  import type { StyleProp, ViewStyle } from "react-native";
4
4
 
5
- export type BannerTypes = "error" | "warning" | "notice";
5
+ export type BannerTypes = "error" | "warning" | "notice" | "success";
6
6
 
7
7
  export interface BannerStyleProps {
8
8
  /**
@@ -0,0 +1,128 @@
1
+ import React, { useRef } from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
3
+ import { View } from "react-native";
4
+ import { SafeAreaProvider } from "react-native-safe-area-context";
5
+ import { Button, Heading, Text } from "@jobber/components-native";
6
+ import { BottomSheet } from "./BottomSheet";
7
+ import type { BottomSheetRef } from "./BottomSheet";
8
+ import { BottomSheetOption } from "./components/BottomSheetOption";
9
+
10
+ const meta = {
11
+ title: "Components/Selections/BottomSheet",
12
+ component: BottomSheet,
13
+ } satisfies Meta<typeof BottomSheet>;
14
+
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+
18
+ const BasicTemplate = () => {
19
+ const bottomSheetRef = useRef<BottomSheetRef>(null);
20
+
21
+ const openBottomSheet = () => {
22
+ bottomSheetRef.current?.open();
23
+ };
24
+
25
+ const closeBottomSheet = () => {
26
+ bottomSheetRef.current?.close();
27
+ };
28
+
29
+ return (
30
+ <SafeAreaProvider>
31
+ <View style={{ display: "flex", flexDirection: "column", gap: 16 }}>
32
+ <Heading>Basic BottomSheet</Heading>
33
+ <Text>
34
+ Note that due to the differences between React Native Web and React
35
+ Native, this does not render 100% properly
36
+ </Text>
37
+ <Button label="Open Bottom Sheet" onPress={openBottomSheet} />
38
+ <Button label="Close Bottom Sheet" onPress={closeBottomSheet} />
39
+ </View>
40
+ <BottomSheet
41
+ ref={bottomSheetRef}
42
+ onClose={() => console.log("closed bottom sheet")}
43
+ onOpen={() => console.log("opened bottom sheet")}
44
+ >
45
+ <BottomSheetOption
46
+ icon="sendMessage"
47
+ iconColor="greyBlue"
48
+ text="Send message"
49
+ onPress={() => alert("send message")}
50
+ />
51
+ <BottomSheetOption
52
+ icon="phone"
53
+ iconColor="greyBlue"
54
+ text="Call a friend"
55
+ onPress={() => alert("Calling a friend")}
56
+ />
57
+ <BottomSheetOption
58
+ destructive={true}
59
+ icon="trash"
60
+ text="Remove"
61
+ onPress={() => alert("Removed")}
62
+ />
63
+ </BottomSheet>
64
+ </SafeAreaProvider>
65
+ );
66
+ };
67
+
68
+ const HeaderFooterInputTextTemplate = () => {
69
+ const bottomSheetRef = useRef<BottomSheetRef>(null);
70
+
71
+ const openBottomSheet = () => {
72
+ bottomSheetRef.current?.open();
73
+ };
74
+
75
+ const closeBottomSheet = () => {
76
+ bottomSheetRef.current?.close();
77
+ };
78
+
79
+ return (
80
+ <SafeAreaProvider>
81
+ <View style={{ display: "flex", flexDirection: "column", gap: 16 }}>
82
+ <Heading>Basic BottomSheet</Heading>
83
+ <Text>
84
+ Note that due to the differences between React Native Web and React
85
+ Native, this does not render 100% properly
86
+ </Text>
87
+ <Button label="Open Bottom Sheet" onPress={openBottomSheet} />
88
+ <Button label="Close Bottom Sheet" onPress={closeBottomSheet} />
89
+ </View>
90
+ <BottomSheet
91
+ ref={bottomSheetRef}
92
+ showCancel={true}
93
+ heading="BottomSheet Header"
94
+ onClose={() => console.log("closed bottom sheet")}
95
+ onOpen={() => console.log("opened bottom sheet")}
96
+ >
97
+ <BottomSheetOption
98
+ icon="sendMessage"
99
+ iconColor="greyBlue"
100
+ text="Send message"
101
+ onPress={() => alert("send message")}
102
+ />
103
+ <BottomSheetOption
104
+ icon="phone"
105
+ iconColor="greyBlue"
106
+ text="Call a friend"
107
+ onPress={() => alert("Calling a friend")}
108
+ />
109
+ <BottomSheetOption
110
+ destructive={true}
111
+ icon="trash"
112
+ text="Remove"
113
+ onPress={() => alert("Removed")}
114
+ />
115
+ </BottomSheet>
116
+ </SafeAreaProvider>
117
+ );
118
+ };
119
+
120
+ export const Basic: Story = {
121
+ render: BasicTemplate,
122
+ args: {} as Story["args"],
123
+ };
124
+
125
+ export const HeaderFooterInputText: Story = {
126
+ render: HeaderFooterInputTextTemplate,
127
+ args: {} as Story["args"],
128
+ };
@@ -1,28 +1,18 @@
1
- import { Dimensions, StyleSheet } from "react-native";
2
1
  import { buildThemedStyles } from "../AtlantisThemeContext";
3
2
 
4
- const { height } = Dimensions.get("window");
5
-
6
3
  export const useStyles = buildThemedStyles(tokens => {
7
4
  const modalBorderRadius = tokens["radius-larger"];
8
5
 
9
6
  return {
10
- overlayModalize: {
11
- backgroundColor: "transparent",
12
- },
13
-
14
- overlay: {
15
- ...StyleSheet.absoluteFillObject,
7
+ backdrop: {
16
8
  backgroundColor: tokens["color-overlay"],
17
- height,
18
9
  },
19
- modal: {
10
+ background: {
20
11
  borderTopLeftRadius: modalBorderRadius,
21
12
  borderTopRightRadius: modalBorderRadius,
22
- paddingTop: tokens["space-small"],
23
13
  },
24
- children: {
25
- paddingBottom: tokens["space-small"],
14
+ footerContainer: {
15
+ backgroundColor: tokens["color-surface"],
26
16
  },
27
17
  header: {
28
18
  paddingHorizontal: tokens["space-base"],
@@ -34,5 +24,8 @@ export const useStyles = buildThemedStyles(tokens => {
34
24
  marginTop: tokens["space-small"],
35
25
  marginBottom: tokens["space-smaller"],
36
26
  },
27
+ handle: {
28
+ display: "none",
29
+ },
37
30
  };
38
31
  });
@@ -1,7 +1,6 @@
1
1
  import React, { createRef } from "react";
2
- import { act, fireEvent, render, waitFor } from "@testing-library/react-native";
2
+ import { act, render, userEvent, waitFor } from "@testing-library/react-native";
3
3
  import { AccessibilityInfo, View } from "react-native";
4
- import { Host, Portal } from "react-native-portalize";
5
4
  import { BottomSheet } from ".";
6
5
  import type { BottomSheetRef } from "./BottomSheet";
7
6
  import { waitForUntestableRender } from "../utils/test/wait";
@@ -23,62 +22,59 @@ function setup({
23
22
  loading?: boolean;
24
23
  }) {
25
24
  return render(
26
- <Host>
27
- <Portal>
28
- <BottomSheet
29
- ref={ref}
30
- heading={heading}
31
- showCancel={showCancel}
32
- loading={loading}
33
- onClose={mockOnClose}
34
- onOpen={mockOnOpen}
35
- >
36
- <View>
37
- <Text>BottomSheet</Text>
38
- </View>
39
- </BottomSheet>
40
- </Portal>
41
- </Host>,
25
+ <BottomSheet
26
+ ref={ref}
27
+ heading={heading}
28
+ showCancel={showCancel}
29
+ loading={loading}
30
+ onClose={mockOnClose}
31
+ onOpen={mockOnOpen}
32
+ >
33
+ <View>
34
+ <Text>BottomSheet</Text>
35
+ </View>
36
+ </BottomSheet>,
42
37
  );
43
38
  }
44
39
 
45
40
  it("renders a BottomSheet", async () => {
46
- const { getByText } = setup({});
41
+ const { findByText } = setup({});
47
42
 
48
43
  await waitForUntestableRender(
49
44
  "Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
50
45
  );
51
46
 
52
- act(() => {
47
+ await act(async () => {
53
48
  ref.current?.open();
54
49
  });
55
50
 
56
- expect(getByText("BottomSheet")).toBeDefined();
51
+ expect(await findByText("BottomSheet")).toBeDefined();
57
52
  });
58
53
 
59
54
  it("renders a BottomSheet with a header", async () => {
60
55
  const header = "Hello this is header";
61
- const { getByText } = setup({ heading: header });
56
+ const { findByText } = setup({ heading: header });
62
57
 
63
58
  await waitForUntestableRender(
64
59
  "Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
65
60
  );
66
61
 
67
- act(() => {
62
+ await act(async () => {
68
63
  ref.current?.open();
69
64
  });
70
65
 
71
- expect(getByText(header)).toBeDefined();
66
+ expect(await findByText(header)).toBeDefined();
72
67
  });
73
68
 
74
69
  it("BottomSheet can be closed with the cancel action", async () => {
75
- const { getByText, queryByText } = setup({ showCancel: true });
70
+ const { findByLabelText, queryByText } = setup({ showCancel: true });
76
71
 
77
- act(() => {
72
+ await act(async () => {
78
73
  ref.current?.open();
79
74
  });
80
75
 
81
- fireEvent.press(getByText("Cancel"));
76
+ const cancelButton = await findByLabelText("Cancel");
77
+ await userEvent.press(cancelButton);
82
78
 
83
79
  await waitFor(() => {
84
80
  expect(queryByText("BottomSheet")).toBeNull();
@@ -93,7 +89,7 @@ describe("when loading is provided and true", () => {
93
89
  "Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
94
90
  );
95
91
 
96
- act(() => {
92
+ await act(async () => {
97
93
  ref.current?.open();
98
94
  });
99
95
 
@@ -104,25 +100,25 @@ describe("when loading is provided and true", () => {
104
100
  it("calls onClose when BottomSheet is closed", async () => {
105
101
  setup({});
106
102
 
107
- act(() => {
103
+ await act(async () => {
108
104
  ref.current?.open();
109
105
  ref.current?.close();
110
106
  });
111
107
 
112
108
  await waitFor(() => {
113
- expect(mockOnClose).toHaveBeenCalled();
109
+ expect(mockOnClose).toHaveBeenCalledTimes(1);
114
110
  });
115
111
  });
116
112
 
117
113
  it("calls onOpen when BottomSheet is opened", async () => {
118
114
  setup({});
119
115
 
120
- act(() => {
116
+ await act(async () => {
121
117
  ref.current?.open();
122
118
  });
123
119
 
124
120
  await waitFor(() => {
125
- expect(mockOnOpen).toHaveBeenCalled();
121
+ expect(mockOnOpen).toHaveBeenCalledTimes(1);
126
122
  });
127
123
  });
128
124
 
@@ -132,17 +128,16 @@ describe("when there is a screen reader enabled", () => {
132
128
  .spyOn(AccessibilityInfo, "isScreenReaderEnabled")
133
129
  .mockImplementation(() => Promise.resolve(true));
134
130
 
135
- const { getByText, queryByText } = setup({});
131
+ const { findByLabelText, queryByText } = setup({});
136
132
 
137
- await waitForUntestableRender(
138
- "Wait for AccessibilityInfo.isScreenReaderEnabled to resolve",
139
- );
140
-
141
- act(() => {
133
+ await act(async () => {
142
134
  ref.current?.open();
143
135
  });
144
136
 
145
- fireEvent.press(getByText("Cancel"));
137
+ const cancelButton = await findByLabelText("Cancel");
138
+ expect(cancelButton).toBeDefined();
139
+
140
+ await userEvent.press(cancelButton);
146
141
 
147
142
  await waitFor(() => {
148
143
  expect(queryByText("BottomSheet")).toBeNull();
@@ -1,13 +1,19 @@
1
- import type { ReactNode, Ref, RefObject } from "react";
2
- import React, { forwardRef, useState } from "react";
3
- import { Modalize } from "react-native-modalize";
4
- import { useSafeAreaInsets } from "react-native-safe-area-context";
1
+ import type { ReactNode } from "react";
2
+ import React, { useCallback, useImperativeHandle, useRef } from "react";
5
3
  import { Keyboard, View } from "react-native";
6
- import { BottomSheetOption } from "./components/BottomSheetOption";
4
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
5
+ import RNBottomSheet, {
6
+ BottomSheetBackdrop,
7
+ BottomSheetView,
8
+ } from "@gorhom/bottom-sheet";
9
+ import type { BottomSheetBackdropProps } from "@gorhom/bottom-sheet";
10
+ import { tokens } from "@jobber/design";
7
11
  import { useStyles } from "./BottomSheet.style";
8
- import { useIsScreenReaderEnabled } from "../hooks";
12
+ import { BottomSheetOption } from "./components/BottomSheetOption";
13
+ import { useBottomSheetBackHandler } from "./hooks/useBottomSheetBackHandler";
9
14
  import { Divider } from "../Divider";
10
15
  import { Heading } from "../Heading";
16
+ import { useIsScreenReaderEnabled } from "../hooks";
11
17
  import { useAtlantisI18n } from "../hooks/useAtlantisI18n";
12
18
 
13
19
  export interface BottomSheetProps {
@@ -39,71 +45,89 @@ export interface BottomSheetProps {
39
45
  readonly onClose?: () => void;
40
46
  }
41
47
 
42
- export const BottomSheet = forwardRef(BottomSheetInternal);
43
-
44
- export type BottomSheetRef = Modalize | undefined;
45
-
46
- function BottomSheetInternal(
47
- {
48
- children,
49
- showCancel,
50
- loading = false,
51
- heading,
52
- onOpen,
53
- onClose,
54
- }: BottomSheetProps,
55
- ref: Ref<BottomSheetRef>,
56
- ) {
57
- const isScreenReaderEnabled = useIsScreenReaderEnabled();
58
- const [open, setOpen] = useState<boolean>(false);
48
+ export interface BottomSheetRef {
49
+ open: () => void;
50
+ close: () => void;
51
+ }
52
+
53
+ export function BottomSheet({
54
+ children,
55
+ showCancel,
56
+ loading = false,
57
+ heading,
58
+ onOpen,
59
+ onClose,
60
+ ref,
61
+ }: BottomSheetProps & { readonly ref?: React.Ref<BottomSheetRef> }) {
59
62
  const styles = useStyles();
63
+ const isScreenReaderEnabled = useIsScreenReaderEnabled();
64
+
65
+ const cancellable = (showCancel && !loading) || isScreenReaderEnabled;
66
+
67
+ const { t } = useAtlantisI18n();
68
+ const insets = useSafeAreaInsets();
69
+ const previousIndexRef = useRef(-1);
70
+ const bottomSheetRef = useRef<RNBottomSheet>(null);
71
+ const { handleSheetPositionChange } =
72
+ useBottomSheetBackHandler(bottomSheetRef);
73
+
74
+ useImperativeHandle(ref, () => ({
75
+ open: () => {
76
+ bottomSheetRef.current?.expand();
77
+ },
78
+ close: () => {
79
+ close();
80
+ },
81
+ }));
82
+
83
+ const close = useCallback(() => {
84
+ bottomSheetRef.current?.close();
85
+ }, []);
86
+
87
+ const handleChange = (index: number) => {
88
+ // Handle Android back button
89
+ handleSheetPositionChange(index);
90
+
91
+ const previousIndex = previousIndexRef.current;
92
+
93
+ if (previousIndex === -1 && index >= 0) {
94
+ // Transitioned from closed to open
95
+ dismissKeyboard();
96
+ onOpen?.();
97
+ } else if (previousIndex >= 0 && index === -1) {
98
+ // Transitioned from open to closed
99
+ dismissKeyboard();
100
+ onClose?.();
101
+ }
102
+
103
+ previousIndexRef.current = index;
104
+ };
60
105
 
61
106
  return (
62
- <>
63
- {open && <Overlay styles={styles} />}
64
- <Modalize
65
- ref={ref}
66
- adjustToContentHeight={true}
67
- modalStyle={styles.modal}
68
- overlayStyle={styles.overlayModalize}
69
- HeaderComponent={
70
- heading && <Header heading={heading} styles={styles} />
71
- }
72
- FooterComponent={
73
- <Footer
74
- cancellable={(showCancel && !loading) || isScreenReaderEnabled}
75
- onCancel={() => {
76
- (ref as RefObject<BottomSheetRef>)?.current?.close();
77
- }}
78
- styles={styles}
79
- />
80
- }
81
- withHandle={false}
82
- withReactModal={isScreenReaderEnabled}
83
- onOpen={openModal}
84
- onClose={closeModal}
107
+ <RNBottomSheet
108
+ ref={bottomSheetRef}
109
+ index={-1}
110
+ backdropComponent={Backdrop}
111
+ backgroundStyle={styles.background}
112
+ enablePanDownToClose={true}
113
+ onChange={handleChange}
114
+ keyboardBlurBehavior="restore"
115
+ handleStyle={styles.handle}
116
+ >
117
+ <BottomSheetView
118
+ style={{
119
+ paddingBottom: insets.bottom + tokens["space-small"],
120
+ paddingTop: tokens["space-small"],
121
+ }}
85
122
  >
86
- <View
87
- style={
88
- !showCancel && !isScreenReaderEnabled ? styles.children : undefined
89
- }
90
- >
91
- {children}
92
- </View>
93
- </Modalize>
94
- </>
123
+ {heading && <Header heading={heading} styles={styles} />}
124
+ {children}
125
+ {cancellable && (
126
+ <Footer styles={styles} close={close} cancelLabel={t("cancel")} />
127
+ )}
128
+ </BottomSheetView>
129
+ </RNBottomSheet>
95
130
  );
96
-
97
- function openModal() {
98
- onOpen?.();
99
- setOpen(true);
100
- dismissKeyboard();
101
- }
102
-
103
- function closeModal() {
104
- onClose?.();
105
- setOpen(false);
106
- }
107
131
  }
108
132
 
109
133
  function Header({
@@ -121,31 +145,21 @@ function Header({
121
145
  }
122
146
 
123
147
  function Footer({
124
- cancellable,
125
- onCancel,
126
148
  styles,
149
+ close,
150
+ cancelLabel,
127
151
  }: {
128
- readonly cancellable: boolean;
129
- readonly onCancel: () => void;
130
152
  readonly styles: ReturnType<typeof useStyles>;
153
+ readonly close: () => void;
154
+ readonly cancelLabel: string;
131
155
  }) {
132
- const insets = useSafeAreaInsets();
133
- const { t } = useAtlantisI18n();
134
-
135
156
  return (
136
- <View style={{ marginBottom: insets.bottom }}>
137
- {cancellable && (
138
- <View style={styles.children}>
139
- <View style={styles.footerDivider}>
140
- <Divider />
141
- </View>
142
- <BottomSheetOption
143
- text={t("cancel")}
144
- icon={"remove"}
145
- onPress={onCancel}
146
- />
147
- </View>
148
- )}
157
+ <View>
158
+ <View style={styles.footerDivider}>
159
+ <Divider />
160
+ </View>
161
+
162
+ <BottomSheetOption text={cancelLabel} icon="remove" onPress={close} />
149
163
  </View>
150
164
  );
151
165
  }
@@ -156,10 +170,16 @@ function dismissKeyboard() {
156
170
  Keyboard.dismiss();
157
171
  }
158
172
 
159
- function Overlay({
160
- styles,
161
- }: {
162
- readonly styles: ReturnType<typeof useStyles>;
163
- }) {
164
- return <View style={styles.overlay} />;
173
+ function Backdrop(bottomSheetBackdropProps: BottomSheetBackdropProps) {
174
+ const styles = useStyles();
175
+
176
+ return (
177
+ <BottomSheetBackdrop
178
+ {...bottomSheetBackdropProps}
179
+ appearsOnIndex={0}
180
+ disappearsOnIndex={-1}
181
+ style={styles.backdrop}
182
+ opacity={1}
183
+ />
184
+ );
165
185
  }
@@ -25,7 +25,7 @@ export function BottomSheetOption({
25
25
  destructive,
26
26
  textTransform = "capitalize",
27
27
  onPress,
28
- }: BottomSheetOptionProps): JSX.Element {
28
+ }: BottomSheetOptionProps) {
29
29
  const destructiveColor = "destructive";
30
30
  const textVariation = destructive ? destructiveColor : "subdued";
31
31
  const styles = useStyles();