@jobber/components-native 0.91.3 → 0.92.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.
@@ -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;
@@ -1,5 +1,5 @@
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
5
  type UseInternalFormProps<T extends FieldValues, SubmitResponseType> = Pick<InternalFormProps<T, SubmitResponseType>, "mode" | "reValidateMode" | "initialValues" | "formRef" | "localCacheKey" | "localCacheExclude" | "localCacheId" | "UNSAFE_allowDiscardLocalCacheWhenOffline"> & {
@@ -12,7 +12,7 @@ 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
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>;
@@ -1,5 +1,5 @@
1
- import type { IconColorNames, IconNames } from "@jobber/design";
2
1
  import type { ReactElement } from "react";
2
+ import type { IconColorNames, IconNames } from "@jobber/design";
3
3
  import type { TextAlign } from "../Typography";
4
4
  export interface MenuOptionProps {
5
5
  readonly label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.91.3",
3
+ "version": "0.92.0",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@react-native-community/datetimepicker": "^8.4.5",
57
- "@react-native/babel-preset": "^0.81.1",
57
+ "@react-native/babel-preset": "^0.82.1",
58
58
  "@storybook/addon-a11y": "^9.1.2",
59
59
  "@storybook/react": "^9.1.2",
60
60
  "@storybook/react-native-web-vite": "^9.1.2",
@@ -66,14 +66,14 @@
66
66
  "@types/react-test-renderer": "19.1.0",
67
67
  "date-fns": "^2.30.0",
68
68
  "date-fns-tz": "^2.0.0",
69
- "react-native": "^0.81.4",
70
- "react-native-gesture-handler": "^2.28.0",
69
+ "react-native": "^0.82.1",
70
+ "react-native-gesture-handler": "^2.29.1",
71
71
  "react-native-modal-datetime-picker": "^18.0.0",
72
72
  "react-native-reanimated": "^3.7.1",
73
73
  "react-native-safe-area-context": "^5.4.0",
74
74
  "react-native-svg": "^15.1.0",
75
75
  "react-native-web": "^0.20.0",
76
- "react-test-renderer": "19.1.0",
76
+ "react-test-renderer": "^19.1.1",
77
77
  "storybook": "^9.1.2"
78
78
  },
79
79
  "peerDependencies": {
@@ -82,7 +82,7 @@
82
82
  "@react-native-community/datetimepicker": ">=6.7.0",
83
83
  "date-fns": "^2.30.0",
84
84
  "date-fns-tz": "^2.0.0",
85
- "react": "^18 || ^19.1.0",
85
+ "react": "^19",
86
86
  "react-intl": "^6 || ^7",
87
87
  "react-native": ">=0.79.5",
88
88
  "react-native-gesture-handler": ">=2.22.0",
@@ -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": "4b120bbb1789aa1b6b9a8eaf157be90d4ea15efc"
97
+ "gitHead": "1ca01305080db58e135d5224ab329a8df4ad92ff"
98
98
  }
@@ -12,7 +12,7 @@ export const useStyles = buildThemedStyles(tokens => {
12
12
  justifyContent: "center",
13
13
  marginHorizontal: tokens["space-smaller"],
14
14
  marginTop: tokens["space-small"],
15
- paddingHorizontal: tokens["space-small"],
15
+ paddingHorizontal: tokens["space-base"],
16
16
  },
17
17
  iconLeft: {
18
18
  marginHorizontal: tokens["space-smallest"],
package/src/Chip/Chip.tsx CHANGED
@@ -5,6 +5,7 @@ import type { IconNames } from "@jobber/design";
5
5
  import { useStyles } from "./Chip.style";
6
6
  import { Icon } from "../Icon";
7
7
  import { Typography } from "../Typography";
8
+ import type { AtlantisThemeContextValue } from "../AtlantisThemeContext";
8
9
  import { useAtlantisTheme } from "../AtlantisThemeContext";
9
10
 
10
11
  export type AccentType = "client" | "invoice" | "job" | "request" | "quote";
@@ -86,6 +87,7 @@ export function Chip({
86
87
  : tokens["color-interactive--background"],
87
88
  },
88
89
  isActive && { backgroundColor: accentColor },
90
+ getBorderStyle(inactiveBackgroundColor, tokens),
89
91
  ];
90
92
  const dismiss =
91
93
  (isActive || inactiveBackgroundColor === "surface") &&
@@ -96,7 +98,7 @@ export function Chip({
96
98
  iconCustomColor: iconColor,
97
99
  dismissColor: dismiss,
98
100
  };
99
- }, [accent, isActive, inactiveBackgroundColor]);
101
+ }, [accent, isActive, inactiveBackgroundColor, getBorderStyle, styles]);
100
102
 
101
103
  const accessibilityState = useMemo(() => {
102
104
  const checkableRoles = ["radio", "switch", "togglebutton", "checkbox"];
@@ -145,3 +147,19 @@ export function Chip({
145
147
  </Pressable>
146
148
  );
147
149
  }
150
+
151
+ function getBorderStyle(
152
+ inactiveBackgroundColor: "surface" | "background",
153
+ tokens: AtlantisThemeContextValue["tokens"],
154
+ ) {
155
+ let borderColor = "transparent";
156
+
157
+ if (inactiveBackgroundColor === "surface") {
158
+ borderColor = tokens["color-border"];
159
+ }
160
+
161
+ return {
162
+ borderColor,
163
+ borderWidth: tokens["border-base"],
164
+ };
165
+ }
@@ -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
 
4
4
  export interface UseConfirmBeforeBackProps {
@@ -21,7 +21,7 @@ interface LocalCacheOptions {
21
21
  export interface AtlantisFormContextProps {
22
22
  useConfirmBeforeBack: (
23
23
  props: UseConfirmBeforeBackProps,
24
- ) => MutableRefObject<() => void>;
24
+ ) => RefObject<() => void>;
25
25
  useInternalFormLocalCache: <TData extends FieldValues>(
26
26
  formMethods: UseFormReturn<TData>,
27
27
  cacheKey?: string,
@@ -5,7 +5,7 @@ import type {
5
5
  UseFormReturn,
6
6
  } from "react-hook-form";
7
7
  import { useForm } from "react-hook-form";
8
- import type { MutableRefObject, RefObject } from "react";
8
+ import type { RefObject } from "react";
9
9
  import type { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
10
10
  import { useAtlantisContext } from "../../AtlantisContext";
11
11
  import { useAtlantisFormContext } from "../context/AtlantisFormContext";
@@ -32,7 +32,7 @@ interface UseInternalForm<T extends FieldValues> {
32
32
  readonly handleSubmit: UseFormHandleSubmit<T>;
33
33
  readonly isSubmitting: boolean;
34
34
  readonly isDirty: boolean;
35
- readonly removeListenerRef: MutableRefObject<() => void>;
35
+ readonly removeListenerRef: RefObject<() => void>;
36
36
  readonly setLocalCache: (data: DeepPartial<T>) => void;
37
37
  }
38
38
 
package/src/Menu/types.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { IconColorNames, IconNames } from "@jobber/design";
2
1
  import type { ReactElement } from "react";
2
+ import type { IconColorNames, IconNames } from "@jobber/design";
3
3
  import type { TextAlign } from "../Typography";
4
4
 
5
5
  export interface MenuOptionProps {