tamagui 1.75.0 → 1.75.2

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.
@@ -18042,8 +18042,8 @@ var require_Toggle_native = __commonJS({
18042
18042
  backgroundColor: "$background"
18043
18043
  },
18044
18044
  focusStyle: {
18045
- borderColor: "$borderColorPress",
18046
- backgroundColor: "$backgroundPress"
18045
+ borderColor: "$borderColor",
18046
+ backgroundColor: "$background"
18047
18047
  }
18048
18048
  }
18049
18049
  },
@@ -18061,37 +18061,36 @@ var require_Toggle_native = __commonJS({
18061
18061
  defaultVariants: {
18062
18062
  unstyled: !1
18063
18063
  }
18064
- }), Toggle = ToggleFrame.extractable(
18065
- React2.forwardRef((props, forwardedRef) => {
18066
- let {
18067
- pressed: pressedProp,
18068
- defaultPressed = !1,
18069
- onPressedChange,
18070
- ...buttonProps
18071
- } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
18072
- prop: pressedProp,
18073
- onChange: onPressedChange,
18074
- defaultProp: defaultPressed
18075
- });
18076
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18077
- ToggleFrame,
18078
- {
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 && {
18079
18079
  theme: pressed ? "active" : null,
18080
- themeShallow: !0,
18081
- active: props.unstyled ? void 0 : pressed,
18082
- "aria-pressed": pressed,
18083
- "data-state": pressed ? "on" : "off",
18084
- "data-disabled": props.disabled ? "" : void 0,
18085
- ...buttonProps,
18086
- ref: forwardedRef,
18087
- onPress: (0, import_web.composeEventHandlers)(props.onPress ?? void 0, (event) => {
18088
- props.disabled || setPressed(!pressed);
18089
- })
18090
- }
18091
- );
18092
- })
18093
- );
18094
- 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
+ });
18095
18094
  }
18096
18095
  });
18097
18096
 
@@ -18122,78 +18121,50 @@ var require_ToggleGroup_native = __commonJS({
18122
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(
18123
18122
  import_react2.default.forwardRef(
18124
18123
  (props, forwardedRef) => {
18125
- 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 ? {} : {
18126
18125
  width: void 0,
18127
18126
  height: void 0,
18128
18127
  padding: (0, import_web.getVariableValue)(size2) * 0.6
18129
- }, 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 };
18130
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemProvider, { scope: __scopeToggleGroup, children: context.rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18131
- 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,
18132
18130
  {
18133
- asChild: "except-style",
18134
- __scopeRovingFocusGroup: __scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
18131
+ ...commonProps,
18132
+ ref: forwardedRef,
18135
18133
  focusable: !disabled,
18136
- active: pressed,
18137
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18138
- import_Toggle.ToggleFrame,
18139
- {
18140
- asChild: "except-style",
18141
- focusable: !disabled,
18142
- disabled,
18143
- ref,
18144
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18145
- ToggleGroupItemImpl,
18146
- {
18147
- __scopeToggleGroup,
18148
- ...commonProps,
18149
- ref: forwardedRef,
18150
- ...groupItemProps
18151
- }
18152
- )
18153
- }
18154
- )
18134
+ disabled,
18135
+ ...groupItemProps
18155
18136
  }
18156
- ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18157
- 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,
18158
18140
  {
18159
18141
  asChild: "except-style",
18142
+ __scopeRovingFocusGroup: props.__scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
18160
18143
  focusable: !disabled,
18161
- disabled,
18162
- ref,
18163
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18164
- ToggleGroupItemImpl,
18165
- {
18166
- __scopeToggleGroup,
18167
- ...commonProps,
18168
- ref: forwardedRef
18169
- }
18170
- )
18144
+ active: pressed,
18145
+ children: inner
18171
18146
  }
18172
- ) });
18147
+ ) : inner });
18173
18148
  }
18174
18149
  )
18175
18150
  );
18176
18151
  ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
18177
- var ToggleGroupItemImpl = import_Toggle.ToggleFrame.extractable(
18178
- import_react2.default.forwardRef(
18179
- (props, forwardedRef) => {
18180
- let { __scopeToggleGroup, value, ...itemProps } = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), singleProps = {
18181
- "aria-pressed": void 0
18182
- }, typeProps = valueContext.type === "single" ? singleProps : void 0;
18183
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18184
- import_Toggle.Toggle,
18185
- {
18186
- ...typeProps,
18187
- ...itemProps,
18188
- ref: forwardedRef,
18189
- onPressedChange: (pressed) => {
18190
- pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
18191
- }
18192
- }
18193
- );
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
+ }
18194
18165
  }
18195
- )
18196
- ), ToggleGroup = (0, import_web.withStaticProperties)(
18166
+ );
18167
+ }), ToggleGroup = (0, import_web.withStaticProperties)(
18197
18168
  import_react2.default.forwardRef(
18198
18169
  (props, forwardedRef) => {
18199
18170
  let { type, ...toggleGroupProps } = props;