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.
@@ -3258,7 +3258,7 @@ var require_ThemeManager_native = __commonJS({
3258
3258
  }
3259
3259
  updateStateFromProps(props = this.props || {}, shouldNotify = !0) {
3260
3260
  if (this.props = props, props.forceTheme)
3261
- return this.state.theme = props.forceTheme, this.state.name = props.name || "", !0;
3261
+ return this.state.theme = props.forceTheme, this.state.name = props.name || "", this.updateState(this.state, !0), this.state;
3262
3262
  let nextState = this.getStateIfChanged(props);
3263
3263
  if (nextState)
3264
3264
  return this.updateState(nextState, shouldNotify), nextState;
@@ -3309,7 +3309,7 @@ var require_ThemeManager_native = __commonJS({
3309
3309
  if (!baseManager && props.reset)
3310
3310
  return console.warn("Cannot reset, no parent theme exists"), null;
3311
3311
  let { componentName } = props, result = null, baseName = (baseManager == null ? void 0 : baseManager.state.name) || "";
3312
- baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][a-z]+/, ""));
3312
+ baseManager != null && baseManager.state.isComponent && (baseName = baseName.replace(/_[A-Z][A-Za-z]+/, ""));
3313
3313
  let nextName = props.reset ? baseName : props.name || "", allComponentThemes = componentManagers.map((x) => (x == null ? void 0 : x.state.name) || "");
3314
3314
  isDirectParentAComponentTheme && allComponentThemes.shift();
3315
3315
  let base = baseName.split(import_constants2.THEME_NAME_SEPARATOR), max2 = base.length, min2 = props.componentName && !nextName ? max2 : 0;
@@ -3429,7 +3429,7 @@ var require_useTheme_native = __commonJS({
3429
3429
  }
3430
3430
  ), { themeManager, state } = changedThemeState;
3431
3431
  state != null && state.theme;
3432
- 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]);
3432
+ 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]);
3433
3433
  return [changedThemeState, themeProxied];
3434
3434
  };
3435
3435
  function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys, debug) {
@@ -3531,9 +3531,12 @@ var require_useTheme_native = __commonJS({
3531
3531
  isNewTheme && themeManager && activeThemeManagers.add(themeManager), (isNewTheme || getShouldUpdateTheme(themeManager)) && setThemeState(createState);
3532
3532
  let selfListenerDispose = themeManager.onChangeTheme((_a, _b, forced) => {
3533
3533
  forced && setThemeState((prev) => createState(prev, !0));
3534
- }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme((name, manager) => {
3535
- (((shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"]) ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState(createState);
3536
- }, themeManager.id);
3534
+ }), disposeChangeListener = parentManager == null ? void 0 : parentManager.onChangeTheme(
3535
+ (name, manager, forced) => {
3536
+ ((forced || (shouldUpdate == null ? void 0 : shouldUpdate()) || props.deopt || props["disable-child-theme"]) ?? !!(keys != null && keys.length || isNewTheme)) && setThemeState(createState);
3537
+ },
3538
+ themeManager.id
3539
+ );
3537
3540
  return () => {
3538
3541
  selfListenerDispose(), disposeChangeListener == null || disposeChangeListener(), activeThemeManagers.delete(themeManager);
3539
3542
  };
@@ -3564,14 +3567,14 @@ var require_useTheme_native = __commonJS({
3564
3567
  themeManager
3565
3568
  };
3566
3569
  function createState(prev, force = !1) {
3567
- if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1)
3570
+ if (prev && (shouldUpdate == null ? void 0 : shouldUpdate()) === !1 && !force)
3568
3571
  return prev;
3569
3572
  let themeManager2 = parentManager, state2;
3570
3573
  if ((0, import_ThemeManager.getHasThemeUpdatingProps)(props)) {
3571
3574
  let getNewThemeManager = () => new import_ThemeManager.ThemeManager(props, isRoot ? "root" : parentManager);
3572
3575
  if (prev != null && prev.themeManager) {
3573
3576
  themeManager2 = prev.themeManager;
3574
- let forceChange = !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
3577
+ let forceChange = force || !!(keys != null && keys.length), next = themeManager2.getState(props, parentManager), nextState = getShouldUpdateTheme(
3575
3578
  themeManager2,
3576
3579
  next,
3577
3580
  prev.state,
@@ -3882,7 +3885,7 @@ var require_createComponent_native = __commonJS({
3882
3885
  validStyles: validStyles2 = {},
3883
3886
  variants = {}
3884
3887
  } = staticConfig, defaultComponentClassName = `is_${staticConfig.componentName}`, defaultProps = staticConfig.defaultProps, component = (0, import_react2.forwardRef)((propsIn, forwardedRef) => {
3885
- var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m, _n, _o;
3888
+ var _a2, _b, _c, _d, _e, _f, _i, _j, _k, _l, _m;
3886
3889
  if (!hasSetupBaseViews) {
3887
3890
  hasSetupBaseViews = !0;
3888
3891
  let baseViews = (_b = (_a2 = import_setupHooks.hooks).getBaseViews) == null ? void 0 : _b.call(_a2);
@@ -3945,14 +3948,9 @@ var require_createComponent_native = __commonJS({
3945
3948
  componentName,
3946
3949
  disable: disableTheme,
3947
3950
  shallow: stateRef.current.themeShallow,
3948
- // if this returns undefined it defers to the keys tracking, so its only used to force either updates or no updates
3949
- shouldUpdate: () => (
3950
- // when we use $theme- styles we need to force it to re-render on theme changes (this can be optimized likely)
3951
- stateRef.current.isListeningToTheme
3952
- ),
3953
3951
  debug: debugProp
3954
3952
  };
3955
- themeStateProps.deopt = willBeAnimated;
3953
+ typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.shouldUpdate = () => stateRef.current.isListeningToTheme), themeStateProps.deopt = willBeAnimated;
3956
3954
  let isExiting = !state.unmounted && (presence == null ? void 0 : presence[0]) === !1, [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
3957
3955
  elementType = Component || elementType;
3958
3956
  let isStringElement = typeof elementType == "string", mediaState3 = (0, import_useMedia.useMedia)(stateRef, componentContext);
@@ -4157,7 +4155,15 @@ var require_createComponent_native = __commonJS({
4157
4155
  isZStack,
4158
4156
  debug: debugProp
4159
4157
  });
4160
- asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress })), content = (0, import_react2.createElement)(elementType, viewProps, content), import_setupHooks.hooks.useChildren && (content = (_m = (_l = import_setupHooks.hooks).useChildren) == null ? void 0 : _m.call(_l, content, viewProps, events, staticConfig));
4158
+ asChild && (elementType = import_Slot.Slot, Object.assign(viewProps, { onPress, onLongPress }));
4159
+ let useChildrenResult;
4160
+ import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(
4161
+ elementType,
4162
+ content,
4163
+ viewProps,
4164
+ events,
4165
+ staticConfig
4166
+ )), useChildrenResult ? content = useChildrenResult : content = (0, import_react2.createElement)(elementType, viewProps, content);
4161
4167
  let subGroupContext = (0, import_react2.useMemo)(() => {
4162
4168
  if (groupName)
4163
4169
  return {
@@ -6920,6 +6926,226 @@ var require_index_native14 = __commonJS({
6920
6926
  }
6921
6927
  });
6922
6928
 
6929
+ // ../core/dist/cjs/createOptimizedView.native.js
6930
+ var require_createOptimizedView_native = __commonJS({
6931
+ "../core/dist/cjs/createOptimizedView.native.js"(exports, module2) {
6932
+ "use strict";
6933
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = (target, all) => {
6934
+ for (var name in all)
6935
+ __defProp2(target, name, { get: all[name], enumerable: !0 });
6936
+ }, __copyProps2 = (to, from, except, desc) => {
6937
+ if (from && typeof from == "object" || typeof from == "function")
6938
+ for (let key of __getOwnPropNames2(from))
6939
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
6940
+ return to;
6941
+ }, __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: !0 }), mod), createOptimizedView_native_exports = {};
6942
+ __export2(createOptimizedView_native_exports, {
6943
+ createOptimizedView: () => createOptimizedView,
6944
+ getAccessibilityRoleFromRole: () => getAccessibilityRoleFromRole
6945
+ });
6946
+ module2.exports = __toCommonJS2(createOptimizedView_native_exports);
6947
+ var import_react2 = require("react");
6948
+ function createOptimizedView(children, viewProps, baseViews) {
6949
+ let TextAncestor = baseViews.TextAncestor, ViewNativeComponent = baseViews.View, {
6950
+ accessibilityElementsHidden,
6951
+ accessibilityLabel,
6952
+ accessibilityLabelledBy,
6953
+ accessibilityLiveRegion,
6954
+ accessibilityRole,
6955
+ accessibilityState,
6956
+ accessibilityValue,
6957
+ "aria-busy": ariaBusy,
6958
+ "aria-checked": ariaChecked,
6959
+ "aria-disabled": ariaDisabled,
6960
+ "aria-expanded": ariaExpanded,
6961
+ "aria-hidden": ariaHidden,
6962
+ "aria-label": ariaLabel,
6963
+ "aria-labelledby": ariaLabelledBy,
6964
+ "aria-live": ariaLive,
6965
+ "aria-selected": ariaSelected,
6966
+ "aria-valuemax": ariaValueMax,
6967
+ "aria-valuemin": ariaValueMin,
6968
+ "aria-valuenow": ariaValueNow,
6969
+ "aria-valuetext": ariaValueText,
6970
+ focusable,
6971
+ id,
6972
+ importantForAccessibility,
6973
+ nativeID,
6974
+ pointerEvents,
6975
+ role,
6976
+ tabIndex
6977
+ // ...otherProps
6978
+ } = viewProps, _accessibilityLabelledBy = (ariaLabelledBy == null ? void 0 : ariaLabelledBy.split(/\s*,\s*/g)) ?? accessibilityLabelledBy, _accessibilityState;
6979
+ (accessibilityState != null || ariaBusy != null || ariaChecked != null || ariaDisabled != null || ariaExpanded != null || ariaSelected != null) && (_accessibilityState = {
6980
+ busy: ariaBusy ?? (accessibilityState == null ? void 0 : accessibilityState.busy),
6981
+ checked: ariaChecked ?? (accessibilityState == null ? void 0 : accessibilityState.checked),
6982
+ disabled: ariaDisabled ?? (accessibilityState == null ? void 0 : accessibilityState.disabled),
6983
+ expanded: ariaExpanded ?? (accessibilityState == null ? void 0 : accessibilityState.expanded),
6984
+ selected: ariaSelected ?? (accessibilityState == null ? void 0 : accessibilityState.selected)
6985
+ });
6986
+ let _accessibilityValue;
6987
+ (accessibilityValue != null || ariaValueMax != null || ariaValueMin != null || ariaValueNow != null || ariaValueText != null) && (_accessibilityValue = {
6988
+ max: ariaValueMax ?? (accessibilityValue == null ? void 0 : accessibilityValue.max),
6989
+ min: ariaValueMin ?? (accessibilityValue == null ? void 0 : accessibilityValue.min),
6990
+ now: ariaValueNow ?? (accessibilityValue == null ? void 0 : accessibilityValue.now),
6991
+ text: ariaValueText ?? (accessibilityValue == null ? void 0 : accessibilityValue.text)
6992
+ });
6993
+ let style = Array.isArray(viewProps.style) ? baseViews.StyleSheet.flatten(viewProps.style) : viewProps.style, newPointerEvents = (style == null ? void 0 : style.pointerEvents) || pointerEvents, finalProps = viewProps, extras = {
6994
+ accessibilityLiveRegion: ariaLive === "off" ? "none" : ariaLive ?? accessibilityLiveRegion,
6995
+ accessibilityLabel: ariaLabel ?? accessibilityLabel,
6996
+ focusable: tabIndex !== void 0 ? !tabIndex : focusable,
6997
+ accessibilityState: _accessibilityState,
6998
+ accessibilityRole: role ? getAccessibilityRoleFromRole(role) : accessibilityRole,
6999
+ accessibilityElementsHidden: ariaHidden ?? accessibilityElementsHidden,
7000
+ accessibilityLabelledBy: _accessibilityLabelledBy,
7001
+ accessibilityValue: _accessibilityValue,
7002
+ importantForAccessibility: ariaHidden === !0 ? "no-hide-descendants" : importantForAccessibility,
7003
+ nativeID: id ?? nativeID,
7004
+ style,
7005
+ pointerEvents: newPointerEvents
7006
+ };
7007
+ for (let key in extras)
7008
+ extras[key] != null && (finalProps[key] = extras[key]);
7009
+ let isInText = (0, import_react2.useContext)(TextAncestor), finalElement = (0, import_react2.createElement)(ViewNativeComponent, finalProps, children);
7010
+ return isInText ? (0, import_react2.createElement)(TextAncestor.Provider, { value: !1 }, finalElement) : finalElement;
7011
+ }
7012
+ function getAccessibilityRoleFromRole(role) {
7013
+ switch (role) {
7014
+ case "alert":
7015
+ return "alert";
7016
+ case "alertdialog":
7017
+ return;
7018
+ case "application":
7019
+ return;
7020
+ case "article":
7021
+ return;
7022
+ case "banner":
7023
+ return;
7024
+ case "button":
7025
+ return "button";
7026
+ case "cell":
7027
+ return;
7028
+ case "checkbox":
7029
+ return "checkbox";
7030
+ case "columnheader":
7031
+ return;
7032
+ case "combobox":
7033
+ return "combobox";
7034
+ case "complementary":
7035
+ return;
7036
+ case "contentinfo":
7037
+ return;
7038
+ case "definition":
7039
+ return;
7040
+ case "dialog":
7041
+ return;
7042
+ case "directory":
7043
+ return;
7044
+ case "document":
7045
+ return;
7046
+ case "feed":
7047
+ return;
7048
+ case "figure":
7049
+ return;
7050
+ case "form":
7051
+ return;
7052
+ case "grid":
7053
+ return "grid";
7054
+ case "group":
7055
+ return;
7056
+ case "heading":
7057
+ return "header";
7058
+ case "img":
7059
+ return "image";
7060
+ case "link":
7061
+ return "link";
7062
+ case "list":
7063
+ return "list";
7064
+ case "listitem":
7065
+ return;
7066
+ case "log":
7067
+ return;
7068
+ case "main":
7069
+ return;
7070
+ case "marquee":
7071
+ return;
7072
+ case "math":
7073
+ return;
7074
+ case "menu":
7075
+ return "menu";
7076
+ case "menubar":
7077
+ return "menubar";
7078
+ case "menuitem":
7079
+ return "menuitem";
7080
+ case "meter":
7081
+ return;
7082
+ case "navigation":
7083
+ return;
7084
+ case "none":
7085
+ return "none";
7086
+ case "note":
7087
+ return;
7088
+ case "option":
7089
+ return;
7090
+ case "presentation":
7091
+ return "none";
7092
+ case "progressbar":
7093
+ return "progressbar";
7094
+ case "radio":
7095
+ return "radio";
7096
+ case "radiogroup":
7097
+ return "radiogroup";
7098
+ case "region":
7099
+ return;
7100
+ case "row":
7101
+ return;
7102
+ case "rowgroup":
7103
+ return;
7104
+ case "rowheader":
7105
+ return;
7106
+ case "scrollbar":
7107
+ return "scrollbar";
7108
+ case "searchbox":
7109
+ return "search";
7110
+ case "separator":
7111
+ return;
7112
+ case "slider":
7113
+ return "adjustable";
7114
+ case "spinbutton":
7115
+ return "spinbutton";
7116
+ case "status":
7117
+ return;
7118
+ case "summary":
7119
+ return "summary";
7120
+ case "switch":
7121
+ return "switch";
7122
+ case "tab":
7123
+ return "tab";
7124
+ case "table":
7125
+ return;
7126
+ case "tablist":
7127
+ return "tablist";
7128
+ case "tabpanel":
7129
+ return;
7130
+ case "term":
7131
+ return;
7132
+ case "timer":
7133
+ return "timer";
7134
+ case "toolbar":
7135
+ return "toolbar";
7136
+ case "tooltip":
7137
+ return;
7138
+ case "tree":
7139
+ return;
7140
+ case "treegrid":
7141
+ return;
7142
+ case "treeitem":
7143
+ return;
7144
+ }
7145
+ }
7146
+ }
7147
+ });
7148
+
6923
7149
  // ../core/dist/cjs/getBaseViews.native.js
6924
7150
  var require_getBaseViews_native = __commonJS({
6925
7151
  "../core/dist/cjs/getBaseViews.native.js"(exports, module2) {
@@ -6938,10 +7164,12 @@ var require_getBaseViews_native = __commonJS({
6938
7164
  });
6939
7165
  module2.exports = __toCommonJS2(getBaseViews_native_exports);
6940
7166
  function getBaseViews() {
6941
- let native = require("react-native");
6942
- return {
6943
- View: native.View || native.default.View,
7167
+ let native = require("react-native"), View2, TextAncestor;
7168
+ return View2 || (View2 = native.View || native.default.View), {
7169
+ View: View2,
6944
7170
  Text: native.Text || native.default.Text,
7171
+ StyleSheet: native.StyleSheet || native.default.StyleSheet,
7172
+ TextAncestor,
6945
7173
  Pressable: native.Pressable || native.default.Pressable
6946
7174
  };
6947
7175
  }
@@ -7192,10 +7420,10 @@ var require_index_native15 = __commonJS({
7192
7420
  Text: () => Text3
7193
7421
  });
7194
7422
  module2.exports = __toCommonJS2(src_exports2);
7195
- 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();
7423
+ 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();
7196
7424
  __reExport2(src_exports2, require_index_native9(), module2.exports);
7197
7425
  __reExport2(src_exports2, require_reactNativeTypes_native(), module2.exports);
7198
- var Stack3 = import_web.Stack, Text3 = import_web.Text;
7426
+ var Stack3 = import_web.Stack, Text3 = import_web.Text, baseViews = (0, import_getBaseViews.getBaseViews)();
7199
7427
  (0, import_web.setupHooks)({
7200
7428
  getBaseViews: import_getBaseViews.getBaseViews,
7201
7429
  usePropsTransform(elementType, propsIn, hostRef) {
@@ -7268,22 +7496,9 @@ var require_index_native15 = __commonJS({
7268
7496
  viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_web.composeEventHandlers)(og, val) : val;
7269
7497
  }
7270
7498
  }
7499
+ },
7500
+ useChildren(elementType, children, viewProps, events, staticConfig) {
7271
7501
  }
7272
- // attempt at properly fixing RN input, but <Pressable><TextInput /> just doesnt work on RN
7273
- // useChildren(children, viewProps, events, staticConfig) {
7274
- // if (process.env.TAMAGUI_TARGET === 'native') {
7275
- // if (staticConfig.isInput && !staticConfig.isHOC) {
7276
- // const Pressable = getBaseViews().Pressable
7277
- // console.log(
7278
- // 'wrapping in pressable',
7279
- // events?.['onPressIn']?.toString(),
7280
- // viewProps['onPressIn']
7281
- // )
7282
- // // we need to wrap it in a view?
7283
- // return <Pressable {...events}>{children}</Pressable>
7284
- // }
7285
- // }
7286
- // },
7287
7502
  });
7288
7503
  var dontComposePressabilityKeys = {
7289
7504
  onClick: !0
@@ -17827,8 +18042,8 @@ var require_Toggle_native = __commonJS({
17827
18042
  backgroundColor: "$background"
17828
18043
  },
17829
18044
  focusStyle: {
17830
- borderColor: "$borderColorPress",
17831
- backgroundColor: "$backgroundPress"
18045
+ borderColor: "$borderColor",
18046
+ backgroundColor: "$background"
17832
18047
  }
17833
18048
  }
17834
18049
  },
@@ -17846,37 +18061,36 @@ var require_Toggle_native = __commonJS({
17846
18061
  defaultVariants: {
17847
18062
  unstyled: !1
17848
18063
  }
17849
- }), Toggle = ToggleFrame.extractable(
17850
- React2.forwardRef((props, forwardedRef) => {
17851
- let {
17852
- pressed: pressedProp,
17853
- defaultPressed = !1,
17854
- onPressedChange,
17855
- ...buttonProps
17856
- } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
17857
- prop: pressedProp,
17858
- onChange: onPressedChange,
17859
- defaultProp: defaultPressed
17860
- });
17861
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17862
- ToggleFrame,
17863
- {
18064
+ }), Toggle = React2.forwardRef(function(props, forwardedRef) {
18065
+ let {
18066
+ pressed: pressedProp,
18067
+ defaultPressed = !1,
18068
+ onPressedChange,
18069
+ ...buttonProps
18070
+ } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
18071
+ prop: pressedProp,
18072
+ onChange: onPressedChange,
18073
+ defaultProp: defaultPressed
18074
+ });
18075
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18076
+ ToggleFrame,
18077
+ {
18078
+ ...!props.unstyled && {
17864
18079
  theme: pressed ? "active" : null,
17865
- themeShallow: !0,
17866
- active: props.unstyled ? void 0 : pressed,
17867
- "aria-pressed": pressed,
17868
- "data-state": pressed ? "on" : "off",
17869
- "data-disabled": props.disabled ? "" : void 0,
17870
- ...buttonProps,
17871
- ref: forwardedRef,
17872
- onPress: (0, import_web.composeEventHandlers)(props.onPress ?? void 0, (event) => {
17873
- props.disabled || setPressed(!pressed);
17874
- })
17875
- }
17876
- );
17877
- })
17878
- );
17879
- Toggle.displayName = NAME;
18080
+ themeShallow: !0
18081
+ },
18082
+ active: props.unstyled ? void 0 : pressed,
18083
+ "aria-pressed": pressed,
18084
+ "data-state": pressed ? "on" : "off",
18085
+ "data-disabled": props.disabled ? "" : void 0,
18086
+ ...buttonProps,
18087
+ ref: forwardedRef,
18088
+ onPress: (0, import_web.composeEventHandlers)(props.onPress ?? void 0, () => {
18089
+ props.disabled || setPressed(!pressed);
18090
+ })
18091
+ }
18092
+ );
18093
+ });
17880
18094
  }
17881
18095
  });
17882
18096
 
@@ -17907,78 +18121,50 @@ var require_ToggleGroup_native = __commonJS({
17907
18121
  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(
17908
18122
  import_react2.default.forwardRef(
17909
18123
  (props, forwardedRef) => {
17910
- let { __scopeToggleGroup, ...rest } = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), context = useToggleGroupContext(__scopeToggleGroup), pressed = valueContext.value.includes(props.value), disabled = context.disabled || props.disabled || !1, ref = import_react2.default.useRef(null), groupItemProps = (0, import_group.useGroupItem)({ disabled }), size2 = props.size ?? context.size, sizeProps = props.unstyled ? {} : {
18124
+ 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 ? {} : {
17911
18125
  width: void 0,
17912
18126
  height: void 0,
17913
18127
  padding: (0, import_web.getVariableValue)(size2) * 0.6
17914
- }, 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 };
17915
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemProvider, { scope: __scopeToggleGroup, children: context.rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17916
- import_roving_focus.RovingFocusGroup.Item,
18128
+ }, 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)(
18129
+ ToggleGroupItemImpl,
17917
18130
  {
17918
- asChild: "except-style",
17919
- __scopeRovingFocusGroup: __scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
18131
+ ...commonProps,
18132
+ ref: forwardedRef,
17920
18133
  focusable: !disabled,
17921
- active: pressed,
17922
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17923
- import_Toggle.ToggleFrame,
17924
- {
17925
- asChild: "except-style",
17926
- focusable: !disabled,
17927
- disabled,
17928
- ref,
17929
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17930
- ToggleGroupItemImpl,
17931
- {
17932
- __scopeToggleGroup,
17933
- ...commonProps,
17934
- ref: forwardedRef,
17935
- ...groupItemProps
17936
- }
17937
- )
17938
- }
17939
- )
18134
+ disabled,
18135
+ ...groupItemProps
17940
18136
  }
17941
- ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17942
- import_Toggle.ToggleFrame,
18137
+ );
18138
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemProvider, { scope: props.__scopeToggleGroup, children: context.rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18139
+ import_roving_focus.RovingFocusGroup.Item,
17943
18140
  {
17944
18141
  asChild: "except-style",
18142
+ __scopeRovingFocusGroup: props.__scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
17945
18143
  focusable: !disabled,
17946
- disabled,
17947
- ref,
17948
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17949
- ToggleGroupItemImpl,
17950
- {
17951
- __scopeToggleGroup,
17952
- ...commonProps,
17953
- ref: forwardedRef
17954
- }
17955
- )
18144
+ active: pressed,
18145
+ children: inner
17956
18146
  }
17957
- ) });
18147
+ ) : inner });
17958
18148
  }
17959
18149
  )
17960
18150
  );
17961
18151
  ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
17962
- var ToggleGroupItemImpl = import_Toggle.ToggleFrame.extractable(
17963
- import_react2.default.forwardRef(
17964
- (props, forwardedRef) => {
17965
- let { __scopeToggleGroup, value, ...itemProps } = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), singleProps = {
17966
- "aria-pressed": void 0
17967
- }, typeProps = valueContext.type === "single" ? singleProps : void 0;
17968
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
17969
- import_Toggle.Toggle,
17970
- {
17971
- ...typeProps,
17972
- ...itemProps,
17973
- ref: forwardedRef,
17974
- onPressedChange: (pressed) => {
17975
- pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
17976
- }
17977
- }
17978
- );
18152
+ var ToggleGroupItemImpl = import_react2.default.forwardRef((props, forwardedRef) => {
18153
+ let { __scopeToggleGroup, value, ...itemProps } = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), singleProps = {
18154
+ "aria-pressed": void 0
18155
+ }, typeProps = valueContext.type === "single" ? singleProps : void 0;
18156
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18157
+ import_Toggle.Toggle,
18158
+ {
18159
+ ...typeProps,
18160
+ ...itemProps,
18161
+ ref: forwardedRef,
18162
+ onPressedChange: (pressed) => {
18163
+ pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
18164
+ }
17979
18165
  }
17980
- )
17981
- ), ToggleGroup = (0, import_web.withStaticProperties)(
18166
+ );
18167
+ }), ToggleGroup = (0, import_web.withStaticProperties)(
17982
18168
  import_react2.default.forwardRef(
17983
18169
  (props, forwardedRef) => {
17984
18170
  let { type, ...toggleGroupProps } = props;