@tamagui/button 3.0.0-beta.1358.1 → 3.0.0-beta.1386.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.
@@ -40,7 +40,10 @@ const ButtonFrame = (0, import_web.styled)(import_web.View, {
40
40
  flexDirection: "row",
41
41
  flexWrap: "nowrap",
42
42
  justifyContent: "center",
43
- variants: { disabled: { true: { pointerEvents: "none" } } }
43
+ variants: { disabled: {
44
+ true: { pointerEvents: "none" },
45
+ false: { "aria-disabled": false }
46
+ } }
44
47
  });
45
48
  const ButtonText = (0, import_web.styled)(import_web.Text, {
46
49
  flexGrow: 0,
@@ -83,8 +86,8 @@ function useButton(propsIn, { Text: Text2 = ButtonText, iconColor, iconSize: ico
83
86
  }) : void 0);
84
87
  const resolvedProps = {
85
88
  ...frameProps,
89
+ "aria-disabled": !!disabled,
86
90
  ...disabled && {
87
- "aria-disabled": true,
88
91
  disabled: true,
89
92
  tabIndex: -1
90
93
  },
@@ -42,7 +42,10 @@ var ButtonFrame = (0, import_web.styled)(import_web.View, {
42
42
  flexDirection: "row",
43
43
  flexWrap: "nowrap",
44
44
  justifyContent: "center",
45
- variants: { disabled: { true: { pointerEvents: "none" } } }
45
+ variants: { disabled: {
46
+ true: { pointerEvents: "none" },
47
+ false: { "aria-disabled": false }
48
+ } }
46
49
  });
47
50
  var ButtonText = (0, import_web.styled)(import_web.Text, {
48
51
  flexGrow: 0,
@@ -87,8 +90,8 @@ function useButton(propsIn) {
87
90
  }) : void 0;
88
91
  var resolvedProps = {
89
92
  ...frameProps,
93
+ "aria-disabled": !!disabled,
90
94
  ...disabled && {
91
- "aria-disabled": true,
92
95
  disabled: true,
93
96
  tabIndex: -1
94
97
  },
@@ -42,7 +42,10 @@ var ButtonFrame = (0, import_web.styled)(import_web.View, {
42
42
  flexDirection: "row",
43
43
  flexWrap: "nowrap",
44
44
  justifyContent: "center",
45
- variants: { disabled: { true: { pointerEvents: "none" } } }
45
+ variants: { disabled: {
46
+ true: { pointerEvents: "none" },
47
+ false: { "aria-disabled": false }
48
+ } }
46
49
  });
47
50
  var ButtonText = (0, import_web.styled)(import_web.Text, {
48
51
  flexGrow: 0,
@@ -87,8 +90,8 @@ function useButton(propsIn) {
87
90
  }) : void 0;
88
91
  var resolvedProps = {
89
92
  ...frameProps,
93
+ "aria-disabled": !!disabled,
90
94
  ...disabled && {
91
- "aria-disabled": true,
92
95
  disabled: true,
93
96
  tabIndex: -1
94
97
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Button.native.js","names":[],"sources":["cjs/Button.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Button_exports = {};\n__export(Button_exports, {\n ButtonFrame: () => ButtonFrame,\n ButtonIcon: () => ButtonIcon,\n ButtonText: () => ButtonText,\n useButton: () => useButton\n});\nmodule.exports = __toCommonJS(Button_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_helpers_tamagui = require(\"@tamagui/helpers-tamagui\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar import_react = require(\"react\");\nvar ButtonFrame = (0, import_web.styled)(import_web.View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\"\n }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar ButtonText = (0, import_web.styled)(import_web.Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nvar ButtonIcon = function(param) {\n var { children, color, scaleIcon = 1, size } = param;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn) {\n var { Text: _$Text = ButtonText, iconColor, iconSize: iconSizeOption, textProps: textPropsOption } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext);\n var [wrappedTextProps, buttonProps] = (0, import_web.splitStyleProps)(propsIn, {\n expandShorthands: true,\n filter: import_text.textParentProps\n });\n var { children, disabled, icon, iconAfter, iconSize, render, scaleIcon = 1, ...frameProps } = buttonProps;\n var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n var resolvedIconSize = iconSize !== null && iconSize !== void 0 ? iconSize : iconSizeOption;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n var [themedIcon, themedIconAfter] = [\n icon,\n iconAfter\n ].map(function(item) {\n return item ? getThemedIcon(item) : null;\n });\n var wrappedChildren = (0, import_text.wrapChildrenInText)(_$Text, {\n children,\n noTextWrap,\n textProps\n }, {\n ...textPropsOption,\n ...textStyleProps\n });\n var resolvedRender = render !== null && render !== void 0 ? render : isNested ? \"span\" : disabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\",\n disabled: true\n }) : void 0;\n var resolvedProps = {\n ...frameProps,\n ...disabled && {\n \"aria-disabled\": true,\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : {\n render: resolvedRender\n },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stacks.ButtonNestingContext.Provider, {\n value: true,\n children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ]\n })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAA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ACA;IACA;GACF;EACF,CAAC;CACH;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"Button.native.js","names":[],"sources":["cjs/Button.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Button_exports = {};\n__export(Button_exports, {\n ButtonFrame: () => ButtonFrame,\n ButtonIcon: () => ButtonIcon,\n ButtonText: () => ButtonText,\n useButton: () => useButton\n});\nmodule.exports = __toCommonJS(Button_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_helpers_tamagui = require(\"@tamagui/helpers-tamagui\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar import_react = require(\"react\");\nvar ButtonFrame = (0, import_web.styled)(import_web.View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\"\n }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n },\n false: {\n // @ts-ignore\n \"aria-disabled\": false\n }\n }\n }\n});\nvar ButtonText = (0, import_web.styled)(import_web.Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nvar ButtonIcon = function(param) {\n var { children, color, scaleIcon = 1, size } = param;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn) {\n var { Text: _$Text = ButtonText, iconColor, iconSize: iconSizeOption, textProps: textPropsOption } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext);\n var [wrappedTextProps, buttonProps] = (0, import_web.splitStyleProps)(propsIn, {\n expandShorthands: true,\n filter: import_text.textParentProps\n });\n var { children, disabled, icon, iconAfter, iconSize, render, scaleIcon = 1, ...frameProps } = buttonProps;\n var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n var resolvedIconSize = iconSize !== null && iconSize !== void 0 ? iconSize : iconSizeOption;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n var [themedIcon, themedIconAfter] = [\n icon,\n iconAfter\n ].map(function(item) {\n return item ? getThemedIcon(item) : null;\n });\n var wrappedChildren = (0, import_text.wrapChildrenInText)(_$Text, {\n children,\n noTextWrap,\n textProps\n }, {\n ...textPropsOption,\n ...textStyleProps\n });\n var resolvedRender = render !== null && render !== void 0 ? render : isNested ? \"span\" : disabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\",\n disabled: true\n }) : void 0;\n var resolvedProps = {\n ...frameProps,\n \"aria-disabled\": !!disabled,\n ...disabled && {\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : {\n render: resolvedRender\n },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stacks.ButtonNestingContext.Provider, {\n value: true,\n children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ]\n })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,iBAAiB,CAAC;AACtB,SAAS,gBAAgB;CACvB,mBAAmB;CACnB,kBAAkB;CAClB,kBAAkB;CAClB,iBAAiB;AACnB,CAAC;AACD,OAAO,UAAU,aAAa,cAAc;AAC5C,IAAI,qBAAqB,QAAQ,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AAG,mBAAmB;CACnD,IAAI,mBAAmB,aAAa,QAAQ,aAAa,KAAK,IAAI,WAAW;CAC7E,IAAI,iBAAiB,GAAG,uBAAuB,iBAAgB,CAAE;EAC/D,OAAO;EACP,MAAM,qBAAqB,KAAK,IAAI,KAAK,IAAI,mBAAmB;CAClE,CAAC;CACD,IAAI,CAAC,YAAY,mBAAmB,CAClC,MACA,SACF,CAAC,CAAC,IAAI,SAAS,MAAM;EACnB,OAAO,OAAO,cAAc,IAAI,IAAI;CACtC,CAAC;CACD,IAAI,mBAAmB,GAAG,YAAY,mBAAkB,CAAE,QAAQ;EAChE;EACA;EACA;CACF,GAAG;EACD,GAAG;EACH,GAAG;CACL,CAAC;CACD,IAAI,iBAAiB,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,WAAW,SAAS,WAA2B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,UAAU;EACxJ,MAAM;EACN,UAAU;CACZ,CAAC,IAAI,KAAK;CACV,IAAI,gBAAgB;EAClB,GAAG;EACH,iBAAiB,CAAC,CAAC;EACnB,GAAG,YAAY;GACb,UAAU;GACV,UAAU,CAAC;EACb;EACA,GAAG,mBAAmB,KAAK,IAAI,OAAO,EACpC,QAAQ,eACV;EACA,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,iBAAC,GAAG,mBAAmB,KAAI,CAAE,cAAc,qBAAqB,UAAU;GAClG,OAAO;GACP,UAAU;IACR;IACA;IACA;GACF;EACF,CAAC;CACH;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
@@ -13,7 +13,10 @@ const ButtonFrame = styled(View, {
13
13
  flexDirection: "row",
14
14
  flexWrap: "nowrap",
15
15
  justifyContent: "center",
16
- variants: { disabled: { true: { pointerEvents: "none" } } }
16
+ variants: { disabled: {
17
+ true: { pointerEvents: "none" },
18
+ false: { "aria-disabled": false }
19
+ } }
17
20
  });
18
21
  const ButtonText = styled(Text, {
19
22
  flexGrow: 0,
@@ -56,8 +59,8 @@ function useButton(propsIn, { Text: Text2 = ButtonText, iconColor, iconSize: ico
56
59
  }) : void 0);
57
60
  const resolvedProps = {
58
61
  ...frameProps,
62
+ "aria-disabled": !!disabled,
59
63
  ...disabled && {
60
- "aria-disabled": true,
61
64
  disabled: true,
62
65
  tabIndex: -1
63
66
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":[],"sources":["esm/Button.js"],"sourcesContent":["import { useGetThemedIcon } from \"@tamagui/helpers-tamagui\";\nimport { ButtonNestingContext } from \"@tamagui/stacks\";\nimport { textParentProps, wrapChildrenInText } from \"@tamagui/text\";\nimport { splitStyleProps, styled, Text, View } from \"@tamagui/web\";\nimport { useContext } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst ButtonFrame = styled(View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ jsx(\"button\", { type: \"button\" }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nconst ButtonText = styled(Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nconst ButtonIcon = ({ children, color, scaleIcon = 1, size }) => {\n const getThemedIcon = useGetThemedIcon({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn, {\n Text: Text2 = ButtonText,\n iconColor,\n iconSize: iconSizeOption,\n textProps: textPropsOption\n} = {}) {\n const isNested = useContext(ButtonNestingContext);\n const [wrappedTextProps, buttonProps] = splitStyleProps(propsIn, {\n expandShorthands: true,\n filter: textParentProps\n });\n const {\n children,\n disabled,\n icon,\n iconAfter,\n iconSize,\n render,\n scaleIcon = 1,\n ...frameProps\n } = buttonProps;\n const { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n const resolvedIconSize = iconSize ?? iconSizeOption;\n const getThemedIcon = useGetThemedIcon({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map((item) => {\n return item ? getThemedIcon(item) : null;\n });\n const wrappedChildren = wrapChildrenInText(\n Text2,\n { children, noTextWrap, textProps },\n { ...textPropsOption, ...textStyleProps }\n );\n const resolvedRender = render ?? (isNested ? \"span\" : disabled ? /* @__PURE__ */ jsx(\"button\", { type: \"button\", disabled: true }) : void 0);\n const resolvedProps = {\n ...frameProps,\n ...disabled && {\n \"aria-disabled\": true,\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : { render: resolvedRender },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ jsxs(ButtonNestingContext.Provider, { value: true, children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ] })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\nexport {\n ButtonFrame,\n ButtonIcon,\n ButtonText,\n useButton\n};\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;;;;;;AAMA,MAAM,cAAc,OAAO,MAAM;CAE/B,MAAM;CACN,QAAwB,oBAAI,UAAU,EAAE,MAAM,SAAS,CAAC;CACxD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AU,CAAC;EACb;EACA,GAAG,mBAAmB,KAAK,IAAI,OAAO,EAAE,QAAQ,eAAe;EAC/D,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,qBAAK,qBAAqB,UAAU;GAAE,OAAO;GAAM,UAAU;IACrF;IACA;IACA;GACF;EAAE,CAAC;CACL;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"Button.js","names":[],"sources":["esm/Button.js"],"sourcesContent":["import { useGetThemedIcon } from \"@tamagui/helpers-tamagui\";\nimport { ButtonNestingContext } from \"@tamagui/stacks\";\nimport { textParentProps, wrapChildrenInText } from \"@tamagui/text\";\nimport { splitStyleProps, styled, Text, View } from \"@tamagui/web\";\nimport { useContext } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst ButtonFrame = styled(View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ jsx(\"button\", { type: \"button\" }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n },\n false: {\n // @ts-ignore\n \"aria-disabled\": false\n }\n }\n }\n});\nconst ButtonText = styled(Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nconst ButtonIcon = ({ children, color, scaleIcon = 1, size }) => {\n const getThemedIcon = useGetThemedIcon({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn, {\n Text: Text2 = ButtonText,\n iconColor,\n iconSize: iconSizeOption,\n textProps: textPropsOption\n} = {}) {\n const isNested = useContext(ButtonNestingContext);\n const [wrappedTextProps, buttonProps] = splitStyleProps(propsIn, {\n expandShorthands: true,\n filter: textParentProps\n });\n const {\n children,\n disabled,\n icon,\n iconAfter,\n iconSize,\n render,\n scaleIcon = 1,\n ...frameProps\n } = buttonProps;\n const { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n const resolvedIconSize = iconSize ?? iconSizeOption;\n const getThemedIcon = useGetThemedIcon({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map((item) => {\n return item ? getThemedIcon(item) : null;\n });\n const wrappedChildren = wrapChildrenInText(\n Text2,\n { children, noTextWrap, textProps },\n { ...textPropsOption, ...textStyleProps }\n );\n const resolvedRender = render ?? (isNested ? \"span\" : disabled ? /* @__PURE__ */ jsx(\"button\", { type: \"button\", disabled: true }) : void 0);\n const resolvedProps = {\n ...frameProps,\n \"aria-disabled\": !!disabled,\n ...disabled && {\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : { render: resolvedRender },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ jsxs(ButtonNestingContext.Provider, { value: true, children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ] })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\nexport {\n ButtonFrame,\n ButtonIcon,\n ButtonText,\n useButton\n};\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;;;;;;AAMA,MAAM,cA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,UAAU;CAAK,CAAC,IAAI,KAAK;CAC1I,MAAM,gBAAgB;EACpB,GAAG;EACH,iBAAiB,CAAC,CAAC;EACnB,GAAG,YAAY;GACb,UAAU;GACV,UAAU,CAAC;EACb;EACA,GAAG,mBAAmB,KAAK,IAAI,OAAO,EAAE,QAAQ,eAAe;EAC/D,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,qBAAK,qBAAqB,UAAU;GAAE,OAAO;GAAM,UAAU;IACrF;IACA;IACA;GACF;EAAE,CAAC;CACL;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
@@ -13,7 +13,10 @@ var ButtonFrame = styled(View, {
13
13
  flexDirection: "row",
14
14
  flexWrap: "nowrap",
15
15
  justifyContent: "center",
16
- variants: { disabled: { true: { pointerEvents: "none" } } }
16
+ variants: { disabled: {
17
+ true: { pointerEvents: "none" },
18
+ false: { "aria-disabled": false }
19
+ } }
17
20
  });
18
21
  var ButtonText = styled(Text, {
19
22
  flexGrow: 0,
@@ -58,8 +61,8 @@ function useButton(propsIn) {
58
61
  }) : void 0;
59
62
  var resolvedProps = {
60
63
  ...frameProps,
64
+ "aria-disabled": !!disabled,
61
65
  ...disabled && {
62
- "aria-disabled": true,
63
66
  disabled: true,
64
67
  tabIndex: -1
65
68
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Button.native.js","names":[],"sources":["esm/Button.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useGetThemedIcon } from \"@tamagui/helpers-tamagui\";\nimport { ButtonNestingContext } from \"@tamagui/stacks\";\nimport { textParentProps, wrapChildrenInText } from \"@tamagui/text\";\nimport { splitStyleProps, styled, Text, View } from \"@tamagui/web\";\nimport { useContext } from \"react\";\nvar ButtonFrame = styled(View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ _jsx(\"button\", {\n type: \"button\"\n }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar ButtonText = styled(Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nvar ButtonIcon = function(param) {\n var { children, color, scaleIcon = 1, size } = param;\n var getThemedIcon = useGetThemedIcon({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn) {\n var { Text: _$Text = ButtonText, iconColor, iconSize: iconSizeOption, textProps: textPropsOption } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var isNested = useContext(ButtonNestingContext);\n var [wrappedTextProps, buttonProps] = splitStyleProps(propsIn, {\n expandShorthands: true,\n filter: textParentProps\n });\n var { children, disabled, icon, iconAfter, iconSize, render, scaleIcon = 1, ...frameProps } = buttonProps;\n var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n var resolvedIconSize = iconSize !== null && iconSize !== void 0 ? iconSize : iconSizeOption;\n var getThemedIcon = useGetThemedIcon({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n var [themedIcon, themedIconAfter] = [\n icon,\n iconAfter\n ].map(function(item) {\n return item ? getThemedIcon(item) : null;\n });\n var wrappedChildren = wrapChildrenInText(_$Text, {\n children,\n noTextWrap,\n textProps\n }, {\n ...textPropsOption,\n ...textStyleProps\n });\n var resolvedRender = render !== null && render !== void 0 ? render : isNested ? \"span\" : disabled ? /* @__PURE__ */ _jsx(\"button\", {\n type: \"button\",\n disabled: true\n }) : void 0;\n var resolvedProps = {\n ...frameProps,\n ...disabled && {\n \"aria-disabled\": true,\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : {\n render: resolvedRender\n },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ _jsxs(ButtonNestingContext.Provider, {\n value: true,\n children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ]\n })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\nexport {\n ButtonFrame,\n ButtonIcon,\n ButtonText,\n useButton\n};\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;;;;;;AAMA,IAAI,cAAc,OAAO,MAAM;CAE7B,MAAM;CACN,QAAwB,oBAAK,UAAU,EACrC,MAAM,SACR,CAAC;CACD,UAAU;CACV,YAAY;CACZ,eAAe;CACf,UAAU;CACV,gBAAgB;CAChB,UAAU,EACR,UAAU,EACR,MAAM,EACJ,eAAe,OACjB,EACF,EACF;AACF,CAAC;AACD,IAAI,aAAa,OAAO,MAAM;CAE5B,UAAU;CACV,YAAY;AACd,CAAC;AACD,IAAI,aAAa,SAAS,OAAO;CAC/B,IAAI,EAAE,UAAU,OAAO,YAAY,GAAG,SAAS;CAC/C,IAAI,gBAAgB,iBAAiB;EACnC;EACA,MAAM,SAAS,KAAK,IAAI,KAAK,IAAI,OAAO;CAC1C,CAAC;CACD,OAAO,cAAc,QAAQ;AAC/B;AACA,SAAS,UAAU,SAAS;CAC1B,IAAI,EAAE,MAAM,SAAS,YAAY,WAAW,UAAU,gBAAgB,WAAW,oBAAoB,UAAU,SAAS,KAAK,UAA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IACA;GACF;EACF,CAAC;CACH;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"Button.native.js","names":[],"sources":["esm/Button.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useGetThemedIcon } from \"@tamagui/helpers-tamagui\";\nimport { ButtonNestingContext } from \"@tamagui/stacks\";\nimport { textParentProps, wrapChildrenInText } from \"@tamagui/text\";\nimport { splitStyleProps, styled, Text, View } from \"@tamagui/web\";\nimport { useContext } from \"react\";\nvar ButtonFrame = styled(View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ _jsx(\"button\", {\n type: \"button\"\n }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n },\n false: {\n // @ts-ignore\n \"aria-disabled\": false\n }\n }\n }\n});\nvar ButtonText = styled(Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nvar ButtonIcon = function(param) {\n var { children, color, scaleIcon = 1, size } = param;\n var getThemedIcon = useGetThemedIcon({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn) {\n var { Text: _$Text = ButtonText, iconColor, iconSize: iconSizeOption, textProps: textPropsOption } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var isNested = useContext(ButtonNestingContext);\n var [wrappedTextProps, buttonProps] = splitStyleProps(propsIn, {\n expandShorthands: true,\n filter: textParentProps\n });\n var { children, disabled, icon, iconAfter, iconSize, render, scaleIcon = 1, ...frameProps } = buttonProps;\n var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n var resolvedIconSize = iconSize !== null && iconSize !== void 0 ? iconSize : iconSizeOption;\n var getThemedIcon = useGetThemedIcon({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n var [themedIcon, themedIconAfter] = [\n icon,\n iconAfter\n ].map(function(item) {\n return item ? getThemedIcon(item) : null;\n });\n var wrappedChildren = wrapChildrenInText(_$Text, {\n children,\n noTextWrap,\n textProps\n }, {\n ...textPropsOption,\n ...textStyleProps\n });\n var resolvedRender = render !== null && render !== void 0 ? render : isNested ? \"span\" : disabled ? /* @__PURE__ */ _jsx(\"button\", {\n type: \"button\",\n disabled: true\n }) : void 0;\n var resolvedProps = {\n ...frameProps,\n \"aria-disabled\": !!disabled,\n ...disabled && {\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : {\n render: resolvedRender\n },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ _jsxs(ButtonNestingContext.Provider, {\n value: true,\n children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ]\n })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\nexport {\n ButtonFrame,\n ButtonIcon,\n ButtonText,\n useButton\n};\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;;;;;;AAMA,IAAI,cAAc,OAAO,MAAM;CAE7B,MAAM;CACN,QAAwB,oBAAK,UAAU,EACrC,MAAM,SACR,CAAC;CACD,UAAU;CACV,YAAY;CACZ,eAAe;CACf,UAAU;CACV,gBAAgB;CAChB,UAAU,EACR,UAAU;EACR,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EAEL,iBAAiB,MACnB;CACF,EACF;AACF,CAAC;AACD,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C,CAAC;EACnB,GAAG,YAAY;GACb,UAAU;GACV,UAAU,CAAC;EACb;EACA,GAAG,mBAAmB,KAAK,IAAI,OAAO,EACpC,QAAQ,eACV;EACA,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,qBAAM,qBAAqB,UAAU;GAC7D,OAAO;GACP,UAAU;IACR;IACA;IACA;GACF;EACF,CAAC;CACH;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
@@ -13,7 +13,10 @@ const ButtonFrame = styled(View, {
13
13
  flexDirection: "row",
14
14
  flexWrap: "nowrap",
15
15
  justifyContent: "center",
16
- variants: { disabled: { true: { pointerEvents: "none" } } }
16
+ variants: { disabled: {
17
+ true: { pointerEvents: "none" },
18
+ false: { "aria-disabled": false }
19
+ } }
17
20
  });
18
21
  const ButtonText = styled(Text, {
19
22
  flexGrow: 0,
@@ -56,8 +59,8 @@ function useButton(propsIn, { Text: Text2 = ButtonText, iconColor, iconSize: ico
56
59
  }) : void 0);
57
60
  const resolvedProps = {
58
61
  ...frameProps,
62
+ "aria-disabled": !!disabled,
59
63
  ...disabled && {
60
- "aria-disabled": true,
61
64
  disabled: true,
62
65
  tabIndex: -1
63
66
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":[],"sources":["jsx/Button.js"],"sourcesContent":["import { useGetThemedIcon } from \"@tamagui/helpers-tamagui\";\nimport { ButtonNestingContext } from \"@tamagui/stacks\";\nimport { textParentProps, wrapChildrenInText } from \"@tamagui/text\";\nimport { splitStyleProps, styled, Text, View } from \"@tamagui/web\";\nimport { useContext } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst ButtonFrame = styled(View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ jsx(\"button\", { type: \"button\" }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nconst ButtonText = styled(Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nconst ButtonIcon = ({ children, color, scaleIcon = 1, size }) => {\n const getThemedIcon = useGetThemedIcon({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn, {\n Text: Text2 = ButtonText,\n iconColor,\n iconSize: iconSizeOption,\n textProps: textPropsOption\n} = {}) {\n const isNested = useContext(ButtonNestingContext);\n const [wrappedTextProps, buttonProps] = splitStyleProps(propsIn, {\n expandShorthands: true,\n filter: textParentProps\n });\n const {\n children,\n disabled,\n icon,\n iconAfter,\n iconSize,\n render,\n scaleIcon = 1,\n ...frameProps\n } = buttonProps;\n const { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n const resolvedIconSize = iconSize ?? iconSizeOption;\n const getThemedIcon = useGetThemedIcon({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map((item) => {\n return item ? getThemedIcon(item) : null;\n });\n const wrappedChildren = wrapChildrenInText(\n Text2,\n { children, noTextWrap, textProps },\n { ...textPropsOption, ...textStyleProps }\n );\n const resolvedRender = render ?? (isNested ? \"span\" : disabled ? /* @__PURE__ */ jsx(\"button\", { type: \"button\", disabled: true }) : void 0);\n const resolvedProps = {\n ...frameProps,\n ...disabled && {\n \"aria-disabled\": true,\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : { render: resolvedRender },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ jsxs(ButtonNestingContext.Provider, { value: true, children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ] })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\nexport {\n ButtonFrame,\n ButtonIcon,\n ButtonText,\n useButton\n};\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;;;;;;AAMA,MAAM,cAAc,OAAO,MAAM;CAE/B,MAAM;CACN,QAAwB,oBAAI,UAAU,EAAE,MAAM,SAAS,CAAC;CACxD,UAAU;CACV,YAAY;CACZ,eAAe;CACf,UAAU;CACV,gBAAgB;CAChB,UAAU,EACR,UAAU,EACR,MAAM,EACJ,eAAe,OACjB,EACF,EACF;AACF,CAAC;AACD,MAAM,aAAa,OAAO,MAAM;CAE9B,UAAU;CACV,YAAY;AACd,CAAC;AACD,MAAM,cAAc,EAAE,UAAU,OAAO,YAAY,GAAG,WAAW;CAC/D,MAAM,gBAAgB,iBAAiB;EACrC;EACA,MAAM,SAAS,KAAK,IAAI,KAAK,IAAI,OAAO;CAC1C,CAAC;CACD,OAAO,cAAc,QAAQ;AAC/B;AACA,SAAS,UAAU,SAAS,EAC1B,MAAM,QAAQ,YACd,WACA,UAAU,gBACV,WAAW,oBACT,CAAC,GAAG;CACN,MAAM,WAAW,WAAW,oBAAoB;CAChD,MAAM,CAAC,kBAAkB,eAAe,gBAAgB,SAAS;EAC/D,kBAAkB;EAClB,QAAQ;CACV,CAAC;CACD,MAAM,EACJ,UACA,UACA,MACA,WACA,UACA,QACA,YAAY,GACZ,GAAG,eACD;CACJ,MAAM,EAAE,YAAY,WAAW,GAAG,mBAAmB;CACrD,MAAM,mBAAmB,YAAY;CACrC,MAAM,gBAAgB,iBAAiB;EACrC,OAAO;EACP,MAAM,qBAAqB,KAAK,IAAI,KAAK,IAAI,mBAAmB;CAClE,CAAC;CACD,MAAM,CAAC,YAAY,mBAAmB,CAAC,MAAM,SAAS,CAAC,CAAC,KAAK,SAAS;EACpE,OAAO,OAAO,cAAc,IAAI,IAAI;CACtC,CAAC;CACD,MAAM,kBAAkB,mBACtB,OACA;EAAE;EAAU;EAAY;CAAU,GAClC;EAAE,GAAG;EAAiB,GAAG;CAAe,CAC1C;CACA,MAAM,iBAAiB,WAAW,WAAW,SAAS,WAA2B,oBAAI,UAAU;EAAE,MAAM;EAAU,UAAU;CAAK,CAAC,IAAI,KAAK;CAC1I,MAAM,gBAAgB;EACpB,GAAG;EACH,GAAG,YAAY;GACb,iBAAiB;GACjB,UAAU;GACV,UAAU,CAAC;EACb;EACA,GAAG,mBAAmB,KAAK,IAAI,OAAO,EAAE,QAAQ,eAAe;EAC/D,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,qBAAK,qBAAqB,UAAU;GAAE,OAAO;GAAM,UAAU;IACrF;IACA;IACA;GACF;EAAE,CAAC;CACL;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"Button.js","names":[],"sources":["jsx/Button.js"],"sourcesContent":["import { useGetThemedIcon } from \"@tamagui/helpers-tamagui\";\nimport { ButtonNestingContext } from \"@tamagui/stacks\";\nimport { textParentProps, wrapChildrenInText } from \"@tamagui/text\";\nimport { splitStyleProps, styled, Text, View } from \"@tamagui/web\";\nimport { useContext } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst ButtonFrame = styled(View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ jsx(\"button\", { type: \"button\" }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n },\n false: {\n // @ts-ignore\n \"aria-disabled\": false\n }\n }\n }\n});\nconst ButtonText = styled(Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nconst ButtonIcon = ({ children, color, scaleIcon = 1, size }) => {\n const getThemedIcon = useGetThemedIcon({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn, {\n Text: Text2 = ButtonText,\n iconColor,\n iconSize: iconSizeOption,\n textProps: textPropsOption\n} = {}) {\n const isNested = useContext(ButtonNestingContext);\n const [wrappedTextProps, buttonProps] = splitStyleProps(propsIn, {\n expandShorthands: true,\n filter: textParentProps\n });\n const {\n children,\n disabled,\n icon,\n iconAfter,\n iconSize,\n render,\n scaleIcon = 1,\n ...frameProps\n } = buttonProps;\n const { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n const resolvedIconSize = iconSize ?? iconSizeOption;\n const getThemedIcon = useGetThemedIcon({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n const [themedIcon, themedIconAfter] = [icon, iconAfter].map((item) => {\n return item ? getThemedIcon(item) : null;\n });\n const wrappedChildren = wrapChildrenInText(\n Text2,\n { children, noTextWrap, textProps },\n { ...textPropsOption, ...textStyleProps }\n );\n const resolvedRender = render ?? (isNested ? \"span\" : disabled ? /* @__PURE__ */ jsx(\"button\", { type: \"button\", disabled: true }) : void 0);\n const resolvedProps = {\n ...frameProps,\n \"aria-disabled\": !!disabled,\n ...disabled && {\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : { render: resolvedRender },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ jsxs(ButtonNestingContext.Provider, { value: true, children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ] })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\nexport {\n ButtonFrame,\n ButtonIcon,\n ButtonText,\n useButton\n};\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;;;;;;AAMA,MAAM,cAAc,OAAO,MAAM;CAE/B,MAAM;CACN,QAAwB,oBAAI,UAAU,EAAE,MAAM,SAAS,CAAC;CACxD,UAAU;CACV,YAAY;CACZ,eAAe;CACf,UAAU;CACV,gBAAgB;CAChB,UAAU,EACR,UAAU;EACR,MAAM,EACJ,eAAe,OACjB;EACA,OAAO,EAEL,iBAAiB,MACnB;CACF,EACF;AACF,CAAC;AACD,MAAM,aAAa,OAAO,MAAM;CAE9B,UAAU;CACV,YAAY;AACd,CAAC;AACD,MAAM,cAAc,EAAE,UAAU,OAAO,YAAY,GAAG,WAAW;CAC/D,MAAM,gBAAgB,iBAAiB;EACrC;EACA,MAAM,SAAS,KAAK,IAAI,KAAK,IAAI,OAAO;CAC1C,CAAC;CACD,OAAO,cAAc,QAAQ;AAC/B;AACA,SAAS,UAAU,SAAS,EAC1B,MAAM,QAAQ,YACd,WACA,UAAU,gBACV,WAAW,oBACT,CAAC,GAAG;CACN,MAAM,WAAW,WAAW,oBAAoB;CAChD,MAAM,CAAC,kBAAkB,eAAe,gBAAgB,SAAS;EAC/D,kBAAkB;EAClB,QAAQ;CACV,CAAC;CACD,MAAM,EACJ,UACA,UACA,MACA,WACA,UACA,QACA,YAAY,GACZ,GAAG,eACD;CACJ,MAAM,EAAE,YAAY,WAAW,GAAG,mBAAmB;CACrD,MAAM,mBAAmB,YAAY;CACrC,MAAM,gBAAgB,iBAAiB;EACrC,OAAO;EACP,MAAM,qBAAqB,KAAK,IAAI,KAAK,IAAI,mBAAmB;CAClE,CAAC;CACD,MAAM,CAAC,YAAY,mBAAmB,CAAC,MAAM,SAAS,CAAC,CAAC,KAAK,SAAS;EACpE,OAAO,OAAO,cAAc,IAAI,IAAI;CACtC,CAAC;CACD,MAAM,kBAAkB,mBACtB,OACA;EAAE;EAAU;EAAY;CAAU,GAClC;EAAE,GAAG;EAAiB,GAAG;CAAe,CAC1C;CACA,MAAM,iBAAiB,WAAW,WAAW,SAAS,WAA2B,oBAAI,UAAU;EAAE,MAAM;EAAU,UAAU;CAAK,CAAC,IAAI,KAAK;CAC1I,MAAM,gBAAgB;EACpB,GAAG;EACH,iBAAiB,CAAC,CAAC;EACnB,GAAG,YAAY;GACb,UAAU;GACV,UAAU,CAAC;EACb;EACA,GAAG,mBAAmB,KAAK,IAAI,OAAO,EAAE,QAAQ,eAAe;EAC/D,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,qBAAK,qBAAqB,UAAU;GAAE,OAAO;GAAM,UAAU;IACrF;IACA;IACA;GACF;EAAE,CAAC;CACL;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
@@ -42,7 +42,10 @@ var ButtonFrame = (0, import_web.styled)(import_web.View, {
42
42
  flexDirection: "row",
43
43
  flexWrap: "nowrap",
44
44
  justifyContent: "center",
45
- variants: { disabled: { true: { pointerEvents: "none" } } }
45
+ variants: { disabled: {
46
+ true: { pointerEvents: "none" },
47
+ false: { "aria-disabled": false }
48
+ } }
46
49
  });
47
50
  var ButtonText = (0, import_web.styled)(import_web.Text, {
48
51
  flexGrow: 0,
@@ -87,8 +90,8 @@ function useButton(propsIn) {
87
90
  }) : void 0;
88
91
  var resolvedProps = {
89
92
  ...frameProps,
93
+ "aria-disabled": !!disabled,
90
94
  ...disabled && {
91
- "aria-disabled": true,
92
95
  disabled: true,
93
96
  tabIndex: -1
94
97
  },
@@ -42,7 +42,10 @@ var ButtonFrame = (0, import_web.styled)(import_web.View, {
42
42
  flexDirection: "row",
43
43
  flexWrap: "nowrap",
44
44
  justifyContent: "center",
45
- variants: { disabled: { true: { pointerEvents: "none" } } }
45
+ variants: { disabled: {
46
+ true: { pointerEvents: "none" },
47
+ false: { "aria-disabled": false }
48
+ } }
46
49
  });
47
50
  var ButtonText = (0, import_web.styled)(import_web.Text, {
48
51
  flexGrow: 0,
@@ -87,8 +90,8 @@ function useButton(propsIn) {
87
90
  }) : void 0;
88
91
  var resolvedProps = {
89
92
  ...frameProps,
93
+ "aria-disabled": !!disabled,
90
94
  ...disabled && {
91
- "aria-disabled": true,
92
95
  disabled: true,
93
96
  tabIndex: -1
94
97
  },
@@ -1 +1 @@
1
- {"version":3,"file":"Button.native.js","names":[],"sources":["jsx/Button.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Button_exports = {};\n__export(Button_exports, {\n ButtonFrame: () => ButtonFrame,\n ButtonIcon: () => ButtonIcon,\n ButtonText: () => ButtonText,\n useButton: () => useButton\n});\nmodule.exports = __toCommonJS(Button_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_helpers_tamagui = require(\"@tamagui/helpers-tamagui\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar import_react = require(\"react\");\nvar ButtonFrame = (0, import_web.styled)(import_web.View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\"\n }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar ButtonText = (0, import_web.styled)(import_web.Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nvar ButtonIcon = function(param) {\n var { children, color, scaleIcon = 1, size } = param;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn) {\n var { Text: _$Text = ButtonText, iconColor, iconSize: iconSizeOption, textProps: textPropsOption } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext);\n var [wrappedTextProps, buttonProps] = (0, import_web.splitStyleProps)(propsIn, {\n expandShorthands: true,\n filter: import_text.textParentProps\n });\n var { children, disabled, icon, iconAfter, iconSize, render, scaleIcon = 1, ...frameProps } = buttonProps;\n var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n var resolvedIconSize = iconSize !== null && iconSize !== void 0 ? iconSize : iconSizeOption;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n var [themedIcon, themedIconAfter] = [\n icon,\n iconAfter\n ].map(function(item) {\n return item ? getThemedIcon(item) : null;\n });\n var wrappedChildren = (0, import_text.wrapChildrenInText)(_$Text, {\n children,\n noTextWrap,\n textProps\n }, {\n ...textPropsOption,\n ...textStyleProps\n });\n var resolvedRender = render !== null && render !== void 0 ? render : isNested ? \"span\" : disabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\",\n disabled: true\n }) : void 0;\n var resolvedProps = {\n ...frameProps,\n ...disabled && {\n \"aria-disabled\": true,\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : {\n render: resolvedRender\n },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stacks.ButtonNestingContext.Provider, {\n value: true,\n children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ]\n })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;C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;CACZ,CAAC,IAAI,KAAK;CACV,IAAI,gBAAgB;EAClB,GAAG;EACH,GAAG,YAAY;GACb,iBAAiB;GACjB,UAAU;GACV,UAAU,CAAC;EACb;EACA,GAAG,mBAAmB,KAAK,IAAI,OAAO,EACpC,QAAQ,eACV;EACA,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,iBAAC,GAAG,mBAAmB,KAAI,CAAE,cAAc,qBAAqB,UAAU;GAClG,OAAO;GACP,UAAU;IACR;IACA;IACA;GACF;EACF,CAAC;CACH;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"Button.native.js","names":[],"sources":["jsx/Button.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar Button_exports = {};\n__export(Button_exports, {\n ButtonFrame: () => ButtonFrame,\n ButtonIcon: () => ButtonIcon,\n ButtonText: () => ButtonText,\n useButton: () => useButton\n});\nmodule.exports = __toCommonJS(Button_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_helpers_tamagui = require(\"@tamagui/helpers-tamagui\");\nvar import_stacks = require(\"@tamagui/stacks\");\nvar import_text = require(\"@tamagui/text\");\nvar import_web = require(\"@tamagui/web\");\nvar import_react = require(\"react\");\nvar ButtonFrame = (0, import_web.styled)(import_web.View, {\n // role is the cross-platform one; render only lands on web\n role: \"button\",\n render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\"\n }),\n tabIndex: 0,\n alignItems: \"center\",\n flexDirection: \"row\",\n flexWrap: \"nowrap\",\n justifyContent: \"center\",\n variants: {\n disabled: {\n true: {\n pointerEvents: \"none\"\n },\n false: {\n // @ts-ignore\n \"aria-disabled\": false\n }\n }\n }\n});\nvar ButtonText = (0, import_web.styled)(import_web.Text, {\n // flexGrow 1 pushes text to the start of its parent on native\n flexGrow: 0,\n flexShrink: 1\n});\nvar ButtonIcon = function(param) {\n var { children, color, scaleIcon = 1, size } = param;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color,\n size: size === void 0 ? void 0 : size * scaleIcon\n });\n return getThemedIcon(children);\n};\nfunction useButton(propsIn) {\n var { Text: _$Text = ButtonText, iconColor, iconSize: iconSizeOption, textProps: textPropsOption } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n var isNested = (0, import_react.useContext)(import_stacks.ButtonNestingContext);\n var [wrappedTextProps, buttonProps] = (0, import_web.splitStyleProps)(propsIn, {\n expandShorthands: true,\n filter: import_text.textParentProps\n });\n var { children, disabled, icon, iconAfter, iconSize, render, scaleIcon = 1, ...frameProps } = buttonProps;\n var { noTextWrap, textProps, ...textStyleProps } = wrappedTextProps;\n var resolvedIconSize = iconSize !== null && iconSize !== void 0 ? iconSize : iconSizeOption;\n var getThemedIcon = (0, import_helpers_tamagui.useGetThemedIcon)({\n color: iconColor,\n size: resolvedIconSize === void 0 ? void 0 : resolvedIconSize * scaleIcon\n });\n var [themedIcon, themedIconAfter] = [\n icon,\n iconAfter\n ].map(function(item) {\n return item ? getThemedIcon(item) : null;\n });\n var wrappedChildren = (0, import_text.wrapChildrenInText)(_$Text, {\n children,\n noTextWrap,\n textProps\n }, {\n ...textPropsOption,\n ...textStyleProps\n });\n var resolvedRender = render !== null && render !== void 0 ? render : isNested ? \"span\" : disabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(\"button\", {\n type: \"button\",\n disabled: true\n }) : void 0;\n var resolvedProps = {\n ...frameProps,\n \"aria-disabled\": !!disabled,\n ...disabled && {\n disabled: true,\n tabIndex: -1\n },\n ...resolvedRender === void 0 ? null : {\n render: resolvedRender\n },\n ...isNested && {\n // a nested Button is a presentation part, not a control: strip the\n // interactive semantics so we never place a focusable role=button (with\n // its own press/keyboard handlers) inside the outer native <button>. that\n // nesting is invalid html, adds an extra focus stop, and bubbles\n // activation to the outer control. resolvedRender already makes it a span.\n role: \"none\",\n tabIndex: -1,\n \"aria-disabled\": void 0,\n disabled: void 0,\n onPress: void 0,\n onPressIn: void 0,\n onPressOut: void 0,\n onLongPress: void 0,\n onClick: void 0,\n onKeyDown: void 0,\n onKeyUp: void 0\n },\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stacks.ButtonNestingContext.Provider, {\n value: true,\n children: [\n themedIcon,\n wrappedChildren,\n themedIconAfter\n ]\n })\n };\n return {\n isNested,\n props: resolvedProps\n };\n}\n//# sourceMappingURL=Button.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK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QAAQ,eACV;EACA,GAAG,YAAY;GAMb,MAAM;GACN,UAAU,CAAC;GACX,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,YAAY,KAAK;GACjB,aAAa,KAAK;GAClB,SAAS,KAAK;GACd,WAAW,KAAK;GAChB,SAAS,KAAK;EAChB;EACA,UAA0B,iBAAC,GAAG,mBAAmB,KAAI,CAAE,cAAc,qBAAqB,UAAU;GAClG,OAAO;GACP,UAAU;IACR;IACA;IACA;GACF;EACF,CAAC;CACH;CACA,OAAO;EACL;EACA,OAAO;CACT;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/button",
3
- "version": "3.0.0-beta.1358.1",
3
+ "version": "3.0.0-beta.1386.1",
4
4
  "license": "MIT",
5
5
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
6
6
  "source": "src/index.ts",
@@ -36,18 +36,18 @@
36
36
  "clean:build": "tamagui-build clean:build"
37
37
  },
38
38
  "dependencies": {
39
- "@tamagui/config-default": "3.0.0-beta.1358.1",
40
- "@tamagui/core": "3.0.0-beta.1358.1",
41
- "@tamagui/helpers": "3.0.0-beta.1358.1",
42
- "@tamagui/helpers-tamagui": "3.0.0-beta.1358.1",
43
- "@tamagui/spacer": "3.0.0-beta.1358.1",
44
- "@tamagui/stacks": "3.0.0-beta.1358.1",
45
- "@tamagui/text": "3.0.0-beta.1358.1",
46
- "@tamagui/font-size": "3.0.0-beta.1358.1",
47
- "@tamagui/web": "3.0.0-beta.1358.1"
39
+ "@tamagui/config-default": "3.0.0-beta.1386.1",
40
+ "@tamagui/core": "3.0.0-beta.1386.1",
41
+ "@tamagui/helpers": "3.0.0-beta.1386.1",
42
+ "@tamagui/helpers-tamagui": "3.0.0-beta.1386.1",
43
+ "@tamagui/spacer": "3.0.0-beta.1386.1",
44
+ "@tamagui/stacks": "3.0.0-beta.1386.1",
45
+ "@tamagui/text": "3.0.0-beta.1386.1",
46
+ "@tamagui/font-size": "3.0.0-beta.1386.1",
47
+ "@tamagui/web": "3.0.0-beta.1386.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@tamagui/build": "3.0.0-beta.1358.1",
50
+ "@tamagui/build": "3.0.0-beta.1386.1",
51
51
  "react": "19.2.3",
52
52
  "vitest": "4.1.0"
53
53
  },
package/src/Button.tsx CHANGED
@@ -22,6 +22,10 @@ export const ButtonFrame = styled(View, {
22
22
  true: {
23
23
  pointerEvents: 'none',
24
24
  },
25
+ false: {
26
+ // @ts-ignore
27
+ 'aria-disabled': false,
28
+ },
25
29
  },
26
30
  } as const,
27
31
  })
@@ -164,8 +168,8 @@ export function useButton<Props extends ButtonBehaviorProps>(
164
168
 
165
169
  const resolvedProps = {
166
170
  ...frameProps,
171
+ 'aria-disabled': !!disabled,
167
172
  ...(disabled && {
168
- 'aria-disabled': true,
169
173
  disabled: true,
170
174
  tabIndex: -1,
171
175
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,eAAe,EAAsB,MAAM,eAAe,CAAA;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAA;AAE3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAG9D,eAAO,MAAM,WAAW;;;;;;;;;;CAiBtB,CAAA;AAEF,eAAO,MAAM,UAAU;;;;CAIrB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,U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