@multiplatform.one/theme 7.74.0 → 7.75.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/theme",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.75.0",
|
|
4
4
|
"description": "Tamagui theme system for multiplatform.one",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multiplatform",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@multiplatform.one/platform": "^7.
|
|
76
|
-
"@multiplatform.one/store": "^7.
|
|
75
|
+
"@multiplatform.one/platform": "^7.75.0",
|
|
76
|
+
"@multiplatform.one/store": "^7.75.0",
|
|
77
77
|
"@tamagui/animations-react-native": "2.7.6",
|
|
78
78
|
"@tamagui/colors": "2.7.6",
|
|
79
79
|
"@tamagui/config": "2.7.6",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@expo/prebuild-config": "55.0.18",
|
|
92
|
-
"@multiplatform.one/config": "7.
|
|
93
|
-
"@multiplatform.one/test-utils": "7.
|
|
92
|
+
"@multiplatform.one/config": "7.75.0",
|
|
93
|
+
"@multiplatform.one/test-utils": "7.75.0",
|
|
94
94
|
"@tamagui/animations-css": "2.7.6",
|
|
95
95
|
"@tamagui/animations-reanimated": "2.7.6",
|
|
96
96
|
"@tamagui/font-inter": "2.7.6",
|
|
@@ -85,4 +85,18 @@ describe("IconSlot", () => {
|
|
|
85
85
|
);
|
|
86
86
|
expect(screen.getByTestId("icon").dataset.color).toBe("currentColor");
|
|
87
87
|
});
|
|
88
|
+
|
|
89
|
+
it("FZ-8439: a bold glyph's currentColor outline takes the glyph's ink on native", () => {
|
|
90
|
+
function Stroked({ color, stroke }: { color?: string; stroke?: string }) {
|
|
91
|
+
return <span data-testid="stroked" data-color={color} data-stroke={stroke} />;
|
|
92
|
+
}
|
|
93
|
+
render(
|
|
94
|
+
<TamaguiProvider config={config.tamagui} defaultTheme="light" disableInjectCSS>
|
|
95
|
+
<IconSlot icon={<Stroked stroke="currentColor" />} color="#ffffff" />
|
|
96
|
+
</TamaguiProvider>,
|
|
97
|
+
);
|
|
98
|
+
const glyph = screen.getByTestId("stroked");
|
|
99
|
+
expect(glyph.getAttribute("data-stroke")).toBe(glyph.getAttribute("data-color"));
|
|
100
|
+
expect(glyph.getAttribute("data-stroke")).not.toBe("currentColor");
|
|
101
|
+
});
|
|
88
102
|
});
|
package/src/theme/IconSlot.tsx
CHANGED
|
@@ -28,12 +28,22 @@ export function IconSlot({
|
|
|
28
28
|
value && value !== "currentColor" ? value : color === "currentColor" ? undefined : color,
|
|
29
29
|
);
|
|
30
30
|
const render = (value: IconSlotValue): ReactNode => {
|
|
31
|
-
if (
|
|
31
|
+
if (
|
|
32
|
+
isValidElement<{ color?: string; size?: number; stroke?: string; children?: ReactNode }>(
|
|
33
|
+
value,
|
|
34
|
+
)
|
|
35
|
+
) {
|
|
32
36
|
if (value.type === Fragment)
|
|
33
37
|
return cloneElement(value, {}, Children.map(value.props.children, render));
|
|
38
|
+
const glyphInk = isWeb ? undefined : ink(value.props.color);
|
|
34
39
|
return cloneElement(value, {
|
|
35
40
|
...(size == null || value.props.size != null ? {} : { size }),
|
|
36
|
-
...(
|
|
41
|
+
...(glyphInk === undefined ? {} : { color: glyphInk }),
|
|
42
|
+
// FZ-8439: react-native-svg resolves currentColor to black, so a bold
|
|
43
|
+
// glyph's outline stroke would ring its fill in black.
|
|
44
|
+
...(glyphInk !== undefined && value.props.stroke === "currentColor"
|
|
45
|
+
? { stroke: glyphInk }
|
|
46
|
+
: {}),
|
|
37
47
|
});
|
|
38
48
|
}
|
|
39
49
|
if (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconSlot.d.ts","sourceRoot":"","sources":["../../src/theme/IconSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,aAAa,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEzF,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,IAAI,GACL,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,
|
|
1
|
+
{"version":3,"file":"IconSlot.d.ts","sourceRoot":"","sources":["../../src/theme/IconSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,aAAa,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEzF,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,IAAI,GACL,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,aAsCA"}
|