tamagui 1.125.31 → 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/native.js
CHANGED
|
@@ -15976,31 +15976,52 @@ var require_useStackedZIndex_native = __commonJS({
|
|
|
15976
15976
|
}
|
|
15977
15977
|
});
|
|
15978
15978
|
module2.exports = __toCommonJS2(useStackedZIndex_exports);
|
|
15979
|
-
var import_react3 = require("react"), import_context = require_context_native(), ZIndicesByContext = {}, useStackedZIndex = function(props) {
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
|
|
15990
|
-
|
|
15991
|
-
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
15999
|
-
|
|
16000
|
-
};
|
|
16001
|
-
|
|
16002
|
-
|
|
16003
|
-
|
|
15979
|
+
var import_react3 = require("react"), import_context = require_context_native(), ZIndicesByContext = {}, CurrentPortalZIndices = {}, useStackedZIndex = function(props) {
|
|
15980
|
+
if (process.env.TAMAGUI_STACK_Z_INDEX_GLOBAL) {
|
|
15981
|
+
var { stackZIndex, zIndex: zIndexProp = 1e3 } = props, id = (0, import_react3.useId)(), zIndex = (0, import_react3.useMemo)(function() {
|
|
15982
|
+
if (stackZIndex && stackZIndex !== "global") {
|
|
15983
|
+
var highest = Object.values(CurrentPortalZIndices).reduce(function(acc, cur) {
|
|
15984
|
+
return Math.max(acc, cur);
|
|
15985
|
+
}, 0);
|
|
15986
|
+
return Math.max(stackZIndex === !0 ? 1 : stackZIndex, highest + 1);
|
|
15987
|
+
}
|
|
15988
|
+
return zIndexProp || 1e3;
|
|
15989
|
+
}, [
|
|
15990
|
+
stackZIndex
|
|
15991
|
+
]);
|
|
15992
|
+
return (0, import_react3.useEffect)(function() {
|
|
15993
|
+
if (typeof stackZIndex == "number") return CurrentPortalZIndices[id] = stackZIndex, function() {
|
|
15994
|
+
delete CurrentPortalZIndices[id];
|
|
15995
|
+
};
|
|
15996
|
+
}, [
|
|
15997
|
+
stackZIndex
|
|
15998
|
+
]), zIndex;
|
|
15999
|
+
} else {
|
|
16000
|
+
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);
|
|
16001
|
+
(_ZIndicesByContext = ZIndicesByContext)[_stackLayer = stackLayer] || (_ZIndicesByContext[_stackLayer] = {});
|
|
16002
|
+
var stackContext = ZIndicesByContext[stackLayer], zIndex1 = (0, import_react3.useMemo)(function() {
|
|
16003
|
+
if (typeof zIndexProp1 == "number") return zIndexProp1;
|
|
16004
|
+
if (stackZIndex1) {
|
|
16005
|
+
if (hardcoded) return hardcoded + 1;
|
|
16006
|
+
var highest = Object.values(stackContext).reduce(function(acc, cur) {
|
|
16007
|
+
return Math.max(acc, cur);
|
|
16008
|
+
}, 0), found = stackLayer * 5e3 + highest + 1;
|
|
16009
|
+
return typeof stackZIndex1 == "number" ? stackZIndex1 + found : found;
|
|
16010
|
+
}
|
|
16011
|
+
return 1;
|
|
16012
|
+
}, [
|
|
16013
|
+
stackLayer,
|
|
16014
|
+
zIndexProp1,
|
|
16015
|
+
stackZIndex1
|
|
16016
|
+
]);
|
|
16017
|
+
return (0, import_react3.useEffect)(function() {
|
|
16018
|
+
if (stackZIndex1) return stackContext[id1] = zIndex1, function() {
|
|
16019
|
+
delete stackContext[id1];
|
|
16020
|
+
};
|
|
16021
|
+
}, [
|
|
16022
|
+
zIndex1
|
|
16023
|
+
]), zIndex1;
|
|
16024
|
+
}
|
|
16004
16025
|
};
|
|
16005
16026
|
}
|
|
16006
16027
|
});
|
|
@@ -28493,18 +28514,15 @@ var require_constants_native6 = __commonJS({
|
|
|
28493
28514
|
SLIDER_NAME: function() {
|
|
28494
28515
|
return SLIDER_NAME;
|
|
28495
28516
|
},
|
|
28517
|
+
SliderContext: function() {
|
|
28518
|
+
return SliderContext2;
|
|
28519
|
+
},
|
|
28496
28520
|
SliderOrientationProvider: function() {
|
|
28497
28521
|
return SliderOrientationProvider;
|
|
28498
28522
|
},
|
|
28499
28523
|
SliderProvider: function() {
|
|
28500
28524
|
return SliderProvider;
|
|
28501
28525
|
},
|
|
28502
|
-
createSliderContext: function() {
|
|
28503
|
-
return createSliderContext;
|
|
28504
|
-
},
|
|
28505
|
-
createSliderScope: function() {
|
|
28506
|
-
return createSliderScope;
|
|
28507
|
-
},
|
|
28508
28526
|
useSliderContext: function() {
|
|
28509
28527
|
return useSliderContext;
|
|
28510
28528
|
},
|
|
@@ -28513,7 +28531,12 @@ var require_constants_native6 = __commonJS({
|
|
|
28513
28531
|
}
|
|
28514
28532
|
});
|
|
28515
28533
|
module2.exports = __toCommonJS2(constants_exports);
|
|
28516
|
-
var
|
|
28534
|
+
var import_core12 = require_index_native18(), SLIDER_NAME = "Slider", SliderContext2 = (0, import_core12.createStyledContext)({
|
|
28535
|
+
size: "$true",
|
|
28536
|
+
min: 0,
|
|
28537
|
+
max: 100,
|
|
28538
|
+
orientation: "horizontal"
|
|
28539
|
+
}), { Provider: SliderProvider, useStyledContext: useSliderContext } = SliderContext2, { Provider: SliderOrientationProvider, useStyledContext: useSliderOrientationContext } = (0, import_core12.createStyledContext)({
|
|
28517
28540
|
startEdge: "left",
|
|
28518
28541
|
endEdge: "right",
|
|
28519
28542
|
sizeProp: "width",
|
|
@@ -28757,7 +28780,7 @@ var require_SliderImpl_native = __commonJS({
|
|
|
28757
28780
|
}
|
|
28758
28781
|
}
|
|
28759
28782
|
}), SliderImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
28760
|
-
var { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
28783
|
+
var { __scopeSlider, onSlideStart, onSlideMove, onSlideEnd, onHomeKeyDown, onEndKeyDown, onStepKeyDown, ...sliderProps } = props, context = (0, import_constants22.useSliderContext)(__scopeSlider);
|
|
28761
28784
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SliderFrame2, {
|
|
28762
28785
|
size: "$4",
|
|
28763
28786
|
...sliderProps,
|
|
@@ -29069,7 +29092,7 @@ var require_Slider_native = __commonJS({
|
|
|
29069
29092
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
29070
29093
|
}
|
|
29071
29094
|
}), SliderTrack = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
29072
|
-
var { __scopeSlider, ...trackProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
29095
|
+
var { __scopeSlider, ...trackProps } = props, context = (0, import_constants22.useSliderContext)(__scopeSlider);
|
|
29073
29096
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SliderTrackFrame, {
|
|
29074
29097
|
"data-disabled": context.disabled ? "" : void 0,
|
|
29075
29098
|
"data-orientation": context.orientation,
|
|
@@ -29086,7 +29109,7 @@ var require_Slider_native = __commonJS({
|
|
|
29086
29109
|
position: "absolute",
|
|
29087
29110
|
pointerEvents: "box-none"
|
|
29088
29111
|
}), SliderTrackActive = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
29089
|
-
var { __scopeSlider, ...rangeProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
29112
|
+
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) {
|
|
29090
29113
|
return (0, import_helpers3.convertValueToPercentage)(value, context.min, context.max);
|
|
29091
29114
|
}), offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0, offsetEnd = 100 - Math.max(...percentages);
|
|
29092
29115
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SliderTrackActiveFrame, {
|
|
@@ -29113,7 +29136,7 @@ var require_Slider_native = __commonJS({
|
|
|
29113
29136
|
});
|
|
29114
29137
|
});
|
|
29115
29138
|
SliderTrackActive.displayName = RANGE_NAME;
|
|
29116
|
-
var
|
|
29139
|
+
var getThumbSize = function(val) {
|
|
29117
29140
|
var tokens = (0, import_core12.getTokens)(), size4 = typeof val == "number" ? val : (0, import_get_token2.getSize)(tokens.size[val], {
|
|
29118
29141
|
shift: -1
|
|
29119
29142
|
});
|
|
@@ -29145,7 +29168,7 @@ var require_Slider_native = __commonJS({
|
|
|
29145
29168
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
29146
29169
|
}
|
|
29147
29170
|
}), SliderThumb = SliderThumbFrame.styleable(function(props, forwardedRef) {
|
|
29148
|
-
var { __scopeSlider, index, size: sizeProp, ...thumbProps } = props, context = (0, import_constants22.useSliderContext)(
|
|
29171
|
+
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() {
|
|
29149
29172
|
var estimatedSize = (0, import_core12.getVariableValue)(getThumbSize(sizeIn).width);
|
|
29150
29173
|
return estimatedSize;
|
|
29151
29174
|
}), thumbInBoundsOffset = size4 ? (0, import_helpers3.getThumbInBoundsOffset)(size4, percent, orientation.direction) : 0;
|
|
@@ -29196,6 +29219,7 @@ var require_Slider_native = __commonJS({
|
|
|
29196
29219
|
...positionalStyles,
|
|
29197
29220
|
[orientation.startEdge]: `${percent}%`,
|
|
29198
29221
|
size: sizeIn,
|
|
29222
|
+
circular,
|
|
29199
29223
|
...thumbProps,
|
|
29200
29224
|
onLayout: function(e) {
|
|
29201
29225
|
setSize(e.nativeEvent.layout[orientation.sizeProp]);
|
|
@@ -29365,13 +29389,16 @@ var require_index_native66 = __commonJS({
|
|
|
29365
29389
|
}), mod);
|
|
29366
29390
|
}, index_exports2 = {};
|
|
29367
29391
|
__export2(index_exports2, {
|
|
29392
|
+
SliderContext: function() {
|
|
29393
|
+
return import_constants4.SliderContext;
|
|
29394
|
+
},
|
|
29368
29395
|
SliderFrame: function() {
|
|
29369
29396
|
return import_SliderImpl.SliderFrame;
|
|
29370
29397
|
}
|
|
29371
29398
|
});
|
|
29372
29399
|
module2.exports = __toCommonJS2(index_exports2);
|
|
29373
29400
|
__reExport2(index_exports2, require_Slider_native(), module2.exports);
|
|
29374
|
-
var import_SliderImpl = require_SliderImpl_native();
|
|
29401
|
+
var import_constants4 = require_constants_native6(), import_SliderImpl = require_SliderImpl_native();
|
|
29375
29402
|
}
|
|
29376
29403
|
});
|
|
29377
29404
|
|