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/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
|
},
|
|
@@ -3578,10 +3566,20 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3578
3566
|
}
|
|
3579
3567
|
}
|
|
3580
3568
|
]), ThemeManager2;
|
|
3581
|
-
}();
|
|
3569
|
+
}(), cache = {};
|
|
3582
3570
|
function getState(props, manager) {
|
|
3583
|
-
if (props.name && props.reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
|
|
3584
3571
|
if (!getHasThemeUpdatingProps(props)) return null;
|
|
3572
|
+
var [allManagers] = getManagers(manager), cacheKey = `${props.name || ""}${props.componentName || ""}${props.inverse || ""}${props.reset || ""}${allManagers.map(function(x) {
|
|
3573
|
+
return (x == null ? void 0 : x.state.name) || ".";
|
|
3574
|
+
}).join("")}`, cached = cache[cacheKey];
|
|
3575
|
+
if (!cached) {
|
|
3576
|
+
var res = getStateUncached(props, manager);
|
|
3577
|
+
return cache[cacheKey] = res, res;
|
|
3578
|
+
}
|
|
3579
|
+
return cached;
|
|
3580
|
+
}
|
|
3581
|
+
function getStateUncached(props, manager) {
|
|
3582
|
+
if (props.name && props.reset) throw new Error(process.env.NODE_ENV === "production" ? "\u274C004" : "Cannot reset and set a new name at the same time.");
|
|
3585
3583
|
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];
|
|
3586
3584
|
if (!baseManager && props.reset) return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
|
|
3587
3585
|
var { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
@@ -3948,73 +3946,61 @@ var require_useTheme_native = __commonJS({
|
|
|
3948
3946
|
process.env.NODE_ENV === "development" && (state != null && state.theme || process.env.TAMAGUI_DISABLE_NO_THEME_WARNING !== "1" && console.error(`[tamagui] No theme found, this could be due to an invalid theme name (given theme props ${JSON.stringify(props)}).
|
|
3949
3947
|
|
|
3950
3948
|
If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`));
|
|
3951
|
-
var themeProxied = (
|
|
3952
|
-
return keys.current && (keys.current = null), !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, keys, themeManager, props.debug);
|
|
3953
|
-
}, [
|
|
3954
|
-
state == null ? void 0 : state.theme,
|
|
3955
|
-
themeManager,
|
|
3956
|
-
props.deopt,
|
|
3957
|
-
props.debug
|
|
3958
|
-
]);
|
|
3949
|
+
var themeProxied = getThemeProxied(props, state, keys, themeManager);
|
|
3959
3950
|
return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(` \u{1F539} [${themeManager == null ? void 0 : themeManager.id}] useTheme =>`, state == null ? void 0 : state.name), console.info("returning state", changedThemeState.state, changedThemeState.isNewTheme, "from props", props), console.groupEnd()), [
|
|
3960
3951
|
changedThemeState,
|
|
3961
3952
|
themeProxied
|
|
3962
3953
|
];
|
|
3963
|
-
};
|
|
3964
|
-
function getThemeProxied(
|
|
3965
|
-
var
|
|
3966
|
-
if (!theme) return
|
|
3967
|
-
|
|
3954
|
+
}, emptyObject = {}, ProxiedThemes = /* @__PURE__ */ new Map(), curKeys, curProps, curThemeManger;
|
|
3955
|
+
function getThemeProxied(_props, state, _keys, _themeManager) {
|
|
3956
|
+
var theme = state == null ? void 0 : state.theme;
|
|
3957
|
+
if (!theme || !_themeManager) return emptyObject;
|
|
3958
|
+
if (curKeys = _keys, curProps = _props, curThemeManger = _themeManager, ProxiedThemes.has(theme)) {
|
|
3959
|
+
var proxied = ProxiedThemes.get(theme);
|
|
3960
|
+
return proxied;
|
|
3961
|
+
}
|
|
3962
|
+
var { name, scheme } = state, config = (0, import_config.getConfig)();
|
|
3968
3963
|
function track(key) {
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
[scheme]: color,
|
|
3996
|
-
[oppositeScheme]: oppositeColor
|
|
3997
|
-
}
|
|
3998
|
-
};
|
|
3999
|
-
return dynamicVal;
|
|
4000
|
-
}
|
|
4001
|
-
return process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
|
|
4002
|
-
not web: ${platform2 !== "web"}
|
|
4003
|
-
isIOS: ${import_constants4.isIos}
|
|
4004
|
-
deopt: ${deopt}
|
|
4005
|
-
fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
|
|
4006
|
-
inversed: ${getIsInversed(themeManager)}
|
|
4007
|
-
`), track(keyString), outVal;
|
|
4008
|
-
};
|
|
4009
|
-
return Reflect.get(val, subkey);
|
|
4010
|
-
}
|
|
4011
|
-
});
|
|
4012
|
-
if (process.env.NODE_ENV === "development" && process.env.TAMAGUI_FEAT_THROW_ON_MISSING_THEME_VALUE === "1") throw new Error(`[tamagui] No theme key "${key}" found in theme ${name}.
|
|
4013
|
-
Keys in theme: ${Object.keys(theme).join(", ")}`);
|
|
3964
|
+
curKeys && (curKeys.current || (curKeys.current = []), curKeys.current.push(key), process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
3965
|
+
}
|
|
3966
|
+
var proxied1 = Object.fromEntries(Object.entries(theme).flatMap(function(param) {
|
|
3967
|
+
var [key, value] = param, proxied2 = {
|
|
3968
|
+
...value,
|
|
3969
|
+
get val() {
|
|
3970
|
+
return globalThis.tamaguiAvoidTracking || track(key), value.val;
|
|
3971
|
+
},
|
|
3972
|
+
get(platform2) {
|
|
3973
|
+
var outVal = (0, import_createVariable.getVariable)(value);
|
|
3974
|
+
if (platform2 !== "web" && import_constants4.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && !(0, import_shouldDeoptDueToParentScheme.shouldDeoptDueToParentScheme)(curThemeManger) && scheme) {
|
|
3975
|
+
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 = {
|
|
3976
|
+
dynamic: {
|
|
3977
|
+
[scheme]: color,
|
|
3978
|
+
[oppositeScheme]: oppositeColor
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
return dynamicVal;
|
|
3982
|
+
}
|
|
3983
|
+
return process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key because of:
|
|
3984
|
+
not web: ${platform2 !== "web"}
|
|
3985
|
+
isIOS: ${import_constants4.isIos}
|
|
3986
|
+
deopt: ${curProps.deopt}
|
|
3987
|
+
fastScheme: ${(0, import_config.getSetting)("fastSchemeChange")}
|
|
3988
|
+
inversed: ${getIsInversed(curThemeManger)}
|
|
3989
|
+
`), track(key), outVal;
|
|
4014
3990
|
}
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
3991
|
+
};
|
|
3992
|
+
return [
|
|
3993
|
+
[
|
|
3994
|
+
key,
|
|
3995
|
+
proxied2
|
|
3996
|
+
],
|
|
3997
|
+
[
|
|
3998
|
+
`$${key}`,
|
|
3999
|
+
proxied2
|
|
4000
|
+
]
|
|
4001
|
+
];
|
|
4002
|
+
}));
|
|
4003
|
+
return ProxiedThemes.set(theme, proxied1), proxied1;
|
|
4018
4004
|
}
|
|
4019
4005
|
function getIsInversed(manager) {
|
|
4020
4006
|
for (var isInversed = !1, cur = manager; cur; ) {
|
|
@@ -9547,7 +9533,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
9547
9533
|
}
|
|
9548
9534
|
});
|
|
9549
9535
|
module2.exports = __toCommonJS2(proxyThemeToParents_exports);
|
|
9550
|
-
var
|
|
9536
|
+
var themesRaw = {};
|
|
9551
9537
|
function proxyThemesToParents(dedupedThemes) {
|
|
9552
9538
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
9553
9539
|
try {
|
|
@@ -9608,21 +9594,24 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
9608
9594
|
return themes;
|
|
9609
9595
|
}
|
|
9610
9596
|
function proxyThemeToParents(themeName, theme) {
|
|
9611
|
-
var cur = [], parents = themeName.split("_").slice(0, -1).map(function(part) {
|
|
9597
|
+
var out = {}, cur = [], parents = themeName.split("_").slice(0, -1).map(function(part) {
|
|
9612
9598
|
return cur.push(part), cur.join("_");
|
|
9613
|
-
}),
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
key == "undefined" || Reflect.has(target, key)) return Reflect.get(target, key);
|
|
9619
|
-
for (var i = numParents - 1; i >= 0; i--) {
|
|
9620
|
-
var parent = themesRaw[parents[i]];
|
|
9621
|
-
if (parent && Reflect.has(parent, key)) return Reflect.get(parent, key);
|
|
9622
|
-
}
|
|
9623
|
-
return (0, import_config.getTokenObject)(key);
|
|
9599
|
+
}), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
9600
|
+
try {
|
|
9601
|
+
for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
9602
|
+
var parent = _step.value;
|
|
9603
|
+
Object.assign(out, themesRaw[parent]);
|
|
9624
9604
|
}
|
|
9625
|
-
})
|
|
9605
|
+
} catch (err) {
|
|
9606
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
9607
|
+
} finally {
|
|
9608
|
+
try {
|
|
9609
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
9610
|
+
} finally {
|
|
9611
|
+
if (_didIteratorError) throw _iteratorError;
|
|
9612
|
+
}
|
|
9613
|
+
}
|
|
9614
|
+
return Object.assign(out, theme), out;
|
|
9626
9615
|
}
|
|
9627
9616
|
}
|
|
9628
9617
|
});
|
|
@@ -13962,6 +13951,86 @@ var require_Pressability_native = __commonJS({
|
|
|
13962
13951
|
}
|
|
13963
13952
|
});
|
|
13964
13953
|
|
|
13954
|
+
// ../../core/core/dist/cjs/addNativeValidStyles.native.js
|
|
13955
|
+
var require_addNativeValidStyles_native = __commonJS({
|
|
13956
|
+
"../../core/core/dist/cjs/addNativeValidStyles.native.js"(exports2, module2) {
|
|
13957
|
+
"use strict";
|
|
13958
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
13959
|
+
for (var name in all) __defProp2(target, name, {
|
|
13960
|
+
get: all[name],
|
|
13961
|
+
enumerable: !0
|
|
13962
|
+
});
|
|
13963
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
13964
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
13965
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
13966
|
+
for (var _loop = function() {
|
|
13967
|
+
var key = _step.value;
|
|
13968
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
13969
|
+
get: function() {
|
|
13970
|
+
return from[key];
|
|
13971
|
+
},
|
|
13972
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
13973
|
+
});
|
|
13974
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
13975
|
+
} catch (err) {
|
|
13976
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
13977
|
+
} finally {
|
|
13978
|
+
try {
|
|
13979
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
13980
|
+
} finally {
|
|
13981
|
+
if (_didIteratorError)
|
|
13982
|
+
throw _iteratorError;
|
|
13983
|
+
}
|
|
13984
|
+
}
|
|
13985
|
+
return to;
|
|
13986
|
+
}, __toCommonJS2 = function(mod) {
|
|
13987
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
13988
|
+
value: !0
|
|
13989
|
+
}), mod);
|
|
13990
|
+
}, addNativeValidStyles_native_exports = {};
|
|
13991
|
+
__export2(addNativeValidStyles_native_exports, {
|
|
13992
|
+
addNativeValidStyles: function() {
|
|
13993
|
+
return addNativeValidStyles;
|
|
13994
|
+
}
|
|
13995
|
+
});
|
|
13996
|
+
module2.exports = __toCommonJS2(addNativeValidStyles_native_exports);
|
|
13997
|
+
var import_helpers = require_index_native7();
|
|
13998
|
+
function getReactNativeVersion() {
|
|
13999
|
+
var version = process.env.REACT_NATIVE_VERSION;
|
|
14000
|
+
if (!version) try {
|
|
14001
|
+
var ReactNativeOfficalVersion = require("react-native/Libraries/Core/ReactNativeVersion");
|
|
14002
|
+
if (ReactNativeOfficalVersion) {
|
|
14003
|
+
var { version: { major, minor, patch } } = ReactNativeOfficalVersion;
|
|
14004
|
+
version = `${major}.${minor}.${patch}`;
|
|
14005
|
+
}
|
|
14006
|
+
} catch {
|
|
14007
|
+
} finally {
|
|
14008
|
+
version || (version = "0.77");
|
|
14009
|
+
}
|
|
14010
|
+
var [major1, minor1, patch1] = version.split(".");
|
|
14011
|
+
return [
|
|
14012
|
+
+major1,
|
|
14013
|
+
+minor1,
|
|
14014
|
+
+patch1
|
|
14015
|
+
];
|
|
14016
|
+
}
|
|
14017
|
+
function addNativeValidStyles() {
|
|
14018
|
+
var [major, minor] = getReactNativeVersion();
|
|
14019
|
+
if (major === 0 && minor >= 77) {
|
|
14020
|
+
var additional = {
|
|
14021
|
+
boxSizing: !0,
|
|
14022
|
+
mixBlendMode: !0,
|
|
14023
|
+
outlineWidth: !0,
|
|
14024
|
+
outlineStyle: !0,
|
|
14025
|
+
outlineSpread: !0,
|
|
14026
|
+
outlineColor: !0
|
|
14027
|
+
};
|
|
14028
|
+
Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
|
|
14029
|
+
}
|
|
14030
|
+
}
|
|
14031
|
+
}
|
|
14032
|
+
});
|
|
14033
|
+
|
|
13965
14034
|
// ../../core/core/dist/cjs/reactNativeTypes.native.js
|
|
13966
14035
|
var require_reactNativeTypes_native = __commonJS({
|
|
13967
14036
|
"../../core/core/dist/cjs/reactNativeTypes.native.js"(exports2, module2) {
|
|
@@ -14064,9 +14133,10 @@ var require_index_native18 = __commonJS({
|
|
|
14064
14133
|
}
|
|
14065
14134
|
});
|
|
14066
14135
|
module2.exports = __toCommonJS2(index_exports2);
|
|
14067
|
-
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();
|
|
14136
|
+
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();
|
|
14068
14137
|
__reExport2(index_exports2, require_index_native14(), module2.exports);
|
|
14069
14138
|
__reExport2(index_exports2, require_reactNativeTypes_native(), module2.exports);
|
|
14139
|
+
(0, import_addNativeValidStyles.addNativeValidStyles)();
|
|
14070
14140
|
var createTamagui2 = function(conf) {
|
|
14071
14141
|
return conf.media && (conf.media = (0, import_react_native_media_driver.createMedia)(conf.media)), (0, import_web.createTamagui)(conf);
|
|
14072
14142
|
}, baseViews = (0, import_getBaseViews.getBaseViews)();
|
|
@@ -16772,8 +16842,8 @@ var require_Adapt_native = __commonJS({
|
|
|
16772
16842
|
enabled
|
|
16773
16843
|
]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
16774
16844
|
return function() {
|
|
16775
|
-
var _context_setWhen;
|
|
16776
|
-
context == null || (_context_setWhen = context.setWhen) === null || _context_setWhen === void 0 || _context_setWhen.call(context, null);
|
|
16845
|
+
var _context_setWhen, _context_setPlatform;
|
|
16846
|
+
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);
|
|
16777
16847
|
};
|
|
16778
16848
|
}, []);
|
|
16779
16849
|
var output;
|
|
@@ -25075,6 +25145,7 @@ var require_Popper_native = __commonJS({
|
|
|
25075
25145
|
placement,
|
|
25076
25146
|
sameScrollView: !1,
|
|
25077
25147
|
// this only takes effect on native
|
|
25148
|
+
whileElementsMounted: import_floating.autoUpdate,
|
|
25078
25149
|
platform: disableRTL ?? setupOptions.disableRTL ? {
|
|
25079
25150
|
...import_floating.platform,
|
|
25080
25151
|
isRTL(element) {
|
|
@@ -25090,12 +25161,7 @@ var require_Popper_native = __commonJS({
|
|
|
25090
25161
|
typeof offsetOptions < "u" ? (0, import_floating.offset)(offsetOptions) : null,
|
|
25091
25162
|
checkFloating
|
|
25092
25163
|
].filter(Boolean)
|
|
25093
|
-
}), {
|
|
25094
|
-
refs,
|
|
25095
|
-
middlewareData,
|
|
25096
|
-
// @ts-expect-error this comes from Tooltip for example
|
|
25097
|
-
open
|
|
25098
|
-
} = floating, dimensions = (0, import_react_native4.useWindowDimensions)(), [keyboardOpen, setKeyboardOpen] = React4.useState(!1);
|
|
25164
|
+
}), { middlewareData } = floating, dimensions = (0, import_react_native4.useWindowDimensions)(), [keyboardOpen, setKeyboardOpen] = React4.useState(!1);
|
|
25099
25165
|
React4.useEffect(function() {
|
|
25100
25166
|
var showSubscription = import_react_native4.Keyboard.addListener("keyboardDidShow", function() {
|
|
25101
25167
|
(0, import_start_transition.startTransition)(function() {
|
|
@@ -25207,6 +25273,9 @@ var require_Popper_native = __commonJS({
|
|
|
25207
25273
|
};
|
|
25208
25274
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
|
|
25209
25275
|
...getFloatingProps ? getFloatingProps(frameProps) : frameProps,
|
|
25276
|
+
...x === 0 && y === 0 ? {
|
|
25277
|
+
opacity: 0
|
|
25278
|
+
} : {},
|
|
25210
25279
|
children: contents
|
|
25211
25280
|
});
|
|
25212
25281
|
}), PopperArrowFrame = (0, import_core12.styled)(import_stacks3.YStack, {
|
|
@@ -30591,12 +30660,18 @@ var require_Toggle_native = __commonJS({
|
|
|
30591
30660
|
},
|
|
30592
30661
|
ToggleFrame: function() {
|
|
30593
30662
|
return ToggleFrame;
|
|
30663
|
+
},
|
|
30664
|
+
context: function() {
|
|
30665
|
+
return context;
|
|
30594
30666
|
}
|
|
30595
30667
|
});
|
|
30596
30668
|
module2.exports = __toCommonJS2(Toggle_exports);
|
|
30597
|
-
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")),
|
|
30669
|
+
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)({
|
|
30670
|
+
color: ""
|
|
30671
|
+
}), NAME = "Toggle", ToggleFrame = (0, import_web.styled)(import_stacks3.ThemeableStack, {
|
|
30598
30672
|
name: NAME,
|
|
30599
30673
|
tag: "button",
|
|
30674
|
+
context,
|
|
30600
30675
|
variants: {
|
|
30601
30676
|
unstyled: {
|
|
30602
30677
|
false: {
|
|
@@ -30624,6 +30699,11 @@ var require_Toggle_native = __commonJS({
|
|
|
30624
30699
|
}
|
|
30625
30700
|
}
|
|
30626
30701
|
},
|
|
30702
|
+
color: {
|
|
30703
|
+
"...color": function() {
|
|
30704
|
+
return {};
|
|
30705
|
+
}
|
|
30706
|
+
},
|
|
30627
30707
|
active: {
|
|
30628
30708
|
true: {
|
|
30629
30709
|
zIndex: 1,
|
|
@@ -30731,7 +30811,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30731
30811
|
});
|
|
30732
30812
|
module2.exports = __toCommonJS2(ToggleGroup_exports);
|
|
30733
30813
|
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) {
|
|
30734
|
-
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)({
|
|
30814
|
+
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)({
|
|
30735
30815
|
disabled
|
|
30736
30816
|
}), _props_size, size4 = (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : context.size, sizeProps = props.unstyled ? {} : {
|
|
30737
30817
|
width: void 0,
|
|
@@ -30739,7 +30819,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30739
30819
|
padding: (0, import_web.getVariableValue)(size4) * 0.6
|
|
30740
30820
|
}, 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)({
|
|
30741
30821
|
size: iconSize,
|
|
30742
|
-
color: theme.color
|
|
30822
|
+
color: color ?? theme.color
|
|
30743
30823
|
}), childrens = import_react3.default.Children.toArray(props.children), children = childrens.map(function(child) {
|
|
30744
30824
|
return props.disablePassStyles || !/* @__PURE__ */ import_react3.default.isValidElement(child) ? child : getThemedIcon(child);
|
|
30745
30825
|
}), commonProps = {
|
|
@@ -30751,7 +30831,8 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30751
30831
|
}, inner = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemImpl, {
|
|
30752
30832
|
...commonProps,
|
|
30753
30833
|
ref: forwardedRef,
|
|
30754
|
-
focusable
|
|
30834
|
+
// focusable={!disabled}
|
|
30835
|
+
tabIndex: disabled ? -1 : 0,
|
|
30755
30836
|
disabled,
|
|
30756
30837
|
...groupItemProps
|
|
30757
30838
|
});
|