@tamagui/web 2.3.1 → 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.
@@ -36,7 +36,10 @@ function expandStyle(key, value) {
36
36
  }
37
37
  return;
38
38
  }
39
- if (key in nativeExpansions) return nativeExpansions[key].map(function (k) {
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 nativeExpansions = {
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
- paddingBlockStart: ["paddingTop"],
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","parent2","_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","parent","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(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 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,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,CAACI,KAAK,CAAC,CAAC,EAAE,CAACF,WAAW,GAAG,CAACD,KAAK,GAAG,OAAO,CAACI,IAAI,CAACL,OAAO,CAAC,MAAM,IAAI,IAAIC,KAAK,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,KAAK,CAACK,KAAK,MAAM,IAAI,IAAIJ,WAAW,KAAK,KAAK,CAAC,GAAGA,WAAW,GAAGF,OAAO,CAACO,MAAM,CAAC;EACpMC,UAAU,CAACR,OAAO,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,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;EAC1CC,YAAY,EAAE,CAAC,YAAY,EAAE,eAAe,CAAC;EAC7CC,aAAa,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;EAC7CC,gBAAgB,EAAE,CAAC,WAAW,CAAC;EAC/BC,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,iBAAiB,EAAE,CAAC,aAAa,CAAC;EAClCC,eAAe,EAAE,CAAC,WAAW,CAAC;EAC9BC,iBAAiB,EAAE,CAAC,YAAY,CAAC;EACjCC,eAAe,EAAE,CAAC,eAAe,CAAC;EAClCC,kBAAkB,EAAE,CAAC,cAAc,CAAC;EACpCC,gBAAgB,EAAE,CAAC,YAAY,CAAC;EAChCC,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,CAAC;EACrBC,KAAK,EAAE,CACN,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,CACN;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,SAAS3E,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,CAACI,KAAK,CAAC,CAAC,EAAE,CAACF,WAAW,GAAG,CAACD,KAAK,GAAG,OAAO,CAACI,IAAI,CAACL,OAAO,CAAC,MAAM,IAAI,IAAIC,KAAK,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,KAAK,CAACK,KAAK,MAAM,IAAI,IAAIJ,WAAW,KAAK,KAAK,CAAC,GAAGA,WAAW,GAAGF,OAAO,CAACO,MAAM,CAAC;EACpMC,UAAU,CAACR,OAAO,CAAC,GAAGQ,UAAU,CAACR,OAAO,CAAC,CAACS,GAAG,CAAC,UAASC,CAAC,EAAE;IACzD,OAAO,GAAGP,MAAM,GAAGO,CAAC,EAAE;EACvB,CAAC,CAAC;AACH,CAAC;AACD,SAASC,WAAWA,CAACC,GAAG,EAAEC,KA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E,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;AACD,IAAInD,sBAAsB,GAAG;EAC5BoD,iBAAiB,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;EACzDC,iBAAiB,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;EACzDC,iBAAiB,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;EACzDC,sBAAsB,EAAE,CAAC,kBAAkB,CAAC;EAC5CC,oBAAoB,EAAE,CAAC,gBAAgB,CAAC;EACxCC,sBAAsB,EAAE,CAAC,kBAAkB,CAAC;EAC5CC,oBAAoB,EAAE,CAAC,gBAAgB,CAAC;EACxCC,sBAAsB,EAAE,CAAC,kBAAkB,CAAC;EAC5CC,oBAAoB,EAAE,CAAC,gBAAgB,CAAC;EACxCC,YAAY,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;EAC1CC,iBAAiB,EAAE,CAAC,aAAa,CAAC;EAClCC,eAAe,EAAE,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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/web",
3
- "version": "2.3.1",
3
+ "version": "2.3.2-1782110552417",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Nate Wienert"
@@ -51,20 +51,20 @@
51
51
  "test:web": "vitest --typecheck --run"
52
52
  },
53
53
  "dependencies": {
54
- "@tamagui/compose-refs": "2.3.1",
55
- "@tamagui/constants": "2.3.1",
56
- "@tamagui/helpers": "2.3.1",
57
- "@tamagui/is-equal-shallow": "2.3.1",
58
- "@tamagui/native": "2.3.1",
59
- "@tamagui/normalize-css-color": "2.3.1",
60
- "@tamagui/timer": "2.3.1",
61
- "@tamagui/types": "2.3.1",
62
- "@tamagui/use-did-finish-ssr": "2.3.1",
63
- "@tamagui/use-event": "2.3.1",
64
- "@tamagui/use-force-update": "2.3.1"
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.1",
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",
@@ -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
- const nextState = { ...groupContext.state, pseudo }
1812
- groupEmitter.emit(nextState)
1813
- groupContext.state = nextState
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 key expansions (logical properties)
144
- if (key in nativeExpansions) {
145
- return nativeExpansions[key].map((k) => [k, value])
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
- // native-only expansions (logical properties not supported in RN)
206
- const nativeExpansions: Record<string, string[]> = {
207
- // logical border properties
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
- paddingBlockStart: ['paddingTop'],
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
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA6B/D,OAAO,KAAK,EAQV,YAAY,EAEZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EAOf,MAAM,SAAS,CAAA;AAahB,KAAK,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA;AAEpF,eAAO,MAAM,kBAAkB,wBAA+B,CAAA;AA8J9D,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,EACnD,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,SAAS,GAAG,KAAK,EACjB,UAAU,SAAS,MAAM,GAAG,KAAK,EACjC,YAAY,EAAE,YAAY,wEA+lD3B"}
1
+ {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA6B/D,OAAO,KAAK,EAQV,YAAY,EAEZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EAOf,MAAM,SAAS,CAAA;AAahB,KAAK,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC,CAAA;AAEpF,eAAO,MAAM,kBAAkB,wBAA+B,CAAA;AAwK9D,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,EACnD,GAAG,SAAS,cAAc,GAAG,cAAc,EAC3C,SAAS,GAAG,KAAK,EACjB,UAAU,SAAS,MAAM,GAAG,KAAK,EACjC,YAAY,EAAE,YAAY,wEA0nD3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"expandStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/expandStyle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA8D/C,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,GAAG,EACV,WAAW,GAAE,WAA8B,GAC1C,eAAe,CA6EjB"}
1
+ {"version":3,"file":"expandStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/expandStyle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA8D/C,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,GAAG,EACV,WAAW,GAAE,WAA8B,GAC1C,eAAe,CAsFjB"}