@jobber/components-native 0.89.5-JOB-140604-cab60b8.43 → 0.89.5-JOB-140604-8777ec5.52

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 (229) hide show
  1. package/dist/package.json +7 -7
  2. package/dist/src/ActionItem/ActionItemGroup.js +1 -1
  3. package/dist/src/AutoLink/components/Link/Link.js +1 -1
  4. package/dist/src/BottomSheet/BottomSheet.js +4 -2
  5. package/dist/src/BottomSheet/hooks/useBottomSheetBackHandler.js +26 -0
  6. package/dist/src/Chip/Chip.js +12 -1
  7. package/dist/src/Chip/Chip.style.js +1 -1
  8. package/dist/src/ContentOverlay/ContentOverlay.js +3 -5
  9. package/dist/src/ErrorMessageWrapper/context/ErrorMessageProvider.js +1 -1
  10. package/dist/src/Form/Form.js +2 -1
  11. package/dist/src/Form/components/FormMessageBanner/FormMessageBanner.js +1 -1
  12. package/dist/src/Form/hooks/useInternalForm.js +6 -3
  13. package/dist/src/FormatFile/components/MediaView/MediaView.js +22 -5
  14. package/dist/src/InputDate/InputDate.js +2 -2
  15. package/dist/src/InputFieldWrapper/InputFieldWrapper.js +14 -12
  16. package/dist/src/InputFieldWrapper/components/Prefix/Prefix.js +5 -2
  17. package/dist/src/InputFieldWrapper/components/Suffix/Suffix.js +5 -2
  18. package/dist/src/InputPressable/InputPressable.js +20 -8
  19. package/dist/src/InputPressable/InputPressable.style.js +3 -0
  20. package/dist/src/InputText/InputText.js +22 -11
  21. package/dist/src/InputText/InputText.style.js +4 -0
  22. package/dist/src/InputTime/InputTime.js +2 -2
  23. package/dist/src/Menu/Menu.js +2 -2
  24. package/dist/src/Select/components/SelectPressable/SelectPressable.js +1 -1
  25. package/dist/src/utils/meta/meta.json +0 -1
  26. package/dist/tsconfig.build.tsbuildinfo +1 -1
  27. package/dist/types/src/ActionItem/ActionItem.d.ts +2 -1
  28. package/dist/types/src/ActionItem/ActionItemGroup.d.ts +2 -1
  29. package/dist/types/src/ActionItem/components/ActionItemContainer.d.ts +2 -1
  30. package/dist/types/src/ActionLabel/ActionLabel.d.ts +1 -1
  31. package/dist/types/src/ActivityIndicator/ActivityIndicator.d.ts +2 -1
  32. package/dist/types/src/AutoLink/AutoLink.d.ts +2 -1
  33. package/dist/types/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.d.ts +2 -1
  34. package/dist/types/src/AutoLink/components/Link/Link.d.ts +2 -1
  35. package/dist/types/src/Banner/Banner.d.ts +2 -1
  36. package/dist/types/src/Banner/components/BannerIcon/BannerIcon.d.ts +2 -1
  37. package/dist/types/src/BottomSheet/BottomSheet.d.ts +4 -9
  38. package/dist/types/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.d.ts +2 -1
  39. package/dist/types/src/BottomSheet/hooks/useBottomSheetBackHandler.d.ts +8 -0
  40. package/dist/types/src/Button/Button.d.ts +2 -1
  41. package/dist/types/src/Button/components/InternalButtonLoading/InternalButtonLoading.d.ts +1 -1
  42. package/dist/types/src/ButtonGroup/ButtonGroup.d.ts +2 -1
  43. package/dist/types/src/ButtonGroup/ButtonGroupAction.d.ts +4 -3
  44. package/dist/types/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.d.ts +3 -2
  45. package/dist/types/src/Card/Card.d.ts +2 -1
  46. package/dist/types/src/Card/components/InternalCardHeader.d.ts +2 -1
  47. package/dist/types/src/Checkbox/Checkbox.d.ts +2 -1
  48. package/dist/types/src/Checkbox/CheckboxGroup.d.ts +2 -1
  49. package/dist/types/src/Chip/Chip.d.ts +2 -1
  50. package/dist/types/src/Content/Content.d.ts +2 -1
  51. package/dist/types/src/ContentOverlay/UNSAFE_WrappedModalize.d.ts +1 -1
  52. package/dist/types/src/Disclosure/Disclosure.d.ts +1 -1
  53. package/dist/types/src/Divider/Divider.d.ts +2 -1
  54. package/dist/types/src/EmptyState/EmptyState.d.ts +2 -1
  55. package/dist/types/src/ErrorMessageWrapper/ErrorMessageWrapper.d.ts +2 -1
  56. package/dist/types/src/ErrorMessageWrapper/context/ErrorMessageProvider.d.ts +2 -1
  57. package/dist/types/src/ErrorMessageWrapper/context/types.d.ts +1 -1
  58. package/dist/types/src/Flex/Flex.d.ts +2 -1
  59. package/dist/types/src/Form/Form.d.ts +2 -1
  60. package/dist/types/src/Form/components/FormActionBar/FormActionBar.d.ts +3 -2
  61. package/dist/types/src/Form/components/FormBody/FormBody.d.ts +3 -2
  62. package/dist/types/src/Form/components/FormCache/FormCache.d.ts +2 -1
  63. package/dist/types/src/Form/components/FormErrorBanner/FormErrorBanner.d.ts +2 -1
  64. package/dist/types/src/Form/components/FormMask/FormMask.d.ts +2 -1
  65. package/dist/types/src/Form/components/FormMessage/FormMessage.d.ts +2 -1
  66. package/dist/types/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.d.ts +2 -1
  67. package/dist/types/src/Form/components/FormMessageBanner/FormMessageBanner.d.ts +2 -1
  68. package/dist/types/src/Form/components/FormSaveButton/FormSaveButton.d.ts +2 -1
  69. package/dist/types/src/Form/context/AtlantisFormContext.d.ts +1 -1
  70. package/dist/types/src/Form/context/types.d.ts +2 -2
  71. package/dist/types/src/Form/hooks/useFormViewRefs.d.ts +2 -2
  72. package/dist/types/src/Form/hooks/useInternalForm.d.ts +5 -5
  73. package/dist/types/src/Form/types.d.ts +10 -4
  74. package/dist/types/src/FormField/FormField.d.ts +1 -1
  75. package/dist/types/src/FormatFile/FormatFile.d.ts +2 -1
  76. package/dist/types/src/FormatFile/components/ErrorIcon/ErrorIcon.d.ts +2 -1
  77. package/dist/types/src/FormatFile/components/FileView/FileView.d.ts +2 -1
  78. package/dist/types/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.d.ts +3 -2
  79. package/dist/types/src/FormatFile/components/MediaView/MediaView.d.ts +2 -1
  80. package/dist/types/src/FormatFile/components/ProgressBar/ProgressBar.d.ts +2 -1
  81. package/dist/types/src/Heading/Heading.d.ts +1 -1
  82. package/dist/types/src/Icon/Icon.d.ts +2 -1
  83. package/dist/types/src/IconButton/IconButton.d.ts +1 -1
  84. package/dist/types/src/InputCurrency/InputCurrency.d.ts +2 -1
  85. package/dist/types/src/InputDate/InputDate.d.ts +4 -2
  86. package/dist/types/src/InputFieldWrapper/InputFieldWrapper.d.ts +9 -2
  87. package/dist/types/src/InputFieldWrapper/components/ClearAction/ClearAction.d.ts +2 -1
  88. package/dist/types/src/InputFieldWrapper/components/Prefix/Prefix.d.ts +4 -4
  89. package/dist/types/src/InputFieldWrapper/components/Suffix/Suffix.d.ts +4 -4
  90. package/dist/types/src/InputPressable/InputPressable.d.ts +9 -1
  91. package/dist/types/src/InputPressable/InputPressable.style.d.ts +3 -0
  92. package/dist/types/src/InputSearch/InputSearch.d.ts +1 -1
  93. package/dist/types/src/InputSearch/components/FilterButton.d.ts +2 -1
  94. package/dist/types/src/InputText/InputText.d.ts +8 -0
  95. package/dist/types/src/InputText/InputText.style.d.ts +4 -0
  96. package/dist/types/src/InputText/context/InputAccessoriesProvider.d.ts +2 -1
  97. package/dist/types/src/InputTime/InputTime.d.ts +4 -2
  98. package/dist/types/src/Menu/Menu.d.ts +2 -1
  99. package/dist/types/src/Menu/components/MenuOption/MenuOption.d.ts +2 -1
  100. package/dist/types/src/Menu/components/Overlay/Overlay.d.ts +2 -1
  101. package/dist/types/src/Menu/types.d.ts +6 -1
  102. package/dist/types/src/ProgressBar/ProgressBar.d.ts +2 -1
  103. package/dist/types/src/ProgressBar/ProgressBarInner.d.ts +2 -1
  104. package/dist/types/src/Select/Select.d.ts +3 -2
  105. package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.d.ts +2 -1
  106. package/dist/types/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.d.ts +2 -1
  107. package/dist/types/src/Select/components/SelectInternalPicker/SelectInternalPicker.d.ts +2 -1
  108. package/dist/types/src/Select/components/SelectPressable/SelectPressable.d.ts +2 -1
  109. package/dist/types/src/StatusLabel/StatusLabel.d.ts +2 -1
  110. package/dist/types/src/Switch/Switch.d.ts +2 -1
  111. package/dist/types/src/Switch/components/BaseSwitch/BaseSwitch.d.ts +2 -1
  112. package/dist/types/src/Text/Text.d.ts +1 -1
  113. package/dist/types/src/TextList/TextList.d.ts +2 -1
  114. package/dist/types/src/ThumbnailList/ThumbnailList.d.ts +2 -1
  115. package/dist/types/src/Toast/Toast.d.ts +2 -1
  116. package/dist/types/src/Typography/Typography.d.ts +1 -1
  117. package/dist/types/src/Typography/TypographyGestureDetector.d.ts +2 -1
  118. package/dist/types/src/utils/test/MockSafeAreaProvider.d.ts +1 -1
  119. package/package.json +7 -7
  120. package/src/ActionItem/ActionItem.tsx +1 -1
  121. package/src/ActionItem/ActionItemGroup.tsx +1 -3
  122. package/src/ActionItem/components/ActionItemContainer.tsx +1 -1
  123. package/src/ActionLabel/ActionLabel.tsx +1 -1
  124. package/src/ActivityIndicator/ActivityIndicator.tsx +1 -3
  125. package/src/AutoLink/AutoLink.tsx +1 -1
  126. package/src/AutoLink/components/ComposeTextWithLinks/ComposeTextWithLinks.tsx +1 -1
  127. package/src/AutoLink/components/Link/Link.tsx +1 -5
  128. package/src/Banner/Banner.tsx +2 -2
  129. package/src/Banner/components/BannerIcon/BannerIcon.tsx +1 -1
  130. package/src/BottomSheet/BottomSheet.stories.tsx +0 -1
  131. package/src/BottomSheet/BottomSheet.tsx +9 -10
  132. package/src/BottomSheet/components/BottomSheetOption/BottomSheetOption.tsx +1 -1
  133. package/src/BottomSheet/hooks/useBottomSheetBackHandler.test.ts +90 -0
  134. package/src/BottomSheet/hooks/useBottomSheetBackHandler.ts +41 -0
  135. package/src/Button/Button.tsx +1 -1
  136. package/src/Button/components/InternalButtonLoading/InternalButtonLoading.tsx +1 -1
  137. package/src/ButtonGroup/ButtonGroup.tsx +1 -1
  138. package/src/ButtonGroup/ButtonGroupAction.tsx +4 -4
  139. package/src/ButtonGroup/components/SecondaryActionSheet/SecondaryActionSheet.tsx +2 -2
  140. package/src/Card/Card.tsx +1 -1
  141. package/src/Card/components/InternalCardHeader.tsx +1 -1
  142. package/src/Checkbox/Checkbox.tsx +2 -2
  143. package/src/Checkbox/CheckboxGroup.test.tsx +1 -1
  144. package/src/Checkbox/CheckboxGroup.tsx +2 -2
  145. package/src/Chip/Chip.style.ts +1 -1
  146. package/src/Chip/Chip.tsx +20 -2
  147. package/src/Content/Content.tsx +1 -1
  148. package/src/ContentOverlay/ContentOverlay.tsx +3 -4
  149. package/src/Disclosure/Disclosure.tsx +1 -1
  150. package/src/Divider/Divider.tsx +1 -1
  151. package/src/EmptyState/EmptyState.tsx +1 -1
  152. package/src/ErrorMessageWrapper/ErrorMessageWrapper.tsx +1 -1
  153. package/src/ErrorMessageWrapper/context/ErrorMessageProvider.tsx +3 -5
  154. package/src/ErrorMessageWrapper/context/types.ts +1 -1
  155. package/src/Flex/Flex.tsx +2 -2
  156. package/src/Form/Form.test.tsx +145 -2
  157. package/src/Form/Form.tsx +3 -1
  158. package/src/Form/components/FormActionBar/FormActionBar.tsx +3 -3
  159. package/src/Form/components/FormBody/FormBody.tsx +3 -3
  160. package/src/Form/components/FormCache/FormCache.tsx +1 -1
  161. package/src/Form/components/FormErrorBanner/FormErrorBanner.tsx +1 -1
  162. package/src/Form/components/FormMask/FormMask.tsx +1 -1
  163. package/src/Form/components/FormMessage/FormMessage.tsx +1 -1
  164. package/src/Form/components/FormMessage/components/InternalFormMessage/InternalFormMessage.tsx +1 -1
  165. package/src/Form/components/FormMessageBanner/FormMessageBanner.tsx +1 -3
  166. package/src/Form/components/FormSaveButton/FormSaveButton.tsx +1 -1
  167. package/src/Form/context/types.ts +2 -2
  168. package/src/Form/hooks/useFormViewRefs.ts +4 -5
  169. package/src/Form/hooks/useInternalForm.ts +12 -5
  170. package/src/Form/types.ts +11 -4
  171. package/src/FormField/FormField.tsx +1 -1
  172. package/src/FormatFile/FormatFile.tsx +3 -3
  173. package/src/FormatFile/components/ErrorIcon/ErrorIcon.tsx +1 -1
  174. package/src/FormatFile/components/FileView/FileView.tsx +1 -1
  175. package/src/FormatFile/components/FormatFileBottomSheet/FormatFileBottomSheet.tsx +2 -2
  176. package/src/FormatFile/components/MediaView/MediaView.test.tsx +283 -0
  177. package/src/FormatFile/components/MediaView/MediaView.tsx +28 -7
  178. package/src/FormatFile/components/ProgressBar/ProgressBar.tsx +1 -1
  179. package/src/Heading/Heading.tsx +1 -1
  180. package/src/Icon/Icon.tsx +1 -1
  181. package/src/IconButton/IconButton.tsx +1 -1
  182. package/src/InputCurrency/InputCurrency.tsx +1 -1
  183. package/src/InputDate/InputDate.tsx +7 -3
  184. package/src/InputFieldWrapper/InputFieldWrapper.test.tsx +48 -1
  185. package/src/InputFieldWrapper/InputFieldWrapper.tsx +39 -29
  186. package/src/InputFieldWrapper/components/ClearAction/ClearAction.tsx +1 -1
  187. package/src/InputFieldWrapper/components/Prefix/Prefix.test.tsx +3 -5
  188. package/src/InputFieldWrapper/components/Prefix/Prefix.tsx +8 -6
  189. package/src/InputFieldWrapper/components/Suffix/Suffix.test.tsx +2 -4
  190. package/src/InputFieldWrapper/components/Suffix/Suffix.tsx +8 -6
  191. package/src/InputPassword/InputPassword.tsx +1 -1
  192. package/src/InputPressable/InputPressable.style.ts +4 -0
  193. package/src/InputPressable/InputPressable.test.tsx +75 -1
  194. package/src/InputPressable/InputPressable.tsx +34 -8
  195. package/src/InputSearch/InputSearch.tsx +1 -0
  196. package/src/InputSearch/components/FilterButton.tsx +1 -1
  197. package/src/InputText/InputText.style.ts +5 -0
  198. package/src/InputText/InputText.test.tsx +75 -0
  199. package/src/InputText/InputText.tsx +32 -12
  200. package/src/InputText/context/InputAccessoriesProvider.tsx +1 -1
  201. package/src/InputTime/InputTime.tsx +7 -3
  202. package/src/Menu/Menu.tsx +3 -3
  203. package/src/Menu/components/MenuOption/MenuOption.tsx +1 -1
  204. package/src/Menu/components/Overlay/Overlay.tsx +1 -1
  205. package/src/Menu/types.ts +7 -1
  206. package/src/ProgressBar/ProgressBar.tsx +1 -1
  207. package/src/ProgressBar/ProgressBarInner.tsx +1 -1
  208. package/src/Select/Select.tsx +2 -2
  209. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.ios.tsx +1 -1
  210. package/src/Select/components/SelectDefaultPicker/SelectDefaultPicker.tsx +1 -1
  211. package/src/Select/components/SelectInternalPicker/SelectInternalPicker.tsx +1 -1
  212. package/src/Select/components/SelectPressable/SelectPressable.tsx +1 -4
  213. package/src/StatusLabel/StatusLabel.tsx +1 -1
  214. package/src/Switch/Switch.tsx +1 -1
  215. package/src/Switch/components/BaseSwitch/BaseSwitch.tsx +1 -1
  216. package/src/Text/Text.tsx +1 -1
  217. package/src/TextList/TextList.tsx +1 -1
  218. package/src/ThumbnailList/ThumbnailList.tsx +1 -1
  219. package/src/Toast/Toast.tsx +2 -2
  220. package/src/Typography/Typography.tsx +1 -1
  221. package/src/Typography/TypographyGestureDetector.tsx +1 -3
  222. package/src/utils/meta/meta.json +0 -1
  223. package/src/utils/test/MockSafeAreaProvider.tsx +1 -1
  224. package/dist/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.js +0 -45
  225. package/dist/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.styles.js +0 -8
  226. package/dist/types/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.d.ts +0 -9
  227. package/dist/types/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.styles.d.ts +0 -5
  228. package/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.styles.ts +0 -9
  229. package/src/BottomSheet/components/BottomSheetInputText/BottomSheetInputText.tsx +0 -89
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import React from "react";
2
3
  import type { IconColorNames, IconNames } from "@jobber/design";
3
4
  export interface ActionItemProps {
4
5
  /**
@@ -35,7 +36,7 @@ export interface ActionItemProps {
35
36
  readonly onPress?: () => void;
36
37
  readonly testID?: string;
37
38
  }
38
- export declare function ActionItem({ title, icon, iconColor, children, actionIcon, actionIconColour, actionIconAlignment, onPress, testID, }: ActionItemProps): JSX.Element;
39
+ export declare function ActionItem({ title, icon, iconColor, children, actionIcon, actionIconColour, actionIconAlignment, onPress, testID, }: ActionItemProps): React.JSX.Element;
39
40
  type ActionIconColour = "interactive" | "destructive" | "informative" | "subtle";
40
41
  type ActionIconNames = IconNames | "editpencil";
41
42
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { ReactElement } from "react";
2
+ import React from "react";
2
3
  import type { ActionItem, ActionItemProps } from "./ActionItem";
3
4
  export type ActionItemElement = ReactElement<ActionItemProps, typeof ActionItem> | boolean | null | undefined;
4
5
  interface ActionItemGroupProps {
@@ -7,5 +8,5 @@ interface ActionItemGroupProps {
7
8
  */
8
9
  readonly children: ActionItemElement | ActionItemElement[];
9
10
  }
10
- export declare function ActionItemGroup({ children, }: ActionItemGroupProps): JSX.Element;
11
+ export declare function ActionItemGroup({ children }: ActionItemGroupProps): React.JSX.Element;
11
12
  export {};
@@ -1,9 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
+ import React from "react";
2
3
  interface ActionItemContainerProps {
3
4
  readonly children: ReactNode;
4
5
  readonly title?: string;
5
6
  readonly onPress?: () => void;
6
7
  readonly testID?: string;
7
8
  }
8
- export declare function ActionItemContainer({ onPress, title, children, testID, }: ActionItemContainerProps): JSX.Element;
9
+ export declare function ActionItemContainer({ onPress, title, children, testID, }: ActionItemContainerProps): React.JSX.Element;
9
10
  export {};
@@ -24,5 +24,5 @@ interface ActionLabelProps {
24
24
  */
25
25
  readonly align?: TextAlign;
26
26
  }
27
- export declare function ActionLabel({ children, variation, type, disabled, align, }: ActionLabelProps): JSX.Element;
27
+ export declare function ActionLabel({ children, variation, type, disabled, align, }: ActionLabelProps): React.JSX.Element;
28
28
  export {};
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { ActivityIndicatorProps } from "react-native";
2
- export declare function JobberActivityIndicator(props: ActivityIndicatorProps): JSX.Element;
3
+ export declare function JobberActivityIndicator(props: ActivityIndicatorProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { AutoLinkProps } from "./types";
2
- export declare function AutoLink({ children: text, bottomTabsVisible, selectable, ...rest }: AutoLinkProps): JSX.Element;
3
+ export declare function AutoLink({ children: text, bottomTabsVisible, selectable, ...rest }: AutoLinkProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { ComposeTextWithLinksProps } from "../../types";
2
- export declare function ComposeTextWithLinks({ part, index, match, bottomTabsVisible, selectable, }: ComposeTextWithLinksProps): JSX.Element;
3
+ export declare function ComposeTextWithLinks({ part, index, match, bottomTabsVisible, selectable, }: ComposeTextWithLinksProps): React.JSX.Element;
@@ -1,7 +1,8 @@
1
+ import React from "react";
1
2
  interface LinkProps {
2
3
  readonly children: string;
3
4
  readonly onPress: () => void;
4
5
  readonly onLongPress?: () => void;
5
6
  }
6
- export declare function Link({ children, onPress, onLongPress, }: LinkProps): JSX.Element;
7
+ export declare function Link({ children, onPress, onLongPress }: LinkProps): React.JSX.Element;
7
8
  export {};
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { BannerProps } from "./types";
2
- export declare function Banner({ action, details, text, type, children, icon, }: BannerProps): JSX.Element;
3
+ export declare function Banner({ action, details, text, type, children, icon, }: BannerProps): React.JSX.Element;
@@ -1,7 +1,8 @@
1
+ import React from "react";
1
2
  import type { IconNames } from "@jobber/design";
2
3
  import type { BannerTypes } from "../../types";
3
4
  export interface BannerIconProps {
4
5
  readonly icon: IconNames;
5
6
  readonly type: BannerTypes;
6
7
  }
7
- export declare function BannerIcon({ icon, type }: BannerIconProps): JSX.Element;
8
+ export declare function BannerIcon({ icon, type }: BannerIconProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { ReactNode, Ref } from "react";
1
+ import type { ReactNode } from "react";
2
2
  import React from "react";
3
3
  export interface BottomSheetProps {
4
4
  readonly children: ReactNode;
@@ -22,16 +22,11 @@ export interface BottomSheetProps {
22
22
  * Callback that is called when the overlay is closed.
23
23
  */
24
24
  readonly onClose?: () => void;
25
- /**
26
- * Ref to the bottom sheet component.
27
- */
28
- readonly ref: Ref<BottomSheetRef>;
29
25
  }
30
26
  export interface BottomSheetRef {
31
27
  open: () => void;
32
28
  close: () => void;
33
29
  }
34
- export declare function BottomSheet({ children, showCancel, loading, heading, onOpen, onClose, ref, }: BottomSheetProps): React.JSX.Element;
35
- export declare namespace BottomSheet {
36
- var InputText: React.ForwardRefExoticComponent<import("..").InputTextProps & React.RefAttributes<import("..").InputTextRef>>;
37
- }
30
+ export declare function BottomSheet({ children, showCancel, loading, heading, onOpen, onClose, ref, }: BottomSheetProps & {
31
+ readonly ref?: React.Ref<BottomSheetRef>;
32
+ }): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { IconColorNames, IconNames } from "@jobber/design";
2
3
  import type { TextAlign } from "../../../Typography";
3
4
  export interface BottomSheetOptionProps {
@@ -9,4 +10,4 @@ export interface BottomSheetOptionProps {
9
10
  readonly textTransform?: "none" | "capitalize";
10
11
  readonly onPress: () => void;
11
12
  }
12
- export declare function BottomSheetOption({ text, icon, iconColor, textAlign, destructive, textTransform, onPress, }: BottomSheetOptionProps): JSX.Element;
13
+ export declare function BottomSheetOption({ text, icon, iconColor, textAlign, destructive, textTransform, onPress, }: BottomSheetOptionProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type BottomSheet from "@gorhom/bottom-sheet";
2
+ /**
3
+ * Hook that closes the bottom sheet on the hardware back button press if it is visible
4
+ * @param bottomSheetRef ref to the bottom sheet component
5
+ */
6
+ export declare function useBottomSheetBackHandler(bottomSheetRef: React.RefObject<BottomSheet | null>): {
7
+ handleSheetPositionChange: (index: number) => void;
8
+ };
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { StyleProp, ViewStyle } from "react-native";
2
3
  import type { IconNames } from "@jobber/design";
3
4
  import type { XOR } from "ts-xor";
@@ -83,5 +84,5 @@ interface IconButton extends CommonButtonProps {
83
84
  readonly accessibilityLabel: string;
84
85
  }
85
86
  export type ButtonProps = XOR<LabelButton, IconButton>;
86
- export declare function Button({ label, onPress, variation, type, fullHeight, fullWidth, disabled, loading, size, accessibilityLabel, accessibilityHint, icon, testID, UNSAFE_style, }: ButtonProps): JSX.Element;
87
+ export declare function Button({ label, onPress, variation, type, fullHeight, fullWidth, disabled, loading, size, accessibilityLabel, accessibilityHint, icon, testID, UNSAFE_style, }: ButtonProps): React.JSX.Element;
87
88
  export {};
@@ -4,7 +4,7 @@ interface InternalButtonLoadingProps {
4
4
  readonly variation: ButtonVariation;
5
5
  readonly type: ButtonType;
6
6
  }
7
- declare function InternalButtonLoadingInternal({ variation, type, }: InternalButtonLoadingProps): JSX.Element;
7
+ declare function InternalButtonLoadingInternal({ variation, type, }: InternalButtonLoadingProps): React.JSX.Element;
8
8
  export declare const darkPattern = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAgMAAACf9p+rAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAITgAACE4AUWWMWAAAAAMUExURQAAAEdwTAAAAAAAAKDh18UAAAAEdFJOUxkADQwimkzpAAAAtUlEQVRIx+3NqxHDQBRDUc0YuxyXokxgSkmT7sdgP++3YoYrqAsOYDto+7gfpwtfHy4Xfj7cLvw3sYlNbOINAoI4IIgTgrggiBuCIAThQyB8CIQLkXAhEi5EwoVIWEiEhURYSISFRMyQiRkyMUMmZsjECIUYoRAjFGKEQvRQiR4q0UMleqhECwuihQXRwoJoYUEQgiAEQQiCEAQhCEIQhCAIQRCCIARBCIIQBCEIQhCEIAhB8AEuzZ5wHe17xgAAAABJRU5ErkJggg==";
9
9
  export declare const lightPattern = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgAgMAAACf9p+rAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAITgAACE4AUWWMWAAAAAJUExURf///0dwTP///0SistEAAAADdFJOU0AAILGCadYAAAC0SURBVEjH7c2pFcNAFENRHTMX4pKUE5hS0oT7NZjlbyNmOIJ64AK2g7aP+3G68PXhcuHnw+3CfxOb2MQm3iAgiAOCOCGIC4K4IQhCED4EwodAuBAJFyLhQiRciISFRFhIhIVEWEjEDJmYIRMzZGKGTIxQiBEKMUIhRihED5XooRI9VKKHSrSwIFpYEC0siBYWBCEIQhCEIAhBEIIgBEEIghAEIQhCEIQgCEEQgiAEQQiCEAQfva6WeBniVLgAAAAASUVORK5CYII=";
10
10
  export declare const InternalButtonLoading: React.MemoExoticComponent<typeof InternalButtonLoadingInternal>;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { ButtonGroupActionElement } from "./types";
2
3
  export interface ButtonGroupProps {
3
4
  readonly children: ButtonGroupActionElement | ButtonGroupActionElement[];
@@ -22,7 +23,7 @@ export interface ButtonGroupProps {
22
23
  */
23
24
  readonly allowTapWhenOffline?: boolean;
24
25
  }
25
- export declare function ButtonGroup({ children, showCancelInBottomSheet, bottomSheetHeading, onOpenBottomSheet, onCloseBottomSheet, allowTapWhenOffline, }: ButtonGroupProps): JSX.Element;
26
+ export declare function ButtonGroup({ children, showCancelInBottomSheet, bottomSheetHeading, onOpenBottomSheet, onCloseBottomSheet, allowTapWhenOffline, }: ButtonGroupProps): React.JSX.Element;
26
27
  export declare namespace ButtonGroup {
27
28
  var PrimaryAction: typeof import("./ButtonGroupAction").PrimaryAction;
28
29
  var SecondaryAction: typeof import("./ButtonGroupAction").SecondaryAction;
@@ -1,4 +1,5 @@
1
1
  import type { IconColorNames, IconNames } from "@jobber/design";
2
+ import React, { type ReactElement } from "react";
2
3
  import type { ButtonType, ButtonVariation } from "../Button";
3
4
  export interface ButtonGroupActionProps {
4
5
  /**
@@ -39,8 +40,8 @@ export interface ButtonGroupPrimaryActionProps extends ButtonGroupActionProps {
39
40
  /**
40
41
  * Optional custom button that can be rendered in place of the primary action button
41
42
  */
42
- customButton?: JSX.Element;
43
+ customButton?: ReactElement;
43
44
  loading?: boolean;
44
45
  }
45
- export declare function PrimaryAction(_: ButtonGroupPrimaryActionProps): JSX.Element;
46
- export declare function SecondaryAction(_: ButtonGroupSecondaryActionProps): JSX.Element;
46
+ export declare function PrimaryAction(_: ButtonGroupPrimaryActionProps): React.JSX.Element;
47
+ export declare function SecondaryAction(_: ButtonGroupSecondaryActionProps): React.JSX.Element;
@@ -1,13 +1,14 @@
1
1
  import type { RefObject } from "react";
2
+ import React from "react";
2
3
  import type { ButtonGroupSecondaryActionProps } from "../../types";
3
4
  import type { BottomSheetRef } from "../../../BottomSheet/BottomSheet";
4
5
  interface SecondaryActionSheetProps {
5
6
  readonly actions: ButtonGroupSecondaryActionProps[];
6
- readonly secondaryActionsRef: RefObject<BottomSheetRef>;
7
+ readonly secondaryActionsRef: RefObject<BottomSheetRef | null>;
7
8
  readonly showCancel?: boolean;
8
9
  readonly heading?: string;
9
10
  readonly onOpenBottomSheet?: () => void;
10
11
  readonly onCloseBottomSheet?: () => void;
11
12
  }
12
- export declare function SecondaryActionSheet({ actions, secondaryActionsRef, heading, showCancel, onOpenBottomSheet, onCloseBottomSheet, }: SecondaryActionSheetProps): JSX.Element;
13
+ export declare function SecondaryActionSheet({ actions, secondaryActionsRef, heading, showCancel, onOpenBottomSheet, onCloseBottomSheet, }: SecondaryActionSheetProps): React.JSX.Element;
13
14
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import React from "react";
2
3
  import type { IconNames } from "@jobber/design";
3
4
  import type { XOR } from "ts-xor";
4
5
  interface CardProps {
@@ -36,5 +37,5 @@ interface ButtonAction {
36
37
  readonly label: string;
37
38
  }
38
39
  export type CardAction = XOR<IconAction, ButtonAction>;
39
- export declare function Card({ header, footer, children, reportCardHeight: onCardHeightChange, testID, error, elevation, }: CardProps): JSX.Element;
40
+ export declare function Card({ header, footer, children, reportCardHeight: onCardHeightChange, testID, error, elevation, }: CardProps): React.JSX.Element;
40
41
  export {};
@@ -1,9 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
+ import React from "react";
2
3
  interface InternalCardHeaderProps {
3
4
  readonly children: ReactNode[] | ReactNode;
4
5
  readonly onPress?: () => void;
5
6
  readonly testID?: string;
6
7
  readonly collapsable: boolean;
7
8
  }
8
- export declare function InternalCardHeader({ onPress, children, testID, collapsable, }: InternalCardHeaderProps): JSX.Element;
9
+ export declare function InternalCardHeader({ onPress, children, testID, collapsable, }: InternalCardHeaderProps): React.JSX.Element;
9
10
  export {};
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { XOR } from "ts-xor";
2
3
  interface CommonCheckboxProps {
3
4
  /**
@@ -54,5 +55,5 @@ interface UncontrolledCheckboxProps extends CommonCheckboxProps {
54
55
  readonly name: string;
55
56
  }
56
57
  export type CheckboxProps = XOR<ControlledCheckboxProps, UncontrolledCheckboxProps>;
57
- export declare function Checkbox(props: CheckboxProps): JSX.Element;
58
+ export declare function Checkbox(props: CheckboxProps): React.JSX.Element;
58
59
  export {};
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { XOR } from "ts-xor";
2
3
  import type { CheckboxProps } from "./Checkbox";
3
4
  import type { CheckboxElement, CheckboxGroupState } from "./types";
@@ -17,5 +18,5 @@ interface UncontrolledCheckboxGroupProps extends CommonCheckboxGroupProps {
17
18
  name: string;
18
19
  }
19
20
  export type CheckboxGroupProps = XOR<UncontrolledCheckboxGroupProps, ControlledCheckboxGroupProps>;
20
- export declare function CheckboxGroup({ children, state, onChange, name, ...rest }: CheckboxGroupProps): JSX.Element;
21
+ export declare function CheckboxGroup({ children, state, onChange, name, ...rest }: CheckboxGroupProps): React.JSX.Element;
21
22
  export {};
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { AccessibilityRole } from "react-native";
2
3
  import type { IconNames } from "@jobber/design";
3
4
  export type AccentType = "client" | "invoice" | "job" | "request" | "quote";
@@ -41,4 +42,4 @@ export interface ChipProps {
41
42
  */
42
43
  readonly accent?: AccentType;
43
44
  }
44
- export declare function Chip({ icon, label, onPress, isDismissible, isActive, inactiveBackgroundColor, accessibilityLabel, accessibilityRole, accent, }: ChipProps): JSX.Element;
45
+ export declare function Chip({ icon, label, onPress, isDismissible, isActive, inactiveBackgroundColor, accessibilityLabel, accessibilityRole, accent, }: ChipProps): React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import React from "react";
2
3
  import type { StyleProp, ViewStyle } from "react-native";
3
4
  export type Spacing = "none" | "base" | "small" | "smaller" | "smallest" | "large";
4
5
  export interface ContentUnsafeStyle {
@@ -26,4 +27,4 @@ export interface ContentProps {
26
27
  */
27
28
  readonly UNSAFE_style?: ContentUnsafeStyle;
28
29
  }
29
- export declare function Content({ children, spacing, childSpacing, direction, UNSAFE_style, }: ContentProps): JSX.Element;
30
+ export declare function Content({ children, spacing, childSpacing, direction, UNSAFE_style, }: ContentProps): React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import type { IHandles } from "react-native-modalize/lib/options";
3
- export declare const UNSAFE_WrappedModalize: React.ForwardRefExoticComponent<Omit<import("react-native-modalize/lib/options").IProps<any> & React.RefAttributes<string | number | boolean | {} | React.ReactPortal | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | undefined>, "ref"> & React.RefAttributes<IHandles | undefined>>;
3
+ export declare const UNSAFE_WrappedModalize: React.ForwardRefExoticComponent<Omit<import("react-native-modalize/lib/options").IProps<any> & React.RefAttributes<any>, "ref"> & React.RefAttributes<IHandles | undefined>>;
@@ -31,5 +31,5 @@ interface DisclosureProps {
31
31
  */
32
32
  onToggle(): void;
33
33
  }
34
- export declare function Disclosure({ content, header, open, onToggle, isEmpty, animationDuration, }: DisclosureProps): JSX.Element;
34
+ export declare function Disclosure({ content, header, open, onToggle, isEmpty, animationDuration, }: DisclosureProps): React.JSX.Element;
35
35
  export {};
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  interface DividerProps {
2
3
  /**
3
4
  * The weight of the divider.
@@ -16,5 +17,5 @@ interface DividerProps {
16
17
  */
17
18
  readonly testID?: string;
18
19
  }
19
- export declare function Divider({ size, direction, testID, }: DividerProps): JSX.Element;
20
+ export declare function Divider({ size, direction, testID, }: DividerProps): React.JSX.Element;
20
21
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { IconColorNames, IconNames } from "@jobber/design";
2
+ import React from "react";
2
3
  interface Action {
3
4
  label: string;
4
5
  onPress: () => void;
@@ -30,5 +31,5 @@ export interface EmptyStateProps {
30
31
  */
31
32
  readonly secondaryAction?: Action;
32
33
  }
33
- export declare function EmptyState({ icon, title, description, primaryAction, secondaryAction, iconColor, }: EmptyStateProps): JSX.Element;
34
+ export declare function EmptyState({ icon, title, description, primaryAction, secondaryAction, iconColor, }: EmptyStateProps): React.JSX.Element;
34
35
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import React from "react";
2
3
  type WrapForTypes = "card" | "default";
3
4
  interface ErrorMessageWrapperProps {
4
5
  /**
@@ -17,5 +18,5 @@ interface ErrorMessageWrapperProps {
17
18
  *
18
19
  * This component is internal to Atlantis and shouldn't be used outside of it.
19
20
  */
20
- export declare function ErrorMessageWrapper({ message, wrapFor, children, }: ErrorMessageWrapperProps): JSX.Element;
21
+ export declare function ErrorMessageWrapper({ message, wrapFor, children, }: ErrorMessageWrapperProps): React.JSX.Element;
21
22
  export {};
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
+ import React from "react";
2
3
  interface ErrorMessageProviderProps {
3
4
  readonly children: ReactNode;
4
5
  }
5
- export declare function ErrorMessageProvider({ children, }: ErrorMessageProviderProps): JSX.Element;
6
+ export declare function ErrorMessageProvider({ children }: ErrorMessageProviderProps): React.JSX.Element;
6
7
  export {};
@@ -43,7 +43,7 @@ type ElementID = Element["id"];
43
43
  export interface ErrorMessageContextRegisterParams {
44
44
  readonly id: ElementID;
45
45
  readonly hasErrorMessage: Methods["hasErrorMessage"];
46
- readonly ref: RefObject<View>;
46
+ readonly ref: RefObject<View | null>;
47
47
  }
48
48
  export interface ErrorMessageContextProps {
49
49
  /**
@@ -1,3 +1,4 @@
1
1
  import type { PropsWithChildren } from "react";
2
+ import React from "react";
2
3
  import type { FlexProps } from "./types";
3
- export declare function Flex({ template, align, gap, children, }: PropsWithChildren<FlexProps>): JSX.Element;
4
+ export declare function Flex({ template, align, gap, children, }: PropsWithChildren<FlexProps>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { FieldValues } from "react-hook-form";
2
3
  import type { FormProps } from "./types";
3
- export declare function Form<T extends FieldValues, S>({ initialLoading, ...rest }: FormProps<T, S>): JSX.Element;
4
+ export declare function Form<T extends FieldValues, S>({ initialLoading, ...rest }: FormProps<T, S>): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React, { type ReactElement } from "react";
1
2
  import type { SecondaryActionProp } from "../../types";
2
3
  export interface FormActionBarProps {
3
4
  readonly keyboardHeight: number;
@@ -5,8 +6,8 @@ export interface FormActionBarProps {
5
6
  readonly saveButtonLabel?: string;
6
7
  readonly submit: () => Promise<void> | void;
7
8
  readonly setSaveButtonHeight?: (height: number) => void;
8
- readonly renderStickySection?: (onSubmit: () => void, label: string | undefined, isSubmitting: boolean) => JSX.Element;
9
+ readonly renderStickySection?: (onSubmit: () => void, label: string | undefined, isSubmitting: boolean) => ReactElement;
9
10
  readonly secondaryActions?: SecondaryActionProp[];
10
11
  readonly setSecondaryActionLoading?: (bool: boolean) => void;
11
12
  }
12
- export declare function FormActionBar({ keyboardHeight, submit, isFormSubmitting, saveButtonLabel, renderStickySection, setSaveButtonHeight, secondaryActions, setSecondaryActionLoading, }: FormActionBarProps): JSX.Element;
13
+ export declare function FormActionBar({ keyboardHeight, submit, isFormSubmitting, saveButtonLabel, renderStickySection, setSaveButtonHeight, secondaryActions, setSecondaryActionLoading, }: FormActionBarProps): React.JSX.Element;
@@ -1,9 +1,10 @@
1
+ import React, { type ReactElement } from "react";
1
2
  import type { FormActionBarProps } from "../FormActionBar";
2
3
  interface FormBodyProps extends FormActionBarProps {
3
- readonly children: JSX.Element;
4
+ readonly children: ReactElement;
4
5
  readonly shouldRenderActionBar?: boolean;
5
6
  readonly saveButtonOffset?: number;
6
7
  }
7
- export declare function FormBody({ isFormSubmitting, submit, keyboardHeight, children, saveButtonLabel, renderStickySection, shouldRenderActionBar, secondaryActions, setSecondaryActionLoading, setSaveButtonHeight, saveButtonOffset, }: FormBodyProps): JSX.Element;
8
+ export declare function FormBody({ isFormSubmitting, submit, keyboardHeight, children, saveButtonLabel, renderStickySection, shouldRenderActionBar, secondaryActions, setSecondaryActionLoading, setSaveButtonHeight, saveButtonOffset, }: FormBodyProps): React.JSX.Element;
8
9
  export declare function useBottomPadding(): number;
9
10
  export {};
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { DeepPartial, FieldValues } from "react-hook-form";
2
3
  interface FormCacheProps<T extends FieldValues> {
3
4
  readonly localCacheId?: string | string[];
@@ -5,5 +6,5 @@ interface FormCacheProps<T extends FieldValues> {
5
6
  readonly localCacheExclude?: string[];
6
7
  readonly setLocalCache: (data: DeepPartial<T>) => void;
7
8
  }
8
- export declare function FormCache<T extends FieldValues>({ localCacheExclude, localCacheKey, setLocalCache, }: FormCacheProps<T>): JSX.Element;
9
+ export declare function FormCache<T extends FieldValues>({ localCacheExclude, localCacheKey, setLocalCache, }: FormCacheProps<T>): React.JSX.Element;
9
10
  export {};
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { FormBannerErrors } from "../../types";
2
- export declare function FormErrorBanner({ networkError, bannerError, }: FormBannerErrors): JSX.Element;
3
+ export declare function FormErrorBanner({ networkError, bannerError, }: FormBannerErrors): React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare function FormMask(): JSX.Element;
1
+ import React from "react";
2
+ export declare function FormMask(): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { EmptyStateProps } from "../../../EmptyState";
2
3
  type FormMessageData = EmptyStateProps;
3
4
  /**
@@ -11,7 +12,7 @@ type FormMessageData = EmptyStateProps;
11
12
  * recent message.
12
13
  */
13
14
  export declare const FormMessage: {
14
- (): JSX.Element;
15
+ (): React.JSX.Element;
15
16
  show(messageData: FormMessageData): void;
16
17
  close(): void;
17
18
  };
@@ -1,7 +1,8 @@
1
+ import React from "react";
1
2
  import type { EmptyStateProps } from "../../../../../EmptyState";
2
3
  interface FormMessageProps {
3
4
  readonly data: EmptyStateProps;
4
5
  readonly onRequestClose: () => void;
5
6
  }
6
- export declare function InternalFormMessage({ data, onRequestClose, }: FormMessageProps): JSX.Element;
7
+ export declare function InternalFormMessage({ data, onRequestClose, }: FormMessageProps): React.JSX.Element;
7
8
  export {};
@@ -1,6 +1,7 @@
1
+ import React from "react";
1
2
  import type { FormBannerMessage } from "../../types";
2
3
  interface FormMessageBannerProps {
3
4
  readonly bannerMessages?: FormBannerMessage[];
4
5
  }
5
- export declare function FormMessageBanner({ bannerMessages, }: FormMessageBannerProps): JSX.Element;
6
+ export declare function FormMessageBanner({ bannerMessages }: FormMessageBannerProps): React.JSX.Element;
6
7
  export {};
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import type { FormSaveButtonProps } from "../../types";
2
- export declare function FormSaveButton({ primaryAction, loading, label, secondaryActions, setSecondaryActionLoading, onOpenBottomSheet, onCloseBottomSheet, }: FormSaveButtonProps): JSX.Element;
3
+ export declare function FormSaveButton({ primaryAction, loading, label, secondaryActions, setSecondaryActionLoading, onOpenBottomSheet, onCloseBottomSheet, }: FormSaveButtonProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import type { AtlantisFormContextProps } from "./types";
2
2
  export declare const atlantisFormContextDefaultValues: {
3
- useConfirmBeforeBack: () => import("react").MutableRefObject<() => undefined>;
3
+ useConfirmBeforeBack: () => import("react").RefObject<() => undefined>;
4
4
  useInternalFormLocalCache: () => {
5
5
  setLocalCache: () => undefined;
6
6
  removeLocalCache: () => undefined;
@@ -1,4 +1,4 @@
1
- import type { MutableRefObject } from "react";
1
+ import type { RefObject } from "react";
2
2
  import type { DeepPartial, FieldValues, UseFormReturn } from "react-hook-form";
3
3
  export interface UseConfirmBeforeBackProps {
4
4
  alwaysPreventBack: boolean;
@@ -16,7 +16,7 @@ interface LocalCacheOptions {
16
16
  readonly id?: string | string[];
17
17
  }
18
18
  export interface AtlantisFormContextProps {
19
- useConfirmBeforeBack: (props: UseConfirmBeforeBackProps) => MutableRefObject<() => void>;
19
+ useConfirmBeforeBack: (props: UseConfirmBeforeBackProps) => RefObject<() => void>;
20
20
  useInternalFormLocalCache: <TData extends FieldValues>(formMethods: UseFormReturn<TData>, cacheKey?: string, options?: LocalCacheOptions) => {
21
21
  setLocalCache: (data: DeepPartial<TData>) => void;
22
22
  removeLocalCache: () => void;
@@ -2,8 +2,8 @@ import type { RefObject } from "react";
2
2
  import type { View } from "react-native";
3
3
  import type { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
4
4
  interface UseFormViewRefsReturn {
5
- readonly scrollViewRef: RefObject<KeyboardAwareScrollView>;
6
- readonly bottomViewRef: RefObject<View>;
5
+ readonly scrollViewRef: RefObject<KeyboardAwareScrollView | null>;
6
+ readonly bottomViewRef: RefObject<View | null>;
7
7
  readonly scrollToTop: () => void;
8
8
  }
9
9
  export declare function useFormViewRefs(): UseFormViewRefsReturn;
@@ -1,9 +1,9 @@
1
1
  import type { DeepPartial, FieldValues, UseFormHandleSubmit, UseFormReturn } from "react-hook-form";
2
- import type { MutableRefObject, RefObject } from "react";
2
+ import type { RefObject } from "react";
3
3
  import type { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
4
4
  import type { InternalFormProps } from "../types";
5
- type UseInternalFormProps<T extends FieldValues, SubmitResponseType> = Pick<InternalFormProps<T, SubmitResponseType>, "mode" | "reValidateMode" | "initialValues" | "formRef" | "localCacheKey" | "localCacheExclude" | "localCacheId"> & {
6
- scrollViewRef?: RefObject<KeyboardAwareScrollView>;
5
+ type UseInternalFormProps<T extends FieldValues, SubmitResponseType> = Pick<InternalFormProps<T, SubmitResponseType>, "mode" | "reValidateMode" | "initialValues" | "formRef" | "localCacheKey" | "localCacheExclude" | "localCacheId" | "UNSAFE_allowDiscardLocalCacheWhenOffline"> & {
6
+ scrollViewRef?: RefObject<KeyboardAwareScrollView | null>;
7
7
  readonly saveButtonHeight: number;
8
8
  readonly messageBannerHeight: number;
9
9
  };
@@ -12,8 +12,8 @@ interface UseInternalForm<T extends FieldValues> {
12
12
  readonly handleSubmit: UseFormHandleSubmit<T>;
13
13
  readonly isSubmitting: boolean;
14
14
  readonly isDirty: boolean;
15
- readonly removeListenerRef: MutableRefObject<() => void>;
15
+ readonly removeListenerRef: RefObject<() => void>;
16
16
  readonly setLocalCache: (data: DeepPartial<T>) => void;
17
17
  }
18
- export declare function useInternalForm<T extends FieldValues, SubmitResponseType>({ mode, reValidateMode, initialValues, formRef, localCacheKey, localCacheId, scrollViewRef, saveButtonHeight, messageBannerHeight, }: UseInternalFormProps<T, SubmitResponseType>): UseInternalForm<T>;
18
+ export declare function useInternalForm<T extends FieldValues, SubmitResponseType>({ mode, reValidateMode, initialValues, formRef, localCacheKey, localCacheId, scrollViewRef, saveButtonHeight, messageBannerHeight, UNSAFE_allowDiscardLocalCacheWhenOffline, }: UseInternalFormProps<T, SubmitResponseType>): UseInternalForm<T>;
19
19
  export {};
@@ -1,4 +1,4 @@
1
- import type { MutableRefObject, RefObject } from "react";
1
+ import type { ReactElement, RefObject } from "react";
2
2
  import type { ControllerProps, DefaultValues, FieldPath, FieldValues, Mode, UseFormReturn } from "react-hook-form";
3
3
  import type { IconNames } from "@jobber/design";
4
4
  import type { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
@@ -37,7 +37,7 @@ interface FormNoticeMessage {
37
37
  message: string;
38
38
  }
39
39
  export type FormRef<T extends FieldValues = FieldValues> = (UseFormReturn<T> & {
40
- scrollViewRef?: RefObject<KeyboardAwareScrollView>;
40
+ scrollViewRef?: RefObject<KeyboardAwareScrollView | null>;
41
41
  saveButtonHeight?: number;
42
42
  messageBannerHeight?: number;
43
43
  }) | undefined;
@@ -97,7 +97,7 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
97
97
  /**
98
98
  * ref object to access react hook form methods and state
99
99
  */
100
- formRef?: MutableRefObject<FormRef<T> | undefined>;
100
+ formRef?: RefObject<FormRef<T> | undefined>;
101
101
  /**
102
102
  * Label to be displayed for the save button
103
103
  */
@@ -106,7 +106,7 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
106
106
  * @deprecated use `secondaryAction` instead.
107
107
  * Override default save button in the sticky section of the form with another element.
108
108
  */
109
- renderStickySection?: (onSubmit: () => void, label: string | undefined, isSubmitting: boolean) => JSX.Element;
109
+ renderStickySection?: (onSubmit: () => void, label: string | undefined, isSubmitting: boolean) => ReactElement;
110
110
  /**
111
111
  * Adding a key will save a local copy of the form data that will be used to
112
112
  * recover values when the app is backgrounded or has crashed.
@@ -131,6 +131,12 @@ export interface FormProps<T extends FieldValues, SubmitResponseType> {
131
131
  * If a user opens the same form the data will only be loaded if the `localCacheId` matches
132
132
  */
133
133
  localCacheId?: string | string[];
134
+ /**
135
+ * If true, the local cache will be removed when the user navigates away from
136
+ * the dirty form even when offline. By default, cache is only removed on back when online.
137
+ * Defaults to false.
138
+ */
139
+ UNSAFE_allowDiscardLocalCacheWhenOffline?: boolean;
134
140
  /**
135
141
  * Secondary Action for ButtonGroup
136
142
  */
@@ -20,5 +20,5 @@ interface FormFieldProps<T> {
20
20
  */
21
21
  readonly validations?: RegisterOptions;
22
22
  }
23
- export declare function FormField<T>({ name, children, defaultValue: value, validations, }: FormFieldProps<T>): JSX.Element;
23
+ export declare function FormField<T>({ name, children, defaultValue: value, validations, }: FormFieldProps<T>): React.JSX.Element;
24
24
  export {};
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import type { BottomSheetOptionsSuffix } from "./components/FormatFileBottomSheet";
2
3
  import type { CreateThumbnail, File, FileUpload, FormattedFile } from "./types";
3
4
  export interface FormatFileProps<T> {
@@ -43,4 +44,4 @@ export interface FormatFileProps<T> {
43
44
  readonly showFileTypeIndicator?: boolean;
44
45
  readonly createThumbnail?: CreateThumbnail;
45
46
  }
46
- export declare function FormatFile<T extends File | FileUpload>({ file, accessibilityLabel, accessibilityHint, onTap, onRemove, bottomSheetOptionsSuffix, styleInGrid, testID, showFileTypeIndicator, createThumbnail, onPreviewPress, }: FormatFileProps<T>): JSX.Element;
47
+ export declare function FormatFile<T extends File | FileUpload>({ file, accessibilityLabel, accessibilityHint, onTap, onRemove, bottomSheetOptionsSuffix, styleInGrid, testID, showFileTypeIndicator, createThumbnail, onPreviewPress, }: FormatFileProps<T>): React.JSX.Element;