@tamagui/button 2.0.0-rc.26 → 2.0.0-rc.26-1773452370596

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/button",
3
- "version": "2.0.0-rc.26",
3
+ "version": "2.0.0-rc.26-1773452370596",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -37,19 +37,19 @@
37
37
  "clean:build": "tamagui-build clean:build"
38
38
  },
39
39
  "dependencies": {
40
- "@tamagui/config-default": "2.0.0-rc.26",
41
- "@tamagui/core": "2.0.0-rc.26",
42
- "@tamagui/font-size": "2.0.0-rc.26",
43
- "@tamagui/get-button-sized": "2.0.0-rc.26",
44
- "@tamagui/helpers": "2.0.0-rc.26",
45
- "@tamagui/helpers-tamagui": "2.0.0-rc.26",
46
- "@tamagui/spacer": "2.0.0-rc.26",
47
- "@tamagui/stacks": "2.0.0-rc.26",
48
- "@tamagui/text": "2.0.0-rc.26",
49
- "@tamagui/web": "2.0.0-rc.26"
40
+ "@tamagui/config-default": "2.0.0-rc.26-1773452370596",
41
+ "@tamagui/core": "2.0.0-rc.26-1773452370596",
42
+ "@tamagui/font-size": "2.0.0-rc.26-1773452370596",
43
+ "@tamagui/get-button-sized": "2.0.0-rc.26-1773452370596",
44
+ "@tamagui/helpers": "2.0.0-rc.26-1773452370596",
45
+ "@tamagui/helpers-tamagui": "2.0.0-rc.26-1773452370596",
46
+ "@tamagui/spacer": "2.0.0-rc.26-1773452370596",
47
+ "@tamagui/stacks": "2.0.0-rc.26-1773452370596",
48
+ "@tamagui/text": "2.0.0-rc.26-1773452370596",
49
+ "@tamagui/web": "2.0.0-rc.26-1773452370596"
50
50
  },
51
51
  "devDependencies": {
52
- "@tamagui/build": "2.0.0-rc.26",
52
+ "@tamagui/build": "2.0.0-rc.26-1773452370596",
53
53
  "react": ">=19",
54
54
  "vitest": "4.0.4"
55
55
  },
@@ -1,176 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var Button_exports = {};
16
- __export(Button_exports, {
17
- Button: () => Button,
18
- ButtonContext: () => ButtonContext
19
- });
20
- module.exports = __toCommonJS(Button_exports);
21
- var import_font_size = require("@tamagui/font-size"), import_get_button_sized = require("@tamagui/get-button-sized"), import_helpers_tamagui = require("@tamagui/helpers-tamagui"), import_stacks = require("@tamagui/stacks"), import_text = require("@tamagui/text"), import_web = require("@tamagui/web"), import_react = require("react"), import_jsx_runtime = require("react/jsx-runtime");
22
- const context = (0, import_web.createStyledContext)({
23
- size: void 0,
24
- variant: void 0,
25
- color: void 0,
26
- elevation: void 0
27
- }), Frame = (0, import_web.styled)(import_web.View, {
28
- context,
29
- name: "Button",
30
- role: "button",
31
- render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button" }),
32
- tabIndex: 0,
33
- variants: {
34
- unstyled: {
35
- false: {
36
- size: "$true",
37
- justifyContent: "center",
38
- alignItems: "center",
39
- flexWrap: "nowrap",
40
- flexDirection: "row",
41
- cursor: "pointer",
42
- backgroundColor: "$background",
43
- borderWidth: 1,
44
- borderColor: "transparent",
45
- hoverStyle: {
46
- backgroundColor: "$backgroundHover",
47
- borderColor: "$borderColorHover"
48
- },
49
- pressStyle: {
50
- backgroundColor: "$backgroundPress",
51
- borderColor: "$borderColorHover"
52
- },
53
- focusVisibleStyle: {
54
- outlineColor: "$outlineColor",
55
- outlineStyle: "solid",
56
- outlineWidth: 2
57
- }
58
- }
59
- },
60
- variant: {
61
- outlined: process.env.TAMAGUI_HEADLESS === "1" ? {} : {
62
- backgroundColor: "transparent",
63
- borderWidth: 1,
64
- borderColor: "$borderColor",
65
- hoverStyle: {
66
- backgroundColor: "transparent",
67
- borderColor: "$borderColorHover"
68
- },
69
- pressStyle: {
70
- backgroundColor: "transparent",
71
- borderColor: "$borderColorPress"
72
- }
73
- }
74
- },
75
- circular: import_stacks.themeableVariants.circular,
76
- chromeless: import_stacks.themeableVariants.chromeless,
77
- size: {
78
- "...size": (val, extras) => {
79
- const buttonStyle = (0, import_get_button_sized.getButtonSized)(val, extras), gap = (0, import_web.getTokenValue)(val);
80
- return {
81
- ...buttonStyle,
82
- gap
83
- };
84
- },
85
- ":number": (val, extras) => {
86
- const buttonStyle = (0, import_get_button_sized.getButtonSized)(val, extras), gap = val * 0.4;
87
- return {
88
- ...buttonStyle,
89
- gap
90
- };
91
- }
92
- },
93
- elevation: {
94
- "...size": import_stacks.getElevation,
95
- ":number": import_stacks.getElevation
96
- },
97
- disabled: {
98
- true: {
99
- pointerEvents: "none",
100
- // @ts-ignore
101
- "aria-disabled": !0
102
- }
103
- }
104
- },
105
- defaultVariants: {
106
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
107
- }
108
- }), Text = (0, import_web.styled)(import_text.SizableText, {
109
- context,
110
- variants: {
111
- unstyled: {
112
- false: {
113
- userSelect: "none",
114
- cursor: "pointer",
115
- // flexGrow 1 leads to inconsistent native style where text pushes to start of view
116
- flexGrow: 0,
117
- flexShrink: 1,
118
- ellipsis: !0,
119
- color: "$color"
120
- }
121
- }
122
- },
123
- defaultVariants: {
124
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
125
- }
126
- }), Icon = (props) => {
127
- const { children, scaleIcon = 1, size } = props, styledContext = context.useStyledContext();
128
- if (!styledContext)
129
- throw new Error("Button.Icon must be used within a Button");
130
- const sizeToken = size ?? styledContext.size, iconColor = (0, import_helpers_tamagui.useCurrentColor)(styledContext.color), iconSize = (typeof sizeToken == "number" ? sizeToken * 0.5 : (0, import_font_size.getFontSize)(sizeToken)) * scaleIcon;
131
- return (0, import_helpers_tamagui.getIcon)(children, {
132
- size: iconSize,
133
- color: iconColor
134
- });
135
- }, ButtonContext = (0, import_web.createStyledContext)({
136
- size: void 0,
137
- variant: void 0,
138
- color: void 0
139
- }), ButtonComponent = Frame.styleable((propsIn, ref) => {
140
- const isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext), processedProps = (0, import_web.useProps)(propsIn, {
141
- noNormalize: !0,
142
- noExpand: !0
143
- }), { children, iconSize, icon, iconAfter, scaleIcon = 1, ...props } = processedProps, size = propsIn.size || (propsIn.unstyled ? void 0 : "$true"), styledContext = context.useStyledContext(), iconColor = (0, import_helpers_tamagui.useCurrentColor)(styledContext?.color), finalSize = iconSize ?? size ?? styledContext?.size, iconSizeNumber = (typeof finalSize == "number" ? finalSize * 0.5 : (0, import_font_size.getFontSize)(finalSize)) * scaleIcon, [themedIcon, themedIconAfter] = [icon, iconAfter].map((icon2) => icon2 ? (0, import_helpers_tamagui.getIcon)(icon2, {
144
- size: iconSizeNumber,
145
- color: iconColor
146
- // No marginLeft or marginRight needed - spacing is handled by the gap property in Frame's size variants
147
- }) : null), wrappedChildren = (0, import_text.wrapChildrenInText)(
148
- Text,
149
- { children },
150
- {
151
- unstyled: process.env.TAMAGUI_HEADLESS === "1",
152
- size: finalSize ?? styledContext?.size
153
- }
154
- );
155
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, { value: !0, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
156
- Frame,
157
- {
158
- ref,
159
- ...props,
160
- ...isNested && { render: "span" },
161
- ...props.circular && !propsIn.size && { size },
162
- tabIndex: 0,
163
- children: [
164
- themedIcon,
165
- wrappedChildren,
166
- themedIconAfter
167
- ]
168
- }
169
- ) });
170
- }), Button = (0, import_web.withStaticProperties)(ButtonComponent, {
171
- Apply: context.Provider,
172
- Frame,
173
- Text,
174
- Icon
175
- });
176
- //# sourceMappingURL=Button.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Button.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA4B,+BAC5B,0BAA+B,sCAC/B,yBAAyC,qCACzC,gBAAsE,4BACtE,cAAgD,0BAEhD,aAOO,yBAEP,eAA2B,kBAoBjB;AAhBV,MAAM,cAAU,gCAKb;AAAA,EACD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AACb,CAAC,GAEK,YAAQ,mBAAO,iBAAM;AAAA,EACzB;AAAA,EACA,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ,4CAAC,YAAO,MAAK,UAAS;AAAA,EAC9B,UAAU;AAAA,EAEV,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,MAAM;AAAA,QACN,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,aAAa;AAAA,QAEb,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,QACf;AAAA,QAEA,YAAY;AAAA,UACV,iBAAiB;AAAA,UACjB,aAAa;AAAA,QACf;AAAA,QAEA,mBAAmB;AAAA,UACjB,cAAc;AAAA,UACd,cAAc;AAAA,UACd,cAAc;AAAA,QAChB;AAAA,MACF;AAAA,IACF;AAAA,IAEA,SAAS;AAAA,MACP,UACE,QAAQ,IAAI,qBAAqB,MAC7B,C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AA;AAAA,MACC;AAAA,MACC,GAAG;AAAA,MACH,GAAI,YAAY,EAAE,QAAQ,OAAO;AAAA,MAEjC,GAAI,MAAM,YAAY,CAAC,QAAQ,QAAQ,EAAE,KAAK;AAAA,MAC/C,UAAU;AAAA,MAET;AAAA;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA,EACH,GACF;AAEJ,CAAC,GAEY,aAAS,iCAAqB,iBAAiB;AAAA,EAC1D,OAAO,QAAQ;AAAA,EACf;AAAA,EACA;AAAA,EACA;AACF,CAAC;",
5
- "names": ["icon"]
6
- }
@@ -1,24 +0,0 @@
1
- var import_config_default = require("@tamagui/config-default"), import_core = require("@tamagui/core"), import_vitest = require("vitest"), import_Button = require("./Button"), import_jsx_runtime = require("react/jsx-runtime");
2
- const conf = (0, import_core.createTamagui)((0, import_config_default.getDefaultTamaguiConfig)());
3
- (0, import_vitest.describe)("Button", () => {
4
- (0, import_vitest.test)("123", () => {
5
- (0, import_vitest.expect)(!0).toBeTruthy();
6
- }), (0, import_vitest.test)("accepts native button html props", () => {
7
- const _submitBtn = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "submit", children: "Submit" }), _resetBtn = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "reset", children: "Reset" }), _buttonBtn = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", children: "Button" }), _formBtn = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
8
- import_Button.Button,
9
- {
10
- type: "submit",
11
- form: "myForm",
12
- formAction: "/submit",
13
- formMethod: "post",
14
- formTarget: "_blank",
15
- formNoValidate: !0,
16
- name: "submitBtn",
17
- value: "submit",
18
- children: "Submit"
19
- }
20
- );
21
- (0, import_vitest.expect)(!0).toBeTruthy();
22
- });
23
- });
24
- //# sourceMappingURL=Button.test.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Button.test.tsx"],
4
- "mappings": "AAAA,4BAAwC,oCACxC,cAA8B,0BAC9B,gBAAuC,mBACvC,gBAAuB,qBAYA;AAVvB,MAAM,WAAO,+BAAc,+CAAwB,CAAC;AAAA,IAEpD,wBAAS,UAAU,MAAM;AACvB,0BAAK,OAAO,MAAM;AAChB,8BAAO,EAAI,EAAE,WAAW;AAAA,EAC1B,CAAC,OAGD,oBAAK,oCAAoC,MAAM;AAE7C,UAAM,aAAa,4CAAC,wBAAO,MAAK,UAAS,oBAAM,GACzC,YAAY,4CAAC,wBAAO,MAAK,SAAQ,mBAAK,GACtC,aAAa,4CAAC,wBAAO,MAAK,UAAS,oBAAM,GACzC,WACJ;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,YAAW;AAAA,QACX,YAAW;AAAA,QACX,YAAW;AAAA,QACX,gBAAc;AAAA,QACd,MAAK;AAAA,QACL,OAAM;AAAA,QACP;AAAA;AAAA,IAED;AAEF,8BAAO,EAAI,EAAE,WAAW;AAAA,EAC1B,CAAC;AAWH,CAAC;",
5
- "names": []
6
- }
@@ -1,208 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var Button_exports = {};
16
- __export(Button_exports, {
17
- Button: () => Button2,
18
- ButtonContext: () => ButtonContext,
19
- ButtonFrame: () => ButtonFrame,
20
- ButtonIcon: () => ButtonIcon,
21
- ButtonText: () => ButtonText,
22
- useButton: () => useButton
23
- });
24
- module.exports = __toCommonJS(Button_exports);
25
- var import_font_size = require("@tamagui/font-size"), import_get_button_sized = require("@tamagui/get-button-sized"), import_helpers = require("@tamagui/helpers"), import_helpers_tamagui = require("@tamagui/helpers-tamagui"), import_stacks = require("@tamagui/stacks"), import_text = require("@tamagui/text"), import_web = require("@tamagui/web"), import_react = require("react"), import_spacer = require("@tamagui/spacer"), import_jsx_runtime = require("react/jsx-runtime");
26
- const ButtonContext = (0, import_web.createStyledContext)({
27
- // keeping these here means they work with styled() passing down color to text
28
- color: void 0,
29
- ellipsis: void 0,
30
- fontFamily: void 0,
31
- fontSize: void 0,
32
- fontStyle: void 0,
33
- fontWeight: void 0,
34
- letterSpacing: void 0,
35
- maxFontSizeMultiplier: void 0,
36
- size: void 0,
37
- textAlign: void 0,
38
- variant: void 0
39
- }), BUTTON_NAME = "Button", ButtonFrame = (0, import_web.styled)(import_stacks.ThemeableStack, {
40
- name: BUTTON_NAME,
41
- render: "button",
42
- context: ButtonContext,
43
- role: "button",
44
- focusable: !0,
45
- variants: {
46
- unstyled: {
47
- false: {
48
- size: "$true",
49
- justifyContent: "center",
50
- alignItems: "center",
51
- flexWrap: "nowrap",
52
- flexDirection: "row",
53
- cursor: "pointer",
54
- hoverTheme: !0,
55
- pressTheme: !0,
56
- backgroundColor: "$background",
57
- borderWidth: 1,
58
- borderColor: "transparent",
59
- focusVisibleStyle: {
60
- outlineColor: "$outlineColor",
61
- outlineStyle: "solid",
62
- outlineWidth: 2
63
- }
64
- }
65
- },
66
- variant: {
67
- outlined: {
68
- backgroundColor: "transparent",
69
- borderWidth: 2,
70
- borderColor: "$borderColor",
71
- hoverStyle: {
72
- backgroundColor: "transparent",
73
- borderColor: "$borderColorHover"
74
- },
75
- pressStyle: {
76
- backgroundColor: "transparent",
77
- borderColor: "$borderColorPress"
78
- },
79
- focusVisibleStyle: {
80
- backgroundColor: "transparent",
81
- borderColor: "$borderColorFocus"
82
- }
83
- }
84
- },
85
- size: {
86
- "...size": import_get_button_sized.getButtonSized,
87
- ":number": import_get_button_sized.getButtonSized
88
- },
89
- disabled: {
90
- true: {
91
- pointerEvents: "none"
92
- }
93
- }
94
- },
95
- defaultVariants: {
96
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
97
- }
98
- }), ButtonText = (0, import_web.styled)(import_text.SizableText, {
99
- name: "Button",
100
- context: ButtonContext,
101
- variants: {
102
- unstyled: {
103
- false: {
104
- userSelect: "none",
105
- cursor: "pointer",
106
- // flexGrow 1 leads to inconsistent native style where text pushes to start of view
107
- flexGrow: 0,
108
- flexShrink: 1,
109
- ellipsis: !0,
110
- color: "$color"
111
- }
112
- }
113
- },
114
- defaultVariants: {
115
- unstyled: process.env.TAMAGUI_HEADLESS === "1"
116
- }
117
- }), ButtonIcon = (props) => {
118
- const { children, scaleIcon = 1 } = props, { size, color } = (0, import_react.useContext)(ButtonContext), iconSize = (typeof size == "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size)) * scaleIcon;
119
- return (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color })(children);
120
- }, ButtonComponent = ButtonFrame.styleable(
121
- function(props, ref) {
122
- const { props: buttonProps } = useButton(props);
123
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonFrame, { "data-disable-theme": !0, ...buttonProps, ref });
124
- }
125
- ), Button2 = (0, import_helpers.withStaticProperties)(ButtonComponent, {
126
- Text: ButtonText,
127
- Icon: ButtonIcon
128
- });
129
- function useButton({ textProps, ...propsIn }, { Text = Button2.Text } = { Text: Button2.Text }) {
130
- const isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext), propsActive = (0, import_web.useProps)(propsIn, {
131
- noNormalize: !0,
132
- noExpand: !0
133
- }), {
134
- icon,
135
- iconAfter,
136
- gap,
137
- spaceFlex,
138
- scaleIcon = 1,
139
- scaleSpace = 0.66,
140
- noTextWrap,
141
- fontFamily,
142
- fontSize,
143
- fontWeight,
144
- fontStyle,
145
- letterSpacing,
146
- render,
147
- ellipsis,
148
- maxFontSizeMultiplier,
149
- ...restProps
150
- } = propsActive, size = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size == "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size, {
151
- font: fontFamily?.[0] === "$" ? fontFamily : void 0
152
- })) * scaleIcon, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
153
- size: iconSize,
154
- color
155
- }), [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon), spaceSize = gap ?? (0, import_web.getVariableValue)(iconSize) * scaleSpace, contents = noTextWrap ? [propsIn.children] : (0, import_text.wrapChildrenInText)(
156
- Text,
157
- {
158
- children: propsIn.children,
159
- fontFamily,
160
- fontSize,
161
- textProps,
162
- fontWeight,
163
- fontStyle,
164
- letterSpacing,
165
- ellipsis,
166
- maxFontSizeMultiplier
167
- },
168
- Text === ButtonText && propsActive.unstyled !== !0 ? {
169
- unstyled: process.env.TAMAGUI_HEADLESS === "1",
170
- size
171
- } : void 0
172
- ), inner = (0, import_spacer.spacedChildren)({
173
- // a bit arbitrary but scaling to font size is necessary so long as button does
174
- space: spaceSize,
175
- spaceFlex,
176
- ensureKeys: !0,
177
- direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
178
- // for keys to stay the same we keep indices as similar a possible
179
- // so even if icons are undefined we still pass them
180
- children: [themedIcon, ...contents, themedIconAfter]
181
- }), props = {
182
- size,
183
- ...propsIn.disabled && {
184
- // in rnw - false still has keyboard tabIndex, undefined = not actually focusable
185
- focusable: void 0,
186
- // even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
187
- focusVisibleStyle: {
188
- borderColor: "$background"
189
- }
190
- },
191
- // fixes SSR issue + DOM nesting issue of not allowing button in button
192
- render: render ?? (isNested ? "span" : (
193
- // defaults to <a /> when accessibilityRole = link
194
- // see https://github.com/tamagui/tamagui/issues/505
195
- propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"
196
- )),
197
- ...restProps,
198
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, { value: !0, children: inner }),
199
- // forces it to be a runtime pressStyle so it passes through context text colors
200
- disableClassName: !0
201
- };
202
- return {
203
- spaceSize,
204
- isNested,
205
- props
206
- };
207
- }
208
- //# sourceMappingURL=Button.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/v1/Button.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA4B,+BAC5B,0BAA+B,sCAC/B,iBAAqC,6BACrC,yBAAiC,qCACjC,gBAAqD,4BAErD,cAAgD,0BAEhD,aAAwE,yBAExE,eAA2B,kBAC3B,gBAA+B,4BAiLpB;AA7KJ,MAAM,oBAAgB,gCAO3B;AAAA;AAAA,EAEA,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,uBAAuB;AAAA,EACvB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AACX,CAAC,GAyCK,cAAc,UAEd,kBAAc,mBAAO,8BAAgB;AAAA,EACzC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,WAAW;AAAA,EAEX,UAAU;AAAA,IACR,UAAU;AAAA,MACR,OAAO;AAAA,QACL,MAAM;AAAA,QACN,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,iBAAiB;AAAA,QACjB,aAAa;AAAA,QAC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;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,SAAS,cAAc,YAAY,aAAa,KAC5C;AAAA,MACE,UAAU,QAAQ,IAAI,qBAAqB;AAAA,MAC3C;AAAA,IACF,IACA;AAAA,EACN,GAEE,YAAQ,8BAAe;AAAA;AAAA,IAE3B,OAAO;AAAA,IACP;AAAA,IACA,YAAY;AAAA,IACZ,WACE,YAAY,kBAAkB,YAC9B,YAAY,kBAAkB,mBAC1B,aACA;AAAA;AAAA;AAAA,IAGN,UAAU,CAAC,YAAY,GAAG,UAAU,eAAe;AAAA,EACrD,CAAC,GAEK,QAAQ;AAAA,IACZ;AAAA,IACA,GAAI,QAAQ,YAAY;AAAA;AAAA,MAEtB,WAAW;AAAA;AAAA,MAEX,mBAAmB;AAAA,QACjB,aAAa;AAAA,MACf;AAAA,IACF;AAAA;AAAA,IAEA,QACE,WACC,WACG;AAAA;AAAA;AAAA,MAGA,YAAY,sBAAsB,UAAU,YAAY,SAAS,SAC/D,MACA;AAAA;AAAA,IAER,GAAG;AAAA,IAEH,UACE,4CAAC,mCAAqB,UAArB,EAA8B,OAAO,IAAO,iBAAM;AAAA;AAAA,IAGrD,kBAAkB;AAAA,EACpB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
5
- "names": ["Button"]
6
- }
@@ -1,8 +0,0 @@
1
- var import_config_default = require("@tamagui/config-default"), import_core = require("@tamagui/core"), import_vitest = require("vitest");
2
- const conf = (0, import_core.createTamagui)((0, import_config_default.getDefaultTamaguiConfig)());
3
- (0, import_vitest.describe)("Button", () => {
4
- (0, import_vitest.test)("123", () => {
5
- (0, import_vitest.expect)(!0).toBeTruthy();
6
- });
7
- });
8
- //# sourceMappingURL=Button.test.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/v1/Button.test.tsx"],
4
- "mappings": "AAAA,4BAAwC,oCACxC,cAA8B,0BAC9B,gBAAuC;AAEvC,MAAM,WAAO,+BAAc,+CAAwB,CAAC;AAAA,IAEpD,wBAAS,UAAU,MAAM;AACvB,0BAAK,OAAO,MAAM;AAChB,8BAAO,EAAI,EAAE,WAAW;AAAA,EAC1B,CAAC;AAWH,CAAC;",
5
- "names": []
6
- }
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var v1_exports = {};
13
- module.exports = __toCommonJS(v1_exports);
14
- __reExport(v1_exports, require("./Button"), module.exports);
15
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/v1/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,uBAAc,qBAAd;",
5
- "names": []
6
- }