@tamagui/core 1.89.2 → 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.
@@ -912,9 +912,9 @@ var require_index_native3 = __commonJS({
912
912
  }
913
913
  });
914
914
 
915
- // ../helpers/dist/cjs/native.js
916
- var require_native = __commonJS({
917
- "../helpers/dist/cjs/native.js"(exports2, module2) {
915
+ // ../helpers/dist/cjs/shouldRenderNativePlatform.native.js
916
+ var require_shouldRenderNativePlatform_native = __commonJS({
917
+ "../helpers/dist/cjs/shouldRenderNativePlatform.native.js"(exports2, module2) {
918
918
  "use strict";
919
919
  var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
920
920
  for (var name in all)
@@ -924,11 +924,11 @@ var require_native = __commonJS({
924
924
  for (let key of __getOwnPropNames2(from))
925
925
  !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
926
926
  return to;
927
- }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), native_exports = {};
928
- __export2(native_exports, {
927
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), shouldRenderNativePlatform_exports = {};
928
+ __export2(shouldRenderNativePlatform_exports, {
929
929
  shouldRenderNativePlatform: () => shouldRenderNativePlatform
930
930
  });
931
- module2.exports = __toCommonJS2(native_exports);
931
+ module2.exports = __toCommonJS2(shouldRenderNativePlatform_exports);
932
932
  var import_constants = require_index_native3(), ALL_PLATFORMS = ["web", "android", "ios"];
933
933
  function shouldRenderNativePlatform(nativeProp) {
934
934
  if (!nativeProp)
@@ -1228,7 +1228,7 @@ var require_index_native4 = __commonJS({
1228
1228
  __reExport2(src_exports2, require_composeEventHandlers_native(), module2.exports);
1229
1229
  __reExport2(src_exports2, require_concatClassName_native(), module2.exports);
1230
1230
  __reExport2(src_exports2, require_types_native2(), module2.exports);
1231
- __reExport2(src_exports2, require_native(), module2.exports);
1231
+ __reExport2(src_exports2, require_shouldRenderNativePlatform_native(), module2.exports);
1232
1232
  __reExport2(src_exports2, require_validStyleProps_native(), module2.exports);
1233
1233
  __reExport2(src_exports2, require_withStaticProperties_native(), module2.exports);
1234
1234
  }
@@ -3902,7 +3902,7 @@ var require_getSplitStyles_native = __commonJS({
3902
3902
  return (staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles))[key] || ((_a = staticConfig.acceptTokens) == null ? void 0 : _a[key]);
3903
3903
  }
3904
3904
  var getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
3905
- var _a, _b, _c, _e, _f, _g;
3905
+ var _a, _b, _c, _e, _f, _g, _h;
3906
3906
  conf = conf || (0, import_config.getConfig)(), import_constants.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
3907
3907
  let { shorthands } = conf, {
3908
3908
  isHOC,
@@ -4204,7 +4204,10 @@ var require_getSplitStyles_native = __commonJS({
4204
4204
  overrideFace && (style.fontFamily = overrideFace, styleState.fontFamily = overrideFace, delete style.fontWeight, delete style.fontStyle);
4205
4205
  }
4206
4206
  }
4207
- if (className && (classNames.className = className), !1)
4207
+ let fontFamily = isText || isInput ? styleState.fontFamily || ((_h = staticConfig.defaultProps) == null ? void 0 : _h.fontFamily) : null;
4208
+ fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
4209
+ let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", asChild = props.asChild;
4210
+ if (asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style), !1)
4208
4211
  try {
4209
4212
  } catch {
4210
4213
  }
@@ -4636,7 +4639,7 @@ var require_createComponent_native = __commonJS({
4636
4639
  // disableClassName="until-hydrated" to be more straightforward
4637
4640
  // see issue if not, Button sets disableClassName to true <Button animation="" /> with
4638
4641
  // the react-native driver errors because it tries to animate var(--color) to rbga(..)
4639
- propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group, groupClassName = groupName ? `t_group_${props.group}` : "";
4642
+ propsIn.disableClassName && isHydrated), shouldForcePseudo = !!propsIn.forceStyle, noClassNames = shouldAvoidClasses || shouldForcePseudo, groupName = props.group;
4640
4643
  if (groupName && !curState.group) {
4641
4644
  let listeners = /* @__PURE__ */ new Set();
4642
4645
  curState.group = {
@@ -4664,7 +4667,7 @@ var require_createComponent_native = __commonJS({
4664
4667
  groupContextState[groupName] = next;
4665
4668
  };
4666
4669
  }
4667
- 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), element = import_constants.isWeb && (!Component || typeof Component == "string") && props.tag || Component, elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
4670
+ let hasTextAncestor = !!(import_constants.isWeb && isText && componentContext.inText), isDisabled = props.disabled ?? ((_e = props.accessibilityState) == null ? void 0 : _e.disabled), element = import_constants.isWeb && (!Component || typeof Component == "string") && props.tag || Component, elementType = isText ? BaseText || element || "span" : BaseView || element || (hasTextAncestor ? "span" : "div");
4668
4671
  animationsConfig && isAnimated && (elementType = animationsConfig[isText ? "Text" : "View"] || elementType);
4669
4672
  let disableTheme = isHOC;
4670
4673
  props.themeShallow && (curState.themeShallow = !0);
@@ -4714,26 +4717,7 @@ var require_createComponent_native = __commonJS({
4714
4717
  style: splitStylesStyle,
4715
4718
  classNames,
4716
4719
  space
4717
- } = splitStyles, propsWithAnimation = props, animationStyles;
4718
- if (
4719
- // if it supports css vars we run it on server too to get matching initial style
4720
- (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
4721
- ) {
4722
- let animations = useAnimations({
4723
- props: propsWithAnimation,
4724
- // if hydrating, send empty style
4725
- style: splitStylesStyle,
4726
- presence,
4727
- componentState: state,
4728
- styleProps,
4729
- theme: (_g = themeState.state) == null ? void 0 : _g.theme,
4730
- pseudos: pseudos || null,
4731
- staticConfig,
4732
- stateRef
4733
- });
4734
- (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style);
4735
- }
4736
- let {
4720
+ } = splitStyles, propsWithAnimation = props, {
4737
4721
  asChild,
4738
4722
  children,
4739
4723
  themeShallow,
@@ -4760,9 +4744,30 @@ var require_createComponent_native = __commonJS({
4760
4744
  // @ts-ignore
4761
4745
  defaultVariants,
4762
4746
  ...nonTamaguiProps
4763
- } = viewPropsIn, disabled = ((_h = props.accessibilityState) == null ? void 0 : _h.disabled) || // @ts-expect-error (comes from core)
4764
- props.accessibilityDisabled, viewProps = nonTamaguiProps;
4765
- hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp), groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
4747
+ } = viewPropsIn, viewProps = nonTamaguiProps;
4748
+ hasAnimationProp && props.tag && !props.role && !props.accessibilityRole && (viewProps.role = props.tag), isHOC && _themeProp && (viewProps.theme = _themeProp);
4749
+ let animationStyles;
4750
+ if (
4751
+ // if it supports css vars we run it on server too to get matching initial style
4752
+ (supportsCSSVars ? willBeAnimatedClient : willBeAnimated) && useAnimations && !isHOC
4753
+ ) {
4754
+ let animations = useAnimations({
4755
+ props: propsWithAnimation,
4756
+ // if hydrating, send empty style
4757
+ style: splitStylesStyle,
4758
+ presence,
4759
+ componentState: state,
4760
+ styleProps,
4761
+ theme: (_g = themeState.state) == null ? void 0 : _g.theme,
4762
+ pseudos: pseudos || null,
4763
+ staticConfig,
4764
+ stateRef
4765
+ });
4766
+ (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles);
4767
+ }
4768
+ let disabled = ((_h = props.accessibilityState) == null ? void 0 : _h.disabled) || // @ts-expect-error (comes from core)
4769
+ props.accessibilityDisabled;
4770
+ groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(
4766
4771
  nonTamaguiProps.onLayout,
4767
4772
  (e) => {
4768
4773
  stateRef.current.group.emit(groupName, {
@@ -4821,10 +4826,6 @@ var require_createComponent_native = __commonJS({
4821
4826
  pseudoGroups ? Object.keys([...pseudoGroups]).join("") : 0,
4822
4827
  mediaGroups ? Object.keys([...mediaGroups]).join("") : 0
4823
4828
  ]);
4824
- let fontFamily = isText || isInput ? splitStyles.fontFamily || ((_k = staticConfig.defaultProps) == null ? void 0 : _k.fontFamily) : null;
4825
- fontFamily && fontFamily[0] === "$" && (fontFamily = fontFamily.slice(1));
4826
- let fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "", style = animationStyles || splitStyles.style, className;
4827
- asChild === "except-style" || asChild === "except-style-web" || (viewProps.style = style);
4828
4829
  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), events = !!(attachFocus || attachPress || isHoverable || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle) && !isDisabled && !props.asChild ? {
4829
4830
  onPressOut: attachPress ? (e) => {
4830
4831
  unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
@@ -4875,7 +4876,7 @@ var require_createComponent_native = __commonJS({
4875
4876
  delayPressOut: viewProps.delayPressOut,
4876
4877
  focusable: viewProps.focusable ?? !0,
4877
4878
  minPressDuration: 0
4878
- }), (_m = (_l = import_setupHooks.hooks).useEvents) == null || _m.call(_l, viewProps, events, splitStyles, setStateShallow, staticConfig);
4879
+ }), (_l = (_k = import_setupHooks.hooks).useEvents) == null || _l.call(_k, viewProps, events, splitStyles, setStateShallow, staticConfig);
4879
4880
  let direction = props.spaceDirection || "both", content = !children || asChild ? children : spacedChildren({
4880
4881
  separator,
4881
4882
  children,
@@ -4893,7 +4894,7 @@ var require_createComponent_native = __commonJS({
4893
4894
  events,
4894
4895
  staticConfig
4895
4896
  )), useChildrenResult ? content = useChildrenResult : content = (0, import_react3.createElement)(elementType, viewProps, content);
4896
- let ResetPresence = (_n = config == null ? void 0 : config.animations) == null ? void 0 : _n.ResetPresence;
4897
+ let ResetPresence = (_m = config == null ? void 0 : config.animations) == null ? void 0 : _m.ResetPresence;
4897
4898
  ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResetPresence, { children: content }));
4898
4899
  let groupState = curState.group, subGroupContext = (0, import_react3.useMemo)(() => {
4899
4900
  if (!(!groupState || !groupName))
@@ -4919,7 +4920,7 @@ var require_createComponent_native = __commonJS({
4919
4920
  if (groupName && subGroupContext && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, { ...componentContext, groups: subGroupContext, children: content })), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1), staticConfig.context) {
4920
4921
  let contextProps = staticConfig.context.props;
4921
4922
  for (let key in contextProps)
4922
- (key in style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = style[key] ?? viewProps[key]);
4923
+ (viewProps.style && key in viewProps.style || key in viewProps) && (overriddenContextProps || (overriddenContextProps = {}), overriddenContextProps[key] = ((_n = viewProps.style) == null ? void 0 : _n[key]) ?? viewProps[key]);
4923
4924
  }
4924
4925
  if (overriddenContextProps) {
4925
4926
  let Provider = staticConfig.context.Provider;