tamagui 1.79.8 → 1.79.10

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
@@ -2654,7 +2654,10 @@ var require_propMapper_native = __commonJS({
2654
2654
  return;
2655
2655
  if (value === "unset") {
2656
2656
  let unsetVal = (_a = styleStateIn.conf.unset) == null ? void 0 : _a[key];
2657
- unsetVal != null && (value = unsetVal);
2657
+ if (unsetVal != null)
2658
+ value = unsetVal;
2659
+ else
2660
+ return;
2658
2661
  }
2659
2662
  let subProps = styleStateIn.styleProps.fallbackProps || subPropsIn, styleState = subProps ? new Proxy(styleStateIn, {
2660
2663
  get(_, k) {
@@ -2985,7 +2988,7 @@ var require_getSplitStyles_native = __commonJS({
2985
2988
  parentStaticConfig
2986
2989
  }), console.groupEnd()), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || !styleProps.noSkip && keyInit in skipProps)
2987
2990
  continue;
2988
- if (isText && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
2991
+ if (isText && valInit && (keyInit === "fontFamily" || keyInit === shorthands.fontFamily) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit), isValidStyleKeyInit && !variants && valInit !== "unset" && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
2989
2992
  style[keyInit] = valInit;
2990
2993
  continue;
2991
2994
  }
@@ -4172,7 +4175,8 @@ var require_createComponent_native = __commonJS({
4172
4175
  defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
4173
4176
  });
4174
4177
  let component = (0, import_react2.forwardRef)((propsIn, forwardedRef) => {
4175
- var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m;
4178
+ var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m, _n;
4179
+ let internalID = process.env.NODE_ENV === "development" ? (0, import_react2.useId)() : "";
4176
4180
  if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
4177
4181
  hasSetupBaseViews = !0;
4178
4182
  let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
@@ -4263,32 +4267,29 @@ var require_createComponent_native = __commonJS({
4263
4267
  };
4264
4268
  typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated;
4265
4269
  let isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
4266
- if (process.env.NODE_ENV === "development") {
4267
- let id = (0, import_react2.useId)();
4268
- if (debugProp && debugProp !== "profile") {
4269
- let name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = isAnimatedReactNative ? "(animated)" : isReactNative ? "(rnw)" : "", dataIs = propsIn["data-is"] || "", banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type} id ${id}`;
4270
- console.group(
4271
- `%c ${banner} (unmounted: ${state.unmounted})${presence ? ` (presence: ${presence[0]})` : ""} ${isHydrated ? "\u{1F4A6}" : "\u{1F3DC}\uFE0F"}`,
4272
- "background: green; color: white;"
4273
- ), import_constants.isServer || (console.groupCollapsed(
4274
- `Info (collapsed): ${state.press || state.pressIn ? "PRESSED " : ""}${state.hover ? "HOVERED " : ""}${state.focus ? "FOCUSED" : " "}`
4275
- ), (0, import_log.log)({
4276
- propsIn,
4277
- props,
4278
- state,
4279
- staticConfig,
4280
- elementType,
4281
- themeStateProps,
4282
- styledContext: { contextProps: styledContextProps, overriddenContextProps },
4283
- presence,
4284
- isAnimated,
4285
- isHOC,
4286
- hasAnimationProp,
4287
- useAnimations,
4288
- propsInOrder: Object.keys(propsIn),
4289
- propsOrder: Object.keys(props)
4290
- }), console.groupEnd());
4291
- }
4270
+ if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
4271
+ let name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`, type = isAnimatedReactNative ? "(animated)" : isReactNative ? "(rnw)" : "", dataIs = propsIn["data-is"] || "", banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type} id ${internalID}`;
4272
+ console.group(
4273
+ `%c ${banner} (unmounted: ${state.unmounted})${presence ? ` (presence: ${presence[0]})` : ""} ${isHydrated ? "\u{1F4A6}" : "\u{1F3DC}\uFE0F"}`,
4274
+ "background: green; color: white;"
4275
+ ), import_constants.isServer || (console.groupCollapsed(
4276
+ `Info (collapsed): ${state.press || state.pressIn ? "PRESSED " : ""}${state.hover ? "HOVERED " : ""}${state.focus ? "FOCUSED" : " "}`
4277
+ ), (0, import_log.log)({
4278
+ propsIn,
4279
+ props,
4280
+ state,
4281
+ staticConfig,
4282
+ elementType,
4283
+ themeStateProps,
4284
+ styledContext: { contextProps: styledContextProps, overriddenContextProps },
4285
+ presence,
4286
+ isAnimated,
4287
+ isHOC,
4288
+ hasAnimationProp,
4289
+ useAnimations,
4290
+ propsInOrder: Object.keys(propsIn),
4291
+ propsOrder: Object.keys(props)
4292
+ }), console.groupEnd());
4292
4293
  }
4293
4294
  process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
4294
4295
  let [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
@@ -4514,8 +4515,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4514
4515
  direction,
4515
4516
  isZStack,
4516
4517
  debug: debugProp
4517
- });
4518
- asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
4518
+ }), ResetPresence = (_l = config == null ? void 0 : config.animations) == null ? void 0 : _l.ResetPresence;
4519
+ willBeAnimated && presence && ResetPresence && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence, { children: content })), asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
4519
4520
  let useChildrenResult;
4520
4521
  import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(
4521
4522
  elementType,
@@ -4553,7 +4554,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4553
4554
  content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Provider, { ...contextValue, ...overriddenContextProps, children: content });
4554
4555
  }
4555
4556
  if (process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile") {
4556
- console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> with props`);
4557
+ console.groupCollapsed(`render <${typeof elementType == "string" ? elementType : "Component"} /> (${internalID}) with props`);
4557
4558
  try {
4558
4559
  (0, import_log.log)("viewProps", viewProps), (0, import_log.log)("viewPropsOrder", Object.keys(viewProps));
4559
4560
  for (let key in viewProps)
@@ -4571,8 +4572,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
4571
4572
  handlesPressEvents,
4572
4573
  willBeAnimated,
4573
4574
  isStringElement,
4574
- classNamesIn: (_l = props.className) == null ? void 0 : _l.split(" "),
4575
- classNamesOut: (_m = viewProps.className) == null ? void 0 : _m.split(" "),
4575
+ classNamesIn: (_m = props.className) == null ? void 0 : _m.split(" "),
4576
+ classNamesOut: (_n = viewProps.className) == null ? void 0 : _n.split(" "),
4576
4577
  events,
4577
4578
  shouldAttach,
4578
4579
  pseudos,
@@ -6186,10 +6187,11 @@ var require_PresenceContext_native = __commonJS({
6186
6187
  return to;
6187
6188
  }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), PresenceContext_exports = {};
6188
6189
  __export2(PresenceContext_exports, {
6189
- PresenceContext: () => PresenceContext
6190
+ PresenceContext: () => PresenceContext,
6191
+ ResetPresence: () => ResetPresence
6190
6192
  });
6191
6193
  module2.exports = __toCommonJS2(PresenceContext_exports);
6192
- var import_react2 = require("react"), PresenceContext = (0, import_react2.createContext)(null);
6194
+ var import_react2 = require("react"), import_jsx_runtime6 = require("react/jsx-runtime"), PresenceContext = (0, import_react2.createContext)(null), ResetPresence = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PresenceContext.Provider, { value: null, children: props.children });
6193
6195
  }
6194
6196
  });
6195
6197
 
@@ -8412,6 +8414,27 @@ var require_ThemeableStack_native = __commonJS({
8412
8414
  }
8413
8415
  });
8414
8416
 
8417
+ // ../stacks/dist/cjs/NestingContext.native.js
8418
+ var require_NestingContext_native = __commonJS({
8419
+ "../stacks/dist/cjs/NestingContext.native.js"(exports, module2) {
8420
+ "use strict";
8421
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
8422
+ for (var name in all)
8423
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
8424
+ }, __copyProps2 = (to, from, except, desc) => {
8425
+ if (from && typeof from == "object" || typeof from == "function")
8426
+ for (let key of __getOwnPropNames2(from))
8427
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
8428
+ return to;
8429
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), NestingContext_exports = {};
8430
+ __export2(NestingContext_exports, {
8431
+ ButtonNestingContext: () => ButtonNestingContext
8432
+ });
8433
+ module2.exports = __toCommonJS2(NestingContext_exports);
8434
+ var import_react2 = require("react"), ButtonNestingContext = (0, import_react2.createContext)(!1);
8435
+ }
8436
+ });
8437
+
8415
8438
  // ../stacks/dist/cjs/index.native.js
8416
8439
  var require_index_native19 = __commonJS({
8417
8440
  "../stacks/dist/cjs/index.native.js"(exports, module2) {
@@ -8426,6 +8449,7 @@ var require_index_native19 = __commonJS({
8426
8449
  __reExport2(src_exports2, require_Stacks_native(), module2.exports);
8427
8450
  __reExport2(src_exports2, require_SizableStack_native(), module2.exports);
8428
8451
  __reExport2(src_exports2, require_ThemeableStack_native(), module2.exports);
8452
+ __reExport2(src_exports2, require_NestingContext_native(), module2.exports);
8429
8453
  }
8430
8454
  });
8431
8455
 
@@ -10880,11 +10904,11 @@ var require_Dialog_native = __commonJS({
10880
10904
  name: TRIGGER_NAME
10881
10905
  }), DialogTrigger = DialogTriggerFrame.styleable(
10882
10906
  (props, forwardedRef) => {
10883
- let { __scopeDialog, ...triggerProps } = props, context = useDialogContext(TRIGGER_NAME, __scopeDialog), composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
10884
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
10907
+ let { __scopeDialog, ...triggerProps } = props, isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext), context = useDialogContext(TRIGGER_NAME, __scopeDialog), composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
10908
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
10885
10909
  DialogTriggerFrame,
10886
10910
  {
10887
- tag: "button",
10911
+ tag: isInsideButton ? "span" : "button",
10888
10912
  "aria-haspopup": "dialog",
10889
10913
  "aria-expanded": context.open,
10890
10914
  "aria-controls": context.contentId,
@@ -10893,7 +10917,7 @@ var require_Dialog_native = __commonJS({
10893
10917
  ref: composedTriggerRef,
10894
10918
  onPress: (0, import_core13.composeEventHandlers)(props.onPress, context.onOpenToggle)
10895
10919
  }
10896
- );
10920
+ ) });
10897
10921
  }
10898
10922
  );
10899
10923
  DialogTrigger.displayName = TRIGGER_NAME;
@@ -12030,7 +12054,6 @@ var require_Button_native = __commonJS({
12030
12054
  ButtonContext: () => ButtonContext,
12031
12055
  ButtonFrame: () => ButtonFrame,
12032
12056
  ButtonIcon: () => ButtonIcon,
12033
- ButtonNestingContext: () => ButtonNestingContext,
12034
12057
  ButtonText: () => ButtonText,
12035
12058
  buttonStaticConfig: () => buttonStaticConfig,
12036
12059
  useButton: () => useButton
@@ -12148,9 +12171,9 @@ var require_Button_native = __commonJS({
12148
12171
  }, Button2 = (0, import_web.withStaticProperties)(ButtonComponent, {
12149
12172
  Text: ButtonText,
12150
12173
  Icon: ButtonIcon
12151
- }), ButtonNestingContext = (0, import_react2.createContext)(!1);
12174
+ });
12152
12175
  function useButton({ textProps, ...propsIn }, { Text: Text3 = Button2.Text } = { Text: Button2.Text }) {
12153
- let isNested = (0, import_react2.useContext)(ButtonNestingContext), didFinishSSR = (0, import_web.useDidFinishSSR)(), propsActive = (0, import_web.useProps)(propsIn), {
12176
+ let isNested = (0, import_react2.useContext)(import_stacks3.ButtonNestingContext), didFinishSSR = (0, import_web.useDidFinishSSR)(), propsActive = (0, import_web.useProps)(propsIn), {
12154
12177
  icon,
12155
12178
  iconAfter,
12156
12179
  space,
@@ -12160,7 +12183,8 @@ var require_Button_native = __commonJS({
12160
12183
  separator,
12161
12184
  noTextWrap,
12162
12185
  fontFamily,
12163
- fontSize
12186
+ fontSize,
12187
+ ...restProps
12164
12188
  } = propsActive, size2 = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size2 == "number" ? size2 * 0.5 : (0, import_font_size.getFontSize)(size2)) * scaleIcon, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
12165
12189
  size: iconSize,
12166
12190
  color
@@ -12182,7 +12206,7 @@ var require_Button_native = __commonJS({
12182
12206
  // defaults to <a /> when accessibilityRole = link
12183
12207
  // see https://github.com/tamagui/tamagui/issues/505
12184
12208
  propsActive.accessibilityRole === "link" ? "a" : void 0
12185
- ), { iconAfter: _1, icon: _2, noTextWrap: _3, ...restProps } = propsIn, props = {
12209
+ ), props = {
12186
12210
  size: size2,
12187
12211
  ...propsIn.disabled && {
12188
12212
  // in rnw - false still has keyboard tabIndex, undefined = not actually focusable
@@ -12196,7 +12220,7 @@ var require_Button_native = __commonJS({
12196
12220
  tag
12197
12221
  },
12198
12222
  ...restProps,
12199
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ButtonNestingContext.Provider, { value: !0, children: inner }),
12223
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: inner }),
12200
12224
  // forces it to be a runtime pressStyle so it passes through context text colors
12201
12225
  disableClassName: didFinishSSR
12202
12226
  };
@@ -12805,7 +12829,7 @@ var require_Checkbox_native = __commonJS({
12805
12829
  native,
12806
12830
  scaleIcon,
12807
12831
  ...checkboxProps
12808
- } = props, [button, setButton] = React2.useState(null), composedRefs = (0, import_core13.useComposedRefs)(forwardedRef, (node) => setButton(node)), hasConsumerStoppedPropagationRef = React2.useRef(!1), propsActive = (0, import_core13.useProps)(props), isFormControl = import_core13.isWeb ? button ? !!button.closest("form") : !0 : !1, [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
12832
+ } = props, isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext), [button, setButton] = React2.useState(null), composedRefs = (0, import_core13.useComposedRefs)(forwardedRef, (node) => setButton(node)), hasConsumerStoppedPropagationRef = React2.useRef(!1), propsActive = (0, import_core13.useProps)(props), isFormControl = import_core13.isWeb ? button ? !!button.closest("form") : !0 : !1, [checked = !1, setChecked] = (0, import_use_controllable_state.useControllableState)({
12809
12833
  prop: checkedProp,
12810
12834
  defaultProp: defaultChecked,
12811
12835
  onChange: onCheckedChange
@@ -12841,7 +12865,7 @@ var require_Checkbox_native = __commonJS({
12841
12865
  {
12842
12866
  width: size2,
12843
12867
  height: size2,
12844
- tag: "button",
12868
+ tag: isInsideButton ? "span" : "button",
12845
12869
  role: "checkbox",
12846
12870
  "aria-labelledby": labelledBy,
12847
12871
  "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
@@ -16927,7 +16951,9 @@ var require_Select_native = __commonJS({
16927
16951
  });
16928
16952
  React2.useEffect(() => {
16929
16953
  open && emitValue(value);
16930
- }, [open]);
16954
+ }, [open]), React2.useEffect(() => {
16955
+ emitValue(value);
16956
+ }, [value]);
16931
16957
  let [activeIndex, setActiveIndex] = React2.useState(0), [emitValue, valueSubscribe] = useEmitter(), [emitActiveIndex, activeIndexSubscribe] = useEmitter(), selectedIndexRef = React2.useRef(null), activeIndexRef = React2.useRef(null), listContentRef = React2.useRef([]), [selectedIndex, setSelectedIndex] = React2.useState(0), [valueNode, setValueNode] = React2.useState(null);
16932
16958
  (0, import_core13.useIsomorphicLayoutEffect)(() => {
16933
16959
  selectedIndexRef.current = selectedIndex, activeIndexRef.current = activeIndex;
@@ -17914,25 +17940,29 @@ var require_createSwitch_native = __commonJS({
17914
17940
  onChange: onCheckedChange,
17915
17941
  transition: !0
17916
17942
  });
17917
- return shouldRenderMobileNative ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17918
- import_react_native4.Switch,
17919
- {
17920
- value: checkedProp,
17921
- onValueChange: onCheckedChange,
17922
- ...nativeProps
17923
- }
17924
- ) : (import_core13.isWeb || React2.useEffect(() => {
17943
+ if (shouldRenderMobileNative)
17944
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17945
+ import_react_native4.Switch,
17946
+ {
17947
+ value: checkedProp,
17948
+ onValueChange: onCheckedChange,
17949
+ ...nativeProps
17950
+ }
17951
+ );
17952
+ import_core13.isWeb || React2.useEffect(() => {
17925
17953
  if (props.id)
17926
17954
  return (0, import_focusable2.registerFocusable)(props.id, {
17927
17955
  focus: () => {
17928
17956
  setChecked((x) => !x);
17929
17957
  }
17930
17958
  });
17931
- }, [props.id, setChecked]), /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
17932
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17959
+ }, [props.id, setChecked]);
17960
+ let isInsideButton = React2.useContext(import_stacks3.ButtonNestingContext);
17961
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
17962
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17933
17963
  Frame,
17934
17964
  {
17935
- tag: "button",
17965
+ tag: isInsideButton ? "span" : "button",
17936
17966
  unstyled,
17937
17967
  size: size2,
17938
17968
  checked,
@@ -17968,7 +17998,7 @@ var require_createSwitch_native = __commonJS({
17968
17998
  }
17969
17999
  )
17970
18000
  }
17971
- ),
18001
+ ) }),
17972
18002
  import_core13.isWeb && isFormControl && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17973
18003
  BubbleInput,
17974
18004
  {
@@ -17982,7 +18012,7 @@ var require_createSwitch_native = __commonJS({
17982
18012
  style: { transform: "translateX(-100%)" }
17983
18013
  }
17984
18014
  )
17985
- ] }));
18015
+ ] });
17986
18016
  }), BubbleInput = (props) => {
17987
18017
  let { control, checked, bubbles = !0, ...inputProps } = props, ref = React2.useRef(null), prevChecked = (0, import_use_previous.usePrevious)(checked);
17988
18018
  return React2.useEffect(() => {