tamagui 1.122.8 → 1.123.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/dist/native.js +188 -107
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +182 -99
- package/dist/test.native.js.map +3 -3
- package/package.json +54 -54
package/dist/test.native.js
CHANGED
|
@@ -1115,7 +1115,7 @@ var require_types_native2 = __commonJS({
|
|
|
1115
1115
|
var require_constants_native = __commonJS({
|
|
1116
1116
|
"../../core/constants/dist/cjs/constants.native.js"(exports2, module2) {
|
|
1117
1117
|
"use strict";
|
|
1118
|
-
var
|
|
1118
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
1119
1119
|
for (var name in all) __defProp2(target, name, {
|
|
1120
1120
|
get: all[name],
|
|
1121
1121
|
enumerable: !0
|
|
@@ -1143,18 +1143,6 @@ var require_constants_native = __commonJS({
|
|
|
1143
1143
|
}
|
|
1144
1144
|
}
|
|
1145
1145
|
return to;
|
|
1146
|
-
}, __toESM2 = function(mod, isNodeMode, target) {
|
|
1147
|
-
return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
1148
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
1149
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
1150
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1151
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1152
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
|
|
1153
|
-
value: mod,
|
|
1154
|
-
enumerable: !0
|
|
1155
|
-
}) : target,
|
|
1156
|
-
mod
|
|
1157
|
-
);
|
|
1158
1146
|
}, __toCommonJS2 = function(mod) {
|
|
1159
1147
|
return __copyProps2(__defProp2({}, "__esModule", {
|
|
1160
1148
|
value: !0
|
|
@@ -1196,7 +1184,10 @@ var require_constants_native = __commonJS({
|
|
|
1196
1184
|
}
|
|
1197
1185
|
});
|
|
1198
1186
|
module2.exports = __toCommonJS2(constants_native_exports);
|
|
1199
|
-
var import_react3 =
|
|
1187
|
+
var import_react3 = require("react"), import_react_native4 = require("react-native"), isWeb6 = !1, isWindowDefined = !1, isServer2 = !1, isClient2 = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome2 = !1, isWebTouchable2 = !1, isTouchable2 = !0, isAndroid = import_react_native4.Platform.OS === "android" || process.env.TEST_NATIVE_PLATFORM === "android", isIos = import_react_native4.Platform.OS === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios", platforms = {
|
|
1188
|
+
ios: "ios",
|
|
1189
|
+
android: "android"
|
|
1190
|
+
}, currentPlatform = platforms[import_react_native4.Platform.OS] || "native";
|
|
1200
1191
|
}
|
|
1201
1192
|
});
|
|
1202
1193
|
|
|
@@ -1362,9 +1353,6 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1362
1353
|
stylePropsAll: function() {
|
|
1363
1354
|
return stylePropsAll;
|
|
1364
1355
|
},
|
|
1365
|
-
stylePropsFont: function() {
|
|
1366
|
-
return stylePropsFont;
|
|
1367
|
-
},
|
|
1368
1356
|
stylePropsText: function() {
|
|
1369
1357
|
return stylePropsText;
|
|
1370
1358
|
},
|
|
@@ -3383,10 +3371,20 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3383
3371
|
}
|
|
3384
3372
|
}
|
|
3385
3373
|
]), ThemeManager2;
|
|
3386
|
-
}();
|
|
3374
|
+
}(), cache = {};
|
|
3387
3375
|
function getState(props, manager) {
|
|
3388
|
-
if (props.name && props.reset) throw new Error("Cannot reset and set a new name at the same time.");
|
|
3389
3376
|
if (!getHasThemeUpdatingProps(props)) return null;
|
|
3377
|
+
var [allManagers] = getManagers(manager), cacheKey = `${props.name || ""}${props.componentName || ""}${props.inverse || ""}${props.reset || ""}${allManagers.map(function(x) {
|
|
3378
|
+
return (x == null ? void 0 : x.state.name) || ".";
|
|
3379
|
+
}).join("")}`, cached = cache[cacheKey];
|
|
3380
|
+
if (!cached) {
|
|
3381
|
+
var res = getStateUncached(props, manager);
|
|
3382
|
+
return cache[cacheKey] = res, res;
|
|
3383
|
+
}
|
|
3384
|
+
return cached;
|
|
3385
|
+
}
|
|
3386
|
+
function getStateUncached(props, manager) {
|
|
3387
|
+
if (props.name && props.reset) throw new Error("Cannot reset and set a new name at the same time.");
|
|
3390
3388
|
var themes = (0, import_config.getThemes)(), [allManagers, componentManagers] = getManagers(manager), isDirectParentAComponentTheme = !!(manager != null && manager.state.isComponent), startIndex = props.reset && !isDirectParentAComponentTheme ? 1 : 0, baseManager = allManagers[startIndex], parentManager = allManagers[startIndex + 1];
|
|
3391
3389
|
if (!baseManager && props.reset) return console.warn("Cannot reset, no parent theme exists"), null;
|
|
3392
3390
|
var { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
@@ -3742,65 +3740,55 @@ var require_useTheme_native = __commonJS({
|
|
|
3742
3740
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyProps, [_, theme] = useThemeWithState(props), res = theme;
|
|
3743
3741
|
return res;
|
|
3744
3742
|
}, useThemeWithState = function(props) {
|
|
3745
|
-
var keys = (0, import_react3.useRef)(null), changedThemeState = useChangeThemeEffect(props, !1, keys), { themeManager, state } = changedThemeState, themeProxied = (
|
|
3746
|
-
return keys.current && (keys.current = null), !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, keys, themeManager, props.debug);
|
|
3747
|
-
}, [
|
|
3748
|
-
state == null ? void 0 : state.theme,
|
|
3749
|
-
themeManager,
|
|
3750
|
-
props.deopt,
|
|
3751
|
-
props.debug
|
|
3752
|
-
]);
|
|
3743
|
+
var keys = (0, import_react3.useRef)(null), changedThemeState = useChangeThemeEffect(props, !1, keys), { themeManager, state } = changedThemeState, themeProxied = getThemeProxied(props, state, keys, themeManager);
|
|
3753
3744
|
return [
|
|
3754
3745
|
changedThemeState,
|
|
3755
3746
|
themeProxied
|
|
3756
3747
|
];
|
|
3757
|
-
};
|
|
3758
|
-
function getThemeProxied(
|
|
3759
|
-
var
|
|
3760
|
-
if (!theme) return
|
|
3761
|
-
|
|
3748
|
+
}, emptyObject = {}, ProxiedThemes = /* @__PURE__ */ new Map(), curKeys, curProps, curThemeManger;
|
|
3749
|
+
function getThemeProxied(_props, state, _keys, _themeManager) {
|
|
3750
|
+
var theme = state == null ? void 0 : state.theme;
|
|
3751
|
+
if (!theme || !_themeManager) return emptyObject;
|
|
3752
|
+
if (curKeys = _keys, curProps = _props, curThemeManger = _themeManager, ProxiedThemes.has(theme)) {
|
|
3753
|
+
var proxied = ProxiedThemes.get(theme);
|
|
3754
|
+
return proxied;
|
|
3755
|
+
}
|
|
3756
|
+
var { name, scheme } = state, config = (0, import_config.getConfig)();
|
|
3762
3757
|
function track(key) {
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
if (subkey === "val") globalThis.tamaguiAvoidTracking || track(keyString);
|
|
3784
|
-
else if (subkey === "get") return function(platform2) {
|
|
3785
|
-
var outVal = (0, import_createVariable.getVariable)(val);
|
|
3786
|
-
if (platform2 !== "web" && import_constants4.isIos && !deopt && (0, import_config.getSetting)("fastSchemeChange") && !(0, import_shouldDeoptDueToParentScheme.shouldDeoptDueToParentScheme)(themeManager) && scheme) {
|
|
3787
|
-
var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[keyString]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[keyString]), dynamicVal = {
|
|
3788
|
-
dynamic: {
|
|
3789
|
-
[scheme]: color,
|
|
3790
|
-
[oppositeScheme]: oppositeColor
|
|
3791
|
-
}
|
|
3792
|
-
};
|
|
3793
|
-
return dynamicVal;
|
|
3794
|
-
}
|
|
3795
|
-
return track(keyString), outVal;
|
|
3796
|
-
};
|
|
3797
|
-
return Reflect.get(val, subkey);
|
|
3798
|
-
}
|
|
3799
|
-
});
|
|
3758
|
+
curKeys && (curKeys.current || (curKeys.current = []), curKeys.current.push(key));
|
|
3759
|
+
}
|
|
3760
|
+
var proxied1 = Object.fromEntries(Object.entries(theme).flatMap(function(param) {
|
|
3761
|
+
var [key, value] = param, proxied2 = {
|
|
3762
|
+
...value,
|
|
3763
|
+
get val() {
|
|
3764
|
+
return globalThis.tamaguiAvoidTracking || track(key), value.val;
|
|
3765
|
+
},
|
|
3766
|
+
get(platform2) {
|
|
3767
|
+
var outVal = (0, import_createVariable.getVariable)(value);
|
|
3768
|
+
if (platform2 !== "web" && import_constants4.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && !(0, import_shouldDeoptDueToParentScheme.shouldDeoptDueToParentScheme)(curThemeManger) && scheme) {
|
|
3769
|
+
var _config_themes_name, _config_themes_oppositeName, oppositeScheme = scheme === "dark" ? "light" : "dark", oppositeName = name.replace(scheme, oppositeScheme), color = (0, import_createVariable.getVariable)((_config_themes_name = config.themes[name]) === null || _config_themes_name === void 0 ? void 0 : _config_themes_name[key]), oppositeColor = (0, import_createVariable.getVariable)((_config_themes_oppositeName = config.themes[oppositeName]) === null || _config_themes_oppositeName === void 0 ? void 0 : _config_themes_oppositeName[key]), dynamicVal = {
|
|
3770
|
+
dynamic: {
|
|
3771
|
+
[scheme]: color,
|
|
3772
|
+
[oppositeScheme]: oppositeColor
|
|
3773
|
+
}
|
|
3774
|
+
};
|
|
3775
|
+
return dynamicVal;
|
|
3776
|
+
}
|
|
3777
|
+
return track(key), outVal;
|
|
3800
3778
|
}
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3779
|
+
};
|
|
3780
|
+
return [
|
|
3781
|
+
[
|
|
3782
|
+
key,
|
|
3783
|
+
proxied2
|
|
3784
|
+
],
|
|
3785
|
+
[
|
|
3786
|
+
`$${key}`,
|
|
3787
|
+
proxied2
|
|
3788
|
+
]
|
|
3789
|
+
];
|
|
3790
|
+
}));
|
|
3791
|
+
return ProxiedThemes.set(theme, proxied1), proxied1;
|
|
3804
3792
|
}
|
|
3805
3793
|
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = function(id) {
|
|
3806
3794
|
return _idToUID[id];
|
|
@@ -8938,7 +8926,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
8938
8926
|
}
|
|
8939
8927
|
});
|
|
8940
8928
|
module2.exports = __toCommonJS2(proxyThemeToParents_exports);
|
|
8941
|
-
var
|
|
8929
|
+
var themesRaw = {};
|
|
8942
8930
|
function proxyThemesToParents(dedupedThemes) {
|
|
8943
8931
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8944
8932
|
try {
|
|
@@ -8999,21 +8987,24 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
8999
8987
|
return themes;
|
|
9000
8988
|
}
|
|
9001
8989
|
function proxyThemeToParents(themeName, theme) {
|
|
9002
|
-
var cur = [], parents = themeName.split("_").slice(0, -1).map(function(part) {
|
|
8990
|
+
var out = {}, cur = [], parents = themeName.split("_").slice(0, -1).map(function(part) {
|
|
9003
8991
|
return cur.push(part), cur.join("_");
|
|
9004
|
-
}),
|
|
9005
|
-
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
key == "undefined" || Reflect.has(target, key)) return Reflect.get(target, key);
|
|
9010
|
-
for (var i = numParents - 1; i >= 0; i--) {
|
|
9011
|
-
var parent = themesRaw[parents[i]];
|
|
9012
|
-
if (parent && Reflect.has(parent, key)) return Reflect.get(parent, key);
|
|
9013
|
-
}
|
|
9014
|
-
return (0, import_config.getTokenObject)(key);
|
|
8992
|
+
}), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8993
|
+
try {
|
|
8994
|
+
for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
8995
|
+
var parent = _step.value;
|
|
8996
|
+
Object.assign(out, themesRaw[parent]);
|
|
9015
8997
|
}
|
|
9016
|
-
})
|
|
8998
|
+
} catch (err) {
|
|
8999
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
9000
|
+
} finally {
|
|
9001
|
+
try {
|
|
9002
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
9003
|
+
} finally {
|
|
9004
|
+
if (_didIteratorError) throw _iteratorError;
|
|
9005
|
+
}
|
|
9006
|
+
}
|
|
9007
|
+
return Object.assign(out, theme), out;
|
|
9017
9008
|
}
|
|
9018
9009
|
}
|
|
9019
9010
|
});
|
|
@@ -13345,6 +13336,86 @@ var require_Pressability_native = __commonJS({
|
|
|
13345
13336
|
}
|
|
13346
13337
|
});
|
|
13347
13338
|
|
|
13339
|
+
// ../../core/core/dist/cjs/addNativeValidStyles.native.js
|
|
13340
|
+
var require_addNativeValidStyles_native = __commonJS({
|
|
13341
|
+
"../../core/core/dist/cjs/addNativeValidStyles.native.js"(exports2, module2) {
|
|
13342
|
+
"use strict";
|
|
13343
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
13344
|
+
for (var name in all) __defProp2(target, name, {
|
|
13345
|
+
get: all[name],
|
|
13346
|
+
enumerable: !0
|
|
13347
|
+
});
|
|
13348
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
13349
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
13350
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
13351
|
+
for (var _loop = function() {
|
|
13352
|
+
var key = _step.value;
|
|
13353
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
13354
|
+
get: function() {
|
|
13355
|
+
return from[key];
|
|
13356
|
+
},
|
|
13357
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
13358
|
+
});
|
|
13359
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
13360
|
+
} catch (err) {
|
|
13361
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
13362
|
+
} finally {
|
|
13363
|
+
try {
|
|
13364
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
13365
|
+
} finally {
|
|
13366
|
+
if (_didIteratorError)
|
|
13367
|
+
throw _iteratorError;
|
|
13368
|
+
}
|
|
13369
|
+
}
|
|
13370
|
+
return to;
|
|
13371
|
+
}, __toCommonJS2 = function(mod) {
|
|
13372
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
13373
|
+
value: !0
|
|
13374
|
+
}), mod);
|
|
13375
|
+
}, addNativeValidStyles_native_exports = {};
|
|
13376
|
+
__export2(addNativeValidStyles_native_exports, {
|
|
13377
|
+
addNativeValidStyles: function() {
|
|
13378
|
+
return addNativeValidStyles;
|
|
13379
|
+
}
|
|
13380
|
+
});
|
|
13381
|
+
module2.exports = __toCommonJS2(addNativeValidStyles_native_exports);
|
|
13382
|
+
var import_helpers = require_index_native7();
|
|
13383
|
+
function getReactNativeVersion() {
|
|
13384
|
+
var version = process.env.REACT_NATIVE_VERSION;
|
|
13385
|
+
if (!version) try {
|
|
13386
|
+
var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
|
|
13387
|
+
if (ReactNativeOfficalVersion) {
|
|
13388
|
+
var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
|
|
13389
|
+
version = `${major}.${minor}.${patch}`;
|
|
13390
|
+
}
|
|
13391
|
+
} catch {
|
|
13392
|
+
} finally {
|
|
13393
|
+
version || (version = "0.77");
|
|
13394
|
+
}
|
|
13395
|
+
var [major1, minor1, patch1] = version.split(".");
|
|
13396
|
+
return [
|
|
13397
|
+
+major1,
|
|
13398
|
+
+minor1,
|
|
13399
|
+
+patch1
|
|
13400
|
+
];
|
|
13401
|
+
}
|
|
13402
|
+
function addNativeValidStyles() {
|
|
13403
|
+
var [major, minor] = getReactNativeVersion();
|
|
13404
|
+
if (major === 0 && minor >= 77) {
|
|
13405
|
+
var additional = {
|
|
13406
|
+
boxSizing: !0,
|
|
13407
|
+
mixBlendMode: !0,
|
|
13408
|
+
outlineWidth: !0,
|
|
13409
|
+
outlineStyle: !0,
|
|
13410
|
+
outlineSpread: !0,
|
|
13411
|
+
outlineColor: !0
|
|
13412
|
+
};
|
|
13413
|
+
Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
|
|
13414
|
+
}
|
|
13415
|
+
}
|
|
13416
|
+
}
|
|
13417
|
+
});
|
|
13418
|
+
|
|
13348
13419
|
// ../../core/core/dist/cjs/reactNativeTypes.native.js
|
|
13349
13420
|
var require_reactNativeTypes_native = __commonJS({
|
|
13350
13421
|
"../../core/core/dist/cjs/reactNativeTypes.native.js"(exports2, module2) {
|
|
@@ -13447,9 +13518,10 @@ var require_index_native18 = __commonJS({
|
|
|
13447
13518
|
}
|
|
13448
13519
|
});
|
|
13449
13520
|
module2.exports = __toCommonJS2(index_exports2);
|
|
13450
|
-
var import_react_native_media_driver = require_index_native16(), import_react_native_use_responder_events = require_index_native17(), import_web = require_index_native14(), import_react3 = __toESM2(require("react")), import_createOptimizedView = require_createOptimizedView_native(), import_getBaseViews = require_getBaseViews_native(), import_getRect = require_getRect_native(), import_useElementLayout = require_useElementLayout_native(), import_Pressability = require_Pressability_native();
|
|
13521
|
+
var import_react_native_media_driver = require_index_native16(), import_react_native_use_responder_events = require_index_native17(), import_web = require_index_native14(), import_react3 = __toESM2(require("react")), import_createOptimizedView = require_createOptimizedView_native(), import_getBaseViews = require_getBaseViews_native(), import_getRect = require_getRect_native(), import_useElementLayout = require_useElementLayout_native(), import_Pressability = require_Pressability_native(), import_addNativeValidStyles = require_addNativeValidStyles_native();
|
|
13451
13522
|
__reExport2(index_exports2, require_index_native14(), module2.exports);
|
|
13452
13523
|
__reExport2(index_exports2, require_reactNativeTypes_native(), module2.exports);
|
|
13524
|
+
(0, import_addNativeValidStyles.addNativeValidStyles)();
|
|
13453
13525
|
var createTamagui2 = function(conf) {
|
|
13454
13526
|
return conf.media && (conf.media = (0, import_react_native_media_driver.createMedia)(conf.media)), (0, import_web.createTamagui)(conf);
|
|
13455
13527
|
}, baseViews = (0, import_getBaseViews.getBaseViews)();
|
|
@@ -16144,8 +16216,8 @@ var require_Adapt_native = __commonJS({
|
|
|
16144
16216
|
enabled
|
|
16145
16217
|
]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
16146
16218
|
return function() {
|
|
16147
|
-
var _context_setWhen;
|
|
16148
|
-
context == null || (_context_setWhen = context.setWhen) === null || _context_setWhen === void 0 || _context_setWhen.call(context, null);
|
|
16219
|
+
var _context_setWhen, _context_setPlatform;
|
|
16220
|
+
context == null || (_context_setWhen = context.setWhen) === null || _context_setWhen === void 0 || _context_setWhen.call(context, null), context == null || (_context_setPlatform = context.setPlatform) === null || _context_setPlatform === void 0 || _context_setPlatform.call(context, null);
|
|
16149
16221
|
};
|
|
16150
16222
|
}, []);
|
|
16151
16223
|
var output;
|
|
@@ -24344,6 +24416,7 @@ var require_Popper_native = __commonJS({
|
|
|
24344
24416
|
placement,
|
|
24345
24417
|
sameScrollView: !1,
|
|
24346
24418
|
// this only takes effect on native
|
|
24419
|
+
whileElementsMounted: import_floating.autoUpdate,
|
|
24347
24420
|
platform: disableRTL ?? setupOptions.disableRTL ? {
|
|
24348
24421
|
...import_floating.platform,
|
|
24349
24422
|
isRTL(element) {
|
|
@@ -24359,12 +24432,7 @@ var require_Popper_native = __commonJS({
|
|
|
24359
24432
|
typeof offsetOptions < "u" ? (0, import_floating.offset)(offsetOptions) : null,
|
|
24360
24433
|
checkFloating
|
|
24361
24434
|
].filter(Boolean)
|
|
24362
|
-
}), {
|
|
24363
|
-
refs,
|
|
24364
|
-
middlewareData,
|
|
24365
|
-
// @ts-expect-error this comes from Tooltip for example
|
|
24366
|
-
open
|
|
24367
|
-
} = floating, dimensions = (0, import_react_native4.useWindowDimensions)(), [keyboardOpen, setKeyboardOpen] = React4.useState(!1);
|
|
24435
|
+
}), { middlewareData } = floating, dimensions = (0, import_react_native4.useWindowDimensions)(), [keyboardOpen, setKeyboardOpen] = React4.useState(!1);
|
|
24368
24436
|
React4.useEffect(function() {
|
|
24369
24437
|
var showSubscription = import_react_native4.Keyboard.addListener("keyboardDidShow", function() {
|
|
24370
24438
|
(0, import_start_transition.startTransition)(function() {
|
|
@@ -24476,6 +24544,9 @@ var require_Popper_native = __commonJS({
|
|
|
24476
24544
|
};
|
|
24477
24545
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
|
|
24478
24546
|
...getFloatingProps ? getFloatingProps(frameProps) : frameProps,
|
|
24547
|
+
...x === 0 && y === 0 ? {
|
|
24548
|
+
opacity: 0
|
|
24549
|
+
} : {},
|
|
24479
24550
|
children: contents
|
|
24480
24551
|
});
|
|
24481
24552
|
}), PopperArrowFrame = (0, import_core12.styled)(import_stacks3.YStack, {
|
|
@@ -29855,12 +29926,18 @@ var require_Toggle_native = __commonJS({
|
|
|
29855
29926
|
},
|
|
29856
29927
|
ToggleFrame: function() {
|
|
29857
29928
|
return ToggleFrame;
|
|
29929
|
+
},
|
|
29930
|
+
context: function() {
|
|
29931
|
+
return context;
|
|
29858
29932
|
}
|
|
29859
29933
|
});
|
|
29860
29934
|
module2.exports = __toCommonJS2(Toggle_exports);
|
|
29861
|
-
var import_jsx_runtime6 = require("react/jsx-runtime"), import_helpers = require_index_native7(), import_stacks3 = require_index_native22(), import_use_controllable_state = require_index_native10(), import_web = require_index_native14(), React4 = __toESM2(require("react")),
|
|
29935
|
+
var import_jsx_runtime6 = require("react/jsx-runtime"), import_helpers = require_index_native7(), import_stacks3 = require_index_native22(), import_use_controllable_state = require_index_native10(), import_web = require_index_native14(), React4 = __toESM2(require("react")), context = (0, import_web.createStyledContext)({
|
|
29936
|
+
color: ""
|
|
29937
|
+
}), NAME = "Toggle", ToggleFrame = (0, import_web.styled)(import_stacks3.ThemeableStack, {
|
|
29862
29938
|
name: NAME,
|
|
29863
29939
|
tag: "button",
|
|
29940
|
+
context,
|
|
29864
29941
|
variants: {
|
|
29865
29942
|
unstyled: {
|
|
29866
29943
|
false: {
|
|
@@ -29888,6 +29965,11 @@ var require_Toggle_native = __commonJS({
|
|
|
29888
29965
|
}
|
|
29889
29966
|
}
|
|
29890
29967
|
},
|
|
29968
|
+
color: {
|
|
29969
|
+
"...color": function() {
|
|
29970
|
+
return {};
|
|
29971
|
+
}
|
|
29972
|
+
},
|
|
29891
29973
|
active: {
|
|
29892
29974
|
true: {
|
|
29893
29975
|
zIndex: 1,
|
|
@@ -29995,7 +30077,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
29995
30077
|
});
|
|
29996
30078
|
module2.exports = __toCommonJS2(ToggleGroup_exports);
|
|
29997
30079
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_focusable2 = require_index_native45(), import_font_size = require_index_native41(), import_get_token2 = require_index_native20(), import_group = require_index_native51(), import_helpers = require_index_native7(), import_helpers_tamagui = require_index_native42(), import_roving_focus = require_index_native60(), import_use_controllable_state = require_index_native10(), import_use_direction = require_index_native25(), import_web = require_index_native14(), import_react3 = __toESM2(require("react")), import_Toggle = require_Toggle_native(), TOGGLE_GROUP_NAME = "ToggleGroup", TOGGLE_GROUP_ITEM_NAME = "ToggleGroupItem", TOGGLE_GROUP_CONTEXT = "ToggleGroup", { Provider: ToggleGroupItemProvider, useStyledContext: useToggleGroupItemContext } = (0, import_web.createStyledContext)(), { Provider: ToggleGroupContext, useStyledContext: useToggleGroupContext } = (0, import_web.createStyledContext)(), ToggleGroupItem = import_Toggle.ToggleFrame.extractable(/* @__PURE__ */ import_react3.default.forwardRef(function(props, forwardedRef) {
|
|
29998
|
-
var { disablePassStyles, ...rest } = props, valueContext = useToggleGroupValueContext(props.__scopeToggleGroup), context = useToggleGroupContext(props.__scopeToggleGroup), pressed = valueContext == null ? void 0 : valueContext.value.includes(props.value), disabled = context.disabled || props.disabled || !1, groupItemProps = (0, import_group.useGroupItem)({
|
|
30080
|
+
var [_, { color }] = (0, import_web.usePropsAndStyle)(props), { disablePassStyles, ...rest } = props, valueContext = useToggleGroupValueContext(props.__scopeToggleGroup), context = useToggleGroupContext(props.__scopeToggleGroup), pressed = valueContext == null ? void 0 : valueContext.value.includes(props.value), disabled = context.disabled || props.disabled || !1, groupItemProps = (0, import_group.useGroupItem)({
|
|
29999
30081
|
disabled
|
|
30000
30082
|
}), _props_size, size4 = (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : context.size, sizeProps = props.unstyled ? {} : {
|
|
30001
30083
|
width: void 0,
|
|
@@ -30003,7 +30085,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30003
30085
|
padding: (0, import_web.getVariableValue)(size4) * 0.6
|
|
30004
30086
|
}, iconSize = (typeof size4 == "number" ? size4 * 0.7 : (0, import_font_size.getFontSize)(size4)) * 1.2, theme = (0, import_web.useTheme)(), getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
30005
30087
|
size: iconSize,
|
|
30006
|
-
color: theme.color
|
|
30088
|
+
color: color ?? theme.color
|
|
30007
30089
|
}), childrens = import_react3.default.Children.toArray(props.children), children = childrens.map(function(child) {
|
|
30008
30090
|
return props.disablePassStyles || !/* @__PURE__ */ import_react3.default.isValidElement(child) ? child : getThemedIcon(child);
|
|
30009
30091
|
}), commonProps = {
|
|
@@ -30015,7 +30097,8 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30015
30097
|
}, inner = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemImpl, {
|
|
30016
30098
|
...commonProps,
|
|
30017
30099
|
ref: forwardedRef,
|
|
30018
|
-
focusable
|
|
30100
|
+
// focusable={!disabled}
|
|
30101
|
+
tabIndex: disabled ? -1 : 0,
|
|
30019
30102
|
disabled,
|
|
30020
30103
|
...groupItemProps
|
|
30021
30104
|
});
|