tamagui 1.74.21 → 1.75.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/native.js +327 -139
- package/dist/native.js.map +3 -3
- package/dist/test.native.js +311 -125
- package/dist/test.native.js.map +3 -3
- package/package.json +52 -52
package/dist/native.js
CHANGED
|
@@ -3431,7 +3431,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3431
3431
|
}
|
|
3432
3432
|
updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
|
|
3433
3433
|
if (this.props = props, props.forceTheme)
|
|
3434
|
-
return this.state.theme = props.forceTheme, this.state.name = props.name || "", !0;
|
|
3434
|
+
return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
|
|
3435
3435
|
let nextState = this.getStateIfChanged(props);
|
|
3436
3436
|
if (nextState)
|
|
3437
3437
|
return this.updateState(nextState, shouldNotify), nextState;
|
|
@@ -3482,7 +3482,7 @@ var require_ThemeManager_native = __commonJS({
|
|
|
3482
3482
|
if (!baseManager && props.reset)
|
|
3483
3483
|
return process.env.NODE_ENV !== "production" && console.warn("Cannot reset, no parent theme exists"), null;
|
|
3484
3484
|
let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
|
|
3485
|
-
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][
|
|
3485
|
+
baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
|
|
3486
3486
|
let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
|
|
3487
3487
|
isDirectParentAComponentTheme && allComponentThemes.shift();
|
|
3488
3488
|
let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
|
|
@@ -3612,7 +3612,7 @@ var require_useTheme_native = __commonJS({
|
|
|
3612
3612
|
|
|
3613
3613
|
If this is intended and you are using Tamagui without any themes, you can disable this warning by setting the environment variable TAMAGUI_DISABLE_NO_THEME_WARNING=1`
|
|
3614
3614
|
);
|
|
3615
|
-
let themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state, themeManager, props.deopt, props.debug]);
|
|
3615
|
+
let themeProxied = (0, import_react2.useMemo)(() => !themeManager || !(state != null && state.theme) ? {} : getThemeProxied(state, props.deopt, themeManager, keys.current, props.debug), [state == null ? void 0 : state.theme, themeManager, props.deopt, props.debug]);
|
|
3616
3616
|
return process.env.NODE_ENV === "development" && props.debug === "verbose" && (console.groupCollapsed(" \u{1F539} useTheme =>", state == null ? void 0 : state.name), console.info("returning state", changedThemeState, "from props", props), console.groupEnd()), [changedThemeState, themeProxied];
|
|
3617
3617
|
};
|
|
3618
3618
|
function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
|
|
@@ -3714,17 +3714,20 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3714
3714
|
isNewTheme && themeManager && activeThemeManagers.add(themeManager), (isNewTheme || getShouldUpdateTheme(themeManager)) && setThemeState(createState);
|
|
3715
3715
|
let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
|
|
3716
3716
|
forced && setThemeState((prev) => createState(prev, !0));
|
|
3717
|
-
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3717
|
+
}), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
|
|
3718
|
+
(name, manager, forced) => {
|
|
3719
|
+
let force = forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"], shouldTryUpdate = force ?? !!(keys != null && keys.length || isNewTheme);
|
|
3720
|
+
process.env.NODE_ENV === "development" && props.debug && console.info(" \u{1F538} onChange", themeManager.id, {
|
|
3721
|
+
force,
|
|
3722
|
+
shouldTryUpdate,
|
|
3723
|
+
props,
|
|
3724
|
+
name,
|
|
3725
|
+
manager,
|
|
3726
|
+
keys
|
|
3727
|
+
}), shouldTryUpdate && setThemeState(createState);
|
|
3728
|
+
},
|
|
3729
|
+
themeManager.id
|
|
3730
|
+
);
|
|
3728
3731
|
return () => {
|
|
3729
3732
|
selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), activeThemeManagers.delete(themeManager);
|
|
3730
3733
|
};
|
|
@@ -3757,14 +3760,14 @@ If this is intended and you are using Tamagui without any themes, you can disabl
|
|
|
3757
3760
|
themeManager
|
|
3758
3761
|
};
|
|
3759
3762
|
function createState(prev, force = !1) {
|
|
3760
|
-
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1)
|
|
3763
|
+
if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
|
|
3761
3764
|
return prev;
|
|
3762
3765
|
let themeManager2 = parentManager, state2;
|
|
3763
3766
|
if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
|
|
3764
3767
|
let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
|
|
3765
3768
|
if (prev != null && prev.themeManager) {
|
|
3766
3769
|
themeManager2 = prev.themeManager;
|
|
3767
|
-
let forceChange = !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
3770
|
+
let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
|
|
3768
3771
|
themeManager2,
|
|
3769
3772
|
next,
|
|
3770
3773
|
prev.state,
|
|
@@ -4116,7 +4119,7 @@ var require_createComponent_native = __commonJS({
|
|
|
4116
4119
|
defaultPropsKeyOrder: defaultProps ? Object.keys(defaultProps) : []
|
|
4117
4120
|
});
|
|
4118
4121
|
let component = (0, import_react2.forwardRef)((propsIn, forwardedRef) => {
|
|
4119
|
-
var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m
|
|
4122
|
+
var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m;
|
|
4120
4123
|
if (process.env.NODE_ENV === "development" && startVisualizer && (startVisualizer(), startVisualizer = void 0), !hasSetupBaseViews) {
|
|
4121
4124
|
hasSetupBaseViews = !0;
|
|
4122
4125
|
let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
|
|
@@ -4202,14 +4205,9 @@ var require_createComponent_native = __commonJS({
|
|
|
4202
4205
|
componentName,
|
|
4203
4206
|
disable: disableTheme,
|
|
4204
4207
|
shallow: stateRef.current.themeShallow,
|
|
4205
|
-
// if this returns undefined it defers to the keys tracking, so its only used to force either updates or no updates
|
|
4206
|
-
shouldUpdate: () => (
|
|
4207
|
-
// when we use $theme- styles we need to force it to re-render on theme changes (this can be optimized likely)
|
|
4208
|
-
stateRef.current.isListeningToTheme
|
|
4209
|
-
),
|
|
4210
4208
|
debug: debugProp
|
|
4211
4209
|
};
|
|
4212
|
-
themeStateProps.deopt = willBeAnimated;
|
|
4210
|
+
typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated;
|
|
4213
4211
|
let isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1;
|
|
4214
4212
|
if (process.env.NODE_ENV === "development") {
|
|
4215
4213
|
let id = (0, import_react2.useId)();
|
|
@@ -4470,11 +4468,15 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4470
4468
|
isZStack,
|
|
4471
4469
|
debug: debugProp
|
|
4472
4470
|
});
|
|
4473
|
-
asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4471
|
+
asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
|
|
4472
|
+
let useChildrenResult;
|
|
4473
|
+
import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(
|
|
4474
|
+
elementType,
|
|
4475
|
+
content,
|
|
4476
|
+
viewProps,
|
|
4477
|
+
events,
|
|
4478
|
+
staticConfig
|
|
4479
|
+
)), useChildrenResult ? content = useChildrenResult : content = (0, import_react2.createElement)(elementType, viewProps, content), process.env.NODE_ENV === "development" && time && time`create-element`;
|
|
4478
4480
|
let subGroupContext = (0, import_react2.useMemo)(() => {
|
|
4479
4481
|
if (groupName)
|
|
4480
4482
|
return {
|
|
@@ -4522,8 +4524,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
|
|
|
4522
4524
|
handlesPressEvents,
|
|
4523
4525
|
willBeAnimated,
|
|
4524
4526
|
isStringElement,
|
|
4525
|
-
classNamesIn: (
|
|
4526
|
-
classNamesOut: (
|
|
4527
|
+
classNamesIn: (_l = props.className) == null ? void 0 : _l.split(" "),
|
|
4528
|
+
classNamesOut: (_m = viewProps.className) == null ? void 0 : _m.split(" "),
|
|
4527
4529
|
events,
|
|
4528
4530
|
shouldAttach,
|
|
4529
4531
|
pseudos,
|
|
@@ -7293,6 +7295,226 @@ var require_index_native14 = __commonJS({
|
|
|
7293
7295
|
}
|
|
7294
7296
|
});
|
|
7295
7297
|
|
|
7298
|
+
// ../core/dist/cjs/createOptimizedView.native.js
|
|
7299
|
+
var require_createOptimizedView_native = __commonJS({
|
|
7300
|
+
"../core/dist/cjs/createOptimizedView.native.js"(exports, module2) {
|
|
7301
|
+
"use strict";
|
|
7302
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
|
|
7303
|
+
for (var name in all)
|
|
7304
|
+
__defProp2(target, name, { get: all[name], enumerable: !0 });
|
|
7305
|
+
}, __copyProps2 = (to, from, except, desc) => {
|
|
7306
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
7307
|
+
for (let key of __getOwnPropNames2(from))
|
|
7308
|
+
!__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
7309
|
+
return to;
|
|
7310
|
+
}, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createOptimizedView_native_exports = {};
|
|
7311
|
+
__export2(createOptimizedView_native_exports, {
|
|
7312
|
+
createOptimizedView: () => createOptimizedView,
|
|
7313
|
+
getAccessibilityRoleFromRole: () => getAccessibilityRoleFromRole
|
|
7314
|
+
});
|
|
7315
|
+
module2.exports = __toCommonJS2(createOptimizedView_native_exports);
|
|
7316
|
+
var import_react2 = require("react");
|
|
7317
|
+
function createOptimizedView(children, viewProps, baseViews) {
|
|
7318
|
+
let TextAncestor = baseViews.TextAncestor, ViewNativeComponent = baseViews.View, {
|
|
7319
|
+
accessibilityElementsHidden,
|
|
7320
|
+
accessibilityLabel,
|
|
7321
|
+
accessibilityLabelledBy,
|
|
7322
|
+
accessibilityLiveRegion,
|
|
7323
|
+
accessibilityRole,
|
|
7324
|
+
accessibilityState,
|
|
7325
|
+
accessibilityValue,
|
|
7326
|
+
"aria-busy": ariaBusy,
|
|
7327
|
+
"aria-checked": ariaChecked,
|
|
7328
|
+
"aria-disabled": ariaDisabled,
|
|
7329
|
+
"aria-expanded": ariaExpanded,
|
|
7330
|
+
"aria-hidden": ariaHidden,
|
|
7331
|
+
"aria-label": ariaLabel,
|
|
7332
|
+
"aria-labelledby": ariaLabelledBy,
|
|
7333
|
+
"aria-live": ariaLive,
|
|
7334
|
+
"aria-selected": ariaSelected,
|
|
7335
|
+
"aria-valuemax": ariaValueMax,
|
|
7336
|
+
"aria-valuemin": ariaValueMin,
|
|
7337
|
+
"aria-valuenow": ariaValueNow,
|
|
7338
|
+
"aria-valuetext": ariaValueText,
|
|
7339
|
+
focusable,
|
|
7340
|
+
id,
|
|
7341
|
+
importantForAccessibility,
|
|
7342
|
+
nativeID,
|
|
7343
|
+
pointerEvents,
|
|
7344
|
+
role,
|
|
7345
|
+
tabIndex
|
|
7346
|
+
// ...otherProps
|
|
7347
|
+
} = viewProps, _accessibilityLabelledBy = (ariaLabelledBy == null ? void 0 : ariaLabelledBy.split(/\s*,\s*/g)) ?? accessibilityLabelledBy, _accessibilityState;
|
|
7348
|
+
(accessibilityState != null || ariaBusy != null || ariaChecked != null || ariaDisabled != null || ariaExpanded != null || ariaSelected != null) && (_accessibilityState = {
|
|
7349
|
+
busy: ariaBusy ?? (accessibilityState == null ? void 0 : accessibilityState.busy),
|
|
7350
|
+
checked: ariaChecked ?? (accessibilityState == null ? void 0 : accessibilityState.checked),
|
|
7351
|
+
disabled: ariaDisabled ?? (accessibilityState == null ? void 0 : accessibilityState.disabled),
|
|
7352
|
+
expanded: ariaExpanded ?? (accessibilityState == null ? void 0 : accessibilityState.expanded),
|
|
7353
|
+
selected: ariaSelected ?? (accessibilityState == null ? void 0 : accessibilityState.selected)
|
|
7354
|
+
});
|
|
7355
|
+
let _accessibilityValue;
|
|
7356
|
+
(accessibilityValue != null || ariaValueMax != null || ariaValueMin != null || ariaValueNow != null || ariaValueText != null) && (_accessibilityValue = {
|
|
7357
|
+
max: ariaValueMax ?? (accessibilityValue == null ? void 0 : accessibilityValue.max),
|
|
7358
|
+
min: ariaValueMin ?? (accessibilityValue == null ? void 0 : accessibilityValue.min),
|
|
7359
|
+
now: ariaValueNow ?? (accessibilityValue == null ? void 0 : accessibilityValue.now),
|
|
7360
|
+
text: ariaValueText ?? (accessibilityValue == null ? void 0 : accessibilityValue.text)
|
|
7361
|
+
});
|
|
7362
|
+
let style = Array.isArray(viewProps.style) ? baseViews.StyleSheet.flatten(viewProps.style) : viewProps.style, newPointerEvents = (style == null ? void 0 : style.pointerEvents) || pointerEvents, finalProps = viewProps, extras = {
|
|
7363
|
+
accessibilityLiveRegion: ariaLive === "off" ? "none" : ariaLive ?? accessibilityLiveRegion,
|
|
7364
|
+
accessibilityLabel: ariaLabel ?? accessibilityLabel,
|
|
7365
|
+
focusable: tabIndex !== void 0 ? !tabIndex : focusable,
|
|
7366
|
+
accessibilityState: _accessibilityState,
|
|
7367
|
+
accessibilityRole: role ? getAccessibilityRoleFromRole(role) : accessibilityRole,
|
|
7368
|
+
accessibilityElementsHidden: ariaHidden ?? accessibilityElementsHidden,
|
|
7369
|
+
accessibilityLabelledBy: _accessibilityLabelledBy,
|
|
7370
|
+
accessibilityValue: _accessibilityValue,
|
|
7371
|
+
importantForAccessibility: ariaHidden === !0 ? "no-hide-descendants" : importantForAccessibility,
|
|
7372
|
+
nativeID: id ?? nativeID,
|
|
7373
|
+
style,
|
|
7374
|
+
pointerEvents: newPointerEvents
|
|
7375
|
+
};
|
|
7376
|
+
for (let key in extras)
|
|
7377
|
+
extras[key] != null && (finalProps[key] = extras[key]);
|
|
7378
|
+
let isInText = (0, import_react2.useContext)(TextAncestor), finalElement = (0, import_react2.createElement)(ViewNativeComponent, finalProps, children);
|
|
7379
|
+
return isInText ? (0, import_react2.createElement)(TextAncestor.Provider, { value: !1 }, finalElement) : finalElement;
|
|
7380
|
+
}
|
|
7381
|
+
function getAccessibilityRoleFromRole(role) {
|
|
7382
|
+
switch (role) {
|
|
7383
|
+
case "alert":
|
|
7384
|
+
return "alert";
|
|
7385
|
+
case "alertdialog":
|
|
7386
|
+
return;
|
|
7387
|
+
case "application":
|
|
7388
|
+
return;
|
|
7389
|
+
case "article":
|
|
7390
|
+
return;
|
|
7391
|
+
case "banner":
|
|
7392
|
+
return;
|
|
7393
|
+
case "button":
|
|
7394
|
+
return "button";
|
|
7395
|
+
case "cell":
|
|
7396
|
+
return;
|
|
7397
|
+
case "checkbox":
|
|
7398
|
+
return "checkbox";
|
|
7399
|
+
case "columnheader":
|
|
7400
|
+
return;
|
|
7401
|
+
case "combobox":
|
|
7402
|
+
return "combobox";
|
|
7403
|
+
case "complementary":
|
|
7404
|
+
return;
|
|
7405
|
+
case "contentinfo":
|
|
7406
|
+
return;
|
|
7407
|
+
case "definition":
|
|
7408
|
+
return;
|
|
7409
|
+
case "dialog":
|
|
7410
|
+
return;
|
|
7411
|
+
case "directory":
|
|
7412
|
+
return;
|
|
7413
|
+
case "document":
|
|
7414
|
+
return;
|
|
7415
|
+
case "feed":
|
|
7416
|
+
return;
|
|
7417
|
+
case "figure":
|
|
7418
|
+
return;
|
|
7419
|
+
case "form":
|
|
7420
|
+
return;
|
|
7421
|
+
case "grid":
|
|
7422
|
+
return "grid";
|
|
7423
|
+
case "group":
|
|
7424
|
+
return;
|
|
7425
|
+
case "heading":
|
|
7426
|
+
return "header";
|
|
7427
|
+
case "img":
|
|
7428
|
+
return "image";
|
|
7429
|
+
case "link":
|
|
7430
|
+
return "link";
|
|
7431
|
+
case "list":
|
|
7432
|
+
return "list";
|
|
7433
|
+
case "listitem":
|
|
7434
|
+
return;
|
|
7435
|
+
case "log":
|
|
7436
|
+
return;
|
|
7437
|
+
case "main":
|
|
7438
|
+
return;
|
|
7439
|
+
case "marquee":
|
|
7440
|
+
return;
|
|
7441
|
+
case "math":
|
|
7442
|
+
return;
|
|
7443
|
+
case "menu":
|
|
7444
|
+
return "menu";
|
|
7445
|
+
case "menubar":
|
|
7446
|
+
return "menubar";
|
|
7447
|
+
case "menuitem":
|
|
7448
|
+
return "menuitem";
|
|
7449
|
+
case "meter":
|
|
7450
|
+
return;
|
|
7451
|
+
case "navigation":
|
|
7452
|
+
return;
|
|
7453
|
+
case "none":
|
|
7454
|
+
return "none";
|
|
7455
|
+
case "note":
|
|
7456
|
+
return;
|
|
7457
|
+
case "option":
|
|
7458
|
+
return;
|
|
7459
|
+
case "presentation":
|
|
7460
|
+
return "none";
|
|
7461
|
+
case "progressbar":
|
|
7462
|
+
return "progressbar";
|
|
7463
|
+
case "radio":
|
|
7464
|
+
return "radio";
|
|
7465
|
+
case "radiogroup":
|
|
7466
|
+
return "radiogroup";
|
|
7467
|
+
case "region":
|
|
7468
|
+
return;
|
|
7469
|
+
case "row":
|
|
7470
|
+
return;
|
|
7471
|
+
case "rowgroup":
|
|
7472
|
+
return;
|
|
7473
|
+
case "rowheader":
|
|
7474
|
+
return;
|
|
7475
|
+
case "scrollbar":
|
|
7476
|
+
return "scrollbar";
|
|
7477
|
+
case "searchbox":
|
|
7478
|
+
return "search";
|
|
7479
|
+
case "separator":
|
|
7480
|
+
return;
|
|
7481
|
+
case "slider":
|
|
7482
|
+
return "adjustable";
|
|
7483
|
+
case "spinbutton":
|
|
7484
|
+
return "spinbutton";
|
|
7485
|
+
case "status":
|
|
7486
|
+
return;
|
|
7487
|
+
case "summary":
|
|
7488
|
+
return "summary";
|
|
7489
|
+
case "switch":
|
|
7490
|
+
return "switch";
|
|
7491
|
+
case "tab":
|
|
7492
|
+
return "tab";
|
|
7493
|
+
case "table":
|
|
7494
|
+
return;
|
|
7495
|
+
case "tablist":
|
|
7496
|
+
return "tablist";
|
|
7497
|
+
case "tabpanel":
|
|
7498
|
+
return;
|
|
7499
|
+
case "term":
|
|
7500
|
+
return;
|
|
7501
|
+
case "timer":
|
|
7502
|
+
return "timer";
|
|
7503
|
+
case "toolbar":
|
|
7504
|
+
return "toolbar";
|
|
7505
|
+
case "tooltip":
|
|
7506
|
+
return;
|
|
7507
|
+
case "tree":
|
|
7508
|
+
return;
|
|
7509
|
+
case "treegrid":
|
|
7510
|
+
return;
|
|
7511
|
+
case "treeitem":
|
|
7512
|
+
return;
|
|
7513
|
+
}
|
|
7514
|
+
}
|
|
7515
|
+
}
|
|
7516
|
+
});
|
|
7517
|
+
|
|
7296
7518
|
// ../core/dist/cjs/getBaseViews.native.js
|
|
7297
7519
|
var require_getBaseViews_native = __commonJS({
|
|
7298
7520
|
"../core/dist/cjs/getBaseViews.native.js"(exports, module2) {
|
|
@@ -7311,10 +7533,12 @@ var require_getBaseViews_native = __commonJS({
|
|
|
7311
7533
|
});
|
|
7312
7534
|
module2.exports = __toCommonJS2(getBaseViews_native_exports);
|
|
7313
7535
|
function getBaseViews() {
|
|
7314
|
-
let native = require("react-native");
|
|
7315
|
-
return {
|
|
7316
|
-
View:
|
|
7536
|
+
let native = require("react-native"), View2, TextAncestor;
|
|
7537
|
+
return process.env.NODE_ENV !== "test" && (View2 = require("react-native/Libraries/Components/View/ViewNativeComponent").default, TextAncestor = require("react-native/Libraries/Text/TextAncestor")), View2 || (View2 = native.View || native.default.View), {
|
|
7538
|
+
View: View2,
|
|
7317
7539
|
Text: native.Text || native.default.Text,
|
|
7540
|
+
StyleSheet: native.StyleSheet || native.default.StyleSheet,
|
|
7541
|
+
TextAncestor,
|
|
7318
7542
|
Pressable: native.Pressable || native.default.Pressable
|
|
7319
7543
|
};
|
|
7320
7544
|
}
|
|
@@ -7565,10 +7789,10 @@ var require_index_native15 = __commonJS({
|
|
|
7565
7789
|
Text: () => Text3
|
|
7566
7790
|
});
|
|
7567
7791
|
module2.exports = __toCommonJS2(src_exports2);
|
|
7568
|
-
var import_react_native_use_responder_events = require_index_native14(), import_web = require_index_native9(), import_getBaseViews = require_getBaseViews_native(), import_useElementLayout = require_useElementLayout_native(), import_usePlatformMethods = require_usePlatformMethods_native(), import_Pressability = require_Pressability_native();
|
|
7792
|
+
var import_react_native_use_responder_events = require_index_native14(), import_web = require_index_native9(), import_react2 = require("react"), import_createOptimizedView = require_createOptimizedView_native(), import_getBaseViews = require_getBaseViews_native(), import_useElementLayout = require_useElementLayout_native(), import_usePlatformMethods = require_usePlatformMethods_native(), import_Pressability = require_Pressability_native();
|
|
7569
7793
|
__reExport2(src_exports2, require_index_native9(), module2.exports);
|
|
7570
7794
|
__reExport2(src_exports2, require_reactNativeTypes_native(), module2.exports);
|
|
7571
|
-
var Stack3 = import_web.Stack, Text3 = import_web.Text;
|
|
7795
|
+
var Stack3 = import_web.Stack, Text3 = import_web.Text, baseViews = (0, import_getBaseViews.getBaseViews)();
|
|
7572
7796
|
(0, import_web.setupHooks)({
|
|
7573
7797
|
getBaseViews: import_getBaseViews.getBaseViews,
|
|
7574
7798
|
usePropsTransform(elementType, propsIn, hostRef) {
|
|
@@ -7641,22 +7865,15 @@ var require_index_native15 = __commonJS({
|
|
|
7641
7865
|
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
|
|
7642
7866
|
}
|
|
7643
7867
|
}
|
|
7868
|
+
},
|
|
7869
|
+
useChildren(elementType, children, viewProps, events, staticConfig) {
|
|
7870
|
+
if (process.env.NODE_ENV !== "test") {
|
|
7871
|
+
if (elementType === baseViews.View)
|
|
7872
|
+
return (0, import_createOptimizedView.createOptimizedView)(children, viewProps, baseViews);
|
|
7873
|
+
if (process.env.TAMAGUI_OPTIMIZE_NATIVE_VIEWS && elementType === baseViews.Text)
|
|
7874
|
+
return viewProps.children = children, (0, import_react2.createElement)("RCTText", viewProps);
|
|
7875
|
+
}
|
|
7644
7876
|
}
|
|
7645
|
-
// attempt at properly fixing RN input, but <Pressable><TextInput /> just doesnt work on RN
|
|
7646
|
-
// useChildren(children, viewProps, events, staticConfig) {
|
|
7647
|
-
// if (process.env.TAMAGUI_TARGET === 'native') {
|
|
7648
|
-
// if (staticConfig.isInput && !staticConfig.isHOC) {
|
|
7649
|
-
// const Pressable = getBaseViews().Pressable
|
|
7650
|
-
// console.log(
|
|
7651
|
-
// 'wrapping in pressable',
|
|
7652
|
-
// events?.['onPressIn']?.toString(),
|
|
7653
|
-
// viewProps['onPressIn']
|
|
7654
|
-
// )
|
|
7655
|
-
// // we need to wrap it in a view?
|
|
7656
|
-
// return <Pressable {...events}>{children}</Pressable>
|
|
7657
|
-
// }
|
|
7658
|
-
// }
|
|
7659
|
-
// },
|
|
7660
7877
|
});
|
|
7661
7878
|
var dontComposePressabilityKeys = {
|
|
7662
7879
|
onClick: !0
|
|
@@ -18386,8 +18603,8 @@ var require_Toggle_native = __commonJS({
|
|
|
18386
18603
|
backgroundColor: "$background"
|
|
18387
18604
|
},
|
|
18388
18605
|
focusStyle: {
|
|
18389
|
-
borderColor: "$
|
|
18390
|
-
backgroundColor: "$
|
|
18606
|
+
borderColor: "$borderColor",
|
|
18607
|
+
backgroundColor: "$background"
|
|
18391
18608
|
}
|
|
18392
18609
|
}
|
|
18393
18610
|
},
|
|
@@ -18405,37 +18622,36 @@ var require_Toggle_native = __commonJS({
|
|
|
18405
18622
|
defaultVariants: {
|
|
18406
18623
|
unstyled: !1
|
|
18407
18624
|
}
|
|
18408
|
-
}), Toggle =
|
|
18409
|
-
|
|
18410
|
-
|
|
18411
|
-
|
|
18412
|
-
|
|
18413
|
-
|
|
18414
|
-
|
|
18415
|
-
|
|
18416
|
-
|
|
18417
|
-
|
|
18418
|
-
|
|
18419
|
-
|
|
18420
|
-
|
|
18421
|
-
|
|
18422
|
-
{
|
|
18625
|
+
}), Toggle = React2.forwardRef(function(props, forwardedRef) {
|
|
18626
|
+
let {
|
|
18627
|
+
pressed: pressedProp,
|
|
18628
|
+
defaultPressed = !1,
|
|
18629
|
+
onPressedChange,
|
|
18630
|
+
...buttonProps
|
|
18631
|
+
} = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
|
|
18632
|
+
prop: pressedProp,
|
|
18633
|
+
onChange: onPressedChange,
|
|
18634
|
+
defaultProp: defaultPressed
|
|
18635
|
+
});
|
|
18636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18637
|
+
ToggleFrame,
|
|
18638
|
+
{
|
|
18639
|
+
...!props.unstyled && {
|
|
18423
18640
|
theme: pressed ? "active" : null,
|
|
18424
|
-
themeShallow: !0
|
|
18425
|
-
|
|
18426
|
-
|
|
18427
|
-
|
|
18428
|
-
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
}
|
|
18435
|
-
|
|
18436
|
-
|
|
18437
|
-
);
|
|
18438
|
-
Toggle.displayName = NAME;
|
|
18641
|
+
themeShallow: !0
|
|
18642
|
+
},
|
|
18643
|
+
active: props.unstyled ? void 0 : pressed,
|
|
18644
|
+
"aria-pressed": pressed,
|
|
18645
|
+
"data-state": pressed ? "on" : "off",
|
|
18646
|
+
"data-disabled": props.disabled ? "" : void 0,
|
|
18647
|
+
...buttonProps,
|
|
18648
|
+
ref: forwardedRef,
|
|
18649
|
+
onPress: (0, import_web.composeEventHandlers)(props.onPress ?? void 0, () => {
|
|
18650
|
+
props.disabled || setPressed(!pressed);
|
|
18651
|
+
})
|
|
18652
|
+
}
|
|
18653
|
+
);
|
|
18654
|
+
});
|
|
18439
18655
|
}
|
|
18440
18656
|
});
|
|
18441
18657
|
|
|
@@ -18466,78 +18682,50 @@ var require_ToggleGroup_native = __commonJS({
|
|
|
18466
18682
|
var import_focusable2 = require_index_native44(), import_font_size = require_index_native40(), import_get_token2 = require_index_native17(), import_group = require_index_native50(), import_helpers_tamagui = require_index_native41(), import_roving_focus = require_index_native62(), import_use_controllable_state = require_index_native12(), import_use_direction = require_index_native22(), import_web = require_index_native9(), import_react2 = __toESM2(require("react")), import_Toggle = require_Toggle_native(), import_jsx_runtime6 = require("react/jsx-runtime"), TOGGLE_GROUP_NAME = "ToggleGroup", TOGGLE_GROUP_ITEM_NAME = "ToggleGroupItem", TOGGLE_GROUP_CONTEXT = "ToggleGroup", { Provider: ToggleGroupItemProvider, useStyledContext: useToggleGroupItemContext } = (0, import_web.createStyledContext)(), { Provider: ToggleGroupContext, useStyledContext: useToggleGroupContext } = (0, import_web.createStyledContext)(), ToggleGroupItem = import_Toggle.ToggleFrame.extractable(
|
|
18467
18683
|
import_react2.default.forwardRef(
|
|
18468
18684
|
(props, forwardedRef) => {
|
|
18469
|
-
let
|
|
18685
|
+
let valueContext = useToggleGroupValueContext(props.__scopeToggleGroup), context = useToggleGroupContext(props.__scopeToggleGroup), pressed = valueContext == null ? void 0 : valueContext.value.includes(props.value), disabled = context.disabled || props.disabled || !1, groupItemProps = (0, import_group.useGroupItem)({ disabled }), size2 = props.size ?? context.size, sizeProps = props.unstyled ? {} : {
|
|
18470
18686
|
width: void 0,
|
|
18471
18687
|
height: void 0,
|
|
18472
18688
|
padding: (0, import_web.getVariableValue)(size2) * 0.6
|
|
18473
|
-
}, iconSize = (typeof size2 == "number" ? size2 * 0.7 : (0, import_font_size.getFontSize)(size2)) * 1.2, theme = (0, import_web.useTheme)(), getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color: theme.color }), children = import_react2.default.Children.toArray(props.children).map((child) => props.disablePassStyles || !import_react2.default.isValidElement(child) ? child : getThemedIcon(child)), commonProps = { pressed, disabled, ...sizeProps, ...props, children }
|
|
18474
|
-
|
|
18475
|
-
import_roving_focus.RovingFocusGroup.Item,
|
|
18689
|
+
}, iconSize = (typeof size2 == "number" ? size2 * 0.7 : (0, import_font_size.getFontSize)(size2)) * 1.2, theme = (0, import_web.useTheme)(), getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color: theme.color }), children = import_react2.default.Children.toArray(props.children).map((child) => props.disablePassStyles || !import_react2.default.isValidElement(child) ? child : getThemedIcon(child)), commonProps = { pressed, disabled, ...sizeProps, ...props, children }, inner = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18690
|
+
ToggleGroupItemImpl,
|
|
18476
18691
|
{
|
|
18477
|
-
|
|
18478
|
-
|
|
18692
|
+
...commonProps,
|
|
18693
|
+
ref: forwardedRef,
|
|
18479
18694
|
focusable: !disabled,
|
|
18480
|
-
|
|
18481
|
-
|
|
18482
|
-
import_Toggle.ToggleFrame,
|
|
18483
|
-
{
|
|
18484
|
-
asChild: "except-style",
|
|
18485
|
-
focusable: !disabled,
|
|
18486
|
-
disabled,
|
|
18487
|
-
ref,
|
|
18488
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18489
|
-
ToggleGroupItemImpl,
|
|
18490
|
-
{
|
|
18491
|
-
__scopeToggleGroup,
|
|
18492
|
-
...commonProps,
|
|
18493
|
-
ref: forwardedRef,
|
|
18494
|
-
...groupItemProps
|
|
18495
|
-
}
|
|
18496
|
-
)
|
|
18497
|
-
}
|
|
18498
|
-
)
|
|
18695
|
+
disabled,
|
|
18696
|
+
...groupItemProps
|
|
18499
18697
|
}
|
|
18500
|
-
)
|
|
18501
|
-
|
|
18698
|
+
);
|
|
18699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemProvider, { scope: props.__scopeToggleGroup, children: context.rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18700
|
+
import_roving_focus.RovingFocusGroup.Item,
|
|
18502
18701
|
{
|
|
18503
18702
|
asChild: "except-style",
|
|
18703
|
+
__scopeRovingFocusGroup: props.__scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
|
|
18504
18704
|
focusable: !disabled,
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18508
|
-
ToggleGroupItemImpl,
|
|
18509
|
-
{
|
|
18510
|
-
__scopeToggleGroup,
|
|
18511
|
-
...commonProps,
|
|
18512
|
-
ref: forwardedRef
|
|
18513
|
-
}
|
|
18514
|
-
)
|
|
18705
|
+
active: pressed,
|
|
18706
|
+
children: inner
|
|
18515
18707
|
}
|
|
18516
|
-
) });
|
|
18708
|
+
) : inner });
|
|
18517
18709
|
}
|
|
18518
18710
|
)
|
|
18519
18711
|
);
|
|
18520
18712
|
ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
|
|
18521
|
-
var ToggleGroupItemImpl =
|
|
18522
|
-
|
|
18523
|
-
|
|
18524
|
-
|
|
18525
|
-
|
|
18526
|
-
|
|
18527
|
-
|
|
18528
|
-
|
|
18529
|
-
|
|
18530
|
-
|
|
18531
|
-
|
|
18532
|
-
|
|
18533
|
-
|
|
18534
|
-
pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
|
|
18535
|
-
}
|
|
18536
|
-
}
|
|
18537
|
-
);
|
|
18713
|
+
var ToggleGroupItemImpl = import_react2.default.forwardRef((props, forwardedRef) => {
|
|
18714
|
+
let { __scopeToggleGroup, value, ...itemProps } = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), singleProps = {
|
|
18715
|
+
"aria-pressed": void 0
|
|
18716
|
+
}, typeProps = valueContext.type === "single" ? singleProps : void 0;
|
|
18717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18718
|
+
import_Toggle.Toggle,
|
|
18719
|
+
{
|
|
18720
|
+
...typeProps,
|
|
18721
|
+
...itemProps,
|
|
18722
|
+
ref: forwardedRef,
|
|
18723
|
+
onPressedChange: (pressed) => {
|
|
18724
|
+
pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
|
|
18725
|
+
}
|
|
18538
18726
|
}
|
|
18539
|
-
)
|
|
18540
|
-
), ToggleGroup = (0, import_web.withStaticProperties)(
|
|
18727
|
+
);
|
|
18728
|
+
}), ToggleGroup = (0, import_web.withStaticProperties)(
|
|
18541
18729
|
import_react2.default.forwardRef(
|
|
18542
18730
|
(props, forwardedRef) => {
|
|
18543
18731
|
let { type, ...toggleGroupProps } = props;
|