@tamagui/core 2.0.0-1768530912818 → 2.0.0-1768586279389

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.cjs CHANGED
@@ -1953,14 +1953,14 @@ function requireNormalizeColor() {
1953
1953
  return (int % 360 + 360) % 360 / 360;
1954
1954
  }
1955
1955
  function parse1(str) {
1956
- const num = parseFloat(str);
1957
- if (num < 0) {
1956
+ const num2 = parseFloat(str);
1957
+ if (num2 < 0) {
1958
1958
  return 0;
1959
1959
  }
1960
- if (num > 1) {
1960
+ if (num2 > 1) {
1961
1961
  return 255;
1962
1962
  }
1963
- return Math.round(num * 255);
1963
+ return Math.round(num2 * 255);
1964
1964
  }
1965
1965
  function parsePercentage(str) {
1966
1966
  const int = parseFloat(str);
@@ -8716,13 +8716,14 @@ var webOnlyStylePropsView = {
8716
8716
  borderLeftStyle: true,
8717
8717
  borderRightStyle: true,
8718
8718
  borderTopStyle: true,
8719
- boxSizing: true,
8719
+ // boxSizing: now supported in RN 0.77+ (New Architecture)
8720
8720
  caretColor: true,
8721
8721
  clipPath: true,
8722
8722
  contain: true,
8723
8723
  containerType: true,
8724
8724
  content: true,
8725
8725
  cursor: true,
8726
+ // NOTE: cursor is supported on iOS 17+ for trackpad/stylus
8726
8727
  float: true,
8727
8728
  mask: true,
8728
8729
  maskBorder: true,
@@ -8741,13 +8742,10 @@ var webOnlyStylePropsView = {
8741
8742
  maskRepeat: true,
8742
8743
  maskSize: true,
8743
8744
  maskType: true,
8744
- mixBlendMode: true,
8745
+ // mixBlendMode: now supported in RN 0.77+ (New Architecture)
8745
8746
  objectFit: true,
8746
8747
  objectPosition: true,
8747
- outlineOffset: true,
8748
- outlineStyle: true,
8749
- outlineWidth: true,
8750
- outlineColor: true,
8748
+ // outline*: now supported in RN 0.77+ (New Architecture)
8751
8749
  overflowBlock: true,
8752
8750
  overflowInline: true,
8753
8751
  overflowX: true,
@@ -8803,7 +8801,7 @@ var textColors = {
8803
8801
  zIndex: {
8804
8802
  zIndex: true
8805
8803
  },
8806
- color: __spreadValues({
8804
+ color: __spreadProps(__spreadValues({
8807
8805
  backgroundColor: true,
8808
8806
  borderColor: true,
8809
8807
  borderBlockStartColor: true,
@@ -8819,7 +8817,10 @@ var textColors = {
8819
8817
  borderEndColor: true,
8820
8818
  borderStartColor: true,
8821
8819
  shadowColor: true
8822
- }, textColors)
8820
+ }, textColors), {
8821
+ // outlineColor is supported on RN 0.77+ (New Architecture)
8822
+ outlineColor: true
8823
+ })
8823
8824
  }, stylePropsUnitless = {
8824
8825
  WebkitLineClamp: true,
8825
8826
  animationIterationCount: true,
@@ -8872,7 +8873,7 @@ var textColors = {
8872
8873
  rotateY: true,
8873
8874
  rotateX: true,
8874
8875
  rotateZ: true
8875
- }, stylePropsView = __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
8876
+ }, stylePropsView = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
8876
8877
  backfaceVisibility: true,
8877
8878
  borderBottomEndRadius: true,
8878
8879
  borderBottomStartRadius: true,
@@ -8962,12 +8963,13 @@ var textColors = {
8962
8963
  elevationAndroid: true
8963
8964
  } : {}), {
8964
8965
  boxShadow: true,
8965
- filter: true
8966
- }), !process.env.REACT_NATIVE_PRE_77 && {
8966
+ filter: true,
8967
+ // RN 0.76/0.77+ style props (New Architecture)
8967
8968
  boxSizing: true,
8968
8969
  mixBlendMode: true,
8970
+ isolation: true,
8969
8971
  outlineColor: true,
8970
- outlineSpread: true,
8972
+ outlineOffset: true,
8971
8973
  outlineStyle: true,
8972
8974
  outlineWidth: true
8973
8975
  }), stylePropsFont = {
@@ -9659,9 +9661,58 @@ var _loop = function(parent) {
9659
9661
  EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
9660
9662
  return `${prefix}${k}`;
9661
9663
  });
9664
+ }, num = function(v) {
9665
+ return Number.parseFloat(v) || 0;
9666
+ }, parseBoxShadowStr = function(s2) {
9667
+ return s2.split(/,(?![^(]*\))/).map(function(sh) {
9668
+ var p = sh.trim().split(/\s+/), i = p[0] === "inset" ? 1 : 0, o = {
9669
+ offsetX: num(p[i++]),
9670
+ offsetY: num(p[i++])
9671
+ };
9672
+ return p[0] === "inset" && (o.inset = true), p[i] && /^-?[\d.]/.test(p[i]) && (o.blurRadius = num(p[i++])), p[i] && /^-?[\d.]/.test(p[i]) && (o.spreadDistance = num(p[i++])), p[i] && (o.color = p.slice(i).join(" ")), o;
9673
+ });
9674
+ }, simpleFilters = /* @__PURE__ */ new Set(["brightness", "opacity", "contrast", "grayscale", "invert", "saturate", "sepia", "blur"]), parseFilterStr = function(s2) {
9675
+ var r = [], _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
9676
+ try {
9677
+ for (var _iterator = s2.matchAll(/(\w+)\(([^)]+)\)/g)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
9678
+ var [, fn, val] = _step.value, n = +val || 0;
9679
+ if (simpleFilters.has(fn)) r.push({
9680
+ [fn]: n
9681
+ });
9682
+ else if (fn === "hueRotate" || fn === "hue-rotate") r.push({
9683
+ hueRotate: val
9684
+ });
9685
+ else if (fn === "dropShadow" || fn === "drop-shadow") {
9686
+ var p = val.trim().split(/\s+/), ds = {
9687
+ offsetX: num(p[0]),
9688
+ offsetY: num(p[1])
9689
+ };
9690
+ p[2] && /^-?[\d.]/.test(p[2]) ? (ds.blurRadius = num(p[2]), p[3] && (ds.color = p.slice(3).join(" "))) : p[2] && (ds.color = p.slice(2).join(" ")), r.push({
9691
+ dropShadow: ds
9692
+ });
9693
+ }
9694
+ }
9695
+ } catch (err) {
9696
+ _didIteratorError = true, _iteratorError = err;
9697
+ } finally {
9698
+ try {
9699
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
9700
+ } finally {
9701
+ if (_didIteratorError) throw _iteratorError;
9702
+ }
9703
+ }
9704
+ return r;
9662
9705
  };
9663
9706
  function expandStyle(key, value) {
9664
9707
  if (isAndroid && key === "elevationAndroid") return [["elevation", value]];
9708
+ if (key === "boxShadow") {
9709
+ if (typeof value == "string") return [["boxShadow", parseBoxShadowStr(value)]];
9710
+ if (value && !Array.isArray(value)) return [["boxShadow", [value]]];
9711
+ }
9712
+ if (key === "filter") {
9713
+ if (typeof value == "string") return [["filter", parseFilterStr(value)]];
9714
+ if (value && !Array.isArray(value)) return [["filter", [value]]];
9715
+ }
9665
9716
  if (key in EXPANSIONS) return EXPANSIONS[key].map(function(key2) {
9666
9717
  return [key2, value];
9667
9718
  });
@@ -9670,18 +9721,17 @@ function expandStyle(key, value) {
9670
9721
  });
9671
9722
  if (key in webToNativeDynamicExpansion) return webToNativeDynamicExpansion[key](value);
9672
9723
  }
9673
- var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], xy = ["X", "Y"], EXPANSIONS = __spreadValues({
9724
+ var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], EXPANSIONS = {
9674
9725
  borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
9675
9726
  borderRadius: ["TopLeftRadius", "TopRightRadius", "BottomRightRadius", "BottomLeftRadius"],
9676
9727
  borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
9677
9728
  margin: all,
9678
9729
  marginHorizontal: horiz,
9679
9730
  marginVertical: vert,
9680
- overscrollBehavior: xy,
9681
9731
  padding: all,
9682
9732
  paddingHorizontal: horiz,
9683
9733
  paddingVertical: vert
9684
- }, isWeb);
9734
+ };
9685
9735
  for (var parent in EXPANSIONS) _loop(parent);
9686
9736
  var cache$1 = /* @__PURE__ */ new WeakMap(), getVariantExtras = function(styleState) {
9687
9737
  if (cache$1.has(styleState)) return cache$1.get(styleState);
@@ -9821,14 +9871,47 @@ function _type_of$3(obj) {
9821
9871
  "@swc/helpers - typeof";
9822
9872
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
9823
9873
  }
9824
- var shorthandStringProps = {
9825
- boxShadow: 1,
9826
- border: 1,
9827
- borderTop: 1,
9828
- borderRight: 1,
9829
- borderBottom: 1,
9830
- borderLeft: 1,
9831
- background: 1
9874
+ var resolveTok = function(v, cat, sp, ss) {
9875
+ if (typeof v == "string" && v[0] === "$") {
9876
+ var r = getTokenForKey(cat, v, sp, ss);
9877
+ return cat === "size" ? r != null && +r || 0 : r != null ? String(r) : v;
9878
+ }
9879
+ return cat === "size" ? typeof v == "number" ? v : +v || 0 : v;
9880
+ }, boxShadowObjResolve = function(v, sp, ss) {
9881
+ return (Array.isArray(v) ? v : [v]).map(function(o) {
9882
+ return __spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, o.inset && {
9883
+ inset: true
9884
+ }), {
9885
+ offsetX: resolveTok(o.offsetX, "size", sp, ss),
9886
+ offsetY: resolveTok(o.offsetY, "size", sp, ss)
9887
+ }), o.blurRadius != null && {
9888
+ blurRadius: resolveTok(o.blurRadius, "size", sp, ss)
9889
+ }), o.spreadDistance != null && {
9890
+ spreadDistance: resolveTok(o.spreadDistance, "size", sp, ss)
9891
+ }), o.color != null && {
9892
+ color: resolveTok(o.color, "color", sp, ss)
9893
+ });
9894
+ });
9895
+ }, filterObjResolve = function(v, sp, ss) {
9896
+ return (Array.isArray(v) ? v : [v]).map(function(o) {
9897
+ if ("blur" in o) return {
9898
+ blur: resolveTok(o.blur, "size", sp, ss)
9899
+ };
9900
+ if ("dropShadow" in o) {
9901
+ var ds = o.dropShadow;
9902
+ return {
9903
+ dropShadow: __spreadValues(__spreadValues({
9904
+ offsetX: resolveTok(ds.offsetX, "size", sp, ss),
9905
+ offsetY: resolveTok(ds.offsetY, "size", sp, ss)
9906
+ }, ds.blurRadius != null && {
9907
+ blurRadius: resolveTok(ds.blurRadius, "size", sp, ss)
9908
+ }), ds.color != null && {
9909
+ color: resolveTok(ds.color, "color", sp, ss)
9910
+ })
9911
+ };
9912
+ }
9913
+ return o;
9914
+ });
9832
9915
  }, propMapper = function(key, value, styleState, disabled, map) {
9833
9916
  if (disabled) return map(key, value);
9834
9917
  if (lastFontFamilyToken = null, !(!isAndroid && key === "elevationAndroid")) {
@@ -9857,13 +9940,13 @@ var shorthandStringProps = {
9857
9940
  }
9858
9941
  styleProps2.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
9859
9942
  var originalValue = value;
9860
- if (value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps2, styleState) : (
9861
- /* Handle CSS shorthand strings with embedded $variables (e.g., boxShadow="0 0 10px $red") */
9862
- key in shorthandStringProps && typeof value == "string" && value.includes("$") ? value = value.replace(/\$[\w.-]+/g, function(token) {
9863
- var resolved = getTokenForKey("color", token, styleProps2, styleState);
9864
- return resolved != null ? String(resolved) : token;
9865
- }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps2.resolveValues) : isRemValue(value) && (value = resolveRem(value))
9866
- )), value != null) {
9943
+ if (value != null && (key === "boxShadow" && (typeof value > "u" ? "undefined" : _type_of$3(value)) === "object" ? value = boxShadowObjResolve(value, styleProps2, styleState) : key === "filter" && (typeof value > "u" ? "undefined" : _type_of$3(value)) === "object" ? value = filterObjResolve(value, styleProps2, styleState) : typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps2, styleState) : key === "boxShadow" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
9944
+ var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps2, styleState);
9945
+ return r != null ? String(r) : t2;
9946
+ }) : key === "filter" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
9947
+ var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps2, styleState);
9948
+ return r != null ? String(r) : t2;
9949
+ }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps2.resolveValues) : isRemValue(value) && (value = resolveRem(value))), value != null) {
9867
9950
  key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
9868
9951
  var expanded = styleProps2.noExpand ? null : expandStyle(key, value);
9869
9952
  if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
@@ -868,13 +868,14 @@ var webOnlyStylePropsView = {
868
868
  borderLeftStyle: true,
869
869
  borderRightStyle: true,
870
870
  borderTopStyle: true,
871
- boxSizing: true,
871
+ // boxSizing: now supported in RN 0.77+ (New Architecture)
872
872
  caretColor: true,
873
873
  clipPath: true,
874
874
  contain: true,
875
875
  containerType: true,
876
876
  content: true,
877
877
  cursor: true,
878
+ // NOTE: cursor is supported on iOS 17+ for trackpad/stylus
878
879
  float: true,
879
880
  mask: true,
880
881
  maskBorder: true,
@@ -893,13 +894,10 @@ var webOnlyStylePropsView = {
893
894
  maskRepeat: true,
894
895
  maskSize: true,
895
896
  maskType: true,
896
- mixBlendMode: true,
897
+ // mixBlendMode: now supported in RN 0.77+ (New Architecture)
897
898
  objectFit: true,
898
899
  objectPosition: true,
899
- outlineOffset: true,
900
- outlineStyle: true,
901
- outlineWidth: true,
902
- outlineColor: true,
900
+ // outline*: now supported in RN 0.77+ (New Architecture)
903
901
  overflowBlock: true,
904
902
  overflowInline: true,
905
903
  overflowX: true,
@@ -955,7 +953,7 @@ var textColors = {
955
953
  zIndex: {
956
954
  zIndex: true
957
955
  },
958
- color: __spreadValues({
956
+ color: __spreadProps(__spreadValues({
959
957
  backgroundColor: true,
960
958
  borderColor: true,
961
959
  borderBlockStartColor: true,
@@ -971,7 +969,10 @@ var textColors = {
971
969
  borderEndColor: true,
972
970
  borderStartColor: true,
973
971
  shadowColor: true
974
- }, textColors)
972
+ }, textColors), {
973
+ // outlineColor is supported on RN 0.77+ (New Architecture)
974
+ outlineColor: true
975
+ })
975
976
  }, stylePropsUnitless = {
976
977
  WebkitLineClamp: true,
977
978
  animationIterationCount: true,
@@ -1024,7 +1025,7 @@ var textColors = {
1024
1025
  rotateY: true,
1025
1026
  rotateX: true,
1026
1027
  rotateZ: true
1027
- }, stylePropsView = __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
1028
+ }, stylePropsView = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
1028
1029
  backfaceVisibility: true,
1029
1030
  borderBottomEndRadius: true,
1030
1031
  borderBottomStartRadius: true,
@@ -1114,12 +1115,13 @@ var textColors = {
1114
1115
  elevationAndroid: true
1115
1116
  } : {}), {
1116
1117
  boxShadow: true,
1117
- filter: true
1118
- }), !process.env.REACT_NATIVE_PRE_77 && {
1118
+ filter: true,
1119
+ // RN 0.76/0.77+ style props (New Architecture)
1119
1120
  boxSizing: true,
1120
1121
  mixBlendMode: true,
1122
+ isolation: true,
1121
1123
  outlineColor: true,
1122
- outlineSpread: true,
1124
+ outlineOffset: true,
1123
1125
  outlineStyle: true,
1124
1126
  outlineWidth: true
1125
1127
  }), stylePropsFont = {
@@ -1851,14 +1853,14 @@ function requireNormalizeColor() {
1851
1853
  return (int % 360 + 360) % 360 / 360;
1852
1854
  }
1853
1855
  function parse1(str) {
1854
- const num = parseFloat(str);
1855
- if (num < 0) {
1856
+ const num2 = parseFloat(str);
1857
+ if (num2 < 0) {
1856
1858
  return 0;
1857
1859
  }
1858
- if (num > 1) {
1860
+ if (num2 > 1) {
1859
1861
  return 255;
1860
1862
  }
1861
- return Math.round(num * 255);
1863
+ return Math.round(num2 * 255);
1862
1864
  }
1863
1865
  function parsePercentage(str) {
1864
1866
  const int = parseFloat(str);
@@ -2352,9 +2354,58 @@ var _loop = function(parent) {
2352
2354
  EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
2353
2355
  return `${prefix}${k}`;
2354
2356
  });
2357
+ }, num = function(v) {
2358
+ return Number.parseFloat(v) || 0;
2359
+ }, parseBoxShadowStr = function(s2) {
2360
+ return s2.split(/,(?![^(]*\))/).map(function(sh) {
2361
+ var p = sh.trim().split(/\s+/), i = p[0] === "inset" ? 1 : 0, o = {
2362
+ offsetX: num(p[i++]),
2363
+ offsetY: num(p[i++])
2364
+ };
2365
+ return p[0] === "inset" && (o.inset = true), p[i] && /^-?[\d.]/.test(p[i]) && (o.blurRadius = num(p[i++])), p[i] && /^-?[\d.]/.test(p[i]) && (o.spreadDistance = num(p[i++])), p[i] && (o.color = p.slice(i).join(" ")), o;
2366
+ });
2367
+ }, simpleFilters = /* @__PURE__ */ new Set(["brightness", "opacity", "contrast", "grayscale", "invert", "saturate", "sepia", "blur"]), parseFilterStr = function(s2) {
2368
+ var r = [], _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
2369
+ try {
2370
+ for (var _iterator = s2.matchAll(/(\w+)\(([^)]+)\)/g)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2371
+ var [, fn, val] = _step.value, n = +val || 0;
2372
+ if (simpleFilters.has(fn)) r.push({
2373
+ [fn]: n
2374
+ });
2375
+ else if (fn === "hueRotate" || fn === "hue-rotate") r.push({
2376
+ hueRotate: val
2377
+ });
2378
+ else if (fn === "dropShadow" || fn === "drop-shadow") {
2379
+ var p = val.trim().split(/\s+/), ds = {
2380
+ offsetX: num(p[0]),
2381
+ offsetY: num(p[1])
2382
+ };
2383
+ p[2] && /^-?[\d.]/.test(p[2]) ? (ds.blurRadius = num(p[2]), p[3] && (ds.color = p.slice(3).join(" "))) : p[2] && (ds.color = p.slice(2).join(" ")), r.push({
2384
+ dropShadow: ds
2385
+ });
2386
+ }
2387
+ }
2388
+ } catch (err) {
2389
+ _didIteratorError = true, _iteratorError = err;
2390
+ } finally {
2391
+ try {
2392
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2393
+ } finally {
2394
+ if (_didIteratorError) throw _iteratorError;
2395
+ }
2396
+ }
2397
+ return r;
2355
2398
  };
2356
2399
  function expandStyle(key, value) {
2357
2400
  if (isAndroid && key === "elevationAndroid") return [["elevation", value]];
2401
+ if (key === "boxShadow") {
2402
+ if (typeof value == "string") return [["boxShadow", parseBoxShadowStr(value)]];
2403
+ if (value && !Array.isArray(value)) return [["boxShadow", [value]]];
2404
+ }
2405
+ if (key === "filter") {
2406
+ if (typeof value == "string") return [["filter", parseFilterStr(value)]];
2407
+ if (value && !Array.isArray(value)) return [["filter", [value]]];
2408
+ }
2358
2409
  if (key in EXPANSIONS) return EXPANSIONS[key].map(function(key2) {
2359
2410
  return [key2, value];
2360
2411
  });
@@ -2363,18 +2414,17 @@ function expandStyle(key, value) {
2363
2414
  });
2364
2415
  if (key in webToNativeDynamicExpansion) return webToNativeDynamicExpansion[key](value);
2365
2416
  }
2366
- var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], xy = ["X", "Y"], EXPANSIONS = __spreadValues({
2417
+ var all = ["Top", "Right", "Bottom", "Left"], horiz = ["Right", "Left"], vert = ["Top", "Bottom"], EXPANSIONS = {
2367
2418
  borderColor: ["TopColor", "RightColor", "BottomColor", "LeftColor"],
2368
2419
  borderRadius: ["TopLeftRadius", "TopRightRadius", "BottomRightRadius", "BottomLeftRadius"],
2369
2420
  borderWidth: ["TopWidth", "RightWidth", "BottomWidth", "LeftWidth"],
2370
2421
  margin: all,
2371
2422
  marginHorizontal: horiz,
2372
2423
  marginVertical: vert,
2373
- overscrollBehavior: xy,
2374
2424
  padding: all,
2375
2425
  paddingHorizontal: horiz,
2376
2426
  paddingVertical: vert
2377
- }, isWeb);
2427
+ };
2378
2428
  for (var parent in EXPANSIONS) _loop(parent);
2379
2429
  var cache$1 = /* @__PURE__ */ new WeakMap(), getVariantExtras = function(styleState) {
2380
2430
  if (cache$1.has(styleState)) return cache$1.get(styleState);
@@ -2515,14 +2565,47 @@ function _type_of$3(obj) {
2515
2565
  "@swc/helpers - typeof";
2516
2566
  return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
2517
2567
  }
2518
- var shorthandStringProps = {
2519
- boxShadow: 1,
2520
- border: 1,
2521
- borderTop: 1,
2522
- borderRight: 1,
2523
- borderBottom: 1,
2524
- borderLeft: 1,
2525
- background: 1
2568
+ var resolveTok = function(v, cat, sp, ss) {
2569
+ if (typeof v == "string" && v[0] === "$") {
2570
+ var r = getTokenForKey(cat, v, sp, ss);
2571
+ return cat === "size" ? r != null && +r || 0 : r != null ? String(r) : v;
2572
+ }
2573
+ return cat === "size" ? typeof v == "number" ? v : +v || 0 : v;
2574
+ }, boxShadowObjResolve = function(v, sp, ss) {
2575
+ return (Array.isArray(v) ? v : [v]).map(function(o) {
2576
+ return __spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, o.inset && {
2577
+ inset: true
2578
+ }), {
2579
+ offsetX: resolveTok(o.offsetX, "size", sp, ss),
2580
+ offsetY: resolveTok(o.offsetY, "size", sp, ss)
2581
+ }), o.blurRadius != null && {
2582
+ blurRadius: resolveTok(o.blurRadius, "size", sp, ss)
2583
+ }), o.spreadDistance != null && {
2584
+ spreadDistance: resolveTok(o.spreadDistance, "size", sp, ss)
2585
+ }), o.color != null && {
2586
+ color: resolveTok(o.color, "color", sp, ss)
2587
+ });
2588
+ });
2589
+ }, filterObjResolve = function(v, sp, ss) {
2590
+ return (Array.isArray(v) ? v : [v]).map(function(o) {
2591
+ if ("blur" in o) return {
2592
+ blur: resolveTok(o.blur, "size", sp, ss)
2593
+ };
2594
+ if ("dropShadow" in o) {
2595
+ var ds = o.dropShadow;
2596
+ return {
2597
+ dropShadow: __spreadValues(__spreadValues({
2598
+ offsetX: resolveTok(ds.offsetX, "size", sp, ss),
2599
+ offsetY: resolveTok(ds.offsetY, "size", sp, ss)
2600
+ }, ds.blurRadius != null && {
2601
+ blurRadius: resolveTok(ds.blurRadius, "size", sp, ss)
2602
+ }), ds.color != null && {
2603
+ color: resolveTok(ds.color, "color", sp, ss)
2604
+ })
2605
+ };
2606
+ }
2607
+ return o;
2608
+ });
2526
2609
  }, propMapper = function(key, value, styleState, disabled, map) {
2527
2610
  if (disabled) return map(key, value);
2528
2611
  if (lastFontFamilyToken = null, !(!isAndroid && key === "elevationAndroid")) {
@@ -2551,13 +2634,13 @@ var shorthandStringProps = {
2551
2634
  }
2552
2635
  styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
2553
2636
  var originalValue = value;
2554
- if (value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : (
2555
- /* Handle CSS shorthand strings with embedded $variables (e.g., boxShadow="0 0 10px $red") */
2556
- key in shorthandStringProps && typeof value == "string" && value.includes("$") ? value = value.replace(/\$[\w.-]+/g, function(token) {
2557
- var resolved = getTokenForKey("color", token, styleProps, styleState);
2558
- return resolved != null ? String(resolved) : token;
2559
- }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps.resolveValues) : isRemValue(value) && (value = resolveRem(value))
2560
- )), value != null) {
2637
+ if (value != null && (key === "boxShadow" && (typeof value > "u" ? "undefined" : _type_of$3(value)) === "object" ? value = boxShadowObjResolve(value, styleProps, styleState) : key === "filter" && (typeof value > "u" ? "undefined" : _type_of$3(value)) === "object" ? value = filterObjResolve(value, styleProps, styleState) : typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : key === "boxShadow" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
2638
+ var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps, styleState);
2639
+ return r != null ? String(r) : t2;
2640
+ }) : key === "filter" && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t2) {
2641
+ var cat = /^\$-?\d/.test(t2) ? "size" : "color", r = getTokenForKey(cat, t2, styleProps, styleState);
2642
+ return r != null ? String(r) : t2;
2643
+ }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps.resolveValues) : isRemValue(value) && (value = resolveRem(value))), value != null) {
2561
2644
  key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
2562
2645
  var expanded = styleProps.noExpand ? null : expandStyle(key, value);
2563
2646
  if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "2.0.0-1768530912818",
3
+ "version": "2.0.0-1768586279389",
4
4
  "type": "module",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/cjs",
@@ -33,18 +33,18 @@
33
33
  "native-test.d.ts"
34
34
  ],
35
35
  "dependencies": {
36
- "@tamagui/helpers": "2.0.0-1768530912818",
37
- "@tamagui/react-native-media-driver": "2.0.0-1768530912818",
38
- "@tamagui/react-native-use-pressable": "2.0.0-1768530912818",
39
- "@tamagui/react-native-use-responder-events": "2.0.0-1768530912818",
40
- "@tamagui/use-element-layout": "2.0.0-1768530912818",
41
- "@tamagui/use-event": "2.0.0-1768530912818",
42
- "@tamagui/web": "2.0.0-1768530912818"
36
+ "@tamagui/helpers": "2.0.0-1768586279389",
37
+ "@tamagui/react-native-media-driver": "2.0.0-1768586279389",
38
+ "@tamagui/react-native-use-pressable": "2.0.0-1768586279389",
39
+ "@tamagui/react-native-use-responder-events": "2.0.0-1768586279389",
40
+ "@tamagui/use-element-layout": "2.0.0-1768586279389",
41
+ "@tamagui/use-event": "2.0.0-1768586279389",
42
+ "@tamagui/web": "2.0.0-1768586279389"
43
43
  },
44
44
  "devDependencies": {
45
- "@tamagui/build": "2.0.0-1768530912818",
46
- "@tamagui/native-bundle": "2.0.0-1768530912818",
47
- "@tamagui/react-native-web-lite": "2.0.0-1768530912818",
45
+ "@tamagui/build": "2.0.0-1768586279389",
46
+ "@tamagui/native-bundle": "2.0.0-1768586279389",
47
+ "@tamagui/react-native-web-lite": "2.0.0-1768586279389",
48
48
  "@testing-library/react": "^16.1.0",
49
49
  "csstype": "^3.0.10",
50
50
  "react": "*",