tamagui 2.5.0 → 2.5.1
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/.turbo/turbo-build.log +2 -2
- package/dist/native.cjs +102 -25
- package/dist/test.cjs +102 -25
- package/package.json +65 -65
package/.turbo/turbo-build.log
CHANGED
package/dist/native.cjs
CHANGED
|
@@ -15780,9 +15780,13 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15780
15780
|
}
|
|
15781
15781
|
}
|
|
15782
15782
|
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
15783
|
-
var _driver_animations;
|
|
15784
15783
|
if (keyInit === "group");
|
|
15785
|
-
if (keyInit === "transition" && typeof valInit === "string"
|
|
15784
|
+
if (keyInit === "transition" && typeof valInit === "string") {
|
|
15785
|
+
var _driver_animations;
|
|
15786
|
+
var animationConfig = driver === null || driver === void 0 ? void 0 : (_driver_animations = driver.animations) === null || _driver_animations === void 0 ? void 0 : _driver_animations[valInit];
|
|
15787
|
+
if (animationConfig && (driver === null || driver === void 0 ? void 0 : driver.outputStyle) === "css" && process.env.IS_STATIC === "is_static") valInit = `all ${animationConfig}`;
|
|
15788
|
+
else if (animationConfig) return "continue";
|
|
15789
|
+
} else return "continue";
|
|
15786
15790
|
}
|
|
15787
15791
|
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles$1, accept);
|
|
15788
15792
|
if (!isValidStyleKeyInit) {
|
|
@@ -17171,7 +17175,7 @@ function createComponent(staticConfig) {
|
|
|
17171
17175
|
setMediaShouldUpdate(componentContext, didGetVariableValue() || hasRuntimeMediaKeys || noClass && (splitStyles === null || splitStyles === void 0 ? void 0 : splitStyles.hasMedia) === true, hasRuntimeMediaKeys ? splitStyles.hasMedia : null);
|
|
17172
17176
|
var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, pseudoGroups, mediaGroups } = splitStyles || {};
|
|
17173
17177
|
var propsWithAnimation = props;
|
|
17174
|
-
var _ref5 = viewPropsIn || {}, { asChild, children, themeShallow, spaceDirection: _spaceDirection, onPress, onLongPress, onPressIn, onPressOut, onHoverIn, onHoverOut, onMouseUp, onMouseDown, onMouseEnter, onMouseLeave, onFocus, onBlur, separator, passThrough, forceStyle: _forceStyle, onClick, theme: _themeProp } = _ref5, nonTamaguiProps = _objectWithoutProperties(_ref5, _excluded2$29);
|
|
17178
|
+
var _ref5 = viewPropsIn || {}, { asChild, children, themeShallow, spaceDirection: _spaceDirection, onPress, onLongPress, onPressIn, onPressOut, onHoverIn, onHoverOut, onMouseUp, onMouseDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onDidAnimate, separator, passThrough, forceStyle: _forceStyle, onClick, theme: _themeProp } = _ref5, nonTamaguiProps = _objectWithoutProperties(_ref5, _excluded2$29);
|
|
17175
17179
|
var viewProps = nonTamaguiProps;
|
|
17176
17180
|
if (props.forceStyle) viewProps.forceStyle = props.forceStyle;
|
|
17177
17181
|
if (isHOC) {
|
|
@@ -17201,7 +17205,8 @@ function createComponent(staticConfig) {
|
|
|
17201
17205
|
themeName,
|
|
17202
17206
|
pseudos: pseudos || null,
|
|
17203
17207
|
staticConfig,
|
|
17204
|
-
stateRef
|
|
17208
|
+
stateRef,
|
|
17209
|
+
onDidAnimate
|
|
17205
17210
|
});
|
|
17206
17211
|
if (animations) {
|
|
17207
17212
|
if (animations.ref) animatedRef = animations.ref;
|
|
@@ -17532,6 +17537,7 @@ var init_createComponent_native = __esmMin((() => {
|
|
|
17532
17537
|
"onMouseLeave",
|
|
17533
17538
|
"onFocus",
|
|
17534
17539
|
"onBlur",
|
|
17540
|
+
"onDidAnimate",
|
|
17535
17541
|
"separator",
|
|
17536
17542
|
"passThrough",
|
|
17537
17543
|
"forceStyle",
|
|
@@ -20312,7 +20318,7 @@ var _excluded$48 = ["type"], _excluded2$26 = [
|
|
|
20312
20318
|
"disabled",
|
|
20313
20319
|
"dir",
|
|
20314
20320
|
"orientation"
|
|
20315
|
-
], _excluded5$12 = ["__scopeAccordion", "value"], _excluded6$8 = ["__scopeAccordion"], _excluded7$5 = ["__scopeAccordion"], _excluded8$5 = ["__scopeAccordion"], _excluded9$5 = ["children"];
|
|
20321
|
+
], _excluded5$12 = ["__scopeAccordion", "value"], _excluded6$8 = ["__scopeAccordion"], _excluded7$5 = ["__scopeAccordion"], _excluded8$5 = ["__scopeAccordion", "forceMount"], _excluded9$5 = ["children", "transition"];
|
|
20316
20322
|
var ACCORDION_NAME = "Accordion";
|
|
20317
20323
|
var ACCORDION_KEYS = [
|
|
20318
20324
|
"Home",
|
|
@@ -20539,38 +20545,109 @@ var AccordionContentFrame = styledExport(Collapsible.Content, {
|
|
|
20539
20545
|
} } },
|
|
20540
20546
|
defaultVariants: { unstyled: process.env.TAMAGUI_HEADLESS === "1" }
|
|
20541
20547
|
});
|
|
20548
|
+
var AccordionHeightAnimatorContext = /* @__PURE__ */ react$1.createContext(false);
|
|
20542
20549
|
var AccordionContent = AccordionContentFrame.styleable(function AccordionContent2(props, forwardedRef) {
|
|
20543
|
-
var { __scopeAccordion } = props, contentProps = _objectWithoutProperties(props, _excluded8$5);
|
|
20550
|
+
var { __scopeAccordion, forceMount } = props, contentProps = _objectWithoutProperties(props, _excluded8$5);
|
|
20544
20551
|
var accordionContext = useAccordionContext(__scopeAccordion);
|
|
20552
|
+
var itemContext = useAccordionItemContext(__scopeAccordion);
|
|
20553
|
+
var heightAnimatorPresent = react$1.useContext(AccordionHeightAnimatorContext);
|
|
20545
20554
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccordionContentFrame, _objectSpread2(_objectSpread2({
|
|
20546
20555
|
role: "region",
|
|
20547
|
-
"aria-labelledby":
|
|
20556
|
+
"aria-labelledby": itemContext.triggerId,
|
|
20548
20557
|
"data-orientation": accordionContext.orientation,
|
|
20549
20558
|
__scopeCollapsible: __scopeAccordion || ACCORDION_CONTEXT
|
|
20550
|
-
}, contentProps), {}, {
|
|
20559
|
+
}, contentProps), {}, {
|
|
20560
|
+
forceMount: forceMount || heightAnimatorPresent,
|
|
20561
|
+
ref: forwardedRef
|
|
20562
|
+
}));
|
|
20551
20563
|
});
|
|
20552
20564
|
var HeightAnimator = View.styleable(function(props, ref) {
|
|
20553
20565
|
var itemContext = useAccordionItemContext();
|
|
20554
|
-
var { children } = props, rest = _objectWithoutProperties(props, _excluded9$5);
|
|
20555
|
-
var
|
|
20556
|
-
var
|
|
20557
|
-
var
|
|
20558
|
-
var
|
|
20566
|
+
var { children, transition } = props, rest = _objectWithoutProperties(props, _excluded9$5);
|
|
20567
|
+
var open = !!itemContext.open;
|
|
20568
|
+
var [fixed, setFixed] = react$1.useState(!open);
|
|
20569
|
+
var [pinned, setPinned] = react$1.useState(false);
|
|
20570
|
+
var [contentPresent, setContentPresent] = react$1.useState(open);
|
|
20571
|
+
var [contentHeight, setContentHeight] = react$1.useState(0);
|
|
20572
|
+
var outerRef = react$1.useRef(null);
|
|
20573
|
+
var innerRef = react$1.useRef(null);
|
|
20574
|
+
var composedRef = useComposedRefs(outerRef, ref);
|
|
20575
|
+
var lastOuterHeightRef = react$1.useRef(0);
|
|
20576
|
+
var pinnedHeightRef = react$1.useRef(0);
|
|
20577
|
+
var settleTimerRef = react$1.useRef(void 0);
|
|
20578
|
+
var prevOpenRef = react$1.useRef(open);
|
|
20579
|
+
if (prevOpenRef.current !== open) {
|
|
20580
|
+
prevOpenRef.current = open;
|
|
20581
|
+
clearTimeout(settleTimerRef.current);
|
|
20582
|
+
if (open) setContentPresent(true);
|
|
20583
|
+
else if (lastOuterHeightRef.current < 1) setContentPresent(false);
|
|
20584
|
+
if (!fixed) {
|
|
20585
|
+
pinnedHeightRef.current = lastOuterHeightRef.current;
|
|
20586
|
+
setFixed(true);
|
|
20587
|
+
setPinned(true);
|
|
20588
|
+
}
|
|
20589
|
+
}
|
|
20590
|
+
useIsomorphicLayoutEffect(function() {
|
|
20591
|
+
if (!pinned) return;
|
|
20592
|
+
var frame = requestAnimationFrame(function() {
|
|
20593
|
+
return setPinned(false);
|
|
20594
|
+
});
|
|
20595
|
+
return function() {
|
|
20596
|
+
return cancelAnimationFrame(frame);
|
|
20597
|
+
};
|
|
20598
|
+
}, [pinned]);
|
|
20599
|
+
react$1.useEffect(function() {
|
|
20600
|
+
return function() {
|
|
20601
|
+
return clearTimeout(settleTimerRef.current);
|
|
20602
|
+
};
|
|
20603
|
+
}, []);
|
|
20604
|
+
useIsomorphicLayoutEffect(function() {
|
|
20605
|
+
var _el_getBoundingClientRect;
|
|
20606
|
+
if (!fixed || !open) return;
|
|
20607
|
+
var el = innerRef.current;
|
|
20608
|
+
var naturalHeight = el === null || el === void 0 ? void 0 : (_el_getBoundingClientRect = el.getBoundingClientRect) === null || _el_getBoundingClientRect === void 0 ? void 0 : _el_getBoundingClientRect.call(el).height;
|
|
20609
|
+
if (naturalHeight && naturalHeight > 0 && naturalHeight !== contentHeight) setContentHeight(naturalHeight);
|
|
20610
|
+
});
|
|
20611
|
+
var minHeight = pinned ? pinnedHeightRef.current : open ? contentHeight : 0;
|
|
20559
20612
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(View, _objectSpread2(_objectSpread2({
|
|
20560
|
-
ref,
|
|
20561
|
-
height,
|
|
20613
|
+
ref: composedRef,
|
|
20562
20614
|
position: "relative"
|
|
20563
|
-
}, rest), {}, {
|
|
20564
|
-
|
|
20565
|
-
|
|
20566
|
-
|
|
20567
|
-
|
|
20615
|
+
}, rest), {}, {
|
|
20616
|
+
transition: fixed ? transition : void 0,
|
|
20617
|
+
height: "auto",
|
|
20618
|
+
minHeight,
|
|
20619
|
+
overflow: "hidden",
|
|
20568
20620
|
onLayout: function(param) {
|
|
20569
20621
|
var { nativeEvent } = param;
|
|
20570
|
-
|
|
20622
|
+
var outerHeight = nativeEvent.layout.height;
|
|
20623
|
+
lastOuterHeightRef.current = outerHeight;
|
|
20624
|
+
clearTimeout(settleTimerRef.current);
|
|
20625
|
+
if (fixed && !pinned && open && contentHeight > 0) {
|
|
20626
|
+
if (Math.abs(outerHeight - contentHeight) < 1) settleTimerRef.current = setTimeout(function() {
|
|
20627
|
+
return setFixed(false);
|
|
20628
|
+
}, 100);
|
|
20629
|
+
}
|
|
20571
20630
|
},
|
|
20572
|
-
|
|
20573
|
-
|
|
20631
|
+
onDidAnimate: function() {
|
|
20632
|
+
if (!prevOpenRef.current && !pinned) setContentPresent(false);
|
|
20633
|
+
},
|
|
20634
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(View, {
|
|
20635
|
+
ref: innerRef,
|
|
20636
|
+
position: fixed ? "absolute" : "relative",
|
|
20637
|
+
top: fixed ? 0 : void 0,
|
|
20638
|
+
left: fixed ? 0 : void 0,
|
|
20639
|
+
right: fixed ? 0 : void 0,
|
|
20640
|
+
onLayout: function(param) {
|
|
20641
|
+
var { nativeEvent } = param;
|
|
20642
|
+
var naturalHeight = nativeEvent.layout.height;
|
|
20643
|
+
if (open && naturalHeight !== contentHeight) setContentHeight(naturalHeight);
|
|
20644
|
+
},
|
|
20645
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccordionHeightAnimatorContext.Provider, {
|
|
20646
|
+
value: contentPresent,
|
|
20647
|
+
children
|
|
20648
|
+
})
|
|
20649
|
+
})
|
|
20650
|
+
}));
|
|
20574
20651
|
});
|
|
20575
20652
|
function getState$4(open) {
|
|
20576
20653
|
return open ? "open" : "closed";
|
|
@@ -32319,10 +32396,10 @@ var Toggle = /* @__PURE__ */ react$1.forwardRef(function Toggle2(props, forwarde
|
|
|
32319
32396
|
"data-state": active ? "on" : "off",
|
|
32320
32397
|
"data-disabled": props.disabled ? "" : void 0,
|
|
32321
32398
|
unstyled
|
|
32322
|
-
}, active && !activeStyle && !unstyled && { defaultActiveStyle: true }), active && activeStyle && _objectSpread2(_objectSpread2({}, activeStyle), {}, {
|
|
32399
|
+
}, active && !activeStyle && !unstyled && { defaultActiveStyle: true }), buttonProps), active && activeStyle && _objectSpread2(_objectSpread2({}, activeStyle), {}, {
|
|
32323
32400
|
hoverStyle: activeStyle,
|
|
32324
32401
|
focusStyle: activeStyle
|
|
32325
|
-
})),
|
|
32402
|
+
})), {}, {
|
|
32326
32403
|
ref: forwardedRef,
|
|
32327
32404
|
onPress: composeEventHandlers((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {
|
|
32328
32405
|
if (!props.disabled) setActive(function(prev) {
|
package/dist/test.cjs
CHANGED
|
@@ -15960,9 +15960,13 @@ var init_getSplitStyles_native = __esmMin((() => {
|
|
|
15960
15960
|
}
|
|
15961
15961
|
}
|
|
15962
15962
|
if (keyInit in skipProps && !noSkip && !isHOC) {
|
|
15963
|
-
var _driver_animations;
|
|
15964
15963
|
if (keyInit === "group");
|
|
15965
|
-
if (keyInit === "transition" && typeof valInit === "string"
|
|
15964
|
+
if (keyInit === "transition" && typeof valInit === "string") {
|
|
15965
|
+
var _driver_animations;
|
|
15966
|
+
var animationConfig = driver === null || driver === void 0 ? void 0 : (_driver_animations = driver.animations) === null || _driver_animations === void 0 ? void 0 : _driver_animations[valInit];
|
|
15967
|
+
if (animationConfig && (driver === null || driver === void 0 ? void 0 : driver.outputStyle) === "css" && process.env.IS_STATIC === "is_static") valInit = `all ${animationConfig}`;
|
|
15968
|
+
else if (animationConfig) return "continue";
|
|
15969
|
+
} else return "continue";
|
|
15966
15970
|
}
|
|
15967
15971
|
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles$1, accept);
|
|
15968
15972
|
if (!isValidStyleKeyInit) {
|
|
@@ -17357,7 +17361,7 @@ function createComponent(staticConfig) {
|
|
|
17357
17361
|
setMediaShouldUpdate(componentContext, didGetVariableValue() || hasRuntimeMediaKeys || noClass && (splitStyles === null || splitStyles === void 0 ? void 0 : splitStyles.hasMedia) === true, hasRuntimeMediaKeys ? splitStyles.hasMedia : null);
|
|
17358
17362
|
var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, pseudoGroups, mediaGroups } = splitStyles || {};
|
|
17359
17363
|
var propsWithAnimation = props;
|
|
17360
|
-
var _ref5 = viewPropsIn || {}, { asChild, children, themeShallow, spaceDirection: _spaceDirection, onPress, onLongPress, onPressIn, onPressOut, onHoverIn, onHoverOut, onMouseUp, onMouseDown, onMouseEnter, onMouseLeave, onFocus, onBlur, separator, passThrough, forceStyle: _forceStyle, onClick, theme: _themeProp } = _ref5, nonTamaguiProps = _objectWithoutProperties(_ref5, _excluded2$29);
|
|
17364
|
+
var _ref5 = viewPropsIn || {}, { asChild, children, themeShallow, spaceDirection: _spaceDirection, onPress, onLongPress, onPressIn, onPressOut, onHoverIn, onHoverOut, onMouseUp, onMouseDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onDidAnimate, separator, passThrough, forceStyle: _forceStyle, onClick, theme: _themeProp } = _ref5, nonTamaguiProps = _objectWithoutProperties(_ref5, _excluded2$29);
|
|
17361
17365
|
var viewProps = nonTamaguiProps;
|
|
17362
17366
|
if (props.forceStyle) viewProps.forceStyle = props.forceStyle;
|
|
17363
17367
|
if (isHOC) {
|
|
@@ -17387,7 +17391,8 @@ function createComponent(staticConfig) {
|
|
|
17387
17391
|
themeName,
|
|
17388
17392
|
pseudos: pseudos || null,
|
|
17389
17393
|
staticConfig,
|
|
17390
|
-
stateRef
|
|
17394
|
+
stateRef,
|
|
17395
|
+
onDidAnimate
|
|
17391
17396
|
});
|
|
17392
17397
|
if (animations) {
|
|
17393
17398
|
if (animations.ref) animatedRef = animations.ref;
|
|
@@ -17718,6 +17723,7 @@ var init_createComponent_native = __esmMin((() => {
|
|
|
17718
17723
|
"onMouseLeave",
|
|
17719
17724
|
"onFocus",
|
|
17720
17725
|
"onBlur",
|
|
17726
|
+
"onDidAnimate",
|
|
17721
17727
|
"separator",
|
|
17722
17728
|
"passThrough",
|
|
17723
17729
|
"forceStyle",
|
|
@@ -20379,7 +20385,7 @@ var _excluded$48 = ["type"], _excluded2$26 = [
|
|
|
20379
20385
|
"disabled",
|
|
20380
20386
|
"dir",
|
|
20381
20387
|
"orientation"
|
|
20382
|
-
], _excluded5$12 = ["__scopeAccordion", "value"], _excluded6$8 = ["__scopeAccordion"], _excluded7$5 = ["__scopeAccordion"], _excluded8$5 = ["__scopeAccordion"], _excluded9$5 = ["children"];
|
|
20388
|
+
], _excluded5$12 = ["__scopeAccordion", "value"], _excluded6$8 = ["__scopeAccordion"], _excluded7$5 = ["__scopeAccordion"], _excluded8$5 = ["__scopeAccordion", "forceMount"], _excluded9$5 = ["children", "transition"];
|
|
20383
20389
|
var ACCORDION_NAME = "Accordion";
|
|
20384
20390
|
var ACCORDION_KEYS = [
|
|
20385
20391
|
"Home",
|
|
@@ -20606,38 +20612,109 @@ var AccordionContentFrame = styledExport(Collapsible.Content, {
|
|
|
20606
20612
|
} } },
|
|
20607
20613
|
defaultVariants: { unstyled: process.env.TAMAGUI_HEADLESS === "1" }
|
|
20608
20614
|
});
|
|
20615
|
+
var AccordionHeightAnimatorContext = /* @__PURE__ */ react$1.createContext(false);
|
|
20609
20616
|
var AccordionContent = AccordionContentFrame.styleable(function AccordionContent2(props, forwardedRef) {
|
|
20610
|
-
var { __scopeAccordion } = props, contentProps = _objectWithoutProperties(props, _excluded8$5);
|
|
20617
|
+
var { __scopeAccordion, forceMount } = props, contentProps = _objectWithoutProperties(props, _excluded8$5);
|
|
20611
20618
|
var accordionContext = useAccordionContext(__scopeAccordion);
|
|
20619
|
+
var itemContext = useAccordionItemContext(__scopeAccordion);
|
|
20620
|
+
var heightAnimatorPresent = react$1.useContext(AccordionHeightAnimatorContext);
|
|
20612
20621
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccordionContentFrame, _objectSpread2(_objectSpread2({
|
|
20613
20622
|
role: "region",
|
|
20614
|
-
"aria-labelledby":
|
|
20623
|
+
"aria-labelledby": itemContext.triggerId,
|
|
20615
20624
|
"data-orientation": accordionContext.orientation,
|
|
20616
20625
|
__scopeCollapsible: __scopeAccordion || ACCORDION_CONTEXT
|
|
20617
|
-
}, contentProps), {}, {
|
|
20626
|
+
}, contentProps), {}, {
|
|
20627
|
+
forceMount: forceMount || heightAnimatorPresent,
|
|
20628
|
+
ref: forwardedRef
|
|
20629
|
+
}));
|
|
20618
20630
|
});
|
|
20619
20631
|
var HeightAnimator = View.styleable(function(props, ref) {
|
|
20620
20632
|
var itemContext = useAccordionItemContext();
|
|
20621
|
-
var { children } = props, rest = _objectWithoutProperties(props, _excluded9$5);
|
|
20622
|
-
var
|
|
20623
|
-
var
|
|
20624
|
-
var
|
|
20625
|
-
var
|
|
20633
|
+
var { children, transition } = props, rest = _objectWithoutProperties(props, _excluded9$5);
|
|
20634
|
+
var open = !!itemContext.open;
|
|
20635
|
+
var [fixed, setFixed] = react$1.useState(!open);
|
|
20636
|
+
var [pinned, setPinned] = react$1.useState(false);
|
|
20637
|
+
var [contentPresent, setContentPresent] = react$1.useState(open);
|
|
20638
|
+
var [contentHeight, setContentHeight] = react$1.useState(0);
|
|
20639
|
+
var outerRef = react$1.useRef(null);
|
|
20640
|
+
var innerRef = react$1.useRef(null);
|
|
20641
|
+
var composedRef = useComposedRefs(outerRef, ref);
|
|
20642
|
+
var lastOuterHeightRef = react$1.useRef(0);
|
|
20643
|
+
var pinnedHeightRef = react$1.useRef(0);
|
|
20644
|
+
var settleTimerRef = react$1.useRef(void 0);
|
|
20645
|
+
var prevOpenRef = react$1.useRef(open);
|
|
20646
|
+
if (prevOpenRef.current !== open) {
|
|
20647
|
+
prevOpenRef.current = open;
|
|
20648
|
+
clearTimeout(settleTimerRef.current);
|
|
20649
|
+
if (open) setContentPresent(true);
|
|
20650
|
+
else if (lastOuterHeightRef.current < 1) setContentPresent(false);
|
|
20651
|
+
if (!fixed) {
|
|
20652
|
+
pinnedHeightRef.current = lastOuterHeightRef.current;
|
|
20653
|
+
setFixed(true);
|
|
20654
|
+
setPinned(true);
|
|
20655
|
+
}
|
|
20656
|
+
}
|
|
20657
|
+
useIsomorphicLayoutEffect(function() {
|
|
20658
|
+
if (!pinned) return;
|
|
20659
|
+
var frame = requestAnimationFrame(function() {
|
|
20660
|
+
return setPinned(false);
|
|
20661
|
+
});
|
|
20662
|
+
return function() {
|
|
20663
|
+
return cancelAnimationFrame(frame);
|
|
20664
|
+
};
|
|
20665
|
+
}, [pinned]);
|
|
20666
|
+
react$1.useEffect(function() {
|
|
20667
|
+
return function() {
|
|
20668
|
+
return clearTimeout(settleTimerRef.current);
|
|
20669
|
+
};
|
|
20670
|
+
}, []);
|
|
20671
|
+
useIsomorphicLayoutEffect(function() {
|
|
20672
|
+
var _el_getBoundingClientRect;
|
|
20673
|
+
if (!fixed || !open) return;
|
|
20674
|
+
var el = innerRef.current;
|
|
20675
|
+
var naturalHeight = el === null || el === void 0 ? void 0 : (_el_getBoundingClientRect = el.getBoundingClientRect) === null || _el_getBoundingClientRect === void 0 ? void 0 : _el_getBoundingClientRect.call(el).height;
|
|
20676
|
+
if (naturalHeight && naturalHeight > 0 && naturalHeight !== contentHeight) setContentHeight(naturalHeight);
|
|
20677
|
+
});
|
|
20678
|
+
var minHeight = pinned ? pinnedHeightRef.current : open ? contentHeight : 0;
|
|
20626
20679
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(View, _objectSpread2(_objectSpread2({
|
|
20627
|
-
ref,
|
|
20628
|
-
height,
|
|
20680
|
+
ref: composedRef,
|
|
20629
20681
|
position: "relative"
|
|
20630
|
-
}, rest), {}, {
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20634
|
-
|
|
20682
|
+
}, rest), {}, {
|
|
20683
|
+
transition: fixed ? transition : void 0,
|
|
20684
|
+
height: "auto",
|
|
20685
|
+
minHeight,
|
|
20686
|
+
overflow: "hidden",
|
|
20635
20687
|
onLayout: function(param) {
|
|
20636
20688
|
var { nativeEvent } = param;
|
|
20637
|
-
|
|
20689
|
+
var outerHeight = nativeEvent.layout.height;
|
|
20690
|
+
lastOuterHeightRef.current = outerHeight;
|
|
20691
|
+
clearTimeout(settleTimerRef.current);
|
|
20692
|
+
if (fixed && !pinned && open && contentHeight > 0) {
|
|
20693
|
+
if (Math.abs(outerHeight - contentHeight) < 1) settleTimerRef.current = setTimeout(function() {
|
|
20694
|
+
return setFixed(false);
|
|
20695
|
+
}, 100);
|
|
20696
|
+
}
|
|
20638
20697
|
},
|
|
20639
|
-
|
|
20640
|
-
|
|
20698
|
+
onDidAnimate: function() {
|
|
20699
|
+
if (!prevOpenRef.current && !pinned) setContentPresent(false);
|
|
20700
|
+
},
|
|
20701
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(View, {
|
|
20702
|
+
ref: innerRef,
|
|
20703
|
+
position: fixed ? "absolute" : "relative",
|
|
20704
|
+
top: fixed ? 0 : void 0,
|
|
20705
|
+
left: fixed ? 0 : void 0,
|
|
20706
|
+
right: fixed ? 0 : void 0,
|
|
20707
|
+
onLayout: function(param) {
|
|
20708
|
+
var { nativeEvent } = param;
|
|
20709
|
+
var naturalHeight = nativeEvent.layout.height;
|
|
20710
|
+
if (open && naturalHeight !== contentHeight) setContentHeight(naturalHeight);
|
|
20711
|
+
},
|
|
20712
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccordionHeightAnimatorContext.Provider, {
|
|
20713
|
+
value: contentPresent,
|
|
20714
|
+
children
|
|
20715
|
+
})
|
|
20716
|
+
})
|
|
20717
|
+
}));
|
|
20641
20718
|
});
|
|
20642
20719
|
function getState$4(open) {
|
|
20643
20720
|
return open ? "open" : "closed";
|
|
@@ -32386,10 +32463,10 @@ var Toggle = /* @__PURE__ */ react$1.forwardRef(function Toggle2(props, forwarde
|
|
|
32386
32463
|
"data-state": active ? "on" : "off",
|
|
32387
32464
|
"data-disabled": props.disabled ? "" : void 0,
|
|
32388
32465
|
unstyled
|
|
32389
|
-
}, active && !activeStyle && !unstyled && { defaultActiveStyle: true }), active && activeStyle && _objectSpread2(_objectSpread2({}, activeStyle), {}, {
|
|
32466
|
+
}, active && !activeStyle && !unstyled && { defaultActiveStyle: true }), buttonProps), active && activeStyle && _objectSpread2(_objectSpread2({}, activeStyle), {}, {
|
|
32390
32467
|
hoverStyle: activeStyle,
|
|
32391
32468
|
focusStyle: activeStyle
|
|
32392
|
-
})),
|
|
32469
|
+
})), {}, {
|
|
32393
32470
|
ref: forwardedRef,
|
|
32394
32471
|
onPress: composeEventHandlers((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function() {
|
|
32395
32472
|
if (!props.disabled) setActive(function(prev) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"description": "Style and UI for React (web and native) meet an optimizing compiler",
|
|
6
6
|
"repository": {
|
|
@@ -77,72 +77,72 @@
|
|
|
77
77
|
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@tamagui/accordion": "2.5.
|
|
81
|
-
"@tamagui/adapt": "2.5.
|
|
82
|
-
"@tamagui/alert-dialog": "2.5.
|
|
83
|
-
"@tamagui/animate": "2.5.
|
|
84
|
-
"@tamagui/animate-presence": "2.5.
|
|
85
|
-
"@tamagui/avatar": "2.5.
|
|
86
|
-
"@tamagui/button": "2.5.
|
|
87
|
-
"@tamagui/card": "2.5.
|
|
88
|
-
"@tamagui/checkbox": "2.5.
|
|
89
|
-
"@tamagui/collapsible": "2.5.
|
|
90
|
-
"@tamagui/compose-refs": "2.5.
|
|
91
|
-
"@tamagui/constants": "2.5.
|
|
92
|
-
"@tamagui/context-menu": "2.5.
|
|
93
|
-
"@tamagui/core": "2.5.
|
|
94
|
-
"@tamagui/create-context": "2.5.
|
|
95
|
-
"@tamagui/create-menu": "2.5.
|
|
96
|
-
"@tamagui/dialog": "2.5.
|
|
97
|
-
"@tamagui/element": "2.5.
|
|
98
|
-
"@tamagui/elements": "2.5.
|
|
99
|
-
"@tamagui/fake-react-native": "2.5.
|
|
100
|
-
"@tamagui/focusable": "2.5.
|
|
101
|
-
"@tamagui/form": "2.5.
|
|
102
|
-
"@tamagui/get-button-sized": "2.5.
|
|
103
|
-
"@tamagui/get-font-sized": "2.5.
|
|
104
|
-
"@tamagui/get-token": "2.5.
|
|
105
|
-
"@tamagui/group": "2.5.
|
|
106
|
-
"@tamagui/helpers-tamagui": "2.5.
|
|
107
|
-
"@tamagui/image": "2.5.
|
|
108
|
-
"@tamagui/input": "2.5.
|
|
109
|
-
"@tamagui/label": "2.5.
|
|
110
|
-
"@tamagui/linear-gradient": "2.5.
|
|
111
|
-
"@tamagui/list-item": "2.5.
|
|
112
|
-
"@tamagui/menu": "2.5.
|
|
113
|
-
"@tamagui/polyfill-dev": "2.5.
|
|
114
|
-
"@tamagui/popover": "2.5.
|
|
115
|
-
"@tamagui/popper": "2.5.
|
|
116
|
-
"@tamagui/portal": "2.5.
|
|
117
|
-
"@tamagui/progress": "2.5.
|
|
118
|
-
"@tamagui/radio-group": "2.5.
|
|
119
|
-
"@tamagui/react-native-media-driver": "2.5.
|
|
120
|
-
"@tamagui/scroll-view": "2.5.
|
|
121
|
-
"@tamagui/select": "2.5.
|
|
122
|
-
"@tamagui/separator": "2.5.
|
|
123
|
-
"@tamagui/shapes": "2.5.
|
|
124
|
-
"@tamagui/sheet": "2.5.
|
|
125
|
-
"@tamagui/slider": "2.5.
|
|
126
|
-
"@tamagui/spacer": "2.5.
|
|
127
|
-
"@tamagui/spinner": "2.5.
|
|
128
|
-
"@tamagui/stacks": "2.5.
|
|
129
|
-
"@tamagui/switch": "2.5.
|
|
130
|
-
"@tamagui/tabs": "2.5.
|
|
131
|
-
"@tamagui/text": "2.5.
|
|
132
|
-
"@tamagui/theme": "2.5.
|
|
133
|
-
"@tamagui/toast": "2.5.
|
|
134
|
-
"@tamagui/toggle-group": "2.5.
|
|
135
|
-
"@tamagui/tooltip": "2.5.
|
|
136
|
-
"@tamagui/use-controllable-state": "2.5.
|
|
137
|
-
"@tamagui/use-debounce": "2.5.
|
|
138
|
-
"@tamagui/use-force-update": "2.5.
|
|
139
|
-
"@tamagui/use-window-dimensions": "2.5.
|
|
140
|
-
"@tamagui/visually-hidden": "2.5.
|
|
141
|
-
"@tamagui/font-size": "2.5.
|
|
142
|
-
"@tamagui/z-index-stack": "2.5.
|
|
80
|
+
"@tamagui/accordion": "2.5.1",
|
|
81
|
+
"@tamagui/adapt": "2.5.1",
|
|
82
|
+
"@tamagui/alert-dialog": "2.5.1",
|
|
83
|
+
"@tamagui/animate": "2.5.1",
|
|
84
|
+
"@tamagui/animate-presence": "2.5.1",
|
|
85
|
+
"@tamagui/avatar": "2.5.1",
|
|
86
|
+
"@tamagui/button": "2.5.1",
|
|
87
|
+
"@tamagui/card": "2.5.1",
|
|
88
|
+
"@tamagui/checkbox": "2.5.1",
|
|
89
|
+
"@tamagui/collapsible": "2.5.1",
|
|
90
|
+
"@tamagui/compose-refs": "2.5.1",
|
|
91
|
+
"@tamagui/constants": "2.5.1",
|
|
92
|
+
"@tamagui/context-menu": "2.5.1",
|
|
93
|
+
"@tamagui/core": "2.5.1",
|
|
94
|
+
"@tamagui/create-context": "2.5.1",
|
|
95
|
+
"@tamagui/create-menu": "2.5.1",
|
|
96
|
+
"@tamagui/dialog": "2.5.1",
|
|
97
|
+
"@tamagui/element": "2.5.1",
|
|
98
|
+
"@tamagui/elements": "2.5.1",
|
|
99
|
+
"@tamagui/fake-react-native": "2.5.1",
|
|
100
|
+
"@tamagui/focusable": "2.5.1",
|
|
101
|
+
"@tamagui/form": "2.5.1",
|
|
102
|
+
"@tamagui/get-button-sized": "2.5.1",
|
|
103
|
+
"@tamagui/get-font-sized": "2.5.1",
|
|
104
|
+
"@tamagui/get-token": "2.5.1",
|
|
105
|
+
"@tamagui/group": "2.5.1",
|
|
106
|
+
"@tamagui/helpers-tamagui": "2.5.1",
|
|
107
|
+
"@tamagui/image": "2.5.1",
|
|
108
|
+
"@tamagui/input": "2.5.1",
|
|
109
|
+
"@tamagui/label": "2.5.1",
|
|
110
|
+
"@tamagui/linear-gradient": "2.5.1",
|
|
111
|
+
"@tamagui/list-item": "2.5.1",
|
|
112
|
+
"@tamagui/menu": "2.5.1",
|
|
113
|
+
"@tamagui/polyfill-dev": "2.5.1",
|
|
114
|
+
"@tamagui/popover": "2.5.1",
|
|
115
|
+
"@tamagui/popper": "2.5.1",
|
|
116
|
+
"@tamagui/portal": "2.5.1",
|
|
117
|
+
"@tamagui/progress": "2.5.1",
|
|
118
|
+
"@tamagui/radio-group": "2.5.1",
|
|
119
|
+
"@tamagui/react-native-media-driver": "2.5.1",
|
|
120
|
+
"@tamagui/scroll-view": "2.5.1",
|
|
121
|
+
"@tamagui/select": "2.5.1",
|
|
122
|
+
"@tamagui/separator": "2.5.1",
|
|
123
|
+
"@tamagui/shapes": "2.5.1",
|
|
124
|
+
"@tamagui/sheet": "2.5.1",
|
|
125
|
+
"@tamagui/slider": "2.5.1",
|
|
126
|
+
"@tamagui/spacer": "2.5.1",
|
|
127
|
+
"@tamagui/spinner": "2.5.1",
|
|
128
|
+
"@tamagui/stacks": "2.5.1",
|
|
129
|
+
"@tamagui/switch": "2.5.1",
|
|
130
|
+
"@tamagui/tabs": "2.5.1",
|
|
131
|
+
"@tamagui/text": "2.5.1",
|
|
132
|
+
"@tamagui/theme": "2.5.1",
|
|
133
|
+
"@tamagui/toast": "2.5.1",
|
|
134
|
+
"@tamagui/toggle-group": "2.5.1",
|
|
135
|
+
"@tamagui/tooltip": "2.5.1",
|
|
136
|
+
"@tamagui/use-controllable-state": "2.5.1",
|
|
137
|
+
"@tamagui/use-debounce": "2.5.1",
|
|
138
|
+
"@tamagui/use-force-update": "2.5.1",
|
|
139
|
+
"@tamagui/use-window-dimensions": "2.5.1",
|
|
140
|
+
"@tamagui/visually-hidden": "2.5.1",
|
|
141
|
+
"@tamagui/font-size": "2.5.1",
|
|
142
|
+
"@tamagui/z-index-stack": "2.5.1"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@tamagui/build": "2.5.
|
|
145
|
+
"@tamagui/build": "2.5.1",
|
|
146
146
|
"react": ">=19",
|
|
147
147
|
"react-native": "0.83.2",
|
|
148
148
|
"react-native-web": "^0.21.0"
|