@jobber/components-native 0.88.1 → 0.89.1-JOB-139857-8c5bc05.6

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.
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import React from "react";
3
- import { Modalize } from "react-native-modalize";
3
+ import type { Modalize } from "react-native-modalize";
4
4
  export interface BottomSheetProps {
5
5
  readonly children: ReactNode;
6
6
  /**
@@ -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>>;
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>>;
@@ -5,6 +5,7 @@ export declare const atlantisFormContextDefaultValues: {
5
5
  setLocalCache: () => undefined;
6
6
  removeLocalCache: () => undefined;
7
7
  };
8
+ edgeToEdgeEnabled: boolean;
8
9
  };
9
10
  export declare const AtlantisFormContext: import("react").Context<AtlantisFormContextProps>;
10
11
  export declare function useAtlantisFormContext(): AtlantisFormContextProps;
@@ -21,5 +21,6 @@ export interface AtlantisFormContextProps {
21
21
  setLocalCache: (data: DeepPartial<TData>) => void;
22
22
  removeLocalCache: () => void;
23
23
  };
24
+ edgeToEdgeEnabled?: boolean;
24
25
  }
25
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.88.1",
3
+ "version": "0.89.1-JOB-139857-8c5bc05.6+8c5bc0598",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -94,5 +94,5 @@
94
94
  "react-native-safe-area-context": "^5.4.0",
95
95
  "react-native-svg": ">=12.0.0"
96
96
  },
97
- "gitHead": "02b60328dca8a6166794f853db3219e7b3f9bca1"
97
+ "gitHead": "8c5bc059898a016ab5b77d38f44c1b6818bc0416"
98
98
  }
@@ -1,10 +1,11 @@
1
1
  import type { ReactNode, Ref, RefObject } from "react";
2
2
  import React, { forwardRef, useState } from "react";
3
- import { Modalize } from "react-native-modalize";
3
+ import type { Modalize } from "react-native-modalize";
4
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
5
5
  import { Keyboard, View } from "react-native";
6
6
  import { BottomSheetOption } from "./components/BottomSheetOption";
7
7
  import { useStyles } from "./BottomSheet.style";
8
+ import { UNSAFE_WrappedModalize } from "../ContentOverlay/UNSAFE_WrappedModalize";
8
9
  import { useIsScreenReaderEnabled } from "../hooks";
9
10
  import { Divider } from "../Divider";
10
11
  import { Heading } from "../Heading";
@@ -61,7 +62,7 @@ function BottomSheetInternal(
61
62
  return (
62
63
  <>
63
64
  {open && <Overlay styles={styles} />}
64
- <Modalize
65
+ <UNSAFE_WrappedModalize
65
66
  ref={ref}
66
67
  adjustToContentHeight={true}
67
68
  modalStyle={styles.modal}
@@ -90,7 +91,7 @@ function BottomSheetInternal(
90
91
  >
91
92
  {children}
92
93
  </View>
93
- </Modalize>
94
+ </UNSAFE_WrappedModalize>
94
95
  </>
95
96
  );
96
97
 
@@ -9,7 +9,7 @@ import type { IHandles } from "react-native-modalize/lib/options";
9
9
 
10
10
  type Props = React.ComponentProps<typeof Modalize>;
11
11
 
12
- export const UNSAFE_WrappedModalize = forwardRef<IHandles, Props>(
12
+ export const UNSAFE_WrappedModalize = forwardRef<IHandles | undefined, Props>(
13
13
  (props, ref) => {
14
14
  const innerRef = useRef<IHandles | null>(null);
15
15
  const [openRenderId, setOpenRenderId] = useState(0);
package/src/Form/Form.tsx CHANGED
@@ -26,6 +26,7 @@ import { useScrollToError } from "./hooks/useScrollToError";
26
26
  import { FormSaveButton } from "./components/FormSaveButton";
27
27
  import { useSaveButtonPosition } from "./hooks/useSaveButtonPosition";
28
28
  import { FormCache } from "./components/FormCache/FormCache";
29
+ import { useAtlantisFormContext } from "./context/AtlantisFormContext";
29
30
  import { InputAccessoriesProvider } from "../InputText";
30
31
  import { tokens } from "../utils/design";
31
32
  import { ErrorMessageProvider } from "../ErrorMessageWrapper";
@@ -134,6 +135,8 @@ function InternalForm<T extends FieldValues, S>({
134
135
 
135
136
  const styles = useStyles();
136
137
 
138
+ const { edgeToEdgeEnabled } = useAtlantisFormContext();
139
+
137
140
  return (
138
141
  <FormProvider {...formMethods}>
139
142
  <>
@@ -161,6 +164,7 @@ function InternalForm<T extends FieldValues, S>({
161
164
  <KeyboardAwareScrollView
162
165
  enableResetScrollToCoords={false}
163
166
  enableAutomaticScroll={true}
167
+ enableOnAndroid={edgeToEdgeEnabled}
164
168
  keyboardOpeningTime={
165
169
  Platform.OS === "ios" ? tokens["timing-slowest"] : 0
166
170
  }
@@ -168,6 +172,7 @@ function InternalForm<T extends FieldValues, S>({
168
172
  ref={scrollViewRef}
169
173
  {...keyboardProps}
170
174
  extraHeight={headerHeight}
175
+ extraScrollHeight={edgeToEdgeEnabled ? tokens["space-large"] : 0}
171
176
  contentContainerStyle={
172
177
  !keyboardHeight && styles.scrollContentContainer
173
178
  }
@@ -11,6 +11,7 @@ export const atlantisFormContextDefaultValues = {
11
11
  setLocalCache: () => undefined,
12
12
  removeLocalCache: () => undefined,
13
13
  }),
14
+ edgeToEdgeEnabled: false,
14
15
  };
15
16
 
16
17
  export const AtlantisFormContext = createContext<AtlantisFormContextProps>(
@@ -30,4 +30,5 @@ export interface AtlantisFormContextProps {
30
30
  setLocalCache: (data: DeepPartial<TData>) => void;
31
31
  removeLocalCache: () => void;
32
32
  };
33
+ edgeToEdgeEnabled?: boolean;
33
34
  }