tamagui 1.124.7 → 1.124.9

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.
@@ -2010,13 +2010,17 @@ var require_useControllableState_native = __commonJS({
2010
2010
  var import_use_event = require_index_native8(), React4 = __toESM2(require("react")), import_start_transition = require_index_native9(), emptyCallbackFn = function(_) {
2011
2011
  return _();
2012
2012
  };
2013
- function useControllableState(param) {
2014
- var { prop, defaultProp, onChange, strategy = "prop-wins", preventUpdate, transition } = param, [state, setState] = React4.useState(prop ?? defaultProp), previous = React4.useRef(state), propWins = strategy === "prop-wins" && prop !== void 0, value = propWins ? prop : state, onChangeCb = (0, import_use_event.useEvent)(onChange || idFn), transitionFn = transition ? import_start_transition.startTransition : emptyCallbackFn;
2015
- prop !== state && transitionFn(function() {
2016
- setState(function(prev) {
2017
- if (prev !== prop) return previous.current = prop, prop;
2013
+ function useControllableState(props) {
2014
+ var { prop, defaultProp, onChange, strategy = "prop-wins", preventUpdate, transition } = props, [state, setState] = React4.useState(prop ?? defaultProp), previous = React4.useRef(state), propWins = strategy === "prop-wins" && prop !== void 0, value = propWins ? prop : state, onChangeCb = (0, import_use_event.useEvent)(onChange || idFn), transitionFn = transition ? import_start_transition.startTransition : emptyCallbackFn;
2015
+ React4.useEffect(function() {
2016
+ "prop" in props && prop !== state && transitionFn(function() {
2017
+ setState(function(prev) {
2018
+ if (prev !== prop) return previous.current = prop, prop;
2019
+ });
2018
2020
  });
2019
- }), React4.useEffect(function() {
2021
+ }, [
2022
+ prop
2023
+ ]), React4.useEffect(function() {
2020
2024
  propWins || state !== previous.current && (previous.current = state, onChangeCb(state));
2021
2025
  }, [
2022
2026
  onChangeCb,
@@ -6980,7 +6984,7 @@ var require_useThemeState_native = __commonJS({
6980
6984
  isNew: !0
6981
6985
  } : state;
6982
6986
  }, getSnapshotFrom = function(lastState, props, propsKey) {
6983
- var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate2 = arguments.length > 7 ? arguments[7] : void 0, parentState = states.get(parentId);
6987
+ var isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, id = arguments.length > 4 ? arguments[4] : void 0, parentId = arguments.length > 5 ? arguments[5] : void 0, needsUpdate = arguments.length > 6 ? arguments[6] : void 0, pendingUpdate2 = arguments.length > 7 ? arguments[7] : void 0, { debug } = props, parentState = states.get(parentId);
6984
6988
  themes || (themes = (0, import_config.getConfig)().themes);
6985
6989
  var name = !propsKey && pendingUpdate2 !== "force" ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate2 === "force" ? !0 : !!needsUpdate), isSameAsParent = !!(!name && propsKey);
6986
6990
  if (0)
@@ -6988,6 +6992,7 @@ var require_useThemeState_native = __commonJS({
6988
6992
  if (parentState && isSameAsParent) return parentState;
6989
6993
  if (!name) {
6990
6994
  var next = lastState ?? parentState;
6995
+ if (!next) throw new Error("No theme and no parent?");
6991
6996
  if (needsUpdate && pendingUpdate2) {
6992
6997
  var updated = {
6993
6998
  ...parentState || lastState
@@ -7007,7 +7012,9 @@ var require_useThemeState_native = __commonJS({
7007
7012
  inverses,
7008
7013
  isInverse
7009
7014
  };
7010
- return isRoot && (rootThemeState = nextState), pendingUpdate2 !== "force" && lastState && !needsUpdate ? (Object.assign(lastState, nextState), lastState) : nextState;
7015
+ isRoot && (rootThemeState = nextState);
7016
+ var shouldAvoidRerender = pendingUpdate2 !== "force" && lastState && !needsUpdate && nextState.name === lastState.name;
7017
+ return shouldAvoidRerender ? (Object.assign(lastState, nextState), lastState) : nextState;
7011
7018
  };
7012
7019
  function scheduleUpdate(id) {
7013
7020
  for (var queue = [
@@ -10258,7 +10265,10 @@ var require_useProps_native = __commonJS({
10258
10265
  var _opts_forComponent, _opts_forComponent_staticConfig, staticConfig = (_opts_forComponent_staticConfig = opts == null || (_opts_forComponent = opts.forComponent) === null || _opts_forComponent === void 0 ? void 0 : _opts_forComponent.staticConfig) !== null && _opts_forComponent_staticConfig !== void 0 ? _opts_forComponent_staticConfig : import_Stack.Stack.staticConfig, [theme, themeState] = (0, import_useTheme.useThemeWithState)({
10259
10266
  componentName: staticConfig.componentName,
10260
10267
  name: "theme" in props ? props.theme : void 0,
10261
- inverse: "themeInverse" in props ? props.themeInverse : void 0
10268
+ inverse: "themeInverse" in props ? props.themeInverse : void 0,
10269
+ needsUpdate() {
10270
+ return !0;
10271
+ }
10262
10272
  }), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
10263
10273
  // not safe to use mediaState but really marginal to hit this
10264
10274
  import_useMedia.mediaState
@@ -24687,7 +24697,9 @@ var require_Popover_native = __commonJS({
24687
24697
  __scopePopover,
24688
24698
  zIndex: props.zIndex,
24689
24699
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
24690
- pointerEvents: context.open ? "auto" : "none",
24700
+ ...!context.open && {
24701
+ pointerEvents: "none"
24702
+ },
24691
24703
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContentImpl, {
24692
24704
  ...contentImplProps,
24693
24705
  disableRemoveScroll,