@jobber/components-native 0.85.1-JOB-136074-0fe613a.28 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,4 +12,7 @@ export declare const useStyles: () => {
12
12
  notice: {
13
13
  backgroundColor: string;
14
14
  };
15
+ success: {
16
+ backgroundColor: string;
17
+ };
15
18
  };
@@ -1,7 +1,7 @@
1
1
  import type { IconNames } from "@jobber/design";
2
2
  import type { ReactElement } from "react";
3
3
  import type { StyleProp, ViewStyle } from "react-native";
4
- export type BannerTypes = "error" | "warning" | "notice";
4
+ export type BannerTypes = "error" | "warning" | "notice" | "success";
5
5
  export interface BannerStyleProps {
6
6
  /**
7
7
  * Styles applied to the main view of the banner. Styles are grabbed from Banner.style.ts file
@@ -23,6 +23,7 @@ export declare const useStyles: () => {
23
23
  right: number;
24
24
  bottom: number;
25
25
  left: number;
26
+ zIndex: number;
26
27
  };
27
28
  miniLabel: {
28
29
  top: number;
@@ -30,7 +31,6 @@ export declare const useStyles: () => {
30
31
  backgroundColor: string;
31
32
  marginRight: number;
32
33
  maxHeight: number;
33
- zIndex: number;
34
34
  };
35
35
  miniLabelShowClearAction: {
36
36
  backgroundColor: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.85.1-JOB-136074-0fe613a.28+0fe613a84",
3
+ "version": "0.86.0",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -86,7 +86,6 @@
86
86
  "react": "^18.2.0",
87
87
  "react-intl": "^6.4.2",
88
88
  "react-native": ">=0.76.0",
89
- "react-native-build-config": "^0.3.2",
90
89
  "react-native-gesture-handler": ">=2.10.0",
91
90
  "react-native-keyboard-aware-scroll-view": "^0.9.5",
92
91
  "react-native-modal-datetime-picker": " >=13.0.0",
@@ -96,10 +95,5 @@
96
95
  "react-native-safe-area-context": "^5.4.0",
97
96
  "react-native-svg": ">=12.0.0"
98
97
  },
99
- "peerDependenciesMeta": {
100
- "react-native-build-config": {
101
- "optional": true
102
- }
103
- },
104
- "gitHead": "0fe613a84c9d804a249c128d7cd35ea5a6cbda38"
98
+ "gitHead": "712019a3de148ba8511e117278495ced049f331f"
105
99
  }
@@ -35,6 +35,18 @@ describe("Banner", () => {
35
35
  expect(getByText("Notice me")).toBeDefined();
36
36
  expect(icon.props.children.props.name).toBe("starburst");
37
37
  });
38
+
39
+ it("renders a success Banner", () => {
40
+ const { getByText, getByTestId } = render(
41
+ <Banner type="success">
42
+ <Text>Your import is complete</Text>
43
+ </Banner>,
44
+ );
45
+
46
+ const icon = getByTestId("ATL-Banner-Icon");
47
+ expect(getByText("Your import is complete")).toBeDefined();
48
+ expect(icon.props.children.props.name).toBe("checkmark");
49
+ });
38
50
  });
39
51
 
40
52
  describe("Children", () => {
@@ -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
  });
@@ -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
  /**
package/src/Form/Form.tsx CHANGED
@@ -26,7 +26,6 @@ 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 { isEdgeToEdgeEnabled } from "../utils/buildConfig/isEdgeToEdgeEnabled";
30
29
  import { InputAccessoriesProvider } from "../InputText";
31
30
  import { tokens } from "../utils/design";
32
31
  import { ErrorMessageProvider } from "../ErrorMessageWrapper";
@@ -135,9 +134,6 @@ function InternalForm<T extends FieldValues, S>({
135
134
 
136
135
  const styles = useStyles();
137
136
 
138
- // Check if edge-to-edge is enabled using utility function
139
- const edgeToEdgeEnabled = isEdgeToEdgeEnabled();
140
-
141
137
  return (
142
138
  <FormProvider {...formMethods}>
143
139
  <>
@@ -165,7 +161,6 @@ function InternalForm<T extends FieldValues, S>({
165
161
  <KeyboardAwareScrollView
166
162
  enableResetScrollToCoords={false}
167
163
  enableAutomaticScroll={true}
168
- enableOnAndroid={edgeToEdgeEnabled}
169
164
  keyboardOpeningTime={
170
165
  Platform.OS === "ios" ? tokens["timing-slowest"] : 0
171
166
  }
@@ -173,7 +168,6 @@ function InternalForm<T extends FieldValues, S>({
173
168
  ref={scrollViewRef}
174
169
  {...keyboardProps}
175
170
  extraHeight={headerHeight}
176
- extraScrollHeight={edgeToEdgeEnabled ? 20 : 0}
177
171
  contentContainerStyle={
178
172
  !keyboardHeight && styles.scrollContentContainer
179
173
  }
@@ -43,6 +43,7 @@ export const useStyles = buildThemedStyles(tokens => {
43
43
  right: 0,
44
44
  bottom: 0,
45
45
  left: 0,
46
+ zIndex: 1,
46
47
  },
47
48
 
48
49
  miniLabel: {
@@ -53,7 +54,6 @@ export const useStyles = buildThemedStyles(tokens => {
53
54
  maxHeight:
54
55
  (typographyStyles.defaultSize.lineHeight || 0) +
55
56
  tokens["space-smaller"],
56
- zIndex: 1,
57
57
  },
58
58
  // Prevents the miniLabel from cutting off the ClearAction button
59
59
  miniLabelShowClearAction: {
@@ -1,18 +0,0 @@
1
- import { Platform } from "react-native";
2
- function loadBuildConfig() {
3
- var _a;
4
- try {
5
- // eslint-disable-next-line @typescript-eslint/no-var-requires
6
- const mod = require("react-native-build-config");
7
- return ((_a = mod === null || mod === void 0 ? void 0 : mod.default) !== null && _a !== void 0 ? _a : mod);
8
- }
9
- catch (_b) {
10
- return null; // module not installed or not linked
11
- }
12
- }
13
- export function isEdgeToEdgeEnabled() {
14
- if (Platform.OS !== "android")
15
- return false;
16
- const cfg = loadBuildConfig();
17
- return !!(cfg === null || cfg === void 0 ? void 0 : cfg.IS_EDGE_TO_EDGE_ENABLED);
18
- }
@@ -1 +0,0 @@
1
- export declare function isEdgeToEdgeEnabled(): boolean;
@@ -1,7 +0,0 @@
1
- declare module "react-native-build-config" {
2
- const BuildConfig: {
3
- IS_EDGE_TO_EDGE_ENABLED?: boolean;
4
- [k: string]: unknown;
5
- };
6
- export = BuildConfig;
7
- }
@@ -1,21 +0,0 @@
1
- import { Platform } from "react-native";
2
-
3
- type BuildCfg = { IS_EDGE_TO_EDGE_ENABLED?: boolean } | undefined | null;
4
-
5
- function loadBuildConfig(): BuildCfg {
6
- try {
7
- // eslint-disable-next-line @typescript-eslint/no-var-requires
8
- const mod = require("react-native-build-config");
9
-
10
- return (mod?.default ?? mod) as BuildCfg;
11
- } catch {
12
- return null; // module not installed or not linked
13
- }
14
- }
15
-
16
- export function isEdgeToEdgeEnabled(): boolean {
17
- if (Platform.OS !== "android") return false;
18
- const cfg = loadBuildConfig();
19
-
20
- return !!cfg?.IS_EDGE_TO_EDGE_ENABLED;
21
- }