tamagui 1.122.8 → 1.123.0
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 +168 -105
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +162 -97
- 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,7 @@ 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"), isWeb6 = !1, isWindowDefined = !1, isServer2 = !1, isClient2 = !1, useIsomorphicLayoutEffect2 = import_react3.useLayoutEffect, isChrome2 = !1, isWebTouchable2 = !1, isTouchable2 = !0, isAndroid = !1, isIos = process.env.TEST_NATIVE_PLATFORM === "ios", currentPlatform = "native";
|
|
1200
1188
|
}
|
|
1201
1189
|
});
|
|
1202
1190
|
|
|
@@ -1362,9 +1350,6 @@ var require_validStyleProps_native = __commonJS({
|
|
|
1362
1350
|
stylePropsAll: function() {
|
|
1363
1351
|
return stylePropsAll;
|
|
1364
1352
|
},
|
|
1365
|
-
stylePropsFont: function() {
|
|
1366
|
-
return stylePropsFont;
|
|
1367
|
-
},
|
|
1368
1353
|
stylePropsText: function() {
|
|
1369
1354
|
return stylePropsText;
|
|
1370
1355
|
},
|
|
@@ -3742,65 +3727,55 @@ var require_useTheme_native = __commonJS({
|
|
|
3742
3727
|
var props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : emptyProps, [_, theme] = useThemeWithState(props), res = theme;
|
|
3743
3728
|
return res;
|
|
3744
3729
|
}, 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
|
-
]);
|
|
3730
|
+
var keys = (0, import_react3.useRef)(null), changedThemeState = useChangeThemeEffect(props, !1, keys), { themeManager, state } = changedThemeState, themeProxied = getThemeProxied(props, state, keys, themeManager);
|
|
3753
3731
|
return [
|
|
3754
3732
|
changedThemeState,
|
|
3755
3733
|
themeProxied
|
|
3756
3734
|
];
|
|
3757
|
-
};
|
|
3758
|
-
function getThemeProxied(
|
|
3759
|
-
var
|
|
3760
|
-
if (!theme) return
|
|
3761
|
-
|
|
3735
|
+
}, emptyObject = {}, ProxiedThemes = /* @__PURE__ */ new Map(), curKeys, curProps, curThemeManger;
|
|
3736
|
+
function getThemeProxied(_props, state, _keys, _themeManager) {
|
|
3737
|
+
var theme = state == null ? void 0 : state.theme;
|
|
3738
|
+
if (!theme || !_themeManager) return emptyObject;
|
|
3739
|
+
if (curKeys = _keys, curProps = _props, curThemeManger = _themeManager, ProxiedThemes.has(theme)) {
|
|
3740
|
+
var proxied = ProxiedThemes.get(theme);
|
|
3741
|
+
return proxied;
|
|
3742
|
+
}
|
|
3743
|
+
var { name, scheme } = state, config = (0, import_config.getConfig)();
|
|
3762
3744
|
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
|
-
});
|
|
3745
|
+
curKeys && (curKeys.current || (curKeys.current = []), curKeys.current.push(key));
|
|
3746
|
+
}
|
|
3747
|
+
var proxied1 = Object.fromEntries(Object.entries(theme).flatMap(function(param) {
|
|
3748
|
+
var [key, value] = param, proxied2 = {
|
|
3749
|
+
...value,
|
|
3750
|
+
get val() {
|
|
3751
|
+
return globalThis.tamaguiAvoidTracking || track(key), value.val;
|
|
3752
|
+
},
|
|
3753
|
+
get(platform2) {
|
|
3754
|
+
var outVal = (0, import_createVariable.getVariable)(value);
|
|
3755
|
+
if (platform2 !== "web" && import_constants4.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && !(0, import_shouldDeoptDueToParentScheme.shouldDeoptDueToParentScheme)(curThemeManger) && scheme) {
|
|
3756
|
+
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 = {
|
|
3757
|
+
dynamic: {
|
|
3758
|
+
[scheme]: color,
|
|
3759
|
+
[oppositeScheme]: oppositeColor
|
|
3760
|
+
}
|
|
3761
|
+
};
|
|
3762
|
+
return dynamicVal;
|
|
3763
|
+
}
|
|
3764
|
+
return track(key), outVal;
|
|
3800
3765
|
}
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3766
|
+
};
|
|
3767
|
+
return [
|
|
3768
|
+
[
|
|
3769
|
+
key,
|
|
3770
|
+
proxied2
|
|
3771
|
+
],
|
|
3772
|
+
[
|
|
3773
|
+
`$${key}`,
|
|
3774
|
+
proxied2
|
|
3775
|
+
]
|
|
3776
|
+
];
|
|
3777
|
+
}));
|
|
3778
|
+
return ProxiedThemes.set(theme, proxied1), proxied1;
|
|
3804
3779
|
}
|
|
3805
3780
|
var activeThemeManagers = /* @__PURE__ */ new Set(), _uidToManager = /* @__PURE__ */ new WeakMap(), _idToUID = {}, getId = function(id) {
|
|
3806
3781
|
return _idToUID[id];
|
|
@@ -8938,7 +8913,7 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
8938
8913
|
}
|
|
8939
8914
|
});
|
|
8940
8915
|
module2.exports = __toCommonJS2(proxyThemeToParents_exports);
|
|
8941
|
-
var
|
|
8916
|
+
var themesRaw = {};
|
|
8942
8917
|
function proxyThemesToParents(dedupedThemes) {
|
|
8943
8918
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8944
8919
|
try {
|
|
@@ -8999,21 +8974,24 @@ var require_proxyThemeToParents_native = __commonJS({
|
|
|
8999
8974
|
return themes;
|
|
9000
8975
|
}
|
|
9001
8976
|
function proxyThemeToParents(themeName, theme) {
|
|
9002
|
-
var cur = [], parents = themeName.split("_").slice(0, -1).map(function(part) {
|
|
8977
|
+
var out = {}, cur = [], parents = themeName.split("_").slice(0, -1).map(function(part) {
|
|
9003
8978
|
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);
|
|
8979
|
+
}), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
8980
|
+
try {
|
|
8981
|
+
for (var _iterator = parents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
8982
|
+
var parent = _step.value;
|
|
8983
|
+
Object.assign(out, themesRaw[parent]);
|
|
9015
8984
|
}
|
|
9016
|
-
})
|
|
8985
|
+
} catch (err) {
|
|
8986
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
8987
|
+
} finally {
|
|
8988
|
+
try {
|
|
8989
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
8990
|
+
} finally {
|
|
8991
|
+
if (_didIteratorError) throw _iteratorError;
|
|
8992
|
+
}
|
|
8993
|
+
}
|
|
8994
|
+
return Object.assign(out, theme), out;
|
|
9017
8995
|
}
|
|
9018
8996
|
}
|
|
9019
8997
|
});
|
|
@@ -13345,6 +13323,81 @@ var require_Pressability_native = __commonJS({
|
|
|
13345
13323
|
}
|
|
13346
13324
|
});
|
|
13347
13325
|
|
|
13326
|
+
// ../../core/core/dist/cjs/addNativeValidStyles.native.js
|
|
13327
|
+
var require_addNativeValidStyles_native = __commonJS({
|
|
13328
|
+
"../../core/core/dist/cjs/addNativeValidStyles.native.js"(exports2, module2) {
|
|
13329
|
+
"use strict";
|
|
13330
|
+
var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
|
|
13331
|
+
for (var name in all) __defProp2(target, name, {
|
|
13332
|
+
get: all[name],
|
|
13333
|
+
enumerable: !0
|
|
13334
|
+
});
|
|
13335
|
+
}, __copyProps2 = function(to, from, except, desc) {
|
|
13336
|
+
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
13337
|
+
if (from && typeof from == "object" || typeof from == "function") try {
|
|
13338
|
+
for (var _loop = function() {
|
|
13339
|
+
var key = _step.value;
|
|
13340
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
|
|
13341
|
+
get: function() {
|
|
13342
|
+
return from[key];
|
|
13343
|
+
},
|
|
13344
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
13345
|
+
});
|
|
13346
|
+
}, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
|
|
13347
|
+
} catch (err) {
|
|
13348
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
13349
|
+
} finally {
|
|
13350
|
+
try {
|
|
13351
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
13352
|
+
} finally {
|
|
13353
|
+
if (_didIteratorError)
|
|
13354
|
+
throw _iteratorError;
|
|
13355
|
+
}
|
|
13356
|
+
}
|
|
13357
|
+
return to;
|
|
13358
|
+
}, __toESM2 = function(mod, isNodeMode, target) {
|
|
13359
|
+
return target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
13360
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
13361
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
13362
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
13363
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
13364
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
|
|
13365
|
+
value: mod,
|
|
13366
|
+
enumerable: !0
|
|
13367
|
+
}) : target,
|
|
13368
|
+
mod
|
|
13369
|
+
);
|
|
13370
|
+
}, __toCommonJS2 = function(mod) {
|
|
13371
|
+
return __copyProps2(__defProp2({}, "__esModule", {
|
|
13372
|
+
value: !0
|
|
13373
|
+
}), mod);
|
|
13374
|
+
}, addNativeValidStyles_native_exports = {};
|
|
13375
|
+
__export2(addNativeValidStyles_native_exports, {
|
|
13376
|
+
addNativeValidStyles: function() {
|
|
13377
|
+
return addNativeValidStyles;
|
|
13378
|
+
}
|
|
13379
|
+
});
|
|
13380
|
+
module2.exports = __toCommonJS2(addNativeValidStyles_native_exports);
|
|
13381
|
+
var import_helpers = require_index_native7(), import_ReactNativeVersion = __toESM2(require("react-native/Libraries/Core/ReactNativeVersion"));
|
|
13382
|
+
function addNativeValidStyles() {
|
|
13383
|
+
if (import_ReactNativeVersion.default) {
|
|
13384
|
+
var { version: { major, minor } } = import_ReactNativeVersion.default;
|
|
13385
|
+
if (major === 0 && minor >= 77) {
|
|
13386
|
+
var additional = {
|
|
13387
|
+
boxSizing: !0,
|
|
13388
|
+
mixBlendMode: !0,
|
|
13389
|
+
outlineWidth: !0,
|
|
13390
|
+
outlineStyle: !0,
|
|
13391
|
+
outlineSpread: !0,
|
|
13392
|
+
outlineColor: !0
|
|
13393
|
+
};
|
|
13394
|
+
Object.assign(import_helpers.validStyles, additional), Object.assign(import_helpers.stylePropsAll, additional);
|
|
13395
|
+
}
|
|
13396
|
+
}
|
|
13397
|
+
}
|
|
13398
|
+
}
|
|
13399
|
+
});
|
|
13400
|
+
|
|
13348
13401
|
// ../../core/core/dist/cjs/reactNativeTypes.native.js
|
|
13349
13402
|
var require_reactNativeTypes_native = __commonJS({
|
|
13350
13403
|
"../../core/core/dist/cjs/reactNativeTypes.native.js"(exports2, module2) {
|
|
@@ -13447,9 +13500,10 @@ var require_index_native18 = __commonJS({
|
|
|
13447
13500
|
}
|
|
13448
13501
|
});
|
|
13449
13502
|
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();
|
|
13503
|
+
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
13504
|
__reExport2(index_exports2, require_index_native14(), module2.exports);
|
|
13452
13505
|
__reExport2(index_exports2, require_reactNativeTypes_native(), module2.exports);
|
|
13506
|
+
(0, import_addNativeValidStyles.addNativeValidStyles)();
|
|
13453
13507
|
var createTamagui2 = function(conf) {
|
|
13454
13508
|
return conf.media && (conf.media = (0, import_react_native_media_driver.createMedia)(conf.media)), (0, import_web.createTamagui)(conf);
|
|
13455
13509
|
}, baseViews = (0, import_getBaseViews.getBaseViews)();
|
|
@@ -16144,8 +16198,8 @@ var require_Adapt_native = __commonJS({
|
|
|
16144
16198
|
enabled
|
|
16145
16199
|
]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
16146
16200
|
return function() {
|
|
16147
|
-
var _context_setWhen;
|
|
16148
|
-
context == null || (_context_setWhen = context.setWhen) === null || _context_setWhen === void 0 || _context_setWhen.call(context, null);
|
|
16201
|
+
var _context_setWhen, _context_setPlatform;
|
|
16202
|
+
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
16203
|
};
|
|
16150
16204
|
}, []);
|
|
16151
16205
|
var output;
|
|
@@ -24344,6 +24398,7 @@ var require_Popper_native = __commonJS({
|
|
|
24344
24398
|
placement,
|
|
24345
24399
|
sameScrollView: !1,
|
|
24346
24400
|
// this only takes effect on native
|
|
24401
|
+
whileElementsMounted: import_floating.autoUpdate,
|
|
24347
24402
|
platform: disableRTL ?? setupOptions.disableRTL ? {
|
|
24348
24403
|
...import_floating.platform,
|
|
24349
24404
|
isRTL(element) {
|
|
@@ -24359,12 +24414,7 @@ var require_Popper_native = __commonJS({
|
|
|
24359
24414
|
typeof offsetOptions < "u" ? (0, import_floating.offset)(offsetOptions) : null,
|
|
24360
24415
|
checkFloating
|
|
24361
24416
|
].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);
|
|
24417
|
+
}), { middlewareData } = floating, dimensions = (0, import_react_native4.useWindowDimensions)(), [keyboardOpen, setKeyboardOpen] = React4.useState(!1);
|
|
24368
24418
|
React4.useEffect(function() {
|
|
24369
24419
|
var showSubscription = import_react_native4.Keyboard.addListener("keyboardDidShow", function() {
|
|
24370
24420
|
(0, import_start_transition.startTransition)(function() {
|
|
@@ -24476,6 +24526,9 @@ var require_Popper_native = __commonJS({
|
|
|
24476
24526
|
};
|
|
24477
24527
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
|
|
24478
24528
|
...getFloatingProps ? getFloatingProps(frameProps) : frameProps,
|
|
24529
|
+
...x === 0 && y === 0 ? {
|
|
24530
|
+
opacity: 0
|
|
24531
|
+
} : {},
|
|
24479
24532
|
children: contents
|
|
24480
24533
|
});
|
|
24481
24534
|
}), PopperArrowFrame = (0, import_core12.styled)(import_stacks3.YStack, {
|
|
@@ -29855,12 +29908,18 @@ var require_Toggle_native = __commonJS({
|
|
|
29855
29908
|
},
|
|
29856
29909
|
ToggleFrame: function() {
|
|
29857
29910
|
return ToggleFrame;
|
|
29911
|
+
},
|
|
29912
|
+
context: function() {
|
|
29913
|
+
return context;
|
|
29858
29914
|
}
|
|
29859
29915
|
});
|
|
29860
29916
|
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")),
|
|
29917
|
+
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)({
|
|
29918
|
+
color: ""
|
|
29919
|
+
}), NAME = "Toggle", ToggleFrame = (0, import_web.styled)(import_stacks3.ThemeableStack, {
|
|
29862
29920
|
name: NAME,
|
|
29863
29921
|
tag: "button",
|
|
29922
|
+
context,
|
|
29864
29923
|
variants: {
|
|
29865
29924
|
unstyled: {
|
|
29866
29925
|
false: {
|
|
@@ -29888,6 +29947,11 @@ var require_Toggle_native = __commonJS({
|
|
|
29888
29947
|
}
|
|
29889
29948
|
}
|
|
29890
29949
|
},
|
|
29950
|
+
color: {
|
|
29951
|
+
"...color": function() {
|
|
29952
|
+
return {};
|
|
29953
|
+
}
|
|
29954
|
+
},
|
|
29891
29955
|
active: {
|
|
29892
29956
|
true: {
|
|
29893
29957
|
zIndex: 1,
|
|
@@ -29995,7 +30059,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
29995
30059
|
});
|
|
29996
30060
|
module2.exports = __toCommonJS2(ToggleGroup_exports);
|
|
29997
30061
|
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)({
|
|
30062
|
+
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
30063
|
disabled
|
|
30000
30064
|
}), _props_size, size4 = (_props_size = props.size) !== null && _props_size !== void 0 ? _props_size : context.size, sizeProps = props.unstyled ? {} : {
|
|
30001
30065
|
width: void 0,
|
|
@@ -30003,7 +30067,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30003
30067
|
padding: (0, import_web.getVariableValue)(size4) * 0.6
|
|
30004
30068
|
}, 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
30069
|
size: iconSize,
|
|
30006
|
-
color: theme.color
|
|
30070
|
+
color: color ?? theme.color
|
|
30007
30071
|
}), childrens = import_react3.default.Children.toArray(props.children), children = childrens.map(function(child) {
|
|
30008
30072
|
return props.disablePassStyles || !/* @__PURE__ */ import_react3.default.isValidElement(child) ? child : getThemedIcon(child);
|
|
30009
30073
|
}), commonProps = {
|
|
@@ -30015,7 +30079,8 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30015
30079
|
}, inner = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemImpl, {
|
|
30016
30080
|
...commonProps,
|
|
30017
30081
|
ref: forwardedRef,
|
|
30018
|
-
focusable
|
|
30082
|
+
// focusable={!disabled}
|
|
30083
|
+
tabIndex: disabled ? -1 : 0,
|
|
30019
30084
|
disabled,
|
|
30020
30085
|
...groupItemProps
|
|
30021
30086
|
});
|