tamagui 1.74.1 → 1.74.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.
package/dist/native.js CHANGED
@@ -3581,6 +3581,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3581
3581
  function getThemeProxied({ theme, name }, deopt = !1, themeManager, keys, debug) {
3582
3582
  if (!theme)
3583
3583
  return {};
3584
+ let config = (0, import_config.getConfig)();
3584
3585
  function track(key) {
3585
3586
  keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.log(` \u{1F3A8} useTheme() tracking new key: ${key}`));
3586
3587
  }
@@ -3610,13 +3611,13 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3610
3611
  else if (subkey === "get")
3611
3612
  return () => {
3612
3613
  let outVal = (0, import_createVariable.getVariable)(val);
3613
- if (import_constants.isIos && !deopt) {
3614
+ if (import_constants.isIos && !deopt && config.settings.fastSchemeChange) {
3614
3615
  let isDark = name.startsWith("dark"), isLight = !isDark && name.startsWith("light");
3615
3616
  if (isDark || isLight) {
3616
3617
  let oppositeThemeName = name.replace(
3617
3618
  isDark ? "dark" : "light",
3618
3619
  isDark ? "light" : "dark"
3619
- ), oppositeTheme = (0, import_config.getConfig)().themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
3620
+ ), oppositeTheme = config.themes[oppositeThemeName], oppositeVal = (0, import_createVariable.getVariable)(oppositeTheme == null ? void 0 : oppositeTheme[keyString]);
3620
3621
  if (oppositeVal)
3621
3622
  return {
3622
3623
  dynamic: {
@@ -3664,15 +3665,15 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3664
3665
  let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
3665
3666
  forced && setThemeState((prev) => createState(prev, !0));
3666
3667
  }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme((name, manager) => {
3667
- let force = (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"], doUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
3668
+ let force = (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
3668
3669
  process.env.NODE_ENV === "development" && props.debug && console.log(" \u{1F538} onChange", themeManager.id, {
3669
3670
  force,
3670
- doUpdate,
3671
+ shouldTryUpdate,
3671
3672
  props,
3672
3673
  name,
3673
3674
  manager,
3674
3675
  keys
3675
- }), doUpdate && setThemeState(createState);
3676
+ }), shouldTryUpdate && setThemeState(createState);
3676
3677
  }, themeManager.id);
3677
3678
  return () => {
3678
3679
  selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), activeThemeManagers.delete(themeManager);
@@ -4169,7 +4170,7 @@ var require_createComponent_native = __commonJS({
4169
4170
  ),
4170
4171
  debug: debugProp
4171
4172
  };
4172
- themeStateProps.deopt = config != null && config.settings.fastSchemeChange ? willBeAnimated : !0;
4173
+ themeStateProps.deopt = willBeAnimated;
4173
4174
  let isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
4174
4175
  if (process.env.NODE_ENV === "development") {
4175
4176
  let id = (0, import_react2.useId)();
@@ -4414,7 +4415,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4414
4415
  isZStack,
4415
4416
  debug: debugProp
4416
4417
  });
4417
- asChild && (elementType = import_Slot.Slot), process.env.NODE_ENV === "development" && time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
4418
+ asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`, // in test mode disable perf unwrapping so react-testing-library finds Text properly
4418
4419
  process.env.NODE_ENV !== "test" && (elementType === BaseText || elementType === BaseView) ? process.env.TAMAGUI_OPTIMIZE_NATIVE_VIEWS ? (viewProps.children = content, content = (0, import_react2.createElement)(
4419
4420
  elementType === BaseText ? "RCTText" : "RCTView",
4420
4421
  viewProps
@@ -12576,22 +12577,22 @@ var require_Form_native = __commonJS({
12576
12577
  useFormContext: () => useFormContext
12577
12578
  });
12578
12579
  module2.exports = __toCommonJS2(Form_exports);
12579
- var import_core12 = require_index_native15(), import_create_context = require_index_native25(), import_react2 = require("react"), import_jsx_runtime6 = require("react/jsx-runtime"), FORM_NAME = "Form", FormFrame = (0, import_core12.styled)(import_core12.Stack, {
12580
+ var import_core12 = require_index_native15(), import_create_context = require_index_native25(), import_jsx_runtime6 = require("react/jsx-runtime"), FORM_NAME = "Form", FormFrame = (0, import_core12.styled)(import_core12.Stack, {
12580
12581
  name: FORM_NAME,
12581
12582
  tag: "form"
12582
12583
  }), [createFormContext] = (0, import_create_context.createContextScope)(FORM_NAME), [FormProvider, useFormContext] = createFormContext(FORM_NAME), TRIGGER_NAME = "FormTrigger", FormTriggerFrame = (0, import_core12.styled)(import_core12.View, {
12583
12584
  name: TRIGGER_NAME
12584
12585
  }), FormTrigger = FormTriggerFrame.styleable(
12585
12586
  (props, forwardedRef) => {
12586
- let { __scopeForm, children, ...triggerProps } = props, context = useFormContext(TRIGGER_NAME, __scopeForm);
12587
+ let { __scopeForm, children, onPress, ...triggerProps } = props, context = useFormContext(TRIGGER_NAME, __scopeForm);
12587
12588
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
12588
12589
  FormTriggerFrame,
12589
12590
  {
12590
12591
  tag: "button",
12591
12592
  ...triggerProps,
12592
- children: triggerProps.asChild ? (0, import_react2.cloneElement)(children, { disabled: triggerProps.disabled }) : children,
12593
12593
  ref: forwardedRef,
12594
- onPress: (0, import_core12.composeEventHandlers)(props.onPress, context.onSubmit)
12594
+ onPress: (0, import_core12.composeEventHandlers)(onPress, context.onSubmit),
12595
+ children
12595
12596
  }
12596
12597
  );
12597
12598
  }
@@ -13193,8 +13194,7 @@ var require_Group_native = __commonJS({
13193
13194
  variants: {
13194
13195
  unstyled: {
13195
13196
  false: {
13196
- size: "$true",
13197
- y: 0
13197
+ size: "$true"
13198
13198
  }
13199
13199
  },
13200
13200
  size: (val, { tokens }) => ({