@jobber/components-native 0.114.6 → 0.114.8

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.
@@ -285,25 +285,26 @@ export function IconSizesExample() {
285
285
 
286
286
  ### Messaging
287
287
 
288
- | Icon | `Name` |
289
- | :--- | :---------------- |
290
- | | `chat` |
291
- | | `compose` |
292
- | | `conversation` |
293
- | | `email` |
294
- | | `emailInbound` |
295
- | | `emailOutbound` |
296
- | | `markSent` |
297
- | | `marketing` |
298
- | | `reminder` |
299
- | | `sendMessage` |
300
- | | `sms` |
301
- | | `sms2` |
302
- | | `smsInbound` |
303
- | | `smsOutbound` |
304
- | | `smsProgress` |
305
- | | `webchat` |
306
- | | `webchatProgress` |
288
+ | Icon | `Name` |
289
+ | :--- | :---------------------- |
290
+ | | `chat` |
291
+ | | `compose` |
292
+ | | `conversation` |
293
+ | | `email` |
294
+ | | `emailInbound` |
295
+ | | `emailOutbound` |
296
+ | | `markSent` |
297
+ | | `marketing` |
298
+ | | `reminder` |
299
+ | | `sendMessage` |
300
+ | | `sms` |
301
+ | | `sms2` |
302
+ | | `smsInbound` |
303
+ | | `smsOutbound` |
304
+ | | `smsProgress` |
305
+ | | `snoozeRecommendations` |
306
+ | | `webchat` |
307
+ | | `webchatProgress` |
307
308
 
308
309
  ### User
309
310
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.114.6",
3
+ "version": "0.114.8",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -73,7 +73,7 @@
73
73
  "devDependencies": {
74
74
  "@babel/runtime": "^7.29.2",
75
75
  "@gorhom/bottom-sheet": "^5.2.8",
76
- "@jobber/design": "0.116.0",
76
+ "@jobber/design": "0.117.0",
77
77
  "@jobber/hooks": "2.21.1",
78
78
  "@react-native-community/datetimepicker": "^8.4.5",
79
79
  "@react-native/babel-preset": "^0.82.1",
@@ -123,5 +123,5 @@
123
123
  "react-native-screens": ">=4.18.0",
124
124
  "react-native-svg": ">=12.0.0"
125
125
  },
126
- "gitHead": "f21049fd61b5c1cd4b75e2e160da68bdb5999e56"
126
+ "gitHead": "849254e4ce108a25e35ab25eab411ab07dad69dd"
127
127
  }
@@ -1,13 +1,18 @@
1
1
  import { androidTokens, darkTokens, iosTokens } from "@jobber/design";
2
2
  import React, { createContext, useCallback, useContext, useState } from "react";
3
- import merge from "lodash/merge";
3
+ import mergeWith from "lodash/mergeWith";
4
4
  import { Platform, useColorScheme } from "react-native";
5
5
  const lightTokens = Platform.select({
6
6
  ios: () => iosTokens,
7
7
  android: () => androidTokens,
8
8
  default: () => androidTokens,
9
9
  })();
10
- const completeDarkTokens = merge({}, lightTokens, darkTokens);
10
+ const completeDarkTokens = mergeWith({}, lightTokens, darkTokens, (platformValue, darkValue) => {
11
+ const platformValueIsObject = typeof platformValue === "object" && platformValue !== null;
12
+ const darkValueIsObject = typeof darkValue === "object" && darkValue !== null;
13
+ if (platformValueIsObject && !darkValueIsObject)
14
+ return platformValue;
15
+ });
11
16
  const defaultAtlantisThemeContextValue = {
12
17
  theme: "light",
13
18
  effectiveTheme: "light",
@@ -21,7 +21,7 @@ jest.mock("react-native", () => {
21
21
  });
22
22
  return actual;
23
23
  });
24
- const expectedDarkTokens = merge({}, iosTokens, darkTokens);
24
+ const expectedDarkTokens = Object.assign(Object.assign({}, merge({}, iosTokens, darkTokens)), { "shadow-low": iosTokens["shadow-low"], "shadow-base": iosTokens["shadow-base"], "shadow-high": iosTokens["shadow-high"] });
25
25
  const expectedLightTokens = iosTokens;
26
26
  const mockUseColorScheme = useColorScheme;
27
27
  function Wrapper({ children, theme, onThemeChange, dangerouslyOverrideTheme, }) {
@@ -56,6 +56,14 @@ describe("ThemeContext", () => {
56
56
  expect(result.current.effectiveTheme).toBe("light");
57
57
  expect(result.current.tokens).toEqual(expectedLightTokens);
58
58
  }));
59
+ it.each(["shadow-low", "shadow-base", "shadow-high"])("keeps the platform-native %s token in dark mode", (shadowToken) => __awaiter(void 0, void 0, void 0, function* () {
60
+ const { result } = renderHook(useAtlantisTheme, {
61
+ wrapper: (props) => (React.createElement(Wrapper, Object.assign({}, props))),
62
+ });
63
+ yield act(() => __awaiter(void 0, void 0, void 0, function* () { return result.current.setTheme("dark"); }));
64
+ expect(result.current.tokens[shadowToken]).toEqual(iosTokens[shadowToken]);
65
+ expect(typeof result.current.tokens[shadowToken]).toBe("object");
66
+ }));
59
67
  it("resolves the system theme from the OS color scheme", () => __awaiter(void 0, void 0, void 0, function* () {
60
68
  mockUseColorScheme.mockReturnValue("dark");
61
69
  const { result, rerender } = renderHook(useAtlantisTheme, {