@tamagui/react-native-web-lite 3.1.2 → 3.1.4
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.
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: () => from[key],
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var nativeColors_exports = {};
|
|
22
|
+
__export(nativeColors_exports, { getNativeColorFactories: () => getNativeColorFactories });
|
|
23
|
+
module.exports = __toCommonJS(nativeColors_exports);
|
|
24
|
+
function getNativeColorFactories(platform) {
|
|
25
|
+
return {
|
|
26
|
+
PlatformColor(...args) {
|
|
27
|
+
const last = args[args.length - 1];
|
|
28
|
+
const fallback = last && typeof last === "object" && typeof last.fallback === "string" ? last.fallback : void 0;
|
|
29
|
+
const names = args.filter((name) => typeof name === "string");
|
|
30
|
+
const color = platform === "android" ? { resource_paths: names } : { semantic: names };
|
|
31
|
+
return fallback === void 0 ? color : {
|
|
32
|
+
...color,
|
|
33
|
+
fallback
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
DynamicColorIOS(colors) {
|
|
37
|
+
if (platform === "android") {
|
|
38
|
+
throw new Error("DynamicColorIOS is not available on this platform.");
|
|
39
|
+
}
|
|
40
|
+
return { dynamic: {
|
|
41
|
+
light: colors.light,
|
|
42
|
+
dark: colors.dark,
|
|
43
|
+
highContrastLight: colors.highContrastLight,
|
|
44
|
+
highContrastDark: colors.highContrastDark
|
|
45
|
+
} };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function getNativeColorFactories(platform) {
|
|
2
|
+
return {
|
|
3
|
+
PlatformColor(...args) {
|
|
4
|
+
const last = args[args.length - 1];
|
|
5
|
+
const fallback = last && typeof last === "object" && typeof last.fallback === "string" ? last.fallback : void 0;
|
|
6
|
+
const names = args.filter((name) => typeof name === "string");
|
|
7
|
+
const color = platform === "android" ? { resource_paths: names } : { semantic: names };
|
|
8
|
+
return fallback === void 0 ? color : {
|
|
9
|
+
...color,
|
|
10
|
+
fallback
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
DynamicColorIOS(colors) {
|
|
14
|
+
if (platform === "android") {
|
|
15
|
+
throw new Error("DynamicColorIOS is not available on this platform.");
|
|
16
|
+
}
|
|
17
|
+
return { dynamic: {
|
|
18
|
+
light: colors.light,
|
|
19
|
+
dark: colors.dark,
|
|
20
|
+
highContrastLight: colors.highContrastLight,
|
|
21
|
+
highContrastDark: colors.highContrastDark
|
|
22
|
+
} };
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { getNativeColorFactories };
|
|
28
|
+
//# sourceMappingURL=nativeColors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeColors.js","names":[],"sources":["esm/nativeColors.js"],"sourcesContent":["function getNativeColorFactories(platform) {\n return {\n PlatformColor(...args) {\n const last = args[args.length - 1];\n const fallback = last && typeof last === \"object\" && typeof last.fallback === \"string\" ? last.fallback : void 0;\n const names = args.filter((name) => typeof name === \"string\");\n const color = platform === \"android\" ? { resource_paths: names } : { semantic: names };\n return fallback === void 0 ? color : { ...color, fallback };\n },\n DynamicColorIOS(colors) {\n if (platform === \"android\") {\n throw new Error(\"DynamicColorIOS is not available on this platform.\");\n }\n return {\n dynamic: {\n light: colors.light,\n dark: colors.dark,\n highContrastLight: colors.highContrastLight,\n highContrastDark: colors.highContrastDark\n }\n };\n }\n };\n}\nexport {\n getNativeColorFactories\n};\n//# sourceMappingURL=nativeColors.js.map\n"],"mappings":";AAAA,SAAS,wBAAwB,UAAU;CACzC,OAAO;EACL,cAAc,GAAG,MAAM;GACrB,MAAM,OAAO,KAAK,KAAK,SAAS;GAChC,MAAM,WAAW,QAAQ,OAAO,SAAS,YAAY,OAAO,KAAK,aAAa,WAAW,KAAK,WAAW,KAAK;GAC9G,MAAM,QAAQ,KAAK,QAAQ,SAAS,OAAO,SAAS,QAAQ;GAC5D,MAAM,QAAQ,aAAa,YAAY,EAAE,gBAAgB,MAAM,IAAI,EAAE,UAAU,MAAM;GACrF,OAAO,aAAa,KAAK,IAAI,QAAQ;IAAE,GAAG;IAAO;GAAS;EAC5D;EACA,gBAAgB,QAAQ;GACtB,IAAI,aAAa,WAAW;IAC1B,MAAM,IAAI,MAAM,oDAAoD;GACtE;GACA,OAAO,EACL,SAAS;IACP,OAAO,OAAO;IACd,MAAM,OAAO;IACb,mBAAmB,OAAO;IAC1B,kBAAkB,OAAO;GAC3B,EACF;EACF;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/react-native-web-lite",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "React Native for Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -93,6 +93,12 @@
|
|
|
93
93
|
"module": "./dist/esm/*/index.mjs",
|
|
94
94
|
"import": "./dist/esm/*/index.mjs",
|
|
95
95
|
"require": "./dist/cjs/*/index.cjs"
|
|
96
|
+
},
|
|
97
|
+
"./nativeColors": {
|
|
98
|
+
"types": "./types/nativeColors.d.ts",
|
|
99
|
+
"import": "./dist/esm/nativeColors.mjs",
|
|
100
|
+
"require": "./dist/cjs/nativeColors.cjs",
|
|
101
|
+
"default": "./dist/esm/nativeColors.mjs"
|
|
96
102
|
}
|
|
97
103
|
},
|
|
98
104
|
"scripts": {
|
|
@@ -102,16 +108,16 @@
|
|
|
102
108
|
"clean:build": "tamagui-build clean:build"
|
|
103
109
|
},
|
|
104
110
|
"dependencies": {
|
|
105
|
-
"@tamagui/normalize-css-color": "3.1.
|
|
106
|
-
"@tamagui/react-native-use-pressable": "3.1.
|
|
107
|
-
"@tamagui/react-native-use-responder-events": "3.1.
|
|
108
|
-
"@tamagui/react-native-web-internals": "3.1.
|
|
109
|
-
"@tamagui/web": "3.1.
|
|
111
|
+
"@tamagui/normalize-css-color": "3.1.4",
|
|
112
|
+
"@tamagui/react-native-use-pressable": "3.1.4",
|
|
113
|
+
"@tamagui/react-native-use-responder-events": "3.1.4",
|
|
114
|
+
"@tamagui/react-native-web-internals": "3.1.4",
|
|
115
|
+
"@tamagui/web": "3.1.4",
|
|
110
116
|
"invariant": "^2.2.4",
|
|
111
117
|
"memoize-one": "^6.0.0"
|
|
112
118
|
},
|
|
113
119
|
"devDependencies": {
|
|
114
|
-
"@tamagui/build": "3.1.
|
|
120
|
+
"@tamagui/build": "3.1.4",
|
|
115
121
|
"react": "19.3.0",
|
|
116
122
|
"react-dom": "19.3.0"
|
|
117
123
|
},
|
|
@@ -122,5 +128,5 @@
|
|
|
122
128
|
"tags": [
|
|
123
129
|
"react"
|
|
124
130
|
],
|
|
125
|
-
"releaseSourceCommit": "
|
|
131
|
+
"releaseSourceCommit": "7ea8fdab519a1477311f2d882403e7926aba59df"
|
|
126
132
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// native config evaluation uses the native color values without loading a native
|
|
9
|
+
// runtime. keep this separate from the web entry, whose colors are css values.
|
|
10
|
+
export function getNativeColorFactories(platform: string) {
|
|
11
|
+
return {
|
|
12
|
+
PlatformColor(...args: Array<string | { fallback: string }>) {
|
|
13
|
+
const last = args[args.length - 1]
|
|
14
|
+
const fallback =
|
|
15
|
+
last && typeof last === 'object' && typeof last.fallback === 'string'
|
|
16
|
+
? last.fallback
|
|
17
|
+
: undefined
|
|
18
|
+
const names = args.filter((name): name is string => typeof name === 'string')
|
|
19
|
+
const color =
|
|
20
|
+
platform === 'android' ? { resource_paths: names } : { semantic: names }
|
|
21
|
+
return fallback === undefined ? color : { ...color, fallback }
|
|
22
|
+
},
|
|
23
|
+
DynamicColorIOS(colors: Record<string, unknown>) {
|
|
24
|
+
if (platform === 'android') {
|
|
25
|
+
throw new Error('DynamicColorIOS is not available on this platform.')
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
dynamic: {
|
|
29
|
+
light: colors.light,
|
|
30
|
+
dark: colors.dark,
|
|
31
|
+
highContrastLight: colors.highContrastLight,
|
|
32
|
+
highContrastDark: colors.highContrastDark,
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
}
|