@tamagui/core 2.0.0-rc.1 → 2.0.0-rc.1-1770183079077

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
@@ -8382,8 +8382,8 @@ function loadAnimationDriver(name, driver) {
8382
8382
  };
8383
8383
  }
8384
8384
  function getGroupPropParts(groupProp) {
8385
- var mediaQueries = getMedia(), [_2, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
8386
- return media ? pseudo = part4 : pseudo = part3, {
8385
+ var m = getMedia(), [_2, name, a, b, c] = groupProp.split("-"), m2 = a && b ? `${a}-${b}` : "", media = m2 && m2 in m && m2 || a && a in m && a || void 0, pseudo = media ? media === m2 ? c : b ? `${b}${c ? `-${c}` : ""}` : void 0 : a ? `${a}${b ? `-${b}` : ""}${c ? `-${c}` : ""}` : void 0;
8386
+ return {
8387
8387
  name,
8388
8388
  pseudo,
8389
8389
  media
@@ -8692,10 +8692,7 @@ var webOnlyStylePropsView = {
8692
8692
  textWrap: true,
8693
8693
  backdropFilter: true,
8694
8694
  WebkitBackdropFilter: true,
8695
- // These background-* props are web-only CSS, but NOT backgroundColor
8696
8695
  background: true,
8697
- // CSS border shorthand (e.g., "1px solid red") - RN only supports individual props
8698
- border: true,
8699
8696
  borderTop: true,
8700
8697
  borderRight: true,
8701
8698
  borderBottom: true,
@@ -8703,7 +8700,6 @@ var webOnlyStylePropsView = {
8703
8700
  backgroundAttachment: true,
8704
8701
  backgroundBlendMode: true,
8705
8702
  backgroundClip: true,
8706
- // backgroundImage: now cross-platform via experimental_backgroundImage in RN 0.76+
8707
8703
  backgroundOrigin: true,
8708
8704
  backgroundPosition: true,
8709
8705
  backgroundRepeat: true,
@@ -8713,13 +8709,11 @@ var webOnlyStylePropsView = {
8713
8709
  borderLeftStyle: true,
8714
8710
  borderRightStyle: true,
8715
8711
  borderTopStyle: true,
8716
- // boxSizing: now supported in RN 0.77+ (New Architecture)
8717
8712
  caretColor: true,
8718
8713
  clipPath: true,
8719
8714
  contain: true,
8720
8715
  containerType: true,
8721
8716
  content: true,
8722
- // cursor: now cross-platform - supported on iOS 17+ (trackpad/stylus) with limited values
8723
8717
  float: true,
8724
8718
  mask: true,
8725
8719
  maskBorder: true,
@@ -8738,10 +8732,8 @@ var webOnlyStylePropsView = {
8738
8732
  maskRepeat: true,
8739
8733
  maskSize: true,
8740
8734
  maskType: true,
8741
- // mixBlendMode: now supported in RN 0.77+ (New Architecture)
8742
8735
  objectFit: true,
8743
8736
  objectPosition: true,
8744
- // outline*: now supported in RN 0.77+ (New Architecture)
8745
8737
  overflowBlock: true,
8746
8738
  overflowInline: true,
8747
8739
  overflowX: true,
@@ -9674,6 +9666,31 @@ __spreadValues({}, stylePropsAll);
9674
9666
  function normalizeValueWithProperty(value) {
9675
9667
  return value;
9676
9668
  }
9669
+ var borderStyles = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"]);
9670
+ function parseBorderShorthand(value) {
9671
+ if (value === "none" || value === "0") return [["borderTopWidth", 0], ["borderRightWidth", 0], ["borderBottomWidth", 0], ["borderLeftWidth", 0], ["borderStyle", "solid"]];
9672
+ var parts = value.trim().split(/\s+/), borderWidth, borderStyle, borderColor, _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
9673
+ try {
9674
+ for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
9675
+ var part = _step.value;
9676
+ if (borderStyles.has(part)) borderStyle = part;
9677
+ else if (/^[\d.]+(?:px|em|rem|%|pt|vw|vh)?$/.test(part)) {
9678
+ var num = parseFloat(part);
9679
+ borderWidth = part.endsWith("px") || !part.match(/[a-z%]/i) ? num : part;
9680
+ } else borderColor = part;
9681
+ }
9682
+ } catch (err) {
9683
+ _didIteratorError = true, _iteratorError = err;
9684
+ } finally {
9685
+ try {
9686
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
9687
+ } finally {
9688
+ if (_didIteratorError) throw _iteratorError;
9689
+ }
9690
+ }
9691
+ var result = [];
9692
+ return borderWidth !== void 0 && (result.push(["borderTopWidth", borderWidth]), result.push(["borderRightWidth", borderWidth]), result.push(["borderBottomWidth", borderWidth]), result.push(["borderLeftWidth", borderWidth])), borderStyle !== void 0 && result.push(["borderStyle", borderStyle]), borderColor !== void 0 && (result.push(["borderTopColor", borderColor]), result.push(["borderRightColor", borderColor]), result.push(["borderBottomColor", borderColor]), result.push(["borderLeftColor", borderColor])), result.length > 0 ? result : void 0;
9693
+ }
9677
9694
  var _loop = function(parent) {
9678
9695
  var _exec, _exec_index, 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);
9679
9696
  EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
@@ -9693,6 +9710,13 @@ function expandStyle(key, value) {
9693
9710
  return value === "fixed" || value === "sticky" ? [["position", "absolute"]] : void 0;
9694
9711
  case "backgroundImage":
9695
9712
  return [["experimental_backgroundImage", value]];
9713
+ case "border": {
9714
+ if (typeof value == "string") {
9715
+ var parsed = parseBorderShorthand(value);
9716
+ if (parsed) return parsed;
9717
+ }
9718
+ return;
9719
+ }
9696
9720
  }
9697
9721
  if (key in nativeExpansions) return nativeExpansions[key].map(function(k) {
9698
9722
  return [k, value];
@@ -9932,7 +9956,7 @@ var propMapper = function(key, value, styleState, disabled, map) {
9932
9956
  }
9933
9957
  styleProps2.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
9934
9958
  var originalValue = value;
9935
- if (value != null && (typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps2, styleState) : (key === "boxShadow" || key === "textShadow" || key === "filter" || key === "backgroundImage") && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t) {
9959
+ if (value != null && (typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps2, styleState) : (key === "boxShadow" || key === "textShadow" || key === "filter" || key === "backgroundImage" || key === "border") && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t) {
9936
9960
  var r = getTokenForKey("size", t, styleProps2, styleState);
9937
9961
  return r == null && (r = getTokenForKey("color", t, styleProps2, styleState)), r != null ? String(r) : t;
9938
9962
  }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps2.resolveValues) : isRemValue(value) && (value = resolveRem(value))), value != null) {
@@ -317,8 +317,8 @@ function loadAnimationDriver(name, driver) {
317
317
  };
318
318
  }
319
319
  function getGroupPropParts(groupProp) {
320
- var mediaQueries = getMedia(), [_2, name, part3, part4] = groupProp.split("-"), pseudo, media = part3 in mediaQueries ? part3 : void 0;
321
- return media ? pseudo = part4 : pseudo = part3, {
320
+ var m = getMedia(), [_2, name, a, b, c] = groupProp.split("-"), m2 = a && b ? `${a}-${b}` : "", media = m2 && m2 in m && m2 || a && a in m && a || void 0, pseudo = media ? media === m2 ? c : b ? `${b}${c ? `-${c}` : ""}` : void 0 : a ? `${a}${b ? `-${b}` : ""}${c ? `-${c}` : ""}` : void 0;
321
+ return {
322
322
  name,
323
323
  pseudo,
324
324
  media
@@ -627,10 +627,7 @@ var webOnlyStylePropsView = {
627
627
  textWrap: true,
628
628
  backdropFilter: true,
629
629
  WebkitBackdropFilter: true,
630
- // These background-* props are web-only CSS, but NOT backgroundColor
631
630
  background: true,
632
- // CSS border shorthand (e.g., "1px solid red") - RN only supports individual props
633
- border: true,
634
631
  borderTop: true,
635
632
  borderRight: true,
636
633
  borderBottom: true,
@@ -638,7 +635,6 @@ var webOnlyStylePropsView = {
638
635
  backgroundAttachment: true,
639
636
  backgroundBlendMode: true,
640
637
  backgroundClip: true,
641
- // backgroundImage: now cross-platform via experimental_backgroundImage in RN 0.76+
642
638
  backgroundOrigin: true,
643
639
  backgroundPosition: true,
644
640
  backgroundRepeat: true,
@@ -648,13 +644,11 @@ var webOnlyStylePropsView = {
648
644
  borderLeftStyle: true,
649
645
  borderRightStyle: true,
650
646
  borderTopStyle: true,
651
- // boxSizing: now supported in RN 0.77+ (New Architecture)
652
647
  caretColor: true,
653
648
  clipPath: true,
654
649
  contain: true,
655
650
  containerType: true,
656
651
  content: true,
657
- // cursor: now cross-platform - supported on iOS 17+ (trackpad/stylus) with limited values
658
652
  float: true,
659
653
  mask: true,
660
654
  maskBorder: true,
@@ -673,10 +667,8 @@ var webOnlyStylePropsView = {
673
667
  maskRepeat: true,
674
668
  maskSize: true,
675
669
  maskType: true,
676
- // mixBlendMode: now supported in RN 0.77+ (New Architecture)
677
670
  objectFit: true,
678
671
  objectPosition: true,
679
- // outline*: now supported in RN 0.77+ (New Architecture)
680
672
  overflowBlock: true,
681
673
  overflowInline: true,
682
674
  overflowX: true,
@@ -2153,6 +2145,31 @@ __spreadValues({}, stylePropsAll);
2153
2145
  function normalizeValueWithProperty(value) {
2154
2146
  return value;
2155
2147
  }
2148
+ var borderStyles = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"]);
2149
+ function parseBorderShorthand(value) {
2150
+ if (value === "none" || value === "0") return [["borderTopWidth", 0], ["borderRightWidth", 0], ["borderBottomWidth", 0], ["borderLeftWidth", 0], ["borderStyle", "solid"]];
2151
+ var parts = value.trim().split(/\s+/), borderWidth, borderStyle, borderColor, _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
2152
+ try {
2153
+ for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2154
+ var part = _step.value;
2155
+ if (borderStyles.has(part)) borderStyle = part;
2156
+ else if (/^[\d.]+(?:px|em|rem|%|pt|vw|vh)?$/.test(part)) {
2157
+ var num = parseFloat(part);
2158
+ borderWidth = part.endsWith("px") || !part.match(/[a-z%]/i) ? num : part;
2159
+ } else borderColor = part;
2160
+ }
2161
+ } catch (err) {
2162
+ _didIteratorError = true, _iteratorError = err;
2163
+ } finally {
2164
+ try {
2165
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
2166
+ } finally {
2167
+ if (_didIteratorError) throw _iteratorError;
2168
+ }
2169
+ }
2170
+ var result = [];
2171
+ return borderWidth !== void 0 && (result.push(["borderTopWidth", borderWidth]), result.push(["borderRightWidth", borderWidth]), result.push(["borderBottomWidth", borderWidth]), result.push(["borderLeftWidth", borderWidth])), borderStyle !== void 0 && result.push(["borderStyle", borderStyle]), borderColor !== void 0 && (result.push(["borderTopColor", borderColor]), result.push(["borderRightColor", borderColor]), result.push(["borderBottomColor", borderColor]), result.push(["borderLeftColor", borderColor])), result.length > 0 ? result : void 0;
2172
+ }
2156
2173
  var _loop = function(parent) {
2157
2174
  var _exec, _exec_index, 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);
2158
2175
  EXPANSIONS[parent] = EXPANSIONS[parent].map(function(k) {
@@ -2172,6 +2189,13 @@ function expandStyle(key, value) {
2172
2189
  return value === "fixed" || value === "sticky" ? [["position", "absolute"]] : void 0;
2173
2190
  case "backgroundImage":
2174
2191
  return [["experimental_backgroundImage", value]];
2192
+ case "border": {
2193
+ if (typeof value == "string") {
2194
+ var parsed = parseBorderShorthand(value);
2195
+ if (parsed) return parsed;
2196
+ }
2197
+ return;
2198
+ }
2175
2199
  }
2176
2200
  if (key in nativeExpansions) return nativeExpansions[key].map(function(k) {
2177
2201
  return [k, value];
@@ -2412,7 +2436,7 @@ var propMapper = function(key, value, styleState, disabled, map) {
2412
2436
  }
2413
2437
  styleProps.disableExpandShorthands || key in conf2.shorthands && (key = conf2.shorthands[key]);
2414
2438
  var originalValue = value;
2415
- if (value != null && (typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : (key === "boxShadow" || key === "textShadow" || key === "filter" || key === "backgroundImage") && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t) {
2439
+ if (value != null && (typeof value == "string" && value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : (key === "boxShadow" || key === "textShadow" || key === "filter" || key === "backgroundImage" || key === "border") && typeof value == "string" && value.includes("$") ? value = value.replace(/(\$[\w.-]+)/g, function(t) {
2416
2440
  var r = getTokenForKey("size", t, styleProps, styleState);
2417
2441
  return r == null && (r = getTokenForKey("color", t, styleProps, styleState)), r != null ? String(r) : t;
2418
2442
  }) : isVariable(value) ? value = resolveVariableValue(key, value, styleProps.resolveValues) : isRemValue(value) && (value = resolveRem(value))), value != null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.0-rc.1-1770183079077",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -82,17 +82,17 @@
82
82
  "clean:build": "tamagui-build clean:build"
83
83
  },
84
84
  "dependencies": {
85
- "@tamagui/helpers": "2.0.0-rc.1",
86
- "@tamagui/react-native-media-driver": "2.0.0-rc.1",
87
- "@tamagui/react-native-use-pressable": "2.0.0-rc.1",
88
- "@tamagui/use-element-layout": "2.0.0-rc.1",
89
- "@tamagui/use-event": "2.0.0-rc.1",
90
- "@tamagui/web": "2.0.0-rc.1"
85
+ "@tamagui/helpers": "2.0.0-rc.1-1770183079077",
86
+ "@tamagui/react-native-media-driver": "2.0.0-rc.1-1770183079077",
87
+ "@tamagui/react-native-use-pressable": "2.0.0-rc.1-1770183079077",
88
+ "@tamagui/use-element-layout": "2.0.0-rc.1-1770183079077",
89
+ "@tamagui/use-event": "2.0.0-rc.1-1770183079077",
90
+ "@tamagui/web": "2.0.0-rc.1-1770183079077"
91
91
  },
92
92
  "devDependencies": {
93
- "@tamagui/build": "2.0.0-rc.1",
94
- "@tamagui/native-bundle": "2.0.0-rc.1",
95
- "@tamagui/react-native-web-lite": "2.0.0-rc.1",
93
+ "@tamagui/build": "2.0.0-rc.1-1770183079077",
94
+ "@tamagui/native-bundle": "2.0.0-rc.1-1770183079077",
95
+ "@tamagui/react-native-web-lite": "2.0.0-rc.1-1770183079077",
96
96
  "@testing-library/react": "^16.1.0",
97
97
  "csstype": "^3.0.10",
98
98
  "react": ">=19",