tamagui 1.90.2 → 1.90.4

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.js CHANGED
@@ -327,7 +327,7 @@ var require_usePresence_native = __commonJS({
327
327
  null,
328
328
  context
329
329
  ];
330
- var isPresent2 = context.isPresent, onExitComplete = context.onExitComplete, register = context.register, id = (0, import_react2.useId)() || "";
330
+ var id = context.id, isPresent2 = context.isPresent, onExitComplete = context.onExitComplete, register = context.register;
331
331
  (0, import_react2.useEffect)(function() {
332
332
  return register(id);
333
333
  }, []);
@@ -453,7 +453,7 @@ var require_PresenceChild_native = __commonJS({
453
453
  }
454
454
  });
455
455
  module2.exports = __toCommonJS2(PresenceChild_exports);
456
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_use_constant = require_index_native2(), import_use_presence = require_index_native3(), React2 = __toESM2(require("react")), import_react2 = require("react"), PresenceChild = function(param) {
456
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_use_constant = require_index_native2(), import_use_presence = require_index_native3(), React2 = __toESM2(require("react")), import_react2 = require("react"), PresenceChild = /* @__PURE__ */ React2.memo(function(param) {
457
457
  var children = param.children, initial = param.initial, isPresent = param.isPresent, onExitComplete = param.onExitComplete, exitVariant = param.exitVariant, enterVariant = param.enterVariant, enterExitVariant = param.enterExitVariant, presenceAffectsLayout = param.presenceAffectsLayout, custom = param.custom, presenceChildren = (0, import_use_constant.useConstant)(newChildrenMap), id = (0, import_react2.useId)() || "", context = React2.useMemo(
458
458
  function() {
459
459
  return {
@@ -464,8 +464,8 @@ var require_PresenceChild_native = __commonJS({
464
464
  exitVariant,
465
465
  enterVariant,
466
466
  enterExitVariant,
467
- onExitComplete: function(id2) {
468
- presenceChildren.set(id2, !0);
467
+ onExitComplete: function() {
468
+ presenceChildren.set(id, !0);
469
469
  var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
470
470
  try {
471
471
  for (var _iterator = presenceChildren.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
@@ -485,9 +485,9 @@ var require_PresenceChild_native = __commonJS({
485
485
  }
486
486
  onExitComplete == null || onExitComplete();
487
487
  },
488
- register: function(id2) {
489
- return presenceChildren.set(id2, !1), function() {
490
- return presenceChildren.delete(id2);
488
+ register: function() {
489
+ return presenceChildren.set(id, !1), function() {
490
+ return presenceChildren.delete(id);
491
491
  };
492
492
  }
493
493
  };
@@ -518,7 +518,7 @@ var require_PresenceChild_native = __commonJS({
518
518
  value: context,
519
519
  children
520
520
  });
521
- };
521
+ });
522
522
  function newChildrenMap() {
523
523
  return /* @__PURE__ */ new Map();
524
524
  }
@@ -8099,8 +8099,6 @@ current`, _object_spread9({}, styleState.style)));
8099
8099
  mergeTransform(styleState.style, key6, val4, !0);
8100
8100
  });
8101
8101
  }
8102
- if (0)
8103
- var _styleState_style;
8104
8102
  if (parentSplitStyles) {
8105
8103
  if (0)
8106
8104
  for (var key2 in parentSplitStyles.classNames)
@@ -8112,6 +8110,8 @@ current`, _object_spread9({}, styleState.style)));
8112
8110
  }
8113
8111
  }
8114
8112
  }
8113
+ if (0)
8114
+ var _styleState_style, shouldStringifyTransforms;
8115
8115
  if (0) {
8116
8116
  if (styleState.style && shouldDoClasses) {
8117
8117
  var retainedStyles, shouldRetain;
@@ -9453,7 +9453,7 @@ var require_createComponent_native = __commonJS({
9453
9453
  process.env.NODE_ENV === "development" && time && time(_templateObject4());
9454
9454
  var hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), _props_disabled, isDisabled = (_props_disabled = props.disabled) !== null && _props_disabled !== void 0 ? _props_disabled : (_props_accessibilityState = props.accessibilityState) === null || _props_accessibilityState === void 0 ? void 0 : _props_accessibilityState.disabled;
9455
9455
  process.env.NODE_ENV === "development" && time && time(_templateObject5());
9456
- var isTaggable = !Component || typeof Component == "string", element = import_constants4.isWeb && isTaggable && props.tag || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
9456
+ var isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
9457
9457
  animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
9458
9458
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
9459
9459
  process.env.NODE_ENV === "development" && time && time(_templateObject6()), props.themeShallow && (curState.themeShallow = !0);
@@ -9548,7 +9548,7 @@ var require_createComponent_native = __commonJS({
9548
9548
  "theme",
9549
9549
  "defaultVariants"
9550
9550
  ]), viewProps = nonTamaguiProps;
9551
- isHOC && _themeProp && (viewProps.theme = _themeProp);
9551
+ isHOC && _themeProp && (viewProps.theme = _themeProp), elementType.acceptTagProp && (viewProps.tag = tagProp);
9552
9552
  var animationStyles;
9553
9553
  if (
9554
9554
  // if it supports css vars we run it on server too to get matching initial style
@@ -9579,9 +9579,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9579
9579
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
9580
9580
  return _object_spread9({}, prev);
9581
9581
  }), stateRef.current.hasMeasured = !0;
9582
- }));
9583
- var _hooks_usePropsTransform1;
9584
- viewProps = (_hooks_usePropsTransform1 = (_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curState.willHydrate)) !== null && _hooks_usePropsTransform1 !== void 0 ? _hooks_usePropsTransform1 : nonTamaguiProps, curState.composedRef || (curState.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
9582
+ })), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curState.willHydrate)) || nonTamaguiProps, curState.composedRef || (curState.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
9585
9583
  return stateRef.current.host = x;
9586
9584
  }, forwardedRef)), viewProps.ref = curState.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants4.isWeb && !isHOC && import_react2.Children.toArray(props.children).forEach(function(item) {
9587
9585
  typeof item == "string" && item !== `
@@ -21353,6 +21351,7 @@ var require_Dialog_native = __commonJS({
21353
21351
  var PORTAL_NAME = "DialogPortal", _createDialogContext1 = _sliced_to_array(createDialogContext(PORTAL_NAME, {
21354
21352
  forceMount: void 0
21355
21353
  }), 2), PortalProvider2 = _createDialogContext1[0], usePortalContext = _createDialogContext1[1], DialogPortalFrame = (0, import_core12.styled)(import_stacks3.YStack, {
21354
+ pointerEvents: "none",
21356
21355
  variants: {
21357
21356
  unstyled: {
21358
21357
  false: _object_spread9({
@@ -21402,10 +21401,10 @@ var require_Dialog_native = __commonJS({
21402
21401
  "children"
21403
21402
  ]), context = useDialogContext(PORTAL_NAME, __scopeDialog), isShowing = forceMount || context.open, _React_useState = _sliced_to_array(React2.useState(!isShowing), 2), isFullyHidden = _React_useState[0], setIsFullyHidden = _React_useState[1];
21404
21403
  isShowing && isFullyHidden && setIsFullyHidden(!1);
21405
- var contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
21406
- onExitComplete: function() {
21407
- setIsFullyHidden(!0);
21408
- },
21404
+ var handleExitComplete = React2.useCallback(function() {
21405
+ setIsFullyHidden(!0);
21406
+ }, []), contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
21407
+ onExitComplete: handleExitComplete,
21409
21408
  children: isShowing ? children : null
21410
21409
  }), isSheet = useShowDialogSheet(context);
21411
21410
  if (isSheet)
@@ -26920,7 +26919,7 @@ var require_Group_native = __commonJS({
26920
26919
  }
26921
26920
  });
26922
26921
  function createGroup(verticalDefault) {
26923
- return (0, import_helpers.withStaticProperties)(/* @__PURE__ */ (0, import_react2.forwardRef)(function(props, ref) {
26922
+ return (0, import_helpers.withStaticProperties)(GroupFrame.styleable(function(props, ref) {
26924
26923
  var activeProps = (0, import_core12.useProps)(props), __scopeGroup = activeProps.__scopeGroup, childrenProp = activeProps.children, space = activeProps.space, _activeProps_size = activeProps.size, size3 = _activeProps_size === void 0 ? "$true" : _activeProps_size, spaceDirection = activeProps.spaceDirection, separator = activeProps.separator, scrollable = activeProps.scrollable, _activeProps_axis = activeProps.axis, axis = _activeProps_axis === void 0 ? verticalDefault ? "vertical" : "horizontal" : _activeProps_axis, _activeProps_orientation = activeProps.orientation, orientation = _activeProps_orientation === void 0 ? axis : _activeProps_orientation, disabledProp = activeProps.disabled, disablePassBorderRadiusProp = activeProps.disablePassBorderRadius, borderRadius = activeProps.borderRadius, forceUseItem = activeProps.forceUseItem, restProps = _object_without_properties5(activeProps, [
26925
26924
  "__scopeGroup",
26926
26925
  "children",
@@ -28165,8 +28164,11 @@ var require_Animate_native = __commonJS({
28165
28164
  enterVariant: props.enterVariant,
28166
28165
  exitVariant: props.exitVariant,
28167
28166
  enterExitVariant: props.enterExitVariant,
28168
- presenceAffectsLayout: props.presenceAffectsLayout || !0,
28167
+ // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
28168
+ // but since we always re-render this component on open changes this should be fine to leave off?
28169
+ presenceAffectsLayout: !1,
28169
28170
  isPresent: props.present,
28171
+ custom: props.custom,
28170
28172
  children
28171
28173
  }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, _object_spread_props8(_object_spread9({}, props), {
28172
28174
  children: props.present ? children : null
@@ -30997,40 +30999,35 @@ var require_Popover_native = __commonJS({
30997
30999
  "disableRemoveScroll",
30998
31000
  "freezeContentsWhenHidden",
30999
31001
  "setIsFullyHidden"
31000
- ]), context = usePopoverContext(__scopePopover), open = context.open, keepChildrenMounted = context.keepChildrenMounted, popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE), contents = React2.useMemo(function() {
31001
- return import_constants4.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
31002
- style: {
31003
- display: "contents"
31004
- },
31005
- children
31006
- }) : children;
31007
- }, [
31002
+ ]), context = usePopoverContext(__scopePopover), open = context.open, keepChildrenMounted = context.keepChildrenMounted, popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE), contents = import_constants4.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
31003
+ style: dspContentsStyle,
31008
31004
  children
31009
- ]);
31005
+ }) : children;
31010
31006
  if (context.breakpointActive) {
31011
31007
  var childrenWithoutScrollView = React2.Children.toArray(children).map(function(child) {
31012
31008
  return /* @__PURE__ */ React2.isValidElement(child) && child.type === import_react_native4.ScrollView ? child.props.children : child;
31013
- }), content = childrenWithoutScrollView;
31014
- return import_react_native4.Platform.OS === "android" || import_react_native4.Platform.OS === "ios" ? content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, _object_spread_props8(_object_spread9({
31009
+ }), content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
31010
+ children: childrenWithoutScrollView
31011
+ });
31012
+ return (import_react_native4.Platform.OS === "android" || import_react_native4.Platform.OS === "ios") && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, _object_spread_props8(_object_spread9({
31015
31013
  scope: __scopePopover || POPOVER_SCOPE
31016
31014
  }, popperContext), {
31017
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
31018
- children: childrenWithoutScrollView
31019
- })
31020
- })) : content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
31021
- children: content
31022
- }), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
31015
+ children: childrenWithoutScrollView
31016
+ }))), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
31023
31017
  hostName: "".concat(context.id, "PopoverContents"),
31024
31018
  children: content
31025
31019
  });
31026
31020
  }
31021
+ var handleExitComplete = React2.useCallback(function() {
31022
+ setIsFullyHidden == null || setIsFullyHidden(!0);
31023
+ }, [
31024
+ setIsFullyHidden
31025
+ ]);
31027
31026
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate.Animate, {
31028
31027
  type: "presence",
31029
31028
  present: !!open,
31030
31029
  keepChildrenMounted,
31031
- onExitComplete: function() {
31032
- setIsFullyHidden && setIsFullyHidden(!0);
31033
- },
31030
+ onExitComplete: handleExitComplete,
31034
31031
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContent, _object_spread_props8(_object_spread9({
31035
31032
  __scopePopper: __scopePopover || POPOVER_SCOPE,
31036
31033
  "data-state": getState(open),
@@ -31042,9 +31039,7 @@ var require_Popover_native = __commonJS({
31042
31039
  allowPinchZoom: !0,
31043
31040
  // causes lots of bugs on touch web on site
31044
31041
  removeScrollBar: !1,
31045
- style: {
31046
- display: "contents"
31047
- },
31042
+ style: dspContentsStyle,
31048
31043
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
31049
31044
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_focus_scope.FocusScope, {
31050
31045
  loop: !0,
@@ -31058,7 +31053,9 @@ var require_Popover_native = __commonJS({
31058
31053
  })
31059
31054
  }), context.contentId)
31060
31055
  });
31061
- }), PopoverClose = /* @__PURE__ */ React2.forwardRef(function(props, forwardedRef) {
31056
+ }), dspContentsStyle = {
31057
+ display: "contents"
31058
+ }, PopoverClose = /* @__PURE__ */ React2.forwardRef(function(props, forwardedRef) {
31062
31059
  var __scopePopover = props.__scopePopover, rest = _object_without_properties5(props, [
31063
31060
  "__scopePopover"
31064
31061
  ]), context = usePopoverContext(__scopePopover);
@@ -31101,11 +31098,11 @@ var require_Popover_native = __commonJS({
31101
31098
  onChange: function(val) {
31102
31099
  onOpenChange == null || onOpenChange(val, viaRef.current);
31103
31100
  }
31104
- }), 2), open = _useControllableState[0], setOpen = _useControllableState[1], sheetActive = useSheetBreakpointActive(sheetBreakpoint), floatingContext = (0, import_useFloatingContext.useFloatingContext)({
31101
+ }), 2), open = _useControllableState[0], setOpen = _useControllableState[1], handleOpenChange = (0, import_core12.useEvent)(function(val, via) {
31102
+ viaRef.current = via, setOpen(val);
31103
+ }), sheetActive = useSheetBreakpointActive(sheetBreakpoint), floatingContext = (0, import_useFloatingContext.useFloatingContext)({
31105
31104
  open,
31106
- setOpen: function(val, via) {
31107
- viaRef.current = via, setOpen(val);
31108
- },
31105
+ setOpen: handleOpenChange,
31109
31106
  disable: sheetActive,
31110
31107
  hoverable,
31111
31108
  disableFocus
@@ -31122,9 +31119,7 @@ var require_Popover_native = __commonJS({
31122
31119
  triggerRef,
31123
31120
  open,
31124
31121
  breakpointActive: sheetActive,
31125
- onOpenChange: function(val, via) {
31126
- viaRef.current = via, setOpen(val);
31127
- },
31122
+ onOpenChange: handleOpenChange,
31128
31123
  onOpenToggle: (0, import_core12.useEvent)(function() {
31129
31124
  open && sheetActive || setOpen(!open);
31130
31125
  }),