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.
- package/dist/native.js +60 -89
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +60 -89
- package/dist/test.native.js.map +1 -1
- package/package.json +52 -52
package/dist/test.native.js
CHANGED
|
@@ -18042,8 +18042,8 @@ var require_Toggle_native = __commonJS({
|
|
|
18042
18042
|
backgroundColor: "$background"
|
|
18043
18043
|
},
|
|
18044
18044
|
focusStyle: {
|
|
18045
|
-
borderColor: "$
|
|
18046
|
-
backgroundColor: "$
|
|
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 =
|
|
18065
|
-
|
|
18066
|
-
|
|
18067
|
-
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
|
|
18073
|
-
|
|
18074
|
-
|
|
18075
|
-
|
|
18076
|
-
|
|
18077
|
-
|
|
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
|
-
|
|
18082
|
-
|
|
18083
|
-
|
|
18084
|
-
|
|
18085
|
-
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
18134
|
-
|
|
18131
|
+
...commonProps,
|
|
18132
|
+
ref: forwardedRef,
|
|
18135
18133
|
focusable: !disabled,
|
|
18136
|
-
|
|
18137
|
-
|
|
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
|
-
)
|
|
18157
|
-
|
|
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
|
-
|
|
18162
|
-
|
|
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 =
|
|
18178
|
-
|
|
18179
|
-
|
|
18180
|
-
|
|
18181
|
-
|
|
18182
|
-
|
|
18183
|
-
|
|
18184
|
-
|
|
18185
|
-
|
|
18186
|
-
|
|
18187
|
-
|
|
18188
|
-
|
|
18189
|
-
|
|
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;
|