@tamagui/web 2.3.0 → 2.3.2-1782110552417
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/.turbo/turbo-build.log +1 -1
- package/dist/cjs/config.cjs +3 -0
- package/dist/cjs/config.native.js +3 -0
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +16 -6
- package/dist/cjs/createComponent.native.js +16 -6
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +29 -1
- package/dist/cjs/helpers/expandStyle.native.js +34 -29
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.native.js.map +1 -1
- package/dist/cjs/hooks/getThemeProxied.native.js.map +1 -1
- package/dist/cjs/opacityModifier.test-d.cjs +14 -2
- package/dist/cjs/opacityModifier.test-d.native.js +14 -2
- package/dist/cjs/opacityModifier.test-d.native.js.map +1 -1
- package/dist/esm/config.mjs +3 -0
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +3 -0
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +16 -6
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +16 -6
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createVariables.mjs.map +1 -1
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +28 -0
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +34 -29
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/opacityModifier.test-d.mjs +14 -2
- package/dist/esm/opacityModifier.test-d.mjs.map +1 -1
- package/dist/esm/opacityModifier.test-d.native.js +14 -2
- package/dist/esm/opacityModifier.test-d.native.js.map +1 -1
- package/dist/esm/views/Slot.mjs.map +1 -1
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/package.json +13 -13
- package/src/config.ts +4 -1
- package/src/createComponent.tsx +40 -3
- package/src/helpers/expandStyle.ts +52 -33
- package/src/opacityModifier.test-d.ts +31 -23
- package/src/types.tsx +6 -5
- package/types/config.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/types.d.ts +3 -2
- package/types/types.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isWeb","getStyleCompat","neg1Flex","expandFlex","value","compat","expandStyle","key","styleCompat","
|
|
1
|
+
{"version":3,"names":["isWeb","getStyleCompat","neg1Flex","expandFlex","value","compat","expandStyle","key","styleCompat","universalExpansions","map","k","EXPANSIONS","all","horiz","vert","xy","borderColor","borderRadius","borderWidth","margin","marginHorizontal","marginVertical","padding","paddingHorizontal","paddingVertical","borderStyle","overflow","overscrollBehavior","parent","prefix","slice","exec","index","length","inset","insetBlock","insetBlockStart","insetBlockEnd","marginBlock","marginBlockStart","marginBlockEnd","paddingBlock","paddingBlockStart","paddingBlockEnd","borderBlockColor","borderBlockWidth","borderBlockStyle","borderBlockStartColor","borderBlockEndColor","borderBlockStartWidth","borderBlockEndWidth","borderBlockStartStyle","borderBlockEndStyle","minBlockSize","maxBlockSize","minInlineSize","maxInlineSize","blockSize","inlineSize"],"sources":["expandStyle.mjs"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\n\nconst neg1Flex = [\n\t[\"flexGrow\", 0],\n\t[\"flexShrink\", 1],\n\t[\"flexBasis\", \"auto\"]\n];\nfunction expandFlex(value, compat) {\n\tif (typeof value === \"string\") return [[\"flex\", value]];\n\tif (typeof value !== \"number\") return;\n\tif (value === -1) return neg1Flex;\n\tswitch (compat) {\n\t\tcase \"legacy\": return [\n\t\t\t[\"flexGrow\", value],\n\t\t\t[\"flexShrink\", 1],\n\t\t\t[\"flexBasis\", \"auto\"]\n\t\t];\n\t\tcase \"react-native\":\n\t\t\tif (value > 0) return [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t\t\tif (value === 0) return [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", -value],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\tcase \"web\":\n\t\t\tif (value < 0) return [[\"flex\", value]];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 1],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t}\n}\nfunction expandStyle(key, value, styleCompat = getStyleCompat()) {\n\tif (key === \"flex\") return expandFlex(value, styleCompat);\n\tswitch (key) {\n\t\tcase \"writingDirection\": return [[\"direction\", value]];\n\t\tcase \"backdropFilter\": return [[\"backdropFilter\", value], [\"WebkitBackdropFilter\", value]];\n\t}\n\tif (key in universalExpansions) return universalExpansions[key].map((k) => [k, value]);\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map((k) => [k, value]);\n}\nconst all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nconst horiz = [\"Right\", \"Left\"];\nconst vert = [\"Top\", \"Bottom\"];\nconst xy = [\"X\", \"Y\"];\nconst EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (const parent in EXPANSIONS) {\n\tconst prefix = parent.slice(0, /[A-Z]/.exec(parent)?.index ?? parent.length);\n\tEXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);\n}\nconst universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmax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AAC,eAAe,CAAC;EAClCC,gBAAgB,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;EACzDC,gBAAgB,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;EACzDC,gBAAgB,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;EACzDC,qBAAqB,EAAE,CAAC,gBAAgB,CAAC;EACzCC,mBAAmB,EAAE,CAAC,mBAAmB,CAAC;EAC1CC,qBAAqB,EAAE,CAAC,gBAAgB,CAAC;EACzCC,mBAAmB,EAAE,CAAC,mBAAmB,CAAC;EAC1CC,qBAAqB,EAAE,CAAC,gBAAgB,CAAC;EACzCC,mBAAmB,EAAE,CAAC,mBAAmB,CAAC;EAC1CC,YAAY,EAAE,CAAC,WAAW,CAAC;EAC3BC,YAAY,EAAE,CAAC,WAAW,CAAC;EAC3BC,aAAa,EAAE,CAAC,UAAU,CAAC;EAC3BC,aAAa,EAAE,CAAC,UAAU,CAAC;EAC3BC,SAAS,EAAE,CAAC,QAAQ,CAAC;EACrBC,UAAU,EAAE,CAAC,OAAO;AACrB,CAAC;AAED,SAASrD,WAAW","ignoreList":[]}
|
|
@@ -2,11 +2,11 @@ import { isAndroid, isWeb } from "@tamagui/constants";
|
|
|
2
2
|
import { getStyleCompat } from "../config.native.js";
|
|
3
3
|
import { parseBorderShorthand } from "./parseBorderShorthand.native.js";
|
|
4
4
|
import { parseOutlineShorthand } from "./parseOutlineShorthand.native.js";
|
|
5
|
-
var _loop = function (
|
|
5
|
+
var _loop = function (parent2) {
|
|
6
6
|
var _exec;
|
|
7
7
|
var _exec_index;
|
|
8
|
-
var prefix =
|
|
9
|
-
EXPANSIONS[
|
|
8
|
+
var prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);
|
|
9
|
+
EXPANSIONS[parent2] = EXPANSIONS[parent2].map(function (k) {
|
|
10
10
|
return `${prefix}${k}`;
|
|
11
11
|
});
|
|
12
12
|
};
|
|
@@ -36,7 +36,10 @@ function expandStyle(key, value) {
|
|
|
36
36
|
}
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
if (key in
|
|
39
|
+
if (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function (k) {
|
|
40
|
+
return [k, value];
|
|
41
|
+
});
|
|
42
|
+
if (key in universalExpansions) return universalExpansions[key].map(function (k) {
|
|
40
43
|
return [k, value];
|
|
41
44
|
});
|
|
42
45
|
if (key in EXPANSIONS) return EXPANSIONS[key].map(function (k) {
|
|
@@ -77,47 +80,49 @@ var EXPANSIONS = {
|
|
|
77
80
|
})
|
|
78
81
|
};
|
|
79
82
|
for (var parent in EXPANSIONS) _loop(parent);
|
|
80
|
-
var
|
|
83
|
+
var universalExpansions = {
|
|
84
|
+
inset: ["top", "right", "bottom", "left"],
|
|
85
|
+
insetBlock: ["top", "bottom"],
|
|
86
|
+
insetBlockStart: ["top"],
|
|
87
|
+
insetBlockEnd: ["bottom"],
|
|
88
|
+
marginBlock: ["marginTop", "marginBottom"],
|
|
89
|
+
marginBlockStart: ["marginTop"],
|
|
90
|
+
marginBlockEnd: ["marginBottom"],
|
|
91
|
+
paddingBlock: ["paddingTop", "paddingBottom"],
|
|
92
|
+
paddingBlockStart: ["paddingTop"],
|
|
93
|
+
paddingBlockEnd: ["paddingBottom"],
|
|
81
94
|
borderBlockColor: ["borderTopColor", "borderBottomColor"],
|
|
82
|
-
borderInlineColor: ["borderEndColor", "borderStartColor"],
|
|
83
95
|
borderBlockWidth: ["borderTopWidth", "borderBottomWidth"],
|
|
84
|
-
borderInlineWidth: ["borderEndWidth", "borderStartWidth"],
|
|
85
96
|
borderBlockStyle: ["borderTopStyle", "borderBottomStyle"],
|
|
86
|
-
borderInlineStyle: ["borderEndStyle", "borderStartStyle"],
|
|
87
97
|
borderBlockStartColor: ["borderTopColor"],
|
|
88
98
|
borderBlockEndColor: ["borderBottomColor"],
|
|
89
|
-
borderInlineStartColor: ["borderStartColor"],
|
|
90
|
-
borderInlineEndColor: ["borderEndColor"],
|
|
91
99
|
borderBlockStartWidth: ["borderTopWidth"],
|
|
92
100
|
borderBlockEndWidth: ["borderBottomWidth"],
|
|
93
|
-
borderInlineStartWidth: ["borderStartWidth"],
|
|
94
|
-
borderInlineEndWidth: ["borderEndWidth"],
|
|
95
101
|
borderBlockStartStyle: ["borderTopStyle"],
|
|
96
102
|
borderBlockEndStyle: ["borderBottomStyle"],
|
|
103
|
+
minBlockSize: ["minHeight"],
|
|
104
|
+
maxBlockSize: ["maxHeight"],
|
|
105
|
+
minInlineSize: ["minWidth"],
|
|
106
|
+
maxInlineSize: ["maxWidth"],
|
|
107
|
+
blockSize: ["height"],
|
|
108
|
+
inlineSize: ["width"]
|
|
109
|
+
};
|
|
110
|
+
var nativeInlineExpansions = {
|
|
111
|
+
borderInlineColor: ["borderEndColor", "borderStartColor"],
|
|
112
|
+
borderInlineWidth: ["borderEndWidth", "borderStartWidth"],
|
|
113
|
+
borderInlineStyle: ["borderEndStyle", "borderStartStyle"],
|
|
114
|
+
borderInlineStartColor: ["borderStartColor"],
|
|
115
|
+
borderInlineEndColor: ["borderEndColor"],
|
|
116
|
+
borderInlineStartWidth: ["borderStartWidth"],
|
|
117
|
+
borderInlineEndWidth: ["borderEndWidth"],
|
|
97
118
|
borderInlineStartStyle: ["borderStartStyle"],
|
|
98
119
|
borderInlineEndStyle: ["borderEndStyle"],
|
|
99
|
-
marginBlock: ["marginTop", "marginBottom"],
|
|
100
120
|
marginInline: ["marginEnd", "marginStart"],
|
|
101
|
-
paddingBlock: ["paddingTop", "paddingBottom"],
|
|
102
|
-
paddingInline: ["paddingEnd", "paddingStart"],
|
|
103
|
-
marginBlockStart: ["marginTop"],
|
|
104
|
-
marginBlockEnd: ["marginBottom"],
|
|
105
121
|
marginInlineStart: ["marginStart"],
|
|
106
122
|
marginInlineEnd: ["marginEnd"],
|
|
107
|
-
|
|
108
|
-
paddingBlockEnd: ["paddingBottom"],
|
|
123
|
+
paddingInline: ["paddingEnd", "paddingStart"],
|
|
109
124
|
paddingInlineStart: ["paddingStart"],
|
|
110
125
|
paddingInlineEnd: ["paddingEnd"],
|
|
111
|
-
minBlockSize: ["minHeight"],
|
|
112
|
-
maxBlockSize: ["maxHeight"],
|
|
113
|
-
minInlineSize: ["minWidth"],
|
|
114
|
-
maxInlineSize: ["maxWidth"],
|
|
115
|
-
blockSize: ["height"],
|
|
116
|
-
inlineSize: ["width"],
|
|
117
|
-
inset: ["top", "right", "bottom", "left"],
|
|
118
|
-
insetBlock: ["top", "bottom"],
|
|
119
|
-
insetBlockStart: ["top"],
|
|
120
|
-
insetBlockEnd: ["bottom"],
|
|
121
126
|
insetInlineStart: ["left"],
|
|
122
127
|
insetInlineEnd: ["right"]
|
|
123
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isAndroid","isWeb","getStyleCompat","parseBorderShorthand","parseOutlineShorthand","_loop","parent","_exec","_exec_index","prefix","slice","exec","index","length","EXPANSIONS","map","k","expandStyle","key","value","arguments","resizeModeMap","verticalAlignMap","parsed","parsed1","nativeExpansions","fill","none","contain","cover","top","middle","bottom","auto","all","horiz","vert","xy","borderColor","borderRadius","borderWidth","margin","marginHorizontal","marginVertical","padding","paddingHorizontal","paddingVertical","borderStyle","overflow","overscrollBehavior","borderBlockColor","borderInlineColor","borderBlockWidth","borderInlineWidth","borderBlockStyle","borderInlineStyle","borderBlockStartColor","borderBlockEndColor","borderInlineStartColor","borderInlineEndColor","borderBlockStartWidth","borderBlockEndWidth","borderInlineStartWidth","borderInlineEndWidth","borderBlockStartStyle","borderBlockEndStyle","borderInlineStartStyle","borderInlineEndStyle","marginBlock","marginInline","paddingBlock","paddingInline","marginBlockStart","marginBlockEnd","marginInlineStart","marginInlineEnd","paddingBlockStart","paddingBlockEnd","paddingInlineStart","paddingInlineEnd","minBlockSize","maxBlockSize","minInlineSize","maxInlineSize","blockSize","inlineSize","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInlineStart","insetInlineEnd"],"sources":["expandStyle.native.js"],"sourcesContent":["import { isAndroid, isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\nimport { parseBorderShorthand } from \"./parseBorderShorthand\";\nimport { parseOutlineShorthand } from \"./parseOutlineShorthand\";\n\nvar _loop = function(parent) {\n\tvar _exec;\n\tvar _exec_index;\n\tvar prefix = parent.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent.length);\n\tEXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {\n\t\treturn `${prefix}${k}`;\n\t});\n};\nfunction expandStyle(key, value) {\n\targuments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getStyleCompat();\n\tif (isAndroid && key === \"elevationAndroid\") return [[\"elevation\", value]];\n\tswitch (key) {\n\t\tcase \"objectFit\": return [[\"resizeMode\", resizeModeMap[value] || \"cover\"]];\n\t\tcase \"verticalAlign\": return [[\"textAlignVertical\", verticalAlignMap[value] || \"auto\"]];\n\t\tcase \"position\":\n\t\t\tif (value === \"fixed\" || value === \"sticky\") return [[\"position\", \"absolute\"]];\n\t\t\treturn;\n\t\tcase \"backgroundImage\": return [[\"experimental_backgroundImage\", value]];\n\t\tcase \"border\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed = parseBorderShorthand(value);\n\t\t\t\tif (parsed) return parsed;\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"outline\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed1 = parseOutlineShorthand(value);\n\t\t\t\tif (parsed1) return parsed1;\n\t\t\t}\n\t\t\treturn;\n\t}\n\tif (key in nativeExpansions) return nativeExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n}\nvar resizeModeMap = {\n\tfill: \"stretch\",\n\tnone: \"center\",\n\t\"scale-down\": \"contain\",\n\tcontain: \"contain\",\n\tcover: \"cover\"\n};\nvar verticalAlignMap = {\n\ttop: \"top\",\n\tmiddle: \"center\",\n\tbottom: \"bottom\",\n\tauto: \"auto\"\n};\nvar all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nvar horiz = [\"Right\", \"Left\"];\nvar vert = [\"Top\", \"Bottom\"];\nvar xy = [\"X\", \"Y\"];\nvar EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (var parent in EXPANSIONS) _loop(parent);\nvar nativeExpansions = {\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderInlineColor: [\"borderEndColor\", \"borderStartColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderInlineWidth: [\"borderEndWidth\", \"borderStartWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderInlineStyle: [\"borderEndStyle\", \"borderStartStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderInlineStartColor: [\"borderStartColor\"],\n\tborderInlineEndColor: [\"borderEndColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderInlineStartWidth: [\"borderStartWidth\"],\n\tborderInlineEndWidth: [\"borderEndWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tborderInlineStartStyle: [\"borderStartStyle\"],\n\tborderInlineEndStyle: [\"borderEndStyle\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginInline: [\"marginEnd\", \"marginStart\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingInline: [\"paddingEnd\", \"paddingStart\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tmarginInlineStart: [\"marginStart\"],\n\tmarginInlineEnd: [\"marginEnd\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tpaddingInlineStart: [\"paddingStart\"],\n\tpaddingInlineEnd: [\"paddingEnd\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"],\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tinsetInlineStart: [\"left\"],\n\tinsetInlineEnd: [\"right\"]\n};\n\nexport { expandStyle };"],"mappings":"AAAA,SAASA,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,qBAAW;AAC1C,SAAS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ACN;EACDC,UAAU,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;EAC7BC,eAAe,EAAE,CAAC,KAAK,CAAC;EACxBC,aAAa,EAAE,CAAC,QAAQ,CAAC;EACzBC,gBAAgB,EAAE,CAAC,MAAM,CAAC;EAC1BC,cAAc,EAAE,CAAC,OAAO;AACzB,CAAC;AAED,SAAS1E,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["isAndroid","isWeb","getStyleCompat","parseBorderShorthand","parseOutlineShorthand","_loop","parent2","_exec","_exec_index","prefix","slice","exec","index","length","EXPANSIONS","map","k","expandStyle","key","value","arguments","resizeModeMap","verticalAlignMap","parsed","parsed1","nativeInlineExpansions","universalExpansions","fill","none","contain","cover","top","middle","bottom","auto","all","horiz","vert","xy","borderColor","borderRadius","borderWidth","margin","marginHorizontal","marginVertical","padding","paddingHorizontal","paddingVertical","borderStyle","overflow","overscrollBehavior","parent","inset","insetBlock","insetBlockStart","insetBlockEnd","marginBlock","marginBlockStart","marginBlockEnd","paddingBlock","paddingBlockStart","paddingBlockEnd","borderBlockColor","borderBlockWidth","borderBlockStyle","borderBlockStartColor","borderBlockEndColor","borderBlockStartWidth","borderBlockEndWidth","borderBlockStartStyle","borderBlockEndStyle","minBlockSize","maxBlockSize","minInlineSize","maxInlineSize","blockSize","inlineSize","borderInlineColor","borderInlineWidth","borderInlineStyle","borderInlineStartColor","borderInlineEndColor","borderInlineStartWidth","borderInlineEndWidth","borderInlineStartStyle","borderInlineEndStyle","marginInline","marginInlineStart","marginInlineEnd","paddingInline","paddingInlineStart","paddingInlineEnd","insetInlineStart","insetInlineEnd"],"sources":["expandStyle.native.js"],"sourcesContent":["import { isAndroid, isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\nimport { parseBorderShorthand } from \"./parseBorderShorthand\";\nimport { parseOutlineShorthand } from \"./parseOutlineShorthand\";\n\nvar _loop = function(parent2) {\n\tvar _exec;\n\tvar _exec_index;\n\tvar prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);\n\tEXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {\n\t\treturn `${prefix}${k}`;\n\t});\n};\nfunction expandStyle(key, value) {\n\targuments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getStyleCompat();\n\tif (isAndroid && key === \"elevationAndroid\") return [[\"elevation\", value]];\n\tswitch (key) {\n\t\tcase \"objectFit\": return [[\"resizeMode\", resizeModeMap[value] || \"cover\"]];\n\t\tcase \"verticalAlign\": return [[\"textAlignVertical\", verticalAlignMap[value] || \"auto\"]];\n\t\tcase \"position\":\n\t\t\tif (value === \"fixed\" || value === \"sticky\") return [[\"position\", \"absolute\"]];\n\t\t\treturn;\n\t\tcase \"backgroundImage\": return [[\"experimental_backgroundImage\", value]];\n\t\tcase \"border\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed = parseBorderShorthand(value);\n\t\t\t\tif (parsed) return parsed;\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"outline\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed1 = parseOutlineShorthand(value);\n\t\t\t\tif (parsed1) return parsed1;\n\t\t\t}\n\t\t\treturn;\n\t}\n\tif (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in universalExpansions) return universalExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n}\nvar resizeModeMap = {\n\tfill: \"stretch\",\n\tnone: \"center\",\n\t\"scale-down\": \"contain\",\n\tcontain: \"contain\",\n\tcover: \"cover\"\n};\nvar verticalAlignMap = {\n\ttop: \"top\",\n\tmiddle: \"center\",\n\tbottom: \"bottom\",\n\tauto: \"auto\"\n};\nvar all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nvar horiz = [\"Right\", \"Left\"];\nvar vert = [\"Top\", \"Bottom\"];\nvar xy = [\"X\", \"Y\"];\nvar EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (var parent in EXPANSIONS) _loop(parent);\nvar universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nvar nativeInlineExpansions = {\n\tborderInlineColor: [\"borderEndColor\", \"borderStartColor\"],\n\tborderInlineWidth: [\"borderEndWidth\", \"borderStartWidth\"],\n\tborderInlineStyle: [\"borderEndStyle\", \"borderStartStyle\"],\n\tborderInlineStartColor: [\"borderStartColor\"],\n\tborderInlineEndColor: [\"borderEndColor\"],\n\tborderInlineStartWidth: [\"borderStartWidth\"],\n\tborderInlineEndWidth: [\"borderEndWidth\"],\n\tborderInlineStartStyle: [\"borderStartStyle\"],\n\tborderInlineEndStyle: [\"borderEndStyle\"],\n\tmarginInline: [\"marginEnd\", \"marginStart\"],\n\tmarginInlineStart: [\"marginStart\"],\n\tmarginInlineEnd: [\"marginEnd\"],\n\tpaddingInline: [\"paddingEnd\", \"paddingStart\"],\n\tpaddingInlineStart: [\"paddingStart\"],\n\tpaddingInlineEnd: [\"paddingEnd\"],\n\tinsetInlineStart: [\"left\"],\n\tinsetInlineEnd: [\"right\"]\n};\n\nexport { expandStyle };"],"mappings":"AAAA,SAASA,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,qBAAW;AAC1C,SAASC,oBAAoB,QAAQ,kCAAwB;AAC7D,SAASC,qBAAqB,QAAQ,mCAAyB;AAE/D,IAAIC,KAAK,GAAG,SAAAA,CAASC,OAAO,EAAE;EAC7B,IAAIC,KAAK;EACT,IAAIC,WAAW;EACf,IAAIC,MAAM,GAAGH,OAAO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AAE,CAAC,WAAW,CAAC;EAC9BC,aAAa,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;EAC7CC,kBAAkB,EAAE,CAAC,cAAc,CAAC;EACpCC,gBAAgB,EAAE,CAAC,YAAY,CAAC;EAChCC,gBAAgB,EAAE,CAAC,MAAM,CAAC;EAC1BC,cAAc,EAAE,CAAC,OAAO;AACzB,CAAC;AAED,SAAS5E,WAAW","ignoreList":[]}
|
|
@@ -12,14 +12,26 @@ describe("opacity modifier types", () => {
|
|
|
12
12
|
expectTypeOf(regularToken).toMatchTypeOf();
|
|
13
13
|
expectTypeOf(colorName).toMatchTypeOf();
|
|
14
14
|
});
|
|
15
|
-
test("FontColorTokens
|
|
15
|
+
test("FontColorTokens accepts opacity modifier syntax", () => {
|
|
16
16
|
const fontColorNumber = 42;
|
|
17
|
+
const fontColorWithOpacity = "$bodyColor/50";
|
|
17
18
|
expectTypeOf(fontColorNumber).toMatchTypeOf();
|
|
19
|
+
expectTypeOf(fontColorWithOpacity).toMatchTypeOf();
|
|
18
20
|
expectTypeOf().toMatchTypeOf();
|
|
19
21
|
});
|
|
20
|
-
test("opacity modifier
|
|
22
|
+
test("opacity modifier requires token prefix", () => {
|
|
21
23
|
const validOpacity = "$color/75";
|
|
22
24
|
expectTypeOf(validOpacity).toMatchTypeOf();
|
|
25
|
+
const cssColorWithOpacity = "red/75";
|
|
26
|
+
expectTypeOf(cssColorWithOpacity).toMatchTypeOf();
|
|
27
|
+
});
|
|
28
|
+
test("color props accept opacity without expanding large token unions", () => {
|
|
29
|
+
const colorToken = "$color123";
|
|
30
|
+
const colorTokenWithOpacity = "$color123/50";
|
|
31
|
+
const propColorTokenWithOpacity = "$color123/50";
|
|
32
|
+
expectTypeOf(colorToken).toMatchTypeOf();
|
|
33
|
+
expectTypeOf(colorTokenWithOpacity).toMatchTypeOf();
|
|
34
|
+
expectTypeOf(propColorTokenWithOpacity).toMatchTypeOf();
|
|
23
35
|
});
|
|
24
36
|
});
|
|
25
37
|
//# sourceMappingURL=opacityModifier.test-d.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["expectTypeOf","describe","test","colorWithOpacity","colorWithFullOpacity","colorWithLowOpacity","regularToken","colorName","toMatchTypeOf","fontColorNumber","validOpacity"],"sources":["../../src/opacityModifier.test-d.ts"],"sourcesContent":[null],"mappings":"AAQA,SAASA,YAAA,EAAcC,QAAA,EAAUC,IAAA,QAAY;
|
|
1
|
+
{"version":3,"names":["expectTypeOf","describe","test","colorWithOpacity","colorWithFullOpacity","colorWithLowOpacity","regularToken","colorName","toMatchTypeOf","fontColorNumber","fontColorWithOpacity","validOpacity","cssColorWithOpacity","colorToken","colorTokenWithOpacity","propColorTokenWithOpacity"],"sources":["../../src/opacityModifier.test-d.ts"],"sourcesContent":[null],"mappings":"AAQA,SAASA,YAAA,EAAcC,QAAA,EAAUC,IAAA,QAAY;AAM7CD,QAAA,CAAS,0BAA0B,MAAM;EACvCC,IAAA,CAAK,+CAA+C,MAAM;IAExD,MAAMC,gBAAA,GAAgC;IACtC,MAAMC,oBAAA,GAAoC;IAC1C,MAAMC,mBAAA,GAAmC;IAGzC,MAAMC,YAAA,GAA4B;IAClC,MAAMC,SAAA,GAAyB;IAE/BP,YAAA,CAAaG,gBAAgB,EAAEK,aAAA,CAA2B;IAC1DR,YAAA,CAAaI,oBAAoB,EAAEI,aAAA,CAA2B;IAC9DR,YAAA,CAAaK,mBAAmB,EAAEG,aAAA,CAA2B;IAC7DR,YAAA,CAAaM,YAAY,EAAEE,aAAA,CAA2B;IACtDR,YAAA,CAAaO,SAAS,EAAEC,aAAA,CAA2B;EACrD,CAAC;EAEDN,IAAA,CAAK,mDAAmD,MAAM;IAC5D,MAAMO,eAAA,GAAmC;IACzC,MAAMC,oBAAA,GAAwC;IAE9CV,YAAA,CAAaS,eAAe,EAAED,aAAA,CAA+B;IAC7DR,YAAA,CAAaU,oBAAoB,EAAEF,aAAA,CAA+B;IAClER,YAAA,CAAqB,EAAEQ,aAAA,CAA+B;EACxD,CAAC;EAEDN,IAAA,CAAK,0CAA0C,MAAM;IACnD,MAAMS,YAAA,GAA4B;IAClCX,YAAA,CAAaW,YAAY,EAAEH,aAAA,CAA2B;IAGtD,MAAMI,mBAAA,GAAmC;IACzCZ,YAAA,CAAaY,mBAAmB,EAAEJ,aAAA,CAA2B;EAC/D,CAAC;EAEDN,IAAA,CAAK,mEAAmE,MAAM;IAG5E,MAAMW,UAAA,GAA+B;IACrC,MAAMC,qBAAA,GAA0C;IAChD,MAAMC,yBAAA,GACJ;IAEFf,YAAA,CAAaa,UAAU,EAAEL,aAAA,CAAgC;IACzDR,YAAA,CAAac,qBAAqB,EAAEN,aAAA,CAAgC;IACpER,YAAA,CAAae,yBAAyB,EAAEP,aAAA,CAEtC;EACJ,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -12,14 +12,26 @@ describe("opacity modifier types", function () {
|
|
|
12
12
|
expectTypeOf(regularToken).toMatchTypeOf();
|
|
13
13
|
expectTypeOf(colorName).toMatchTypeOf();
|
|
14
14
|
});
|
|
15
|
-
test("FontColorTokens
|
|
15
|
+
test("FontColorTokens accepts opacity modifier syntax", function () {
|
|
16
16
|
var fontColorNumber = 42;
|
|
17
|
+
var fontColorWithOpacity = "$bodyColor/50";
|
|
17
18
|
expectTypeOf(fontColorNumber).toMatchTypeOf();
|
|
19
|
+
expectTypeOf(fontColorWithOpacity).toMatchTypeOf();
|
|
18
20
|
expectTypeOf().toMatchTypeOf();
|
|
19
21
|
});
|
|
20
|
-
test("opacity modifier
|
|
22
|
+
test("opacity modifier requires token prefix", function () {
|
|
21
23
|
var validOpacity = "$color/75";
|
|
22
24
|
expectTypeOf(validOpacity).toMatchTypeOf();
|
|
25
|
+
var cssColorWithOpacity = "red/75";
|
|
26
|
+
expectTypeOf(cssColorWithOpacity).toMatchTypeOf();
|
|
27
|
+
});
|
|
28
|
+
test("color props accept opacity without expanding large token unions", function () {
|
|
29
|
+
var colorToken = "$color123";
|
|
30
|
+
var colorTokenWithOpacity = "$color123/50";
|
|
31
|
+
var propColorTokenWithOpacity = "$color123/50";
|
|
32
|
+
expectTypeOf(colorToken).toMatchTypeOf();
|
|
33
|
+
expectTypeOf(colorTokenWithOpacity).toMatchTypeOf();
|
|
34
|
+
expectTypeOf(propColorTokenWithOpacity).toMatchTypeOf();
|
|
23
35
|
});
|
|
24
36
|
});
|
|
25
37
|
//# sourceMappingURL=opacityModifier.test-d.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["expectTypeOf","describe","test","colorWithOpacity","colorWithFullOpacity","colorWithLowOpacity","regularToken","colorName","toMatchTypeOf","fontColorNumber","validOpacity"],"sources":["../../src/opacityModifier.test-d.ts"],"sourcesContent":[null],"mappings":"AAQA,SAASA,YAAA,EAAcC,QAAA,EAAUC,IAAA,QAAY;
|
|
1
|
+
{"version":3,"names":["expectTypeOf","describe","test","colorWithOpacity","colorWithFullOpacity","colorWithLowOpacity","regularToken","colorName","toMatchTypeOf","fontColorNumber","fontColorWithOpacity","validOpacity","cssColorWithOpacity","colorToken","colorTokenWithOpacity","propColorTokenWithOpacity"],"sources":["../../src/opacityModifier.test-d.ts"],"sourcesContent":[null],"mappings":"AAQA,SAASA,YAAA,EAAcC,QAAA,EAAUC,IAAA,QAAY;AAM7CD,QAAA,CAAS,0BAA0B,YAAM;EACvCC,IAAA,CAAK,+CAA+C,YAAM;IAExD,IAAAC,gBAAM,cAAgC;IACtC,IAAAC,oBAAM,eAAoC;IAC1C,IAAAC,mBAAM,cAAmC;IAGzC,IAAAC,YAAM,WAA4B;IAClC,IAAAC,SAAM,QAAyB;IAE/BP,YAAA,CAAaG,gBAAgB,EAAEK,aAAA,CAA2B;IAC1DR,YAAA,CAAaI,oBAAoB,EAAEI,aAAA,CAA2B;IAC9DR,YAAA,CAAaK,mBAAmB,EAAEG,aAAA,CAA2B;IAC7DR,YAAA,CAAaM,YAAY,EAAEE,aAAA,CAA2B;IACtDR,YAAA,CAAaO,SAAS,EAAEC,aAAA,CAA2B;EACrD,CAAC;EAEDN,IAAA,CAAK,mDAAmD,YAAM;IAC5D,IAAAO,eAAM,KAAmC;IACzC,IAAAC,oBAAM,kBAAwC;IAE9CV,YAAA,CAAaS,eAAe,EAAED,aAAA,CAA+B;IAC7DR,YAAA,CAAaU,oBAAoB,EAAEF,aAAA,CAA+B;IAClER,YAAA,CAAqB,EAAEQ,aAAA,CAA+B;EACxD,CAAC;EAEDN,IAAA,CAAK,0CAA0C,YAAM;IACnD,IAAAS,YAAM,cAA4B;IAClCX,YAAA,CAAaW,YAAY,EAAEH,aAAA,CAA2B;IAGtD,IAAAI,mBAAM,WAAmC;IACzCZ,YAAA,CAAaY,mBAAmB,EAAEJ,aAAA,CAA2B;EAC/D,CAAC;EAEDN,IAAA,CAAK,mEAAmE,YAAM;IAG5E,IAAAW,UAAM,cAA+B;IACrC,IAAAC,qBAAM,iBAA0C;IAChD,IAAAC,yBAAM,iBACJ;IAEFf,YAAA,CAAaa,UAAU,EAAEL,aAAA,CAAgC;IACzDR,YAAA,CAAac,qBAAqB,EAAEN,aAAA,CAAgC;IACpER,YAAA,CAAae,yBAAyB,EAAEP,aAAA,CAEtC;EACJ,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["composeRefs","isWeb","Children","cloneElement","forwardRef","isValidElement","memo","mergeSlotStyleProps","Fragment","jsx","Slot","Slot2","props","forwardedRef","children","slotProps","mergedProps","mergeSlotProps","type","ref","count","only","Slottable","pressMap","onPress","onPressOut","onPressIn","child","childProps","isHTMLChild","key","merged"],"sources":["../../../src/views/Slot.tsx"],"sourcesContent":[null],"mappings":"AAEA,SAASA,WAAA,QAAmB;AAC5B,SAASC,KAAA,QAAa;AAEtB,SAASC,QAAA,EAAUC,YAAA,EAAcC,UAAA,EAAYC,cAAA,EAAgBC,IAAA,QAAY;AACzE,SAASC,mBAAA,QAA2B;AAoC3B,SAAAC,QAAA,EAAAC,GAAA;AA1BF,MAAMC,IAAA,GAAOJ,IAAA,CAClBF,UAAA,CAA2B,SAASO,
|
|
1
|
+
{"version":3,"names":["composeRefs","isWeb","Children","cloneElement","forwardRef","isValidElement","memo","mergeSlotStyleProps","Fragment","jsx","Slot","Slot2","props","forwardedRef","children","slotProps","mergedProps","mergeSlotProps","type","ref","count","only","Slottable","pressMap","onPress","onPressOut","onPressIn","child","childProps","isHTMLChild","key","merged"],"sources":["../../../src/views/Slot.tsx"],"sourcesContent":[null],"mappings":"AAEA,SAASA,WAAA,QAAmB;AAC5B,SAASC,KAAA,QAAa;AAEtB,SAASC,QAAA,EAAUC,YAAA,EAAcC,UAAA,EAAYC,cAAA,EAAgBC,IAAA,QAAY;AACzE,SAASC,mBAAA,QAA2B;AAoC3B,SAAAC,QAAA,EAAAC,GAAA;AA1BF,MAAMC,IAAA,GAAOJ,IAAA,CAClBF,UAAA,CAA2B,SAASO,KAAAD,CAAKE,KAAA,EAAOC,YAAA,EAAc;EAC5D,MAAM;IAAEC,QAAA;IAAU,GAAGC;EAAU,IAAIH,KAAA;EAEnC,IAAIP,cAAA,CAAeS,QAAQ,GAAG;IAC5B,MAAME,WAAA,GAAcC,cAAA,CAAeH,QAAA,EAAUC,SAAS;IACtD,OAAOZ,YAAA,CACLW,QAAA,EACAA,QAAA,CAASI,IAAA,CAAK,iBAAiB,IAC3BF,WAAA,GACA;MACE,GAAGA,WAAA;MACHG,GAAA,EAAKnB,WAAA,CAAYa,YAAA,EAAeC,QAAA,CAAiBF,KAAA,CAAMO,GAAG;IAC5D,CACN;EACF;EAEA,OAAOjB,QAAA,CAASkB,KAAA,CAAMN,QAAQ,IAAI,IAAIZ,QAAA,CAASmB,IAAA,CAAK,IAAI,IAAI;AAC9D,CAAC,CACH;AAMO,MAAMC,SAAA,GAAYA,CAAC;EAAER;AAAS,MAA+B;EAClE,OAAO,eAAAL,GAAA,CAAAD,QAAA;IAAGM;EAAA,CAAS;AACrB;AAEAQ,SAAA,CAAU,aAAa,IAAI;AAI3B,MAAMC,QAAA,GAAWtB,KAAA,GACb;EACEuB,OAAA,EAAS;EACTC,UAAA,EAAY;EACZC,SAAA,EAAW;AACb,IACA,CAAC;AAEL,SAAST,eAAeU,KAAA,EAAYZ,SAAA,EAAgC;EAClE,MAAMa,UAAA,GAAaD,KAAA,CAAMf,KAAA;EACzB,MAAMiB,WAAA,GAAc,OAAOF,KAAA,CAAMT,IAAA,KAAS;EAG1C,IAAIW,WAAA,EAAa;IACf,WAAWC,GAAA,IAAOP,QAAA,EAAU;MAC1B,IAAIO,GAAA,IAAOf,SAAA,EAAW;QACpBA,SAAA,CAAUQ,QAAA,CAASO,GAAG,CAAC,IAAIf,SAAA,CAAUe,GAAG;QACxC,OAAOf,SAAA,CAAUe,GAAG;MACtB;IACF;EACF;EAGA,MAAMC,MAAA,GAASxB,mBAAA,CAAoBQ,SAAA,EAAWa,UAAU;EAGxD,IAAIC,WAAA,EAAa;IACf,WAAWC,GAAA,IAAOP,QAAA,EAAU;MAC1B,IAAIO,GAAA,IAAOC,MAAA,EAAQ;QACjBA,MAAA,CAAOR,QAAA,CAASO,GAAG,CAAC,IAAIC,MAAA,CAAOD,GAAG;QAClC,OAAOC,MAAA,CAAOD,GAAG;MACnB;IACF;EACF;EAEA,OAAOC,MAAA;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isWeb","React","Children","cloneElement","forwardRef","isValidElement","useRef","variableToString","useThemeWithState","getThemeState","hasThemeUpdatingProps","ThemeStateContext","ThemeDebug","jsx","Theme","Theme2","props","ref","disable","children","passThrough","isRoot","_","themeState","disableDirectChildTheme","finalChildren","map","child","only","stateRef","hasEverThemed","getThemedChildren","shallow","forceClassName","state","current","shouldRenderChildrenWithTheme","isNew","process","env","NODE_ENV","debug","themeProps","Provider","value","id","isInverse","name","requiresExtraWrapper","parentId","parentState","Error","toArray","console","warn","themeSpanProps","getThemeClassNameAndColor","baseStyle","contain","inertContainedStyle","inertStyle","className","color","style","
|
|
1
|
+
{"version":3,"names":["isWeb","React","Children","cloneElement","forwardRef","isValidElement","useRef","variableToString","useThemeWithState","getThemeState","hasThemeUpdatingProps","ThemeStateContext","ThemeDebug","jsx","Theme","Theme2","props","ref","disable","children","passThrough","isRoot","_","themeState","disableDirectChildTheme","finalChildren","map","child","only","stateRef","hasEverThemed","getThemedChildren","shallow","forceClassName","state","current","shouldRenderChildrenWithTheme","isNew","process","env","NODE_ENV","debug","themeProps","Provider","value","id","isInverse","name","requiresExtraWrapper","parentId","parentState","Error","toArray","console","warn","themeSpanProps","getThemeClassNameAndColor","baseStyle","contain","inertContainedStyle","inertStyle","className","color","style","startsWith","className2","display","empty","themeColor","theme","themeClassName","replace","schemePrefix","themeNameParts","split","themeClasses","length","hierarchyClasses","i","push","slice","join"],"sources":["../../../src/views/Theme.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,KAAA,QAAa;AAEtB,OAAOC,KAAA,IAASC,QAAA,EAAUC,YAAA,EAAcC,UAAA,EAAYC,cAAA,EAAgBC,MAAA,QAAc;AAElF,SAASC,gBAAA,QAAwB;AACjC,SAASC,iBAAA,QAAyB;AAClC,SACEC,aAAA,EACAC,qBAAA,EACAC,iBAAA,QACK;AAEP,SAASC,UAAA,QAAkB;AAyErB,SAAAC,GAAA;AArEC,MAAMC,KAAA,GAAQV,UAAA,CAAW,SAASW,MAAAD,CAAME,KAAA,EAAgCC,GAAA,EAAK;EAClF;;EAGA,IAAID,KAAA,CAAME,OAAA,EAAS;IACjB,OAAOF,KAAA,CAAMG,QAAA;EACf;EAEA,MAAM;IAAEC;EAAY,IAAIJ,KAAA;EAExB,MAAMK,MAAA,GAAS,CAAC,CAACL,KAAA,CAAM,SAAS;EAEhC,MAAM,CAACM,CAAA,EAAGC,UAAU,IAAIf,iBAAA,CAAkBQ,KAAA,EAAOK,MAAM;EAEvD,MAAMG,uBAAA,GAA0BR,KAAA,CAAM,qBAAqB;EAE3D,IAAIS,aAAA,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
@@ -51,20 +51,20 @@
|
|
|
51
51
|
"test:web": "vitest --typecheck --run"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@tamagui/compose-refs": "2.3.
|
|
55
|
-
"@tamagui/constants": "2.3.
|
|
56
|
-
"@tamagui/helpers": "2.3.
|
|
57
|
-
"@tamagui/is-equal-shallow": "2.3.
|
|
58
|
-
"@tamagui/native": "2.3.
|
|
59
|
-
"@tamagui/normalize-css-color": "2.3.
|
|
60
|
-
"@tamagui/timer": "2.3.
|
|
61
|
-
"@tamagui/types": "2.3.
|
|
62
|
-
"@tamagui/use-did-finish-ssr": "2.3.
|
|
63
|
-
"@tamagui/use-event": "2.3.
|
|
64
|
-
"@tamagui/use-force-update": "2.3.
|
|
54
|
+
"@tamagui/compose-refs": "2.3.2-1782110552417",
|
|
55
|
+
"@tamagui/constants": "2.3.2-1782110552417",
|
|
56
|
+
"@tamagui/helpers": "2.3.2-1782110552417",
|
|
57
|
+
"@tamagui/is-equal-shallow": "2.3.2-1782110552417",
|
|
58
|
+
"@tamagui/native": "2.3.2-1782110552417",
|
|
59
|
+
"@tamagui/normalize-css-color": "2.3.2-1782110552417",
|
|
60
|
+
"@tamagui/timer": "2.3.2-1782110552417",
|
|
61
|
+
"@tamagui/types": "2.3.2-1782110552417",
|
|
62
|
+
"@tamagui/use-did-finish-ssr": "2.3.2-1782110552417",
|
|
63
|
+
"@tamagui/use-event": "2.3.2-1782110552417",
|
|
64
|
+
"@tamagui/use-force-update": "2.3.2-1782110552417"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@tamagui/build": "2.3.
|
|
67
|
+
"@tamagui/build": "2.3.2-1782110552417",
|
|
68
68
|
"@testing-library/react": "^16.1.0",
|
|
69
69
|
"csstype": "^3.0.10",
|
|
70
70
|
"react": ">=19",
|
package/src/config.ts
CHANGED
|
@@ -167,7 +167,10 @@ export const getThemes = () => getConfigFromGlobalOrLocal()!.themes
|
|
|
167
167
|
export const updateConfig = (key: string, value: any) => {
|
|
168
168
|
// for usage internally only
|
|
169
169
|
const config = getConfigFromGlobalOrLocal()
|
|
170
|
-
Object.
|
|
170
|
+
if (!config || !Object.prototype.hasOwnProperty.call(config, key)) {
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
|
+
Object.assign(config[key], value)
|
|
171
174
|
}
|
|
172
175
|
|
|
173
176
|
// searches by value name or token name
|
package/src/createComponent.tsx
CHANGED
|
@@ -85,6 +85,16 @@ const avoidReRenderKeys = new Set([
|
|
|
85
85
|
'group',
|
|
86
86
|
])
|
|
87
87
|
|
|
88
|
+
const groupPseudoKeys = [
|
|
89
|
+
'disabled',
|
|
90
|
+
'hover',
|
|
91
|
+
'press',
|
|
92
|
+
'pressIn',
|
|
93
|
+
'focus',
|
|
94
|
+
'focusVisible',
|
|
95
|
+
'focusWithin',
|
|
96
|
+
] as const satisfies readonly (keyof PseudoGroupState)[]
|
|
97
|
+
|
|
88
98
|
if (process.env.TAMAGUI_TARGET !== 'native' && typeof window !== 'undefined') {
|
|
89
99
|
const cancelPresses = () => {
|
|
90
100
|
// clear all press downs
|
|
@@ -1808,9 +1818,36 @@ export function createComponent<
|
|
|
1808
1818
|
if (!groupContext || !groupEmitter) {
|
|
1809
1819
|
return
|
|
1810
1820
|
}
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1821
|
+
|
|
1822
|
+
const prevPseudo = groupContext.state.pseudo
|
|
1823
|
+
const shouldReplacePseudo =
|
|
1824
|
+
!prevPseudo ||
|
|
1825
|
+
// old/default state objects carry non-pseudo fields; replace once instead
|
|
1826
|
+
// of mutating the shared defaultComponentStateMounted object
|
|
1827
|
+
'unmounted' in prevPseudo ||
|
|
1828
|
+
'group' in prevPseudo ||
|
|
1829
|
+
'hasDynGroupChildren' in prevPseudo ||
|
|
1830
|
+
'transition' in prevPseudo
|
|
1831
|
+
const nextPseudo = shouldReplacePseudo ? {} : prevPseudo
|
|
1832
|
+
let didChange = shouldReplacePseudo
|
|
1833
|
+
|
|
1834
|
+
for (let i = 0; i < groupPseudoKeys.length; i++) {
|
|
1835
|
+
const key = groupPseudoKeys[i]
|
|
1836
|
+
const value = pseudo[key]
|
|
1837
|
+
if (nextPseudo[key] !== value) {
|
|
1838
|
+
nextPseudo[key] = value
|
|
1839
|
+
didChange = true
|
|
1840
|
+
} else if (didChange) {
|
|
1841
|
+
nextPseudo[key] = value
|
|
1842
|
+
}
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
if (!didChange) {
|
|
1846
|
+
return
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
groupContext.state.pseudo = nextPseudo
|
|
1850
|
+
groupEmitter.emit(groupContext.state)
|
|
1814
1851
|
}
|
|
1815
1852
|
|
|
1816
1853
|
// let hasLogged = false
|
|
@@ -140,12 +140,21 @@ export function expandStyle(
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
// native-only
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
// native-only logical expansions (RTL-aware inline props output RN-style
|
|
144
|
+
// names like marginStart/borderEndColor that aren't valid CSS on web)
|
|
145
|
+
if (key in nativeInlineExpansions) {
|
|
146
|
+
return nativeInlineExpansions[key].map((k) => [k, value])
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
|
|
150
|
+
// universal logical expansions — applied on both targets so atomic CSS
|
|
151
|
+
// generates one class per longhand. Otherwise `inset: 0` becomes a single
|
|
152
|
+
// `_inset-0px` class controlling four sub-properties, which silently breaks
|
|
153
|
+
// dedup/override against `top`/`left`/etc.
|
|
154
|
+
if (key in universalExpansions) {
|
|
155
|
+
return universalExpansions[key].map((k) => [k, value])
|
|
156
|
+
}
|
|
157
|
+
|
|
149
158
|
if (key in EXPANSIONS) {
|
|
150
159
|
return EXPANSIONS[key].map((k) => [k, value])
|
|
151
160
|
}
|
|
@@ -202,52 +211,62 @@ for (const parent in EXPANSIONS) {
|
|
|
202
211
|
EXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`)
|
|
203
212
|
}
|
|
204
213
|
|
|
205
|
-
//
|
|
206
|
-
|
|
207
|
-
|
|
214
|
+
// Logical expansions whose targets are physical longhands valid on both
|
|
215
|
+
// targets. Applied unconditionally so atomic CSS stays one-class-per-longhand:
|
|
216
|
+
// without this, `inset: 0` emits `_inset-0px` (one class, four sub-properties)
|
|
217
|
+
// and silently breaks dedup/override against `top`/`left`/etc.
|
|
218
|
+
const universalExpansions: Record<string, string[]> = {
|
|
219
|
+
// inset
|
|
220
|
+
inset: ['top', 'right', 'bottom', 'left'],
|
|
221
|
+
insetBlock: ['top', 'bottom'],
|
|
222
|
+
insetBlockStart: ['top'],
|
|
223
|
+
insetBlockEnd: ['bottom'],
|
|
224
|
+
// block-axis margin/padding
|
|
225
|
+
marginBlock: ['marginTop', 'marginBottom'],
|
|
226
|
+
marginBlockStart: ['marginTop'],
|
|
227
|
+
marginBlockEnd: ['marginBottom'],
|
|
228
|
+
paddingBlock: ['paddingTop', 'paddingBottom'],
|
|
229
|
+
paddingBlockStart: ['paddingTop'],
|
|
230
|
+
paddingBlockEnd: ['paddingBottom'],
|
|
231
|
+
// block-axis border
|
|
208
232
|
borderBlockColor: ['borderTopColor', 'borderBottomColor'],
|
|
209
|
-
borderInlineColor: ['borderEndColor', 'borderStartColor'],
|
|
210
233
|
borderBlockWidth: ['borderTopWidth', 'borderBottomWidth'],
|
|
211
|
-
borderInlineWidth: ['borderEndWidth', 'borderStartWidth'],
|
|
212
234
|
borderBlockStyle: ['borderTopStyle', 'borderBottomStyle'],
|
|
213
|
-
borderInlineStyle: ['borderEndStyle', 'borderStartStyle'],
|
|
214
235
|
borderBlockStartColor: ['borderTopColor'],
|
|
215
236
|
borderBlockEndColor: ['borderBottomColor'],
|
|
216
|
-
borderInlineStartColor: ['borderStartColor'],
|
|
217
|
-
borderInlineEndColor: ['borderEndColor'],
|
|
218
237
|
borderBlockStartWidth: ['borderTopWidth'],
|
|
219
238
|
borderBlockEndWidth: ['borderBottomWidth'],
|
|
220
|
-
borderInlineStartWidth: ['borderStartWidth'],
|
|
221
|
-
borderInlineEndWidth: ['borderEndWidth'],
|
|
222
239
|
borderBlockStartStyle: ['borderTopStyle'],
|
|
223
240
|
borderBlockEndStyle: ['borderBottomStyle'],
|
|
241
|
+
// logical sizing → physical width/height
|
|
242
|
+
minBlockSize: ['minHeight'],
|
|
243
|
+
maxBlockSize: ['maxHeight'],
|
|
244
|
+
minInlineSize: ['minWidth'],
|
|
245
|
+
maxInlineSize: ['maxWidth'],
|
|
246
|
+
blockSize: ['height'],
|
|
247
|
+
inlineSize: ['width'],
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Inline-axis logical expansions are native-only: their targets are RN-style
|
|
251
|
+
// RTL-aware names (marginStart/borderEndColor/etc.) which web's CSS hyphenator
|
|
252
|
+
// would emit as invalid CSS. On web these props pass through as native CSS
|
|
253
|
+
// logical properties, which the browser handles RTL-aware.
|
|
254
|
+
const nativeInlineExpansions: Record<string, string[]> = {
|
|
255
|
+
borderInlineColor: ['borderEndColor', 'borderStartColor'],
|
|
256
|
+
borderInlineWidth: ['borderEndWidth', 'borderStartWidth'],
|
|
257
|
+
borderInlineStyle: ['borderEndStyle', 'borderStartStyle'],
|
|
258
|
+
borderInlineStartColor: ['borderStartColor'],
|
|
259
|
+
borderInlineEndColor: ['borderEndColor'],
|
|
260
|
+
borderInlineStartWidth: ['borderStartWidth'],
|
|
261
|
+
borderInlineEndWidth: ['borderEndWidth'],
|
|
224
262
|
borderInlineStartStyle: ['borderStartStyle'],
|
|
225
263
|
borderInlineEndStyle: ['borderEndStyle'],
|
|
226
|
-
// logical margin/padding
|
|
227
|
-
marginBlock: ['marginTop', 'marginBottom'],
|
|
228
264
|
marginInline: ['marginEnd', 'marginStart'],
|
|
229
|
-
paddingBlock: ['paddingTop', 'paddingBottom'],
|
|
230
|
-
paddingInline: ['paddingEnd', 'paddingStart'],
|
|
231
|
-
marginBlockStart: ['marginTop'],
|
|
232
|
-
marginBlockEnd: ['marginBottom'],
|
|
233
265
|
marginInlineStart: ['marginStart'],
|
|
234
266
|
marginInlineEnd: ['marginEnd'],
|
|
235
|
-
|
|
236
|
-
paddingBlockEnd: ['paddingBottom'],
|
|
267
|
+
paddingInline: ['paddingEnd', 'paddingStart'],
|
|
237
268
|
paddingInlineStart: ['paddingStart'],
|
|
238
269
|
paddingInlineEnd: ['paddingEnd'],
|
|
239
|
-
// logical sizing
|
|
240
|
-
minBlockSize: ['minHeight'],
|
|
241
|
-
maxBlockSize: ['maxHeight'],
|
|
242
|
-
minInlineSize: ['minWidth'],
|
|
243
|
-
maxInlineSize: ['maxWidth'],
|
|
244
|
-
blockSize: ['height'],
|
|
245
|
-
inlineSize: ['width'],
|
|
246
|
-
// inset
|
|
247
|
-
inset: ['top', 'right', 'bottom', 'left'],
|
|
248
|
-
insetBlock: ['top', 'bottom'],
|
|
249
|
-
insetBlockStart: ['top'],
|
|
250
|
-
insetBlockEnd: ['bottom'],
|
|
251
270
|
insetInlineStart: ['left'],
|
|
252
271
|
insetInlineEnd: ['right'],
|
|
253
272
|
}
|