@tamagui/button 2.7.7 → 3.0.0-beta.643.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.
Files changed (48) hide show
  1. package/dist/cjs/Button.cjs +180 -266
  2. package/dist/cjs/Button.native.cjs +224 -0
  3. package/dist/cjs/Button.native.js +200 -271
  4. package/dist/cjs/Button.native.js.map +1 -1
  5. package/dist/cjs/index.cjs +10 -11
  6. package/dist/cjs/index.native.cjs +21 -0
  7. package/dist/cjs/index.native.js +10 -10
  8. package/dist/cjs/index.native.js.map +1 -1
  9. package/dist/esm/Button.mjs +168 -255
  10. package/dist/esm/Button.mjs.map +1 -1
  11. package/dist/esm/Button.native.js +188 -261
  12. package/dist/esm/Button.native.js.map +1 -1
  13. package/dist/esm/index.js +1 -2
  14. package/dist/esm/index.mjs +1 -2
  15. package/dist/esm/index.native.js +1 -2
  16. package/dist/jsx/Button.mjs +168 -255
  17. package/dist/jsx/Button.mjs.map +1 -1
  18. package/dist/jsx/Button.native.cjs +224 -0
  19. package/dist/jsx/Button.native.js +200 -271
  20. package/dist/jsx/Button.native.js.map +1 -1
  21. package/dist/jsx/index.js +1 -2
  22. package/dist/jsx/index.mjs +1 -2
  23. package/dist/jsx/index.native.cjs +21 -0
  24. package/dist/jsx/index.native.js +10 -10
  25. package/dist/jsx/index.native.js.map +1 -1
  26. package/package.json +11 -12
  27. package/src/Button.tsx +222 -280
  28. package/types/Button.d.ts +218 -114
  29. package/types/Button.d.ts.map +1 -1
  30. package/dist/cjs/Button.test.cjs +0 -37
  31. package/dist/cjs/Button.test.native.js +0 -40
  32. package/dist/cjs/Button.test.native.js.map +0 -1
  33. package/dist/esm/Button.test.mjs +0 -38
  34. package/dist/esm/Button.test.mjs.map +0 -1
  35. package/dist/esm/Button.test.native.js +0 -38
  36. package/dist/esm/Button.test.native.js.map +0 -1
  37. package/dist/esm/index.js.map +0 -1
  38. package/dist/esm/index.mjs.map +0 -1
  39. package/dist/esm/index.native.js.map +0 -1
  40. package/dist/jsx/Button.test.mjs +0 -38
  41. package/dist/jsx/Button.test.mjs.map +0 -1
  42. package/dist/jsx/Button.test.native.js +0 -40
  43. package/dist/jsx/Button.test.native.js.map +0 -1
  44. package/dist/jsx/index.js.map +0 -1
  45. package/dist/jsx/index.mjs.map +0 -1
  46. package/src/Button.test.tsx +0 -45
  47. package/types/Button.test.d.ts +0 -2
  48. package/types/Button.test.d.ts.map +0 -1
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
 
3
+
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
8
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
13
+ });
14
+ }
15
+ return to;
15
16
  };
16
17
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
19
  var index_exports = {};
21
20
  module.exports = __toCommonJS(index_exports);
22
21
  __reExport(index_exports, require("./Button.native.js"), module.exports);
22
+
23
23
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./Button\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,oBAAU,GAAG,OAAO,OAAO"}
@@ -1,263 +1,176 @@
1
- import { getFontSize } from "@tamagui/font-size";
2
- import { getButtonSized } from "@tamagui/get-button-sized";
3
- import { getIcon, useCurrentColor } from "@tamagui/helpers-tamagui";
4
- import { ButtonNestingContext, getElevation, themeableVariants } from "@tamagui/stacks";
5
- import { SizableText, wrapChildrenInText } from "@tamagui/text";
6
- import { createStyledContext, getTokenValue, styled, useProps, View, withStaticProperties } from "@tamagui/web";
1
+ import { useGetThemedIcon } from "@tamagui/helpers-tamagui";
2
+ import { ButtonNestingContext } from "@tamagui/stacks";
3
+ import { wrapChildrenInText } from "@tamagui/text";
4
+ import { Text, View, createStyledContext, createStyledHOC, styled, useProps, withStaticProperties } from "@tamagui/web";
7
5
  import { useContext } from "react";
8
6
  import { jsx, jsxs } from "react/jsx-runtime";
9
- const context = createStyledContext({
10
- size: void 0,
11
- variant: void 0,
12
- color: void 0,
13
- elevation: void 0,
14
- ellipsis: void 0,
15
- fontFamily: void 0,
16
- fontSize: void 0,
17
- fontStyle: void 0,
18
- fontWeight: void 0,
19
- letterSpacing: void 0,
20
- maxFontSizeMultiplier: void 0,
21
- textAlign: void 0
22
- });
23
- const Frame = styled(View, {
24
- context,
25
- name: "Button",
26
- role: "button",
27
- render: /* @__PURE__ */jsx("button", {
28
- type: "button"
29
- }),
30
- tabIndex: 0,
31
- variants: {
32
- unstyled: {
33
- true: {
34
- // reset browser <button> defaults
35
- outlineWidth: 0,
36
- borderWidth: 0,
37
- backgroundColor: "transparent"
38
- },
39
- false: {
40
- size: "$true",
41
- justifyContent: "center",
42
- alignItems: "center",
43
- flexWrap: "nowrap",
44
- flexDirection: "row",
45
- backgroundColor: "$background",
46
- borderWidth: 1,
47
- borderColor: "transparent",
48
- "$platform-web": {
49
- cursor: "pointer"
50
- },
51
- hoverStyle: {
52
- backgroundColor: "$backgroundHover",
53
- borderColor: "$borderColorHover"
54
- },
55
- pressStyle: {
56
- backgroundColor: "$backgroundPress",
57
- borderColor: "$borderColorHover"
58
- },
59
- focusVisibleStyle: {
60
- outlineColor: "$outlineColor",
61
- outlineStyle: "solid",
62
- outlineWidth: 2
63
- }
64
- }
65
- },
66
- variant: {
67
- outlined: process.env.TAMAGUI_HEADLESS === "1" ? {} : {
68
- backgroundColor: "transparent",
69
- borderWidth: 1,
70
- borderColor: "$borderColor",
71
- hoverStyle: {
72
- backgroundColor: "transparent",
73
- borderColor: "$borderColorHover"
74
- },
75
- pressStyle: {
76
- backgroundColor: "transparent",
77
- borderColor: "$borderColorPress"
78
- }
79
- }
80
- },
81
- circular: themeableVariants.circular,
82
- chromeless: themeableVariants.chromeless,
83
- size: {
84
- "...size": (val, extras) => {
85
- const buttonStyle = getButtonSized(val, extras);
86
- const gap = getTokenValue(val);
87
- return {
88
- ...buttonStyle,
89
- gap
90
- };
91
- },
92
- ":number": (val, extras) => {
93
- const buttonStyle = getButtonSized(val, extras);
94
- const gap = val * 0.4;
95
- return {
96
- ...buttonStyle,
97
- gap
98
- };
99
- }
100
- },
101
- elevation: {
102
- "...size": getElevation,
103
- ":number": getElevation
104
- },
105
- disabled: {
106
- true: {
107
- pointerEvents: "none",
108
- // @ts-ignore
109
- "aria-disabled": true
110
- }
111
- }
112
- },
113
- defaultVariants: {
114
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
115
- }
7
+
8
+ const buttonContextKeys = [
9
+ "color",
10
+ "ellipsis",
11
+ "fontFamily",
12
+ "fontSize",
13
+ "fontStyle",
14
+ "fontWeight",
15
+ "letterSpacing",
16
+ "maxFontSizeMultiplier",
17
+ "textAlign"
18
+ ];
19
+ const ButtonContext = createStyledContext({
20
+ color: void 0,
21
+ ellipsis: void 0,
22
+ fontFamily: void 0,
23
+ fontSize: void 0,
24
+ fontStyle: void 0,
25
+ fontWeight: void 0,
26
+ letterSpacing: void 0,
27
+ maxFontSizeMultiplier: void 0,
28
+ textAlign: void 0
29
+ }, { keys: buttonContextKeys });
30
+ const ButtonFrame = styled(View, {
31
+ context: ButtonContext,
32
+ displayName: "ButtonFrame",
33
+ role: "button",
34
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
35
+ tabIndex: 0,
36
+ alignItems: "center",
37
+ flexDirection: "row",
38
+ flexWrap: "nowrap",
39
+ justifyContent: "center",
40
+ variants: { disabled: { true: { pointerEvents: "none" } } }
116
41
  });
117
- const Text = styled(SizableText, {
118
- context,
119
- variants: {
120
- unstyled: {
121
- false: {
122
- userSelect: "none",
123
- // flexGrow 1 leads to inconsistent native style where text pushes to start of view
124
- flexGrow: 0,
125
- flexShrink: 1,
126
- ellipsis: true,
127
- color: "$color",
128
- "$platform-web": {
129
- cursor: "pointer"
130
- }
131
- }
132
- }
133
- },
134
- defaultVariants: {
135
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
136
- }
42
+ const ButtonText = styled(Text, {
43
+ context: ButtonContext,
44
+ displayName: "ButtonText",
45
+ flexGrow: 0,
46
+ flexShrink: 1
137
47
  });
138
- const Icon = props => {
139
- const {
140
- children,
141
- scaleIcon = 1,
142
- size
143
- } = props;
144
- const styledContext = context.useStyledContext();
145
- if (!styledContext) {
146
- throw new Error("Button.Icon must be used within a Button");
147
- }
148
- const sizeToken = size ?? styledContext.size;
149
- const iconColorProp = styledContext.color === "unset" || typeof styledContext.color === "number" ? void 0 : styledContext.color;
150
- const iconColor = useCurrentColor(iconColorProp);
151
- const iconSize = (typeof sizeToken === "number" ? sizeToken * 0.5 : getFontSize(sizeToken)) * scaleIcon;
152
- return getIcon(children, {
153
- size: iconSize,
154
- color: iconColor
155
- });
48
+ const ButtonIcon = ({ children, color, scaleIcon = 1, size }) => {
49
+ const styledContext = ButtonContext.useStyledContext();
50
+ const iconColor = color ?? styledContext?.color;
51
+ const getThemedIcon = useGetThemedIcon({
52
+ color: iconColor === "unset" || typeof iconColor === "number" ? void 0 : iconColor,
53
+ size: size === void 0 ? void 0 : size * scaleIcon
54
+ });
55
+ return getThemedIcon(children);
156
56
  };
157
- const ButtonContext = createStyledContext({
158
- size: void 0,
159
- variant: void 0,
160
- color: void 0
161
- });
162
- const ButtonComponent = Frame.styleable((propsIn, ref) => {
163
- const isNested = useContext(ButtonNestingContext);
164
- const processedProps = useProps(propsIn, {
165
- noNormalize: true,
166
- noExpand: true
167
- });
168
- const {
169
- children,
170
- iconSize,
171
- icon,
172
- iconAfter,
173
- scaleIcon = 1,
174
- noTextWrap,
175
- textProps,
176
- color,
177
- ellipsis,
178
- fontFamily,
179
- fontSize,
180
- fontStyle,
181
- fontWeight,
182
- letterSpacing,
183
- maxFontSizeMultiplier,
184
- textAlign,
185
- ...props
186
- } = processedProps;
187
- const size = propsIn.size || (propsIn.unstyled ? void 0 : "$true");
188
- const styledContext = context.useStyledContext();
189
- const contextColor = color ?? propsIn.color ?? styledContext?.color;
190
- const iconColorProp = contextColor === "unset" || typeof contextColor === "number" ? void 0 : contextColor;
191
- const iconColor = useCurrentColor(iconColorProp);
192
- const finalSize = iconSize ?? size ?? styledContext?.size;
193
- const iconSizeNumber = (typeof finalSize === "number" ? finalSize * 0.5 : getFontSize(finalSize)) * scaleIcon;
194
- const [themedIcon, themedIconAfter] = [icon, iconAfter].map(icon2 => {
195
- if (!icon2) return null;
196
- return getIcon(icon2, {
197
- size: iconSizeNumber,
198
- color: iconColor
199
- // No marginLeft or marginRight needed - spacing is handled by the gap property in Frame's size variants
200
- });
201
- });
202
- const wrappedChildren = wrapChildrenInText(Text, {
203
- children,
204
- color: contextColor,
205
- ellipsis: ellipsis ?? propsIn.ellipsis ?? styledContext?.ellipsis,
206
- fontFamily: fontFamily ?? propsIn.fontFamily ?? styledContext?.fontFamily,
207
- fontSize: fontSize ?? propsIn.fontSize ?? styledContext?.fontSize,
208
- fontStyle: fontStyle ?? propsIn.fontStyle ?? styledContext?.fontStyle,
209
- fontWeight: fontWeight ?? propsIn.fontWeight ?? styledContext?.fontWeight,
210
- letterSpacing: letterSpacing ?? propsIn.letterSpacing ?? styledContext?.letterSpacing,
211
- maxFontSizeMultiplier: maxFontSizeMultiplier ?? propsIn.maxFontSizeMultiplier ?? styledContext?.maxFontSizeMultiplier,
212
- noTextWrap: noTextWrap ?? propsIn.noTextWrap,
213
- textAlign: textAlign ?? propsIn.textAlign ?? styledContext?.textAlign,
214
- textProps: textProps ?? propsIn.textProps
215
- }, {
216
- unstyled: process.env.TAMAGUI_HEADLESS === "1",
217
- size: finalSize ?? styledContext?.size
218
- });
219
- const textContext = {
220
- color: contextColor,
221
- ellipsis: ellipsis ?? propsIn.ellipsis ?? styledContext?.ellipsis,
222
- fontFamily: fontFamily ?? propsIn.fontFamily ?? styledContext?.fontFamily,
223
- fontSize: fontSize ?? propsIn.fontSize ?? styledContext?.fontSize,
224
- fontStyle: fontStyle ?? propsIn.fontStyle ?? styledContext?.fontStyle,
225
- fontWeight: fontWeight ?? propsIn.fontWeight ?? styledContext?.fontWeight,
226
- letterSpacing: letterSpacing ?? propsIn.letterSpacing ?? styledContext?.letterSpacing,
227
- maxFontSizeMultiplier: maxFontSizeMultiplier ?? propsIn.maxFontSizeMultiplier ?? styledContext?.maxFontSizeMultiplier,
228
- textAlign: textAlign ?? propsIn.textAlign ?? styledContext?.textAlign
229
- };
230
- const buttonContext = {
231
- ...styledContext,
232
- ...textContext,
233
- size: props.size ?? propsIn.size ?? styledContext?.size,
234
- variant: props.variant ?? propsIn.variant ?? styledContext?.variant,
235
- elevation: props.elevation ?? propsIn.elevation ?? styledContext?.elevation
236
- };
237
- return /* @__PURE__ */jsx(ButtonNestingContext.Provider, {
238
- value: true,
239
- children: /* @__PURE__ */jsx(context.Provider, {
240
- ...buttonContext,
241
- children: /* @__PURE__ */jsxs(Frame, {
242
- ref,
243
- ...props,
244
- ...(isNested && {
245
- render: "span"
246
- }),
247
- ...(props.circular && !propsIn.size && {
248
- size
249
- }),
250
- tabIndex: 0,
251
- children: [themedIcon, wrappedChildren, themedIconAfter]
252
- })
253
- })
254
- });
57
+ const buttonInternalPropNames = [
58
+ "children",
59
+ "color",
60
+ "disabled",
61
+ "ellipsis",
62
+ "fontFamily",
63
+ "fontSize",
64
+ "fontStyle",
65
+ "fontWeight",
66
+ "icon",
67
+ "iconAfter",
68
+ "iconSize",
69
+ "letterSpacing",
70
+ "maxFontSizeMultiplier",
71
+ "noTextWrap",
72
+ "render",
73
+ "scaleIcon",
74
+ "textAlign",
75
+ "textProps"
76
+ ];
77
+ function useButton(propsIn, { Text: Text2 = ButtonText, iconColor: iconColorOption, iconSize: iconSizeOption, textProps: textPropsOption } = {}) {
78
+ const isNested = useContext(ButtonNestingContext);
79
+ const styledContext = ButtonContext.useStyledContext();
80
+ const processedProps = useProps(propsIn, {
81
+ noNormalize: true,
82
+ noExpand: true
83
+ });
84
+ const { children, color, disabled, ellipsis, fontFamily, fontSize, fontStyle, fontWeight, icon, iconAfter, iconSize, letterSpacing, maxFontSizeMultiplier, noTextWrap, render, scaleIcon = 1, textAlign, textProps } = processedProps;
85
+ const frameProps = { ...propsIn };
86
+ for (const key of buttonInternalPropNames) {
87
+ delete frameProps[key];
88
+ }
89
+ const contextColor = color ?? styledContext?.color;
90
+ const iconColor = iconColorOption ?? contextColor;
91
+ const resolvedIconSize = iconSize ?? iconSizeOption;
92
+ const getThemedIcon = useGetThemedIcon({
93
+ color: iconColor === "unset" || typeof iconColor === "number" ? void 0 : iconColor,
94
+ size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon
95
+ });
96
+ const [themedIcon, themedIconAfter] = [icon, iconAfter].map((item) => {
97
+ return item ? getThemedIcon(item) : null;
98
+ });
99
+ const textContext = {
100
+ color: contextColor,
101
+ ellipsis: ellipsis ?? styledContext?.ellipsis,
102
+ fontFamily: fontFamily ?? styledContext?.fontFamily,
103
+ fontSize: fontSize ?? styledContext?.fontSize,
104
+ fontStyle: fontStyle ?? styledContext?.fontStyle,
105
+ fontWeight: fontWeight ?? styledContext?.fontWeight,
106
+ letterSpacing: letterSpacing ?? styledContext?.letterSpacing,
107
+ maxFontSizeMultiplier: maxFontSizeMultiplier ?? styledContext?.maxFontSizeMultiplier,
108
+ textAlign: textAlign ?? styledContext?.textAlign
109
+ };
110
+ const wrappedChildren = wrapChildrenInText(Text2, {
111
+ children,
112
+ ...textContext,
113
+ noTextWrap,
114
+ textProps
115
+ }, {
116
+ ...textPropsOption,
117
+ ...processedProps.size === void 0 ? null : { size: processedProps.size }
118
+ });
119
+ const resolvedRender = render ?? (isNested ? "span" : processedProps.accessibilityRole === "link" || processedProps.role === "link" ? "a" : disabled ? /* @__PURE__ */ jsx("button", {
120
+ type: "button",
121
+ disabled: true
122
+ }) : void 0);
123
+ const props = {
124
+ ...frameProps,
125
+ ...disabled && {
126
+ "aria-disabled": true,
127
+ disabled: true,
128
+ tabIndex: -1
129
+ },
130
+ ...resolvedRender === void 0 ? null : { render: resolvedRender },
131
+ ...isNested && {
132
+ role: "none",
133
+ tabIndex: -1,
134
+ "aria-disabled": void 0,
135
+ disabled: void 0,
136
+ onPress: void 0,
137
+ onPressIn: void 0,
138
+ onPressOut: void 0,
139
+ onLongPress: void 0,
140
+ onClick: void 0,
141
+ onKeyDown: void 0,
142
+ onKeyUp: void 0
143
+ },
144
+ children: /* @__PURE__ */ jsx(ButtonNestingContext.Provider, {
145
+ value: true,
146
+ children: /* @__PURE__ */ jsxs(ButtonContext.Provider, {
147
+ ...textContext,
148
+ children: [
149
+ themedIcon,
150
+ wrappedChildren,
151
+ themedIconAfter
152
+ ]
153
+ })
154
+ })
155
+ };
156
+ return {
157
+ isNested,
158
+ props
159
+ };
160
+ }
161
+ const ButtonComponent = createStyledHOC(ButtonFrame, function Button(props, ref) {
162
+ const { props: buttonProps } = useButton(props);
163
+ return /* @__PURE__ */ jsx(ButtonFrame, {
164
+ ref,
165
+ ...buttonProps
166
+ });
255
167
  });
256
- const Button = withStaticProperties(ButtonComponent, {
257
- Apply: context.Provider,
258
- Frame,
259
- Text,
260
- Icon
168
+ const Button2 = withStaticProperties(ButtonComponent, {
169
+ Apply: ButtonContext.Provider,
170
+ Frame: ButtonFrame,
171
+ Icon: ButtonIcon,
172
+ Text: ButtonText
261
173
  });
262
- export { Button, ButtonContext };
174
+
175
+ export { Button2 as Button, ButtonContext, ButtonFrame, ButtonIcon, ButtonText, useButton };
263
176
  //# sourceMappingURL=Button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["getFontSize","getButtonSized","getIcon","useCurrentColor","ButtonNestingContext","getElevation","themeableVariants","SizableText","wrapChildrenInText","createStyledContext","getTokenValue","styled","useProps","View","withStaticProperties","useContext","jsx","jsxs","context","size","variant","color","elevation","ellipsis","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","maxFontSizeMultiplier","textAlign","Frame","name","role","render","type","tabIndex","variants","unstyled","true","outlineWidth","borderWidth","backgroundColor","false","justifyContent","alignItems","flexWrap","flexDirection","borderColor","cursor","hoverStyle","pressStyle","focusVisibleStyle","outlineColor","outlineStyle","outlined","process","env","TAMAGUI_HEADLESS","circular","chromeless","...size","val","extras","buttonStyle","gap",":number","disabled","pointerEvents","defaultVariants","Text","userSelect","flexGrow","flexShrink","Icon","props","children","scaleIcon","styledContext","useStyledContext","Error","sizeToken","iconColorProp","iconColor","iconSize","ButtonContext","ButtonComponent","styleable","propsIn","ref","isNested","processedProps","noNormalize","noExpand","icon","iconAfter","noTextWrap","textProps","contextColor","finalSize","iconSizeNumber","themedIcon","themedIconAfter","map","wrappedChildren","textContext","buttonContext","Provider","value","Button","Apply"],"sources":["../../src/Button.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,WAAA,QAAmB;AAC5B,SAASC,cAAA,QAAsB;AAC/B,SAASC,OAAA,EAASC,eAAA,QAAuB;AACzC,SAASC,oBAAA,EAAsBC,YAAA,EAAcC,iBAAA,QAAyB;AAEtE,SAASC,WAAA,EAAaC,kBAAA,QAA0B;AAEhD,SACEC,mBAAA,EACAC,aAAA,EACAC,MAAA,EACAC,QAAA,EACAC,IAAA,EACAC,oBAAA,QACK;AAEP,SAASC,UAAA,QAAkB;AA6BjB,SAAAC,GAAA,EAqSFC,IAAA,QArSE;AAnBV,MAAMC,OAAA,GAAUT,mBAAA,CAAyC;EACvDU,IAAA,EAAM;EACNC,OAAA,EAAS;EACTC,KAAA,EAAO;EACPC,SAAA,EAAW;EACXC,QAAA,EAAU;EACVC,UAAA,EAAY;EACZC,QAAA,EAAU;EACVC,SAAA,EAAW;EACXC,UAAA,EAAY;EACZC,aAAA,EAAe;EACfC,qBAAA,EAAuB;EACvBC,SAAA,EAAW;AACb,CAAC;AAED,MAAMC,KAAA,GAAQpB,MAAA,CAAOE,IAAA,EAAM;EACzBK,OAAA;EACAc,IAAA,EAAM;EACNC,IAAA,EAAM;EACNC,MAAA,EAAQ,eAAAlB,GAAA,CAAC;IAAOmB,IAAA,EAAK;EAAA,CAAS;EAC9BC,QAAA,EAAU;EAEVC,QAAA,EAAU;IACRC,QAAA,EAAU;MACRC,IAAA,EAAM;QAAA;QAEJC,YAAA,EAAc;QACdC,WAAA,EAAa;QACbC,eAAA,EAAiB;MACnB;MACAC,KAAA,EAAO;QACLxB,IAAA,EAAM;QACNyB,cAAA,EAAgB;QAChBC,UAAA,EAAY;QACZC,QAAA,EAAU;QACVC,aAAA,EAAe;QACfL,eAAA,EAAiB;QACjBD,WAAA,EAAa;QACbO,WAAA,EAAa;QAEb,iBAAiB;UACfC,MAAA,EAAQ;QACV;QAEAC,UAAA,EAAY;UACVR,eAAA,EA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AAIyC,KAAA,CAAMhB,QAAA,IAAY,CAAC6B,OAAA,CAAQrE,IAAA,IAAQ;UAAEA;QAAK;QAC/CiB,QAAA,EAAU;QAETwC,QAAA,GAAAyB,UAAA,EACAG,eAAA,EACAF,eAAA;MAAA,CACH;IAAA,CACF;EAAA,CACF;AAEJ,CAAC;AAEM,MAAMO,MAAA,GAAS/F,oBAAA,CAAqBwE,eAAA,EAAiB;EAC1DwB,KAAA,EAAO5F,OAAA,CAAQyF,QAAA;EACf5E,KAAA;EACAuC,IAAA;EACAI;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Button.js","names":[],"sources":["esm/Button.js"],"sourcesContent":["import { useGetThemedIcon } from \"@tamagui/helpers-tamagui\";\nimport { ButtonNestingContext } from \"@tamagui/stacks\";\nimport { wrapChildrenInText } from \"@tamagui/text\";\nimport {\n createStyledContext,\n createStyledHOC,\n styled,\n Text,\n useProps,\n View,\n withStaticProperties\n} from \"@tamagui/web\";\nimport { useContext } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst buttonContextKeys = [\n \"color\",\n \"ellipsis\",\n \"fontFamily\",\n \"fontSize\",\n \"fontStyle\",\n \"fontWeight\",\n \"letterSpacing\",\n \"maxFontSizeMultiplier\",\n \"textAlign\"\n];\nconst ButtonContext = createStyledContext(\n {\n color: void 0,\n ellipsis: void 0,\n fontFamily: void 0,\n fontSize: void 0,\n fontStyle: void 0,\n fontWeight: void 0,\n letterSpacing: void 0,\n maxFontSizeMultiplier: void 0,\n textAlign: void 0\n },\n {\n keys: buttonContextKeys\n }\n);\nconst ButtonFrame = styled(View, {\n context: ButtonContext,\n displayName: \"ButtonFrame\",\n role: \"button\",\n render: /* @__PURE__ */ jsx(\"button\", { type: \"button\" }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nconst ButtonText = styled(Text, {\n context: ButtonContext,\n displayName: \"ButtonText\",\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nconst ButtonIcon = ({ children, color, scaleIcon = 1, size }) => {\n const styledContext = ButtonContext.useStyledContext();\n const iconColor = color ?? styledContext?.color;\n const getThemedIcon = useGetThemedIcon({\n color: iconColor === \"unset\" || typeof iconColor === \"number\" ? void 0 : iconColor,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nconst buttonInternalPropNames = [\n \"children\",\n \"color\",\n \"disabled\",\n \"ellipsis\",\n \"fontFamily\",\n \"fontSize\",\n \"fontStyle\",\n \"fontWeight\",\n \"icon\",\n \"iconAfter\",\n \"iconSize\",\n \"letterSpacing\",\n \"maxFontSizeMultiplier\",\n \"noTextWrap\",\n \"render\",\n \"scaleIcon\",\n \"textAlign\",\n \"textProps\"\n];\nfunction useButton(propsIn, {\n Text: Text2 = ButtonText,\n iconColor: iconColorOption,\n iconSize: iconSizeOption,\n textProps: textPropsOption\n} = {}) {\n const isNested = useContext(ButtonNestingContext);\n const styledContext = ButtonContext.useStyledContext();\n const processedProps = useProps(propsIn, {\n noNormalize: true,\n noExpand: true\n });\n const {\n children,\n color,\n disabled,\n ellipsis,\n fontFamily,\n fontSize,\n fontStyle,\n fontWeight,\n icon,\n iconAfter,\n iconSize,\n letterSpacing,\n maxFontSizeMultiplier,\n noTextWrap,\n render,\n scaleIcon = 1,\n textAlign,\n textProps\n } = processedProps;\n const frameProps = { ...propsIn };\n for (const key of buttonInternalPropNames) {\n delete frameProps[key];\n }\n const contextColor = color ?? styledContext?.color;\n const iconColor = iconColorOption ?? contextColor;\n const resolvedIconSize = iconSize ?? iconSizeOption;\n const getThemedIcon = useGetThemedIcon({\n color: iconColor === \"unset\" || typeof iconColor === \"number\" ? void 0 : iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map((item) => {\n return item ? getThemedIcon(item) : null;\n });\n const textContext = {\n color: contextColor,\n ellipsis: ellipsis ?? styledContext?.ellipsis,\n fontFamily: fontFamily ?? styledContext?.fontFamily,\n fontSize: fontSize ?? styledContext?.fontSize,\n fontStyle: fontStyle ?? styledContext?.fontStyle,\n fontWeight: fontWeight ?? styledContext?.fontWeight,\n letterSpacing: letterSpacing ?? styledContext?.letterSpacing,\n maxFontSizeMultiplier: maxFontSizeMultiplier ?? styledContext?.maxFontSizeMultiplier,\n textAlign: textAlign ?? styledContext?.textAlign\n };\n const wrappedChildren = wrapChildrenInText(\n Text2,\n {\n children,\n ...textContext,\n noTextWrap,\n textProps\n },\n {\n ...textPropsOption,\n ...processedProps.size === void 0 ? null : { size: processedProps.size }\n }\n );\n const resolvedRender = render ?? (isNested ? \"span\" : processedProps.accessibilityRole === \"link\" || processedProps.role === \"link\" ? \"a\" : disabled ? /* @__PURE__ */ jsx(\"button\", { type: \"button\", disabled: true }) : void 0);\n const props = {\n ...frameProps,\n ...disabled && {\n \"aria-disabled\": true,\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : { render: resolvedRender },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ jsx(ButtonNestingContext.Provider, { value: true, children: /* @__PURE__ */ jsxs(ButtonContext.Provider, { ...textContext, children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ] }) })\n };\n return {\n isNested,\n props\n };\n}\nconst ButtonComponent = createStyledHOC(\n ButtonFrame,\n function Button(props, ref) {\n const { props: buttonProps } = useButton(props);\n return /* @__PURE__ */ jsx(ButtonFrame, { ref, ...buttonProps });\n }\n);\nconst Button2 = withStaticProperties(ButtonComponent, {\n Apply: ButtonContext.Provider,\n Frame: ButtonFrame,\n Icon: ButtonIcon,\n Text: ButtonText\n});\nexport {\n Button2 as Button,\n ButtonContext,\n ButtonFrame,\n ButtonIcon,\n ButtonText,\n useButton\n};\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;;;;;;AAcA,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,gBAAgB,oBACpB;CACE,OAAO,KAAK;CACZ,UAAU,KAAK;CACf,YAAY,KAAK;CACjB,UAAU,KAAK;CACf,WAAW,KAAK;CAChB,YAAY,KAAK;CACjB,eAAe,KAAK;CACpB,uBAAuB,KAAK;CAC5B,WAAW,KAAK;AAClB,GACA,EACE,MAAM,kBACR,CACF;AACA,MAAM,cAAc,OAAO,MAAM;CAC/B,SAAS;CACT,aAAa;CACb,MAAM;CACN,QAAwB,oBAAI,UAAU,EAAE,MAAM,SAAS,CAAC;CACxD,UAAU;CACV,YAAY;CACZ,eAAe;CACf,UAAU;CACV,gBAAgB;CAChB,UAAU,EACR,UAAU,EACR,MAAM,EACJ,eAAe,OACjB,EACF,EACF;AACF,CAAC;AACD,MAAM,aAAa,OAAO,MAAM;CAC9B,SAAS;CACT,aAAa;CAEb,UAAU;CACV,YAAY;AACd,CAAC;AACD,MAAM,cAAc,EAAE,UAAU,OAAO,YAAY,GAAG,WAAW;CAC/D,MAAM,gBAAgB,cAAc,iBAAiB;CACrD,MAAM,YAAY,SAAS,eAAe;CAC1C,MAAM,gBAAgB,iBAAiB;EACrC,OAAO,cAAc,WAAW,OAAO,cAAc,WAAW,KAAK,IAAI;EACzE,MAAM,SAAS,KAAK,IAAI,KAAK,IAAI,OAAO;CAC1C,CAAC;CACD,OAAO,cAAc,QAAQ;AAC/B;AACA,MAAM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