@tamagui/button 1.143.0 → 2.0.0-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.cjs +126 -158
- package/dist/cjs/Button.js +102 -120
- package/dist/cjs/Button.js.map +2 -2
- package/dist/cjs/Button.native.js +128 -160
- package/dist/cjs/Button.native.js.map +1 -1
- package/dist/esm/Button.js +108 -126
- package/dist/esm/Button.js.map +2 -2
- package/dist/esm/Button.mjs +127 -155
- package/dist/esm/Button.mjs.map +1 -1
- package/dist/esm/Button.native.js +130 -158
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/jsx/Button.js +108 -126
- package/dist/jsx/Button.js.map +2 -2
- package/dist/jsx/Button.mjs +127 -155
- package/dist/jsx/Button.mjs.map +1 -1
- package/dist/jsx/Button.native.js +128 -160
- package/dist/jsx/Button.native.js.map +1 -1
- package/package.json +12 -11
- package/src/Button.tsx +172 -243
- package/src/v1/Button.test.tsx +21 -0
- package/src/v1/Button.tsx +336 -0
- package/src/v1/index.ts +1 -0
- package/types/Button.d.ts +80 -323
- package/types/Button.d.ts.map +1 -1
- package/types/v1/Button.d.ts +338 -0
- package/types/v1/Button.test.d.ts +2 -0
- package/types/v1/index.d.ts +2 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import type { TextContextStyles, TextParentStyles } from '@tamagui/text';
|
|
2
|
+
import type { FontSizeTokens, GetProps, SizeTokens, ThemeableProps } from '@tamagui/web';
|
|
3
|
+
import type { FunctionComponent, JSX } from 'react';
|
|
4
|
+
type ButtonVariant = 'outlined';
|
|
5
|
+
export declare const ButtonContext: import("@tamagui/web").StyledContext<Partial<TextContextStyles & {
|
|
6
|
+
size: SizeTokens;
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
}>>;
|
|
9
|
+
type ButtonIconProps = {
|
|
10
|
+
color?: any;
|
|
11
|
+
size?: any;
|
|
12
|
+
};
|
|
13
|
+
type IconProp = JSX.Element | FunctionComponent<ButtonIconProps> | ((props: ButtonIconProps) => any) | null;
|
|
14
|
+
type ButtonExtraProps = TextParentStyles & ThemeableProps & {
|
|
15
|
+
/**
|
|
16
|
+
* add icon before, passes color and size automatically if Component
|
|
17
|
+
*/
|
|
18
|
+
icon?: IconProp;
|
|
19
|
+
/**
|
|
20
|
+
* add icon after, passes color and size automatically if Component
|
|
21
|
+
*/
|
|
22
|
+
iconAfter?: IconProp;
|
|
23
|
+
/**
|
|
24
|
+
* adjust icon relative to size
|
|
25
|
+
*
|
|
26
|
+
* @default 1
|
|
27
|
+
*/
|
|
28
|
+
scaleIcon?: number;
|
|
29
|
+
/**
|
|
30
|
+
* make the spacing elements flex
|
|
31
|
+
*/
|
|
32
|
+
spaceFlex?: number | boolean;
|
|
33
|
+
/**
|
|
34
|
+
* adjust internal space relative to icon size
|
|
35
|
+
*/
|
|
36
|
+
scaleSpace?: number;
|
|
37
|
+
/**
|
|
38
|
+
* remove default styles
|
|
39
|
+
*/
|
|
40
|
+
unstyled?: boolean;
|
|
41
|
+
};
|
|
42
|
+
type ButtonProps = ButtonExtraProps & GetProps<typeof ButtonFrame>;
|
|
43
|
+
declare const ButtonFrame: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
44
|
+
size?: number | SizeTokens | undefined;
|
|
45
|
+
variant?: "outlined" | undefined;
|
|
46
|
+
elevation?: number | SizeTokens | undefined;
|
|
47
|
+
circular?: boolean | undefined;
|
|
48
|
+
chromeless?: boolean | "all" | undefined;
|
|
49
|
+
bordered?: number | boolean | undefined;
|
|
50
|
+
transparent?: boolean | undefined;
|
|
51
|
+
disabled?: boolean | undefined;
|
|
52
|
+
unstyled?: boolean | undefined;
|
|
53
|
+
fullscreen?: boolean | undefined;
|
|
54
|
+
backgrounded?: boolean | undefined;
|
|
55
|
+
radiused?: boolean | undefined;
|
|
56
|
+
hoverTheme?: boolean | undefined;
|
|
57
|
+
pressTheme?: boolean | undefined;
|
|
58
|
+
focusTheme?: boolean | undefined;
|
|
59
|
+
padded?: boolean | undefined;
|
|
60
|
+
elevate?: boolean | undefined;
|
|
61
|
+
}, import("@tamagui/web").StaticConfigPublic>;
|
|
62
|
+
declare const ButtonText: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
|
|
63
|
+
size?: FontSizeTokens | undefined;
|
|
64
|
+
unstyled?: boolean | undefined;
|
|
65
|
+
}, import("@tamagui/web").StaticConfigPublic>;
|
|
66
|
+
declare const ButtonIcon: (props: {
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
scaleIcon?: number;
|
|
69
|
+
}) => any;
|
|
70
|
+
/**
|
|
71
|
+
* @summary A Button is a clickable element that can be used to trigger actions such as submitting forms, navigating to other pages, or performing other actions.
|
|
72
|
+
* @see — Docs https://tamagui.dev/ui/button
|
|
73
|
+
*/
|
|
74
|
+
declare const Button: import("react").ForwardRefExoticComponent<Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
75
|
+
size?: number | SizeTokens | undefined;
|
|
76
|
+
variant?: "outlined" | undefined;
|
|
77
|
+
elevation?: number | SizeTokens | undefined;
|
|
78
|
+
circular?: boolean | undefined;
|
|
79
|
+
chromeless?: boolean | "all" | undefined;
|
|
80
|
+
bordered?: number | boolean | undefined;
|
|
81
|
+
transparent?: boolean | undefined;
|
|
82
|
+
disabled?: boolean | undefined;
|
|
83
|
+
unstyled?: boolean | undefined;
|
|
84
|
+
fullscreen?: boolean | undefined;
|
|
85
|
+
backgrounded?: boolean | undefined;
|
|
86
|
+
radiused?: boolean | undefined;
|
|
87
|
+
hoverTheme?: boolean | undefined;
|
|
88
|
+
pressTheme?: boolean | undefined;
|
|
89
|
+
focusTheme?: boolean | undefined;
|
|
90
|
+
padded?: boolean | undefined;
|
|
91
|
+
elevate?: boolean | undefined;
|
|
92
|
+
}>, "unstyled" | "icon" | "iconAfter" | "scaleIcon" | "noTextWrap" | keyof TextContextStyles | "textProps" | keyof ThemeableProps | "spaceFlex" | "scaleSpace"> & TextContextStyles & {
|
|
93
|
+
textProps?: Partial<import("@tamagui/text").SizableTextProps>;
|
|
94
|
+
noTextWrap?: boolean;
|
|
95
|
+
} & ThemeableProps & {
|
|
96
|
+
/**
|
|
97
|
+
* add icon before, passes color and size automatically if Component
|
|
98
|
+
*/
|
|
99
|
+
icon?: IconProp;
|
|
100
|
+
/**
|
|
101
|
+
* add icon after, passes color and size automatically if Component
|
|
102
|
+
*/
|
|
103
|
+
iconAfter?: IconProp;
|
|
104
|
+
/**
|
|
105
|
+
* adjust icon relative to size
|
|
106
|
+
*
|
|
107
|
+
* @default 1
|
|
108
|
+
*/
|
|
109
|
+
scaleIcon?: number;
|
|
110
|
+
/**
|
|
111
|
+
* make the spacing elements flex
|
|
112
|
+
*/
|
|
113
|
+
spaceFlex?: number | boolean;
|
|
114
|
+
/**
|
|
115
|
+
* adjust internal space relative to icon size
|
|
116
|
+
*/
|
|
117
|
+
scaleSpace?: number;
|
|
118
|
+
/**
|
|
119
|
+
* remove default styles
|
|
120
|
+
*/
|
|
121
|
+
unstyled?: boolean;
|
|
122
|
+
} & import("react").RefAttributes<import("@tamagui/web").TamaguiElement>> & import("@tamagui/web").StaticComponentObject<Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
123
|
+
size?: number | SizeTokens | undefined;
|
|
124
|
+
variant?: "outlined" | undefined;
|
|
125
|
+
elevation?: number | SizeTokens | undefined;
|
|
126
|
+
circular?: boolean | undefined;
|
|
127
|
+
chromeless?: boolean | "all" | undefined;
|
|
128
|
+
bordered?: number | boolean | undefined;
|
|
129
|
+
transparent?: boolean | undefined;
|
|
130
|
+
disabled?: boolean | undefined;
|
|
131
|
+
unstyled?: boolean | undefined;
|
|
132
|
+
fullscreen?: boolean | undefined;
|
|
133
|
+
backgrounded?: boolean | undefined;
|
|
134
|
+
radiused?: boolean | undefined;
|
|
135
|
+
hoverTheme?: boolean | undefined;
|
|
136
|
+
pressTheme?: boolean | undefined;
|
|
137
|
+
focusTheme?: boolean | undefined;
|
|
138
|
+
padded?: boolean | undefined;
|
|
139
|
+
elevate?: boolean | undefined;
|
|
140
|
+
}>, "unstyled" | "icon" | "iconAfter" | "scaleIcon" | "noTextWrap" | keyof TextContextStyles | "textProps" | keyof ThemeableProps | "spaceFlex" | "scaleSpace"> & TextContextStyles & {
|
|
141
|
+
textProps?: Partial<import("@tamagui/text").SizableTextProps>;
|
|
142
|
+
noTextWrap?: boolean;
|
|
143
|
+
} & ThemeableProps & {
|
|
144
|
+
/**
|
|
145
|
+
* add icon before, passes color and size automatically if Component
|
|
146
|
+
*/
|
|
147
|
+
icon?: IconProp;
|
|
148
|
+
/**
|
|
149
|
+
* add icon after, passes color and size automatically if Component
|
|
150
|
+
*/
|
|
151
|
+
iconAfter?: IconProp;
|
|
152
|
+
/**
|
|
153
|
+
* adjust icon relative to size
|
|
154
|
+
*
|
|
155
|
+
* @default 1
|
|
156
|
+
*/
|
|
157
|
+
scaleIcon?: number;
|
|
158
|
+
/**
|
|
159
|
+
* make the spacing elements flex
|
|
160
|
+
*/
|
|
161
|
+
spaceFlex?: number | boolean;
|
|
162
|
+
/**
|
|
163
|
+
* adjust internal space relative to icon size
|
|
164
|
+
*/
|
|
165
|
+
scaleSpace?: number;
|
|
166
|
+
/**
|
|
167
|
+
* remove default styles
|
|
168
|
+
*/
|
|
169
|
+
unstyled?: boolean;
|
|
170
|
+
}, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & TextContextStyles & {
|
|
171
|
+
textProps?: Partial<import("@tamagui/text").SizableTextProps>;
|
|
172
|
+
noTextWrap?: boolean;
|
|
173
|
+
} & ThemeableProps & {
|
|
174
|
+
/**
|
|
175
|
+
* add icon before, passes color and size automatically if Component
|
|
176
|
+
*/
|
|
177
|
+
icon?: IconProp;
|
|
178
|
+
/**
|
|
179
|
+
* add icon after, passes color and size automatically if Component
|
|
180
|
+
*/
|
|
181
|
+
iconAfter?: IconProp;
|
|
182
|
+
/**
|
|
183
|
+
* adjust icon relative to size
|
|
184
|
+
*
|
|
185
|
+
* @default 1
|
|
186
|
+
*/
|
|
187
|
+
scaleIcon?: number;
|
|
188
|
+
/**
|
|
189
|
+
* make the spacing elements flex
|
|
190
|
+
*/
|
|
191
|
+
spaceFlex?: number | boolean;
|
|
192
|
+
/**
|
|
193
|
+
* adjust internal space relative to icon size
|
|
194
|
+
*/
|
|
195
|
+
scaleSpace?: number;
|
|
196
|
+
/**
|
|
197
|
+
* remove default styles
|
|
198
|
+
*/
|
|
199
|
+
unstyled?: boolean;
|
|
200
|
+
}, import("@tamagui/web").StackStyleBase, {
|
|
201
|
+
size?: number | SizeTokens | undefined;
|
|
202
|
+
variant?: "outlined" | undefined;
|
|
203
|
+
elevation?: number | SizeTokens | undefined;
|
|
204
|
+
circular?: boolean | undefined;
|
|
205
|
+
chromeless?: boolean | "all" | undefined;
|
|
206
|
+
bordered?: number | boolean | undefined;
|
|
207
|
+
transparent?: boolean | undefined;
|
|
208
|
+
disabled?: boolean | undefined;
|
|
209
|
+
unstyled?: boolean | undefined;
|
|
210
|
+
fullscreen?: boolean | undefined;
|
|
211
|
+
backgrounded?: boolean | undefined;
|
|
212
|
+
radiused?: boolean | undefined;
|
|
213
|
+
hoverTheme?: boolean | undefined;
|
|
214
|
+
pressTheme?: boolean | undefined;
|
|
215
|
+
focusTheme?: boolean | undefined;
|
|
216
|
+
padded?: boolean | undefined;
|
|
217
|
+
elevate?: boolean | undefined;
|
|
218
|
+
}, import("@tamagui/web").StaticConfigPublic> & Omit<import("@tamagui/web").StaticConfigPublic, "staticConfig" | "styleable"> & {
|
|
219
|
+
__tama: [Omit<import("@tamagui/web").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/web").StackStyleBase, {
|
|
220
|
+
size?: number | SizeTokens | undefined;
|
|
221
|
+
variant?: "outlined" | undefined;
|
|
222
|
+
elevation?: number | SizeTokens | undefined;
|
|
223
|
+
circular?: boolean | undefined;
|
|
224
|
+
chromeless?: boolean | "all" | undefined;
|
|
225
|
+
bordered?: number | boolean | undefined;
|
|
226
|
+
transparent?: boolean | undefined;
|
|
227
|
+
disabled?: boolean | undefined;
|
|
228
|
+
unstyled?: boolean | undefined;
|
|
229
|
+
fullscreen?: boolean | undefined;
|
|
230
|
+
backgrounded?: boolean | undefined;
|
|
231
|
+
radiused?: boolean | undefined;
|
|
232
|
+
hoverTheme?: boolean | undefined;
|
|
233
|
+
pressTheme?: boolean | undefined;
|
|
234
|
+
focusTheme?: boolean | undefined;
|
|
235
|
+
padded?: boolean | undefined;
|
|
236
|
+
elevate?: boolean | undefined;
|
|
237
|
+
}>, "unstyled" | "icon" | "iconAfter" | "scaleIcon" | "noTextWrap" | keyof TextContextStyles | "textProps" | keyof ThemeableProps | "spaceFlex" | "scaleSpace"> & TextContextStyles & {
|
|
238
|
+
textProps?: Partial<import("@tamagui/text").SizableTextProps>;
|
|
239
|
+
noTextWrap?: boolean;
|
|
240
|
+
} & ThemeableProps & {
|
|
241
|
+
/**
|
|
242
|
+
* add icon before, passes color and size automatically if Component
|
|
243
|
+
*/
|
|
244
|
+
icon?: IconProp;
|
|
245
|
+
/**
|
|
246
|
+
* add icon after, passes color and size automatically if Component
|
|
247
|
+
*/
|
|
248
|
+
iconAfter?: IconProp;
|
|
249
|
+
/**
|
|
250
|
+
* adjust icon relative to size
|
|
251
|
+
*
|
|
252
|
+
* @default 1
|
|
253
|
+
*/
|
|
254
|
+
scaleIcon?: number;
|
|
255
|
+
/**
|
|
256
|
+
* make the spacing elements flex
|
|
257
|
+
*/
|
|
258
|
+
spaceFlex?: number | boolean;
|
|
259
|
+
/**
|
|
260
|
+
* adjust internal space relative to icon size
|
|
261
|
+
*/
|
|
262
|
+
scaleSpace?: number;
|
|
263
|
+
/**
|
|
264
|
+
* remove default styles
|
|
265
|
+
*/
|
|
266
|
+
unstyled?: boolean;
|
|
267
|
+
}, import("@tamagui/web").TamaguiElement, import("@tamagui/core").RNTamaguiViewNonStyleProps & TextContextStyles & {
|
|
268
|
+
textProps?: Partial<import("@tamagui/text").SizableTextProps>;
|
|
269
|
+
noTextWrap?: boolean;
|
|
270
|
+
} & ThemeableProps & {
|
|
271
|
+
/**
|
|
272
|
+
* add icon before, passes color and size automatically if Component
|
|
273
|
+
*/
|
|
274
|
+
icon?: IconProp;
|
|
275
|
+
/**
|
|
276
|
+
* add icon after, passes color and size automatically if Component
|
|
277
|
+
*/
|
|
278
|
+
iconAfter?: IconProp;
|
|
279
|
+
/**
|
|
280
|
+
* adjust icon relative to size
|
|
281
|
+
*
|
|
282
|
+
* @default 1
|
|
283
|
+
*/
|
|
284
|
+
scaleIcon?: number;
|
|
285
|
+
/**
|
|
286
|
+
* make the spacing elements flex
|
|
287
|
+
*/
|
|
288
|
+
spaceFlex?: number | boolean;
|
|
289
|
+
/**
|
|
290
|
+
* adjust internal space relative to icon size
|
|
291
|
+
*/
|
|
292
|
+
scaleSpace?: number;
|
|
293
|
+
/**
|
|
294
|
+
* remove default styles
|
|
295
|
+
*/
|
|
296
|
+
unstyled?: boolean;
|
|
297
|
+
}, import("@tamagui/web").StackStyleBase, {
|
|
298
|
+
size?: number | SizeTokens | undefined;
|
|
299
|
+
variant?: "outlined" | undefined;
|
|
300
|
+
elevation?: number | SizeTokens | undefined;
|
|
301
|
+
circular?: boolean | undefined;
|
|
302
|
+
chromeless?: boolean | "all" | undefined;
|
|
303
|
+
bordered?: number | boolean | undefined;
|
|
304
|
+
transparent?: boolean | undefined;
|
|
305
|
+
disabled?: boolean | undefined;
|
|
306
|
+
unstyled?: boolean | undefined;
|
|
307
|
+
fullscreen?: boolean | undefined;
|
|
308
|
+
backgrounded?: boolean | undefined;
|
|
309
|
+
radiused?: boolean | undefined;
|
|
310
|
+
hoverTheme?: boolean | undefined;
|
|
311
|
+
pressTheme?: boolean | undefined;
|
|
312
|
+
focusTheme?: boolean | undefined;
|
|
313
|
+
padded?: boolean | undefined;
|
|
314
|
+
elevate?: boolean | undefined;
|
|
315
|
+
}, import("@tamagui/web").StaticConfigPublic];
|
|
316
|
+
} & {
|
|
317
|
+
Text: import("@tamagui/web").TamaguiComponent<import("@tamagui/web").TamaDefer, import("@tamagui/web").TamaguiTextElement, import("@tamagui/web").TextNonStyleProps, import("@tamagui/web").TextStylePropsBase, {
|
|
318
|
+
size?: FontSizeTokens | undefined;
|
|
319
|
+
unstyled?: boolean | undefined;
|
|
320
|
+
}, import("@tamagui/web").StaticConfigPublic>;
|
|
321
|
+
Icon: (props: {
|
|
322
|
+
children: React.ReactNode;
|
|
323
|
+
scaleIcon?: number;
|
|
324
|
+
}) => any;
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* @deprecated Instead of useButton, see the Button docs for the newer and much improved Advanced customization pattern: https://tamagui.dev/docs/components/button
|
|
328
|
+
*/
|
|
329
|
+
declare function useButton<Props extends ButtonProps>({ textProps, ...propsIn }: Props, { Text }?: {
|
|
330
|
+
Text: any;
|
|
331
|
+
}): {
|
|
332
|
+
spaceSize: number | "unset" | import("@tamagui/web").UnionableString | import("@tamagui/web").Variable<any>;
|
|
333
|
+
isNested: boolean;
|
|
334
|
+
props: Props;
|
|
335
|
+
};
|
|
336
|
+
export { Button, ButtonFrame, ButtonIcon, ButtonText, useButton, };
|
|
337
|
+
export type { ButtonProps };
|
|
338
|
+
//# sourceMappingURL=Button.d.ts.map
|