@tamagui/core 1.89.3 → 1.89.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
@@ -922,9 +922,9 @@ var require_index_native3 = __commonJS({
922
922
  }
923
923
  });
924
924
 
925
- // ../helpers/dist/cjs/native.js
926
- var require_native = __commonJS({
927
- "../helpers/dist/cjs/native.js"(exports2, module2) {
925
+ // ../helpers/dist/cjs/shouldRenderNativePlatform.native.js
926
+ var require_shouldRenderNativePlatform_native = __commonJS({
927
+ "../helpers/dist/cjs/shouldRenderNativePlatform.native.js"(exports2, module2) {
928
928
  "use strict";
929
929
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
930
930
  for (var name in all)
@@ -934,11 +934,11 @@ var require_native = __commonJS({
934
934
  for (let key of __getOwnPropNames2(from))
935
935
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
936
936
  return to;
937
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), native_exports = {};
938
- __export2(native_exports, {
937
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), shouldRenderNativePlatform_exports = {};
938
+ __export2(shouldRenderNativePlatform_exports, {
939
939
  shouldRenderNativePlatform: () => shouldRenderNativePlatform
940
940
  });
941
- module2.exports = __toCommonJS2(native_exports);
941
+ module2.exports = __toCommonJS2(shouldRenderNativePlatform_exports);
942
942
  var import_constants = require_index_native3(), ALL_PLATFORMS = ["web", "android", "ios"];
943
943
  function shouldRenderNativePlatform(nativeProp) {
944
944
  if (!nativeProp)
@@ -1238,7 +1238,7 @@ var require_index_native4 = __commonJS({
1238
1238
  __reExport2(src_exports2, require_composeEventHandlers_native(), module2.exports);
1239
1239
  __reExport2(src_exports2, require_concatClassName_native(), module2.exports);
1240
1240
  __reExport2(src_exports2, require_types_native2(), module2.exports);
1241
- __reExport2(src_exports2, require_native(), module2.exports);
1241
+ __reExport2(src_exports2, require_shouldRenderNativePlatform_native(), module2.exports);
1242
1242
  __reExport2(src_exports2, require_validStyleProps_native(), module2.exports);
1243
1243
  __reExport2(src_exports2, require_withStaticProperties_native(), module2.exports);
1244
1244
  }
@@ -4070,7 +4070,7 @@ var require_getSplitStyles_native = __commonJS({
4070
4070
  return (staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles))[key] || ((_a = staticConfig.acceptTokens) == null ? void 0 : _a[key]);
4071
4071
  }
4072
4072
  var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
4073
- var _a, _b, _c, _e, _f, _g;
4073
+ var _a, _b, _c, _e, _f, _g, _h;
4074
4074
  conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
4075
4075
  let { shorthands } = conf, {
4076
4076
  isHOC,
@@ -4434,7 +4434,10 @@ current`, {
4434
4434
  }
4435
4435
  process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style.fontFamily}`, faceInfo);
4436
4436
  }
4437
- if (className && (classNames.className = className), process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
4437
+ let fontFamily = isText || isInput ? styleState.fontFamily || ((_h = staticConfig.defaultProps) == null ? void 0 : _h.fontFamily) : null;
4438
+ fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
4439
+ let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", asChild = props.asChild;
4440
+ if (asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style), process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
4438
4441
  console.groupCollapsed("\u{1F539} getSplitStyles ===>");
4439
4442
  try {
4440
4443
  let logs = {
@@ -4926,7 +4929,7 @@ var require_createComponent_native = __commonJS({
4926
4929
  // disableClassName="until-hydrated" to be more straightforward
4927
4930
  // see issue if not, Button sets disableClassName to true <Button animation="" /> with
4928
4931
  // the react-native driver errors because it tries to animate var(--color) to rbga(..)
4929
- propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
4932
+ propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group;
4930
4933
  if (groupName && !curState.group) {
4931
4934
  let listeners = /* @__PURE__ */ new Set();
4932
4935
  curState.group = {
@@ -4955,7 +4958,7 @@ var require_createComponent_native = __commonJS({
4955
4958
  };
4956
4959
  }
4957
4960
  process.env.NODE_ENV === "development" && time && time`use-state`;
4958
- let componentNameFinal = props.componentName || componentName2, componentClassName = props.asChild || !componentNameFinal ? "" : `is_${componentNameFinal}`, hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_e = props.accessibilityState) == null ? void 0 : _e.disabled);
4961
+ let hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_e = props.accessibilityState) == null ? void 0 : _e.disabled);
4959
4962
  process.env.NODE_ENV === "development" && time && time`use-context`;
4960
4963
  let element = import_constants.isWeb && (!Component || typeof Component == "string") && props.tag || Component, elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
4961
4964
  animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
@@ -5022,26 +5025,7 @@ var require_createComponent_native = __commonJS({
5022
5025
  style: splitStylesStyle,
5023
5026
  classNames,
5024
5027
  space
5025
- } = splitStyles, propsWithAnimation = props, animationStyles;
5026
- if (
5027
- // if it supports css vars we run it on server too to get matching initial style
5028
- (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
5029
- ) {
5030
- let animations = useAnimations({
5031
- props: propsWithAnimation,
5032
- // if hydrating, send empty style
5033
- style: splitStylesStyle,
5034
- presence,
5035
- componentState: state,
5036
- styleProps,
5037
- theme: (_g = themeState.state) == null ? void 0 : _g.theme,
5038
- pseudos: pseudos || null,
5039
- staticConfig,
5040
- stateRef
5041
- });
5042
- (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style), process.env.NODE_ENV === "development" && time && time`animations`;
5043
- }
5044
- let {
5028
+ } = splitStyles, propsWithAnimation = props, {
5045
5029
  asChild,
5046
5030
  children,
5047
5031
  themeShallow,
@@ -5068,15 +5052,35 @@ var require_createComponent_native = __commonJS({
5068
5052
  // @ts-ignore
5069
5053
  defaultVariants,
5070
5054
  ...nonTamaguiProps
5071
- } = viewPropsIn;
5055
+ } = viewPropsIn, viewProps = nonTamaguiProps;
5056
+ hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp);
5057
+ let animationStyles;
5058
+ if (
5059
+ // if it supports css vars we run it on server too to get matching initial style
5060
+ (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
5061
+ ) {
5062
+ let animations = useAnimations({
5063
+ props: propsWithAnimation,
5064
+ // if hydrating, send empty style
5065
+ style: splitStylesStyle,
5066
+ presence,
5067
+ componentState: state,
5068
+ styleProps,
5069
+ theme: (_g = themeState.state) == null ? void 0 : _g.theme,
5070
+ pseudos: pseudos || null,
5071
+ staticConfig,
5072
+ stateRef
5073
+ });
5074
+ (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles), process.env.NODE_ENV === "development" && time && time`animations`;
5075
+ }
5072
5076
  process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(
5073
5077
  `You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
5074
5078
 
5075
5079
  If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`
5076
5080
  ), process.env.NODE_ENV === "development" && time && time`destructure`;
5077
5081
  let disabled = ((_h = props.accessibilityState) == null ? void 0 : _h.disabled) || // @ts-expect-error (comes from core)
5078
- props.accessibilityDisabled, viewProps = nonTamaguiProps;
5079
- hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
5082
+ props.accessibilityDisabled;
5083
+ groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
5080
5084
  nonTamaguiProps.onLayout,
5081
5085
  (e) => {
5082
5086
  stateRef.current.group.emit(groupName, {
@@ -5140,10 +5144,6 @@ If you meant to do this, you can disable this warning - either change untilMeasu
5140
5144
  pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
5141
5145
  mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
5142
5146
  ]);
5143
- let fontFamily = isText || isInput ? splitStyles.fontFamily || ((_k = staticConfig.defaultProps) == null ? void 0 : _k.fontFamily) : null;
5144
- fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
5145
- let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style, className;
5146
- asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
5147
5147
  let runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.focusStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || onFocus || onBlur), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick), runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = runtimeHoverStyle || onHoverIn || onHoverOut, isHoverable = import_constants.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
5148
5148
  process.env.NODE_ENV === "development" && time && time`events-setup`;
5149
5149
  let events = shouldAttach && !isDisabled && !props.asChild ? {
@@ -5196,7 +5196,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
5196
5196
  delayPressOut: viewProps.delayPressOut,
5197
5197
  focusable: viewProps.focusable ?? !0,
5198
5198
  minPressDuration: 0
5199
- }), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (_m = (_l = import_setupHooks.hooks).useEvents) == null || _m.call(_l, viewProps, events, splitStyles, setStateShallow, staticConfig);
5199
+ }), process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", { events, isHoverable, attachPress }), (_l = (_k = import_setupHooks.hooks).useEvents) == null || _l.call(_k, viewProps, events, splitStyles, setStateShallow, staticConfig);
5200
5200
  let direction = props.spaceDirection || "both";
5201
5201
  process.env.NODE_ENV === "development" && time && time`hooks`;
5202
5202
  let content = !children || asChild ? children : spacedChildren({
@@ -5216,7 +5216,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
5216
5216
  events,
5217
5217
  staticConfig
5218
5218
  )), useChildrenResult ? content = useChildrenResult : content = (0, import_react3.createElement)(elementType, viewProps, content);
5219
- let ResetPresence = (_n = config == null ? void 0 : config.animations) == null ? void 0 : _n.ResetPresence;
5219
+ let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
5220
5220
  ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResetPresence, { children: content })), process.env.NODE_ENV === "development" && time && time`create-element`;
5221
5221
  let groupState = curState.group, subGroupContext = (0, import_react3.useMemo)(() => {
5222
5222
  if (!(!groupState || !groupName))
@@ -5242,7 +5242,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
5242
5242
  if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, { themeState, themeProps: props, children: content })), staticConfig.context) {
5243
5243
  let contextProps = staticConfig.context.props;
5244
5244
  for (let key in contextProps)
5245
- (key in style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = style[key] ?? viewProps[key]);
5245
+ (viewProps.style && key in viewProps.style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = ((_n = viewProps.style) == null ? void 0 : _n[key]) ?? viewProps[key]);
5246
5246
  }
5247
5247
  if (overriddenContextProps) {
5248
5248
  let Provider = staticConfig.context.Provider;