@tamagui/core 2.0.0-1768263773228 → 2.0.0-1768427228811

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
@@ -9480,7 +9480,7 @@ var defaultOffset = {
9480
9480
  };
9481
9481
  var normalizeColor = function(color, opacity) {
9482
9482
  if (color) {
9483
- if (color[0] === "$") return color;
9483
+ if (typeof color != "string" || color[0] === "$") return color;
9484
9484
  if (color.startsWith("var(")) {
9485
9485
  if (typeof opacity == "number" && opacity < 1) return `color-mix(in srgb, ${color} ${opacity * 100}%, transparent)`;
9486
9486
  } else {
@@ -9493,8 +9493,10 @@ var normalizeColor = function(color, opacity) {
9493
9493
  return color;
9494
9494
  }
9495
9495
  }, getRgba = function(color) {
9496
- var colorNum = normalizeCSSColor(color);
9497
- if (colorNum != null) return rgba(colorNum);
9496
+ if (typeof color == "string") {
9497
+ var colorNum = normalizeCSSColor(color);
9498
+ if (colorNum != null) return rgba(colorNum);
9499
+ }
9498
9500
  };
9499
9501
  function normalizeShadow(param) {
9500
9502
  var {
@@ -10860,14 +10862,14 @@ function createComponent(staticConfig) {
10860
10862
  var {
10861
10863
  context,
10862
10864
  isReactNative
10863
- } = staticConfig, debugProp = propsIn.debug, styledContextValue = context ? React.useContext(context) : void 0, overriddenContextProps = null;
10865
+ } = staticConfig, debugProp = propsIn.debug, styledContextValue = context ? React.useContext(context) : void 0, overriddenContextProps = null, componentContext = React.useContext(ComponentContext);
10864
10866
  var props = propsIn;
10865
10867
  if (styledContextValue || defaultProps2) {
10866
- var [nextProps, overrides] = mergeComponentProps(defaultProps2, styledContextValue, propsIn);
10868
+ var effectiveDefaults = defaultProps2, [nextProps, overrides] = mergeComponentProps(effectiveDefaults, styledContextValue, propsIn);
10867
10869
  nextProps && (props = nextProps), overriddenContextProps = overrides;
10868
10870
  }
10869
10871
  var componentName2 = props.componentName || staticConfig.componentName;
10870
- var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
10872
+ var groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
10871
10873
  disabled,
10872
10874
  groupName,
10873
10875
  hasAnimationProp,
@@ -2173,7 +2173,7 @@ function rgba(colorInt) {
2173
2173
  }
2174
2174
  var normalizeColor = function(color, opacity) {
2175
2175
  if (color) {
2176
- if (color[0] === "$") return color;
2176
+ if (typeof color != "string" || color[0] === "$") return color;
2177
2177
  if (color.startsWith("var(")) {
2178
2178
  if (typeof opacity == "number" && opacity < 1) return `color-mix(in srgb, ${color} ${opacity * 100}%, transparent)`;
2179
2179
  } else {
@@ -2186,8 +2186,10 @@ var normalizeColor = function(color, opacity) {
2186
2186
  return color;
2187
2187
  }
2188
2188
  }, getRgba = function(color) {
2189
- var colorNum = normalizeCSSColor(color);
2190
- if (colorNum != null) return rgba(colorNum);
2189
+ if (typeof color == "string") {
2190
+ var colorNum = normalizeCSSColor(color);
2191
+ if (colorNum != null) return rgba(colorNum);
2192
+ }
2191
2193
  };
2192
2194
  function normalizeShadow(param) {
2193
2195
  var {
@@ -3559,14 +3561,14 @@ function createComponent(staticConfig) {
3559
3561
  var {
3560
3562
  context,
3561
3563
  isReactNative
3562
- } = staticConfig, debugProp = propsIn.debug, styledContextValue = context ? React.useContext(context) : void 0, overriddenContextProps = null;
3564
+ } = staticConfig, debugProp = propsIn.debug, styledContextValue = context ? React.useContext(context) : void 0, overriddenContextProps = null, componentContext = React.useContext(ComponentContext);
3563
3565
  var props = propsIn;
3564
3566
  if (styledContextValue || defaultProps) {
3565
- var [nextProps, overrides] = mergeComponentProps(defaultProps, styledContextValue, propsIn);
3567
+ var effectiveDefaults = defaultProps, [nextProps, overrides] = mergeComponentProps(effectiveDefaults, styledContextValue, propsIn);
3566
3568
  nextProps && (props = nextProps), overriddenContextProps = overrides;
3567
3569
  }
3568
3570
  var componentName2 = props.componentName || staticConfig.componentName;
3569
- var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
3571
+ var groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
3570
3572
  disabled,
3571
3573
  groupName,
3572
3574
  hasAnimationProp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "2.0.0-1768263773228",
3
+ "version": "2.0.0-1768427228811",
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-1768263773228",
37
- "@tamagui/react-native-media-driver": "2.0.0-1768263773228",
38
- "@tamagui/react-native-use-pressable": "2.0.0-1768263773228",
39
- "@tamagui/react-native-use-responder-events": "2.0.0-1768263773228",
40
- "@tamagui/use-element-layout": "2.0.0-1768263773228",
41
- "@tamagui/use-event": "2.0.0-1768263773228",
42
- "@tamagui/web": "2.0.0-1768263773228"
36
+ "@tamagui/helpers": "2.0.0-1768427228811",
37
+ "@tamagui/react-native-media-driver": "2.0.0-1768427228811",
38
+ "@tamagui/react-native-use-pressable": "2.0.0-1768427228811",
39
+ "@tamagui/react-native-use-responder-events": "2.0.0-1768427228811",
40
+ "@tamagui/use-element-layout": "2.0.0-1768427228811",
41
+ "@tamagui/use-event": "2.0.0-1768427228811",
42
+ "@tamagui/web": "2.0.0-1768427228811"
43
43
  },
44
44
  "devDependencies": {
45
- "@tamagui/build": "2.0.0-1768263773228",
46
- "@tamagui/native-bundle": "2.0.0-1768263773228",
47
- "@tamagui/react-native-web-lite": "2.0.0-1768263773228",
45
+ "@tamagui/build": "2.0.0-1768427228811",
46
+ "@tamagui/native-bundle": "2.0.0-1768427228811",
47
+ "@tamagui/react-native-web-lite": "2.0.0-1768427228811",
48
48
  "@testing-library/react": "^16.1.0",
49
49
  "csstype": "^3.0.10",
50
50
  "react": "*",