tamagui 1.90.2 → 1.90.3

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.
@@ -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 {
@@ -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
  }
@@ -7599,8 +7599,6 @@ var require_getSplitStyles_native = __commonJS({
7599
7599
  mergeTransform(styleState.style, key6, val4, !0);
7600
7600
  });
7601
7601
  }
7602
- if (0)
7603
- var _styleState_style;
7604
7602
  if (parentSplitStyles) {
7605
7603
  if (0)
7606
7604
  for (var key2 in parentSplitStyles.classNames)
@@ -7612,6 +7610,8 @@ var require_getSplitStyles_native = __commonJS({
7612
7610
  }
7613
7611
  }
7614
7612
  }
7613
+ if (0)
7614
+ var _styleState_style, shouldStringifyTransforms;
7615
7615
  if (0) {
7616
7616
  if (styleState.style && shouldDoClasses) {
7617
7617
  var retainedStyles, shouldRetain;
@@ -8702,7 +8702,7 @@ var require_createComponent_native = __commonJS({
8702
8702
  groupContextState[groupName] = next;
8703
8703
  };
8704
8704
  }
8705
- 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, 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;
8705
+ 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, 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;
8706
8706
  animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
8707
8707
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
8708
8708
  props.themeShallow && (curState.themeShallow = !0);
@@ -8769,7 +8769,7 @@ var require_createComponent_native = __commonJS({
8769
8769
  "theme",
8770
8770
  "defaultVariants"
8771
8771
  ]), viewProps = nonTamaguiProps;
8772
- isHOC && _themeProp && (viewProps.theme = _themeProp);
8772
+ isHOC && _themeProp && (viewProps.theme = _themeProp), elementType.acceptTagProp && (viewProps.tag = tagProp);
8773
8773
  var animationStyles;
8774
8774
  if (
8775
8775
  // if it supports css vars we run it on server too to get matching initial style
@@ -8797,9 +8797,7 @@ var require_createComponent_native = __commonJS({
8797
8797
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
8798
8798
  return _object_spread9({}, prev);
8799
8799
  }), stateRef.current.hasMeasured = !0;
8800
- }));
8801
- var _hooks_usePropsTransform1;
8802
- 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) {
8800
+ })), 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) {
8803
8801
  return stateRef.current.host = x;
8804
8802
  }, forwardedRef)), viewProps.ref = curState.composedRef;
8805
8803
  var pseudoGroups = splitStyles.pseudoGroups, mediaGroups = splitStyles.mediaGroups;
@@ -20509,10 +20507,10 @@ var require_Dialog_native = __commonJS({
20509
20507
  "children"
20510
20508
  ]), 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];
20511
20509
  isShowing && isFullyHidden && setIsFullyHidden(!1);
20512
- var contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
20513
- onExitComplete: function() {
20514
- setIsFullyHidden(!0);
20515
- },
20510
+ var handleExitComplete = React2.useCallback(function() {
20511
+ setIsFullyHidden(!0);
20512
+ }, []), contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
20513
+ onExitComplete: handleExitComplete,
20516
20514
  children: isShowing ? children : null
20517
20515
  }), isSheet = useShowDialogSheet(context);
20518
20516
  if (isSheet)
@@ -25852,7 +25850,7 @@ var require_Group_native = __commonJS({
25852
25850
  }
25853
25851
  });
25854
25852
  function createGroup(verticalDefault) {
25855
- return (0, import_helpers.withStaticProperties)(/* @__PURE__ */ (0, import_react2.forwardRef)(function(props, ref) {
25853
+ return (0, import_helpers.withStaticProperties)(GroupFrame.styleable(function(props, ref) {
25856
25854
  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, [
25857
25855
  "__scopeGroup",
25858
25856
  "children",
@@ -27097,8 +27095,11 @@ var require_Animate_native = __commonJS({
27097
27095
  enterVariant: props.enterVariant,
27098
27096
  exitVariant: props.exitVariant,
27099
27097
  enterExitVariant: props.enterExitVariant,
27100
- presenceAffectsLayout: props.presenceAffectsLayout || !0,
27098
+ // BUGFIX: this causes continous re-renders if keepChildrenMounted is true, see HeaderMenu
27099
+ // but since we always re-render this component on open changes this should be fine to leave off?
27100
+ presenceAffectsLayout: !1,
27101
27101
  isPresent: props.present,
27102
+ custom: props.custom,
27102
27103
  children
27103
27104
  }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, _object_spread_props8(_object_spread9({}, props), {
27104
27105
  children: props.present ? children : null
@@ -29929,40 +29930,35 @@ var require_Popover_native = __commonJS({
29929
29930
  "disableRemoveScroll",
29930
29931
  "freezeContentsWhenHidden",
29931
29932
  "setIsFullyHidden"
29932
- ]), context = usePopoverContext(__scopePopover), open = context.open, keepChildrenMounted = context.keepChildrenMounted, popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE), contents = React2.useMemo(function() {
29933
- return import_constants4.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
29934
- style: {
29935
- display: "contents"
29936
- },
29937
- children
29938
- }) : children;
29939
- }, [
29933
+ ]), 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", {
29934
+ style: dspContentsStyle,
29940
29935
  children
29941
- ]);
29936
+ }) : children;
29942
29937
  if (context.breakpointActive) {
29943
29938
  var childrenWithoutScrollView = React2.Children.toArray(children).map(function(child) {
29944
29939
  return /* @__PURE__ */ React2.isValidElement(child) && child.type === import_react_native4.ScrollView ? child.props.children : child;
29945
- }), content = childrenWithoutScrollView;
29946
- 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({
29940
+ }), content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
29941
+ children: childrenWithoutScrollView
29942
+ });
29943
+ 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({
29947
29944
  scope: __scopePopover || POPOVER_SCOPE
29948
29945
  }, popperContext), {
29949
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
29950
- children: childrenWithoutScrollView
29951
- })
29952
- })) : content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
29953
- children: content
29954
- }), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
29946
+ children: childrenWithoutScrollView
29947
+ }))), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
29955
29948
  hostName: "".concat(context.id, "PopoverContents"),
29956
29949
  children: content
29957
29950
  });
29958
29951
  }
29952
+ var handleExitComplete = React2.useCallback(function() {
29953
+ setIsFullyHidden == null || setIsFullyHidden(!0);
29954
+ }, [
29955
+ setIsFullyHidden
29956
+ ]);
29959
29957
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate.Animate, {
29960
29958
  type: "presence",
29961
29959
  present: !!open,
29962
29960
  keepChildrenMounted,
29963
- onExitComplete: function() {
29964
- setIsFullyHidden && setIsFullyHidden(!0);
29965
- },
29961
+ onExitComplete: handleExitComplete,
29966
29962
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContent, _object_spread_props8(_object_spread9({
29967
29963
  __scopePopper: __scopePopover || POPOVER_SCOPE,
29968
29964
  "data-state": getState(open),
@@ -29974,9 +29970,7 @@ var require_Popover_native = __commonJS({
29974
29970
  allowPinchZoom: !0,
29975
29971
  // causes lots of bugs on touch web on site
29976
29972
  removeScrollBar: !1,
29977
- style: {
29978
- display: "contents"
29979
- },
29973
+ style: dspContentsStyle,
29980
29974
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.ResetPresence, {
29981
29975
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_focus_scope.FocusScope, {
29982
29976
  loop: !0,
@@ -29990,7 +29984,9 @@ var require_Popover_native = __commonJS({
29990
29984
  })
29991
29985
  }), context.contentId)
29992
29986
  });
29993
- }), PopoverClose = /* @__PURE__ */ React2.forwardRef(function(props, forwardedRef) {
29987
+ }), dspContentsStyle = {
29988
+ display: "contents"
29989
+ }, PopoverClose = /* @__PURE__ */ React2.forwardRef(function(props, forwardedRef) {
29994
29990
  var __scopePopover = props.__scopePopover, rest = _object_without_properties5(props, [
29995
29991
  "__scopePopover"
29996
29992
  ]), context = usePopoverContext(__scopePopover);
@@ -30033,11 +30029,11 @@ var require_Popover_native = __commonJS({
30033
30029
  onChange: function(val) {
30034
30030
  onOpenChange == null || onOpenChange(val, viaRef.current);
30035
30031
  }
30036
- }), 2), open = _useControllableState[0], setOpen = _useControllableState[1], sheetActive = useSheetBreakpointActive(sheetBreakpoint), floatingContext = (0, import_useFloatingContext.useFloatingContext)({
30032
+ }), 2), open = _useControllableState[0], setOpen = _useControllableState[1], handleOpenChange = (0, import_core12.useEvent)(function(val, via) {
30033
+ viaRef.current = via, setOpen(val);
30034
+ }), sheetActive = useSheetBreakpointActive(sheetBreakpoint), floatingContext = (0, import_useFloatingContext.useFloatingContext)({
30037
30035
  open,
30038
- setOpen: function(val, via) {
30039
- viaRef.current = via, setOpen(val);
30040
- },
30036
+ setOpen: handleOpenChange,
30041
30037
  disable: sheetActive,
30042
30038
  hoverable,
30043
30039
  disableFocus
@@ -30054,9 +30050,7 @@ var require_Popover_native = __commonJS({
30054
30050
  triggerRef,
30055
30051
  open,
30056
30052
  breakpointActive: sheetActive,
30057
- onOpenChange: function(val, via) {
30058
- viaRef.current = via, setOpen(val);
30059
- },
30053
+ onOpenChange: handleOpenChange,
30060
30054
  onOpenToggle: (0, import_core12.useEvent)(function() {
30061
30055
  open && sheetActive || setOpen(!open);
30062
30056
  }),