@tamagui/button 1.0.1-beta.159 → 1.0.1-beta.162

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.
@@ -26,7 +26,9 @@ var Button_exports = {};
26
26
  __export(Button_exports, {
27
27
  Button: () => Button2,
28
28
  ButtonFrame: () => ButtonFrame,
29
- ButtonText: () => ButtonText
29
+ ButtonText: () => ButtonText,
30
+ buttonStaticConfig: () => buttonStaticConfig,
31
+ useButton: () => useButton
30
32
  });
31
33
  module.exports = __toCommonJS(Button_exports);
32
34
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -90,7 +92,7 @@ const ButtonText = (0, import_core.styled)(import_text.SizableText, {
90
92
  flexShrink: 1,
91
93
  ellipse: true
92
94
  });
93
- const ButtonComponent = (0, import_react.forwardRef)(function Button(props, ref) {
95
+ function useButton(props, { Text = ButtonText } = { Text: ButtonText }) {
94
96
  const {
95
97
  children,
96
98
  icon,
@@ -117,7 +119,7 @@ const ButtonComponent = (0, import_react.forwardRef)(function Button(props, ref)
117
119
  const getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({ size: iconSize, color });
118
120
  const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
119
121
  const spaceSize = (0, import_core.getVariableValue)(iconSize) * scaleSpace;
120
- const contents = (0, import_text.wrapChildrenInText)(ButtonText, props);
122
+ const contents = (0, import_text.wrapChildrenInText)(Text, props);
121
123
  const inner = themedIcon || themedIconAfter ? (0, import_core.spacedChildren)({
122
124
  space: spaceSize,
123
125
  spaceFlex,
@@ -125,25 +127,35 @@ const ButtonComponent = (0, import_react.forwardRef)(function Button(props, ref)
125
127
  direction: props.flexDirection === "column" || props.flexDirection === "column-reverse" ? "vertical" : "horizontal",
126
128
  children: [themedIcon, contents, themedIconAfter]
127
129
  }) : contents;
130
+ return {
131
+ spaceSize,
132
+ isInsideButton,
133
+ props: {
134
+ ...props.disabled && {
135
+ focusable: void 0,
136
+ focusStyle: {
137
+ borderColor: "$background"
138
+ }
139
+ },
140
+ ...isInsideButton && {
141
+ tag: "span"
142
+ },
143
+ ...rest,
144
+ children: import_core.isRSC ? inner : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ButtonInsideButtonContext.Provider, {
145
+ value: true,
146
+ children: inner
147
+ })
148
+ }
149
+ };
150
+ }
151
+ const ButtonComponent = (0, import_react.forwardRef)(function Button(props, ref) {
152
+ const { props: buttonProps } = useButton(props);
128
153
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ButtonFrame, {
129
- ...props.disabled && {
130
- focusable: void 0,
131
- focusStyle: {
132
- borderColor: "$background"
133
- }
134
- },
135
- ...isInsideButton && {
136
- tag: "span"
137
- },
138
- ref,
139
- ...rest,
140
- children: import_core.isRSC ? inner : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ButtonInsideButtonContext.Provider, {
141
- value: true,
142
- children: inner
143
- })
154
+ ...buttonProps,
155
+ ref
144
156
  });
145
157
  });
146
- const Button2 = ButtonFrame.extractable((0, import_core.themeable)(ButtonComponent), {
158
+ const buttonStaticConfig = {
147
159
  inlineProps: /* @__PURE__ */ new Set([
148
160
  "color",
149
161
  "fontWeight",
@@ -152,11 +164,14 @@ const Button2 = ButtonFrame.extractable((0, import_core.themeable)(ButtonCompone
152
164
  "letterSpacing",
153
165
  "textAlign"
154
166
  ])
155
- });
167
+ };
168
+ const Button2 = ButtonFrame.extractable((0, import_core.themeable)(ButtonComponent), buttonStaticConfig);
156
169
  // Annotate the CommonJS export names for ESM import in node:
157
170
  0 && (module.exports = {
158
171
  Button,
159
172
  ButtonFrame,
160
- ButtonText
173
+ ButtonText,
174
+ buttonStaticConfig,
175
+ useButton
161
176
  });
162
177
  //# sourceMappingURL=Button.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Button.tsx"],
4
- "sourcesContent": ["import {\n ButtonInsideButtonContext,\n GetProps,\n TamaguiComponent,\n ThemeableProps,\n getButtonSize,\n getVariableValue,\n isRSC,\n spacedChildren,\n styled,\n themeable,\n} from '@tamagui/core'\nimport { getFontSize } from '@tamagui/font-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText, TextParentStyles, wrapChildrenInText } from '@tamagui/text'\nimport React, { FunctionComponent, forwardRef, useContext } from 'react'\nimport { View } from 'react-native'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\ntype ButtonIconProps = { color?: string; size?: number }\ntype IconProp = JSX.Element | FunctionComponent<ButtonIconProps> | null\n\nexport type ButtonProps = Omit<TextParentStyles, 'TextComponent'> &\n GetProps<typeof ButtonFrame> &\n ThemeableProps & {\n // add icon before, passes color and size automatically if Component\n icon?: IconProp\n // add icon after, passes color and size automatically if Component\n iconAfter?: IconProp\n // adjust icon relative to size\n // default: -1\n scaleIcon?: number\n // dont wrap inner contents in a text element\n noTextWrap?: boolean\n // make the spacing elements flex\n spaceFlex?: number | boolean\n // adjust internal space relative to icon size\n scaleSpace?: number\n }\n\nexport const ButtonFrame = styled(ThemeableStack, {\n name: 'Button',\n tag: 'button',\n focusable: true,\n hoverTheme: true,\n pressTheme: true,\n backgrounded: true,\n borderWidth: 1,\n borderColor: 'transparent',\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n\n // if we wanted this only when pressable = true, we'd need to merge variants?\n cursor: 'pointer',\n\n pressStyle: {\n borderColor: 'transparent',\n },\n\n hoverStyle: {\n borderColor: 'transparent',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': getButtonSize,\n },\n\n active: {\n true: {\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n disabled: {\n true: {\n opacity: 0.375,\n pointerEvents: 'none',\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$4',\n },\n})\n\n// see TODO breaking types\n// type x = GetProps<typeof ButtonFrame>\n// type y = x['size']\n\nexport const ButtonText = styled(SizableText, {\n color: '$color',\n selectable: false,\n cursor: 'inherit',\n // flexGrow 1 leads to inconsistent native style where text pushes to start of view\n flexGrow: 0,\n flexShrink: 1,\n ellipse: true,\n})\n\nconst ButtonComponent = forwardRef(function Button(props: ButtonProps, ref) {\n // careful not to desctructure and re-order props, order is important\n const {\n children,\n icon,\n iconAfter,\n noTextWrap,\n theme: themeName,\n space,\n spaceFlex,\n scaleIcon = 1,\n scaleSpace = 0.66,\n separator,\n\n // text props\n color,\n fontWeight,\n letterSpacing,\n fontSize,\n fontFamily,\n textAlign,\n textProps,\n ...rest\n } = props as ButtonProps\n\n const isInsideButton = isRSC ? false : useContext(ButtonInsideButtonContext)\n const size = props.size || '$4'\n const iconSize = (typeof size === 'number' ? size * 0.5 : getFontSize(size)) * scaleIcon\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color })\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon)\n const spaceSize = getVariableValue(iconSize) * scaleSpace\n const contents = wrapChildrenInText(ButtonText, props)\n\n const inner =\n themedIcon || themedIconAfter\n ? spacedChildren({\n // a bit arbitrary but scaling to font size is necessary so long as button does\n space: spaceSize,\n spaceFlex,\n separator,\n direction:\n props.flexDirection === 'column' || props.flexDirection === 'column-reverse'\n ? 'vertical'\n : 'horizontal',\n children: [themedIcon, contents, themedIconAfter],\n })\n : contents\n\n return (\n <ButtonFrame\n {...(props.disabled && {\n // in rnw - false still has keyboard tabIndex, undefined = not actually focusable\n focusable: undefined,\n // even with tabIndex unset, it will keep focusStyle on web so disable it here\n focusStyle: {\n borderColor: '$background',\n },\n })}\n // fixes SSR issue + DOM nesting issue of not allowing button in button\n {...(isInsideButton && {\n tag: 'span',\n })}\n ref={ref as any}\n {...rest}\n >\n {isRSC ? (\n inner\n ) : (\n <ButtonInsideButtonContext.Provider value={true}>\n {inner}\n </ButtonInsideButtonContext.Provider>\n )}\n </ButtonFrame>\n )\n})\n\nexport const Button: TamaguiComponent<ButtonProps, HTMLButtonElement | View> =\n ButtonFrame.extractable(themeable(ButtonComponent as any) as any, {\n inlineProps: new Set([\n // text props go here (can't really optimize them, but we never fully extract button anyway)\n 'color',\n 'fontWeight',\n 'fontSize',\n 'fontFamily',\n 'letterSpacing',\n 'textAlign',\n ]),\n })\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAoLQ;AApLR,kBAWO;AACP,uBAA4B;AAC5B,6BAAiC;AACjC,oBAA+B;AAC/B,kBAAkE;AAClE,mBAAiE;AAIjE,aAAAC,QAAM;AAuBC,MAAM,kBAAc,oBAAO,8BAAgB;AAAA,EAChD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,eAAe;AAAA,EAGf,QAAQ;AAAA,EAER,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,QACJ,YAAY;AAAA,UACV,iBAAiB;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAAA,IAEA,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,EACF;AAAA,EAEA,iBAAiB;AAAA,IACf,MAAM;AAAA,EACR;AACF,CAAC;AAMM,MAAM,iBAAa,oBAAO,yBAAa;AAAA,EAC5C,OAAO;AAAA,EACP,YAAY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C;AAAA,KACH;AAAA,GAEJ;AAEJ,CAAC;AAEM,MAAMD,UACX,YAAY,gBAAY,uBAAU,eAAsB,GAAU;AAAA,EAChE,aAAa,oBAAI,IAAI;AAAA,IAEnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["import {\n ButtonInsideButtonContext,\n GetProps,\n TamaguiElement,\n ThemeableProps,\n getButtonSize,\n getVariableValue,\n isRSC,\n spacedChildren,\n styled,\n themeable,\n} from '@tamagui/core'\nimport { getFontSize } from '@tamagui/font-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText, TextParentStyles, wrapChildrenInText } from '@tamagui/text'\nimport React, { FunctionComponent, forwardRef, useContext } from 'react'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\ntype ButtonIconProps = { color?: string; size?: number }\ntype IconProp = JSX.Element | FunctionComponent<ButtonIconProps> | null\n\nexport type ButtonProps = Omit<TextParentStyles, 'TextComponent'> &\n GetProps<typeof ButtonFrame> &\n ThemeableProps & {\n // add icon before, passes color and size automatically if Component\n icon?: IconProp\n // add icon after, passes color and size automatically if Component\n iconAfter?: IconProp\n // adjust icon relative to size\n // default: -1\n scaleIcon?: number\n // dont wrap inner contents in a text element\n noTextWrap?: boolean\n // make the spacing elements flex\n spaceFlex?: number | boolean\n // adjust internal space relative to icon size\n scaleSpace?: number\n }\n\nexport const ButtonFrame = styled(ThemeableStack, {\n name: 'Button',\n tag: 'button',\n focusable: true,\n hoverTheme: true,\n pressTheme: true,\n backgrounded: true,\n borderWidth: 1,\n borderColor: 'transparent',\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n\n // if we wanted this only when pressable = true, we'd need to merge variants?\n cursor: 'pointer',\n\n pressStyle: {\n borderColor: 'transparent',\n },\n\n hoverStyle: {\n borderColor: 'transparent',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': getButtonSize,\n },\n\n active: {\n true: {\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n disabled: {\n true: {\n opacity: 0.375,\n pointerEvents: 'none',\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$4',\n },\n})\n\n// see TODO breaking types\n// type x = GetProps<typeof ButtonFrame>\n// type y = x['size']\n\nexport const ButtonText = styled(SizableText, {\n color: '$color',\n selectable: false,\n cursor: 'inherit',\n // flexGrow 1 leads to inconsistent native style where text pushes to start of view\n flexGrow: 0,\n flexShrink: 1,\n ellipse: true,\n})\n\nexport function useButton(\n props: ButtonProps,\n { Text = ButtonText }: { Text: any } = { Text: ButtonText }\n) {\n // careful not to desctructure and re-order props, order is important\n const {\n children,\n icon,\n iconAfter,\n noTextWrap,\n theme: themeName,\n space,\n spaceFlex,\n scaleIcon = 1,\n scaleSpace = 0.66,\n separator,\n\n // text props\n color,\n fontWeight,\n letterSpacing,\n fontSize,\n fontFamily,\n textAlign,\n textProps,\n ...rest\n } = props\n\n const isInsideButton = isRSC ? false : useContext(ButtonInsideButtonContext)\n const size = props.size || '$4'\n const iconSize = (typeof size === 'number' ? size * 0.5 : getFontSize(size)) * scaleIcon\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color })\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon)\n const spaceSize = getVariableValue(iconSize) * scaleSpace\n const contents = wrapChildrenInText(Text, props)\n const inner =\n themedIcon || themedIconAfter\n ? spacedChildren({\n // a bit arbitrary but scaling to font size is necessary so long as button does\n space: spaceSize,\n spaceFlex,\n separator,\n direction:\n props.flexDirection === 'column' || props.flexDirection === 'column-reverse'\n ? 'vertical'\n : 'horizontal',\n children: [themedIcon, contents, themedIconAfter],\n })\n : contents\n\n return {\n spaceSize,\n isInsideButton,\n props: {\n ...(props.disabled && {\n // in rnw - false still has keyboard tabIndex, undefined = not actually focusable\n focusable: undefined,\n // even with tabIndex unset, it will keep focusStyle on web so disable it here\n focusStyle: {\n borderColor: '$background',\n },\n }),\n // fixes SSR issue + DOM nesting issue of not allowing button in button\n ...(isInsideButton && {\n tag: 'span',\n }),\n ...rest,\n children: isRSC ? (\n inner\n ) : (\n <ButtonInsideButtonContext.Provider value={true}>\n {inner}\n </ButtonInsideButtonContext.Provider>\n ),\n },\n }\n}\n\nconst ButtonComponent = forwardRef<TamaguiElement, ButtonProps>(function Button(props, ref) {\n const { props: buttonProps } = useButton(props)\n return <ButtonFrame {...buttonProps} ref={ref} />\n})\n\nexport const buttonStaticConfig = {\n inlineProps: new Set([\n // text props go here (can't really optimize them, but we never fully extract button anyway)\n // may be able to remove this entirely, as the compiler / runtime have gotten better\n 'color',\n 'fontWeight',\n 'fontSize',\n 'fontFamily',\n 'letterSpacing',\n 'textAlign',\n ]),\n}\n\nexport const Button = ButtonFrame.extractable(themeable(ButtonComponent), buttonStaticConfig)\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqLQ;AArLR,kBAWO;AACP,uBAA4B;AAC5B,6BAAiC;AACjC,oBAA+B;AAC/B,kBAAkE;AAClE,mBAAiE;AAGjE,aAAAC,QAAM;AAuBC,MAAM,kBAAc,oBAAO,8BAAgB;AAAA,EAChD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,eAAe;AAAA,EAGf,QAAQ;AAAA,EAER,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;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AAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,WACE,MAAM,kBAAkB,YAAY,MAAM,kBAAkB,mBACxD,aACA;AAAA,IACN,UAAU,CAAC,YAAY,UAAU,eAAe;AAAA,EAClD,CAAC,IACD;AAEN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL,GAAI,MAAM,YAAY;AAAA,QAEpB,WAAW;AAAA,QAEX,YAAY;AAAA,UACV,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MAEA,GAAI,kBAAkB;AAAA,QACpB,KAAK;AAAA,MACP;AAAA,MACA,GAAG;AAAA,MACH,UAAU,oBACR,QAEA,4CAAC,sCAA0B,UAA1B;AAAA,QAAmC,OAAO;AAAA,QACxC;AAAA,OACH;AAAA,IAEJ;AAAA,EACF;AACF;AAEA,MAAM,sBAAkB,yBAAwC,SAAS,OAAO,OAAO,KAAK;AAC1F,QAAM,EAAE,OAAO,YAAY,IAAI,UAAU,KAAK;AAC9C,SAAO,4CAAC;AAAA,IAAa,GAAG;AAAA,IAAa;AAAA,GAAU;AACjD,CAAC;AAEM,MAAM,qBAAqB;AAAA,EAChC,aAAa,oBAAI,IAAI;AAAA,IAGnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEO,MAAMD,UAAS,YAAY,gBAAY,uBAAU,eAAe,GAAG,kBAAkB;",
6
6
  "names": ["Button", "React"]
7
7
  }
@@ -67,7 +67,7 @@ const ButtonText = styled(SizableText, {
67
67
  flexShrink: 1,
68
68
  ellipse: true
69
69
  });
70
- const ButtonComponent = forwardRef(function Button(props, ref) {
70
+ function useButton(props, { Text = ButtonText } = { Text: ButtonText }) {
71
71
  const {
72
72
  children,
73
73
  icon,
@@ -94,7 +94,7 @@ const ButtonComponent = forwardRef(function Button(props, ref) {
94
94
  const getThemedIcon = useGetThemedIcon({ size: iconSize, color });
95
95
  const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
96
96
  const spaceSize = getVariableValue(iconSize) * scaleSpace;
97
- const contents = wrapChildrenInText(ButtonText, props);
97
+ const contents = wrapChildrenInText(Text, props);
98
98
  const inner = themedIcon || themedIconAfter ? spacedChildren({
99
99
  space: spaceSize,
100
100
  spaceFlex,
@@ -102,25 +102,35 @@ const ButtonComponent = forwardRef(function Button(props, ref) {
102
102
  direction: props.flexDirection === "column" || props.flexDirection === "column-reverse" ? "vertical" : "horizontal",
103
103
  children: [themedIcon, contents, themedIconAfter]
104
104
  }) : contents;
105
+ return {
106
+ spaceSize,
107
+ isInsideButton,
108
+ props: {
109
+ ...props.disabled && {
110
+ focusable: void 0,
111
+ focusStyle: {
112
+ borderColor: "$background"
113
+ }
114
+ },
115
+ ...isInsideButton && {
116
+ tag: "span"
117
+ },
118
+ ...rest,
119
+ children: isRSC ? inner : /* @__PURE__ */ jsx(ButtonInsideButtonContext.Provider, {
120
+ value: true,
121
+ children: inner
122
+ })
123
+ }
124
+ };
125
+ }
126
+ const ButtonComponent = forwardRef(function Button(props, ref) {
127
+ const { props: buttonProps } = useButton(props);
105
128
  return /* @__PURE__ */ jsx(ButtonFrame, {
106
- ...props.disabled && {
107
- focusable: void 0,
108
- focusStyle: {
109
- borderColor: "$background"
110
- }
111
- },
112
- ...isInsideButton && {
113
- tag: "span"
114
- },
115
- ref,
116
- ...rest,
117
- children: isRSC ? inner : /* @__PURE__ */ jsx(ButtonInsideButtonContext.Provider, {
118
- value: true,
119
- children: inner
120
- })
129
+ ...buttonProps,
130
+ ref
121
131
  });
122
132
  });
123
- const Button2 = ButtonFrame.extractable(themeable(ButtonComponent), {
133
+ const buttonStaticConfig = {
124
134
  inlineProps: /* @__PURE__ */ new Set([
125
135
  "color",
126
136
  "fontWeight",
@@ -129,10 +139,13 @@ const Button2 = ButtonFrame.extractable(themeable(ButtonComponent), {
129
139
  "letterSpacing",
130
140
  "textAlign"
131
141
  ])
132
- });
142
+ };
143
+ const Button2 = ButtonFrame.extractable(themeable(ButtonComponent), buttonStaticConfig);
133
144
  export {
134
145
  Button2 as Button,
135
146
  ButtonFrame,
136
- ButtonText
147
+ ButtonText,
148
+ buttonStaticConfig,
149
+ useButton
137
150
  };
138
151
  //# sourceMappingURL=Button.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Button.tsx"],
4
- "sourcesContent": ["import {\n ButtonInsideButtonContext,\n GetProps,\n TamaguiComponent,\n ThemeableProps,\n getButtonSize,\n getVariableValue,\n isRSC,\n spacedChildren,\n styled,\n themeable,\n} from '@tamagui/core'\nimport { getFontSize } from '@tamagui/font-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText, TextParentStyles, wrapChildrenInText } from '@tamagui/text'\nimport React, { FunctionComponent, forwardRef, useContext } from 'react'\nimport { View } from 'react-native'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\ntype ButtonIconProps = { color?: string; size?: number }\ntype IconProp = JSX.Element | FunctionComponent<ButtonIconProps> | null\n\nexport type ButtonProps = Omit<TextParentStyles, 'TextComponent'> &\n GetProps<typeof ButtonFrame> &\n ThemeableProps & {\n // add icon before, passes color and size automatically if Component\n icon?: IconProp\n // add icon after, passes color and size automatically if Component\n iconAfter?: IconProp\n // adjust icon relative to size\n // default: -1\n scaleIcon?: number\n // dont wrap inner contents in a text element\n noTextWrap?: boolean\n // make the spacing elements flex\n spaceFlex?: number | boolean\n // adjust internal space relative to icon size\n scaleSpace?: number\n }\n\nexport const ButtonFrame = styled(ThemeableStack, {\n name: 'Button',\n tag: 'button',\n focusable: true,\n hoverTheme: true,\n pressTheme: true,\n backgrounded: true,\n borderWidth: 1,\n borderColor: 'transparent',\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n\n // if we wanted this only when pressable = true, we'd need to merge variants?\n cursor: 'pointer',\n\n pressStyle: {\n borderColor: 'transparent',\n },\n\n hoverStyle: {\n borderColor: 'transparent',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': getButtonSize,\n },\n\n active: {\n true: {\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n disabled: {\n true: {\n opacity: 0.375,\n pointerEvents: 'none',\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$4',\n },\n})\n\n// see TODO breaking types\n// type x = GetProps<typeof ButtonFrame>\n// type y = x['size']\n\nexport const ButtonText = styled(SizableText, {\n color: '$color',\n selectable: false,\n cursor: 'inherit',\n // flexGrow 1 leads to inconsistent native style where text pushes to start of view\n flexGrow: 0,\n flexShrink: 1,\n ellipse: true,\n})\n\nconst ButtonComponent = forwardRef(function Button(props: ButtonProps, ref) {\n // careful not to desctructure and re-order props, order is important\n const {\n children,\n icon,\n iconAfter,\n noTextWrap,\n theme: themeName,\n space,\n spaceFlex,\n scaleIcon = 1,\n scaleSpace = 0.66,\n separator,\n\n // text props\n color,\n fontWeight,\n letterSpacing,\n fontSize,\n fontFamily,\n textAlign,\n textProps,\n ...rest\n } = props as ButtonProps\n\n const isInsideButton = isRSC ? false : useContext(ButtonInsideButtonContext)\n const size = props.size || '$4'\n const iconSize = (typeof size === 'number' ? size * 0.5 : getFontSize(size)) * scaleIcon\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color })\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon)\n const spaceSize = getVariableValue(iconSize) * scaleSpace\n const contents = wrapChildrenInText(ButtonText, props)\n\n const inner =\n themedIcon || themedIconAfter\n ? spacedChildren({\n // a bit arbitrary but scaling to font size is necessary so long as button does\n space: spaceSize,\n spaceFlex,\n separator,\n direction:\n props.flexDirection === 'column' || props.flexDirection === 'column-reverse'\n ? 'vertical'\n : 'horizontal',\n children: [themedIcon, contents, themedIconAfter],\n })\n : contents\n\n return (\n <ButtonFrame\n {...(props.disabled && {\n // in rnw - false still has keyboard tabIndex, undefined = not actually focusable\n focusable: undefined,\n // even with tabIndex unset, it will keep focusStyle on web so disable it here\n focusStyle: {\n borderColor: '$background',\n },\n })}\n // fixes SSR issue + DOM nesting issue of not allowing button in button\n {...(isInsideButton && {\n tag: 'span',\n })}\n ref={ref as any}\n {...rest}\n >\n {isRSC ? (\n inner\n ) : (\n <ButtonInsideButtonContext.Provider value={true}>\n {inner}\n </ButtonInsideButtonContext.Provider>\n )}\n </ButtonFrame>\n )\n})\n\nexport const Button: TamaguiComponent<ButtonProps, HTMLButtonElement | View> =\n ButtonFrame.extractable(themeable(ButtonComponent as any) as any, {\n inlineProps: new Set([\n // text props go here (can't really optimize them, but we never fully extract button anyway)\n 'color',\n 'fontWeight',\n 'fontSize',\n 'fontFamily',\n 'letterSpacing',\n 'textAlign',\n ]),\n })\n"],
5
- "mappings": "AAoLQ;AApLR;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,aAA+B,0BAA0B;AAClE,OAAO,SAA4B,YAAY,kBAAkB;AAIjE,MAAM;AAuBC,MAAM,cAAc,OAAO,gBAAgB;AAAA,EAChD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,eAAe;AAAA,EAGf,QAAQ;AAAA,EAER,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,YAAY;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EAEA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,WAAW;AAAA,IACb;AAAA,IAE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Y,UAAU,eAAe;AAAA,EAClD,CAAC,IACD;AAEN,SACE,oBAAC;AAAA,IACE,GAAI,MAAM,YAAY;AAAA,MAErB,WAAW;AAAA,MAEX,YAAY;AAAA,QACV,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEC,GAAI,kBAAkB;AAAA,MACrB,KAAK;AAAA,IACP;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEH,kBACC,QAEA,oBAAC,0BAA0B,UAA1B;AAAA,MAAmC,OAAO;AAAA,MACxC;AAAA,KACH;AAAA,GAEJ;AAEJ,CAAC;AAEM,MAAMA,UACX,YAAY,YAAY,UAAU,eAAsB,GAAU;AAAA,EAChE,aAAa,oBAAI,IAAI;AAAA,IAEnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["import {\n ButtonInsideButtonContext,\n GetProps,\n TamaguiElement,\n ThemeableProps,\n getButtonSize,\n getVariableValue,\n isRSC,\n spacedChildren,\n styled,\n themeable,\n} from '@tamagui/core'\nimport { getFontSize } from '@tamagui/font-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText, TextParentStyles, wrapChildrenInText } from '@tamagui/text'\nimport React, { FunctionComponent, forwardRef, useContext } from 'react'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\ntype ButtonIconProps = { color?: string; size?: number }\ntype IconProp = JSX.Element | FunctionComponent<ButtonIconProps> | null\n\nexport type ButtonProps = Omit<TextParentStyles, 'TextComponent'> &\n GetProps<typeof ButtonFrame> &\n ThemeableProps & {\n // add icon before, passes color and size automatically if Component\n icon?: IconProp\n // add icon after, passes color and size automatically if Component\n iconAfter?: IconProp\n // adjust icon relative to size\n // default: -1\n scaleIcon?: number\n // dont wrap inner contents in a text element\n noTextWrap?: boolean\n // make the spacing elements flex\n spaceFlex?: number | boolean\n // adjust internal space relative to icon size\n scaleSpace?: number\n }\n\nexport const ButtonFrame = styled(ThemeableStack, {\n name: 'Button',\n tag: 'button',\n focusable: true,\n hoverTheme: true,\n pressTheme: true,\n backgrounded: true,\n borderWidth: 1,\n borderColor: 'transparent',\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n\n // if we wanted this only when pressable = true, we'd need to merge variants?\n cursor: 'pointer',\n\n pressStyle: {\n borderColor: 'transparent',\n },\n\n hoverStyle: {\n borderColor: 'transparent',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': getButtonSize,\n },\n\n active: {\n true: {\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n disabled: {\n true: {\n opacity: 0.375,\n pointerEvents: 'none',\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$4',\n },\n})\n\n// see TODO breaking types\n// type x = GetProps<typeof ButtonFrame>\n// type y = x['size']\n\nexport const ButtonText = styled(SizableText, {\n color: '$color',\n selectable: false,\n cursor: 'inherit',\n // flexGrow 1 leads to inconsistent native style where text pushes to start of view\n flexGrow: 0,\n flexShrink: 1,\n ellipse: true,\n})\n\nexport function useButton(\n props: ButtonProps,\n { Text = ButtonText }: { Text: any } = { Text: ButtonText }\n) {\n // careful not to desctructure and re-order props, order is important\n const {\n children,\n icon,\n iconAfter,\n noTextWrap,\n theme: themeName,\n space,\n spaceFlex,\n scaleIcon = 1,\n scaleSpace = 0.66,\n separator,\n\n // text props\n color,\n fontWeight,\n letterSpacing,\n fontSize,\n fontFamily,\n textAlign,\n textProps,\n ...rest\n } = props\n\n const isInsideButton = isRSC ? false : useContext(ButtonInsideButtonContext)\n const size = props.size || '$4'\n const iconSize = (typeof size === 'number' ? size * 0.5 : getFontSize(size)) * scaleIcon\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color })\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon)\n const spaceSize = getVariableValue(iconSize) * scaleSpace\n const contents = wrapChildrenInText(Text, props)\n const inner =\n themedIcon || themedIconAfter\n ? spacedChildren({\n // a bit arbitrary but scaling to font size is necessary so long as button does\n space: spaceSize,\n spaceFlex,\n separator,\n direction:\n props.flexDirection === 'column' || props.flexDirection === 'column-reverse'\n ? 'vertical'\n : 'horizontal',\n children: [themedIcon, contents, themedIconAfter],\n })\n : contents\n\n return {\n spaceSize,\n isInsideButton,\n props: {\n ...(props.disabled && {\n // in rnw - false still has keyboard tabIndex, undefined = not actually focusable\n focusable: undefined,\n // even with tabIndex unset, it will keep focusStyle on web so disable it here\n focusStyle: {\n borderColor: '$background',\n },\n }),\n // fixes SSR issue + DOM nesting issue of not allowing button in button\n ...(isInsideButton && {\n tag: 'span',\n }),\n ...rest,\n children: isRSC ? (\n inner\n ) : (\n <ButtonInsideButtonContext.Provider value={true}>\n {inner}\n </ButtonInsideButtonContext.Provider>\n ),\n },\n }\n}\n\nconst ButtonComponent = forwardRef<TamaguiElement, ButtonProps>(function Button(props, ref) {\n const { props: buttonProps } = useButton(props)\n return <ButtonFrame {...buttonProps} ref={ref} />\n})\n\nexport const buttonStaticConfig = {\n inlineProps: new Set([\n // text props go here (can't really optimize them, but we never fully extract button anyway)\n // may be able to remove this entirely, as the compiler / runtime have gotten better\n 'color',\n 'fontWeight',\n 'fontSize',\n 'fontFamily',\n 'letterSpacing',\n 'textAlign',\n ]),\n}\n\nexport const Button = ButtonFrame.extractable(themeable(ButtonComponent), buttonStaticConfig)\n"],
5
+ "mappings": "AAqLQ;AArLR;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,aAA+B,0BAA0B;AAClE,OAAO,SAA4B,YAAY,kBAAkB;AAGjE,MAAM;AAuBC,MAAM,cAAc,OAAO,gBAAgB;AAAA,EAChD,MAA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}
@@ -66,7 +66,7 @@ const ButtonText = styled(SizableText, {
66
66
  flexShrink: 1,
67
67
  ellipse: true
68
68
  });
69
- const ButtonComponent = forwardRef(function Button(props, ref) {
69
+ function useButton(props, { Text = ButtonText } = { Text: ButtonText }) {
70
70
  const {
71
71
  children,
72
72
  icon,
@@ -93,7 +93,7 @@ const ButtonComponent = forwardRef(function Button(props, ref) {
93
93
  const getThemedIcon = useGetThemedIcon({ size: iconSize, color });
94
94
  const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon);
95
95
  const spaceSize = getVariableValue(iconSize) * scaleSpace;
96
- const contents = wrapChildrenInText(ButtonText, props);
96
+ const contents = wrapChildrenInText(Text, props);
97
97
  const inner = themedIcon || themedIconAfter ? spacedChildren({
98
98
  space: spaceSize,
99
99
  spaceFlex,
@@ -101,16 +101,29 @@ const ButtonComponent = forwardRef(function Button(props, ref) {
101
101
  direction: props.flexDirection === "column" || props.flexDirection === "column-reverse" ? "vertical" : "horizontal",
102
102
  children: [themedIcon, contents, themedIconAfter]
103
103
  }) : contents;
104
- return <ButtonFrame {...props.disabled && {
105
- focusable: void 0,
106
- focusStyle: {
107
- borderColor: "$background"
104
+ return {
105
+ spaceSize,
106
+ isInsideButton,
107
+ props: {
108
+ ...props.disabled && {
109
+ focusable: void 0,
110
+ focusStyle: {
111
+ borderColor: "$background"
112
+ }
113
+ },
114
+ ...isInsideButton && {
115
+ tag: "span"
116
+ },
117
+ ...rest,
118
+ children: isRSC ? inner : <ButtonInsideButtonContext.Provider value={true}>{inner}</ButtonInsideButtonContext.Provider>
108
119
  }
109
- }} {...isInsideButton && {
110
- tag: "span"
111
- }} ref={ref} {...rest}>{isRSC ? inner : <ButtonInsideButtonContext.Provider value={true}>{inner}</ButtonInsideButtonContext.Provider>}</ButtonFrame>;
120
+ };
121
+ }
122
+ const ButtonComponent = forwardRef(function Button(props, ref) {
123
+ const { props: buttonProps } = useButton(props);
124
+ return <ButtonFrame {...buttonProps} ref={ref} />;
112
125
  });
113
- const Button2 = ButtonFrame.extractable(themeable(ButtonComponent), {
126
+ const buttonStaticConfig = {
114
127
  inlineProps: /* @__PURE__ */ new Set([
115
128
  "color",
116
129
  "fontWeight",
@@ -119,10 +132,13 @@ const Button2 = ButtonFrame.extractable(themeable(ButtonComponent), {
119
132
  "letterSpacing",
120
133
  "textAlign"
121
134
  ])
122
- });
135
+ };
136
+ const Button2 = ButtonFrame.extractable(themeable(ButtonComponent), buttonStaticConfig);
123
137
  export {
124
138
  Button2 as Button,
125
139
  ButtonFrame,
126
- ButtonText
140
+ ButtonText,
141
+ buttonStaticConfig,
142
+ useButton
127
143
  };
128
144
  //# sourceMappingURL=Button.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Button.tsx"],
4
- "sourcesContent": ["import {\n ButtonInsideButtonContext,\n GetProps,\n TamaguiComponent,\n ThemeableProps,\n getButtonSize,\n getVariableValue,\n isRSC,\n spacedChildren,\n styled,\n themeable,\n} from '@tamagui/core'\nimport { getFontSize } from '@tamagui/font-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText, TextParentStyles, wrapChildrenInText } from '@tamagui/text'\nimport React, { FunctionComponent, forwardRef, useContext } from 'react'\nimport { View } from 'react-native'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\ntype ButtonIconProps = { color?: string; size?: number }\ntype IconProp = JSX.Element | FunctionComponent<ButtonIconProps> | null\n\nexport type ButtonProps = Omit<TextParentStyles, 'TextComponent'> &\n GetProps<typeof ButtonFrame> &\n ThemeableProps & {\n // add icon before, passes color and size automatically if Component\n icon?: IconProp\n // add icon after, passes color and size automatically if Component\n iconAfter?: IconProp\n // adjust icon relative to size\n // default: -1\n scaleIcon?: number\n // dont wrap inner contents in a text element\n noTextWrap?: boolean\n // make the spacing elements flex\n spaceFlex?: number | boolean\n // adjust internal space relative to icon size\n scaleSpace?: number\n }\n\nexport const ButtonFrame = styled(ThemeableStack, {\n name: 'Button',\n tag: 'button',\n focusable: true,\n hoverTheme: true,\n pressTheme: true,\n backgrounded: true,\n borderWidth: 1,\n borderColor: 'transparent',\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n\n // if we wanted this only when pressable = true, we'd need to merge variants?\n cursor: 'pointer',\n\n pressStyle: {\n borderColor: 'transparent',\n },\n\n hoverStyle: {\n borderColor: 'transparent',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': getButtonSize,\n },\n\n active: {\n true: {\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n disabled: {\n true: {\n opacity: 0.375,\n pointerEvents: 'none',\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$4',\n },\n})\n\n// see TODO breaking types\n// type x = GetProps<typeof ButtonFrame>\n// type y = x['size']\n\nexport const ButtonText = styled(SizableText, {\n color: '$color',\n selectable: false,\n cursor: 'inherit',\n // flexGrow 1 leads to inconsistent native style where text pushes to start of view\n flexGrow: 0,\n flexShrink: 1,\n ellipse: true,\n})\n\nconst ButtonComponent = forwardRef(function Button(props: ButtonProps, ref) {\n // careful not to desctructure and re-order props, order is important\n const {\n children,\n icon,\n iconAfter,\n noTextWrap,\n theme: themeName,\n space,\n spaceFlex,\n scaleIcon = 1,\n scaleSpace = 0.66,\n separator,\n\n // text props\n color,\n fontWeight,\n letterSpacing,\n fontSize,\n fontFamily,\n textAlign,\n textProps,\n ...rest\n } = props as ButtonProps\n\n const isInsideButton = isRSC ? false : useContext(ButtonInsideButtonContext)\n const size = props.size || '$4'\n const iconSize = (typeof size === 'number' ? size * 0.5 : getFontSize(size)) * scaleIcon\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color })\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon)\n const spaceSize = getVariableValue(iconSize) * scaleSpace\n const contents = wrapChildrenInText(ButtonText, props)\n\n const inner =\n themedIcon || themedIconAfter\n ? spacedChildren({\n // a bit arbitrary but scaling to font size is necessary so long as button does\n space: spaceSize,\n spaceFlex,\n separator,\n direction:\n props.flexDirection === 'column' || props.flexDirection === 'column-reverse'\n ? 'vertical'\n : 'horizontal',\n children: [themedIcon, contents, themedIconAfter],\n })\n : contents\n\n return (\n <ButtonFrame\n {...(props.disabled && {\n // in rnw - false still has keyboard tabIndex, undefined = not actually focusable\n focusable: undefined,\n // even with tabIndex unset, it will keep focusStyle on web so disable it here\n focusStyle: {\n borderColor: '$background',\n },\n })}\n // fixes SSR issue + DOM nesting issue of not allowing button in button\n {...(isInsideButton && {\n tag: 'span',\n })}\n ref={ref as any}\n {...rest}\n >\n {isRSC ? (\n inner\n ) : (\n <ButtonInsideButtonContext.Provider value={true}>\n {inner}\n </ButtonInsideButtonContext.Provider>\n )}\n </ButtonFrame>\n )\n})\n\nexport const Button: TamaguiComponent<ButtonProps, HTMLButtonElement | View> =\n ButtonFrame.extractable(themeable(ButtonComponent as any) as any, {\n inlineProps: new Set([\n // text props go here (can't really optimize them, but we never fully extract button anyway)\n 'color',\n 'fontWeight',\n 'fontSize',\n 'fontFamily',\n 'letterSpacing',\n 'textAlign',\n ]),\n })\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,aAA+B,0BAA0B;AAClE,OAAO,SAA4B,YAAY,kBAAkB;AAIjE,MAAM;AAuBC,MAAM,cAAc,OAAO,gBAAgB;AAAA,EAChD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,YAAY;AAAA,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,IAAI,aAAa;AACzE,QAAM,YAAY,iBAAiB,QAAQ,IAAI;AAC/C,QAAM,WAAW,mBAAmB,YAAY,KAAK;AAErD,QAAM,QACJ,cAAc,kBACV,eAAe;AAAA,IAEb,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,WACE,MAAM,kBAAkB,YAAY,MAAM,kBAAkB,mBACxD,aACA;AAAA,IACN,UAAU,CAAC,YAAY,UAAU,eAAe;AAAA,EAClD,CAAC,IACD;AAEN,SACE,CAAC,gBACM,MAAM,YAAY;AAAA,IAErB,WAAW;AAAA,IAEX,YAAY;AAAA,MACV,aAAa;AAAA,IACf;AAAA,EACF,OAEK,kBAAkB;AAAA,IACrB,KAAK;AAAA,EACP,GACA,KAAK,SACD,OAEH,QACC,QAEA,CAAC,0BAA0B,SAAS,OAAO,OACxC,MACH,EAFC,0BAA0B,UAI/B,EAvBC;AAyBL,CAAC;AAEM,MAAMA,UACX,YAAY,YAAY,UAAU,eAAsB,GAAU;AAAA,EAChE,aAAa,oBAAI,IAAI;AAAA,IAEnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["import {\n ButtonInsideButtonContext,\n GetProps,\n TamaguiElement,\n ThemeableProps,\n getButtonSize,\n getVariableValue,\n isRSC,\n spacedChildren,\n styled,\n themeable,\n} from '@tamagui/core'\nimport { getFontSize } from '@tamagui/font-size'\nimport { useGetThemedIcon } from '@tamagui/helpers-tamagui'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText, TextParentStyles, wrapChildrenInText } from '@tamagui/text'\nimport React, { FunctionComponent, forwardRef, useContext } from 'react'\n\n// bugfix esbuild strips react jsx: 'preserve'\nReact['createElement']\n\ntype ButtonIconProps = { color?: string; size?: number }\ntype IconProp = JSX.Element | FunctionComponent<ButtonIconProps> | null\n\nexport type ButtonProps = Omit<TextParentStyles, 'TextComponent'> &\n GetProps<typeof ButtonFrame> &\n ThemeableProps & {\n // add icon before, passes color and size automatically if Component\n icon?: IconProp\n // add icon after, passes color and size automatically if Component\n iconAfter?: IconProp\n // adjust icon relative to size\n // default: -1\n scaleIcon?: number\n // dont wrap inner contents in a text element\n noTextWrap?: boolean\n // make the spacing elements flex\n spaceFlex?: number | boolean\n // adjust internal space relative to icon size\n scaleSpace?: number\n }\n\nexport const ButtonFrame = styled(ThemeableStack, {\n name: 'Button',\n tag: 'button',\n focusable: true,\n hoverTheme: true,\n pressTheme: true,\n backgrounded: true,\n borderWidth: 1,\n borderColor: 'transparent',\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n\n // if we wanted this only when pressable = true, we'd need to merge variants?\n cursor: 'pointer',\n\n pressStyle: {\n borderColor: 'transparent',\n },\n\n hoverStyle: {\n borderColor: 'transparent',\n },\n\n focusStyle: {\n borderColor: '$borderColorFocus',\n },\n\n variants: {\n size: {\n '...size': getButtonSize,\n },\n\n active: {\n true: {\n hoverStyle: {\n backgroundColor: '$background',\n },\n },\n },\n\n disabled: {\n true: {\n opacity: 0.375,\n pointerEvents: 'none',\n },\n },\n } as const,\n\n defaultVariants: {\n size: '$4',\n },\n})\n\n// see TODO breaking types\n// type x = GetProps<typeof ButtonFrame>\n// type y = x['size']\n\nexport const ButtonText = styled(SizableText, {\n color: '$color',\n selectable: false,\n cursor: 'inherit',\n // flexGrow 1 leads to inconsistent native style where text pushes to start of view\n flexGrow: 0,\n flexShrink: 1,\n ellipse: true,\n})\n\nexport function useButton(\n props: ButtonProps,\n { Text = ButtonText }: { Text: any } = { Text: ButtonText }\n) {\n // careful not to desctructure and re-order props, order is important\n const {\n children,\n icon,\n iconAfter,\n noTextWrap,\n theme: themeName,\n space,\n spaceFlex,\n scaleIcon = 1,\n scaleSpace = 0.66,\n separator,\n\n // text props\n color,\n fontWeight,\n letterSpacing,\n fontSize,\n fontFamily,\n textAlign,\n textProps,\n ...rest\n } = props\n\n const isInsideButton = isRSC ? false : useContext(ButtonInsideButtonContext)\n const size = props.size || '$4'\n const iconSize = (typeof size === 'number' ? size * 0.5 : getFontSize(size)) * scaleIcon\n const getThemedIcon = useGetThemedIcon({ size: iconSize, color })\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon)\n const spaceSize = getVariableValue(iconSize) * scaleSpace\n const contents = wrapChildrenInText(Text, props)\n const inner =\n themedIcon || themedIconAfter\n ? spacedChildren({\n // a bit arbitrary but scaling to font size is necessary so long as button does\n space: spaceSize,\n spaceFlex,\n separator,\n direction:\n props.flexDirection === 'column' || props.flexDirection === 'column-reverse'\n ? 'vertical'\n : 'horizontal',\n children: [themedIcon, contents, themedIconAfter],\n })\n : contents\n\n return {\n spaceSize,\n isInsideButton,\n props: {\n ...(props.disabled && {\n // in rnw - false still has keyboard tabIndex, undefined = not actually focusable\n focusable: undefined,\n // even with tabIndex unset, it will keep focusStyle on web so disable it here\n focusStyle: {\n borderColor: '$background',\n },\n }),\n // fixes SSR issue + DOM nesting issue of not allowing button in button\n ...(isInsideButton && {\n tag: 'span',\n }),\n ...rest,\n children: isRSC ? (\n inner\n ) : (\n <ButtonInsideButtonContext.Provider value={true}>\n {inner}\n </ButtonInsideButtonContext.Provider>\n ),\n },\n }\n}\n\nconst ButtonComponent = forwardRef<TamaguiElement, ButtonProps>(function Button(props, ref) {\n const { props: buttonProps } = useButton(props)\n return <ButtonFrame {...buttonProps} ref={ref} />\n})\n\nexport const buttonStaticConfig = {\n inlineProps: new Set([\n // text props go here (can't really optimize them, but we never fully extract button anyway)\n // may be able to remove this entirely, as the compiler / runtime have gotten better\n 'color',\n 'fontWeight',\n 'fontSize',\n 'fontFamily',\n 'letterSpacing',\n 'textAlign',\n ]),\n}\n\nexport const Button = ButtonFrame.extractable(themeable(ButtonComponent), buttonStaticConfig)\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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nB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAEO,MAAMA,UAAS,YAAY,YAAY,UAAU,eAAe,GAAG,kBAAkB;",
6
6
  "names": ["Button"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/button",
3
- "version": "1.0.1-beta.159",
3
+ "version": "1.0.1-beta.162",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -28,16 +28,16 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@tamagui/core": "^1.0.1-beta.159",
32
- "@tamagui/font-size": "^1.0.1-beta.159",
33
- "@tamagui/helpers-tamagui": "^1.0.1-beta.159"
31
+ "@tamagui/core": "^1.0.1-beta.162",
32
+ "@tamagui/font-size": "^1.0.1-beta.162",
33
+ "@tamagui/helpers-tamagui": "^1.0.1-beta.162"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": "*",
37
37
  "react-dom": "*"
38
38
  },
39
39
  "devDependencies": {
40
- "@tamagui/build": "^1.0.1-beta.159",
40
+ "@tamagui/build": "^1.0.1-beta.162",
41
41
  "react": "*",
42
42
  "react-dom": "*"
43
43
  },
package/src/Button.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ButtonInsideButtonContext,
3
3
  GetProps,
4
- TamaguiComponent,
4
+ TamaguiElement,
5
5
  ThemeableProps,
6
6
  getButtonSize,
7
7
  getVariableValue,
@@ -15,7 +15,6 @@ import { useGetThemedIcon } from '@tamagui/helpers-tamagui'
15
15
  import { ThemeableStack } from '@tamagui/stacks'
16
16
  import { SizableText, TextParentStyles, wrapChildrenInText } from '@tamagui/text'
17
17
  import React, { FunctionComponent, forwardRef, useContext } from 'react'
18
- import { View } from 'react-native'
19
18
 
20
19
  // bugfix esbuild strips react jsx: 'preserve'
21
20
  React['createElement']
@@ -110,7 +109,10 @@ export const ButtonText = styled(SizableText, {
110
109
  ellipse: true,
111
110
  })
112
111
 
113
- const ButtonComponent = forwardRef(function Button(props: ButtonProps, ref) {
112
+ export function useButton(
113
+ props: ButtonProps,
114
+ { Text = ButtonText }: { Text: any } = { Text: ButtonText }
115
+ ) {
114
116
  // careful not to desctructure and re-order props, order is important
115
117
  const {
116
118
  children,
@@ -133,7 +135,7 @@ const ButtonComponent = forwardRef(function Button(props: ButtonProps, ref) {
133
135
  textAlign,
134
136
  textProps,
135
137
  ...rest
136
- } = props as ButtonProps
138
+ } = props
137
139
 
138
140
  const isInsideButton = isRSC ? false : useContext(ButtonInsideButtonContext)
139
141
  const size = props.size || '$4'
@@ -141,8 +143,7 @@ const ButtonComponent = forwardRef(function Button(props: ButtonProps, ref) {
141
143
  const getThemedIcon = useGetThemedIcon({ size: iconSize, color })
142
144
  const [themedIcon, themedIconAfter] = [icon, iconAfter].map(getThemedIcon)
143
145
  const spaceSize = getVariableValue(iconSize) * scaleSpace
144
- const contents = wrapChildrenInText(ButtonText, props)
145
-
146
+ const contents = wrapChildrenInText(Text, props)
146
147
  const inner =
147
148
  themedIcon || themedIconAfter
148
149
  ? spacedChildren({
@@ -158,43 +159,50 @@ const ButtonComponent = forwardRef(function Button(props: ButtonProps, ref) {
158
159
  })
159
160
  : contents
160
161
 
161
- return (
162
- <ButtonFrame
163
- {...(props.disabled && {
162
+ return {
163
+ spaceSize,
164
+ isInsideButton,
165
+ props: {
166
+ ...(props.disabled && {
164
167
  // in rnw - false still has keyboard tabIndex, undefined = not actually focusable
165
168
  focusable: undefined,
166
169
  // even with tabIndex unset, it will keep focusStyle on web so disable it here
167
170
  focusStyle: {
168
171
  borderColor: '$background',
169
172
  },
170
- })}
173
+ }),
171
174
  // fixes SSR issue + DOM nesting issue of not allowing button in button
172
- {...(isInsideButton && {
175
+ ...(isInsideButton && {
173
176
  tag: 'span',
174
- })}
175
- ref={ref as any}
176
- {...rest}
177
- >
178
- {isRSC ? (
177
+ }),
178
+ ...rest,
179
+ children: isRSC ? (
179
180
  inner
180
181
  ) : (
181
182
  <ButtonInsideButtonContext.Provider value={true}>
182
183
  {inner}
183
184
  </ButtonInsideButtonContext.Provider>
184
- )}
185
- </ButtonFrame>
186
- )
185
+ ),
186
+ },
187
+ }
188
+ }
189
+
190
+ const ButtonComponent = forwardRef<TamaguiElement, ButtonProps>(function Button(props, ref) {
191
+ const { props: buttonProps } = useButton(props)
192
+ return <ButtonFrame {...buttonProps} ref={ref} />
187
193
  })
188
194
 
189
- export const Button: TamaguiComponent<ButtonProps, HTMLButtonElement | View> =
190
- ButtonFrame.extractable(themeable(ButtonComponent as any) as any, {
191
- inlineProps: new Set([
192
- // text props go here (can't really optimize them, but we never fully extract button anyway)
193
- 'color',
194
- 'fontWeight',
195
- 'fontSize',
196
- 'fontFamily',
197
- 'letterSpacing',
198
- 'textAlign',
199
- ]),
200
- })
195
+ export const buttonStaticConfig = {
196
+ inlineProps: new Set([
197
+ // text props go here (can't really optimize them, but we never fully extract button anyway)
198
+ // may be able to remove this entirely, as the compiler / runtime have gotten better
199
+ 'color',
200
+ 'fontWeight',
201
+ 'fontSize',
202
+ 'fontFamily',
203
+ 'letterSpacing',
204
+ 'textAlign',
205
+ ]),
206
+ }
207
+
208
+ export const Button = ButtonFrame.extractable(themeable(ButtonComponent), buttonStaticConfig)
package/types/Button.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { GetProps, TamaguiComponent, ThemeableProps } from '@tamagui/core';
1
+ import { GetProps, TamaguiElement, ThemeableProps } from '@tamagui/core';
2
2
  import { TextParentStyles } from '@tamagui/text';
3
- import { FunctionComponent } from 'react';
4
- import { View } from 'react-native';
3
+ import React, { FunctionComponent } from 'react';
5
4
  declare type ButtonIconProps = {
6
5
  color?: string;
7
6
  size?: number;
@@ -15,22 +14,22 @@ export declare type ButtonProps = Omit<TextParentStyles, 'TextComponent'> & GetP
15
14
  spaceFlex?: number | boolean;
16
15
  scaleSpace?: number;
17
16
  };
18
- export declare const ButtonFrame: TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
17
+ export declare const ButtonFrame: import("@tamagui/core").TamaguiComponent<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
19
18
  readonly fullscreen?: boolean | undefined;
20
19
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
21
20
  } & {
22
- fontFamily?: unknown;
23
- backgrounded?: boolean | undefined;
24
- radiused?: boolean | undefined;
25
- hoverTheme?: boolean | undefined;
26
- pressTheme?: boolean | undefined;
27
- focusTheme?: boolean | undefined;
28
- circular?: boolean | undefined;
29
- padded?: boolean | undefined;
30
- elevate?: boolean | undefined;
31
- bordered?: number | boolean | undefined;
32
- transparent?: boolean | undefined;
33
- chromeless?: boolean | "all" | undefined;
21
+ readonly fontFamily?: unknown;
22
+ readonly backgrounded?: boolean | undefined;
23
+ readonly radiused?: boolean | undefined;
24
+ readonly hoverTheme?: boolean | undefined;
25
+ readonly pressTheme?: boolean | undefined;
26
+ readonly focusTheme?: boolean | undefined;
27
+ readonly circular?: boolean | undefined;
28
+ readonly padded?: boolean | undefined;
29
+ readonly elevate?: boolean | undefined;
30
+ readonly bordered?: number | boolean | undefined;
31
+ readonly transparent?: boolean | undefined;
32
+ readonly chromeless?: boolean | "all" | undefined;
34
33
  }, "disabled" | "size" | "active"> & {
35
34
  readonly size?: import("@tamagui/core").SizeTokens | undefined;
36
35
  readonly active?: boolean | undefined;
@@ -39,18 +38,18 @@ export declare const ButtonFrame: TamaguiComponent<Omit<import("react-native").V
39
38
  readonly fullscreen?: boolean | undefined;
40
39
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
41
40
  } & {
42
- fontFamily?: unknown;
43
- backgrounded?: boolean | undefined;
44
- radiused?: boolean | undefined;
45
- hoverTheme?: boolean | undefined;
46
- pressTheme?: boolean | undefined;
47
- focusTheme?: boolean | undefined;
48
- circular?: boolean | undefined;
49
- padded?: boolean | undefined;
50
- elevate?: boolean | undefined;
51
- bordered?: number | boolean | undefined;
52
- transparent?: boolean | undefined;
53
- chromeless?: boolean | "all" | undefined;
41
+ readonly fontFamily?: unknown;
42
+ readonly backgrounded?: boolean | undefined;
43
+ readonly radiused?: boolean | undefined;
44
+ readonly hoverTheme?: boolean | undefined;
45
+ readonly pressTheme?: boolean | undefined;
46
+ readonly focusTheme?: boolean | undefined;
47
+ readonly circular?: boolean | undefined;
48
+ readonly padded?: boolean | undefined;
49
+ readonly elevate?: boolean | undefined;
50
+ readonly bordered?: number | boolean | undefined;
51
+ readonly transparent?: boolean | undefined;
52
+ readonly chromeless?: boolean | "all" | undefined;
54
53
  }, "disabled" | "size" | "active"> & {
55
54
  readonly size?: import("@tamagui/core").SizeTokens | undefined;
56
55
  readonly active?: boolean | undefined;
@@ -59,68 +58,469 @@ export declare const ButtonFrame: TamaguiComponent<Omit<import("react-native").V
59
58
  readonly fullscreen?: boolean | undefined;
60
59
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
61
60
  } & {
62
- fontFamily?: unknown;
63
- backgrounded?: boolean | undefined;
64
- radiused?: boolean | undefined;
65
- hoverTheme?: boolean | undefined;
66
- pressTheme?: boolean | undefined;
67
- focusTheme?: boolean | undefined;
68
- circular?: boolean | undefined;
69
- padded?: boolean | undefined;
70
- elevate?: boolean | undefined;
71
- bordered?: number | boolean | undefined;
72
- transparent?: boolean | undefined;
73
- chromeless?: boolean | "all" | undefined;
61
+ readonly fontFamily?: unknown;
62
+ readonly backgrounded?: boolean | undefined;
63
+ readonly radiused?: boolean | undefined;
64
+ readonly hoverTheme?: boolean | undefined;
65
+ readonly pressTheme?: boolean | undefined;
66
+ readonly focusTheme?: boolean | undefined;
67
+ readonly circular?: boolean | undefined;
68
+ readonly padded?: boolean | undefined;
69
+ readonly elevate?: boolean | undefined;
70
+ readonly bordered?: number | boolean | undefined;
71
+ readonly transparent?: boolean | undefined;
72
+ readonly chromeless?: boolean | "all" | undefined;
74
73
  }, "disabled" | "size" | "active"> & {
75
74
  readonly size?: import("@tamagui/core").SizeTokens | undefined;
76
75
  readonly active?: boolean | undefined;
77
76
  readonly disabled?: boolean | undefined;
78
- }>>, import("@tamagui/core").TamaguiElement, import("@tamagui/core").StackPropsBase, {
77
+ }>>, TamaguiElement, import("@tamagui/core").StackPropsBase, {
79
78
  readonly fullscreen?: boolean | undefined;
80
79
  readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
81
80
  } & {
82
- fontFamily?: unknown;
83
- backgrounded?: boolean | undefined;
84
- radiused?: boolean | undefined;
85
- hoverTheme?: boolean | undefined;
86
- pressTheme?: boolean | undefined;
87
- focusTheme?: boolean | undefined;
88
- circular?: boolean | undefined;
89
- padded?: boolean | undefined;
90
- elevate?: boolean | undefined;
91
- bordered?: number | boolean | undefined;
92
- transparent?: boolean | undefined;
93
- chromeless?: boolean | "all" | undefined;
81
+ readonly fontFamily?: unknown;
82
+ readonly backgrounded?: boolean | undefined;
83
+ readonly radiused?: boolean | undefined;
84
+ readonly hoverTheme?: boolean | undefined;
85
+ readonly pressTheme?: boolean | undefined;
86
+ readonly focusTheme?: boolean | undefined;
87
+ readonly circular?: boolean | undefined;
88
+ readonly padded?: boolean | undefined;
89
+ readonly elevate?: boolean | undefined;
90
+ readonly bordered?: number | boolean | undefined;
91
+ readonly transparent?: boolean | undefined;
92
+ readonly chromeless?: boolean | "all" | undefined;
94
93
  } & {
95
94
  readonly size?: import("@tamagui/core").SizeTokens | undefined;
96
95
  readonly active?: boolean | undefined;
97
96
  readonly disabled?: boolean | undefined;
98
97
  }>;
99
- export declare const ButtonText: TamaguiComponent<(Omit<import("react-native").TextProps, "children"> & import("@tamagui/core").RNWTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
100
- size?: import("@tamagui/core").FontSizeTokens | undefined;
98
+ export declare const ButtonText: import("@tamagui/core").TamaguiComponent<(Omit<import("react-native").TextProps, "children"> & import("@tamagui/core").RNWTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
99
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
101
100
  } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").TextProps, "children"> & import("@tamagui/core").RNWTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
102
- size?: import("@tamagui/core").FontSizeTokens | undefined;
101
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
103
102
  }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children"> & import("@tamagui/core").RNWTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{}, "size"> & {
104
- size?: import("@tamagui/core").FontSizeTokens | undefined;
103
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
105
104
  }>>) | (Omit<import("react-native").TextProps, "children"> & import("@tamagui/core").RNWTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
106
- size?: import("@tamagui/core").FontSizeTokens | undefined;
105
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
107
106
  }, string | number> & {
108
107
  [x: string]: undefined;
109
108
  } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").TextProps, "children"> & import("@tamagui/core").RNWTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
110
- size?: import("@tamagui/core").FontSizeTokens | undefined;
109
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
111
110
  }, string | number> & {
112
111
  [x: string]: undefined;
113
112
  }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").TextProps, "children"> & import("@tamagui/core").RNWTextProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").TextStylePropsBase>> & Omit<{
114
- size?: import("@tamagui/core").FontSizeTokens | undefined;
113
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
115
114
  }, string | number> & {
116
115
  [x: string]: undefined;
117
- }>>), import("@tamagui/core").TamaguiElement, import("@tamagui/core").TextPropsBase, {
118
- size?: import("@tamagui/core").FontSizeTokens | undefined;
116
+ }>>), TamaguiElement, import("@tamagui/core").TextPropsBase, {
117
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
119
118
  } | ({
120
- size?: import("@tamagui/core").FontSizeTokens | undefined;
119
+ readonly size?: import("@tamagui/core").FontSizeTokens | undefined;
121
120
  } & {
122
121
  [x: string]: undefined;
123
122
  })>;
124
- export declare const Button: TamaguiComponent<ButtonProps, HTMLButtonElement | View>;
123
+ export declare function useButton(props: ButtonProps, { Text }?: {
124
+ Text: any;
125
+ }): {
126
+ spaceSize: number;
127
+ isInsideButton: boolean;
128
+ props: {
129
+ children: string | number | boolean | any[] | JSX.Element | React.ReactFragment | null | undefined;
130
+ hitSlop?: import("react-native").Insets | (import("react-native").Insets & number) | undefined;
131
+ onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
132
+ pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined;
133
+ removeClippedSubviews?: boolean | undefined;
134
+ style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
135
+ testID?: string | undefined;
136
+ nativeID?: string | undefined;
137
+ collapsable?: boolean | undefined;
138
+ needsOffscreenAlphaCompositing?: boolean | undefined;
139
+ renderToHardwareTextureAndroid?: boolean | undefined;
140
+ focusable?: boolean | undefined;
141
+ shouldRasterizeIOS?: boolean | undefined;
142
+ isTVSelectable?: boolean | undefined;
143
+ hasTVPreferredFocus?: boolean | undefined;
144
+ tvParallaxProperties?: import("react-native").TVParallaxProperties | undefined;
145
+ tvParallaxShiftDistanceX?: number | undefined;
146
+ tvParallaxShiftDistanceY?: number | undefined;
147
+ tvParallaxTiltAngle?: number | undefined;
148
+ tvParallaxMagnification?: number | undefined;
149
+ onStartShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
150
+ onMoveShouldSetResponder?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
151
+ onResponderEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
152
+ onResponderGrant?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
153
+ onResponderReject?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
154
+ onResponderMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
155
+ onResponderRelease?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
156
+ onResponderStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
157
+ onResponderTerminationRequest?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
158
+ onResponderTerminate?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
159
+ onStartShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
160
+ onMoveShouldSetResponderCapture?: ((event: import("react-native").GestureResponderEvent) => boolean) | undefined;
161
+ onTouchStart?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
162
+ onTouchMove?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
163
+ onTouchEnd?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
164
+ onTouchCancel?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
165
+ onTouchEndCapture?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
166
+ accessible?: boolean | undefined;
167
+ accessibilityActions?: readonly Readonly<{
168
+ name: string;
169
+ label?: string | undefined;
170
+ }>[] | undefined;
171
+ accessibilityLabel?: string | undefined;
172
+ accessibilityRole?: "none" | "button" | "link" | "search" | "image" | "keyboardkey" | "text" | "adjustable" | "imagebutton" | "header" | "summary" | "list" | undefined;
173
+ accessibilityState?: import("react-native").AccessibilityState | undefined;
174
+ accessibilityHint?: string | undefined;
175
+ accessibilityValue?: import("react-native").AccessibilityValue | undefined;
176
+ onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined;
177
+ accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
178
+ importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants" | undefined;
179
+ accessibilityElementsHidden?: boolean | undefined;
180
+ accessibilityViewIsModal?: boolean | undefined;
181
+ onAccessibilityEscape?: (() => void) | undefined;
182
+ onAccessibilityTap?: (() => void) | undefined;
183
+ onMagicTap?: (() => void) | undefined;
184
+ accessibilityIgnoresInvertColors?: boolean | undefined;
185
+ dataSet?: any;
186
+ target?: any;
187
+ rel?: any;
188
+ download?: any;
189
+ href?: string | undefined;
190
+ hrefAttrs?: {
191
+ target?: "top" | "_blank" | "_self" | "_top" | "blank" | "self" | undefined;
192
+ rel?: string | undefined;
193
+ download?: boolean | undefined;
194
+ } | undefined;
195
+ onMouseDown?: (((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) & ((e: MouseEvent) => any)) | undefined;
196
+ onMouseUp?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
197
+ onMouseEnter?: (((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) & ((e: MouseEvent) => any)) | undefined;
198
+ onMouseLeave?: (((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void) & ((e: MouseEvent) => any)) | undefined;
199
+ onFocus?: ((event: React.FocusEvent<HTMLDivElement, Element>) => void) | undefined;
200
+ onScroll?: ((event: React.UIEvent<HTMLDivElement, UIEvent>) => void) | undefined;
201
+ onScrollShouldSetResponder?: unknown;
202
+ onScrollShouldSetResponderCapture?: unknown;
203
+ onSelectionChangeShouldSetResponder?: unknown;
204
+ onSelectionChangeShouldSetResponderCapture?: unknown;
205
+ asChild?: boolean | undefined;
206
+ spaceDirection?: import("@tamagui/core").SpaceDirection | undefined;
207
+ dangerouslySetInnerHTML?: {
208
+ __html: string;
209
+ } | undefined;
210
+ animation?: import("@tamagui/core").AnimationProp | undefined;
211
+ animateOnly?: string[] | undefined;
212
+ debug?: import("@tamagui/core").DebugProp | undefined;
213
+ disabled?: boolean | undefined;
214
+ className?: string | undefined;
215
+ themeShallow?: boolean | undefined;
216
+ id?: string | undefined;
217
+ tag?: string | undefined;
218
+ componentName?: string | undefined;
219
+ forceStyle?: "hover" | "press" | "focus" | undefined;
220
+ onHoverIn?: ((e: MouseEvent) => any) | undefined;
221
+ onHoverOut?: ((e: MouseEvent) => any) | undefined;
222
+ onPress?: ((e: import("react-native").GestureResponderEvent) => any) | undefined;
223
+ onPressIn?: ((e: import("react-native").GestureResponderEvent) => any) | undefined;
224
+ onPressOut?: ((e: import("react-native").GestureResponderEvent) => any) | undefined;
225
+ userSelect?: import("csstype").Property.UserSelect | undefined;
226
+ cursor?: string | undefined;
227
+ backgroundColor?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ColorTokens | import("react-native").OpaqueColorValue | undefined;
228
+ borderBottomColor?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ColorTokens | import("react-native").OpaqueColorValue | undefined;
229
+ borderBottomEndRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
230
+ borderBottomLeftRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
231
+ borderBottomRightRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
232
+ borderBottomStartRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
233
+ borderBottomWidth?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
234
+ borderColor?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ColorTokens | import("react-native").OpaqueColorValue | undefined;
235
+ borderEndColor?: import("react-native").ColorValue | undefined;
236
+ borderLeftColor?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ColorTokens | import("react-native").OpaqueColorValue | undefined;
237
+ borderLeftWidth?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
238
+ borderRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
239
+ borderRightColor?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ColorTokens | import("react-native").OpaqueColorValue | undefined;
240
+ borderRightWidth?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
241
+ borderStartColor?: import("react-native").ColorValue | undefined;
242
+ borderStyle?: "solid" | "dotted" | "dashed" | undefined;
243
+ borderTopColor?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ColorTokens | import("react-native").OpaqueColorValue | undefined;
244
+ borderTopEndRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
245
+ borderTopLeftRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
246
+ borderTopRightRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
247
+ borderTopStartRadius?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
248
+ borderTopWidth?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
249
+ borderWidth?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
250
+ opacity?: number | undefined;
251
+ alignContent?: "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "stretch" | undefined;
252
+ alignItems?: import("react-native").FlexAlignType | undefined;
253
+ alignSelf?: "auto" | import("react-native").FlexAlignType | undefined;
254
+ aspectRatio?: number | undefined;
255
+ borderEndWidth?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
256
+ borderStartWidth?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
257
+ bottom?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
258
+ end?: string | number | undefined;
259
+ flex?: number | undefined;
260
+ flexBasis?: string | number | undefined;
261
+ flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
262
+ flexGrow?: number | undefined;
263
+ flexShrink?: number | undefined;
264
+ flexWrap?: "nowrap" | "wrap" | "wrap-reverse" | undefined;
265
+ height?: import("@tamagui/core").SizeTokens | import("@tamagui/core").ThemeValueFallback | undefined;
266
+ justifyContent?: "center" | "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | undefined;
267
+ left?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
268
+ margin?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
269
+ marginBottom?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
270
+ marginEnd?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
271
+ marginHorizontal?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
272
+ marginLeft?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
273
+ marginRight?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
274
+ marginStart?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
275
+ marginTop?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
276
+ marginVertical?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
277
+ maxHeight?: import("@tamagui/core").SizeTokens | import("@tamagui/core").ThemeValueFallback | undefined;
278
+ maxWidth?: import("@tamagui/core").SizeTokens | import("@tamagui/core").ThemeValueFallback | undefined;
279
+ minHeight?: import("@tamagui/core").SizeTokens | import("@tamagui/core").ThemeValueFallback | undefined;
280
+ minWidth?: import("@tamagui/core").SizeTokens | import("@tamagui/core").ThemeValueFallback | undefined;
281
+ overflow?: "visible" | "hidden" | "scroll" | undefined;
282
+ padding?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
283
+ paddingBottom?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
284
+ paddingEnd?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
285
+ paddingHorizontal?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
286
+ paddingLeft?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
287
+ paddingRight?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
288
+ paddingStart?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
289
+ paddingTop?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
290
+ paddingVertical?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
291
+ position?: "absolute" | "relative" | undefined;
292
+ right?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
293
+ start?: string | number | undefined;
294
+ top?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
295
+ width?: import("@tamagui/core").SizeTokens | import("@tamagui/core").ThemeValueFallback | undefined;
296
+ zIndex?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ZIndexTokens | undefined;
297
+ direction?: "inherit" | "ltr" | "rtl" | undefined;
298
+ shadowColor?: import("@tamagui/core").ThemeValueFallback | import("@tamagui/core").ColorTokens | import("react-native").OpaqueColorValue | undefined;
299
+ shadowOffset?: import("@tamagui/core").ThemeValueFallback | {
300
+ width: import("@tamagui/core").SpaceTokens;
301
+ height: import("@tamagui/core").SpaceTokens;
302
+ } | {
303
+ width: number;
304
+ height: number;
305
+ } | undefined;
306
+ shadowOpacity?: number | undefined;
307
+ shadowRadius?: import("@tamagui/core").SizeTokens | import("@tamagui/core").ThemeValueFallback | undefined;
308
+ transform?: (import("react-native").PerpectiveTransform | import("react-native").RotateTransform | import("react-native").RotateXTransform | import("react-native").RotateYTransform | import("react-native").RotateZTransform | import("react-native").ScaleTransform | import("react-native").ScaleXTransform | import("react-native").ScaleYTransform | import("react-native").TranslateXTransform | import("react-native").TranslateYTransform | import("react-native").SkewXTransform | import("react-native").SkewYTransform | import("react-native").MatrixTransform)[] | undefined;
309
+ transformMatrix?: number[] | undefined;
310
+ rotation?: number | undefined;
311
+ scaleX?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
312
+ scaleY?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
313
+ translateX?: number | undefined;
314
+ translateY?: number | undefined;
315
+ x?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
316
+ y?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
317
+ perspective?: number | undefined;
318
+ scale?: import("@tamagui/core").SpaceTokens | import("@tamagui/core").ThemeValueFallback | undefined;
319
+ skewX?: string | undefined;
320
+ skewY?: string | undefined;
321
+ matrix?: number[] | undefined;
322
+ rotate?: string | undefined;
323
+ rotateY?: string | undefined;
324
+ rotateX?: string | undefined;
325
+ rotateZ?: string | undefined;
326
+ contain?: string | undefined;
327
+ display?: "flex" | "none" | "inherit" | "inline" | "block" | "contents" | "inline-flex" | undefined;
328
+ elevation?: import("@tamagui/core").SizeTokens | undefined;
329
+ hoverTheme?: boolean | undefined;
330
+ pressTheme?: boolean | undefined;
331
+ focusTheme?: boolean | undefined;
332
+ circular?: boolean | undefined;
333
+ elevate?: boolean | undefined;
334
+ bordered?: number | boolean | undefined;
335
+ transparent?: boolean | undefined;
336
+ backgrounded?: boolean | undefined;
337
+ radiused?: boolean | undefined;
338
+ padded?: boolean | undefined;
339
+ chromeless?: boolean | "all" | undefined;
340
+ fullscreen?: boolean | undefined;
341
+ size?: import("@tamagui/core").SizeTokens | undefined;
342
+ active?: boolean | undefined;
343
+ hoverStyle?: Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
344
+ readonly fullscreen?: boolean | undefined;
345
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
346
+ } & {
347
+ readonly fontFamily?: unknown;
348
+ readonly backgrounded?: boolean | undefined;
349
+ readonly radiused?: boolean | undefined;
350
+ readonly hoverTheme?: boolean | undefined;
351
+ readonly pressTheme?: boolean | undefined;
352
+ readonly focusTheme?: boolean | undefined;
353
+ readonly circular?: boolean | undefined;
354
+ readonly padded?: boolean | undefined;
355
+ readonly elevate?: boolean | undefined;
356
+ readonly bordered?: number | boolean | undefined;
357
+ readonly transparent?: boolean | undefined;
358
+ readonly chromeless?: boolean | "all" | undefined;
359
+ }, "disabled" | "size" | "active"> & {
360
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
361
+ readonly active?: boolean | undefined;
362
+ readonly disabled?: boolean | undefined;
363
+ }> | null | undefined;
364
+ pressStyle?: Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
365
+ readonly fullscreen?: boolean | undefined;
366
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
367
+ } & {
368
+ readonly fontFamily?: unknown;
369
+ readonly backgrounded?: boolean | undefined;
370
+ readonly radiused?: boolean | undefined;
371
+ readonly hoverTheme?: boolean | undefined;
372
+ readonly pressTheme?: boolean | undefined;
373
+ readonly focusTheme?: boolean | undefined;
374
+ readonly circular?: boolean | undefined;
375
+ readonly padded?: boolean | undefined;
376
+ readonly elevate?: boolean | undefined;
377
+ readonly bordered?: number | boolean | undefined;
378
+ readonly transparent?: boolean | undefined;
379
+ readonly chromeless?: boolean | "all" | undefined;
380
+ }, "disabled" | "size" | "active"> & {
381
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
382
+ readonly active?: boolean | undefined;
383
+ readonly disabled?: boolean | undefined;
384
+ }> | null | undefined;
385
+ focusStyle?: Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
386
+ readonly fullscreen?: boolean | undefined;
387
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
388
+ } & {
389
+ readonly fontFamily?: unknown;
390
+ readonly backgrounded?: boolean | undefined;
391
+ readonly radiused?: boolean | undefined;
392
+ readonly hoverTheme?: boolean | undefined;
393
+ readonly pressTheme?: boolean | undefined;
394
+ readonly focusTheme?: boolean | undefined;
395
+ readonly circular?: boolean | undefined;
396
+ readonly padded?: boolean | undefined;
397
+ readonly elevate?: boolean | undefined;
398
+ readonly bordered?: number | boolean | undefined;
399
+ readonly transparent?: boolean | undefined;
400
+ readonly chromeless?: boolean | "all" | undefined;
401
+ }, "disabled" | "size" | "active"> & {
402
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
403
+ readonly active?: boolean | undefined;
404
+ readonly disabled?: boolean | undefined;
405
+ }> | null | undefined;
406
+ exitStyle?: Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
407
+ readonly fullscreen?: boolean | undefined;
408
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
409
+ } & {
410
+ readonly fontFamily?: unknown;
411
+ readonly backgrounded?: boolean | undefined;
412
+ readonly radiused?: boolean | undefined;
413
+ readonly hoverTheme?: boolean | undefined;
414
+ readonly pressTheme?: boolean | undefined;
415
+ readonly focusTheme?: boolean | undefined;
416
+ readonly circular?: boolean | undefined;
417
+ readonly padded?: boolean | undefined;
418
+ readonly elevate?: boolean | undefined;
419
+ readonly bordered?: number | boolean | undefined;
420
+ readonly transparent?: boolean | undefined;
421
+ readonly chromeless?: boolean | "all" | undefined;
422
+ }, "disabled" | "size" | "active"> & {
423
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
424
+ readonly active?: boolean | undefined;
425
+ readonly disabled?: boolean | undefined;
426
+ }> | null | undefined;
427
+ enterStyle?: Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
428
+ readonly fullscreen?: boolean | undefined;
429
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
430
+ } & {
431
+ readonly fontFamily?: unknown;
432
+ readonly backgrounded?: boolean | undefined;
433
+ readonly radiused?: boolean | undefined;
434
+ readonly hoverTheme?: boolean | undefined;
435
+ readonly pressTheme?: boolean | undefined;
436
+ readonly focusTheme?: boolean | undefined;
437
+ readonly circular?: boolean | undefined;
438
+ readonly padded?: boolean | undefined;
439
+ readonly elevate?: boolean | undefined;
440
+ readonly bordered?: number | boolean | undefined;
441
+ readonly transparent?: boolean | undefined;
442
+ readonly chromeless?: boolean | "all" | undefined;
443
+ }, "disabled" | "size" | "active"> & {
444
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
445
+ readonly active?: boolean | undefined;
446
+ readonly disabled?: boolean | undefined;
447
+ }> | null | undefined;
448
+ themeInverse?: boolean | undefined;
449
+ };
450
+ };
451
+ export declare const buttonStaticConfig: {
452
+ inlineProps: Set<string>;
453
+ };
454
+ export declare const Button: (props: Omit<Omit<TextParentStyles, "TextComponent"> & Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
455
+ readonly fullscreen?: boolean | undefined;
456
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
457
+ } & {
458
+ readonly fontFamily?: unknown;
459
+ readonly backgrounded?: boolean | undefined;
460
+ readonly radiused?: boolean | undefined;
461
+ readonly hoverTheme?: boolean | undefined;
462
+ readonly pressTheme?: boolean | undefined;
463
+ readonly focusTheme?: boolean | undefined;
464
+ readonly circular?: boolean | undefined;
465
+ readonly padded?: boolean | undefined;
466
+ readonly elevate?: boolean | undefined;
467
+ readonly bordered?: number | boolean | undefined;
468
+ readonly transparent?: boolean | undefined;
469
+ readonly chromeless?: boolean | "all" | undefined;
470
+ }, "disabled" | "size" | "active"> & {
471
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
472
+ readonly active?: boolean | undefined;
473
+ readonly disabled?: boolean | undefined;
474
+ } & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
475
+ readonly fullscreen?: boolean | undefined;
476
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
477
+ } & {
478
+ readonly fontFamily?: unknown;
479
+ readonly backgrounded?: boolean | undefined;
480
+ readonly radiused?: boolean | undefined;
481
+ readonly hoverTheme?: boolean | undefined;
482
+ readonly pressTheme?: boolean | undefined;
483
+ readonly focusTheme?: boolean | undefined;
484
+ readonly circular?: boolean | undefined;
485
+ readonly padded?: boolean | undefined;
486
+ readonly elevate?: boolean | undefined;
487
+ readonly bordered?: number | boolean | undefined;
488
+ readonly transparent?: boolean | undefined;
489
+ readonly chromeless?: boolean | "all" | undefined;
490
+ }, "disabled" | "size" | "active"> & {
491
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
492
+ readonly active?: boolean | undefined;
493
+ readonly disabled?: boolean | undefined;
494
+ }>> & import("@tamagui/core").PseudoProps<Partial<Omit<import("react-native").ViewProps, "display" | "children"> & import("@tamagui/core").RNWViewProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & Omit<{
495
+ readonly fullscreen?: boolean | undefined;
496
+ readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
497
+ } & {
498
+ readonly fontFamily?: unknown;
499
+ readonly backgrounded?: boolean | undefined;
500
+ readonly radiused?: boolean | undefined;
501
+ readonly hoverTheme?: boolean | undefined;
502
+ readonly pressTheme?: boolean | undefined;
503
+ readonly focusTheme?: boolean | undefined;
504
+ readonly circular?: boolean | undefined;
505
+ readonly padded?: boolean | undefined;
506
+ readonly elevate?: boolean | undefined;
507
+ readonly bordered?: number | boolean | undefined;
508
+ readonly transparent?: boolean | undefined;
509
+ readonly chromeless?: boolean | "all" | undefined;
510
+ }, "disabled" | "size" | "active"> & {
511
+ readonly size?: import("@tamagui/core").SizeTokens | undefined;
512
+ readonly active?: boolean | undefined;
513
+ readonly disabled?: boolean | undefined;
514
+ }>> & ThemeableProps & {
515
+ icon?: IconProp | undefined;
516
+ iconAfter?: IconProp | undefined;
517
+ scaleIcon?: number | undefined;
518
+ noTextWrap?: boolean | undefined;
519
+ spaceFlex?: number | boolean | undefined;
520
+ scaleSpace?: number | undefined;
521
+ } & React.RefAttributes<TamaguiElement>, "theme" | "themeInverse"> & {
522
+ theme?: import("@tamagui/core").ThemeName | null | undefined;
523
+ themeInverse?: boolean | undefined;
524
+ }) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
125
525
  export {};
126
526
  //# sourceMappingURL=Button.d.ts.map