tamagui 1.132.14 → 1.132.15
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 +284 -284
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +274 -274
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/native.js
CHANGED
|
@@ -1070,9 +1070,9 @@ var require_clamp_native = __commonJS({
|
|
|
1070
1070
|
}
|
|
1071
1071
|
});
|
|
1072
1072
|
module2.exports = __toCommonJS2(clamp_exports);
|
|
1073
|
-
function clamp(
|
|
1073
|
+
function clamp(value, param) {
|
|
1074
1074
|
var [min, max] = param;
|
|
1075
|
-
return Math.min(max, Math.max(min,
|
|
1075
|
+
return Math.min(max, Math.max(min, value));
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
1078
|
});
|
|
@@ -2056,7 +2056,7 @@ var require_useControllableState_native = __commonJS({
|
|
|
2056
2056
|
return _();
|
|
2057
2057
|
};
|
|
2058
2058
|
function useControllableState(param) {
|
|
2059
|
-
var { prop, defaultProp, onChange, strategy = "prop-wins", preventUpdate, transition } = param, [state, setState] = React4.useState(prop ?? defaultProp), previous = React4.useRef(state), propWins = strategy === "prop-wins" && prop !== void 0,
|
|
2059
|
+
var { prop, defaultProp, onChange, strategy = "prop-wins", preventUpdate, transition } = param, [state, setState] = React4.useState(prop ?? defaultProp), previous = React4.useRef(state), propWins = strategy === "prop-wins" && prop !== void 0, value = propWins ? prop : state, onChangeCb = (0, import_use_event.useEvent)(onChange || idFn), transitionFn = transition ? import_start_transition.startTransition : emptyCallbackFn;
|
|
2060
2060
|
React4.useEffect(function() {
|
|
2061
2061
|
prop !== void 0 && (previous.current = prop, transitionFn(function() {
|
|
2062
2062
|
setState(prop);
|
|
@@ -2079,7 +2079,7 @@ var require_useControllableState_native = __commonJS({
|
|
|
2079
2079
|
});
|
|
2080
2080
|
});
|
|
2081
2081
|
return [
|
|
2082
|
-
|
|
2082
|
+
value,
|
|
2083
2083
|
setter
|
|
2084
2084
|
];
|
|
2085
2085
|
}
|
|
@@ -2388,22 +2388,22 @@ Haven't called createTamagui yet. ${import_constants22.MISSING_THEME_MESSAGE}
|
|
|
2388
2388
|
if (process.env.NODE_ENV === "development" && !conf) throw new Error(haventCalledErrorMessage);
|
|
2389
2389
|
var { tokens, tokensParsed } = conf;
|
|
2390
2390
|
return prefixed === !1 ? tokens : prefixed === !0 ? tokensParsed : tokensMerged;
|
|
2391
|
-
}, getTokenObject = function(
|
|
2391
|
+
}, getTokenObject = function(value, group) {
|
|
2392
2392
|
var _tokensMerged_group, _tokensMerged_, _conf_specificTokens_value;
|
|
2393
|
-
return (_conf_specificTokens_value = conf.specificTokens[
|
|
2394
|
-
return tokensMerged[cat][
|
|
2395
|
-
}) || ""]) === null || _tokensMerged_ === void 0 ? void 0 : _tokensMerged_[
|
|
2396
|
-
}, getToken3 = function(
|
|
2397
|
-
var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants4.isWeb, token = getTokenObject(
|
|
2393
|
+
return (_conf_specificTokens_value = conf.specificTokens[value]) !== null && _conf_specificTokens_value !== void 0 ? _conf_specificTokens_value : group ? (_tokensMerged_group = tokensMerged[group]) === null || _tokensMerged_group === void 0 ? void 0 : _tokensMerged_group[value] : (_tokensMerged_ = tokensMerged[Object.keys(tokensMerged).find(function(cat) {
|
|
2394
|
+
return tokensMerged[cat][value];
|
|
2395
|
+
}) || ""]) === null || _tokensMerged_ === void 0 ? void 0 : _tokensMerged_[value];
|
|
2396
|
+
}, getToken3 = function(value, group) {
|
|
2397
|
+
var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants4.isWeb, token = getTokenObject(value, group);
|
|
2398
2398
|
return useVariable ? token == null ? void 0 : token.variable : token == null ? void 0 : token.val;
|
|
2399
|
-
}, getTokenValue3 = function(
|
|
2400
|
-
if (!(
|
|
2399
|
+
}, getTokenValue3 = function(value, group) {
|
|
2400
|
+
if (!(value === "unset" || value === "auto")) return getToken3(value, group, !1);
|
|
2401
2401
|
}, useTokens = getTokens3, getThemes3 = function() {
|
|
2402
2402
|
return conf.themes;
|
|
2403
2403
|
}, configListeners = /* @__PURE__ */ new Set(), onConfiguredOnce = function(cb) {
|
|
2404
2404
|
conf ? cb(conf) : configListeners.add(cb);
|
|
2405
|
-
}, updateConfig2 = function(key,
|
|
2406
|
-
Object.assign(conf[key],
|
|
2405
|
+
}, updateConfig2 = function(key, value) {
|
|
2406
|
+
Object.assign(conf[key], value);
|
|
2407
2407
|
}, getFont = function(name) {
|
|
2408
2408
|
var _Object_entries_find, conf2 = getConfig3(), _conf_fontsParsed_name;
|
|
2409
2409
|
return (_conf_fontsParsed_name = conf2.fontsParsed[name]) !== null && _conf_fontsParsed_name !== void 0 ? _conf_fontsParsed_name : (_Object_entries_find = Object.entries(conf2.fontsParsed).find(function(param) {
|
|
@@ -2545,9 +2545,9 @@ var require_createVariable_native = __commonJS({
|
|
|
2545
2545
|
var name = (0, import_helpers.simpleHash)(nameProp, 60);
|
|
2546
2546
|
return includeVar ? constructCSSVariableName(name) : name;
|
|
2547
2547
|
};
|
|
2548
|
-
function px(
|
|
2548
|
+
function px(value) {
|
|
2549
2549
|
return {
|
|
2550
|
-
val:
|
|
2550
|
+
val: value,
|
|
2551
2551
|
needsPx: !0
|
|
2552
2552
|
};
|
|
2553
2553
|
}
|
|
@@ -2637,8 +2637,8 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2637
2637
|
process.env.NODE_ENV === "development" && console.error(`\u274C Invalid transform, likely used deg/% improperly ${identifier}`);
|
|
2638
2638
|
return;
|
|
2639
2639
|
}
|
|
2640
|
-
var startI = s + 10, endI = css.indexOf(";"),
|
|
2641
|
-
if (!insertedTransforms[identifier]) return insertedTransforms[identifier] =
|
|
2640
|
+
var startI = s + 10, endI = css.indexOf(";"), value = css.slice(startI, endI);
|
|
2641
|
+
if (!insertedTransforms[identifier]) return insertedTransforms[identifier] = value, !0;
|
|
2642
2642
|
}
|
|
2643
2643
|
var lastScannedSheets = null;
|
|
2644
2644
|
function scanAllSheets() {
|
|
@@ -2753,15 +2753,15 @@ var require_insertStyleRule_native = __commonJS({
|
|
|
2753
2753
|
if (sepI !== -1) {
|
|
2754
2754
|
var varIndex = rule.indexOf("--"), key1 = rule.slice(varIndex === -1 ? 0 : varIndex + 2, sepI);
|
|
2755
2755
|
process.env.TAMAGUI_CSS_VARIABLE_PREFIX && (key1 = key1.replace(process.env.TAMAGUI_CSS_VARIABLE_PREFIX, ""));
|
|
2756
|
-
var val = rule.slice(sepI + 2),
|
|
2756
|
+
var val = rule.slice(sepI + 2), value = void 0;
|
|
2757
2757
|
if (val[0] === "v" && val.startsWith("var(")) {
|
|
2758
2758
|
var varName = val.slice(6, -1), tokenVal = colorVarToVal[varName];
|
|
2759
|
-
tokenVal ?
|
|
2760
|
-
} else
|
|
2759
|
+
tokenVal ? value = tokenVal : (rootComputedStyle || (rootComputedStyle = getComputedStyle(document.body)), value = rootComputedStyle.getPropertyValue("--" + varName));
|
|
2760
|
+
} else value = val;
|
|
2761
2761
|
values[key1] = (0, import_createVariable.createVariable)({
|
|
2762
2762
|
key: key1,
|
|
2763
2763
|
name: key1,
|
|
2764
|
-
val:
|
|
2764
|
+
val: value
|
|
2765
2765
|
}, !0);
|
|
2766
2766
|
}
|
|
2767
2767
|
}
|
|
@@ -3295,8 +3295,8 @@ var require_useMedia_native = __commonJS({
|
|
|
3295
3295
|
if (typeof query == "string") return query;
|
|
3296
3296
|
if (cache.has(query)) return cache.get(query);
|
|
3297
3297
|
var res = Object.entries(query).map(function(param) {
|
|
3298
|
-
var [feature,
|
|
3299
|
-
return feature = camelToHyphen(feature), typeof
|
|
3298
|
+
var [feature, value] = param;
|
|
3299
|
+
return feature = camelToHyphen(feature), typeof value == "string" ? `(${feature}: ${value})` : (typeof value == "number" && /[height|width]$/.test(feature) && (value = `${value}px`), `(${feature}: ${value})`);
|
|
3300
3300
|
}).join(" and ");
|
|
3301
3301
|
return key && (cachedMediaKeyToQuery[key] = res), cache.set(query, res), res;
|
|
3302
3302
|
}
|
|
@@ -3387,13 +3387,13 @@ var require_Tamagui_native = __commonJS({
|
|
|
3387
3387
|
function _create_class(Constructor, protoProps, staticProps) {
|
|
3388
3388
|
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
3389
3389
|
}
|
|
3390
|
-
function _define_property(obj, key,
|
|
3390
|
+
function _define_property(obj, key, value) {
|
|
3391
3391
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
3392
|
-
value
|
|
3392
|
+
value,
|
|
3393
3393
|
enumerable: !0,
|
|
3394
3394
|
configurable: !0,
|
|
3395
3395
|
writable: !0
|
|
3396
|
-
}) : obj[key] =
|
|
3396
|
+
}) : obj[key] = value, obj;
|
|
3397
3397
|
}
|
|
3398
3398
|
var Tamagui = function() {
|
|
3399
3399
|
if (process.env.NODE_ENV === "development") {
|
|
@@ -3447,8 +3447,8 @@ var require_Tamagui_native = __commonJS({
|
|
|
3447
3447
|
}
|
|
3448
3448
|
}(), identifierToValue = /* @__PURE__ */ new Map(), getValueFromIdentifier = function(identifier) {
|
|
3449
3449
|
return identifierToValue.get(identifier);
|
|
3450
|
-
}, setIdentifierValue = function(identifier,
|
|
3451
|
-
identifierToValue.set(identifier,
|
|
3450
|
+
}, setIdentifierValue = function(identifier, value) {
|
|
3451
|
+
identifierToValue.set(identifier, value);
|
|
3452
3452
|
};
|
|
3453
3453
|
}
|
|
3454
3454
|
});
|
|
@@ -3515,8 +3515,8 @@ var require_compose_refs_native = __commonJS({
|
|
|
3515
3515
|
});
|
|
3516
3516
|
module2.exports = __toCommonJS2(compose_refs_exports);
|
|
3517
3517
|
var React4 = __toESM2(require("react"));
|
|
3518
|
-
function setRef(ref,
|
|
3519
|
-
typeof ref == "function" ? ref(
|
|
3518
|
+
function setRef(ref, value) {
|
|
3519
|
+
typeof ref == "function" ? ref(value) : ref && (ref.current = value);
|
|
3520
3520
|
}
|
|
3521
3521
|
function composeRefs() {
|
|
3522
3522
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) refs[_key] = arguments[_key];
|
|
@@ -3843,8 +3843,8 @@ var require_createStyledContext_native = __commonJS({
|
|
|
3843
3843
|
})
|
|
3844
3844
|
});
|
|
3845
3845
|
}, useStyledContext = function() {
|
|
3846
|
-
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = (0, import_react3.useContext)(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext,
|
|
3847
|
-
return
|
|
3846
|
+
var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", lastScopeInNamespace = (0, import_react3.useContext)(LastScopeInNamespace), scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn, context = scope ? getOrCreateScopedContext(scope) : OGContext, value = import_react3.default.useContext(context);
|
|
3847
|
+
return value;
|
|
3848
3848
|
};
|
|
3849
3849
|
return Context.Provider = Provider, Context.props = defaultValues, Context.context = OGContext, Context.useStyledContext = useStyledContext, Context;
|
|
3850
3850
|
}
|
|
@@ -5388,11 +5388,11 @@ var require_normalizeValueWithProperty_native = __commonJS({
|
|
|
5388
5388
|
translateX: !0,
|
|
5389
5389
|
translateY: !0
|
|
5390
5390
|
};
|
|
5391
|
-
function normalizeValueWithProperty(
|
|
5391
|
+
function normalizeValueWithProperty(value) {
|
|
5392
5392
|
var property = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
5393
|
-
if (!import_constants4.isWeb || import_helpers.stylePropsUnitless[property] || property && !stylePropsAllPlusTransforms[property] || typeof
|
|
5394
|
-
var res =
|
|
5395
|
-
return
|
|
5393
|
+
if (!import_constants4.isWeb || import_helpers.stylePropsUnitless[property] || property && !stylePropsAllPlusTransforms[property] || typeof value == "boolean") return value;
|
|
5394
|
+
var res = value;
|
|
5395
|
+
return value && typeof value == "object" ? value : (typeof value == "number" ? res = `${value}px` : property && (res = `${res}`), res);
|
|
5396
5396
|
}
|
|
5397
5397
|
}
|
|
5398
5398
|
});
|
|
@@ -5656,26 +5656,26 @@ var require_expandStyle_native = __commonJS({
|
|
|
5656
5656
|
return `${prefix}${k}`;
|
|
5657
5657
|
});
|
|
5658
5658
|
};
|
|
5659
|
-
function expandStyle(key,
|
|
5659
|
+
function expandStyle(key, value) {
|
|
5660
5660
|
if (import_constants4.isAndroid && key === "elevationAndroid") return [
|
|
5661
5661
|
[
|
|
5662
5662
|
"elevation",
|
|
5663
|
-
|
|
5663
|
+
value
|
|
5664
5664
|
]
|
|
5665
5665
|
];
|
|
5666
5666
|
if (key in EXPANSIONS) return EXPANSIONS[key].map(function(key2) {
|
|
5667
5667
|
return [
|
|
5668
5668
|
key2,
|
|
5669
|
-
|
|
5669
|
+
value
|
|
5670
5670
|
];
|
|
5671
5671
|
});
|
|
5672
5672
|
if (key in import_webToNativeProps.webToNativeExpansion) return import_webToNativeProps.webToNativeExpansion[key].map(function(key2) {
|
|
5673
5673
|
return [
|
|
5674
5674
|
key2,
|
|
5675
|
-
|
|
5675
|
+
value
|
|
5676
5676
|
];
|
|
5677
5677
|
});
|
|
5678
|
-
if (key in import_webToNativeProps.webToNativeDynamicExpansion) return import_webToNativeProps.webToNativeDynamicExpansion[key](
|
|
5678
|
+
if (key in import_webToNativeProps.webToNativeDynamicExpansion) return import_webToNativeProps.webToNativeDynamicExpansion[key](value);
|
|
5679
5679
|
}
|
|
5680
5680
|
var all = [
|
|
5681
5681
|
"Top",
|
|
@@ -5920,8 +5920,8 @@ var require_normalizeStyle_native = __commonJS({
|
|
|
5920
5920
|
res[key] = normalizeStyle(prop, disableNormalize);
|
|
5921
5921
|
continue;
|
|
5922
5922
|
}
|
|
5923
|
-
var
|
|
5924
|
-
out ? Object.assign(res, Object.fromEntries(out)) : res[key] =
|
|
5923
|
+
var value = disableNormalize ? prop : (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(prop, key), out = (0, import_expandStyle.expandStyle)(key, value);
|
|
5924
|
+
out ? Object.assign(res, Object.fromEntries(out)) : res[key] = value;
|
|
5925
5925
|
}
|
|
5926
5926
|
}
|
|
5927
5927
|
return (0, import_expandStyles.fixStyles)(res), res;
|
|
@@ -6140,18 +6140,18 @@ var require_propMapper_native = __commonJS({
|
|
|
6140
6140
|
}
|
|
6141
6141
|
});
|
|
6142
6142
|
module2.exports = __toCommonJS2(propMapper_exports);
|
|
6143
|
-
var import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_normalizeStyle = require_normalizeStyle_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), propMapper = function(key,
|
|
6144
|
-
if (disabled) return map(key,
|
|
6143
|
+
var import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_expandStyle = require_expandStyle_native(), import_getVariantExtras = require_getVariantExtras_native(), import_isObj = require_isObj_native(), import_normalizeStyle = require_normalizeStyle_native(), import_pseudoDescriptors = require_pseudoDescriptors_native(), import_skipProps = require_skipProps_native(), propMapper = function(key, value, styleState, disabled, map) {
|
|
6144
|
+
if (disabled) return map(key, value);
|
|
6145
6145
|
if (lastFontFamilyToken = null, !(!import_constants4.isAndroid && key === "elevationAndroid")) {
|
|
6146
6146
|
var { conf, styleProps, staticConfig } = styleState;
|
|
6147
|
-
if (
|
|
6147
|
+
if (value === "unset") {
|
|
6148
6148
|
var _conf_unset, unsetVal = (_conf_unset = conf.unset) === null || _conf_unset === void 0 ? void 0 : _conf_unset[key];
|
|
6149
|
-
if (unsetVal != null)
|
|
6149
|
+
if (unsetVal != null) value = unsetVal;
|
|
6150
6150
|
else return;
|
|
6151
6151
|
}
|
|
6152
6152
|
var { variants } = staticConfig;
|
|
6153
6153
|
if (!styleProps.noExpand && variants && key in variants) {
|
|
6154
|
-
var variantValue = resolveVariants(key,
|
|
6154
|
+
var variantValue = resolveVariants(key, value, styleProps, styleState, "");
|
|
6155
6155
|
if (variantValue) {
|
|
6156
6156
|
variantValue.forEach(function(param) {
|
|
6157
6157
|
var [_$key, _$value] = param;
|
|
@@ -6160,35 +6160,35 @@ var require_propMapper_native = __commonJS({
|
|
|
6160
6160
|
return;
|
|
6161
6161
|
}
|
|
6162
6162
|
}
|
|
6163
|
-
if (styleProps.disableExpandShorthands || key in conf.shorthands && (key = conf.shorthands[key]),
|
|
6163
|
+
if (styleProps.disableExpandShorthands || key in conf.shorthands && (key = conf.shorthands[key]), value != null && (value[0] === "$" ? value = getTokenForKey(key, value, styleProps, styleState) : (0, import_createVariable.isVariable)(value) && (value = resolveVariableValue(key, value, styleProps.resolveValues))), value != null) {
|
|
6164
6164
|
key === "fontFamily" && lastFontFamilyToken && (styleState.fontFamily = lastFontFamilyToken);
|
|
6165
|
-
var expanded = styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key,
|
|
6165
|
+
var expanded = styleProps.noExpand ? null : (0, import_expandStyle.expandStyle)(key, value);
|
|
6166
6166
|
if (expanded) for (var max = expanded.length, i = 0; i < max; i++) {
|
|
6167
6167
|
var [nkey, nvalue] = expanded[i];
|
|
6168
6168
|
map(nkey, nvalue);
|
|
6169
6169
|
}
|
|
6170
|
-
else map(key,
|
|
6170
|
+
else map(key, value);
|
|
6171
6171
|
}
|
|
6172
6172
|
}
|
|
6173
|
-
}, resolveVariants = function(key,
|
|
6173
|
+
}, resolveVariants = function(key, value, styleProps, styleState, parentVariantKey) {
|
|
6174
6174
|
var { staticConfig, conf, debug } = styleState, { variants } = staticConfig;
|
|
6175
6175
|
if (variants) {
|
|
6176
|
-
var variantValue = getVariantDefinition(variants[key],
|
|
6176
|
+
var variantValue = getVariantDefinition(variants[key], value, conf);
|
|
6177
6177
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`), console.info({
|
|
6178
6178
|
key,
|
|
6179
|
-
value
|
|
6179
|
+
value,
|
|
6180
6180
|
variantValue,
|
|
6181
6181
|
variants
|
|
6182
6182
|
}), console.groupEnd()), !variantValue) {
|
|
6183
|
-
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof
|
|
6183
|
+
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1" && typeof value != "boolean") {
|
|
6184
6184
|
var name = staticConfig.componentName || "[UnnamedComponent]";
|
|
6185
|
-
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${
|
|
6185
|
+
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${value}"`);
|
|
6186
6186
|
}
|
|
6187
6187
|
return;
|
|
6188
6188
|
}
|
|
6189
6189
|
if (typeof variantValue == "function") {
|
|
6190
6190
|
var fn = variantValue, extras = (0, import_getVariantExtras.getVariantExtras)(styleState);
|
|
6191
|
-
variantValue = fn(
|
|
6191
|
+
variantValue = fn(value, extras), process.env.NODE_ENV;
|
|
6192
6192
|
}
|
|
6193
6193
|
var fontFamilyResult;
|
|
6194
6194
|
if ((0, import_isObj.isObj)(variantValue)) {
|
|
@@ -6213,11 +6213,11 @@ var require_propMapper_native = __commonJS({
|
|
|
6213
6213
|
}
|
|
6214
6214
|
} else if (typeof input == "string" && input[0] === "$") return input;
|
|
6215
6215
|
}
|
|
6216
|
-
var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVariants = function(key,
|
|
6216
|
+
var variableToFontNameCache = /* @__PURE__ */ new WeakMap(), resolveTokensAndVariants = function(key, value, styleProps, styleState, parentVariantKey) {
|
|
6217
6217
|
var { conf, staticConfig, debug, theme } = styleState, { variants } = staticConfig, res = {};
|
|
6218
|
-
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" - resolveTokensAndVariants", key,
|
|
6219
|
-
for (var _key in
|
|
6220
|
-
var subKey = conf.shorthands[_key] || _key, val =
|
|
6218
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.info(" - resolveTokensAndVariants", key, value);
|
|
6219
|
+
for (var _key in value) {
|
|
6220
|
+
var subKey = conf.shorthands[_key] || _key, val = value[_key];
|
|
6221
6221
|
if (!(!styleProps.noSkip && subKey in import_skipProps.skipProps)) {
|
|
6222
6222
|
if (styleProps.noExpand) res[subKey] = val;
|
|
6223
6223
|
else if (variants && subKey in variants) {
|
|
@@ -6285,17 +6285,17 @@ var require_propMapper_native = __commonJS({
|
|
|
6285
6285
|
spreadName: `...${name}`
|
|
6286
6286
|
};
|
|
6287
6287
|
});
|
|
6288
|
-
function getVariantDefinition(variant,
|
|
6288
|
+
function getVariantDefinition(variant, value, conf) {
|
|
6289
6289
|
if (variant) {
|
|
6290
6290
|
if (typeof variant == "function") return variant;
|
|
6291
|
-
var exact = variant[
|
|
6291
|
+
var exact = variant[value];
|
|
6292
6292
|
if (exact) return exact;
|
|
6293
|
-
if (
|
|
6293
|
+
if (value != null) {
|
|
6294
6294
|
var { tokensParsed } = conf, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
6295
6295
|
try {
|
|
6296
6296
|
for (var _iterator = tokenCats[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
6297
6297
|
var { name, spreadName } = _step.value;
|
|
6298
|
-
if (spreadName in variant && name in tokensParsed &&
|
|
6298
|
+
if (spreadName in variant && name in tokensParsed && value in tokensParsed[name]) return variant[spreadName];
|
|
6299
6299
|
}
|
|
6300
6300
|
} catch (err) {
|
|
6301
6301
|
_didIteratorError = !0, _iteratorError = err;
|
|
@@ -6307,32 +6307,32 @@ var require_propMapper_native = __commonJS({
|
|
|
6307
6307
|
}
|
|
6308
6308
|
}
|
|
6309
6309
|
var fontSizeVariant = variant["...fontSize"];
|
|
6310
|
-
if (fontSizeVariant && conf.fontSizeTokens.has(
|
|
6310
|
+
if (fontSizeVariant && conf.fontSizeTokens.has(value)) return fontSizeVariant;
|
|
6311
6311
|
}
|
|
6312
|
-
return variant[`:${typeof
|
|
6312
|
+
return variant[`:${typeof value}`] || variant["..."];
|
|
6313
6313
|
}
|
|
6314
6314
|
}
|
|
6315
6315
|
var fontShorthand = {
|
|
6316
6316
|
fontSize: "size",
|
|
6317
6317
|
fontWeight: "weight"
|
|
6318
|
-
}, lastFontFamilyToken = null, getTokenForKey = function(key,
|
|
6318
|
+
}, lastFontFamilyToken = null, getTokenForKey = function(key, value, styleProps, styleState) {
|
|
6319
6319
|
var _staticConfig_accept, resolveAs = styleProps.resolveValues || "none";
|
|
6320
|
-
if (resolveAs === "none") return
|
|
6321
|
-
var { theme, conf = (0, import_config.getConfig)(), context, fontFamily, staticConfig } = styleState, themeValue = theme ? theme[
|
|
6320
|
+
if (resolveAs === "none") return value;
|
|
6321
|
+
var { theme, conf = (0, import_config.getConfig)(), context, fontFamily, staticConfig } = styleState, themeValue = theme ? theme[value] || theme[value.slice(1)] : void 0, tokensParsed = conf.tokensParsed, valOrVar, hasSet = !1, customTokenAccept = staticConfig == null || (_staticConfig_accept = staticConfig.accept) === null || _staticConfig_accept === void 0 ? void 0 : _staticConfig_accept[key];
|
|
6322
6322
|
if (customTokenAccept) {
|
|
6323
|
-
var val = themeValue ?? tokensParsed[customTokenAccept][
|
|
6323
|
+
var val = themeValue ?? tokensParsed[customTokenAccept][value];
|
|
6324
6324
|
val != null && (resolveAs = "value", valOrVar = val, hasSet = !0);
|
|
6325
6325
|
}
|
|
6326
6326
|
if (themeValue) {
|
|
6327
|
-
if (resolveAs === "except-theme") return
|
|
6328
|
-
valOrVar = themeValue, process.env.NODE_ENV === "development" && styleState.debug === "verbose" && (globalThis.tamaguiAvoidTracking = !0, console.info(` - resolving ${key} to theme value ${
|
|
6327
|
+
if (resolveAs === "except-theme") return value;
|
|
6328
|
+
valOrVar = themeValue, process.env.NODE_ENV === "development" && styleState.debug === "verbose" && (globalThis.tamaguiAvoidTracking = !0, console.info(` - resolving ${key} to theme value ${value} resolveAs ${resolveAs}`, valOrVar), globalThis.tamaguiAvoidTracking = !1), hasSet = !0;
|
|
6329
6329
|
} else {
|
|
6330
|
-
if (
|
|
6330
|
+
if (value in conf.specificTokens) hasSet = !0, valOrVar = conf.specificTokens[value];
|
|
6331
6331
|
else {
|
|
6332
6332
|
switch (key) {
|
|
6333
6333
|
case "fontFamily": {
|
|
6334
6334
|
var _fontsParsed_value, fontsParsed = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed;
|
|
6335
|
-
valOrVar = ((_fontsParsed_value = fontsParsed[
|
|
6335
|
+
valOrVar = ((_fontsParsed_value = fontsParsed[value]) === null || _fontsParsed_value === void 0 ? void 0 : _fontsParsed_value.family) || value, lastFontFamilyToken = value, hasSet = !0;
|
|
6336
6336
|
break;
|
|
6337
6337
|
}
|
|
6338
6338
|
case "fontSize":
|
|
@@ -6342,18 +6342,18 @@ var require_propMapper_native = __commonJS({
|
|
|
6342
6342
|
var fam = fontFamily || conf.defaultFontToken;
|
|
6343
6343
|
if (fam) {
|
|
6344
6344
|
var _font_, fontsParsed1 = context != null && context.language ? (0, import_getVariantExtras.getFontsForLanguage)(conf.fontsParsed, context.language) : conf.fontsParsed, font = fontsParsed1[fam] || fontsParsed1[conf.defaultFontToken];
|
|
6345
|
-
valOrVar = (font == null || (_font_ = font[fontShorthand[key] || key]) === null || _font_ === void 0 ? void 0 : _font_[
|
|
6345
|
+
valOrVar = (font == null || (_font_ = font[fontShorthand[key] || key]) === null || _font_ === void 0 ? void 0 : _font_[value]) || value, hasSet = !0;
|
|
6346
6346
|
}
|
|
6347
6347
|
break;
|
|
6348
6348
|
}
|
|
6349
6349
|
}
|
|
6350
6350
|
for (var cat in import_helpers.tokenCategories) if (key in import_helpers.tokenCategories[cat]) {
|
|
6351
|
-
var res = tokensParsed[cat][
|
|
6351
|
+
var res = tokensParsed[cat][value];
|
|
6352
6352
|
res != null && (valOrVar = res, hasSet = !0);
|
|
6353
6353
|
}
|
|
6354
6354
|
}
|
|
6355
6355
|
if (!hasSet) {
|
|
6356
|
-
var spaceVar = tokensParsed.space[
|
|
6356
|
+
var spaceVar = tokensParsed.space[value];
|
|
6357
6357
|
spaceVar != null && (valOrVar = spaceVar, hasSet = !0);
|
|
6358
6358
|
}
|
|
6359
6359
|
}
|
|
@@ -6479,8 +6479,8 @@ var require_transformsToString_native = __commonJS({
|
|
|
6479
6479
|
// { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'
|
|
6480
6480
|
// { perspective: 1000 } => perspective(1000px)
|
|
6481
6481
|
function(transform) {
|
|
6482
|
-
var type = Object.keys(transform)[0],
|
|
6483
|
-
return type === "matrix" || type === "matrix3d" ? `${type}(${
|
|
6482
|
+
var type = Object.keys(transform)[0], value = transform[type];
|
|
6483
|
+
return type === "matrix" || type === "matrix3d" ? `${type}(${value.join(",")})` : `${type}(${(0, import_normalizeValueWithProperty.normalizeValueWithProperty)(value, type)})`;
|
|
6484
6484
|
}
|
|
6485
6485
|
).join(" ");
|
|
6486
6486
|
}
|
|
@@ -6916,7 +6916,7 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
6916
6916
|
if (!styleState.style.$$css) {
|
|
6917
6917
|
var atomic, _iteratorNormalCompletion, _didIteratorError, _iteratorError;
|
|
6918
6918
|
try {
|
|
6919
|
-
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2,
|
|
6919
|
+
for (var _iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) var atomicStyle, _props_animateOnly, _props_animateOnly1, key2, value, identifier, isAnimatedAndAnimateOnly, nonAnimatedAnimateOnly;
|
|
6920
6920
|
} catch (err) {
|
|
6921
6921
|
} finally {
|
|
6922
6922
|
}
|
|
@@ -7090,14 +7090,14 @@ var require_getSplitStyles_native = __commonJS({
|
|
|
7090
7090
|
delete viewProps[key], viewProps[key] = next;
|
|
7091
7091
|
} else viewProps[key] = val;
|
|
7092
7092
|
}
|
|
7093
|
-
function mergeMediaByImportance(styleState, mediaKey, key,
|
|
7093
|
+
function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp) {
|
|
7094
7094
|
var usedKeys = styleState.usedKeys, importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, styleState, isSizeMedia);
|
|
7095
7095
|
if (importanceBump && (importance = (importance || 0) + importanceBump), process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)(`mergeMediaByImportance ${key} importance usedKey ${usedKeys[key]} next ${importance}`), importance === null) return !1;
|
|
7096
7096
|
if (key in import_pseudoDescriptors.pseudoDescriptors) {
|
|
7097
7097
|
var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
|
|
7098
7098
|
if (isDisabled) return !1;
|
|
7099
|
-
for (var subKey in
|
|
7100
|
-
} else mergeStyle(styleState, key,
|
|
7099
|
+
for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
|
|
7100
|
+
} else mergeStyle(styleState, key, value, importance);
|
|
7101
7101
|
return !0;
|
|
7102
7102
|
}
|
|
7103
7103
|
function normalizeStyle(style) {
|
|
@@ -7727,14 +7727,14 @@ var require_getThemeProxied_native = __commonJS({
|
|
|
7727
7727
|
curKeys && (curKeys.current || (curKeys.current = /* @__PURE__ */ new Set()), curKeys.current.add(key), process.env.NODE_ENV === "development" && curProps.debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`, curKeys));
|
|
7728
7728
|
}
|
|
7729
7729
|
var proxied1 = Object.fromEntries(Object.entries(_state.theme).flatMap(function(param) {
|
|
7730
|
-
var [key,
|
|
7731
|
-
...
|
|
7730
|
+
var [key, value] = param, proxied2 = {
|
|
7731
|
+
...value,
|
|
7732
7732
|
get val() {
|
|
7733
|
-
return globalThis.tamaguiAvoidTracking || track(key),
|
|
7733
|
+
return globalThis.tamaguiAvoidTracking || track(key), value.val;
|
|
7734
7734
|
},
|
|
7735
7735
|
get(platform2) {
|
|
7736
7736
|
if (curState) {
|
|
7737
|
-
var outVal = (0, import_createVariable.getVariable)(
|
|
7737
|
+
var outVal = (0, import_createVariable.getVariable)(value), { name, scheme, inverses } = curState, shouldOptimize = scheme && platform2 !== "web" && import_constants4.isIos && !curProps.deopt && (0, import_config.getSetting)("fastSchemeChange") && inverses === 0 && (0, import_doesRootSchemeMatchSystem.doesRootSchemeMatchSystem)();
|
|
7738
7738
|
if (shouldOptimize) {
|
|
7739
7739
|
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 = (0, import_getDynamicVal.getDynamicVal)({
|
|
7740
7740
|
scheme,
|
|
@@ -8303,11 +8303,11 @@ var require_index_native14 = __commonJS({
|
|
|
8303
8303
|
};
|
|
8304
8304
|
function useDidFinishSSR2() {
|
|
8305
8305
|
var clientOnly = React4.useContext(import_ClientOnly.ClientOnlyContext);
|
|
8306
|
-
return
|
|
8306
|
+
return !0;
|
|
8307
8307
|
}
|
|
8308
|
-
function useClientValue(
|
|
8308
|
+
function useClientValue(value) {
|
|
8309
8309
|
var done = useDidFinishSSR2();
|
|
8310
|
-
return done ? typeof
|
|
8310
|
+
return done ? typeof value == "function" ? value() : value : void 0;
|
|
8311
8311
|
}
|
|
8312
8312
|
}
|
|
8313
8313
|
});
|
|
@@ -9924,10 +9924,10 @@ var require_createFont_native = __commonJS({
|
|
|
9924
9924
|
...sectionKeys
|
|
9925
9925
|
])
|
|
9926
9926
|
].map(function(key) {
|
|
9927
|
-
var _section_key, _ref,
|
|
9928
|
-
return fillValue =
|
|
9927
|
+
var _section_key, _ref, value = (_ref = (_section_key = section[key]) !== null && _section_key !== void 0 ? _section_key : defaultValue) !== null && _ref !== void 0 ? _ref : fillValue;
|
|
9928
|
+
return fillValue = value, defaultValue = value, [
|
|
9929
9929
|
key,
|
|
9930
|
-
|
|
9930
|
+
value
|
|
9931
9931
|
];
|
|
9932
9932
|
}));
|
|
9933
9933
|
}, createFont2 = function(font) {
|
|
@@ -12102,41 +12102,41 @@ var require_matchQuery_native = __commonJS({
|
|
|
12102
12102
|
var inverse = query.inverse, typeMatch = query.type === "all" || values.type === query.type;
|
|
12103
12103
|
if (typeMatch && inverse || !(typeMatch || inverse)) return !1;
|
|
12104
12104
|
var expressionsMatch = query.expressions.every(function(expression) {
|
|
12105
|
-
var feature = expression.feature, modifier = expression.modifier, expValue = expression.value,
|
|
12106
|
-
if (!
|
|
12105
|
+
var feature = expression.feature, modifier = expression.modifier, expValue = expression.value, value = values[feature];
|
|
12106
|
+
if (!value) return !1;
|
|
12107
12107
|
switch (feature) {
|
|
12108
12108
|
case "orientation":
|
|
12109
12109
|
case "scan":
|
|
12110
|
-
return
|
|
12110
|
+
return value.toLowerCase() === expValue.toLowerCase();
|
|
12111
12111
|
case "width":
|
|
12112
12112
|
case "height":
|
|
12113
12113
|
case "device-width":
|
|
12114
12114
|
case "device-height":
|
|
12115
|
-
expValue = toPx(expValue),
|
|
12115
|
+
expValue = toPx(expValue), value = toPx(value);
|
|
12116
12116
|
break;
|
|
12117
12117
|
case "resolution":
|
|
12118
|
-
expValue = toDpi(expValue),
|
|
12118
|
+
expValue = toDpi(expValue), value = toDpi(value);
|
|
12119
12119
|
break;
|
|
12120
12120
|
case "aspect-ratio":
|
|
12121
12121
|
case "device-aspect-ratio":
|
|
12122
12122
|
case /* Deprecated */
|
|
12123
12123
|
"device-pixel-ratio":
|
|
12124
|
-
expValue = toDecimal(expValue),
|
|
12124
|
+
expValue = toDecimal(expValue), value = toDecimal(value);
|
|
12125
12125
|
break;
|
|
12126
12126
|
case "grid":
|
|
12127
12127
|
case "color":
|
|
12128
12128
|
case "color-index":
|
|
12129
12129
|
case "monochrome":
|
|
12130
|
-
expValue = Number.parseInt(expValue, 10) || 1,
|
|
12130
|
+
expValue = Number.parseInt(expValue, 10) || 1, value = Number.parseInt(value, 10) || 0;
|
|
12131
12131
|
break;
|
|
12132
12132
|
}
|
|
12133
12133
|
switch (modifier) {
|
|
12134
12134
|
case "min":
|
|
12135
|
-
return
|
|
12135
|
+
return value >= expValue;
|
|
12136
12136
|
case "max":
|
|
12137
|
-
return
|
|
12137
|
+
return value <= expValue;
|
|
12138
12138
|
default:
|
|
12139
|
-
return
|
|
12139
|
+
return value === expValue;
|
|
12140
12140
|
}
|
|
12141
12141
|
});
|
|
12142
12142
|
return expressionsMatch && !inverse || !expressionsMatch && inverse;
|
|
@@ -12168,35 +12168,35 @@ var require_matchQuery_native = __commonJS({
|
|
|
12168
12168
|
return decimal || (numbers = ratio.match(/^(\d+)\s*\/\s*(\d+)$/), decimal = numbers[1] / numbers[2]), decimal;
|
|
12169
12169
|
}
|
|
12170
12170
|
function toDpi(resolution) {
|
|
12171
|
-
var _String_match,
|
|
12171
|
+
var _String_match, value = Number.parseFloat(resolution), units = (_String_match = String(resolution).match(RE_RESOLUTION_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];
|
|
12172
12172
|
switch (units) {
|
|
12173
12173
|
case "dpcm":
|
|
12174
|
-
return
|
|
12174
|
+
return value / 2.54;
|
|
12175
12175
|
case "dppx":
|
|
12176
|
-
return
|
|
12176
|
+
return value * 96;
|
|
12177
12177
|
default:
|
|
12178
|
-
return
|
|
12178
|
+
return value;
|
|
12179
12179
|
}
|
|
12180
12180
|
}
|
|
12181
12181
|
function toPx(length) {
|
|
12182
|
-
var _String_match,
|
|
12182
|
+
var _String_match, value = Number.parseFloat(length), units = (_String_match = String(length).match(RE_LENGTH_UNIT)) === null || _String_match === void 0 ? void 0 : _String_match[1];
|
|
12183
12183
|
switch (units) {
|
|
12184
12184
|
case "em":
|
|
12185
|
-
return
|
|
12185
|
+
return value * 16;
|
|
12186
12186
|
case "rem":
|
|
12187
|
-
return
|
|
12187
|
+
return value * 16;
|
|
12188
12188
|
case "cm":
|
|
12189
|
-
return
|
|
12189
|
+
return value * 96 / 2.54;
|
|
12190
12190
|
case "mm":
|
|
12191
|
-
return
|
|
12191
|
+
return value * 96 / 2.54 / 10;
|
|
12192
12192
|
case "in":
|
|
12193
|
-
return
|
|
12193
|
+
return value * 96;
|
|
12194
12194
|
case "pt":
|
|
12195
|
-
return
|
|
12195
|
+
return value * 72;
|
|
12196
12196
|
case "pc":
|
|
12197
|
-
return
|
|
12197
|
+
return value * 72 / 12;
|
|
12198
12198
|
default:
|
|
12199
|
-
return
|
|
12199
|
+
return value;
|
|
12200
12200
|
}
|
|
12201
12201
|
}
|
|
12202
12202
|
}
|
|
@@ -12258,13 +12258,13 @@ var require_mediaQueryList_native = __commonJS({
|
|
|
12258
12258
|
function _create_class(Constructor, protoProps, staticProps) {
|
|
12259
12259
|
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
12260
12260
|
}
|
|
12261
|
-
function _define_property(obj, key,
|
|
12261
|
+
function _define_property(obj, key, value) {
|
|
12262
12262
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
12263
|
-
value
|
|
12263
|
+
value,
|
|
12264
12264
|
enumerable: !0,
|
|
12265
12265
|
configurable: !0,
|
|
12266
12266
|
writable: !0
|
|
12267
|
-
}) : obj[key] =
|
|
12267
|
+
}) : obj[key] = value, obj;
|
|
12268
12268
|
}
|
|
12269
12269
|
var NativeMediaQueryList = /* @__PURE__ */ function() {
|
|
12270
12270
|
"use strict";
|
|
@@ -12934,13 +12934,13 @@ var require_ResponderTouchHistoryStore_native = __commonJS({
|
|
|
12934
12934
|
function _create_class(Constructor, protoProps, staticProps) {
|
|
12935
12935
|
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
12936
12936
|
}
|
|
12937
|
-
function _define_property(obj, key,
|
|
12937
|
+
function _define_property(obj, key, value) {
|
|
12938
12938
|
return key in obj ? Object.defineProperty(obj, key, {
|
|
12939
|
-
value
|
|
12939
|
+
value,
|
|
12940
12940
|
enumerable: !0,
|
|
12941
12941
|
configurable: !0,
|
|
12942
12942
|
writable: !0
|
|
12943
|
-
}) : obj[key] =
|
|
12943
|
+
}) : obj[key] = value, obj;
|
|
12944
12944
|
}
|
|
12945
12945
|
var ResponderTouchHistoryStore = /* @__PURE__ */ function() {
|
|
12946
12946
|
"use strict";
|
|
@@ -15925,24 +15925,24 @@ var require_Accordion_native = __commonJS({
|
|
|
15925
15925
|
AccordionComponent.displayName = ACCORDION_NAME;
|
|
15926
15926
|
AccordionComponent.propTypes = {
|
|
15927
15927
|
type(props) {
|
|
15928
|
-
var
|
|
15928
|
+
var value = props.value || props.defaultValue;
|
|
15929
15929
|
return props.type && ![
|
|
15930
15930
|
"single",
|
|
15931
15931
|
"multiple"
|
|
15932
|
-
].includes(props.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : props.type === "multiple" && typeof
|
|
15932
|
+
].includes(props.type) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.") : props.type === "multiple" && typeof value == "string" ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.") : props.type === "single" && Array.isArray(value) ? new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.") : null;
|
|
15933
15933
|
}
|
|
15934
15934
|
};
|
|
15935
15935
|
var { Provider: AccordionValueProvider, useStyledContext: useAccordionValueContext } = (0, import_core12.createStyledContext)(), { Provider: AccordionCollapsibleProvider, useStyledContext: useAccordionCollapsibleContext } = (0, import_core12.createStyledContext)(), AccordionImplSingle = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
15936
15936
|
var { value: valueProp, defaultValue, control, onValueChange = function() {
|
|
15937
|
-
}, collapsible = !1, ...accordionSingleProps } = props, [
|
|
15937
|
+
}, collapsible = !1, ...accordionSingleProps } = props, [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
15938
15938
|
prop: valueProp,
|
|
15939
15939
|
defaultProp: defaultValue || "",
|
|
15940
15940
|
onChange: onValueChange
|
|
15941
15941
|
});
|
|
15942
15942
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionValueProvider, {
|
|
15943
15943
|
scope: props.__scopeAccordion,
|
|
15944
|
-
value:
|
|
15945
|
-
|
|
15944
|
+
value: value ? [
|
|
15945
|
+
value
|
|
15946
15946
|
] : [],
|
|
15947
15947
|
onItemOpen: setValue,
|
|
15948
15948
|
onItemClose: React4.useCallback(function() {
|
|
@@ -15962,7 +15962,7 @@ var require_Accordion_native = __commonJS({
|
|
|
15962
15962
|
});
|
|
15963
15963
|
}), AccordionImplMultiple = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
15964
15964
|
var { value: valueProp, defaultValue, onValueChange = function() {
|
|
15965
|
-
}, ...accordionMultipleProps } = props, [
|
|
15965
|
+
}, ...accordionMultipleProps } = props, [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
15966
15966
|
prop: valueProp,
|
|
15967
15967
|
defaultProp: defaultValue || [],
|
|
15968
15968
|
onChange: onValueChange
|
|
@@ -15979,8 +15979,8 @@ var require_Accordion_native = __commonJS({
|
|
|
15979
15979
|
]), handleItemClose = React4.useCallback(function(itemValue) {
|
|
15980
15980
|
return setValue(function() {
|
|
15981
15981
|
var prevValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
15982
|
-
return prevValue.filter(function(
|
|
15983
|
-
return
|
|
15982
|
+
return prevValue.filter(function(value2) {
|
|
15983
|
+
return value2 !== itemValue;
|
|
15984
15984
|
});
|
|
15985
15985
|
});
|
|
15986
15986
|
}, [
|
|
@@ -15988,7 +15988,7 @@ var require_Accordion_native = __commonJS({
|
|
|
15988
15988
|
]);
|
|
15989
15989
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionValueProvider, {
|
|
15990
15990
|
scope: props.__scopeAccordion,
|
|
15991
|
-
value:
|
|
15991
|
+
value: value || [],
|
|
15992
15992
|
onItemOpen: handleItemOpen,
|
|
15993
15993
|
onItemClose: handleItemClose,
|
|
15994
15994
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionCollapsibleProvider, {
|
|
@@ -16060,7 +16060,7 @@ var require_Accordion_native = __commonJS({
|
|
|
16060
16060
|
})
|
|
16061
16061
|
});
|
|
16062
16062
|
}), ITEM_NAME = "AccordionItem", { Provider: AccordionItemProvider, useStyledContext: useAccordionItemContext } = (0, import_core12.createStyledContext)(), AccordionItem = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
16063
|
-
var { __scopeAccordion, value
|
|
16063
|
+
var { __scopeAccordion, value, ...accordionItemProps } = props, accordionContext = useAccordionContext(__scopeAccordion), valueContext = useAccordionValueContext(__scopeAccordion), triggerId = React4.useId(), open = value && valueContext.value.includes(value) || !1, disabled = accordionContext.disabled || props.disabled;
|
|
16064
16064
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AccordionItemProvider, {
|
|
16065
16065
|
scope: __scopeAccordion,
|
|
16066
16066
|
open,
|
|
@@ -16075,7 +16075,7 @@ var require_Accordion_native = __commonJS({
|
|
|
16075
16075
|
disabled,
|
|
16076
16076
|
open,
|
|
16077
16077
|
onOpenChange: function(open2) {
|
|
16078
|
-
open2 ? valueContext.onItemOpen(
|
|
16078
|
+
open2 ? valueContext.onItemOpen(value) : valueContext.onItemClose(value);
|
|
16079
16079
|
}
|
|
16080
16080
|
})
|
|
16081
16081
|
});
|
|
@@ -16668,9 +16668,9 @@ var require_GorhomPortal_native = __commonJS({
|
|
|
16668
16668
|
};
|
|
16669
16669
|
}, PortalProviderComponent = function(param) {
|
|
16670
16670
|
var { rootHostName = "root", shouldAddRootHost = !0, children } = param, [state, dispatch] = (0, import_react3.useReducer)(reducer, INITIAL_STATE), transitionDispatch = (0, import_react3.useMemo)(function() {
|
|
16671
|
-
var next = function(
|
|
16671
|
+
var next = function(value) {
|
|
16672
16672
|
(0, import_start_transition.startTransition)(function() {
|
|
16673
|
-
dispatch(
|
|
16673
|
+
dispatch(value);
|
|
16674
16674
|
});
|
|
16675
16675
|
};
|
|
16676
16676
|
return next;
|
|
@@ -17350,11 +17350,11 @@ var require_create_context_native = __commonJS({
|
|
|
17350
17350
|
function createContext(rootComponentName, defaultContext) {
|
|
17351
17351
|
var Context = /* @__PURE__ */ React4.createContext(defaultContext);
|
|
17352
17352
|
function Provider(props) {
|
|
17353
|
-
var { children, ...context } = props,
|
|
17353
|
+
var { children, ...context } = props, value = React4.useMemo(function() {
|
|
17354
17354
|
return context;
|
|
17355
17355
|
}, Object.values(context));
|
|
17356
17356
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Context.Provider, {
|
|
17357
|
-
value
|
|
17357
|
+
value,
|
|
17358
17358
|
children
|
|
17359
17359
|
});
|
|
17360
17360
|
}
|
|
@@ -17378,11 +17378,11 @@ var require_create_context_native = __commonJS({
|
|
|
17378
17378
|
defaultContext
|
|
17379
17379
|
];
|
|
17380
17380
|
function Provider(props) {
|
|
17381
|
-
var _scope_scopeName, { scope, children, ...context } = props, Context = (scope == null || (_scope_scopeName = scope[scopeName]) === null || _scope_scopeName === void 0 ? void 0 : _scope_scopeName[index]) || BaseContext,
|
|
17381
|
+
var _scope_scopeName, { scope, children, ...context } = props, Context = (scope == null || (_scope_scopeName = scope[scopeName]) === null || _scope_scopeName === void 0 ? void 0 : _scope_scopeName[index]) || BaseContext, value = React4.useMemo(function() {
|
|
17382
17382
|
return context;
|
|
17383
17383
|
}, Object.values(context));
|
|
17384
17384
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Context.Provider, {
|
|
17385
|
-
value
|
|
17385
|
+
value,
|
|
17386
17386
|
children
|
|
17387
17387
|
});
|
|
17388
17388
|
}
|
|
@@ -18625,8 +18625,8 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
18625
18625
|
useAnimatedNumberReaction({
|
|
18626
18626
|
value: animatedNumber,
|
|
18627
18627
|
hostRef: sheetRef
|
|
18628
|
-
}, import_react3.default.useCallback(function(
|
|
18629
|
-
at.current =
|
|
18628
|
+
}, import_react3.default.useCallback(function(value) {
|
|
18629
|
+
at.current = value, scrollBridge.paneY = value;
|
|
18630
18630
|
}, [
|
|
18631
18631
|
animationDriver
|
|
18632
18632
|
]));
|
|
@@ -22317,7 +22317,7 @@ var require_focusableInputHOC_native = __commonJS({
|
|
|
22317
22317
|
module2.exports = __toCommonJS2(focusableInputHOC_exports);
|
|
22318
22318
|
var import_compose_refs = require_index_native11(), import_web = require_index_native15(), import_react3 = __toESM2(require("react")), import_registerFocusable = require_registerFocusable_native();
|
|
22319
22319
|
function useFocusable2(param) {
|
|
22320
|
-
var { isInput, props, ref } = param, { id, onChangeText, value
|
|
22320
|
+
var { isInput, props, ref } = param, { id, onChangeText, value, defaultValue } = props, inputValue = import_react3.default.useRef(value || defaultValue || ""), unregisterFocusable = import_react3.default.useRef(void 0), focusAndSelect = import_react3.default.useCallback(function(input) {
|
|
22321
22321
|
input.focus(), input.setSelection && typeof inputValue.current == "string" && input.setSelection(0, inputValue.current.length);
|
|
22322
22322
|
}, []), registerFocusableHandler = import_react3.default.useCallback(function(input) {
|
|
22323
22323
|
var _unregisterFocusable_current;
|
|
@@ -22337,8 +22337,8 @@ var require_focusableInputHOC_native = __commonJS({
|
|
|
22337
22337
|
input && registerFocusableHandler(input);
|
|
22338
22338
|
}, [
|
|
22339
22339
|
registerFocusableHandler
|
|
22340
|
-
]), handleChangeText = (0, import_web.useEvent)(function(
|
|
22341
|
-
inputValue.current =
|
|
22340
|
+
]), handleChangeText = (0, import_web.useEvent)(function(value2) {
|
|
22341
|
+
inputValue.current = value2, onChangeText == null || onChangeText(value2);
|
|
22342
22342
|
});
|
|
22343
22343
|
return import_react3.default.useEffect(function() {
|
|
22344
22344
|
return function() {
|
|
@@ -22690,15 +22690,15 @@ var require_index_native49 = __commonJS({
|
|
|
22690
22690
|
});
|
|
22691
22691
|
module2.exports = __toCommonJS2(index_exports2);
|
|
22692
22692
|
var React4 = __toESM2(require("react"));
|
|
22693
|
-
function usePrevious(
|
|
22693
|
+
function usePrevious(value) {
|
|
22694
22694
|
var ref = React4.useRef({
|
|
22695
|
-
value
|
|
22696
|
-
previous:
|
|
22695
|
+
value,
|
|
22696
|
+
previous: value
|
|
22697
22697
|
});
|
|
22698
22698
|
return React4.useMemo(function() {
|
|
22699
|
-
return ref.current.value !==
|
|
22699
|
+
return ref.current.value !== value && (ref.current.previous = ref.current.value, ref.current.value = value), ref.current.previous;
|
|
22700
22700
|
}, [
|
|
22701
|
-
|
|
22701
|
+
value
|
|
22702
22702
|
]);
|
|
22703
22703
|
}
|
|
22704
22704
|
}
|
|
@@ -22910,7 +22910,7 @@ var require_useCheckbox_native = __commonJS({
|
|
|
22910
22910
|
module2.exports = __toCommonJS2(useCheckbox_exports);
|
|
22911
22911
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native(), import_helpers = require_index_native7(), import_label = require_index_native48(), import_react3 = __toESM2(require("react")), import_BubbleInput = require_BubbleInput_native(), import_utils = require_utils_native2();
|
|
22912
22912
|
function useCheckbox(props, param, ref) {
|
|
22913
|
-
var [checked, setChecked] = param, { labelledBy: ariaLabelledby, name, required, disabled, value
|
|
22913
|
+
var [checked, setChecked] = param, { labelledBy: ariaLabelledby, name, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props, [button, setButton] = import_react3.default.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(ref, setButton), hasConsumerStoppedPropagationRef = import_react3.default.useRef(!1), isFormControl = import_constants4.isWeb ? button ? !!button.closest("form") : !0 : !1, labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId, parentKeyDown = props.onKeyDown, handleKeyDown = (0, import_react3.useMemo)(function() {
|
|
22914
22914
|
return (0, import_helpers.composeEventHandlers)(parentKeyDown, function(event) {
|
|
22915
22915
|
event.key === "Enter" && event.preventDefault();
|
|
22916
22916
|
});
|
|
@@ -22931,7 +22931,7 @@ var require_useCheckbox_native = __commonJS({
|
|
|
22931
22931
|
control: button,
|
|
22932
22932
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
22933
22933
|
name,
|
|
22934
|
-
value
|
|
22934
|
+
value,
|
|
22935
22935
|
checked,
|
|
22936
22936
|
required,
|
|
22937
22937
|
disabled
|
|
@@ -22944,7 +22944,7 @@ var require_useCheckbox_native = __commonJS({
|
|
|
22944
22944
|
...checkboxProps,
|
|
22945
22945
|
...import_constants4.isWeb && {
|
|
22946
22946
|
type: "button",
|
|
22947
|
-
value
|
|
22947
|
+
value,
|
|
22948
22948
|
"data-state": (0, import_utils.getState)(checked),
|
|
22949
22949
|
"data-disabled": disabled ? "" : void 0,
|
|
22950
22950
|
disabled,
|
|
@@ -23088,8 +23088,8 @@ var require_createCheckbox_native = __commonJS({
|
|
|
23088
23088
|
import_react3.default.useEffect(function() {
|
|
23089
23089
|
if (props.id && !props.disabled) return (0, import_focusable2.registerFocusable)(props.id, {
|
|
23090
23090
|
focusAndSelect: function() {
|
|
23091
|
-
setChecked == null || setChecked(function(
|
|
23092
|
-
return !
|
|
23091
|
+
setChecked == null || setChecked(function(value) {
|
|
23092
|
+
return !value;
|
|
23093
23093
|
});
|
|
23094
23094
|
},
|
|
23095
23095
|
focus: function() {
|
|
@@ -25534,20 +25534,20 @@ var require_Progress_native = __commonJS({
|
|
|
25534
25534
|
animation: context.width ? animation : null
|
|
25535
25535
|
});
|
|
25536
25536
|
});
|
|
25537
|
-
function defaultGetValueLabel(
|
|
25538
|
-
return `${Math.round(
|
|
25537
|
+
function defaultGetValueLabel(value, max) {
|
|
25538
|
+
return `${Math.round(value / max * 100)}%`;
|
|
25539
25539
|
}
|
|
25540
|
-
function getProgressState(
|
|
25541
|
-
return
|
|
25540
|
+
function getProgressState(value, maxValue) {
|
|
25541
|
+
return value == null ? "indeterminate" : value === maxValue ? "complete" : "loading";
|
|
25542
25542
|
}
|
|
25543
|
-
function isNumber(
|
|
25544
|
-
return typeof
|
|
25543
|
+
function isNumber(value) {
|
|
25544
|
+
return typeof value == "number";
|
|
25545
25545
|
}
|
|
25546
25546
|
function isValidMaxNumber(max) {
|
|
25547
25547
|
return isNumber(max) && !Number.isNaN(max) && max > 0;
|
|
25548
25548
|
}
|
|
25549
|
-
function isValidValueNumber(
|
|
25550
|
-
return isNumber(
|
|
25549
|
+
function isValidValueNumber(value, max) {
|
|
25550
|
+
return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
|
|
25551
25551
|
}
|
|
25552
25552
|
var DEFAULT_MAX = 100, ProgressFrame = (0, import_core12.styled)(import_stacks3.ThemeableStack, {
|
|
25553
25553
|
name: "Progress",
|
|
@@ -25582,21 +25582,21 @@ var require_Progress_native = __commonJS({
|
|
|
25582
25582
|
getValueLabel = defaultGetValueLabel,
|
|
25583
25583
|
size: size2 = "$true",
|
|
25584
25584
|
...progressProps
|
|
25585
|
-
} = props, max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX,
|
|
25585
|
+
} = props, max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX, value = isValidValueNumber(valueProp, max) ? valueProp : null, valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0, [width, setWidth] = React4.useState(0);
|
|
25586
25586
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProgressProvider, {
|
|
25587
25587
|
scope: __scopeProgress,
|
|
25588
|
-
value
|
|
25588
|
+
value,
|
|
25589
25589
|
max,
|
|
25590
25590
|
width,
|
|
25591
25591
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProgressFrame, {
|
|
25592
25592
|
"aria-valuemax": max,
|
|
25593
25593
|
"aria-valuemin": 0,
|
|
25594
|
-
"aria-valuenow": isNumber(
|
|
25594
|
+
"aria-valuenow": isNumber(value) ? value : void 0,
|
|
25595
25595
|
"aria-valuetext": valueLabel,
|
|
25596
25596
|
// @ts-ignore
|
|
25597
25597
|
role: "progressbar",
|
|
25598
|
-
"data-state": getProgressState(
|
|
25599
|
-
"data-value":
|
|
25598
|
+
"data-state": getProgressState(value, max),
|
|
25599
|
+
"data-value": value ?? void 0,
|
|
25600
25600
|
"data-max": max,
|
|
25601
25601
|
...progressProps.unstyled !== !0 && {
|
|
25602
25602
|
size: size2
|
|
@@ -25755,8 +25755,8 @@ var require_RadioGroup_native = __commonJS({
|
|
|
25755
25755
|
}
|
|
25756
25756
|
},
|
|
25757
25757
|
size: {
|
|
25758
|
-
"...size": function(
|
|
25759
|
-
var { props } = param, _props_scaleSize, size2 = Math.floor((0, import_core12.getVariableValue)((0, import_get_token2.getSize)(
|
|
25758
|
+
"...size": function(value, param) {
|
|
25759
|
+
var { props } = param, _props_scaleSize, size2 = Math.floor((0, import_core12.getVariableValue)((0, import_get_token2.getSize)(value)) * ((_props_scaleSize = props.scaleSize) !== null && _props_scaleSize !== void 0 ? _props_scaleSize : 0.5));
|
|
25760
25760
|
return {
|
|
25761
25761
|
width: size2,
|
|
25762
25762
|
height: size2
|
|
@@ -25995,14 +25995,14 @@ var require_useRadioGroup_native = __commonJS({
|
|
|
25995
25995
|
module2.exports = __toCommonJS2(useRadioGroup_exports);
|
|
25996
25996
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native(), import_focusable2 = require_index_native47(), import_helpers = require_index_native7(), import_label = require_index_native48(), import_use_controllable_state = require_index_native10(), import_react3 = require("react"), import_BubbleInput = require_BubbleInput_native2(), import_utils = require_utils_native3();
|
|
25997
25997
|
function useRadioGroup(params) {
|
|
25998
|
-
var { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params, [
|
|
25998
|
+
var { value: valueProp, onValueChange, defaultValue, required, disabled, name, native, accentColor, orientation, ref } = params, [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
25999
25999
|
prop: valueProp,
|
|
26000
26000
|
defaultProp: defaultValue,
|
|
26001
26001
|
onChange: onValueChange
|
|
26002
26002
|
});
|
|
26003
26003
|
return {
|
|
26004
26004
|
providerValue: {
|
|
26005
|
-
value
|
|
26005
|
+
value,
|
|
26006
26006
|
onChange: setValue,
|
|
26007
26007
|
required,
|
|
26008
26008
|
disabled,
|
|
@@ -26027,9 +26027,9 @@ var require_useRadioGroup_native = __commonJS({
|
|
|
26027
26027
|
"ArrowLeft",
|
|
26028
26028
|
"ArrowRight"
|
|
26029
26029
|
], useRadioGroupItem = function(params) {
|
|
26030
|
-
var { radioGroupContext, value
|
|
26030
|
+
var { radioGroupContext, value, labelledBy: ariaLabelledby, disabled: itemDisabled, ref: refProp, id, onPress, onKeyDown, onFocus } = params, { value: groupValue, disabled, required, onChange, name, native, accentColor } = (0, import_react3.useContext)(radioGroupContext), [button, setButton] = (0, import_react3.useState)(null), hasConsumerStoppedPropagationRef = (0, import_react3.useRef)(!1), ref = (0, import_react3.useRef)(null), composedRefs = (0, import_compose_refs.useComposedRefs)(refProp, function(node) {
|
|
26031
26031
|
return setButton(node);
|
|
26032
|
-
}, ref), isArrowKeyPressedRef = (0, import_react3.useRef)(!1), isFormControl = import_constants4.isWeb ? button ? !!button.closest("form") : !0 : !1, checked = groupValue ===
|
|
26032
|
+
}, ref), isArrowKeyPressedRef = (0, import_react3.useRef)(!1), isFormControl = import_constants4.isWeb ? button ? !!button.closest("form") : !0 : !1, checked = groupValue === value, labelId = (0, import_label.useLabelContext)(button), labelledBy = ariaLabelledby || labelId;
|
|
26033
26033
|
(0, import_react3.useEffect)(function() {
|
|
26034
26034
|
if (import_constants4.isWeb) {
|
|
26035
26035
|
var handleKeyDown = function(event) {
|
|
@@ -26044,14 +26044,14 @@ var require_useRadioGroup_native = __commonJS({
|
|
|
26044
26044
|
}, []), (0, import_react3.useEffect)(function() {
|
|
26045
26045
|
if (id && !disabled) return (0, import_focusable2.registerFocusable)(id, {
|
|
26046
26046
|
focusAndSelect: function() {
|
|
26047
|
-
onChange == null || onChange(
|
|
26047
|
+
onChange == null || onChange(value);
|
|
26048
26048
|
},
|
|
26049
26049
|
focus: function() {
|
|
26050
26050
|
}
|
|
26051
26051
|
});
|
|
26052
26052
|
}, [
|
|
26053
26053
|
id,
|
|
26054
|
-
|
|
26054
|
+
value,
|
|
26055
26055
|
disabled
|
|
26056
26056
|
]);
|
|
26057
26057
|
var isDisabled = disabled || itemDisabled;
|
|
@@ -26066,7 +26066,7 @@ var require_useRadioGroup_native = __commonJS({
|
|
|
26066
26066
|
control: button,
|
|
26067
26067
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
26068
26068
|
name,
|
|
26069
|
-
value
|
|
26069
|
+
value,
|
|
26070
26070
|
checked,
|
|
26071
26071
|
required,
|
|
26072
26072
|
disabled: isDisabled,
|
|
@@ -26087,11 +26087,11 @@ var require_useRadioGroup_native = __commonJS({
|
|
|
26087
26087
|
ref: composedRefs,
|
|
26088
26088
|
...import_constants4.isWeb && {
|
|
26089
26089
|
type: "button",
|
|
26090
|
-
value
|
|
26090
|
+
value
|
|
26091
26091
|
},
|
|
26092
26092
|
id,
|
|
26093
26093
|
onPress: (0, import_helpers.composeEventHandlers)(onPress, function(event) {
|
|
26094
|
-
checked || onChange == null || onChange(
|
|
26094
|
+
checked || onChange == null || onChange(value), isFormControl && (hasConsumerStoppedPropagationRef.current = event.isPropagationStopped(), hasConsumerStoppedPropagationRef.current || event.stopPropagation());
|
|
26095
26095
|
}),
|
|
26096
26096
|
...import_constants4.isWeb && {
|
|
26097
26097
|
onKeyDown: (0, import_helpers.composeEventHandlers)(onKeyDown, function(event) {
|
|
@@ -26352,11 +26352,11 @@ var require_createRadioGroup_native = __commonJS({
|
|
|
26352
26352
|
var { disableActiveTheme, Frame = import_RadioGroup.RadioGroupFrame, Indicator = import_RadioGroup.RadioGroupIndicatorFrame, Item = import_RadioGroup.RadioGroupItemFrame } = createProps;
|
|
26353
26353
|
ensureContext(Frame), ensureContext(Indicator), ensureContext(Item);
|
|
26354
26354
|
var RadioGroupImp = Frame.styleable(function(props, ref) {
|
|
26355
|
-
var { value
|
|
26355
|
+
var { value, defaultValue, onValueChange, required = !1, disabled = !1, name, native, accentColor, orientation = "vertical", ...rest } = props, { providerValue, frameAttrs, rovingFocusGroupAttrs } = (0, import_radio_headless.useRadioGroup)({
|
|
26356
26356
|
orientation,
|
|
26357
26357
|
name,
|
|
26358
26358
|
defaultValue,
|
|
26359
|
-
value
|
|
26359
|
+
value,
|
|
26360
26360
|
onValueChange,
|
|
26361
26361
|
required,
|
|
26362
26362
|
disabled,
|
|
@@ -26376,7 +26376,7 @@ var require_createRadioGroup_native = __commonJS({
|
|
|
26376
26376
|
});
|
|
26377
26377
|
}), RadioGroupItemImp = Item.styleable(function(props, ref) {
|
|
26378
26378
|
var {
|
|
26379
|
-
value
|
|
26379
|
+
value,
|
|
26380
26380
|
labelledBy,
|
|
26381
26381
|
onPress,
|
|
26382
26382
|
//@ts-expect-error
|
|
@@ -26386,7 +26386,7 @@ var require_createRadioGroup_native = __commonJS({
|
|
|
26386
26386
|
...rest
|
|
26387
26387
|
} = props, { providerValue, bubbleInput, rovingFocusGroupAttrs, frameAttrs, isFormControl, native } = (0, import_radio_headless.useRadioGroupItem)({
|
|
26388
26388
|
radioGroupContext: RadioGroupContext,
|
|
26389
|
-
value
|
|
26389
|
+
value,
|
|
26390
26390
|
id,
|
|
26391
26391
|
labelledBy,
|
|
26392
26392
|
disabled,
|
|
@@ -26999,41 +26999,41 @@ var require_SelectItem_native = __commonJS({
|
|
|
26999
26999
|
});
|
|
27000
27000
|
module2.exports = __toCommonJS2(SelectItem_exports);
|
|
27001
27001
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native(), import_list_item = require_index_native55(), import_core12 = require_index_native20(), React4 = __toESM2(require("react")), import_context = require_context_native2(), ITEM_NAME = "SelectItem", { Provider: SelectItemContextProvider, useStyledContext: useSelectItemContext } = (0, import_core12.createStyledContext)(null, ITEM_NAME), SelectItem = import_list_item.ListItemFrame.styleable(function(props, forwardedRef) {
|
|
27002
|
-
var { scope, value
|
|
27002
|
+
var { scope, value, disabled = !1, textValue: textValueProp, index, ...restProps } = props, { props: listItemProps } = (0, import_list_item.useListItem)({
|
|
27003
27003
|
...!props.unstyled && {
|
|
27004
27004
|
ellipse: !0
|
|
27005
27005
|
},
|
|
27006
27006
|
...restProps
|
|
27007
|
-
}), context = (0, import_context.useSelectItemParentContext)(scope), { setSelectedIndex, listRef, setOpen, onChange, activeIndexSubscribe, valueSubscribe, allowMouseUpRef, allowSelectRef, setValueAtIndex, selectTimeoutRef, dataRef, interactions, shouldRenderWebNative, size: size2, onActiveChange, initialValue } = context, [isSelected, setSelected] = React4.useState(initialValue ===
|
|
27007
|
+
}), context = (0, import_context.useSelectItemParentContext)(scope), { setSelectedIndex, listRef, setOpen, onChange, activeIndexSubscribe, valueSubscribe, allowMouseUpRef, allowSelectRef, setValueAtIndex, selectTimeoutRef, dataRef, interactions, shouldRenderWebNative, size: size2, onActiveChange, initialValue } = context, [isSelected, setSelected] = React4.useState(initialValue === value);
|
|
27008
27008
|
React4.useEffect(function() {
|
|
27009
27009
|
return activeIndexSubscribe(function(i) {
|
|
27010
27010
|
var isActive = index === i;
|
|
27011
27011
|
if (isActive) {
|
|
27012
27012
|
var _listRef_current_index;
|
|
27013
|
-
onActiveChange(
|
|
27013
|
+
onActiveChange(value, index), listRef == null || (_listRef_current_index = listRef.current[index]) === null || _listRef_current_index === void 0 || _listRef_current_index.focus();
|
|
27014
27014
|
}
|
|
27015
27015
|
});
|
|
27016
27016
|
}, [
|
|
27017
27017
|
index
|
|
27018
27018
|
]), React4.useEffect(function() {
|
|
27019
27019
|
return valueSubscribe(function(val) {
|
|
27020
|
-
setSelected(val ===
|
|
27020
|
+
setSelected(val === value);
|
|
27021
27021
|
});
|
|
27022
27022
|
}, [
|
|
27023
|
-
|
|
27023
|
+
value
|
|
27024
27024
|
]);
|
|
27025
27025
|
var textId = React4.useId(), refCallback = React4.useCallback(function(node) {
|
|
27026
27026
|
import_constants4.isWeb && node instanceof HTMLElement && listRef && (listRef.current[index] = node);
|
|
27027
27027
|
}, []), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, refCallback);
|
|
27028
27028
|
(0, import_constants4.useIsomorphicLayoutEffect)(function() {
|
|
27029
|
-
setValueAtIndex(index,
|
|
27029
|
+
setValueAtIndex(index, value);
|
|
27030
27030
|
}, [
|
|
27031
27031
|
index,
|
|
27032
27032
|
setValueAtIndex,
|
|
27033
|
-
|
|
27033
|
+
value
|
|
27034
27034
|
]);
|
|
27035
27035
|
function handleSelect() {
|
|
27036
|
-
setSelectedIndex(index), onChange(
|
|
27036
|
+
setSelectedIndex(index), onChange(value), setOpen(!1);
|
|
27037
27037
|
}
|
|
27038
27038
|
var selectItemProps = React4.useMemo(function() {
|
|
27039
27039
|
return interactions ? interactions.getItemProps({
|
|
@@ -27062,11 +27062,11 @@ var require_SelectItem_native = __commonJS({
|
|
|
27062
27062
|
]);
|
|
27063
27063
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectItemContextProvider, {
|
|
27064
27064
|
scope,
|
|
27065
|
-
value
|
|
27065
|
+
value,
|
|
27066
27066
|
textId: textId || "",
|
|
27067
27067
|
isSelected,
|
|
27068
27068
|
children: shouldRenderWebNative ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", {
|
|
27069
|
-
value
|
|
27069
|
+
value,
|
|
27070
27070
|
children: props.children
|
|
27071
27071
|
}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_list_item.ListItemFrame, {
|
|
27072
27072
|
tag: "div",
|
|
@@ -27770,9 +27770,9 @@ var require_Select_native = __commonJS({
|
|
|
27770
27770
|
function useEmitter() {
|
|
27771
27771
|
var listeners = React4.useRef(null);
|
|
27772
27772
|
listeners.current || (listeners.current = /* @__PURE__ */ new Set());
|
|
27773
|
-
var emit = function(
|
|
27773
|
+
var emit = function(value) {
|
|
27774
27774
|
listeners.current.forEach(function(l) {
|
|
27775
|
-
return l(
|
|
27775
|
+
return l(value);
|
|
27776
27776
|
});
|
|
27777
27777
|
}, subscribe = React4.useCallback(function(listener) {
|
|
27778
27778
|
return listeners.current.add(listener), function() {
|
|
@@ -27791,25 +27791,25 @@ var require_Select_native = __commonJS({
|
|
|
27791
27791
|
prop: openProp,
|
|
27792
27792
|
defaultProp: defaultOpen || !1,
|
|
27793
27793
|
onChange: onOpenChange
|
|
27794
|
-
}), [
|
|
27794
|
+
}), [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
27795
27795
|
prop: valueProp,
|
|
27796
27796
|
defaultProp: defaultValue || "",
|
|
27797
27797
|
onChange: onValueChange,
|
|
27798
27798
|
transition: !0
|
|
27799
27799
|
});
|
|
27800
27800
|
React4.useEffect(function() {
|
|
27801
|
-
open && emitValue(
|
|
27801
|
+
open && emitValue(value);
|
|
27802
27802
|
}, [
|
|
27803
27803
|
open
|
|
27804
27804
|
]), React4.useEffect(function() {
|
|
27805
|
-
emitValue(
|
|
27805
|
+
emitValue(value);
|
|
27806
27806
|
}, [
|
|
27807
|
-
|
|
27807
|
+
value
|
|
27808
27808
|
]), React4.useEffect(function() {
|
|
27809
27809
|
if (props.id) return (0, import_focusable2.registerFocusable)(props.id, {
|
|
27810
27810
|
focusAndSelect: function() {
|
|
27811
|
-
setOpen == null || setOpen(function(
|
|
27812
|
-
return !
|
|
27811
|
+
setOpen == null || setOpen(function(value2) {
|
|
27812
|
+
return !value2;
|
|
27813
27813
|
});
|
|
27814
27814
|
},
|
|
27815
27815
|
focus: function() {
|
|
@@ -27832,7 +27832,7 @@ var require_Select_native = __commonJS({
|
|
|
27832
27832
|
scope,
|
|
27833
27833
|
adaptScope,
|
|
27834
27834
|
initialValue: React4.useMemo(function() {
|
|
27835
|
-
return
|
|
27835
|
+
return value;
|
|
27836
27836
|
}, [
|
|
27837
27837
|
open
|
|
27838
27838
|
]),
|
|
@@ -27844,12 +27844,12 @@ var require_Select_native = __commonJS({
|
|
|
27844
27844
|
onChange: React4.useCallback(function(val) {
|
|
27845
27845
|
setValue(val), emitValue(val);
|
|
27846
27846
|
}, []),
|
|
27847
|
-
onActiveChange: (0, import_core12.useEvent)(function(
|
|
27848
|
-
onActiveChange == null || onActiveChange(
|
|
27847
|
+
onActiveChange: (0, import_core12.useEvent)(function(value2, index) {
|
|
27848
|
+
onActiveChange == null || onActiveChange(value2, index);
|
|
27849
27849
|
}),
|
|
27850
27850
|
setSelectedIndex,
|
|
27851
|
-
setValueAtIndex: React4.useCallback(function(index,
|
|
27852
|
-
listContentRef.current[index] =
|
|
27851
|
+
setValueAtIndex: React4.useCallback(function(index, value2) {
|
|
27852
|
+
listContentRef.current[index] = value2;
|
|
27853
27853
|
}, []),
|
|
27854
27854
|
shouldRenderWebNative,
|
|
27855
27855
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_context.SelectProvider, {
|
|
@@ -27868,7 +27868,7 @@ var require_Select_native = __commonJS({
|
|
|
27868
27868
|
activeIndex,
|
|
27869
27869
|
selectedIndex,
|
|
27870
27870
|
setActiveIndex: setActiveIndexDebounced,
|
|
27871
|
-
value
|
|
27871
|
+
value,
|
|
27872
27872
|
open,
|
|
27873
27873
|
native,
|
|
27874
27874
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectSheetController, {
|
|
@@ -27880,7 +27880,7 @@ var require_Select_native = __commonJS({
|
|
|
27880
27880
|
selectedIndexRef,
|
|
27881
27881
|
...props,
|
|
27882
27882
|
open,
|
|
27883
|
-
value
|
|
27883
|
+
value,
|
|
27884
27884
|
children
|
|
27885
27885
|
})
|
|
27886
27886
|
})
|
|
@@ -28108,9 +28108,9 @@ var require_helpers_native3 = __commonJS({
|
|
|
28108
28108
|
return a - b;
|
|
28109
28109
|
});
|
|
28110
28110
|
}
|
|
28111
|
-
function convertValueToPercentage(
|
|
28111
|
+
function convertValueToPercentage(value, min, max) {
|
|
28112
28112
|
var maxSteps = max - min, percentPerStep = 100 / maxSteps;
|
|
28113
|
-
return percentPerStep * (
|
|
28113
|
+
return percentPerStep * (value - min);
|
|
28114
28114
|
}
|
|
28115
28115
|
function getLabel(index, totalValues) {
|
|
28116
28116
|
if (totalValues > 2) return `Value ${index + 1} of ${totalValues}`;
|
|
@@ -28121,8 +28121,8 @@ var require_helpers_native3 = __commonJS({
|
|
|
28121
28121
|
}
|
|
28122
28122
|
function getClosestValueIndex(values, nextValue) {
|
|
28123
28123
|
if (values.length === 1) return 0;
|
|
28124
|
-
var distances = values.map(function(
|
|
28125
|
-
return Math.abs(
|
|
28124
|
+
var distances = values.map(function(value) {
|
|
28125
|
+
return Math.abs(value - nextValue);
|
|
28126
28126
|
}), closestDistance = Math.min(...distances);
|
|
28127
28127
|
return distances.indexOf(closestDistance);
|
|
28128
28128
|
}
|
|
@@ -28137,8 +28137,8 @@ var require_helpers_native3 = __commonJS({
|
|
|
28137
28137
|
return (quarterWidth - offset2(left) * direction) * direction;
|
|
28138
28138
|
}
|
|
28139
28139
|
function getStepsBetweenValues(values) {
|
|
28140
|
-
return values.slice(0, -1).map(function(
|
|
28141
|
-
return values[index + 1] -
|
|
28140
|
+
return values.slice(0, -1).map(function(value, index) {
|
|
28141
|
+
return values[index + 1] - value;
|
|
28142
28142
|
});
|
|
28143
28143
|
}
|
|
28144
28144
|
function hasMinStepsBetweenValues(values, minStepsBetweenValues) {
|
|
@@ -28149,18 +28149,18 @@ var require_helpers_native3 = __commonJS({
|
|
|
28149
28149
|
return !0;
|
|
28150
28150
|
}
|
|
28151
28151
|
function linearScale(input, output) {
|
|
28152
|
-
return function(
|
|
28152
|
+
return function(value) {
|
|
28153
28153
|
if (input[0] === input[1] || output[0] === output[1]) return output[0];
|
|
28154
28154
|
var ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
28155
|
-
return output[0] + ratio * (
|
|
28155
|
+
return output[0] + ratio * (value - input[0]);
|
|
28156
28156
|
};
|
|
28157
28157
|
}
|
|
28158
|
-
function getDecimalCount(
|
|
28159
|
-
return (String(
|
|
28158
|
+
function getDecimalCount(value) {
|
|
28159
|
+
return (String(value).split(".")[1] || "").length;
|
|
28160
28160
|
}
|
|
28161
|
-
function roundValue(
|
|
28161
|
+
function roundValue(value, decimalCount) {
|
|
28162
28162
|
var rounder = Math.pow(10, decimalCount);
|
|
28163
|
-
return Math.round(
|
|
28163
|
+
return Math.round(value * rounder) / rounder;
|
|
28164
28164
|
}
|
|
28165
28165
|
}
|
|
28166
28166
|
});
|
|
@@ -28400,8 +28400,8 @@ var require_Slider_native = __commonJS({
|
|
|
28400
28400
|
] : [
|
|
28401
28401
|
max,
|
|
28402
28402
|
min
|
|
28403
|
-
],
|
|
28404
|
-
return
|
|
28403
|
+
], value = (0, import_helpers3.linearScale)(input, output);
|
|
28404
|
+
return value(pointerPosition);
|
|
28405
28405
|
}
|
|
28406
28406
|
var measure = function() {
|
|
28407
28407
|
var _sliderRef_current;
|
|
@@ -28449,16 +28449,16 @@ var require_Slider_native = __commonJS({
|
|
|
28449
28449
|
orientation: "horizontal",
|
|
28450
28450
|
onLayout: measure,
|
|
28451
28451
|
onSlideStart: function(event, target) {
|
|
28452
|
-
var
|
|
28453
|
-
|
|
28452
|
+
var value = getValueFromPointer(event.nativeEvent.locationX);
|
|
28453
|
+
value && (onSlideStart == null || onSlideStart(value, target, event));
|
|
28454
28454
|
},
|
|
28455
28455
|
onSlideMove: function(event) {
|
|
28456
|
-
var
|
|
28457
|
-
|
|
28456
|
+
var value = getValueFromPointer(event.nativeEvent.pageX - state.offset);
|
|
28457
|
+
value && (onSlideMove == null || onSlideMove(value, event));
|
|
28458
28458
|
},
|
|
28459
28459
|
onSlideEnd: function(event) {
|
|
28460
|
-
var
|
|
28461
|
-
|
|
28460
|
+
var value = getValueFromPointer(event.nativeEvent.pageX - state.offset);
|
|
28461
|
+
value && (onSlideEnd == null || onSlideEnd(event, value));
|
|
28462
28462
|
},
|
|
28463
28463
|
onStepKeyDown: function(event) {
|
|
28464
28464
|
var isBackKey = import_constants22.BACK_KEYS[direction].includes(event.key);
|
|
@@ -28495,8 +28495,8 @@ var require_Slider_native = __commonJS({
|
|
|
28495
28495
|
], output = [
|
|
28496
28496
|
max,
|
|
28497
28497
|
min
|
|
28498
|
-
],
|
|
28499
|
-
return
|
|
28498
|
+
], value = (0, import_helpers3.linearScale)(input, output);
|
|
28499
|
+
return value(pointerPosition);
|
|
28500
28500
|
}
|
|
28501
28501
|
var measure = function() {
|
|
28502
28502
|
var _sliderRef_current;
|
|
@@ -28520,16 +28520,16 @@ var require_Slider_native = __commonJS({
|
|
|
28520
28520
|
orientation: "vertical",
|
|
28521
28521
|
onLayout: measure,
|
|
28522
28522
|
onSlideStart: function(event, target) {
|
|
28523
|
-
var
|
|
28524
|
-
|
|
28523
|
+
var value = getValueFromPointer(event.nativeEvent.locationY);
|
|
28524
|
+
value && (onSlideStart == null || onSlideStart(value, target, event));
|
|
28525
28525
|
},
|
|
28526
28526
|
onSlideMove: function(event) {
|
|
28527
|
-
var
|
|
28528
|
-
|
|
28527
|
+
var value = getValueFromPointer(event.nativeEvent.pageY - state.offset);
|
|
28528
|
+
value && (onSlideMove == null || onSlideMove(value, event));
|
|
28529
28529
|
},
|
|
28530
28530
|
onSlideEnd: function(event) {
|
|
28531
|
-
var
|
|
28532
|
-
onSlideEnd == null || onSlideEnd(event,
|
|
28531
|
+
var value = getValueFromPointer(event.nativeEvent.pageY - state.offset);
|
|
28532
|
+
onSlideEnd == null || onSlideEnd(event, value);
|
|
28533
28533
|
},
|
|
28534
28534
|
onStepKeyDown: function(event) {
|
|
28535
28535
|
var isBackKey = import_constants22.BACK_KEYS.ltr.includes(event.key);
|
|
@@ -28575,8 +28575,8 @@ var require_Slider_native = __commonJS({
|
|
|
28575
28575
|
position: "absolute",
|
|
28576
28576
|
pointerEvents: "box-none"
|
|
28577
28577
|
}), SliderTrackActive = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
28578
|
-
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(
|
|
28579
|
-
return (0, import_helpers3.convertValueToPercentage)(
|
|
28578
|
+
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) {
|
|
28579
|
+
return (0, import_helpers3.convertValueToPercentage)(value, context.min, context.max);
|
|
28580
28580
|
}), offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0, offsetEnd = 100 - Math.max(...percentages);
|
|
28581
28581
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SliderTrackActiveFrame, {
|
|
28582
28582
|
orientation: context.orientation,
|
|
@@ -28634,7 +28634,7 @@ var require_Slider_native = __commonJS({
|
|
|
28634
28634
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
28635
28635
|
}
|
|
28636
28636
|
}), SliderThumb = SliderThumbFrame.styleable(function(props, forwardedRef) {
|
|
28637
|
-
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),
|
|
28637
|
+
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", [size2, setSize] = React4.useState(function() {
|
|
28638
28638
|
var estimatedSize = (0, import_core12.getVariableValue)(getThumbSize(sizeIn).width);
|
|
28639
28639
|
return estimatedSize;
|
|
28640
28640
|
}), thumbInBoundsOffset = size2 ? (0, import_helpers3.getThumbInBoundsOffset)(size2, percent, orientation.direction) : 0;
|
|
@@ -28669,7 +28669,7 @@ var require_Slider_native = __commonJS({
|
|
|
28669
28669
|
role: "slider",
|
|
28670
28670
|
"aria-label": props["aria-label"] || label,
|
|
28671
28671
|
"aria-valuemin": context.min,
|
|
28672
|
-
"aria-valuenow":
|
|
28672
|
+
"aria-valuenow": value,
|
|
28673
28673
|
"aria-valuemax": context.max,
|
|
28674
28674
|
"aria-orientation": context.orientation,
|
|
28675
28675
|
"data-orientation": context.orientation,
|
|
@@ -28708,13 +28708,13 @@ var require_Slider_native = __commonJS({
|
|
|
28708
28708
|
}), SliderComponent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
|
|
28709
28709
|
var { name, min = 0, max = 100, step = 1, orientation = "horizontal", disabled = !1, minStepsBetweenThumbs = 0, defaultValue = [
|
|
28710
28710
|
min
|
|
28711
|
-
], value
|
|
28711
|
+
], value, onValueChange = function() {
|
|
28712
28712
|
}, size: sizeProp, onSlideEnd, onSlideMove, onSlideStart, ...sliderProps } = props, sliderRef = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(sliderRef, forwardedRef), thumbRefs = React4.useRef(/* @__PURE__ */ new Map()), valueIndexToChangeRef = React4.useRef(0), isHorizontal = orientation === "horizontal", [values = [], setValues] = (0, import_use_controllable_state.useControllableState)({
|
|
28713
|
-
prop:
|
|
28713
|
+
prop: value,
|
|
28714
28714
|
defaultProp: defaultValue,
|
|
28715
28715
|
transition: !0,
|
|
28716
|
-
onChange: function(
|
|
28717
|
-
updateThumbFocus(valueIndexToChangeRef.current), onValueChange(
|
|
28716
|
+
onChange: function(value2) {
|
|
28717
|
+
updateThumbFocus(valueIndexToChangeRef.current), onValueChange(value2);
|
|
28718
28718
|
}
|
|
28719
28719
|
});
|
|
28720
28720
|
import_constants4.isWeb && React4.useEffect(function() {
|
|
@@ -28750,11 +28750,11 @@ var require_Slider_native = __commonJS({
|
|
|
28750
28750
|
}
|
|
28751
28751
|
}
|
|
28752
28752
|
}
|
|
28753
|
-
function handleSlideMove(
|
|
28754
|
-
updateValues(
|
|
28753
|
+
function handleSlideMove(value2, event) {
|
|
28754
|
+
updateValues(value2, valueIndexToChangeRef.current), onSlideMove == null || onSlideMove(event, value2);
|
|
28755
28755
|
}
|
|
28756
|
-
function updateValues(
|
|
28757
|
-
var decimalCount = (0, import_helpers3.getDecimalCount)(step), snapToStep = (0, import_helpers3.roundValue)(Math.round((
|
|
28756
|
+
function updateValues(value2, atIndex) {
|
|
28757
|
+
var decimalCount = (0, import_helpers3.getDecimalCount)(step), snapToStep = (0, import_helpers3.roundValue)(Math.round((value2 - min) / step) * step + min, decimalCount), nextValue = (0, import_helpers2.clamp)(snapToStep, [
|
|
28758
28758
|
min,
|
|
28759
28759
|
max
|
|
28760
28760
|
]);
|
|
@@ -28782,12 +28782,12 @@ var require_Slider_native = __commonJS({
|
|
|
28782
28782
|
min,
|
|
28783
28783
|
max,
|
|
28784
28784
|
onSlideEnd,
|
|
28785
|
-
onSlideStart: disabled ? void 0 : function(
|
|
28785
|
+
onSlideStart: disabled ? void 0 : function(value2, target, event) {
|
|
28786
28786
|
if (target !== "thumb") {
|
|
28787
|
-
var closestIndex = (0, import_helpers3.getClosestValueIndex)(values,
|
|
28788
|
-
updateValues(
|
|
28787
|
+
var closestIndex = (0, import_helpers3.getClosestValueIndex)(values, value2);
|
|
28788
|
+
updateValues(value2, closestIndex);
|
|
28789
28789
|
}
|
|
28790
|
-
onSlideStart == null || onSlideStart(event,
|
|
28790
|
+
onSlideStart == null || onSlideStart(event, value2, target);
|
|
28791
28791
|
},
|
|
28792
28792
|
onSlideMove: disabled ? void 0 : handleSlideMove,
|
|
28793
28793
|
onHomeKeyDown: function() {
|
|
@@ -28799,8 +28799,8 @@ var require_Slider_native = __commonJS({
|
|
|
28799
28799
|
onStepKeyDown: function(param) {
|
|
28800
28800
|
var { event, direction: stepDirection } = param;
|
|
28801
28801
|
if (!disabled) {
|
|
28802
|
-
var isPageKey = import_constants22.PAGE_KEYS.includes(event.key), isSkipKey = isPageKey || event.shiftKey && import_constants22.ARROW_KEYS.includes(event.key), multiplier = isSkipKey ? 10 : 1, atIndex = valueIndexToChangeRef.current,
|
|
28803
|
-
updateValues(
|
|
28802
|
+
var isPageKey = import_constants22.PAGE_KEYS.includes(event.key), isSkipKey = isPageKey || event.shiftKey && import_constants22.ARROW_KEYS.includes(event.key), multiplier = isSkipKey ? 10 : 1, atIndex = valueIndexToChangeRef.current, value2 = values[atIndex], stepInDirection = step * multiplier * stepDirection;
|
|
28803
|
+
updateValues(value2 + stepInDirection, atIndex);
|
|
28804
28804
|
}
|
|
28805
28805
|
}
|
|
28806
28806
|
})
|
|
@@ -28937,7 +28937,7 @@ var require_useSwitch_native = __commonJS({
|
|
|
28937
28937
|
switchRef: ref,
|
|
28938
28938
|
bubbleInput: null
|
|
28939
28939
|
};
|
|
28940
|
-
var disabled, name,
|
|
28940
|
+
var disabled, name, value, required, hasConsumerStoppedPropagationRef, button, setButton, composedRefs, isFormControl, labelId, ariaLabelledBy;
|
|
28941
28941
|
}
|
|
28942
28942
|
}
|
|
28943
28943
|
});
|
|
@@ -29258,8 +29258,8 @@ var require_createSwitch_native = __commonJS({
|
|
|
29258
29258
|
React4.useEffect(function() {
|
|
29259
29259
|
if (props.id && !props.disabled) return (0, import_focusable2.registerFocusable)(props.id, {
|
|
29260
29260
|
focusAndSelect: function() {
|
|
29261
|
-
setChecked == null || setChecked(function(
|
|
29262
|
-
return !
|
|
29261
|
+
setChecked == null || setChecked(function(value2) {
|
|
29262
|
+
return !value2;
|
|
29263
29263
|
});
|
|
29264
29264
|
},
|
|
29265
29265
|
focus: function() {
|
|
@@ -29275,7 +29275,7 @@ var require_createSwitch_native = __commonJS({
|
|
|
29275
29275
|
onValueChange: setChecked,
|
|
29276
29276
|
...nativeProps
|
|
29277
29277
|
});
|
|
29278
|
-
var disabled = props.disabled,
|
|
29278
|
+
var disabled = props.disabled, value = React4.useMemo(function() {
|
|
29279
29279
|
return {
|
|
29280
29280
|
checked,
|
|
29281
29281
|
disabled,
|
|
@@ -29290,7 +29290,7 @@ var require_createSwitch_native = __commonJS({
|
|
|
29290
29290
|
next !== frameWidth && setFrameInnerWidth(next);
|
|
29291
29291
|
}, _styledContext_unstyled, _ref3, unstyled = (_ref3 = (_styledContext_unstyled = styledContext.unstyled) !== null && _styledContext_unstyled !== void 0 ? _styledContext_unstyled : props.unstyled) !== null && _ref3 !== void 0 ? _ref3 : !1, _styledContext_size, _ref4;
|
|
29292
29292
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(SwitchContext.Provider, {
|
|
29293
|
-
value
|
|
29293
|
+
value,
|
|
29294
29294
|
children: [
|
|
29295
29295
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Frame, {
|
|
29296
29296
|
ref: switchRef,
|
|
@@ -29621,7 +29621,7 @@ var require_createTabs_native = __commonJS({
|
|
|
29621
29621
|
});
|
|
29622
29622
|
TabsList.displayName = TAB_LIST_NAME;
|
|
29623
29623
|
var TRIGGER_NAME = "TabsTrigger", TabsTrigger = TabFrame.styleable(function(props, forwardedRef) {
|
|
29624
|
-
var { __scopeTabs, value
|
|
29624
|
+
var { __scopeTabs, value, disabled = !1, onInteraction, disableActiveTheme, ...triggerProps } = props, context = (0, import_StyledContext.useTabsContext)(__scopeTabs), triggerId = makeTriggerId(context.baseId, value), contentId = makeContentId(context.baseId, value), isSelected = value === context.value, [layout, setLayout] = React4.useState(null), triggerRef = React4.useRef(null), groupItemProps = (0, import_group.useGroupItem)({
|
|
29625
29625
|
disabled: !!disabled
|
|
29626
29626
|
});
|
|
29627
29627
|
React4.useEffect(function() {
|
|
@@ -29649,7 +29649,7 @@ var require_createTabs_native = __commonJS({
|
|
|
29649
29649
|
isSelected && layout && (onInteraction == null || onInteraction("select", layout));
|
|
29650
29650
|
}, [
|
|
29651
29651
|
isSelected,
|
|
29652
|
-
|
|
29652
|
+
value,
|
|
29653
29653
|
layout
|
|
29654
29654
|
]);
|
|
29655
29655
|
var _props_onPress;
|
|
@@ -29688,7 +29688,7 @@ var require_createTabs_native = __commonJS({
|
|
|
29688
29688
|
ref: (0, import_compose_refs.composeRefs)(forwardedRef, triggerRef),
|
|
29689
29689
|
onPress: (0, import_helpers.composeEventHandlers)((_props_onPress = props.onPress) !== null && _props_onPress !== void 0 ? _props_onPress : void 0, function(event) {
|
|
29690
29690
|
var webChecks = !import_constants4.isWeb || event.button === 0 && event.ctrlKey === !1;
|
|
29691
|
-
!disabled && !isSelected && webChecks ? context.onChange(
|
|
29691
|
+
!disabled && !isSelected && webChecks ? context.onChange(value) : event.preventDefault();
|
|
29692
29692
|
}),
|
|
29693
29693
|
...import_constants4.isWeb && {
|
|
29694
29694
|
type: "button",
|
|
@@ -29696,12 +29696,12 @@ var require_createTabs_native = __commonJS({
|
|
|
29696
29696
|
[
|
|
29697
29697
|
" ",
|
|
29698
29698
|
"Enter"
|
|
29699
|
-
].includes(event.key) && (context.onChange(
|
|
29699
|
+
].includes(event.key) && (context.onChange(value), event.preventDefault());
|
|
29700
29700
|
}),
|
|
29701
29701
|
onFocus: (0, import_helpers.composeEventHandlers)(props.onFocus, function(event) {
|
|
29702
29702
|
layout && (onInteraction == null || onInteraction("focus", layout));
|
|
29703
29703
|
var isAutomaticActivation = context.activationMode !== "manual";
|
|
29704
|
-
!isSelected && !disabled && isAutomaticActivation && context.onChange(
|
|
29704
|
+
!isSelected && !disabled && isAutomaticActivation && context.onChange(value);
|
|
29705
29705
|
}),
|
|
29706
29706
|
onBlur: (0, import_helpers.composeEventHandlers)(props.onFocus, function() {
|
|
29707
29707
|
onInteraction == null || onInteraction("focus", null);
|
|
@@ -29713,7 +29713,7 @@ var require_createTabs_native = __commonJS({
|
|
|
29713
29713
|
});
|
|
29714
29714
|
TabsTrigger.displayName = TRIGGER_NAME;
|
|
29715
29715
|
var TabsContent = ContentFrame.styleable(function(props, forwardedRef) {
|
|
29716
|
-
var { __scopeTabs, value
|
|
29716
|
+
var { __scopeTabs, value, forceMount, children, ...contentProps } = props, context = (0, import_StyledContext.useTabsContext)(__scopeTabs), isSelected = value === context.value, show = forceMount || isSelected, triggerId = makeTriggerId(context.baseId, value), contentId = makeContentId(context.baseId, value);
|
|
29717
29717
|
return show ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ContentFrame, {
|
|
29718
29718
|
"data-state": isSelected ? "active" : "inactive",
|
|
29719
29719
|
"data-orientation": context.orientation,
|
|
@@ -29726,9 +29726,9 @@ var require_createTabs_native = __commonJS({
|
|
|
29726
29726
|
...contentProps,
|
|
29727
29727
|
ref: forwardedRef,
|
|
29728
29728
|
children
|
|
29729
|
-
},
|
|
29729
|
+
}, value) : null;
|
|
29730
29730
|
}), TabsComponent = TabsFrame.styleable(function(props, forwardedRef) {
|
|
29731
|
-
var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size: size2 = "$true", ...tabsProps } = props, direction = (0, import_use_direction.useDirection)(dir), [
|
|
29731
|
+
var { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", size: size2 = "$true", ...tabsProps } = props, direction = (0, import_use_direction.useDirection)(dir), [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
29732
29732
|
prop: valueProp,
|
|
29733
29733
|
onChange: onValueChange,
|
|
29734
29734
|
defaultProp: defaultValue ?? ""
|
|
@@ -29744,7 +29744,7 @@ var require_createTabs_native = __commonJS({
|
|
|
29744
29744
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_StyledContext.TabsProvider, {
|
|
29745
29745
|
scope: __scopeTabs,
|
|
29746
29746
|
baseId: React4.useId(),
|
|
29747
|
-
value
|
|
29747
|
+
value,
|
|
29748
29748
|
onChange: setValue,
|
|
29749
29749
|
orientation,
|
|
29750
29750
|
dir: direction,
|
|
@@ -29772,11 +29772,11 @@ var require_createTabs_native = __commonJS({
|
|
|
29772
29772
|
Content: TabsContent
|
|
29773
29773
|
});
|
|
29774
29774
|
}
|
|
29775
|
-
function makeTriggerId(baseId,
|
|
29776
|
-
return `${baseId}-trigger-${
|
|
29775
|
+
function makeTriggerId(baseId, value) {
|
|
29776
|
+
return `${baseId}-trigger-${value}`;
|
|
29777
29777
|
}
|
|
29778
|
-
function makeContentId(baseId,
|
|
29779
|
-
return `${baseId}-content-${
|
|
29778
|
+
function makeContentId(baseId, value) {
|
|
29779
|
+
return `${baseId}-content-${value}`;
|
|
29780
29780
|
}
|
|
29781
29781
|
}
|
|
29782
29782
|
});
|
|
@@ -30450,7 +30450,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30450
30450
|
}));
|
|
30451
30451
|
ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
|
|
30452
30452
|
var ToggleGroupItemImpl = /* @__PURE__ */ import_react3.default.forwardRef(function(props, forwardedRef) {
|
|
30453
|
-
var { __scopeToggleGroup, value
|
|
30453
|
+
var { __scopeToggleGroup, value, ...itemProps } = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), singleProps = {
|
|
30454
30454
|
"aria-pressed": void 0
|
|
30455
30455
|
}, typeProps = valueContext.type === "single" ? singleProps : void 0;
|
|
30456
30456
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_Toggle.Toggle, {
|
|
@@ -30458,7 +30458,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30458
30458
|
...itemProps,
|
|
30459
30459
|
ref: forwardedRef,
|
|
30460
30460
|
onPressedChange: function(pressed) {
|
|
30461
|
-
pressed ? valueContext.onItemActivate(
|
|
30461
|
+
pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
|
|
30462
30462
|
}
|
|
30463
30463
|
});
|
|
30464
30464
|
}), ToggleGroup = (0, import_helpers.withStaticProperties)(/* @__PURE__ */ import_react3.default.forwardRef(function(props, forwardedRef) {
|
|
@@ -30493,7 +30493,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30493
30493
|
ToggleGroup.displayName = TOGGLE_GROUP_NAME;
|
|
30494
30494
|
var { Provider: ToggleGroupValueProvider, useStyledContext: useToggleGroupValueContext } = (0, import_web.createStyledContext)(), ToggleGroupImplSingle = /* @__PURE__ */ import_react3.default.forwardRef(function(props, forwardedRef) {
|
|
30495
30495
|
var { value: valueProp, defaultValue, onValueChange = function() {
|
|
30496
|
-
}, disableDeactivation = !1, ...toggleGroupSingleProps } = props, [
|
|
30496
|
+
}, disableDeactivation = !1, ...toggleGroupSingleProps } = props, [value, setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
30497
30497
|
prop: valueProp,
|
|
30498
30498
|
defaultProp: defaultValue,
|
|
30499
30499
|
onChange: onValueChange
|
|
@@ -30501,10 +30501,10 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30501
30501
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupValueProvider, {
|
|
30502
30502
|
scope: props.__scopeToggleGroup,
|
|
30503
30503
|
type: "single",
|
|
30504
|
-
value:
|
|
30505
|
-
|
|
30504
|
+
value: value ? [
|
|
30505
|
+
value
|
|
30506
30506
|
] : [],
|
|
30507
|
-
defaultValue:
|
|
30507
|
+
defaultValue: value,
|
|
30508
30508
|
onItemActivate: setValue,
|
|
30509
30509
|
onItemDeactivate: import_react3.default.useCallback(function() {
|
|
30510
30510
|
return disableDeactivation ? null : setValue("");
|
|
@@ -30519,7 +30519,7 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30519
30519
|
});
|
|
30520
30520
|
}), ToggleGroupImplMultiple = /* @__PURE__ */ import_react3.default.forwardRef(function(props, forwardedRef) {
|
|
30521
30521
|
var { value: valueProp, defaultValue, onValueChange = function() {
|
|
30522
|
-
}, disableDeactivation, ...toggleGroupMultipleProps } = props, [
|
|
30522
|
+
}, disableDeactivation, ...toggleGroupMultipleProps } = props, [value = [], setValue] = (0, import_use_controllable_state.useControllableState)({
|
|
30523
30523
|
prop: valueProp,
|
|
30524
30524
|
defaultProp: defaultValue,
|
|
30525
30525
|
onChange: onValueChange
|
|
@@ -30536,8 +30536,8 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30536
30536
|
]), handleButtonDeactivate = import_react3.default.useCallback(function(itemValue) {
|
|
30537
30537
|
return setValue(function() {
|
|
30538
30538
|
var prevValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
30539
|
-
return prevValue.filter(function(
|
|
30540
|
-
return
|
|
30539
|
+
return prevValue.filter(function(value2) {
|
|
30540
|
+
return value2 !== itemValue;
|
|
30541
30541
|
});
|
|
30542
30542
|
});
|
|
30543
30543
|
}, [
|
|
@@ -30546,8 +30546,8 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
30546
30546
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupValueProvider, {
|
|
30547
30547
|
scope: props.__scopeToggleGroup,
|
|
30548
30548
|
type: "multiple",
|
|
30549
|
-
value
|
|
30550
|
-
defaultValue:
|
|
30549
|
+
value,
|
|
30550
|
+
defaultValue: value,
|
|
30551
30551
|
onItemActivate: handleButtonActivate,
|
|
30552
30552
|
onItemDeactivate: handleButtonDeactivate,
|
|
30553
30553
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupImpl, {
|