@tamagui/button 1.79.7 → 1.79.8

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.
@@ -0,0 +1,237 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContextScope } from "@tamagui/create-context";
3
+ import { getFontSize } from "@tamagui/font-size";
4
+ import { getButtonSized } from "@tamagui/get-button-sized";
5
+ import { useGetThemedIcon } from "@tamagui/helpers-tamagui";
6
+ import { wrapChildrenInText } from "@tamagui/text";
7
+ import {
8
+ ButtonNestingContext,
9
+ getConfig,
10
+ getVariableValue,
11
+ isRSC,
12
+ spacedChildren,
13
+ styled,
14
+ useMediaPropsActive,
15
+ withStaticProperties
16
+ } from "@tamagui/web";
17
+ import { useCallback, useContext, useEffect, useState } from "react";
18
+ import {
19
+ BUTTON_ICON_NAME,
20
+ BUTTON_NAME,
21
+ BUTTON_TEXT_NAME,
22
+ Button as BaseButton
23
+ } from "./Button";
24
+ const ButtonFrame = styled(BaseButton, {
25
+ name: BUTTON_NAME,
26
+ variants: {
27
+ unstyled: {
28
+ false: {
29
+ size: "$true",
30
+ justifyContent: "center",
31
+ alignItems: "center",
32
+ flexWrap: "nowrap",
33
+ flexDirection: "row",
34
+ cursor: "pointer",
35
+ hoverTheme: true,
36
+ pressTheme: true,
37
+ backgrounded: true,
38
+ borderWidth: 1,
39
+ borderColor: "$borderColor",
40
+ pressStyle: {
41
+ borderColor: "$borderColorPress"
42
+ },
43
+ focusStyle: {
44
+ outlineColor: "$borderColorFocus",
45
+ outlineStyle: "solid",
46
+ outlineWidth: 2
47
+ }
48
+ }
49
+ },
50
+ size: {
51
+ "...size": getButtonSized
52
+ },
53
+ active: {
54
+ true: {
55
+ hoverStyle: {
56
+ backgroundColor: "$background"
57
+ }
58
+ }
59
+ },
60
+ disabled: {
61
+ true: {
62
+ pointerEvents: "none"
63
+ }
64
+ }
65
+ },
66
+ defaultVariants: {
67
+ unstyled: false
68
+ }
69
+ });
70
+ const [createButtonContext, createButtonScope] = createContextScope(BUTTON_NAME);
71
+ const [ButtonProvider, useButtonContext] = createButtonContext("Button");
72
+ const ButtonTextFrame = styled(BaseButton.Text, {
73
+ name: BUTTON_TEXT_NAME,
74
+ variants: {
75
+ unstyled: {
76
+ false: {
77
+ userSelect: "none",
78
+ cursor: "pointer",
79
+ // flexGrow 1 leads to inconsistent native style where text pushes to start of view
80
+ flexGrow: 0,
81
+ flexShrink: 1,
82
+ ellipse: true,
83
+ color: "$color"
84
+ }
85
+ }
86
+ },
87
+ defaultVariants: {
88
+ unstyled: false
89
+ }
90
+ });
91
+ const ButtonText = ButtonTextFrame.styleable(
92
+ (props, ref) => {
93
+ const context = useButtonContext(BUTTON_TEXT_NAME, props.__scopeButton);
94
+ useEffect(() => {
95
+ const unregister = context.registerButtonText();
96
+ return () => unregister();
97
+ }, [context.registerButtonText]);
98
+ return /* @__PURE__ */ jsx(ButtonTextFrame, { ref, color: context.color, size: context.size, ...props, children: props.children });
99
+ }
100
+ );
101
+ const ButtonIcon = (props) => {
102
+ const { children, scaleIcon = 1 } = props;
103
+ const context = useButtonContext(BUTTON_ICON_NAME, props.__scopeButton);
104
+ const size = context.size;
105
+ const color = context.color;
106
+ const iconSize = (typeof size === "number" ? size * 0.5 : getFontSize(size)) * scaleIcon;
107
+ const getThemedIcon = useGetThemedIcon({ size: iconSize, color });
108
+ return getThemedIcon(children);
109
+ };
110
+ const ButtonComponent = ButtonFrame.styleable(
111
+ (props, ref) => {
112
+ const buttonApi = props.forceButtonApi ?? getConfig().buttonApi ?? "mixed";
113
+ const { props: buttonProps } = useButton(props);
114
+ const [buttonTextCount, setButtonTextCount] = useState(0);
115
+ const registerButtonText = useCallback(() => {
116
+ if (buttonApi === "simple") {
117
+ console.warn(
118
+ "You are using Button.Text with simple button API. Either remove Button.Text or use either `buttonApi: composable` or `mixed` in your tamagui config."
119
+ );
120
+ }
121
+ if (buttonApi === "composable")
122
+ return () => {
123
+ };
124
+ setButtonTextCount((prev) => prev + 1);
125
+ return () => setButtonTextCount((prev) => prev - 1);
126
+ }, [setButtonTextCount]);
127
+ const usesComposableApi = buttonApi === "composable" || buttonApi === "mixed" && buttonTextCount > 0;
128
+ return /* @__PURE__ */ jsx(
129
+ ButtonProvider,
130
+ {
131
+ scope: props.__scopeButton,
132
+ size: props.size ?? "$true",
133
+ color: props.color,
134
+ usesComposableApi,
135
+ registerButtonText,
136
+ children: /* @__PURE__ */ jsx(ButtonFrame, { unstyled: props.unstyled ?? false, ref, ...buttonProps })
137
+ }
138
+ );
139
+ }
140
+ );
141
+ const Button = withStaticProperties(ButtonComponent, {
142
+ Text: ButtonText,
143
+ Icon: ButtonIcon
144
+ });
145
+ function useButton(propsIn, { Text = ButtonTextFrame } = { Text: ButtonTextFrame }) {
146
+ const {
147
+ children,
148
+ icon,
149
+ iconAfter,
150
+ noTextWrap,
151
+ theme: themeName,
152
+ space,
153
+ spaceFlex,
154
+ scaleIcon = 1,
155
+ scaleSpace = 0.66,
156
+ separator,
157
+ // text props
158
+ color,
159
+ fontWeight,
160
+ letterSpacing,
161
+ fontSize,
162
+ fontFamily,
163
+ fontStyle,
164
+ textAlign,
165
+ unstyled = false,
166
+ textProps,
167
+ ...rest
168
+ } = propsIn;
169
+ const isNested = isRSC ? false : useContext(ButtonNestingContext);
170
+ const propsActive = useMediaPropsActive(propsIn);
171
+ const size = propsActive.size || "$true";
172
+ const iconSize = (typeof size === "number" ? size * 0.5 : getFontSize(size)) * scaleIcon;
173
+ const getThemedIcon = useGetThemedIcon({ size: iconSize, color });
174
+ const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
175
+ const spaceSize = propsActive.space ?? getVariableValue(iconSize) * scaleSpace;
176
+ const contents = wrapChildrenInText(
177
+ Text,
178
+ propsActive,
179
+ Text === ButtonTextFrame ? {
180
+ unstyled
181
+ } : void 0
182
+ );
183
+ const inner = spacedChildren({
184
+ // a bit arbitrary but scaling to font size is necessary so long as button does
185
+ space: spaceSize,
186
+ spaceFlex,
187
+ separator,
188
+ direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
189
+ children: [themedIcon, ...contents, themedIconAfter]
190
+ });
191
+ const tag = isNested ? "span" : (
192
+ // defaults to <a /> when accessibilityRole = link
193
+ // see https://github.com/tamagui/tamagui/issues/505
194
+ propsIn.accessibilityRole === "link" ? "a" : void 0
195
+ );
196
+ const props = {
197
+ ...propsActive.disabled && {
198
+ // in rnw - false still has keyboard tabIndex, undefined = not actually focusable
199
+ focusable: void 0,
200
+ // even with tabIndex unset, it will keep focusStyle on web so disable it here
201
+ focusStyle: {
202
+ borderColor: "$background"
203
+ }
204
+ },
205
+ tag,
206
+ ...rest,
207
+ children: isRSC ? inner : /* @__PURE__ */ jsx(ButtonNestingContext.Provider, { value: true, children: inner })
208
+ };
209
+ return {
210
+ spaceSize,
211
+ isNested,
212
+ props
213
+ };
214
+ }
215
+ const buttonStaticConfig = {
216
+ inlineProps: /* @__PURE__ */ new Set([
217
+ // text props go here (can't really optimize them, but we never fully extract button anyway)
218
+ // may be able to remove this entirely, as the compiler / runtime have gotten better
219
+ "color",
220
+ "fontWeight",
221
+ "fontSize",
222
+ "fontFamily",
223
+ "fontStyle",
224
+ "letterSpacing",
225
+ "textAlign",
226
+ "unstyled"
227
+ ])
228
+ };
229
+ export {
230
+ Button,
231
+ ButtonFrame,
232
+ ButtonTextFrame as ButtonText,
233
+ buttonStaticConfig,
234
+ createButtonScope,
235
+ useButton
236
+ };
237
+ //# sourceMappingURL=themed.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/themed.tsx"],
4
+ "mappings": "AA8KM;AA7KN,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAoB,wBAAwB;AAC5C,SAA2B,0BAA0B;AACrD;AAAA,EACE;AAAA,EAKA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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AAA;AAAA,IAE3B,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,WACE,YAAY,kBAAkB,YAC9B,YAAY,kBAAkB,mBAC1B,aACA;AAAA,IACN,UAAU,CAAC,YAAY,GAAG,UAAU,eAAe;AAAA,EACrD,CAAC;AAGD,QAAM,MAAM,WACR;AAAA;AAAA;AAAA,IAGF,QAAQ,sBAAsB,SAC5B,MACA;AAAA;AAEJ,QAAM,QAAQ;AAAA,IACZ,GAAI,YAAY,YAAY;AAAA;AAAA,MAE1B,WAAW;AAAA;AAAA,MAEX,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA;AAAA,IACA,GAAG;AAAA,IACH,UAAU,QACR,QAEA,oBAAC,qBAAqB,UAArB,EAA8B,OAAO,MAAO,iBAAM;AAAA,EAEvD;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,MAAM,qBAAqB;AAAA,EACzB,aAAa,oBAAI,IAAI;AAAA;AAAA;AAAA,IAGnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
5
+ "names": []
6
+ }
@@ -0,0 +1,200 @@
1
+ import { getFontSize } from "@tamagui/font-size";
2
+ import { getButtonSized } from "@tamagui/get-button-sized";
3
+ import { useGetThemedIcon } from "@tamagui/helpers-tamagui";
4
+ import { ThemeableStack } from "@tamagui/stacks";
5
+ import {
6
+ SizableText,
7
+ wrapChildrenInText
8
+ } from "@tamagui/text";
9
+ import {
10
+ ButtonNestingContext,
11
+ createStyledContext,
12
+ getVariableValue,
13
+ spacedChildren,
14
+ styled,
15
+ useProps,
16
+ withStaticProperties
17
+ } from "@tamagui/web";
18
+ import { useContext } from "react";
19
+ const ButtonContext = createStyledContext({
20
+ size: "$true",
21
+ color: void 0,
22
+ fontFamily: void 0,
23
+ fontSize: void 0,
24
+ fontStyle: void 0,
25
+ fontWeight: void 0,
26
+ letterSpacing: void 0,
27
+ textAlign: void 0
28
+ });
29
+ const BUTTON_NAME = "Button";
30
+ const ButtonFrame = styled(ThemeableStack, {
31
+ name: BUTTON_NAME,
32
+ tag: "button",
33
+ context: ButtonContext,
34
+ focusable: true,
35
+ role: "button",
36
+ variants: {
37
+ unstyled: {
38
+ false: {
39
+ size: "$true",
40
+ justifyContent: "center",
41
+ alignItems: "center",
42
+ flexWrap: "nowrap",
43
+ flexDirection: "row",
44
+ cursor: "pointer",
45
+ hoverTheme: true,
46
+ pressTheme: true,
47
+ backgrounded: true,
48
+ borderWidth: 1,
49
+ borderColor: "$borderColor",
50
+ focusStyle: {
51
+ outlineColor: "$borderColorFocus",
52
+ outlineStyle: "solid",
53
+ outlineWidth: 2
54
+ }
55
+ }
56
+ },
57
+ size: {
58
+ "...size": getButtonSized
59
+ },
60
+ disabled: {
61
+ true: {
62
+ pointerEvents: "none"
63
+ }
64
+ }
65
+ },
66
+ defaultVariants: {
67
+ unstyled: false
68
+ }
69
+ });
70
+ const ButtonText = styled(SizableText, {
71
+ name: "Button",
72
+ context: ButtonContext,
73
+ variants: {
74
+ unstyled: {
75
+ false: {
76
+ userSelect: "none",
77
+ cursor: "pointer",
78
+ // flexGrow 1 leads to inconsistent native style where text pushes to start of view
79
+ flexGrow: 0,
80
+ flexShrink: 1,
81
+ ellipse: true,
82
+ color: "$color"
83
+ }
84
+ }
85
+ },
86
+ defaultVariants: {
87
+ unstyled: false
88
+ }
89
+ });
90
+ const ButtonIcon = (props) => {
91
+ const { children, scaleIcon = 1 } = props;
92
+ const { size, color } = useContext(ButtonContext);
93
+ const iconSize = (typeof size === "number" ? size * 0.5 : getFontSize(size)) * scaleIcon;
94
+ const getThemedIcon = useGetThemedIcon({ size: iconSize, color });
95
+ return getThemedIcon(children);
96
+ };
97
+ const ButtonComponent = ButtonFrame.styleable(function Button(props, ref) {
98
+ const { props: buttonProps } = useButton(props);
99
+ return <ButtonFrame {...buttonProps} ref={ref} />;
100
+ });
101
+ const buttonStaticConfig = {
102
+ inlineProps: /* @__PURE__ */ new Set([
103
+ // text props go here (can't really optimize them, but we never fully extract button anyway)
104
+ // may be able to remove this entirely, as the compiler / runtime have gotten better
105
+ "color",
106
+ "fontWeight",
107
+ "fontSize",
108
+ "fontFamily",
109
+ "fontStyle",
110
+ "letterSpacing",
111
+ "textAlign",
112
+ "unstyled"
113
+ ])
114
+ };
115
+ const Button2 = withStaticProperties(ButtonComponent, {
116
+ Text: ButtonText,
117
+ Icon: ButtonIcon
118
+ });
119
+ function useButton(propsIn, { Text = Button2.Text } = { Text: Button2.Text }) {
120
+ const {
121
+ children,
122
+ icon,
123
+ iconAfter,
124
+ noTextWrap,
125
+ theme: themeName,
126
+ space,
127
+ spaceFlex,
128
+ scaleIcon = 1,
129
+ scaleSpace = 0.66,
130
+ separator,
131
+ // text props
132
+ color,
133
+ fontWeight,
134
+ letterSpacing,
135
+ fontSize,
136
+ fontFamily,
137
+ fontStyle,
138
+ textAlign,
139
+ textProps,
140
+ ...rest
141
+ } = propsIn;
142
+ const isNested = useContext(ButtonNestingContext);
143
+ const propsActive = useProps(propsIn);
144
+ const size = propsActive.size || "$true";
145
+ const iconSize = (typeof size === "number" ? size * 0.5 : getFontSize(size)) * scaleIcon;
146
+ const getThemedIcon = useGetThemedIcon({ size: iconSize, color });
147
+ const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
148
+ const spaceSize = propsActive.space ?? getVariableValue(iconSize) * scaleSpace;
149
+ const contents = wrapChildrenInText(
150
+ Text,
151
+ propsActive,
152
+ Text === ButtonText && propsIn.unstyled !== true ? {
153
+ unstyled: true,
154
+ size
155
+ } : void 0
156
+ );
157
+ const inner = spacedChildren({
158
+ // a bit arbitrary but scaling to font size is necessary so long as button does
159
+ space: spaceSize,
160
+ spaceFlex,
161
+ separator,
162
+ direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
163
+ children: [themedIcon, ...contents, themedIconAfter]
164
+ });
165
+ const tag = isNested ? "span" : (
166
+ // defaults to <a /> when accessibilityRole = link
167
+ // see https://github.com/tamagui/tamagui/issues/505
168
+ propsIn.accessibilityRole === "link" ? "a" : void 0
169
+ );
170
+ const props = {
171
+ ...propsActive.disabled && {
172
+ // in rnw - false still has keyboard tabIndex, undefined = not actually focusable
173
+ focusable: void 0,
174
+ // even with tabIndex unset, it will keep focusStyle on web so disable it here
175
+ focusStyle: {
176
+ borderColor: "$background"
177
+ }
178
+ },
179
+ ...tag && {
180
+ tag
181
+ },
182
+ ...rest,
183
+ children: <ButtonNestingContext.Provider value={true}>{inner}</ButtonNestingContext.Provider>
184
+ };
185
+ return {
186
+ spaceSize,
187
+ isNested,
188
+ props
189
+ };
190
+ }
191
+ export {
192
+ Button2 as Button,
193
+ ButtonContext,
194
+ ButtonFrame,
195
+ ButtonIcon,
196
+ ButtonText,
197
+ buttonStaticConfig,
198
+ useButton
199
+ };
200
+ //# sourceMappingURL=Button.mjs.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Button.tsx"],
4
+ "mappings": "AAAA,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAKA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA4B,kBAAkB;AAEvC,MAAM,gBAAgB,oBAI3B;AAAA,EACA,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,WAAW;AACb,CAAC;AAoCD,MAAM,cAAc;AAEpB,MAAM,cAAc,OAAO,gBAAgB;AAAA,EACzC,MAAM;AAAA,EACN,KAAK;AAAA,EACL,SAAS;AAAA,E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AE3B,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,WACE,YAAY,kBAAkB,YAC9B,YAAY,kBAAkB,mBAC1B,aACA;AAAA,IACN,UAAU,CAAC,YAAY,GAAG,UAAU,eAAe;AAAA,EACrD,CAAC;AAGD,QAAM,MAAM,WACR;AAAA;AAAA;AAAA,IAGF,QAAQ,sBAAsB,SAC5B,MACA;AAAA;AAEJ,QAAM,QAAQ;AAAA,IACZ,GAAI,YAAY,YAAY;AAAA;AAAA,MAE1B,WAAW;AAAA;AAAA,MAEX,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA,GAAI,OAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,GAAG;AAAA,IACH,UACE,CAAC,qBAAqB,SAAS,OAAO,OAAO,MAAM,EAAlD,qBAAqB;AAAA,EAE1B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
5
+ "names": ["Button"]
6
+ }
@@ -0,0 +1,11 @@
1
+ process.env.TAMAGUI_TARGET = "web";
2
+ import { getDefaultTamaguiConfig } from "@tamagui/config-default";
3
+ import { createTamagui } from "@tamagui/core";
4
+ import { describe, expect, test } from "vitest";
5
+ const conf = createTamagui(getDefaultTamaguiConfig());
6
+ describe("Button", () => {
7
+ test(`123`, () => {
8
+ expect(true).toBeTruthy();
9
+ });
10
+ });
11
+ //# sourceMappingURL=Button.test.mjs.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/Button.test.tsx"],
4
+ "mappings": "AAAA,QAAQ,IAAI,iBAAiB;AAE7B,SAAS,+BAA+B;AACxC,SAAS,qBAAqB;AAC9B,SAAS,UAAU,QAAQ,YAAY;AAEvC,MAAM,OAAO,cAAc,wBAAwB,CAAC;AAEpD,SAAS,UAAU,MAAM;AACvB,OAAK,OAAO,MAAM;AAChB,WAAO,IAAI,EAAE,WAAW;AAAA,EAC1B,CAAC;AAWH,CAAC;",
5
+ "names": []
6
+ }
@@ -0,0 +1,5 @@
1
+ import { Button } from "./Button";
2
+ export {
3
+ Button
4
+ };
5
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/base.ts"],
4
+ "mappings": "AACA,SAAS,cAAc;",
5
+ "names": []
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/base.ts"],
4
+ "mappings": "AACA,SAAS,cAAc;",
5
+ "names": []
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Button";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "mappings": "AAAA,cAAc;",
5
+ "names": []
6
+ }