@tamagui/button 1.110.5 → 1.111.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.
- package/dist/cjs/Button.native.js +28 -151
- package/dist/cjs/Button.native.js.map +2 -2
- package/dist/cjs/Button.test.native.js.map +1 -1
- package/dist/esm/Button.native.js +28 -150
- package/dist/esm/Button.native.js.map +2 -2
- package/dist/esm/Button.native.mjs +240 -0
- package/dist/esm/Button.native.mjs.map +1 -0
- package/dist/esm/Button.test.native.js.map +1 -1
- package/dist/esm/Button.test.native.mjs +10 -0
- package/dist/esm/Button.test.native.mjs.map +1 -0
- package/dist/esm/index.native.mjs +2 -0
- package/dist/esm/index.native.mjs.map +1 -0
- package/dist/jsx/Button.native.js +27 -149
- package/dist/jsx/Button.native.js.map +2 -2
- package/dist/jsx/Button.test.native.js.map +1 -1
- package/package.json +9 -9
|
@@ -24,112 +24,7 @@ __export(Button_exports, {
|
|
|
24
24
|
useButton: () => useButton
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(Button_exports);
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime"), 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")
|
|
28
|
-
function _array_like_to_array(arr, len) {
|
|
29
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
30
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
31
|
-
return arr2;
|
|
32
|
-
}
|
|
33
|
-
function _array_with_holes(arr) {
|
|
34
|
-
if (Array.isArray(arr)) return arr;
|
|
35
|
-
}
|
|
36
|
-
function _array_without_holes(arr) {
|
|
37
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
38
|
-
}
|
|
39
|
-
function _define_property(obj, key, value) {
|
|
40
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
41
|
-
value,
|
|
42
|
-
enumerable: !0,
|
|
43
|
-
configurable: !0,
|
|
44
|
-
writable: !0
|
|
45
|
-
}) : obj[key] = value, obj;
|
|
46
|
-
}
|
|
47
|
-
function _iterable_to_array(iter) {
|
|
48
|
-
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
49
|
-
}
|
|
50
|
-
function _iterable_to_array_limit(arr, i) {
|
|
51
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
52
|
-
if (_i != null) {
|
|
53
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
54
|
-
try {
|
|
55
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
56
|
-
;
|
|
57
|
-
} catch (err) {
|
|
58
|
-
_d = !0, _e = err;
|
|
59
|
-
} finally {
|
|
60
|
-
try {
|
|
61
|
-
!_n && _i.return != null && _i.return();
|
|
62
|
-
} finally {
|
|
63
|
-
if (_d) throw _e;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return _arr;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function _non_iterable_rest() {
|
|
70
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
71
|
-
}
|
|
72
|
-
function _non_iterable_spread() {
|
|
73
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
74
|
-
}
|
|
75
|
-
function _object_spread(target) {
|
|
76
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
77
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
78
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
79
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
80
|
-
}))), ownKeys2.forEach(function(key) {
|
|
81
|
-
_define_property(target, key, source[key]);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return target;
|
|
85
|
-
}
|
|
86
|
-
function ownKeys(object, enumerableOnly) {
|
|
87
|
-
var keys = Object.keys(object);
|
|
88
|
-
if (Object.getOwnPropertySymbols) {
|
|
89
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
90
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
91
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
92
|
-
})), keys.push.apply(keys, symbols);
|
|
93
|
-
}
|
|
94
|
-
return keys;
|
|
95
|
-
}
|
|
96
|
-
function _object_spread_props(target, source) {
|
|
97
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
98
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
99
|
-
}), target;
|
|
100
|
-
}
|
|
101
|
-
function _object_without_properties(source, excluded) {
|
|
102
|
-
if (source == null) return {};
|
|
103
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
104
|
-
if (Object.getOwnPropertySymbols) {
|
|
105
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
106
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
107
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
108
|
-
}
|
|
109
|
-
return target;
|
|
110
|
-
}
|
|
111
|
-
function _object_without_properties_loose(source, excluded) {
|
|
112
|
-
if (source == null) return {};
|
|
113
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
114
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
115
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
116
|
-
return target;
|
|
117
|
-
}
|
|
118
|
-
function _sliced_to_array(arr, i) {
|
|
119
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
120
|
-
}
|
|
121
|
-
function _to_consumable_array(arr) {
|
|
122
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
123
|
-
}
|
|
124
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
125
|
-
if (o) {
|
|
126
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
127
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
128
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
129
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
var ButtonContext = (0, import_web.createStyledContext)({
|
|
27
|
+
var import_jsx_runtime = require("react/jsx-runtime"), 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"), ButtonContext = (0, import_web.createStyledContext)({
|
|
133
28
|
// keeping these here means they work with styled() passing down color to text
|
|
134
29
|
color: void 0,
|
|
135
30
|
ellipse: void 0,
|
|
@@ -221,16 +116,17 @@ var ButtonContext = (0, import_web.createStyledContext)({
|
|
|
221
116
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
222
117
|
}
|
|
223
118
|
}), ButtonIcon = function(props) {
|
|
224
|
-
var
|
|
119
|
+
var { 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, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
225
120
|
size: iconSize,
|
|
226
121
|
color
|
|
227
122
|
});
|
|
228
123
|
return getThemedIcon(children);
|
|
229
124
|
}, ButtonComponent = ButtonFrame.styleable(function(props, ref) {
|
|
230
|
-
var
|
|
231
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonFrame,
|
|
125
|
+
var { props: buttonProps } = useButton(props);
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonFrame, {
|
|
127
|
+
...buttonProps,
|
|
232
128
|
ref
|
|
233
|
-
})
|
|
129
|
+
});
|
|
234
130
|
}), buttonStaticConfig = {
|
|
235
131
|
inlineProps: /* @__PURE__ */ new Set([
|
|
236
132
|
// text props go here (can't really optimize them, but we never fully extract button anyway)
|
|
@@ -248,40 +144,21 @@ var ButtonContext = (0, import_web.createStyledContext)({
|
|
|
248
144
|
Text: ButtonText,
|
|
249
145
|
Icon: ButtonIcon
|
|
250
146
|
});
|
|
251
|
-
function useButton(
|
|
252
|
-
var
|
|
147
|
+
function useButton(param) {
|
|
148
|
+
var { textProps, ...propsIn } = param, { Text = Button2.Text } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
253
149
|
Text: Button2.Text
|
|
254
|
-
},
|
|
255
|
-
"textProps"
|
|
256
|
-
]), _param_Text = _$_param.Text, Text = _param_Text === void 0 ? Button2.Text : _param_Text, isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext), propsActive = (0, import_web.useProps)(propsIn, {
|
|
150
|
+
}, isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext), propsActive = (0, import_web.useProps)(propsIn, {
|
|
257
151
|
noNormalize: !0,
|
|
258
152
|
noExpand: !0
|
|
259
|
-
}),
|
|
260
|
-
"icon",
|
|
261
|
-
"iconAfter",
|
|
262
|
-
"space",
|
|
263
|
-
"spaceFlex",
|
|
264
|
-
"scaleIcon",
|
|
265
|
-
"scaleSpace",
|
|
266
|
-
"separator",
|
|
267
|
-
"noTextWrap",
|
|
268
|
-
"fontFamily",
|
|
269
|
-
"fontSize",
|
|
270
|
-
"fontWeight",
|
|
271
|
-
"fontStyle",
|
|
272
|
-
"letterSpacing",
|
|
273
|
-
"tag",
|
|
274
|
-
"ellipse",
|
|
275
|
-
"maxFontSizeMultiplier"
|
|
276
|
-
]), size = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size == "number" ? size * 0.5 : (0, import_font_size.getFontSize)(size, {
|
|
153
|
+
}), { icon, iconAfter, space, spaceFlex, scaleIcon = 1, scaleSpace = 0.66, separator, noTextWrap, fontFamily, fontSize, fontWeight, fontStyle, letterSpacing, tag, ellipse, maxFontSizeMultiplier, ...restProps } = 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, {
|
|
277
154
|
font: (fontFamily == null ? void 0 : fontFamily[0]) === "$" ? fontFamily : void 0
|
|
278
155
|
})) * scaleIcon, getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({
|
|
279
156
|
size: iconSize,
|
|
280
157
|
color
|
|
281
|
-
}),
|
|
158
|
+
}), [themedIcon, themedIconAfter] = [
|
|
282
159
|
icon,
|
|
283
160
|
iconAfter
|
|
284
|
-
].map(getThemedIcon),
|
|
161
|
+
].map(getThemedIcon), spaceSize = space ?? (0, import_web.getVariableValue)(iconSize) * scaleSpace, contents = noTextWrap ? [
|
|
285
162
|
propsIn.children
|
|
286
163
|
] : (0, import_text.wrapChildrenInText)(Text, {
|
|
287
164
|
children: propsIn.children,
|
|
@@ -306,34 +183,34 @@ function useButton(_param) {
|
|
|
306
183
|
// for keys to stay the same we keep indices as similar a possible
|
|
307
184
|
// so even if icons are undefined we still pass them
|
|
308
185
|
children: [
|
|
309
|
-
themedIcon
|
|
310
|
-
|
|
186
|
+
themedIcon,
|
|
187
|
+
...contents,
|
|
311
188
|
themedIconAfter
|
|
312
|
-
]
|
|
313
|
-
}), props =
|
|
314
|
-
size
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
189
|
+
]
|
|
190
|
+
}), props = {
|
|
191
|
+
size,
|
|
192
|
+
...propsIn.disabled && {
|
|
193
|
+
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
194
|
+
focusable: void 0,
|
|
195
|
+
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
196
|
+
focusVisibleStyle: {
|
|
197
|
+
borderColor: "$background"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
323
200
|
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
324
201
|
tag: tag ?? (isNested ? "span" : (
|
|
325
202
|
// defaults to <a /> when accessibilityRole = link
|
|
326
203
|
// see https://github.com/tamagui/tamagui/issues/505
|
|
327
204
|
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"
|
|
328
|
-
))
|
|
329
|
-
|
|
205
|
+
)),
|
|
206
|
+
...restProps,
|
|
330
207
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stacks.ButtonNestingContext.Provider, {
|
|
331
208
|
value: !0,
|
|
332
209
|
children: inner
|
|
333
210
|
}),
|
|
334
211
|
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
335
212
|
disableClassName: !0
|
|
336
|
-
}
|
|
213
|
+
};
|
|
337
214
|
return {
|
|
338
215
|
spaceSize,
|
|
339
216
|
isNested,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/button/src/Button.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,mBAA4B,+BAC5B,0BAA+B,sCAC/B,iBAAqC,6BACrC,yBAAiC,qCACjC,gBAAqD,4BAErD,cAAgD,0BAEhD,aAMO,yBAEP,eAA2B
|
|
5
|
-
"names": ["ButtonContext", "createStyledContext", "color", "undefined", "ellipse", "fontFamily", "fontSize", "fontStyle", "fontWeight", "letterSpacing", "maxFontSizeMultiplier", "size", "textAlign", "variant", "BUTTON_NAME", "ButtonFrame", "styled", "ThemeableStack", "name", "tag", "context", "role", "focusable", "variants", "unstyled", "false", "justifyContent", "alignItems", "flexWrap", "flexDirection", "cursor", "hoverTheme", "pressTheme", "backgrounded", "borderWidth", "borderColor", "focusVisibleStyle", "outlineColor", "outlineStyle", "outlineWidth", "outlined", "backgroundColor", "hoverStyle", "pressStyle", "getButtonSized", "disabled", "true", "pointerEvents", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "ButtonText", "SizableText", "userSelect", "flexGrow", "flexShrink", "ButtonIcon", "props", "children", "scaleIcon", "useContext", "iconSize", "getFontSize", "getThemedIcon", "useGetThemedIcon", "ButtonComponent", "styleable", "ref", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,mBAA4B,+BAC5B,0BAA+B,sCAC/B,iBAAqC,6BACrC,yBAAiC,qCACjC,gBAAqD,4BAErD,cAAgD,0BAEhD,aAMO,yBAEP,eAA2B,kBAIdA,oBAAgBC,gCAO3B;;EAEAC,OAAOC;EACPC,SAASD;EACTE,YAAYF;EACZG,UAAUH;EACVI,WAAWJ;EACXK,YAAYL;EACZM,eAAeN;EACfO,uBAAuBP;EACvBQ,MAAMR;EACNS,WAAWT;EACXU,SAASV;AACX,CAAA,GAyCMW,cAAc,UAEdC,kBAAcC,mBAAOC,8BAAgB;EACzCC,MAAMJ;EACNK,KAAK;EACLC,SAAS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rB;UACT2C,gCACEzB,MACA;IACElB,UAAUqB,QAAQrB;IAClBtD;IACAC;IACAyE;IACAvE;IACAD;IACAE;IACAL;IACAM;EACF,GACAmE,SAASzB,cAAc+B,YAAY3D,aAAa,KAC5C;IACEA,UAAUyB,QAAQC,IAAIC,qBAAqB;IAC3CxC;EACF,IACAR,MAAAA,GAGJoG,YAAQC,2BAAe;;IAE3Bf,OAAOU;IACPT;IACAe,YAAY;IACZb;IACAc,WACEvB,YAAYtD,kBAAkB,YAC9BsD,YAAYtD,kBAAkB,mBAC1B,aACA;;;IAGN8B,UAAU;MAACqC;SAAeK;MAAUJ;;EACtC,CAAA,GAEMvC,QAAQ;IACZ/C;IACA,GAAIqE,QAAQnC,YAAY;;MAEtBvB,WAAWnB;;MAEXiC,mBAAmB;QACjBD,aAAa;MACf;IACF;;IAEAhB,KACEA,QACC8D,WACG;;;MAGAE,YAAYwB,sBAAsB,UAAUxB,YAAY9D,SAAS,SAC/D,MACA;;IAER,GAAGyE;IAEHnC,UACE,uCAAAY,KAACW,mCAAqB0B,UAAQ;MAACC,OAAO;gBAAON;;;IAG/CO,kBAAkB;EACpB;AAEA,SAAO;IACLX;IACAlB;IACAvB;EACF;AACF;",
|
|
5
|
+
"names": ["ButtonContext", "createStyledContext", "color", "undefined", "ellipse", "fontFamily", "fontSize", "fontStyle", "fontWeight", "letterSpacing", "maxFontSizeMultiplier", "size", "textAlign", "variant", "BUTTON_NAME", "ButtonFrame", "styled", "ThemeableStack", "name", "tag", "context", "role", "focusable", "variants", "unstyled", "false", "justifyContent", "alignItems", "flexWrap", "flexDirection", "cursor", "hoverTheme", "pressTheme", "backgrounded", "borderWidth", "borderColor", "focusVisibleStyle", "outlineColor", "outlineStyle", "outlineWidth", "outlined", "backgroundColor", "hoverStyle", "pressStyle", "getButtonSized", "disabled", "true", "pointerEvents", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "ButtonText", "SizableText", "userSelect", "flexGrow", "flexShrink", "ButtonIcon", "props", "children", "scaleIcon", "useContext", "iconSize", "getFontSize", "getThemedIcon", "useGetThemedIcon", "ButtonComponent", "styleable", "ref", "buttonProps", "useButton", "_jsx", "buttonStaticConfig", "inlineProps", "Set", "Button", "withStaticProperties", "Text", "Icon", "textProps", "propsIn", "isNested", "ButtonNestingContext", "propsActive", "useProps", "noNormalize", "noExpand", "icon", "iconAfter", "space", "spaceFlex", "scaleSpace", "separator", "noTextWrap", "restProps", "font", "themedIcon", "themedIconAfter", "map", "spaceSize", "getVariableValue", "contents", "wrapChildrenInText", "inner", "spacedChildren", "ensureKeys", "direction", "accessibilityRole", "Provider", "value", "disableClassName"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/button/src/Button.test.tsx"],
|
|
4
|
-
"mappings": ";AAAA,4BAAwC,oCACxC,cAA8B,0BAC9B,gBAAuC,mBAEjCA,WAAOC,+BAAcC,+CAAAA,CAAAA;IAE3BC,wBAAS,UAAU,WAAA;AACjBC,
|
|
4
|
+
"mappings": ";AAAA,4BAAwC,oCACxC,cAA8B,0BAC9B,gBAAuC,mBAEjCA,WAAOC,+BAAcC,+CAAAA,CAAAA;IAE3BC,wBAAS,UAAU,WAAA;AACjBC,0BAAK,OAAO,WAAA;AACVC,8BAAO,EAAA,EAAMC,WAAU;EACzB,CAAA;AAWF,CAAA;",
|
|
5
5
|
"names": ["conf", "createTamagui", "getDefaultTamaguiConfig", "describe", "test", "expect", "toBeTruthy"]
|
|
6
6
|
}
|
|
@@ -7,110 +7,6 @@ import { ButtonNestingContext, ThemeableStack } from "@tamagui/stacks";
|
|
|
7
7
|
import { SizableText, wrapChildrenInText } from "@tamagui/text";
|
|
8
8
|
import { createStyledContext, getVariableValue, spacedChildren, styled, useProps } from "@tamagui/web";
|
|
9
9
|
import { useContext } from "react";
|
|
10
|
-
function _array_like_to_array(arr, len) {
|
|
11
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
12
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
13
|
-
return arr2;
|
|
14
|
-
}
|
|
15
|
-
function _array_with_holes(arr) {
|
|
16
|
-
if (Array.isArray(arr)) return arr;
|
|
17
|
-
}
|
|
18
|
-
function _array_without_holes(arr) {
|
|
19
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
20
|
-
}
|
|
21
|
-
function _define_property(obj, key, value) {
|
|
22
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
23
|
-
value,
|
|
24
|
-
enumerable: !0,
|
|
25
|
-
configurable: !0,
|
|
26
|
-
writable: !0
|
|
27
|
-
}) : obj[key] = value, obj;
|
|
28
|
-
}
|
|
29
|
-
function _iterable_to_array(iter) {
|
|
30
|
-
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
31
|
-
}
|
|
32
|
-
function _iterable_to_array_limit(arr, i) {
|
|
33
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
34
|
-
if (_i != null) {
|
|
35
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
36
|
-
try {
|
|
37
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
38
|
-
;
|
|
39
|
-
} catch (err) {
|
|
40
|
-
_d = !0, _e = err;
|
|
41
|
-
} finally {
|
|
42
|
-
try {
|
|
43
|
-
!_n && _i.return != null && _i.return();
|
|
44
|
-
} finally {
|
|
45
|
-
if (_d) throw _e;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return _arr;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function _non_iterable_rest() {
|
|
52
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
53
|
-
}
|
|
54
|
-
function _non_iterable_spread() {
|
|
55
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
56
|
-
}
|
|
57
|
-
function _object_spread(target) {
|
|
58
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
59
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
60
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
61
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
62
|
-
}))), ownKeys2.forEach(function(key) {
|
|
63
|
-
_define_property(target, key, source[key]);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return target;
|
|
67
|
-
}
|
|
68
|
-
function ownKeys(object, enumerableOnly) {
|
|
69
|
-
var keys = Object.keys(object);
|
|
70
|
-
if (Object.getOwnPropertySymbols) {
|
|
71
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
72
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
73
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
74
|
-
})), keys.push.apply(keys, symbols);
|
|
75
|
-
}
|
|
76
|
-
return keys;
|
|
77
|
-
}
|
|
78
|
-
function _object_spread_props(target, source) {
|
|
79
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
80
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
81
|
-
}), target;
|
|
82
|
-
}
|
|
83
|
-
function _object_without_properties(source, excluded) {
|
|
84
|
-
if (source == null) return {};
|
|
85
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
86
|
-
if (Object.getOwnPropertySymbols) {
|
|
87
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
88
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
89
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
90
|
-
}
|
|
91
|
-
return target;
|
|
92
|
-
}
|
|
93
|
-
function _object_without_properties_loose(source, excluded) {
|
|
94
|
-
if (source == null) return {};
|
|
95
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
96
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
97
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
98
|
-
return target;
|
|
99
|
-
}
|
|
100
|
-
function _sliced_to_array(arr, i) {
|
|
101
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
102
|
-
}
|
|
103
|
-
function _to_consumable_array(arr) {
|
|
104
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
105
|
-
}
|
|
106
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
107
|
-
if (o) {
|
|
108
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
109
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
110
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
111
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
10
|
var ButtonContext = createStyledContext({
|
|
115
11
|
// keeping these here means they work with styled() passing down color to text
|
|
116
12
|
color: void 0,
|
|
@@ -203,16 +99,17 @@ var ButtonContext = createStyledContext({
|
|
|
203
99
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
204
100
|
}
|
|
205
101
|
}), ButtonIcon = function(props) {
|
|
206
|
-
var
|
|
102
|
+
var { children, scaleIcon = 1 } = props, { size, color } = useContext(ButtonContext), iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size)) * scaleIcon, getThemedIcon = useGetThemedIcon({
|
|
207
103
|
size: iconSize,
|
|
208
104
|
color
|
|
209
105
|
});
|
|
210
106
|
return getThemedIcon(children);
|
|
211
107
|
}, ButtonComponent = ButtonFrame.styleable(function(props, ref) {
|
|
212
|
-
var
|
|
213
|
-
return /* @__PURE__ */ _jsx(ButtonFrame,
|
|
108
|
+
var { props: buttonProps } = useButton(props);
|
|
109
|
+
return /* @__PURE__ */ _jsx(ButtonFrame, {
|
|
110
|
+
...buttonProps,
|
|
214
111
|
ref
|
|
215
|
-
})
|
|
112
|
+
});
|
|
216
113
|
}), buttonStaticConfig = {
|
|
217
114
|
inlineProps: /* @__PURE__ */ new Set([
|
|
218
115
|
// text props go here (can't really optimize them, but we never fully extract button anyway)
|
|
@@ -230,40 +127,21 @@ var ButtonContext = createStyledContext({
|
|
|
230
127
|
Text: ButtonText,
|
|
231
128
|
Icon: ButtonIcon
|
|
232
129
|
});
|
|
233
|
-
function useButton(
|
|
234
|
-
var
|
|
130
|
+
function useButton(param) {
|
|
131
|
+
var { textProps, ...propsIn } = param, { Text = Button2.Text } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
235
132
|
Text: Button2.Text
|
|
236
|
-
},
|
|
237
|
-
"textProps"
|
|
238
|
-
]), _param_Text = _$_param.Text, Text = _param_Text === void 0 ? Button2.Text : _param_Text, isNested = useContext(ButtonNestingContext), propsActive = useProps(propsIn, {
|
|
133
|
+
}, isNested = useContext(ButtonNestingContext), propsActive = useProps(propsIn, {
|
|
239
134
|
noNormalize: !0,
|
|
240
135
|
noExpand: !0
|
|
241
|
-
}),
|
|
242
|
-
"
|
|
243
|
-
"iconAfter",
|
|
244
|
-
"space",
|
|
245
|
-
"spaceFlex",
|
|
246
|
-
"scaleIcon",
|
|
247
|
-
"scaleSpace",
|
|
248
|
-
"separator",
|
|
249
|
-
"noTextWrap",
|
|
250
|
-
"fontFamily",
|
|
251
|
-
"fontSize",
|
|
252
|
-
"fontWeight",
|
|
253
|
-
"fontStyle",
|
|
254
|
-
"letterSpacing",
|
|
255
|
-
"tag",
|
|
256
|
-
"ellipse",
|
|
257
|
-
"maxFontSizeMultiplier"
|
|
258
|
-
]), size = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size, {
|
|
259
|
-
font: (fontFamily == null ? void 0 : fontFamily[0]) === "$" ? fontFamily : void 0
|
|
136
|
+
}), { icon, iconAfter, space, spaceFlex, scaleIcon = 1, scaleSpace = 0.66, separator, noTextWrap, fontFamily, fontSize, fontWeight, fontStyle, letterSpacing, tag, ellipse, maxFontSizeMultiplier, ...restProps } = propsActive, size = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size, {
|
|
137
|
+
font: fontFamily?.[0] === "$" ? fontFamily : void 0
|
|
260
138
|
})) * scaleIcon, getThemedIcon = useGetThemedIcon({
|
|
261
139
|
size: iconSize,
|
|
262
140
|
color
|
|
263
|
-
}),
|
|
141
|
+
}), [themedIcon, themedIconAfter] = [
|
|
264
142
|
icon,
|
|
265
143
|
iconAfter
|
|
266
|
-
].map(getThemedIcon),
|
|
144
|
+
].map(getThemedIcon), spaceSize = space ?? getVariableValue(iconSize) * scaleSpace, contents = noTextWrap ? [
|
|
267
145
|
propsIn.children
|
|
268
146
|
] : wrapChildrenInText(Text, {
|
|
269
147
|
children: propsIn.children,
|
|
@@ -288,34 +166,34 @@ function useButton(_param) {
|
|
|
288
166
|
// for keys to stay the same we keep indices as similar a possible
|
|
289
167
|
// so even if icons are undefined we still pass them
|
|
290
168
|
children: [
|
|
291
|
-
themedIcon
|
|
292
|
-
|
|
169
|
+
themedIcon,
|
|
170
|
+
...contents,
|
|
293
171
|
themedIconAfter
|
|
294
|
-
]
|
|
295
|
-
}), props =
|
|
296
|
-
size
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
172
|
+
]
|
|
173
|
+
}), props = {
|
|
174
|
+
size,
|
|
175
|
+
...propsIn.disabled && {
|
|
176
|
+
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
177
|
+
focusable: void 0,
|
|
178
|
+
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
179
|
+
focusVisibleStyle: {
|
|
180
|
+
borderColor: "$background"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
305
183
|
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
306
184
|
tag: tag ?? (isNested ? "span" : (
|
|
307
185
|
// defaults to <a /> when accessibilityRole = link
|
|
308
186
|
// see https://github.com/tamagui/tamagui/issues/505
|
|
309
187
|
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"
|
|
310
|
-
))
|
|
311
|
-
|
|
188
|
+
)),
|
|
189
|
+
...restProps,
|
|
312
190
|
children: /* @__PURE__ */ _jsx(ButtonNestingContext.Provider, {
|
|
313
191
|
value: !0,
|
|
314
192
|
children: inner
|
|
315
193
|
}),
|
|
316
194
|
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
317
195
|
disableClassName: !0
|
|
318
|
-
}
|
|
196
|
+
};
|
|
319
197
|
return {
|
|
320
198
|
spaceSize,
|
|
321
199
|
isNested,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/button/src/Button.tsx"],
|
|
4
|
-
"mappings": ";AAAA,SAASA,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,4BAA4B;AACrC,SAASC,wBAAwB;AACjC,SAASC,sBAAsBC,sBAAsB;AAErD,SAASC,aAAaC,0BAA0B;AAEhD,SACEC,qBACAC,kBACAC,gBACAC,QACAC,gBACK;AAEP,SAASC,kBAAkB
|
|
5
|
-
"names": ["getFontSize", "getButtonSized", "withStaticProperties", "useGetThemedIcon", "ButtonNestingContext", "ThemeableStack", "SizableText", "wrapChildrenInText", "createStyledContext", "getVariableValue", "spacedChildren", "styled", "useProps", "useContext", "ButtonContext", "color", "undefined", "ellipse", "fontFamily", "fontSize", "fontStyle", "fontWeight", "letterSpacing", "maxFontSizeMultiplier", "size", "textAlign", "variant", "BUTTON_NAME", "ButtonFrame", "name", "tag", "context", "role", "focusable", "variants", "unstyled", "false", "justifyContent", "alignItems", "flexWrap", "flexDirection", "cursor", "hoverTheme", "pressTheme", "backgrounded", "borderWidth", "borderColor", "focusVisibleStyle", "outlineColor", "outlineStyle", "outlineWidth", "outlined", "backgroundColor", "hoverStyle", "pressStyle", "disabled", "true", "pointerEvents", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "ButtonText", "userSelect", "flexGrow", "flexShrink", "ButtonIcon", "props", "children", "scaleIcon", "iconSize", "getThemedIcon", "ButtonComponent", "styleable", "ref", "
|
|
4
|
+
"mappings": ";AAAA,SAASA,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,4BAA4B;AACrC,SAASC,wBAAwB;AACjC,SAASC,sBAAsBC,sBAAsB;AAErD,SAASC,aAAaC,0BAA0B;AAEhD,SACEC,qBACAC,kBACAC,gBACAC,QACAC,gBACK;AAEP,SAASC,kBAAkB;AAIpB,IAAMC,gBAAgBN,oBAO3B;;EAEAO,OAAOC;EACPC,SAASD;EACTE,YAAYF;EACZG,UAAUH;EACVI,WAAWJ;EACXK,YAAYL;EACZM,eAAeN;EACfO,uBAAuBP;EACvBQ,MAAMR;EACNS,WAAWT;EACXU,SAASV;AACX,CAAA,GAyCMW,cAAc,UAEdC,cAAcjB,OAAON,gBAAgB;EACzCwB,MAAMF;EACNG,KAAK;EACLC,S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ACEb,UAAUgB,QAAQhB;IAClBlD;IACAC;IACAgE;IACA9D;IACAD;IACAE;IACAL;IACAM;EACF,GACA0D,SAASnB,cAAcwB,YAAYnD,aAAa,KAC5C;IACEA,UAAUwB,QAAQC,IAAIC,qBAAqB;IAC3CrC;EACF,IACAR,MAAAA,GAGJuF,QAAQ7F,eAAe;;IAE3BiF,OAAOU;IACPT;IACAY,YAAY;IACZV;IACAW,WACEnB,YAAY9C,kBAAkB,YAC9B8C,YAAY9C,kBAAkB,mBAC1B,aACA;;;IAGN4B,UAAU;MAAC8B;SAAeI;MAAUH;;EACtC,CAAA,GAEMhC,QAAQ;IACZ3C;IACA,GAAI4D,QAAQ7B,YAAY;;MAEtBtB,WAAWjB;;MAEX+B,mBAAmB;QACjBD,aAAa;MACf;IACF;;IAEAhB,KACEA,QACCuD,WACG;;;MAGAC,YAAYoB,sBAAsB,UAAUpB,YAAYtD,SAAS,SAC/D,MACA;;IAER,GAAGgE;IAEH5B,UACE,qBAAChE,qBAAqBuG,UAAQ;MAACC,OAAO;gBAAOL;;;IAG/CM,kBAAkB;EACpB;AAEA,SAAO;IACLR;IACAhB;IACAlB;EACF;AACF;",
|
|
5
|
+
"names": ["getFontSize", "getButtonSized", "withStaticProperties", "useGetThemedIcon", "ButtonNestingContext", "ThemeableStack", "SizableText", "wrapChildrenInText", "createStyledContext", "getVariableValue", "spacedChildren", "styled", "useProps", "useContext", "ButtonContext", "color", "undefined", "ellipse", "fontFamily", "fontSize", "fontStyle", "fontWeight", "letterSpacing", "maxFontSizeMultiplier", "size", "textAlign", "variant", "BUTTON_NAME", "ButtonFrame", "name", "tag", "context", "role", "focusable", "variants", "unstyled", "false", "justifyContent", "alignItems", "flexWrap", "flexDirection", "cursor", "hoverTheme", "pressTheme", "backgrounded", "borderWidth", "borderColor", "focusVisibleStyle", "outlineColor", "outlineStyle", "outlineWidth", "outlined", "backgroundColor", "hoverStyle", "pressStyle", "disabled", "true", "pointerEvents", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "ButtonText", "userSelect", "flexGrow", "flexShrink", "ButtonIcon", "props", "children", "scaleIcon", "iconSize", "getThemedIcon", "ButtonComponent", "styleable", "ref", "buttonProps", "useButton", "buttonStaticConfig", "inlineProps", "Set", "Button", "Text", "Icon", "textProps", "propsIn", "isNested", "propsActive", "noNormalize", "noExpand", "icon", "iconAfter", "space", "spaceFlex", "scaleSpace", "separator", "noTextWrap", "restProps", "font", "themedIcon", "themedIconAfter", "map", "spaceSize", "contents", "inner", "ensureKeys", "direction", "accessibilityRole", "Provider", "value", "disableClassName"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getFontSize } from "@tamagui/font-size";
|
|
3
|
+
import { getButtonSized } from "@tamagui/get-button-sized";
|
|
4
|
+
import { withStaticProperties } from "@tamagui/helpers";
|
|
5
|
+
import { useGetThemedIcon } from "@tamagui/helpers-tamagui";
|
|
6
|
+
import { ButtonNestingContext, ThemeableStack } from "@tamagui/stacks";
|
|
7
|
+
import { SizableText, wrapChildrenInText } from "@tamagui/text";
|
|
8
|
+
import { createStyledContext, getVariableValue, spacedChildren, styled, useProps } from "@tamagui/web";
|
|
9
|
+
import { useContext } from "react";
|
|
10
|
+
var ButtonContext = createStyledContext({
|
|
11
|
+
// keeping these here means they work with styled() passing down color to text
|
|
12
|
+
color: void 0,
|
|
13
|
+
ellipse: void 0,
|
|
14
|
+
fontFamily: void 0,
|
|
15
|
+
fontSize: void 0,
|
|
16
|
+
fontStyle: void 0,
|
|
17
|
+
fontWeight: void 0,
|
|
18
|
+
letterSpacing: void 0,
|
|
19
|
+
maxFontSizeMultiplier: void 0,
|
|
20
|
+
size: void 0,
|
|
21
|
+
textAlign: void 0,
|
|
22
|
+
variant: void 0
|
|
23
|
+
}),
|
|
24
|
+
BUTTON_NAME = "Button",
|
|
25
|
+
ButtonFrame = styled(ThemeableStack, {
|
|
26
|
+
name: BUTTON_NAME,
|
|
27
|
+
tag: "button",
|
|
28
|
+
context: ButtonContext,
|
|
29
|
+
role: "button",
|
|
30
|
+
focusable: !0,
|
|
31
|
+
variants: {
|
|
32
|
+
unstyled: {
|
|
33
|
+
false: {
|
|
34
|
+
size: "$true",
|
|
35
|
+
justifyContent: "center",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
flexWrap: "nowrap",
|
|
38
|
+
flexDirection: "row",
|
|
39
|
+
cursor: "pointer",
|
|
40
|
+
hoverTheme: !0,
|
|
41
|
+
pressTheme: !0,
|
|
42
|
+
backgrounded: !0,
|
|
43
|
+
borderWidth: 1,
|
|
44
|
+
borderColor: "transparent",
|
|
45
|
+
focusVisibleStyle: {
|
|
46
|
+
outlineColor: "$outlineColor",
|
|
47
|
+
outlineStyle: "solid",
|
|
48
|
+
outlineWidth: 2
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
variant: {
|
|
53
|
+
outlined: {
|
|
54
|
+
backgroundColor: "transparent",
|
|
55
|
+
borderWidth: 2,
|
|
56
|
+
borderColor: "$borderColor",
|
|
57
|
+
hoverStyle: {
|
|
58
|
+
backgroundColor: "transparent",
|
|
59
|
+
borderColor: "$borderColorHover"
|
|
60
|
+
},
|
|
61
|
+
pressStyle: {
|
|
62
|
+
backgroundColor: "transparent",
|
|
63
|
+
borderColor: "$borderColorPress"
|
|
64
|
+
},
|
|
65
|
+
focusVisibleStyle: {
|
|
66
|
+
backgroundColor: "transparent",
|
|
67
|
+
borderColor: "$borderColorFocus"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
size: {
|
|
72
|
+
"...size": getButtonSized,
|
|
73
|
+
":number": getButtonSized
|
|
74
|
+
},
|
|
75
|
+
disabled: {
|
|
76
|
+
true: {
|
|
77
|
+
pointerEvents: "none"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
83
|
+
}
|
|
84
|
+
}),
|
|
85
|
+
ButtonText = styled(SizableText, {
|
|
86
|
+
name: "Button",
|
|
87
|
+
context: ButtonContext,
|
|
88
|
+
variants: {
|
|
89
|
+
unstyled: {
|
|
90
|
+
false: {
|
|
91
|
+
userSelect: "none",
|
|
92
|
+
cursor: "pointer",
|
|
93
|
+
// flexGrow 1 leads to inconsistent native style where text pushes to start of view
|
|
94
|
+
flexGrow: 0,
|
|
95
|
+
flexShrink: 1,
|
|
96
|
+
ellipse: !0,
|
|
97
|
+
color: "$color"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
defaultVariants: {
|
|
102
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
103
|
+
}
|
|
104
|
+
}),
|
|
105
|
+
ButtonIcon = function (props) {
|
|
106
|
+
var {
|
|
107
|
+
children,
|
|
108
|
+
scaleIcon = 1
|
|
109
|
+
} = props,
|
|
110
|
+
{
|
|
111
|
+
size,
|
|
112
|
+
color
|
|
113
|
+
} = useContext(ButtonContext),
|
|
114
|
+
iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size)) * scaleIcon,
|
|
115
|
+
getThemedIcon = useGetThemedIcon({
|
|
116
|
+
size: iconSize,
|
|
117
|
+
color
|
|
118
|
+
});
|
|
119
|
+
return getThemedIcon(children);
|
|
120
|
+
},
|
|
121
|
+
ButtonComponent = ButtonFrame.styleable(function (props, ref) {
|
|
122
|
+
var {
|
|
123
|
+
props: buttonProps
|
|
124
|
+
} = useButton(props);
|
|
125
|
+
return /* @__PURE__ */_jsx(ButtonFrame, {
|
|
126
|
+
...buttonProps,
|
|
127
|
+
ref
|
|
128
|
+
});
|
|
129
|
+
}),
|
|
130
|
+
buttonStaticConfig = {
|
|
131
|
+
inlineProps: /* @__PURE__ */new Set([
|
|
132
|
+
// text props go here (can't really optimize them, but we never fully extract button anyway)
|
|
133
|
+
// may be able to remove this entirely, as the compiler / runtime have gotten better
|
|
134
|
+
"color", "fontWeight", "fontSize", "fontFamily", "fontStyle", "letterSpacing", "textAlign", "unstyled"])
|
|
135
|
+
},
|
|
136
|
+
Button2 = withStaticProperties(ButtonComponent, {
|
|
137
|
+
Text: ButtonText,
|
|
138
|
+
Icon: ButtonIcon
|
|
139
|
+
});
|
|
140
|
+
function useButton(param) {
|
|
141
|
+
var {
|
|
142
|
+
textProps,
|
|
143
|
+
...propsIn
|
|
144
|
+
} = param,
|
|
145
|
+
{
|
|
146
|
+
Text = Button2.Text
|
|
147
|
+
} = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
148
|
+
Text: Button2.Text
|
|
149
|
+
},
|
|
150
|
+
isNested = useContext(ButtonNestingContext),
|
|
151
|
+
propsActive = useProps(propsIn, {
|
|
152
|
+
noNormalize: !0,
|
|
153
|
+
noExpand: !0
|
|
154
|
+
}),
|
|
155
|
+
{
|
|
156
|
+
icon,
|
|
157
|
+
iconAfter,
|
|
158
|
+
space,
|
|
159
|
+
spaceFlex,
|
|
160
|
+
scaleIcon = 1,
|
|
161
|
+
scaleSpace = 0.66,
|
|
162
|
+
separator,
|
|
163
|
+
noTextWrap,
|
|
164
|
+
fontFamily,
|
|
165
|
+
fontSize,
|
|
166
|
+
fontWeight,
|
|
167
|
+
fontStyle,
|
|
168
|
+
letterSpacing,
|
|
169
|
+
tag,
|
|
170
|
+
ellipse,
|
|
171
|
+
maxFontSizeMultiplier,
|
|
172
|
+
...restProps
|
|
173
|
+
} = propsActive,
|
|
174
|
+
size = propsActive.size || (propsActive.unstyled ? void 0 : "$true"),
|
|
175
|
+
color = propsActive.color,
|
|
176
|
+
iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size, {
|
|
177
|
+
font: fontFamily?.[0] === "$" ? fontFamily : void 0
|
|
178
|
+
})) * scaleIcon,
|
|
179
|
+
getThemedIcon = useGetThemedIcon({
|
|
180
|
+
size: iconSize,
|
|
181
|
+
color
|
|
182
|
+
}),
|
|
183
|
+
[themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon),
|
|
184
|
+
spaceSize = space ?? getVariableValue(iconSize) * scaleSpace,
|
|
185
|
+
contents = noTextWrap ? [propsIn.children] : wrapChildrenInText(Text, {
|
|
186
|
+
children: propsIn.children,
|
|
187
|
+
fontFamily,
|
|
188
|
+
fontSize,
|
|
189
|
+
textProps,
|
|
190
|
+
fontWeight,
|
|
191
|
+
fontStyle,
|
|
192
|
+
letterSpacing,
|
|
193
|
+
ellipse,
|
|
194
|
+
maxFontSizeMultiplier
|
|
195
|
+
}, Text === ButtonText && propsActive.unstyled !== !0 ? {
|
|
196
|
+
unstyled: process.env.TAMAGUI_HEADLESS === "1",
|
|
197
|
+
size
|
|
198
|
+
} : void 0),
|
|
199
|
+
inner = spacedChildren({
|
|
200
|
+
// a bit arbitrary but scaling to font size is necessary so long as button does
|
|
201
|
+
space: spaceSize,
|
|
202
|
+
spaceFlex,
|
|
203
|
+
ensureKeys: !0,
|
|
204
|
+
separator,
|
|
205
|
+
direction: propsActive.flexDirection === "column" || propsActive.flexDirection === "column-reverse" ? "vertical" : "horizontal",
|
|
206
|
+
// for keys to stay the same we keep indices as similar a possible
|
|
207
|
+
// so even if icons are undefined we still pass them
|
|
208
|
+
children: [themedIcon, ...contents, themedIconAfter]
|
|
209
|
+
}),
|
|
210
|
+
props = {
|
|
211
|
+
size,
|
|
212
|
+
...(propsIn.disabled && {
|
|
213
|
+
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
214
|
+
focusable: void 0,
|
|
215
|
+
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
216
|
+
focusVisibleStyle: {
|
|
217
|
+
borderColor: "$background"
|
|
218
|
+
}
|
|
219
|
+
}),
|
|
220
|
+
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
221
|
+
tag: tag ?? (isNested ? "span" :
|
|
222
|
+
// defaults to <a /> when accessibilityRole = link
|
|
223
|
+
// see https://github.com/tamagui/tamagui/issues/505
|
|
224
|
+
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"),
|
|
225
|
+
...restProps,
|
|
226
|
+
children: /* @__PURE__ */_jsx(ButtonNestingContext.Provider, {
|
|
227
|
+
value: !0,
|
|
228
|
+
children: inner
|
|
229
|
+
}),
|
|
230
|
+
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
231
|
+
disableClassName: !0
|
|
232
|
+
};
|
|
233
|
+
return {
|
|
234
|
+
spaceSize,
|
|
235
|
+
isNested,
|
|
236
|
+
props
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
export { Button2 as Button, ButtonContext, ButtonFrame, ButtonIcon, ButtonText, buttonStaticConfig, useButton };
|
|
240
|
+
//# sourceMappingURL=Button.native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","getFontSize","getButtonSized","withStaticProperties","useGetThemedIcon","ButtonNestingContext","ThemeableStack","SizableText","wrapChildrenInText","createStyledContext","getVariableValue","spacedChildren","styled","useProps","useContext","ButtonContext","color","ellipse","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","maxFontSizeMultiplier","size","textAlign","variant","BUTTON_NAME","ButtonFrame","name","tag","context","role","focusable","variants","unstyled","false","justifyContent","alignItems","flexWrap","flexDirection","cursor","hoverTheme","pressTheme","backgrounded","borderWidth","borderColor","focusVisibleStyle","outlineColor","outlineStyle","outlineWidth","outlined","backgroundColor","hoverStyle","pressStyle","disabled","true","pointerEvents","defaultVariants","process","env","TAMAGUI_HEADLESS","ButtonText","userSelect","flexGrow","flexShrink","ButtonIcon","props","children","scaleIcon","iconSize","getThemedIcon","ButtonComponent","styleable","ref","buttonProps","useButton","buttonStaticConfig","inlineProps","Set","Button2","Text","Icon","param","textProps","propsIn","arguments","length","isNested","propsActive","noNormalize","noExpand","icon","iconAfter","space","spaceFlex","scaleSpace","separator","noTextWrap","restProps","font","themedIcon","themedIconAfter","map","spaceSize","contents","inner","ensureKeys","direction","accessibilityRole","Provider","value","disableClassName","Button"],"sources":["../../src/Button.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAA,IAAAC,IAAA,QAAmB;AAC5B,SAASC,WAAA,4BAAsB;AAC/B,SAASC,cAAA,mCAA4B;AACrC,SAASC,oBAAA,QAAwB;AACjC,SAASC,gBAAA,QAAsB,0BAAsB;AAErD,SAASC,oBAAa,EAAAC,cAAA,QAA0B;AAEhD,SAAAC,WAAA,EAAAC,kBAAA;AAAA,SACEC,mBAAA,EAAAC,gBAAA,EAAAC,cAAA,EAAAC,MAAA,EAAAC,QAAA;AAAA,SACAC,UAAA;AAAA,IACAC,aAAA,GAAAN,mBAAA;IACA;IACAO,KAAA;IAAAC,OACK;IAEPC,UAAS;IAgLEC,QAAA;IA5KJC,SAAM;IAOXC,UAAA;IAEAC,aAAO;IACPC,qBAAS;IACTC,IAAA,QAAY;IACZC,SAAA,EAAU;IACVC,OAAA,OAAW;EAAA,EACX;EAAAC,WAAY;EAAAC,WAAA,GAAAhB,MAAA,CAAAN,cAAA;IACZuB,IAAA,EAAAF,WAAe;IACfG,GAAA;IACAC,OAAM,EAAAhB,aAAA;IACNiB,IAAA,UAAW;IACXC,SAAS;IACVC,QAyCK;MAGJC,QAAM;QACNC,KAAK;UACLZ,IAAS;UACHa,cAAA;UACNC,UAAW;UAEXC,QAAU;UACRC,aAAU;UACRC,MAAO;UACLC,UAAM;UACNC,UAAA;UACAC,YAAY;UACZC,WAAU;UACVC,WAAA,eAAe;UACfC,iBAAQ;YACRC,YAAY;YACZC,YAAY;YACZC,YAAc;UACd;QAAa;MACA;MAEMxB,OACjB;QAAcyB,QACd;UAAcC,eACd,EAAc;UAChBP,WAAA;UACFC,WAAA;UACFO,UAAA;YAEAD,eAAS;YACPN,WAAU;UACR;UACAQ,UAAA;YACAF,eAAa;YAEbN,WAAY;UAAA;UACOC,iBACJ;YACfK,eAAA;YAEAN,WAAY;UAAA;QACO;MACJ;MACftB,I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agui/code/ui/button/src/Button.test.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAASA,+BAA+B;AACxC,SAASC,qBAAqB;AAC9B,SAASC,UAAUC,QAAQC,YAAY;AAEvC,IAAMC,OAAOJ,cAAcD,wBAAAA,CAAAA;AAE3BE,SAAS,UAAU,WAAA;AACjBE,
|
|
4
|
+
"mappings": "AAAA,SAASA,+BAA+B;AACxC,SAASC,qBAAqB;AAC9B,SAASC,UAAUC,QAAQC,YAAY;AAEvC,IAAMC,OAAOJ,cAAcD,wBAAAA,CAAAA;AAE3BE,SAAS,UAAU,WAAA;AACjBE,OAAK,OAAO,WAAA;AACVD,WAAO,EAAA,EAAMG,WAAU;EACzB,CAAA;AAWF,CAAA;",
|
|
5
5
|
"names": ["getDefaultTamaguiConfig", "createTamagui", "describe", "expect", "test", "conf", "toBeTruthy"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getDefaultTamaguiConfig } from "@tamagui/config-default";
|
|
2
|
+
import { createTamagui } from "@tamagui/core";
|
|
3
|
+
import { describe, expect, test } from "vitest";
|
|
4
|
+
var conf = createTamagui(getDefaultTamaguiConfig());
|
|
5
|
+
describe("Button", function () {
|
|
6
|
+
test("123", function () {
|
|
7
|
+
expect(!0).toBeTruthy();
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=Button.test.native.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getDefaultTamaguiConfig","createTamagui","describe","expect","test","conf","toBeTruthy"],"sources":["../../src/Button.test.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,uBAAA,QAA+B;AACxC,SAASC,aAAA,QAAqB;AAC9B,SAASC,QAAA,EAAUC,MAAA,EAAQC,IAAA,QAAY;AAEvC,IAAAC,IAAM,GAAAJ,aAAO,CAAAD,uBAAc,GAAwB;AAEnDE,QAAA,CAAS,UAAU,YAAM;EACvBE,IAAA,CAAK,OAAO,YAAM;IAChBD,MAAA,CAAO,EAAI,EAAEG,UAAA,CAAW;EAC1B,CAAC;AAWH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|
|
@@ -7,110 +7,6 @@ import { ButtonNestingContext, ThemeableStack } from "@tamagui/stacks";
|
|
|
7
7
|
import { SizableText, wrapChildrenInText } from "@tamagui/text";
|
|
8
8
|
import { createStyledContext, getVariableValue, spacedChildren, styled, useProps } from "@tamagui/web";
|
|
9
9
|
import { useContext } from "react";
|
|
10
|
-
function _array_like_to_array(arr, len) {
|
|
11
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
12
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
13
|
-
return arr2;
|
|
14
|
-
}
|
|
15
|
-
function _array_with_holes(arr) {
|
|
16
|
-
if (Array.isArray(arr)) return arr;
|
|
17
|
-
}
|
|
18
|
-
function _array_without_holes(arr) {
|
|
19
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
20
|
-
}
|
|
21
|
-
function _define_property(obj, key, value) {
|
|
22
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
23
|
-
value,
|
|
24
|
-
enumerable: !0,
|
|
25
|
-
configurable: !0,
|
|
26
|
-
writable: !0
|
|
27
|
-
}) : obj[key] = value, obj;
|
|
28
|
-
}
|
|
29
|
-
function _iterable_to_array(iter) {
|
|
30
|
-
if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
31
|
-
}
|
|
32
|
-
function _iterable_to_array_limit(arr, i) {
|
|
33
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
34
|
-
if (_i != null) {
|
|
35
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
36
|
-
try {
|
|
37
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
38
|
-
;
|
|
39
|
-
} catch (err) {
|
|
40
|
-
_d = !0, _e = err;
|
|
41
|
-
} finally {
|
|
42
|
-
try {
|
|
43
|
-
!_n && _i.return != null && _i.return();
|
|
44
|
-
} finally {
|
|
45
|
-
if (_d) throw _e;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return _arr;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function _non_iterable_rest() {
|
|
52
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
53
|
-
}
|
|
54
|
-
function _non_iterable_spread() {
|
|
55
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
56
|
-
}
|
|
57
|
-
function _object_spread(target) {
|
|
58
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
59
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
60
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
61
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
62
|
-
}))), ownKeys2.forEach(function(key) {
|
|
63
|
-
_define_property(target, key, source[key]);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return target;
|
|
67
|
-
}
|
|
68
|
-
function ownKeys(object, enumerableOnly) {
|
|
69
|
-
var keys = Object.keys(object);
|
|
70
|
-
if (Object.getOwnPropertySymbols) {
|
|
71
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
72
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
73
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
74
|
-
})), keys.push.apply(keys, symbols);
|
|
75
|
-
}
|
|
76
|
-
return keys;
|
|
77
|
-
}
|
|
78
|
-
function _object_spread_props(target, source) {
|
|
79
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
80
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
81
|
-
}), target;
|
|
82
|
-
}
|
|
83
|
-
function _object_without_properties(source, excluded) {
|
|
84
|
-
if (source == null) return {};
|
|
85
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
86
|
-
if (Object.getOwnPropertySymbols) {
|
|
87
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
88
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
89
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
90
|
-
}
|
|
91
|
-
return target;
|
|
92
|
-
}
|
|
93
|
-
function _object_without_properties_loose(source, excluded) {
|
|
94
|
-
if (source == null) return {};
|
|
95
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
96
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
97
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
98
|
-
return target;
|
|
99
|
-
}
|
|
100
|
-
function _sliced_to_array(arr, i) {
|
|
101
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
102
|
-
}
|
|
103
|
-
function _to_consumable_array(arr) {
|
|
104
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
105
|
-
}
|
|
106
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
107
|
-
if (o) {
|
|
108
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
109
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
110
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
111
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
10
|
var ButtonContext = createStyledContext({
|
|
115
11
|
// keeping these here means they work with styled() passing down color to text
|
|
116
12
|
color: void 0,
|
|
@@ -203,16 +99,17 @@ var ButtonContext = createStyledContext({
|
|
|
203
99
|
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
204
100
|
}
|
|
205
101
|
}), ButtonIcon = function(props) {
|
|
206
|
-
var
|
|
102
|
+
var { children, scaleIcon = 1 } = props, { size, color } = useContext(ButtonContext), iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size)) * scaleIcon, getThemedIcon = useGetThemedIcon({
|
|
207
103
|
size: iconSize,
|
|
208
104
|
color
|
|
209
105
|
});
|
|
210
106
|
return getThemedIcon(children);
|
|
211
107
|
}, ButtonComponent = ButtonFrame.styleable(function(props, ref) {
|
|
212
|
-
var
|
|
213
|
-
return /* @__PURE__ */ _jsx(ButtonFrame,
|
|
108
|
+
var { props: buttonProps } = useButton(props);
|
|
109
|
+
return /* @__PURE__ */ _jsx(ButtonFrame, {
|
|
110
|
+
...buttonProps,
|
|
214
111
|
ref
|
|
215
|
-
})
|
|
112
|
+
});
|
|
216
113
|
}), buttonStaticConfig = {
|
|
217
114
|
inlineProps: /* @__PURE__ */ new Set([
|
|
218
115
|
// text props go here (can't really optimize them, but we never fully extract button anyway)
|
|
@@ -230,40 +127,21 @@ var ButtonContext = createStyledContext({
|
|
|
230
127
|
Text: ButtonText,
|
|
231
128
|
Icon: ButtonIcon
|
|
232
129
|
});
|
|
233
|
-
function useButton(
|
|
234
|
-
var
|
|
130
|
+
function useButton(param) {
|
|
131
|
+
var { textProps, ...propsIn } = param, { Text = Button2.Text } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
235
132
|
Text: Button2.Text
|
|
236
|
-
},
|
|
237
|
-
"textProps"
|
|
238
|
-
]), _param_Text = _$_param.Text, Text = _param_Text === void 0 ? Button2.Text : _param_Text, isNested = useContext(ButtonNestingContext), propsActive = useProps(propsIn, {
|
|
133
|
+
}, isNested = useContext(ButtonNestingContext), propsActive = useProps(propsIn, {
|
|
239
134
|
noNormalize: !0,
|
|
240
135
|
noExpand: !0
|
|
241
|
-
}),
|
|
242
|
-
"icon",
|
|
243
|
-
"iconAfter",
|
|
244
|
-
"space",
|
|
245
|
-
"spaceFlex",
|
|
246
|
-
"scaleIcon",
|
|
247
|
-
"scaleSpace",
|
|
248
|
-
"separator",
|
|
249
|
-
"noTextWrap",
|
|
250
|
-
"fontFamily",
|
|
251
|
-
"fontSize",
|
|
252
|
-
"fontWeight",
|
|
253
|
-
"fontStyle",
|
|
254
|
-
"letterSpacing",
|
|
255
|
-
"tag",
|
|
256
|
-
"ellipse",
|
|
257
|
-
"maxFontSizeMultiplier"
|
|
258
|
-
]), size = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size, {
|
|
136
|
+
}), { icon, iconAfter, space, spaceFlex, scaleIcon = 1, scaleSpace = 0.66, separator, noTextWrap, fontFamily, fontSize, fontWeight, fontStyle, letterSpacing, tag, ellipse, maxFontSizeMultiplier, ...restProps } = propsActive, size = propsActive.size || (propsActive.unstyled ? void 0 : "$true"), color = propsActive.color, iconSize = (typeof size == "number" ? size * 0.5 : getFontSize(size, {
|
|
259
137
|
font: (fontFamily == null ? void 0 : fontFamily[0]) === "$" ? fontFamily : void 0
|
|
260
138
|
})) * scaleIcon, getThemedIcon = useGetThemedIcon({
|
|
261
139
|
size: iconSize,
|
|
262
140
|
color
|
|
263
|
-
}),
|
|
141
|
+
}), [themedIcon, themedIconAfter] = [
|
|
264
142
|
icon,
|
|
265
143
|
iconAfter
|
|
266
|
-
].map(getThemedIcon),
|
|
144
|
+
].map(getThemedIcon), spaceSize = space ?? getVariableValue(iconSize) * scaleSpace, contents = noTextWrap ? [
|
|
267
145
|
propsIn.children
|
|
268
146
|
] : wrapChildrenInText(Text, {
|
|
269
147
|
children: propsIn.children,
|
|
@@ -288,34 +166,34 @@ function useButton(_param) {
|
|
|
288
166
|
// for keys to stay the same we keep indices as similar a possible
|
|
289
167
|
// so even if icons are undefined we still pass them
|
|
290
168
|
children: [
|
|
291
|
-
themedIcon
|
|
292
|
-
|
|
169
|
+
themedIcon,
|
|
170
|
+
...contents,
|
|
293
171
|
themedIconAfter
|
|
294
|
-
]
|
|
295
|
-
}), props =
|
|
296
|
-
size
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
172
|
+
]
|
|
173
|
+
}), props = {
|
|
174
|
+
size,
|
|
175
|
+
...propsIn.disabled && {
|
|
176
|
+
// in rnw - false still has keyboard tabIndex, undefined = not actually focusable
|
|
177
|
+
focusable: void 0,
|
|
178
|
+
// even with tabIndex unset, it will keep focusVisibleStyle on web so disable it here
|
|
179
|
+
focusVisibleStyle: {
|
|
180
|
+
borderColor: "$background"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
305
183
|
// fixes SSR issue + DOM nesting issue of not allowing button in button
|
|
306
184
|
tag: tag ?? (isNested ? "span" : (
|
|
307
185
|
// defaults to <a /> when accessibilityRole = link
|
|
308
186
|
// see https://github.com/tamagui/tamagui/issues/505
|
|
309
187
|
propsActive.accessibilityRole === "link" || propsActive.role === "link" ? "a" : "button"
|
|
310
|
-
))
|
|
311
|
-
|
|
188
|
+
)),
|
|
189
|
+
...restProps,
|
|
312
190
|
children: /* @__PURE__ */ _jsx(ButtonNestingContext.Provider, {
|
|
313
191
|
value: !0,
|
|
314
192
|
children: inner
|
|
315
193
|
}),
|
|
316
194
|
// forces it to be a runtime pressStyle so it passes through context text colors
|
|
317
195
|
disableClassName: !0
|
|
318
|
-
}
|
|
196
|
+
};
|
|
319
197
|
return {
|
|
320
198
|
spaceSize,
|
|
321
199
|
isNested,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/button/src/Button.tsx"],
|
|
4
|
-
"mappings": ";AAAA,SAASA,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,4BAA4B;AACrC,SAASC,wBAAwB;AACjC,SAASC,sBAAsBC,sBAAsB;AAErD,SAASC,aAAaC,0BAA0B;AAEhD,SACEC,qBACAC,kBACAC,gBACAC,QACAC,gBACK;AAEP,SAASC,kBAAkB
|
|
5
|
-
"names": ["getFontSize", "getButtonSized", "withStaticProperties", "useGetThemedIcon", "ButtonNestingContext", "ThemeableStack", "SizableText", "wrapChildrenInText", "createStyledContext", "getVariableValue", "spacedChildren", "styled", "useProps", "useContext", "ButtonContext", "color", "undefined", "ellipse", "fontFamily", "fontSize", "fontStyle", "fontWeight", "letterSpacing", "maxFontSizeMultiplier", "size", "textAlign", "variant", "BUTTON_NAME", "ButtonFrame", "name", "tag", "context", "role", "focusable", "variants", "unstyled", "false", "justifyContent", "alignItems", "flexWrap", "flexDirection", "cursor", "hoverTheme", "pressTheme", "backgrounded", "borderWidth", "borderColor", "focusVisibleStyle", "outlineColor", "outlineStyle", "outlineWidth", "outlined", "backgroundColor", "hoverStyle", "pressStyle", "disabled", "true", "pointerEvents", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "ButtonText", "userSelect", "flexGrow", "flexShrink", "ButtonIcon", "props", "children", "scaleIcon", "iconSize", "getThemedIcon", "ButtonComponent", "styleable", "ref", "
|
|
4
|
+
"mappings": ";AAAA,SAASA,mBAAmB;AAC5B,SAASC,sBAAsB;AAC/B,SAASC,4BAA4B;AACrC,SAASC,wBAAwB;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AY,UAE/DD,QAAQuE,YAAYvE,OAEpBuD,YACH,OAAO9C,QAAS,WACbA,OAAO,MACPxB,YAAYwB,MAAwB;IAClCyE,OAAM/E,cAAAA,OAAAA,SAAAA,WAAa,CAAA,OAAO,MAAOA,aAAqBF;EACxD,CAAA,KAAMqD,WAENE,gBAAgBpE,iBAAiB;IACrCqB,MAAM8C;IACNvD;EACF,CAAA,GAEM,CAACmF,YAAYC,eAAAA,IAAmB;IAACV;IAAMC;IAAWU,IAAI7B,aAAAA,GACtD8B,YAAYV,SAASlF,iBAAiB6D,QAAAA,IAAYuB,YAClDS,WAAWP,aACb;IAACX,QAAQhB;MACT7D,mBACE0E,MACA;IACEb,UAAUgB,QAAQhB;IAClBlD;IACAC;IACAgE;IACA9D;IACAD;IACAE;IACAL;IACAM;EACF,GACA0D,SAASnB,cAAcwB,YAAYnD,aAAa,KAC5C;IACEA,UAAUwB,QAAQC,IAAIC,qBAAqB;IAC3CrC;EACF,IACAR,MAAAA,GAGJuF,QAAQ7F,eAAe;;IAE3BiF,OAAOU;IACPT;IACAY,YAAY;IACZV;IACAW,WACEnB,YAAY9C,kBAAkB,YAC9B8C,YAAY9C,kBAAkB,mBAC1B,aACA;;;IAGN4B,UAAU;MAAC8B;SAAeI;MAAUH;;EACtC,CAAA,GAEMhC,QAAQ;IACZ3C;IACA,GAAI4D,QAAQ7B,YAAY;;MAEtBtB,WAAWjB;;MAEX+B,mBAAmB;QACjBD,aAAa;MACf;IACF;;IAEAhB,KACEA,QACCuD,WACG;;;MAGAC,YAAYoB,sBAAsB,UAAUpB,YAAYtD,SAAS,SAC/D,MACA;;IAER,GAAGgE;IAEH5B,UACE,qBAAChE,qBAAqBuG,UAAQ;MAACC,OAAO;gBAAOL;;;IAG/CM,kBAAkB;EACpB;AAEA,SAAO;IACLR;IACAhB;IACAlB;EACF;AACF;",
|
|
5
|
+
"names": ["getFontSize", "getButtonSized", "withStaticProperties", "useGetThemedIcon", "ButtonNestingContext", "ThemeableStack", "SizableText", "wrapChildrenInText", "createStyledContext", "getVariableValue", "spacedChildren", "styled", "useProps", "useContext", "ButtonContext", "color", "undefined", "ellipse", "fontFamily", "fontSize", "fontStyle", "fontWeight", "letterSpacing", "maxFontSizeMultiplier", "size", "textAlign", "variant", "BUTTON_NAME", "ButtonFrame", "name", "tag", "context", "role", "focusable", "variants", "unstyled", "false", "justifyContent", "alignItems", "flexWrap", "flexDirection", "cursor", "hoverTheme", "pressTheme", "backgrounded", "borderWidth", "borderColor", "focusVisibleStyle", "outlineColor", "outlineStyle", "outlineWidth", "outlined", "backgroundColor", "hoverStyle", "pressStyle", "disabled", "true", "pointerEvents", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "ButtonText", "userSelect", "flexGrow", "flexShrink", "ButtonIcon", "props", "children", "scaleIcon", "iconSize", "getThemedIcon", "ButtonComponent", "styleable", "ref", "buttonProps", "useButton", "buttonStaticConfig", "inlineProps", "Set", "Button", "Text", "Icon", "textProps", "propsIn", "isNested", "propsActive", "noNormalize", "noExpand", "icon", "iconAfter", "space", "spaceFlex", "scaleSpace", "separator", "noTextWrap", "restProps", "font", "themedIcon", "themedIconAfter", "map", "spaceSize", "contents", "inner", "ensureKeys", "direction", "accessibilityRole", "Provider", "value", "disableClassName"]
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/button/src/Button.test.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAASA,+BAA+B;AACxC,SAASC,qBAAqB;AAC9B,SAASC,UAAUC,QAAQC,YAAY;AAEvC,IAAMC,OAAOJ,cAAcD,wBAAAA,CAAAA;AAE3BE,SAAS,UAAU,WAAA;AACjBE,
|
|
4
|
+
"mappings": "AAAA,SAASA,+BAA+B;AACxC,SAASC,qBAAqB;AAC9B,SAASC,UAAUC,QAAQC,YAAY;AAEvC,IAAMC,OAAOJ,cAAcD,wBAAAA,CAAAA;AAE3BE,SAAS,UAAU,WAAA;AACjBE,OAAK,OAAO,WAAA;AACVD,WAAO,EAAA,EAAMG,WAAU;EACzB,CAAA;AAWF,CAAA;",
|
|
5
5
|
"names": ["getDefaultTamaguiConfig", "createTamagui", "describe", "expect", "test", "conf", "toBeTruthy"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/button",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.111.1",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tamagui/font-size": "1.
|
|
37
|
-
"@tamagui/get-button-sized": "1.
|
|
38
|
-
"@tamagui/helpers": "1.
|
|
39
|
-
"@tamagui/helpers-tamagui": "1.
|
|
40
|
-
"@tamagui/stacks": "1.
|
|
41
|
-
"@tamagui/text": "1.
|
|
42
|
-
"@tamagui/web": "1.
|
|
36
|
+
"@tamagui/font-size": "1.111.1",
|
|
37
|
+
"@tamagui/get-button-sized": "1.111.1",
|
|
38
|
+
"@tamagui/helpers": "1.111.1",
|
|
39
|
+
"@tamagui/helpers-tamagui": "1.111.1",
|
|
40
|
+
"@tamagui/stacks": "1.111.1",
|
|
41
|
+
"@tamagui/text": "1.111.1",
|
|
42
|
+
"@tamagui/web": "1.111.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@tamagui/build": "1.
|
|
45
|
+
"@tamagui/build": "1.111.1",
|
|
46
46
|
"react": "^18.2.0 || ^19.0.0",
|
|
47
47
|
"vitest": "0.34.3"
|
|
48
48
|
},
|