tamagui 1.125.31-1743030157133 → 1.125.32
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 +65 -38
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +65 -38
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/test.native.js
CHANGED
|
@@ -15383,31 +15383,52 @@ var require_useStackedZIndex_native = __commonJS({
|
|
|
15383
15383
|
}
|
|
15384
15384
|
});
|
|
15385
15385
|
module2.exports = __toCommonJS2(useStackedZIndex_exports);
|
|
15386
|
-
var import_react3 = require("react"), import_context = require_context_native(), ZIndicesByContext = {}, useStackedZIndex = function(props) {
|
|
15387
|
-
|
|
15388
|
-
|
|
15389
|
-
|
|
15390
|
-
|
|
15391
|
-
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
|
|
15395
|
-
|
|
15396
|
-
|
|
15397
|
-
|
|
15398
|
-
|
|
15399
|
-
|
|
15400
|
-
|
|
15401
|
-
|
|
15402
|
-
|
|
15403
|
-
|
|
15404
|
-
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
};
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
|
|
15386
|
+
var import_react3 = require("react"), import_context = require_context_native(), ZIndicesByContext = {}, CurrentPortalZIndices = {}, useStackedZIndex = function(props) {
|
|
15387
|
+
if (process.env.TAMAGUI_STACK_Z_INDEX_GLOBAL) {
|
|
15388
|
+
var { stackZIndex, zIndex: zIndexProp = 1e3 } = props, id = (0, import_react3.useId)(), zIndex = (0, import_react3.useMemo)(function() {
|
|
15389
|
+
if (stackZIndex && stackZIndex !== "global") {
|
|
15390
|
+
var highest = Object.values(CurrentPortalZIndices).reduce(function(acc, cur) {
|
|
15391
|
+
return Math.max(acc, cur);
|
|
15392
|
+
}, 0);
|
|
15393
|
+
return Math.max(stackZIndex === !0 ? 1 : stackZIndex, highest + 1);
|
|
15394
|
+
}
|
|
15395
|
+
return zIndexProp || 1e3;
|
|
15396
|
+
}, [
|
|
15397
|
+
stackZIndex
|
|
15398
|
+
]);
|
|
15399
|
+
return (0, import_react3.useEffect)(function() {
|
|
15400
|
+
if (typeof stackZIndex == "number") return CurrentPortalZIndices[id] = stackZIndex, function() {
|
|
15401
|
+
delete CurrentPortalZIndices[id];
|
|
15402
|
+
};
|
|
15403
|
+
}, [
|
|
15404
|
+
stackZIndex
|
|
15405
|
+
]), zIndex;
|
|
15406
|
+
} else {
|
|
15407
|
+
var _ZIndicesByContext, _stackLayer, { stackZIndex: stackZIndex1, zIndex: zIndexProp1 } = props, id1 = (0, import_react3.useId)(), stackingContextLevel = (0, import_react3.useContext)(import_context.ZIndexStackContext), stackLayer = stackZIndex1 === "global" ? 0 : stackingContextLevel, hardcoded = (0, import_react3.useContext)(import_context.ZIndexHardcodedContext);
|
|
15408
|
+
(_ZIndicesByContext = ZIndicesByContext)[_stackLayer = stackLayer] || (_ZIndicesByContext[_stackLayer] = {});
|
|
15409
|
+
var stackContext = ZIndicesByContext[stackLayer], zIndex1 = (0, import_react3.useMemo)(function() {
|
|
15410
|
+
if (typeof zIndexProp1 == "number") return zIndexProp1;
|
|
15411
|
+
if (stackZIndex1) {
|
|
15412
|
+
if (hardcoded) return hardcoded + 1;
|
|
15413
|
+
var highest = Object.values(stackContext).reduce(function(acc, cur) {
|
|
15414
|
+
return Math.max(acc, cur);
|
|
15415
|
+
}, 0), found = stackLayer * 5e3 + highest + 1;
|
|
15416
|
+
return typeof stackZIndex1 == "number" ? stackZIndex1 + found : found;
|
|
15417
|
+
}
|
|
15418
|
+
return 1;
|
|
15419
|
+
}, [
|
|
15420
|
+
stackLayer,
|
|
15421
|
+
zIndexProp1,
|
|
15422
|
+
stackZIndex1
|
|
15423
|
+
]);
|
|
15424
|
+
return (0, import_react3.useEffect)(function() {
|
|
15425
|
+
if (stackZIndex1) return stackContext[id1] = zIndex1, function() {
|
|
15426
|
+
delete stackContext[id1];
|
|
15427
|
+
};
|
|
15428
|
+
}, [
|
|
15429
|
+
zIndex1
|
|
15430
|
+
]), zIndex1;
|
|
15431
|
+
}
|
|
15411
15432
|
};
|
|
15412
15433
|
}
|
|
15413
15434
|
});
|
|
@@ -27797,18 +27818,15 @@ var require_constants_native6 = __commonJS({
|
|
|
27797
27818
|
SLIDER_NAME: function() {
|
|
27798
27819
|
return SLIDER_NAME;
|
|
27799
27820
|
},
|
|
27821
|
+
SliderContext: function() {
|
|
27822
|
+
return SliderContext2;
|
|
27823
|
+
},
|
|
27800
27824
|
SliderOrientationProvider: function() {
|
|
27801
27825
|
return SliderOrientationProvider;
|
|
27802
27826
|
},
|
|
27803
27827
|
SliderProvider: function() {
|
|
27804
27828
|
return SliderProvider;
|
|
27805
27829
|
},
|
|
27806
|
-
createSliderContext: function() {
|
|
27807
|
-
return createSliderContext;
|
|
27808
|
-
},
|
|
27809
|
-
createSliderScope: function() {
|
|
27810
|
-
return createSliderScope;
|
|
27811
|
-
},
|
|
27812
27830
|
useSliderContext: function() {
|
|
27813
27831
|
return useSliderContext;
|
|
27814
27832
|
},
|
|
@@ -27817,7 +27835,12 @@ var require_constants_native6 = __commonJS({
|
|
|
27817
27835
|
}
|
|
27818
27836
|
});
|
|
27819
27837
|
module2.exports = __toCommonJS2(constants_exports);
|
|
27820
|
-
var
|
|
27838
|
+
var import_core12 = require_index_native18(), SLIDER_NAME = "Slider", SliderContext2 = (0, import_core12.createStyledContext)({
|
|
27839
|
+
size: "$true",
|
|
27840
|
+
min: 0,
|
|
27841
|
+
max: 100,
|
|
27842
|
+
orientation: "horizontal"
|
|
27843
|
+
}), { Provider: SliderProvider, useStyledContext: useSliderContext } = SliderContext2, { Provider: SliderOrientationProvider, useStyledContext: useSliderOrientationContext } = (0, import_core12.createStyledContext)({
|
|
27821
27844
|
startEdge: "left",
|
|
27822
27845
|
endEdge: "right",
|
|
27823
27846
|
sizeProp: "width",
|
|
@@ -28061,7 +28084,7 @@ var require_SliderImpl_native = __commonJS({
|
|
|
28061
28084
|
}
|
|
28062
28085
|
}
|
|
28063
28086
|
}), SliderImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
28064
|
-
var { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
28087
|
+
var { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props, context = (0, import_constants22.useSliderContext)(__scopeSlider);
|
|
28065
28088
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SliderFrame2, {
|
|
28066
28089
|
size: "$4",
|
|
28067
28090
|
...sliderProps,
|
|
@@ -28373,7 +28396,7 @@ var require_Slider_native = __commonJS({
|
|
|
28373
28396
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
28374
28397
|
}
|
|
28375
28398
|
}), SliderTrack = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
28376
|
-
var { __scopeSlider, ...trackProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
28399
|
+
var { __scopeSlider, ...trackProps } = props, context = (0, import_constants22.useSliderContext)(__scopeSlider);
|
|
28377
28400
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SliderTrackFrame, {
|
|
28378
28401
|
"data-disabled": context.disabled ? "" : void 0,
|
|
28379
28402
|
"data-orientation": context.orientation,
|
|
@@ -28390,7 +28413,7 @@ var require_Slider_native = __commonJS({
|
|
|
28390
28413
|
position: "absolute",
|
|
28391
28414
|
pointerEvents: "box-none"
|
|
28392
28415
|
}), SliderTrackActive = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
28393
|
-
var { __scopeSlider, ...rangeProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
28416
|
+
var { __scopeSlider, ...rangeProps } = props, context = (0, import_constants22.useSliderContext)(__scopeSlider), orientation = (0, import_constants22.useSliderOrientationContext)(__scopeSlider), ref = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref), valuesCount = context.values.length, percentages = context.values.map(function(value) {
|
|
28394
28417
|
return (0, import_helpers3.convertValueToPercentage)(value, context.min, context.max);
|
|
28395
28418
|
}), offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0, offsetEnd = 100 - Math.max(...percentages);
|
|
28396
28419
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SliderTrackActiveFrame, {
|
|
@@ -28417,7 +28440,7 @@ var require_Slider_native = __commonJS({
|
|
|
28417
28440
|
});
|
|
28418
28441
|
});
|
|
28419
28442
|
SliderTrackActive.displayName = RANGE_NAME;
|
|
28420
|
-
var
|
|
28443
|
+
var getThumbSize = function(val) {
|
|
28421
28444
|
var tokens = (0, import_core12.getTokens)(), size4 = typeof val == "number" ? val : (0, import_get_token2.getSize)(tokens.size[val], {
|
|
28422
28445
|
shift: -1
|
|
28423
28446
|
});
|
|
@@ -28449,7 +28472,7 @@ var require_Slider_native = __commonJS({
|
|
|
28449
28472
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
28450
28473
|
}
|
|
28451
28474
|
}), SliderThumb = SliderThumbFrame.styleable(function(props, forwardedRef) {
|
|
28452
|
-
var { __scopeSlider, index, size: sizeProp, ...thumbProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
28475
|
+
var { __scopeSlider, index, circular, size: sizeProp, ...thumbProps } = props, context = (0, import_constants22.useSliderContext)(__scopeSlider), orientation = (0, import_constants22.useSliderOrientationContext)(__scopeSlider), [thumb, setThumb] = React4.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, setThumb), value = context.values[index], percent = value === void 0 ? 0 : (0, import_helpers3.convertValueToPercentage)(value, context.min, context.max), label = (0, import_helpers3.getLabel)(index, context.values.length), _ref, sizeIn = (_ref = sizeProp ?? context.size) !== null && _ref !== void 0 ? _ref : "$true", [size4, setSize] = React4.useState(function() {
|
|
28453
28476
|
var estimatedSize = (0, import_core12.getVariableValue)(getThumbSize(sizeIn).width);
|
|
28454
28477
|
return estimatedSize;
|
|
28455
28478
|
}), thumbInBoundsOffset = size4 ? (0, import_helpers3.getThumbInBoundsOffset)(size4, percent, orientation.direction) : 0;
|
|
@@ -28500,6 +28523,7 @@ var require_Slider_native = __commonJS({
|
|
|
28500
28523
|
...positionalStyles,
|
|
28501
28524
|
[orientation.startEdge]: `${percent}%`,
|
|
28502
28525
|
size: sizeIn,
|
|
28526
|
+
circular,
|
|
28503
28527
|
...thumbProps,
|
|
28504
28528
|
onLayout: function(e) {
|
|
28505
28529
|
setSize(e.nativeEvent.layout[orientation.sizeProp]);
|
|
@@ -28669,13 +28693,16 @@ var require_index_native66 = __commonJS({
|
|
|
28669
28693
|
}), mod);
|
|
28670
28694
|
}, index_exports2 = {};
|
|
28671
28695
|
__export2(index_exports2, {
|
|
28696
|
+
SliderContext: function() {
|
|
28697
|
+
return import_constants4.SliderContext;
|
|
28698
|
+
},
|
|
28672
28699
|
SliderFrame: function() {
|
|
28673
28700
|
return import_SliderImpl.SliderFrame;
|
|
28674
28701
|
}
|
|
28675
28702
|
});
|
|
28676
28703
|
module2.exports = __toCommonJS2(index_exports2);
|
|
28677
28704
|
__reExport2(index_exports2, require_Slider_native(), module2.exports);
|
|
28678
|
-
var import_SliderImpl = require_SliderImpl_native();
|
|
28705
|
+
var import_constants4 = require_constants_native6(), import_SliderImpl = require_SliderImpl_native();
|
|
28679
28706
|
}
|
|
28680
28707
|
});
|
|
28681
28708
|
|