@jobber/components-native 0.69.3-SCOTTTHd.31 → 0.69.3-SCOTTTHd.48
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.
- package/dist/package.json +2 -2
- package/dist/src/Icon/Icon.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Button/Button.test.tsx +8 -8
- package/src/Icon/Icon.tsx +4 -2
- package/src/Icon/__snapshots__/Icon.test.tsx.snap +10 -16
- package/src/Menu/Menu.test.tsx +8 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.69.3-SCOTTTHd.
|
|
3
|
+
"version": "0.69.3-SCOTTTHd.48+a0b5bb3c",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"react-native-safe-area-context": "^4.5.2",
|
|
83
83
|
"react-native-svg": ">=12.0.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "a0b5bb3ca4c74c2d2bb86edae9e34e2b3482b364"
|
|
86
86
|
}
|
|
@@ -209,8 +209,8 @@ describe("Button", () => {
|
|
|
209
209
|
it("renders an icon Button with same color as the Button text", () => {
|
|
210
210
|
const { iconColor, textColor } = getIconAndTextColorFromRender({});
|
|
211
211
|
|
|
212
|
-
expect(iconColor).toBe("
|
|
213
|
-
expect(textColor).toBe(
|
|
212
|
+
expect(iconColor).toBe(tokens["color-white"]);
|
|
213
|
+
expect(textColor).toBe(iconColor);
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
it("renders the learning variation and secondary type with icon and label with the same color", () => {
|
|
@@ -218,8 +218,8 @@ describe("Button", () => {
|
|
|
218
218
|
variation: "learning",
|
|
219
219
|
type: "secondary",
|
|
220
220
|
});
|
|
221
|
-
expect(iconColor).toBe("
|
|
222
|
-
expect(textColor).toBe(
|
|
221
|
+
expect(iconColor).toBe(tokens["color-interactive--subtle"]);
|
|
222
|
+
expect(textColor).toBe(iconColor);
|
|
223
223
|
});
|
|
224
224
|
|
|
225
225
|
it("renders the destructive variation and secondary type with icon and label with the same color", () => {
|
|
@@ -227,8 +227,8 @@ describe("Button", () => {
|
|
|
227
227
|
variation: "destructive",
|
|
228
228
|
type: "secondary",
|
|
229
229
|
});
|
|
230
|
-
expect(iconColor).toBe("
|
|
231
|
-
expect(textColor).toBe(
|
|
230
|
+
expect(iconColor).toBe(tokens["color-destructive"]);
|
|
231
|
+
expect(textColor).toBe(iconColor);
|
|
232
232
|
});
|
|
233
233
|
|
|
234
234
|
it("renders the cancel variation and tertiary type with icon and label with the same color", () => {
|
|
@@ -236,8 +236,8 @@ describe("Button", () => {
|
|
|
236
236
|
variation: "cancel",
|
|
237
237
|
type: "tertiary",
|
|
238
238
|
});
|
|
239
|
-
expect(iconColor).toBe("
|
|
240
|
-
expect(textColor).toBe(
|
|
239
|
+
expect(iconColor).toBe(tokens["color-interactive--subtle"]);
|
|
240
|
+
expect(textColor).toBe(iconColor);
|
|
241
241
|
});
|
|
242
242
|
|
|
243
243
|
it("renders an icon Button if only an icon is passed", () => {
|
package/src/Icon/Icon.tsx
CHANGED
|
@@ -37,14 +37,16 @@ export function Icon({
|
|
|
37
37
|
customColor,
|
|
38
38
|
testID,
|
|
39
39
|
}: IconProps): JSX.Element {
|
|
40
|
-
const { svgStyle,
|
|
40
|
+
const { svgStyle, paths, viewBox } = getIcon({
|
|
41
41
|
name,
|
|
42
42
|
color,
|
|
43
43
|
size,
|
|
44
|
+
platform: "mobile",
|
|
44
45
|
format: "js",
|
|
45
46
|
});
|
|
47
|
+
|
|
46
48
|
const icon = paths.map((path: string) => {
|
|
47
|
-
return <Path key={path} d={path} fill={customColor ||
|
|
49
|
+
return <Path key={path} d={path} fill={customColor || svgStyle.fill} />;
|
|
48
50
|
});
|
|
49
51
|
|
|
50
52
|
return (
|
|
@@ -50,7 +50,7 @@ exports[`renders apple icon 1`] = `
|
|
|
50
50
|
d="M18.467 12.754c-.027-2.996 2.453-4.453 2.566-4.52-1.404-2.048-3.581-2.328-4.346-2.35-1.828-.193-3.601 1.094-4.533 1.094-.95 0-2.384-1.076-3.93-1.044-1.988.03-3.849 1.182-4.87 2.97C1.25 12.55 2.82 17.91 4.838 20.856c1.01 1.443 2.189 3.055 3.733 2.998 1.51-.062 2.074-.963 3.897-.963 1.806 0 2.335.963 3.91.927 1.62-.026 2.641-1.45 3.615-2.907 1.166-1.654 1.635-3.283 1.653-3.367-.038-.013-3.147-1.2-3.178-4.79Zm-2.974-8.81c.812-1.015 1.368-2.397 1.213-3.8-1.175.053-2.646.814-3.492 1.807-.75.876-1.418 2.31-1.246 3.66 1.321.099 2.677-.666 3.525-1.666Z"
|
|
51
51
|
fill={
|
|
52
52
|
{
|
|
53
|
-
"payload":
|
|
53
|
+
"payload": 4280499528,
|
|
54
54
|
"type": 0,
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -114,7 +114,7 @@ exports[`renders home icon 1`] = `
|
|
|
114
114
|
d="M13.147 3.582a2 2 0 0 0-2.294 0l-9.426 6.599a1 1 0 1 0 1.147 1.638L5 10.121V18a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3v-7.88l2.427 1.7a1 1 0 0 0 1.146-1.64l-9.426-6.598ZM17 8.721V18a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V8.72l5-3.5 5 3.5Z"
|
|
115
115
|
fill={
|
|
116
116
|
{
|
|
117
|
-
"payload":
|
|
117
|
+
"payload": 4280499528,
|
|
118
118
|
"type": 0,
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -178,7 +178,7 @@ exports[`renders large arrowDown icon 1`] = `
|
|
|
178
178
|
d="M7.703 8.291a.996.996 0 0 0-1.41.001.994.994 0 0 0 0 1.41l5 5.005a.998.998 0 0 0 1.415 0l5-5a.994.994 0 0 0 0-1.41.995.995 0 0 0-1.411-.001L12 12.584 7.703 8.291Z"
|
|
179
179
|
fill={
|
|
180
180
|
{
|
|
181
|
-
"payload":
|
|
181
|
+
"payload": 4280499528,
|
|
182
182
|
"type": 0,
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -320,7 +320,7 @@ exports[`renders small more icon 1`] = `
|
|
|
320
320
|
d="M4 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm6 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm8-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z"
|
|
321
321
|
fill={
|
|
322
322
|
{
|
|
323
|
-
"payload":
|
|
323
|
+
"payload": 4280499528,
|
|
324
324
|
"type": 0,
|
|
325
325
|
}
|
|
326
326
|
}
|
|
@@ -417,7 +417,11 @@ exports[`renders thumbsDown icon 1`] = `
|
|
|
417
417
|
"display": "flex",
|
|
418
418
|
"fill": "hsl(198, 35%, 21%)",
|
|
419
419
|
"height": 24,
|
|
420
|
-
"transform":
|
|
420
|
+
"transform": [
|
|
421
|
+
{
|
|
422
|
+
"scaleY": -1,
|
|
423
|
+
},
|
|
424
|
+
],
|
|
421
425
|
"verticalAlign": "middle",
|
|
422
426
|
"width": 24,
|
|
423
427
|
},
|
|
@@ -439,16 +443,6 @@ exports[`renders thumbsDown icon 1`] = `
|
|
|
439
443
|
"type": 0,
|
|
440
444
|
}
|
|
441
445
|
}
|
|
442
|
-
matrix={
|
|
443
|
-
[
|
|
444
|
-
1,
|
|
445
|
-
0,
|
|
446
|
-
0,
|
|
447
|
-
1,
|
|
448
|
-
0,
|
|
449
|
-
0,
|
|
450
|
-
]
|
|
451
|
-
}
|
|
452
446
|
propList={
|
|
453
447
|
[
|
|
454
448
|
"fill",
|
|
@@ -459,7 +453,7 @@ exports[`renders thumbsDown icon 1`] = `
|
|
|
459
453
|
d="M8 11.78V19h8l3-5.76v-1.29h-7.639l1.036-7.944L8 11.78ZM6.134 11l4.555-8.034c1.124-1.846 3.971-.844 3.691 1.299l-.74 5.685h6.86a.5.5 0 0 1 .5.5v3a1 1 0 0 1-.084.4l-3.276 6.648a.95.95 0 0 1-.44.453c-.132.065-.276.049-.423.049H4c-1.105 0-2-1.045-2-2.15V13a2 2 0 0 1 2-2h2.134ZM6 13H4v6h2v-6Z"
|
|
460
454
|
fill={
|
|
461
455
|
{
|
|
462
|
-
"payload":
|
|
456
|
+
"payload": 4280499528,
|
|
463
457
|
"type": 0,
|
|
464
458
|
}
|
|
465
459
|
}
|
package/src/Menu/Menu.test.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { fireEvent, render } from "@testing-library/react-native";
|
|
3
3
|
import { Host } from "react-native-portalize";
|
|
4
4
|
import { View } from "react-native";
|
|
5
|
+
import { tokens } from "@jobber/design/foundation";
|
|
5
6
|
import { Menu, MenuOptionProps, MenuProps } from ".";
|
|
6
7
|
import { Icon } from "../Icon";
|
|
7
8
|
import { Button } from "../Button";
|
|
@@ -129,17 +130,13 @@ describe("Menu", () => {
|
|
|
129
130
|
});
|
|
130
131
|
|
|
131
132
|
fireEvent.press(getByLabelText(menuLabel));
|
|
132
|
-
expect(getByTestId("add").props.style).
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
width: 24,
|
|
140
|
-
},
|
|
141
|
-
{ flex: 0, height: 24, width: 24 },
|
|
142
|
-
]);
|
|
133
|
+
expect(getByTestId("add").props.style).toContainEqual({
|
|
134
|
+
display: "flex",
|
|
135
|
+
fill: tokens["color-critical"],
|
|
136
|
+
height: 24,
|
|
137
|
+
verticalAlign: "middle",
|
|
138
|
+
width: 24,
|
|
139
|
+
});
|
|
143
140
|
});
|
|
144
141
|
|
|
145
142
|
it("closes the menu after clicking on a menu option", () => {
|