tamagui 2.0.0-1768326993354 → 2.0.0-1768427228811

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.
Files changed (3) hide show
  1. package/dist/native.cjs +14 -11
  2. package/dist/test.cjs +14 -11
  3. package/package.json +57 -57
package/dist/native.cjs CHANGED
@@ -10905,14 +10905,14 @@ function createComponent(staticConfig) {
10905
10905
  var {
10906
10906
  context: context2,
10907
10907
  isReactNative
10908
- } = staticConfig, debugProp = propsIn.debug, styledContextValue = context2 ? React.useContext(context2) : void 0, overriddenContextProps = null;
10908
+ } = staticConfig, debugProp = propsIn.debug, styledContextValue = context2 ? React.useContext(context2) : void 0, overriddenContextProps = null, componentContext = React.useContext(ComponentContext);
10909
10909
  var props = propsIn;
10910
10910
  if (styledContextValue || defaultProps2) {
10911
- var [nextProps, overrides] = mergeComponentProps(defaultProps2, styledContextValue, propsIn);
10911
+ var effectiveDefaults = defaultProps2, [nextProps, overrides] = mergeComponentProps(effectiveDefaults, styledContextValue, propsIn);
10912
10912
  nextProps && (props = nextProps), overriddenContextProps = overrides;
10913
10913
  }
10914
10914
  var componentName2 = props.componentName || staticConfig.componentName;
10915
- var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
10915
+ var groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
10916
10916
  disabled,
10917
10917
  groupName,
10918
10918
  hasAnimationProp,
@@ -13971,7 +13971,7 @@ function PortalHostNonNative(props) {
13971
13971
  deregisterHost: deregisterHost2
13972
13972
  } = usePortal(props.name);
13973
13973
  return useIsomorphicLayoutEffect(function() {
13974
- if (!(typeof window > "u")) return registerHost2(), function() {
13974
+ return registerHost2(), function() {
13975
13975
  deregisterHost2();
13976
13976
  };
13977
13977
  }, []), render(forwardProps ? state.map(function(item) {
@@ -19720,7 +19720,7 @@ function resisted(y, minY) {
19720
19720
  var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCustom = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
19721
19721
  var parentSheet = React.useContext(ParentSheetContext), {
19722
19722
  transition,
19723
- animationConfig: animationConfigProp,
19723
+ transitionConfig: transitionConfigProp,
19724
19724
  modal = false,
19725
19725
  zIndex = parentSheet.zIndex + 1,
19726
19726
  moveOnKeyboardChange = false,
@@ -19749,9 +19749,9 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
19749
19749
  animationDriver
19750
19750
  } = useConfiguration();
19751
19751
  if (!animationDriver) throw new Error("Sheet reqiures an animation driver to be set");
19752
- var animationConfig = (function() {
19752
+ var transitionConfig = (function() {
19753
19753
  var _animationDriver_animations;
19754
- if (animationConfigProp) return animationConfigProp;
19754
+ if (transitionConfigProp) return transitionConfigProp;
19755
19755
  var [animationProp, animationPropConfig] = transition ? Array.isArray(transition) ? transition : [transition] : [];
19756
19756
  return animationProp && !((_animationDriver_animations = animationDriver.animations) === null || _animationDriver_animations === void 0) && _animationDriver_animations[animationProp] ? __spreadValues(__spreadValues({}, animationDriver.animations[animationProp]), animationPropConfig) : null;
19757
19757
  })(), [isShowingInnerSheet, setIsShowingInnerSheet] = React.useState(false), shouldHideParentSheet = modal && isShowingInnerSheet && // if not using weird portal limitation we dont need to hide parent sheet
@@ -19799,7 +19799,7 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
19799
19799
  var toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
19800
19800
  at.current !== toValue && (at.current = toValue, stopSpring(), animatedNumber.setValue(toValue, __spreadValues({
19801
19801
  type: "spring"
19802
- }, animationConfig)));
19802
+ }, transitionConfig)));
19803
19803
  }
19804
19804
  });
19805
19805
  useIsomorphicLayoutEffect(function() {
@@ -19885,10 +19885,10 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
19885
19885
  }, [disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]), handleAnimationViewLayout = React.useCallback(function(e2) {
19886
19886
  var _e_nativeEvent;
19887
19887
  if (!(!open2 && stableFrameSize.current !== 0)) {
19888
- var next = Math.min((_e_nativeEvent = e2.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, Dimensions2.get(relativeDimensionTo).height);
19888
+ var layoutHeight = (_e_nativeEvent = e2.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, next = modal ? Math.min(layoutHeight, Dimensions2.get(relativeDimensionTo).height) : layoutHeight;
19889
19889
  next && setFrameSize(next);
19890
19890
  }
19891
- }, [open2]), handleMaxContentViewLayout = React.useCallback(function(e2) {
19891
+ }, [open2, modal]), handleMaxContentViewLayout = React.useCallback(function(e2) {
19892
19892
  var _e_nativeEvent, next = Math.min((_e_nativeEvent = e2.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, Dimensions2.get(relativeDimensionTo).height);
19893
19893
  next && setMaxContentSize(next);
19894
19894
  }, []), animatedStyle = useAnimatedNumberStyle(animatedNumber, function(val) {
@@ -19929,7 +19929,10 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
19929
19929
  };
19930
19930
  }
19931
19931
  }, [open2]);
19932
- var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${"%"}` : maxSnapPoint, setHasScrollView = React.useCallback(function(val) {
19932
+ var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? (
19933
+ // Use dvh for modal (viewport-relative), % for inline (container-relative)
19934
+ `${maxSnapPoint}${"%"}`
19935
+ ) : maxSnapPoint, setHasScrollView = React.useCallback(function(val) {
19933
19936
  hasScrollView.current = val;
19934
19937
  }, []), contents = /* @__PURE__ */ jsxRuntimeExports.jsx(LayoutMeasurementController, {
19935
19938
  disable: !open2,
package/dist/test.cjs CHANGED
@@ -11293,14 +11293,14 @@ function createComponent(staticConfig) {
11293
11293
  var {
11294
11294
  context: context2,
11295
11295
  isReactNative
11296
- } = staticConfig, debugProp = propsIn.debug, styledContextValue = context2 ? React.useContext(context2) : void 0, overriddenContextProps = null;
11296
+ } = staticConfig, debugProp = propsIn.debug, styledContextValue = context2 ? React.useContext(context2) : void 0, overriddenContextProps = null, componentContext = React.useContext(ComponentContext);
11297
11297
  var props = propsIn;
11298
11298
  if (styledContextValue || defaultProps2) {
11299
- var [nextProps, overrides] = mergeComponentProps(defaultProps2, styledContextValue, propsIn);
11299
+ var effectiveDefaults = defaultProps2, [nextProps, overrides] = mergeComponentProps(effectiveDefaults, styledContextValue, propsIn);
11300
11300
  nextProps && (props = nextProps), overriddenContextProps = overrides;
11301
11301
  }
11302
11302
  var componentName2 = props.componentName || staticConfig.componentName;
11303
- var componentContext = React.useContext(ComponentContext), groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
11303
+ var groupContextParent = React.useContext(GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = useComponentState(props, (animationDriver == null ? void 0 : animationDriver.isStub) ? null : animationDriver, staticConfig), {
11304
11304
  disabled,
11305
11305
  groupName,
11306
11306
  hasAnimationProp,
@@ -14164,7 +14164,7 @@ function PortalHostNonNative(props) {
14164
14164
  deregisterHost: deregisterHost2
14165
14165
  } = usePortal(props.name);
14166
14166
  return useIsomorphicLayoutEffect(function() {
14167
- if (!(typeof window > "u")) return registerHost2(), function() {
14167
+ return registerHost2(), function() {
14168
14168
  deregisterHost2();
14169
14169
  };
14170
14170
  }, []), render(forwardProps ? state.map(function(item) {
@@ -19913,7 +19913,7 @@ function resisted(y, minY) {
19913
19913
  var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCustom = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
19914
19914
  var parentSheet = React.useContext(ParentSheetContext), {
19915
19915
  transition,
19916
- animationConfig: animationConfigProp,
19916
+ transitionConfig: transitionConfigProp,
19917
19917
  modal = false,
19918
19918
  zIndex = parentSheet.zIndex + 1,
19919
19919
  moveOnKeyboardChange = false,
@@ -19942,9 +19942,9 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
19942
19942
  animationDriver
19943
19943
  } = useConfiguration();
19944
19944
  if (!animationDriver) throw new Error("Sheet reqiures an animation driver to be set");
19945
- var animationConfig = (function() {
19945
+ var transitionConfig = (function() {
19946
19946
  var _animationDriver_animations;
19947
- if (animationConfigProp) return animationConfigProp;
19947
+ if (transitionConfigProp) return transitionConfigProp;
19948
19948
  var [animationProp, animationPropConfig] = transition ? Array.isArray(transition) ? transition : [transition] : [];
19949
19949
  return animationProp && !((_animationDriver_animations = animationDriver.animations) === null || _animationDriver_animations === void 0) && _animationDriver_animations[animationProp] ? __spreadValues(__spreadValues({}, animationDriver.animations[animationProp]), animationPropConfig) : null;
19950
19950
  })(), [isShowingInnerSheet, setIsShowingInnerSheet] = React.useState(false), shouldHideParentSheet = modal && isShowingInnerSheet && // if not using weird portal limitation we dont need to hide parent sheet
@@ -19992,7 +19992,7 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
19992
19992
  var toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
19993
19993
  at.current !== toValue && (at.current = toValue, stopSpring(), animatedNumber.setValue(toValue, __spreadValues({
19994
19994
  type: "spring"
19995
- }, animationConfig)));
19995
+ }, transitionConfig)));
19996
19996
  }
19997
19997
  });
19998
19998
  useIsomorphicLayoutEffect(function() {
@@ -20078,10 +20078,10 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
20078
20078
  }, [disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]), handleAnimationViewLayout = React.useCallback(function(e2) {
20079
20079
  var _e_nativeEvent;
20080
20080
  if (!(!open2 && stableFrameSize.current !== 0)) {
20081
- var next = Math.min((_e_nativeEvent = e2.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, Dimensions2.get(relativeDimensionTo).height);
20081
+ var layoutHeight = (_e_nativeEvent = e2.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, next = modal ? Math.min(layoutHeight, Dimensions2.get(relativeDimensionTo).height) : layoutHeight;
20082
20082
  next && setFrameSize(next);
20083
20083
  }
20084
- }, [open2]), handleMaxContentViewLayout = React.useCallback(function(e2) {
20084
+ }, [open2, modal]), handleMaxContentViewLayout = React.useCallback(function(e2) {
20085
20085
  var _e_nativeEvent, next = Math.min((_e_nativeEvent = e2.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, Dimensions2.get(relativeDimensionTo).height);
20086
20086
  next && setMaxContentSize(next);
20087
20087
  }, []), animatedStyle = useAnimatedNumberStyle(animatedNumber, function(val) {
@@ -20122,7 +20122,10 @@ var hiddenSize = 10000.1, relativeDimensionTo = "screen", SheetImplementationCus
20122
20122
  };
20123
20123
  }
20124
20124
  }, [open2]);
20125
- var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${"%"}` : maxSnapPoint, setHasScrollView = React.useCallback(function(val) {
20125
+ var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? (
20126
+ // Use dvh for modal (viewport-relative), % for inline (container-relative)
20127
+ `${maxSnapPoint}${"%"}`
20128
+ ) : maxSnapPoint, setHasScrollView = React.useCallback(function(val) {
20126
20129
  hasScrollView.current = val;
20127
20130
  }, []), contents = /* @__PURE__ */ jsxRuntimeExports.jsx(LayoutMeasurementController, {
20128
20131
  disable: !open2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tamagui",
3
- "version": "2.0.0-1768326993354",
3
+ "version": "2.0.0-1768427228811",
4
4
  "type": "module",
5
5
  "description": "Style and UI for React (web and native) meet an optimizing compiler",
6
6
  "removeSideEffects": true,
@@ -88,64 +88,64 @@
88
88
  }
89
89
  },
90
90
  "dependencies": {
91
- "@tamagui/accordion": "2.0.0-1768326993354",
92
- "@tamagui/adapt": "2.0.0-1768326993354",
93
- "@tamagui/alert-dialog": "2.0.0-1768326993354",
94
- "@tamagui/animate-presence": "2.0.0-1768326993354",
95
- "@tamagui/avatar": "2.0.0-1768326993354",
96
- "@tamagui/button": "2.0.0-1768326993354",
97
- "@tamagui/card": "2.0.0-1768326993354",
98
- "@tamagui/checkbox": "2.0.0-1768326993354",
99
- "@tamagui/compose-refs": "2.0.0-1768326993354",
100
- "@tamagui/constants": "2.0.0-1768326993354",
101
- "@tamagui/core": "2.0.0-1768326993354",
102
- "@tamagui/create-context": "2.0.0-1768326993354",
103
- "@tamagui/dialog": "2.0.0-1768326993354",
104
- "@tamagui/elements": "2.0.0-1768326993354",
105
- "@tamagui/fake-react-native": "2.0.0-1768326993354",
106
- "@tamagui/focusable": "2.0.0-1768326993354",
107
- "@tamagui/font-size": "2.0.0-1768326993354",
108
- "@tamagui/form": "2.0.0-1768326993354",
109
- "@tamagui/get-button-sized": "2.0.0-1768326993354",
110
- "@tamagui/get-font-sized": "2.0.0-1768326993354",
111
- "@tamagui/get-token": "2.0.0-1768326993354",
112
- "@tamagui/group": "2.0.0-1768326993354",
113
- "@tamagui/helpers-tamagui": "2.0.0-1768326993354",
114
- "@tamagui/image": "2.0.0-1768326993354",
115
- "@tamagui/input": "2.0.0-1768326993354",
116
- "@tamagui/label": "2.0.0-1768326993354",
117
- "@tamagui/linear-gradient": "2.0.0-1768326993354",
118
- "@tamagui/list-item": "2.0.0-1768326993354",
119
- "@tamagui/polyfill-dev": "2.0.0-1768326993354",
120
- "@tamagui/popover": "2.0.0-1768326993354",
121
- "@tamagui/popper": "2.0.0-1768326993354",
122
- "@tamagui/portal": "2.0.0-1768326993354",
123
- "@tamagui/progress": "2.0.0-1768326993354",
124
- "@tamagui/radio-group": "2.0.0-1768326993354",
125
- "@tamagui/react-native-media-driver": "2.0.0-1768326993354",
126
- "@tamagui/scroll-view": "2.0.0-1768326993354",
127
- "@tamagui/select": "2.0.0-1768326993354",
128
- "@tamagui/separator": "2.0.0-1768326993354",
129
- "@tamagui/shapes": "2.0.0-1768326993354",
130
- "@tamagui/sheet": "2.0.0-1768326993354",
131
- "@tamagui/slider": "2.0.0-1768326993354",
132
- "@tamagui/spacer": "2.0.0-1768326993354",
133
- "@tamagui/stacks": "2.0.0-1768326993354",
134
- "@tamagui/switch": "2.0.0-1768326993354",
135
- "@tamagui/tabs": "2.0.0-1768326993354",
136
- "@tamagui/text": "2.0.0-1768326993354",
137
- "@tamagui/theme": "2.0.0-1768326993354",
138
- "@tamagui/toggle-group": "2.0.0-1768326993354",
139
- "@tamagui/tooltip": "2.0.0-1768326993354",
140
- "@tamagui/use-controllable-state": "2.0.0-1768326993354",
141
- "@tamagui/use-debounce": "2.0.0-1768326993354",
142
- "@tamagui/use-force-update": "2.0.0-1768326993354",
143
- "@tamagui/use-window-dimensions": "2.0.0-1768326993354",
144
- "@tamagui/visually-hidden": "2.0.0-1768326993354",
145
- "@tamagui/z-index-stack": "2.0.0-1768326993354"
91
+ "@tamagui/accordion": "2.0.0-1768427228811",
92
+ "@tamagui/adapt": "2.0.0-1768427228811",
93
+ "@tamagui/alert-dialog": "2.0.0-1768427228811",
94
+ "@tamagui/animate-presence": "2.0.0-1768427228811",
95
+ "@tamagui/avatar": "2.0.0-1768427228811",
96
+ "@tamagui/button": "2.0.0-1768427228811",
97
+ "@tamagui/card": "2.0.0-1768427228811",
98
+ "@tamagui/checkbox": "2.0.0-1768427228811",
99
+ "@tamagui/compose-refs": "2.0.0-1768427228811",
100
+ "@tamagui/constants": "2.0.0-1768427228811",
101
+ "@tamagui/core": "2.0.0-1768427228811",
102
+ "@tamagui/create-context": "2.0.0-1768427228811",
103
+ "@tamagui/dialog": "2.0.0-1768427228811",
104
+ "@tamagui/elements": "2.0.0-1768427228811",
105
+ "@tamagui/fake-react-native": "2.0.0-1768427228811",
106
+ "@tamagui/focusable": "2.0.0-1768427228811",
107
+ "@tamagui/font-size": "2.0.0-1768427228811",
108
+ "@tamagui/form": "2.0.0-1768427228811",
109
+ "@tamagui/get-button-sized": "2.0.0-1768427228811",
110
+ "@tamagui/get-font-sized": "2.0.0-1768427228811",
111
+ "@tamagui/get-token": "2.0.0-1768427228811",
112
+ "@tamagui/group": "2.0.0-1768427228811",
113
+ "@tamagui/helpers-tamagui": "2.0.0-1768427228811",
114
+ "@tamagui/image": "2.0.0-1768427228811",
115
+ "@tamagui/input": "2.0.0-1768427228811",
116
+ "@tamagui/label": "2.0.0-1768427228811",
117
+ "@tamagui/linear-gradient": "2.0.0-1768427228811",
118
+ "@tamagui/list-item": "2.0.0-1768427228811",
119
+ "@tamagui/polyfill-dev": "2.0.0-1768427228811",
120
+ "@tamagui/popover": "2.0.0-1768427228811",
121
+ "@tamagui/popper": "2.0.0-1768427228811",
122
+ "@tamagui/portal": "2.0.0-1768427228811",
123
+ "@tamagui/progress": "2.0.0-1768427228811",
124
+ "@tamagui/radio-group": "2.0.0-1768427228811",
125
+ "@tamagui/react-native-media-driver": "2.0.0-1768427228811",
126
+ "@tamagui/scroll-view": "2.0.0-1768427228811",
127
+ "@tamagui/select": "2.0.0-1768427228811",
128
+ "@tamagui/separator": "2.0.0-1768427228811",
129
+ "@tamagui/shapes": "2.0.0-1768427228811",
130
+ "@tamagui/sheet": "2.0.0-1768427228811",
131
+ "@tamagui/slider": "2.0.0-1768427228811",
132
+ "@tamagui/spacer": "2.0.0-1768427228811",
133
+ "@tamagui/stacks": "2.0.0-1768427228811",
134
+ "@tamagui/switch": "2.0.0-1768427228811",
135
+ "@tamagui/tabs": "2.0.0-1768427228811",
136
+ "@tamagui/text": "2.0.0-1768427228811",
137
+ "@tamagui/theme": "2.0.0-1768427228811",
138
+ "@tamagui/toggle-group": "2.0.0-1768427228811",
139
+ "@tamagui/tooltip": "2.0.0-1768427228811",
140
+ "@tamagui/use-controllable-state": "2.0.0-1768427228811",
141
+ "@tamagui/use-debounce": "2.0.0-1768427228811",
142
+ "@tamagui/use-force-update": "2.0.0-1768427228811",
143
+ "@tamagui/use-window-dimensions": "2.0.0-1768427228811",
144
+ "@tamagui/visually-hidden": "2.0.0-1768427228811",
145
+ "@tamagui/z-index-stack": "2.0.0-1768427228811"
146
146
  },
147
147
  "devDependencies": {
148
- "@tamagui/build": "2.0.0-1768326993354",
148
+ "@tamagui/build": "2.0.0-1768427228811",
149
149
  "react": "*",
150
150
  "react-native": "0.81.5",
151
151
  "react-native-web": "^0.21.0"