tamagui 1.133.0 → 1.134.0

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.
@@ -3410,10 +3410,11 @@ var require_mergeProps_native = __commonJS({
3410
3410
  };
3411
3411
  function mergeProp(out, defaultProps, props, key) {
3412
3412
  var val = props[key];
3413
- defaultProps && key in defaultProps && (key in import_pseudoDescriptors.pseudoDescriptors || key[0] === "$") && (val = {
3414
- ...defaultProps[key],
3415
- ...val
3416
- }), out[key] = val;
3413
+ if (defaultProps && key in defaultProps && (key in import_pseudoDescriptors.pseudoDescriptors || key[0] === "$") && val && typeof val == "object") {
3414
+ var defaultVal = defaultProps[key];
3415
+ defaultVal && typeof defaultVal == "object" && (val = mergeProps(defaultVal, val));
3416
+ }
3417
+ out[key] = val;
3417
3418
  }
3418
3419
  }
3419
3420
  });
@@ -6254,7 +6255,7 @@ var require_getSplitStyles_native = __commonJS({
6254
6255
  (isText || isInput) && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
6255
6256
  var disablePropMap = isMediaOrPseudo || !isStyleLikeKey;
6256
6257
  (0, import_propMapper.propMapper)(keyInit, valInit, styleState, disablePropMap, function(key4, val2) {
6257
- var _parentStaticConfig_variants, isStyledContextProp = styleProps.styledContext && key4 in styleProps.styledContext;
6258
+ var _parentStaticConfig_variants, isStyledContextProp = styledContext && key4 in styledContext;
6258
6259
  if (!isHOC && disablePropMap && !isStyledContextProp && !isMediaOrPseudo) {
6259
6260
  viewProps[key4] = val2;
6260
6261
  return;
@@ -6458,7 +6459,7 @@ var require_getSplitStyles_native = __commonJS({
6458
6459
  }
6459
6460
  }));
6460
6461
  }
6461
- var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
6462
+ var { asChild } = props, { accept } = staticConfig, { noSkip, disableExpandShorthands, noExpand, styledContext } = styleProps, { webContainerType } = conf.settings, parentVariants = parentStaticConfig == null ? void 0 : parentStaticConfig.variants;
6462
6463
  for (var keyOg in props) _loop(keyOg);
6463
6464
  var avoidNormalize = styleProps.noNormalize === !1;
6464
6465
  if (!avoidNormalize) {
@@ -8129,7 +8130,7 @@ var require_createComponent_native = __commonJS({
8129
8130
  var _propsIn_datatestrenders, _current, _;
8130
8131
  (_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
8131
8132
  }
8132
- var { context, isReactNative } = staticConfig, styledContextValue = context ? import_react3.default.useContext(context) : void 0, overriddenContextProps = null, debugProp = propsIn.debug;
8133
+ var { context, isReactNative } = staticConfig, debugProp = propsIn.debug, styledContextValue = context ? import_react3.default.useContext(context) : void 0, overriddenContextProps = null;
8133
8134
  if (0)
8134
8135
  var timer;
8135
8136
  var props = propsIn;
@@ -8214,7 +8215,7 @@ var require_createComponent_native = __commonJS({
8214
8215
  isExiting,
8215
8216
  isAnimated,
8216
8217
  willBeAnimated,
8217
- styledContext: context
8218
+ styledContext: styledContextValue
8218
8219
  }, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), isPassthrough = !splitStyles, groupContext = groupName && (allGroupContexts == null ? void 0 : allGroupContexts[groupName]) || null;
8219
8220
  if (!isPassthrough && groupContext && // avoids onLayout if we don't need it
8220
8221
  props.containerType !== "normal") {
@@ -23785,7 +23786,8 @@ var require_Popper_native = __commonJS({
23785
23786
  update: context.update,
23786
23787
  context: context.context,
23787
23788
  getFloatingProps: context.getFloatingProps,
23788
- getReferenceProps: context.getReferenceProps
23789
+ getReferenceProps: context.getReferenceProps,
23790
+ open: context.open
23789
23791
  };
23790
23792
  }
23791
23793
  var checkFloating = {
@@ -23854,9 +23856,11 @@ var require_Popper_native = __commonJS({
23854
23856
  arrowStyle: middlewareData.arrow,
23855
23857
  onArrowSize: setArrowSize,
23856
23858
  hasFloating: (_middlewareData_checkFloating = middlewareData.checkFloating) === null || _middlewareData_checkFloating === void 0 ? void 0 : _middlewareData_checkFloating.hasFloating,
23859
+ open: !!open,
23857
23860
  ...floating
23858
23861
  };
23859
23862
  }, [
23863
+ open,
23860
23864
  size2,
23861
23865
  floating.x,
23862
23866
  floating.y,
@@ -23928,7 +23932,7 @@ var require_Popper_native = __commonJS({
23928
23932
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
23929
23933
  }
23930
23934
  }), PopperContent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
23931
- var { scope, enableAnimationForPositionChange, children, passThrough, ...rest } = props, { strategy, placement, refs, x, y, getFloatingProps, size: size2 } = usePopperContext(scope), contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), [needsMeasure, setNeedsMeasure] = React4.useState(enableAnimationForPositionChange);
23935
+ var { scope, enableAnimationForPositionChange, children, passThrough, ...rest } = props, context = usePopperContext(scope), { strategy, placement, refs, x, y, getFloatingProps, size: size2, isPositioned } = context, contentRefs = (0, import_compose_refs.useComposedRefs)(refs.setFloating, forwardedRef), [needsMeasure, setNeedsMeasure] = React4.useState(enableAnimationForPositionChange);
23932
23936
  (0, import_constants4.useIsomorphicLayoutEffect)(function() {
23933
23937
  needsMeasure && x && y && setNeedsMeasure(!1);
23934
23938
  }, [
@@ -23937,7 +23941,16 @@ var require_Popper_native = __commonJS({
23937
23941
  x,
23938
23942
  y
23939
23943
  ]);
23940
- var hide2 = x === 0 && y === 0, frameProps = {
23944
+ var hide2 = x === 0 && y === 0, disableAnimationProp = (
23945
+ // if they want to animate also when re-positioning allow it
23946
+ enableAnimationForPositionChange === "even-when-repositioning" ? needsMeasure : !isPositioned || needsMeasure
23947
+ ), [disableAnimation, setDisableAnimation] = React4.useState(disableAnimationProp);
23948
+ React4.useEffect(function() {
23949
+ setDisableAnimation(disableAnimationProp);
23950
+ }, [
23951
+ disableAnimationProp
23952
+ ]);
23953
+ var frameProps = {
23941
23954
  ref: contentRefs,
23942
23955
  x: x || 0,
23943
23956
  y: y || 0,
@@ -23947,7 +23960,7 @@ var require_Popper_native = __commonJS({
23947
23960
  opacity: 1,
23948
23961
  ...enableAnimationForPositionChange && {
23949
23962
  animation: rest.animation,
23950
- animateOnly: needsMeasure ? [] : rest.animateOnly,
23963
+ animateOnly: disableAnimation ? [] : rest.animateOnly,
23951
23964
  // apply animation but disable it on initial render to avoid animating from 0 to the first position
23952
23965
  animatePresence: !1
23953
23966
  },