@tamagui/button 2.0.0-rc.4 → 2.0.0-rc.40
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/cjs/Button.cjs +195 -186
- package/dist/cjs/Button.native.js +195 -188
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/cjs/Button.test.cjs +33 -5
- package/dist/cjs/Button.test.native.js +34 -6
- package/dist/cjs/Button.test.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/v1/Button.cjs +215 -212
- package/dist/cjs/v1/Button.native.js +217 -215
- package/dist/cjs/v1/Button.native.js.map +1 -1
- package/dist/cjs/v1/Button.test.cjs +5 -5
- package/dist/cjs/v1/Button.test.native.js +6 -6
- package/dist/cjs/v1/Button.test.native.js.map +1 -1
- package/dist/cjs/v1/index.cjs +7 -5
- package/dist/cjs/v1/index.native.js +7 -5
- package/dist/cjs/v1/index.native.js.map +1 -1
- package/dist/esm/Button.mjs +175 -168
- package/dist/esm/Button.mjs.map +1 -1
- package/dist/esm/Button.native.js +175 -170
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Button.test.mjs +30 -2
- package/dist/esm/Button.test.mjs.map +1 -1
- package/dist/esm/Button.test.native.js +30 -2
- package/dist/esm/Button.test.native.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/v1/Button.mjs +193 -192
- package/dist/esm/v1/Button.mjs.map +1 -1
- package/dist/esm/v1/Button.native.js +194 -194
- package/dist/esm/v1/Button.native.js.map +1 -1
- package/dist/esm/v1/Button.test.mjs +2 -2
- package/dist/esm/v1/Button.test.mjs.map +1 -1
- package/dist/esm/v1/Button.test.native.js +2 -2
- package/dist/esm/v1/Button.test.native.js.map +1 -1
- package/dist/jsx/Button.mjs +175 -168
- package/dist/jsx/Button.mjs.map +1 -1
- package/dist/jsx/Button.native.js +195 -188
- package/dist/jsx/Button.native.js.map +1 -1
- package/dist/jsx/Button.test.mjs +30 -2
- package/dist/jsx/Button.test.mjs.map +1 -1
- package/dist/jsx/Button.test.native.js +34 -6
- package/dist/jsx/Button.test.native.js.map +1 -1
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +1 -6
- package/dist/jsx/index.native.js +7 -5
- package/dist/jsx/v1/Button.mjs +193 -192
- package/dist/jsx/v1/Button.mjs.map +1 -1
- package/dist/jsx/v1/Button.native.js +217 -215
- package/dist/jsx/v1/Button.native.js.map +1 -1
- package/dist/jsx/v1/Button.test.mjs +2 -2
- package/dist/jsx/v1/Button.test.mjs.map +1 -1
- package/dist/jsx/v1/Button.test.native.js +6 -6
- package/dist/jsx/v1/Button.test.native.js.map +1 -1
- package/dist/jsx/v1/index.native.js +7 -5
- package/package.json +15 -18
- package/src/Button.test.tsx +24 -0
- package/src/Button.tsx +16 -3
- package/types/Button.d.ts +9 -0
- package/types/Button.d.ts.map +1 -1
- package/dist/cjs/Button.js +0 -176
- package/dist/cjs/Button.js.map +0 -6
- package/dist/cjs/Button.test.js +0 -8
- package/dist/cjs/Button.test.js.map +0 -6
- package/dist/cjs/index.js +0 -15
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/v1/Button.js +0 -208
- package/dist/cjs/v1/Button.js.map +0 -6
- package/dist/cjs/v1/Button.test.js +0 -8
- package/dist/cjs/v1/Button.test.js.map +0 -6
- package/dist/cjs/v1/index.js +0 -15
- package/dist/cjs/v1/index.js.map +0 -6
- package/dist/esm/Button.js +0 -174
- package/dist/esm/Button.js.map +0 -6
- package/dist/esm/Button.test.js +0 -10
- package/dist/esm/Button.test.js.map +0 -6
- package/dist/esm/v1/Button.js +0 -201
- package/dist/esm/v1/Button.js.map +0 -6
- package/dist/esm/v1/Button.test.js +0 -10
- package/dist/esm/v1/Button.test.js.map +0 -6
- package/dist/esm/v1/index.js +0 -2
- package/dist/esm/v1/index.js.map +0 -6
- package/dist/jsx/Button.js +0 -174
- package/dist/jsx/Button.js.map +0 -6
- package/dist/jsx/Button.test.js +0 -10
- package/dist/jsx/Button.test.js.map +0 -6
- package/dist/jsx/v1/Button.js +0 -201
- package/dist/jsx/v1/Button.js.map +0 -6
- package/dist/jsx/v1/Button.test.js +0 -10
- package/dist/jsx/v1/Button.test.js.map +0 -6
- package/dist/jsx/v1/index.js +0 -2
- package/dist/jsx/v1/index.js.map +0 -6
package/dist/cjs/v1/Button.cjs
CHANGED
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var Button_exports = {};
|
|
22
24
|
__export(Button_exports, {
|
|
@@ -28,140 +30,141 @@ __export(Button_exports, {
|
|
|
28
30
|
useButton: () => useButton
|
|
29
31
|
});
|
|
30
32
|
module.exports = __toCommonJS(Button_exports);
|
|
31
|
-
var import_font_size = require("@tamagui/font-size")
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
var import_font_size = require("@tamagui/font-size");
|
|
34
|
+
var import_get_button_sized = require("@tamagui/get-button-sized");
|
|
35
|
+
var import_helpers = require("@tamagui/helpers");
|
|
36
|
+
var import_helpers_tamagui = require("@tamagui/helpers-tamagui");
|
|
37
|
+
var import_stacks = require("@tamagui/stacks");
|
|
38
|
+
var import_text = require("@tamagui/text");
|
|
39
|
+
var import_web = require("@tamagui/web");
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_spacer = require("@tamagui/spacer");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
43
|
const ButtonContext = (0, import_web.createStyledContext)({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
44
|
+
// keeping these here means they work with styled() passing down color to text
|
|
45
|
+
color: void 0,
|
|
46
|
+
ellipsis: void 0,
|
|
47
|
+
fontFamily: void 0,
|
|
48
|
+
fontSize: void 0,
|
|
49
|
+
fontStyle: void 0,
|
|
50
|
+
fontWeight: void 0,
|
|
51
|
+
letterSpacing: void 0,
|
|
52
|
+
maxFontSizeMultiplier: void 0,
|
|
53
|
+
size: void 0,
|
|
54
|
+
textAlign: void 0,
|
|
55
|
+
variant: void 0
|
|
56
|
+
});
|
|
57
|
+
const BUTTON_NAME = "Button";
|
|
58
|
+
const ButtonFrame = (0, import_web.styled)(import_stacks.ThemeableStack, {
|
|
59
|
+
name: BUTTON_NAME,
|
|
60
|
+
render: "button",
|
|
61
|
+
context: ButtonContext,
|
|
62
|
+
role: "button",
|
|
63
|
+
focusable: true,
|
|
64
|
+
variants: {
|
|
65
|
+
unstyled: {
|
|
66
|
+
false: {
|
|
67
|
+
size: "$true",
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
flexWrap: "nowrap",
|
|
71
|
+
flexDirection: "row",
|
|
72
|
+
cursor: "pointer",
|
|
73
|
+
hoverTheme: true,
|
|
74
|
+
pressTheme: true,
|
|
75
|
+
backgroundColor: "$background",
|
|
76
|
+
borderWidth: 1,
|
|
77
|
+
borderColor: "transparent",
|
|
78
|
+
focusVisibleStyle: {
|
|
79
|
+
outlineColor: "$outlineColor",
|
|
80
|
+
outlineStyle: "solid",
|
|
81
|
+
outlineWidth: 2
|
|
81
82
|
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
variant: {
|
|
86
|
+
outlined: {
|
|
87
|
+
backgroundColor: "transparent",
|
|
88
|
+
borderWidth: 2,
|
|
89
|
+
borderColor: "$borderColor",
|
|
90
|
+
hoverStyle: {
|
|
85
91
|
backgroundColor: "transparent",
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
focusVisibleStyle: {
|
|
97
|
-
backgroundColor: "transparent",
|
|
98
|
-
borderColor: "$borderColorFocus"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
size: {
|
|
103
|
-
"...size": import_get_button_sized.getButtonSized,
|
|
104
|
-
":number": import_get_button_sized.getButtonSized
|
|
105
|
-
},
|
|
106
|
-
disabled: {
|
|
107
|
-
true: {
|
|
108
|
-
pointerEvents: "none"
|
|
92
|
+
borderColor: "$borderColorHover"
|
|
93
|
+
},
|
|
94
|
+
pressStyle: {
|
|
95
|
+
backgroundColor: "transparent",
|
|
96
|
+
borderColor: "$borderColorPress"
|
|
97
|
+
},
|
|
98
|
+
focusVisibleStyle: {
|
|
99
|
+
backgroundColor: "transparent",
|
|
100
|
+
borderColor: "$borderColorFocus"
|
|
109
101
|
}
|
|
110
102
|
}
|
|
111
103
|
},
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
size: {
|
|
105
|
+
"...size": import_get_button_sized.getButtonSized,
|
|
106
|
+
":number": import_get_button_sized.getButtonSized
|
|
107
|
+
},
|
|
108
|
+
disabled: {
|
|
109
|
+
true: {
|
|
110
|
+
pointerEvents: "none"
|
|
111
|
+
}
|
|
114
112
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
113
|
+
},
|
|
114
|
+
defaultVariants: {
|
|
115
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const ButtonText = (0, import_web.styled)(import_text.SizableText, {
|
|
119
|
+
name: "Button",
|
|
120
|
+
context: ButtonContext,
|
|
121
|
+
variants: {
|
|
122
|
+
unstyled: {
|
|
123
|
+
false: {
|
|
124
|
+
userSelect: "none",
|
|
125
|
+
cursor: "pointer",
|
|
126
|
+
// flexGrow 1 leads to inconsistent native style where text pushes to start of view
|
|
127
|
+
flexGrow: 0,
|
|
128
|
+
flexShrink: 1,
|
|
129
|
+
ellipsis: true,
|
|
130
|
+
color: "$color"
|
|
130
131
|
}
|
|
131
|
-
},
|
|
132
|
-
defaultVariants: {
|
|
133
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
134
132
|
}
|
|
135
|
-
}),
|
|
136
|
-
ButtonIcon = props => {
|
|
137
|
-
const {
|
|
138
|
-
children,
|
|
139
|
-
scaleIcon = 1
|
|
140
|
-
} = props,
|
|
141
|
-
{
|
|
142
|
-
size,
|
|
143
|
-
color
|
|
144
|
-
} = (0, import_react.useContext)(ButtonContext),
|
|
145
|
-
iconSize = (typeof size == "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size)) * scaleIcon;
|
|
146
|
-
return (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
147
|
-
size: iconSize,
|
|
148
|
-
color
|
|
149
|
-
})(children);
|
|
150
133
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
134
|
+
defaultVariants: {
|
|
135
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
const ButtonIcon = props => {
|
|
139
|
+
const {
|
|
140
|
+
children,
|
|
141
|
+
scaleIcon = 1
|
|
142
|
+
} = props;
|
|
143
|
+
const {
|
|
144
|
+
size,
|
|
145
|
+
color
|
|
146
|
+
} = (0, import_react.useContext)(ButtonContext);
|
|
147
|
+
const iconSize = (typeof size === "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size)) * scaleIcon;
|
|
148
|
+
const getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
149
|
+
size: iconSize,
|
|
150
|
+
color
|
|
164
151
|
});
|
|
152
|
+
return getThemedIcon(children);
|
|
153
|
+
};
|
|
154
|
+
const ButtonComponent = ButtonFrame.styleable(function Button(props, ref) {
|
|
155
|
+
const {
|
|
156
|
+
props: buttonProps
|
|
157
|
+
} = useButton(props);
|
|
158
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(ButtonFrame, {
|
|
159
|
+
"data-disable-theme": true,
|
|
160
|
+
...buttonProps,
|
|
161
|
+
ref
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
const Button2 = (0, import_helpers.withStaticProperties)(ButtonComponent, {
|
|
165
|
+
Text: ButtonText,
|
|
166
|
+
Icon: ButtonIcon
|
|
167
|
+
});
|
|
165
168
|
function useButton({
|
|
166
169
|
textProps,
|
|
167
170
|
...propsIn
|
|
@@ -170,87 +173,87 @@ function useButton({
|
|
|
170
173
|
} = {
|
|
171
174
|
Text: Button2.Text
|
|
172
175
|
}) {
|
|
173
|
-
const isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
176
|
+
const isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext);
|
|
177
|
+
const propsActive = (0, import_web.useProps)(propsIn, {
|
|
178
|
+
noNormalize: true,
|
|
179
|
+
noExpand: true
|
|
180
|
+
});
|
|
181
|
+
const {
|
|
182
|
+
icon,
|
|
183
|
+
iconAfter,
|
|
184
|
+
gap,
|
|
185
|
+
spaceFlex,
|
|
186
|
+
scaleIcon = 1,
|
|
187
|
+
scaleSpace = 0.66,
|
|
188
|
+
noTextWrap,
|
|
189
|
+
fontFamily,
|
|
190
|
+
fontSize,
|
|
191
|
+
fontWeight,
|
|
192
|
+
fontStyle,
|
|
193
|
+
letterSpacing,
|
|
194
|
+
render,
|
|
195
|
+
ellipsis,
|
|
196
|
+
maxFontSizeMultiplier,
|
|
197
|
+
...restProps
|
|
198
|
+
} = propsActive;
|
|
199
|
+
const size = propsActive.size || (propsActive.unstyled ? void 0 : "$true");
|
|
200
|
+
const color = propsActive.color;
|
|
201
|
+
const iconSize = (typeof size === "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size, {
|
|
202
|
+
font: fontFamily?.[0] === "$" ? fontFamily : void 0
|
|
203
|
+
})) * scaleIcon;
|
|
204
|
+
const getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
205
|
+
size: iconSize,
|
|
206
|
+
color
|
|
207
|
+
});
|
|
208
|
+
const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
|
|
209
|
+
const spaceSize = gap ?? (0, import_web.getVariableValue)(iconSize) * scaleSpace;
|
|
210
|
+
const contents = noTextWrap ? [propsIn.children] : (0, import_text.wrapChildrenInText)(Text, {
|
|
211
|
+
children: propsIn.children,
|
|
212
|
+
fontFamily,
|
|
213
|
+
fontSize,
|
|
214
|
+
textProps,
|
|
215
|
+
fontWeight,
|
|
216
|
+
fontStyle,
|
|
217
|
+
letterSpacing,
|
|
218
|
+
ellipsis,
|
|
219
|
+
maxFontSizeMultiplier
|
|
220
|
+
}, Text === ButtonText && propsActive.unstyled !== true ? {
|
|
221
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1",
|
|
222
|
+
size
|
|
223
|
+
} : void 0);
|
|
224
|
+
const inner = (0, import_spacer.spacedChildren)({
|
|
225
|
+
// a bit arbitrary but scaling to font size is necessary so long as button does
|
|
226
|
+
space: spaceSize,
|
|
227
|
+
spaceFlex,
|
|
228
|
+
ensureKeys: true,
|
|
229
|
+
direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
|
|
230
|
+
// for keys to stay the same we keep indices as similar a possible
|
|
231
|
+
// so even if icons are undefined we still pass them
|
|
232
|
+
children: [themedIcon, ...contents, themedIconAfter]
|
|
233
|
+
});
|
|
234
|
+
const props = {
|
|
235
|
+
size,
|
|
236
|
+
...(propsIn.disabled && {
|
|
237
|
+
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
238
|
+
focusable: void 0,
|
|
239
|
+
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
240
|
+
focusVisibleStyle: {
|
|
241
|
+
borderColor: "$background"
|
|
242
|
+
}
|
|
204
243
|
}),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
letterSpacing,
|
|
215
|
-
ellipsis,
|
|
216
|
-
maxFontSizeMultiplier
|
|
217
|
-
}, Text === ButtonText && propsActive.unstyled !== !0 ? {
|
|
218
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1",
|
|
219
|
-
size
|
|
220
|
-
} : void 0),
|
|
221
|
-
inner = (0, import_spacer.spacedChildren)({
|
|
222
|
-
// a bit arbitrary but scaling to font size is necessary so long as button does
|
|
223
|
-
space: spaceSize,
|
|
224
|
-
spaceFlex,
|
|
225
|
-
ensureKeys: !0,
|
|
226
|
-
direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
|
|
227
|
-
// for keys to stay the same we keep indices as similar a possible
|
|
228
|
-
// so even if icons are undefined we still pass them
|
|
229
|
-
children: [themedIcon, ...contents, themedIconAfter]
|
|
244
|
+
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
245
|
+
render: render ?? (isNested ? "span" :
|
|
246
|
+
// defaults to <a /> when accessibilityRole = link
|
|
247
|
+
// see https://github.com/tamagui/tamagui/issues/505
|
|
248
|
+
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"),
|
|
249
|
+
...restProps,
|
|
250
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, {
|
|
251
|
+
value: true,
|
|
252
|
+
children: inner
|
|
230
253
|
}),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
235
|
-
focusable: void 0,
|
|
236
|
-
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
237
|
-
focusVisibleStyle: {
|
|
238
|
-
borderColor: "$background"
|
|
239
|
-
}
|
|
240
|
-
}),
|
|
241
|
-
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
242
|
-
render: render ?? (isNested ? "span" :
|
|
243
|
-
// defaults to <a /> when accessibilityRole = link
|
|
244
|
-
// see https://github.com/tamagui/tamagui/issues/505
|
|
245
|
-
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"),
|
|
246
|
-
...restProps,
|
|
247
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, {
|
|
248
|
-
value: !0,
|
|
249
|
-
children: inner
|
|
250
|
-
}),
|
|
251
|
-
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
252
|
-
disableClassName: !0
|
|
253
|
-
};
|
|
254
|
+
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
255
|
+
disableClassName: true
|
|
256
|
+
};
|
|
254
257
|
return {
|
|
255
258
|
spaceSize,
|
|
256
259
|
isNested,
|