tamagui 1.75.0 → 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 CHANGED
@@ -18603,8 +18603,8 @@ var require_Toggle_native = __commonJS({
18603
18603
  backgroundColor: "$background"
18604
18604
  },
18605
18605
  focusStyle: {
18606
- borderColor: "$borderColorPress",
18607
- backgroundColor: "$backgroundPress"
18606
+ borderColor: "$borderColor",
18607
+ backgroundColor: "$background"
18608
18608
  }
18609
18609
  }
18610
18610
  },
@@ -18622,37 +18622,36 @@ var require_Toggle_native = __commonJS({
18622
18622
  defaultVariants: {
18623
18623
  unstyled: !1
18624
18624
  }
18625
- }), Toggle = ToggleFrame.extractable(
18626
- React2.forwardRef((props, forwardedRef) => {
18627
- let {
18628
- pressed: pressedProp,
18629
- defaultPressed = !1,
18630
- onPressedChange,
18631
- ...buttonProps
18632
- } = props, [pressed = !1, setPressed] = (0, import_use_controllable_state.useControllableState)({
18633
- prop: pressedProp,
18634
- onChange: onPressedChange,
18635
- defaultProp: defaultPressed
18636
- });
18637
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18638
- ToggleFrame,
18639
- {
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 && {
18640
18640
  theme: pressed ? "active" : null,
18641
- themeShallow: !0,
18642
- active: props.unstyled ? void 0 : pressed,
18643
- "aria-pressed": pressed,
18644
- "data-state": pressed ? "on" : "off",
18645
- "data-disabled": props.disabled ? "" : void 0,
18646
- ...buttonProps,
18647
- ref: forwardedRef,
18648
- onPress: (0, import_web.composeEventHandlers)(props.onPress ?? void 0, (event) => {
18649
- props.disabled || setPressed(!pressed);
18650
- })
18651
- }
18652
- );
18653
- })
18654
- );
18655
- 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
+ });
18656
18655
  }
18657
18656
  });
18658
18657
 
@@ -18683,78 +18682,50 @@ var require_ToggleGroup_native = __commonJS({
18683
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(
18684
18683
  import_react2.default.forwardRef(
18685
18684
  (props, forwardedRef) => {
18686
- 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 ? {} : {
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 ? {} : {
18687
18686
  width: void 0,
18688
18687
  height: void 0,
18689
18688
  padding: (0, import_web.getVariableValue)(size2) * 0.6
18690
- }, 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 };
18691
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ToggleGroupItemProvider, { scope: __scopeToggleGroup, children: context.rovingFocus ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18692
- 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,
18693
18691
  {
18694
- asChild: "except-style",
18695
- __scopeRovingFocusGroup: __scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
18692
+ ...commonProps,
18693
+ ref: forwardedRef,
18696
18694
  focusable: !disabled,
18697
- active: pressed,
18698
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18699
- import_Toggle.ToggleFrame,
18700
- {
18701
- asChild: "except-style",
18702
- focusable: !disabled,
18703
- disabled,
18704
- ref,
18705
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18706
- ToggleGroupItemImpl,
18707
- {
18708
- __scopeToggleGroup,
18709
- ...commonProps,
18710
- ref: forwardedRef,
18711
- ...groupItemProps
18712
- }
18713
- )
18714
- }
18715
- )
18695
+ disabled,
18696
+ ...groupItemProps
18716
18697
  }
18717
- ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18718
- import_Toggle.ToggleFrame,
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,
18719
18701
  {
18720
18702
  asChild: "except-style",
18703
+ __scopeRovingFocusGroup: props.__scopeToggleGroup || TOGGLE_GROUP_CONTEXT,
18721
18704
  focusable: !disabled,
18722
- disabled,
18723
- ref,
18724
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18725
- ToggleGroupItemImpl,
18726
- {
18727
- __scopeToggleGroup,
18728
- ...commonProps,
18729
- ref: forwardedRef
18730
- }
18731
- )
18705
+ active: pressed,
18706
+ children: inner
18732
18707
  }
18733
- ) });
18708
+ ) : inner });
18734
18709
  }
18735
18710
  )
18736
18711
  );
18737
18712
  ToggleGroupItem.displayName = TOGGLE_GROUP_ITEM_NAME;
18738
- var ToggleGroupItemImpl = import_Toggle.ToggleFrame.extractable(
18739
- import_react2.default.forwardRef(
18740
- (props, forwardedRef) => {
18741
- let { __scopeToggleGroup, value, ...itemProps } = props, valueContext = useToggleGroupValueContext(__scopeToggleGroup), singleProps = {
18742
- "aria-pressed": void 0
18743
- }, typeProps = valueContext.type === "single" ? singleProps : void 0;
18744
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
18745
- import_Toggle.Toggle,
18746
- {
18747
- ...typeProps,
18748
- ...itemProps,
18749
- ref: forwardedRef,
18750
- onPressedChange: (pressed) => {
18751
- pressed ? valueContext.onItemActivate(value) : valueContext.onItemDeactivate(value);
18752
- }
18753
- }
18754
- );
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
+ }
18755
18726
  }
18756
- )
18757
- ), ToggleGroup = (0, import_web.withStaticProperties)(
18727
+ );
18728
+ }), ToggleGroup = (0, import_web.withStaticProperties)(
18758
18729
  import_react2.default.forwardRef(
18759
18730
  (props, forwardedRef) => {
18760
18731
  let { type, ...toggleGroupProps } = props;