@react-spectrum/button 3.16.3 → 3.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionButton.main.js +17 -17
- package/dist/ActionButton.mjs +18 -18
- package/dist/ActionButton.module.js +17 -17
- package/dist/Button.main.js +41 -32
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +42 -33
- package/dist/Button.module.js +41 -32
- package/dist/Button.module.js.map +1 -1
- package/dist/ClearButton.main.js +7 -7
- package/dist/ClearButton.mjs +8 -8
- package/dist/ClearButton.module.js +7 -7
- package/dist/FieldButton.main.js +10 -10
- package/dist/FieldButton.main.js.map +1 -1
- package/dist/FieldButton.mjs +11 -11
- package/dist/FieldButton.module.js +10 -10
- package/dist/FieldButton.module.js.map +1 -1
- package/dist/LogicButton.main.js +6 -6
- package/dist/LogicButton.mjs +7 -7
- package/dist/LogicButton.module.js +6 -6
- package/dist/ToggleButton.main.js +15 -15
- package/dist/ToggleButton.mjs +16 -16
- package/dist/ToggleButton.module.js +15 -15
- package/dist/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/button_vars_css.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/intlStrings.mjs +1 -1
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +15 -15
- package/src/Button.tsx +14 -1
- package/src/FieldButton.tsx +3 -3
@@ -52,34 +52,34 @@ function $b5c927da7d8f1be6$var$ToggleButton(props, ref) {
|
|
52
52
|
let { styleProps: styleProps } = (0, $58xyJ$reactspectrumutils.useStyleProps)(otherProps);
|
53
53
|
let isTextOnly = (0, ($parcel$interopDefault($58xyJ$react))).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, ($parcel$interopDefault($58xyJ$react))).isValidElement(c));
|
54
54
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($58xyJ$react))).createElement((0, $58xyJ$reactariafocus.FocusRing), {
|
55
|
-
focusRingClass: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
55
|
+
focusRingClass: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'focus-ring'),
|
56
56
|
autoFocus: autoFocus
|
57
57
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($58xyJ$react))).createElement("button", {
|
58
58
|
...styleProps,
|
59
59
|
...(0, $58xyJ$reactariautils.mergeProps)(buttonProps, hoverProps),
|
60
60
|
ref: domRef,
|
61
|
-
className: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
className: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-ActionButton', {
|
62
|
+
'spectrum-ActionButton--quiet': isQuiet,
|
63
|
+
'spectrum-ActionButton--emphasized': isEmphasized,
|
64
|
+
'spectrum-ActionButton--staticColor': !!staticColor,
|
65
|
+
'spectrum-ActionButton--staticWhite': staticColor === 'white',
|
66
|
+
'spectrum-ActionButton--staticBlack': staticColor === 'black',
|
67
|
+
'is-active': isPressed,
|
68
|
+
'is-disabled': isDisabled,
|
69
|
+
'is-hovered': isHovered,
|
70
|
+
'is-selected': state.isSelected
|
71
71
|
}, styleProps.className)
|
72
72
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($58xyJ$react))).createElement((0, $58xyJ$reactspectrumutils.SlotProvider), {
|
73
73
|
slots: {
|
74
74
|
icon: {
|
75
|
-
size:
|
76
|
-
UNSAFE_className: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
75
|
+
size: 'S',
|
76
|
+
UNSAFE_className: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-Icon')
|
77
77
|
},
|
78
78
|
text: {
|
79
|
-
UNSAFE_className: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
79
|
+
UNSAFE_className: (0, $58xyJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-ActionButton-label')
|
80
80
|
}
|
81
81
|
}
|
82
|
-
}, typeof children ===
|
82
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, ($parcel$interopDefault($58xyJ$react))).createElement((0, $58xyJ$reactspectrumtext.Text), null, children) : children)));
|
83
83
|
}
|
84
84
|
/**
|
85
85
|
* ToggleButtons allow users to toggle a selection on or off, for example
|
package/dist/ToggleButton.mjs
CHANGED
@@ -46,34 +46,34 @@ function $3979c7c23b0bd270$var$ToggleButton(props, ref) {
|
|
46
46
|
let { styleProps: styleProps } = (0, $3XyjH$useStyleProps)(otherProps);
|
47
47
|
let isTextOnly = (0, $3XyjH$react).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, $3XyjH$react).isValidElement(c));
|
48
48
|
return /*#__PURE__*/ (0, $3XyjH$react).createElement((0, $3XyjH$FocusRing), {
|
49
|
-
focusRingClass: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
49
|
+
focusRingClass: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'focus-ring'),
|
50
50
|
autoFocus: autoFocus
|
51
51
|
}, /*#__PURE__*/ (0, $3XyjH$react).createElement("button", {
|
52
52
|
...styleProps,
|
53
53
|
...(0, $3XyjH$mergeProps)(buttonProps, hoverProps),
|
54
54
|
ref: domRef,
|
55
|
-
className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
55
|
+
className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'spectrum-ActionButton', {
|
56
|
+
'spectrum-ActionButton--quiet': isQuiet,
|
57
|
+
'spectrum-ActionButton--emphasized': isEmphasized,
|
58
|
+
'spectrum-ActionButton--staticColor': !!staticColor,
|
59
|
+
'spectrum-ActionButton--staticWhite': staticColor === 'white',
|
60
|
+
'spectrum-ActionButton--staticBlack': staticColor === 'black',
|
61
|
+
'is-active': isPressed,
|
62
|
+
'is-disabled': isDisabled,
|
63
|
+
'is-hovered': isHovered,
|
64
|
+
'is-selected': state.isSelected
|
65
65
|
}, styleProps.className)
|
66
66
|
}, /*#__PURE__*/ (0, $3XyjH$react).createElement((0, $3XyjH$SlotProvider), {
|
67
67
|
slots: {
|
68
68
|
icon: {
|
69
|
-
size:
|
70
|
-
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
69
|
+
size: 'S',
|
70
|
+
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'spectrum-Icon')
|
71
71
|
},
|
72
72
|
text: {
|
73
|
-
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
73
|
+
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'spectrum-ActionButton-label')
|
74
74
|
}
|
75
75
|
}
|
76
|
-
}, typeof children ===
|
76
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $3XyjH$react).createElement((0, $3XyjH$Text), null, children) : children)));
|
77
77
|
}
|
78
78
|
/**
|
79
79
|
* ToggleButtons allow users to toggle a selection on or off, for example
|
@@ -82,4 +82,4 @@ function $3979c7c23b0bd270$var$ToggleButton(props, ref) {
|
|
82
82
|
|
83
83
|
|
84
84
|
export {$3979c7c23b0bd270$export$d2b052e7b4be1756 as ToggleButton};
|
85
|
-
//# sourceMappingURL=ToggleButton.
|
85
|
+
//# sourceMappingURL=ToggleButton.module.js.map
|
@@ -46,34 +46,34 @@ function $3979c7c23b0bd270$var$ToggleButton(props, ref) {
|
|
46
46
|
let { styleProps: styleProps } = (0, $3XyjH$useStyleProps)(otherProps);
|
47
47
|
let isTextOnly = (0, $3XyjH$react).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, $3XyjH$react).isValidElement(c));
|
48
48
|
return /*#__PURE__*/ (0, $3XyjH$react).createElement((0, $3XyjH$FocusRing), {
|
49
|
-
focusRingClass: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
49
|
+
focusRingClass: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'focus-ring'),
|
50
50
|
autoFocus: autoFocus
|
51
51
|
}, /*#__PURE__*/ (0, $3XyjH$react).createElement("button", {
|
52
52
|
...styleProps,
|
53
53
|
...(0, $3XyjH$mergeProps)(buttonProps, hoverProps),
|
54
54
|
ref: domRef,
|
55
|
-
className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
55
|
+
className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'spectrum-ActionButton', {
|
56
|
+
'spectrum-ActionButton--quiet': isQuiet,
|
57
|
+
'spectrum-ActionButton--emphasized': isEmphasized,
|
58
|
+
'spectrum-ActionButton--staticColor': !!staticColor,
|
59
|
+
'spectrum-ActionButton--staticWhite': staticColor === 'white',
|
60
|
+
'spectrum-ActionButton--staticBlack': staticColor === 'black',
|
61
|
+
'is-active': isPressed,
|
62
|
+
'is-disabled': isDisabled,
|
63
|
+
'is-hovered': isHovered,
|
64
|
+
'is-selected': state.isSelected
|
65
65
|
}, styleProps.className)
|
66
66
|
}, /*#__PURE__*/ (0, $3XyjH$react).createElement((0, $3XyjH$SlotProvider), {
|
67
67
|
slots: {
|
68
68
|
icon: {
|
69
|
-
size:
|
70
|
-
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
69
|
+
size: 'S',
|
70
|
+
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'spectrum-Icon')
|
71
71
|
},
|
72
72
|
text: {
|
73
|
-
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))),
|
73
|
+
UNSAFE_className: (0, $3XyjH$classNames)((0, ($parcel$interopDefault($3XyjH$button_vars_cssmodulejs))), 'spectrum-ActionButton-label')
|
74
74
|
}
|
75
75
|
}
|
76
|
-
}, typeof children ===
|
76
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $3XyjH$react).createElement((0, $3XyjH$Text), null, children) : children)));
|
77
77
|
}
|
78
78
|
/**
|
79
79
|
* ToggleButtons allow users to toggle a selection on or off, for example
|
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/button_vars_css.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED
package/dist/intlStrings.mjs
CHANGED
package/dist/it-IT.mjs
CHANGED
package/dist/ja-JP.mjs
CHANGED
package/dist/ko-KR.mjs
CHANGED
package/dist/lt-LT.mjs
CHANGED
package/dist/lv-LV.mjs
CHANGED
package/dist/nb-NO.mjs
CHANGED
package/dist/nl-NL.mjs
CHANGED
package/dist/pl-PL.mjs
CHANGED
package/dist/pt-BR.mjs
CHANGED
package/dist/pt-PT.mjs
CHANGED
package/dist/ro-RO.mjs
CHANGED
package/dist/ru-RU.mjs
CHANGED
package/dist/sk-SK.mjs
CHANGED
package/dist/sl-SI.mjs
CHANGED
package/dist/sr-SP.mjs
CHANGED
package/dist/sv-SE.mjs
CHANGED
package/dist/tr-TR.mjs
CHANGED
package/dist/types.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import { FocusableRef, FocusableRefValue, DOMProps, StyleProps } from "@react-types/shared";
|
2
|
-
import React, {
|
2
|
+
import React, { ElementType, ReactElement } from "react";
|
3
3
|
import { SpectrumButtonProps, SpectrumActionButtonProps, ButtonProps, SpectrumLogicButtonProps, AriaButtonElementTypeProps, SpectrumToggleButtonProps } from "@react-types/button";
|
4
4
|
/**
|
5
5
|
* Buttons allow users to perform an action or to navigate to another page.
|
6
6
|
* They have multiple styles for various needs, and are ideal for calling attention to
|
7
7
|
* where a user needs to do something in order to move forward in a flow.
|
8
8
|
*/
|
9
|
-
export let Button: <T extends
|
9
|
+
export let Button: <T extends ElementType = "button">(props: SpectrumButtonProps<T> & {
|
10
10
|
ref?: FocusableRef<HTMLElement>;
|
11
11
|
}) => ReactElement;
|
12
12
|
/**
|
package/dist/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"mappings":";;;
|
1
|
+
{"mappings":";;;AA2MA;;;;GAIG;AACH,OAAA,IAAI,QAAsC,CAAC,CAAgC,SAAtB,WAAW,GAAG,QAAQ,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,aAAa,WAAW,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;AC3GhK;;;GAGG;AACH,OAAA,IAAI,uJAA8C,CAAC;ACnFnD,0BAA2B,SAAQ,WAAW,EAAE,QAAQ,EAAE,UAAU;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAsDD,OAAA,IAAI,iIAA4C,CAAC;ACpBjD;;GAEG;AACH,OAAA,IAAI,qJAA4C,CAAC;AC1CjD,2BAA2B,CAAC,SAAS,WAAW,GAAG,QAAQ,CAAE,SAAQ,WAAW,EAAE,2BAA2B,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU;IACnI,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAmDD,OAAA,IAAI,uJAA4C,CAAC;ACQjD;;;GAGG;AACH,OAAA,IAAI,uJAA8C,CAAC;ACzEnD,YAAY,EAAC,yBAAyB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,yBAAyB,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/button/src/packages/@react-spectrum/button/src/Button.tsx","packages/@react-spectrum/button/src/packages/@react-spectrum/button/src/ActionButton.tsx","packages/@react-spectrum/button/src/packages/@react-spectrum/button/src/FieldButton.tsx","packages/@react-spectrum/button/src/packages/@react-spectrum/button/src/LogicButton.tsx","packages/@react-spectrum/button/src/packages/@react-spectrum/button/src/ClearButton.tsx","packages/@react-spectrum/button/src/packages/@react-spectrum/button/src/ToggleButton.tsx","packages/@react-spectrum/button/src/packages/@react-spectrum/button/src/index.ts","packages/@react-spectrum/button/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <reference types=\"css-module-types\" />\nexport {Button} from './Button';\nexport {ActionButton} from './ActionButton';\nexport {FieldButton} from './FieldButton';\nexport {LogicButton} from './LogicButton';\nexport {ClearButton} from './ClearButton';\nexport {ToggleButton} from './ToggleButton';\nexport type {SpectrumActionButtonProps, SpectrumButtonProps, SpectrumLogicButtonProps, SpectrumToggleButtonProps} from '@react-types/button';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/dist/uk-UA.mjs
CHANGED
package/dist/zh-CN.mjs
CHANGED
package/dist/zh-TW.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/button",
|
3
|
-
"version": "3.16.
|
3
|
+
"version": "3.16.5",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -36,18 +36,18 @@
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@react-aria/button": "^3.9.
|
40
|
-
"@react-aria/focus": "^3.
|
41
|
-
"@react-aria/i18n": "^3.
|
42
|
-
"@react-aria/interactions": "^3.
|
43
|
-
"@react-aria/utils": "^3.
|
44
|
-
"@react-spectrum/progress": "^3.7.
|
45
|
-
"@react-spectrum/text": "^3.5.
|
46
|
-
"@react-spectrum/utils": "^3.11.
|
47
|
-
"@react-stately/toggle": "^3.7.
|
48
|
-
"@react-types/button": "^3.9.
|
49
|
-
"@react-types/shared": "^3.
|
50
|
-
"@spectrum-icons/ui": "^3.6.
|
39
|
+
"@react-aria/button": "^3.9.6",
|
40
|
+
"@react-aria/focus": "^3.18.0",
|
41
|
+
"@react-aria/i18n": "^3.12.0",
|
42
|
+
"@react-aria/interactions": "^3.22.0",
|
43
|
+
"@react-aria/utils": "^3.25.0",
|
44
|
+
"@react-spectrum/progress": "^3.7.8",
|
45
|
+
"@react-spectrum/text": "^3.5.6",
|
46
|
+
"@react-spectrum/utils": "^3.11.8",
|
47
|
+
"@react-stately/toggle": "^3.7.5",
|
48
|
+
"@react-types/button": "^3.9.5",
|
49
|
+
"@react-types/shared": "^3.24.0",
|
50
|
+
"@spectrum-icons/ui": "^3.6.8",
|
51
51
|
"@swc/helpers": "^0.5.0"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
@@ -56,10 +56,10 @@
|
|
56
56
|
},
|
57
57
|
"peerDependencies": {
|
58
58
|
"@react-spectrum/provider": "^3.0.0",
|
59
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
59
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
|
60
60
|
},
|
61
61
|
"publishConfig": {
|
62
62
|
"access": "public"
|
63
63
|
},
|
64
|
-
"gitHead": "
|
64
|
+
"gitHead": "86d80e3216bc32e75108831cf3a5a720bc849206"
|
65
65
|
}
|
package/src/Button.tsx
CHANGED
@@ -114,11 +114,24 @@ function Button<T extends ElementType = 'button'>(props: SpectrumButtonProps<T>,
|
|
114
114
|
if (isAppleDevice() && (!hasAriaLabel || isFirefox())) {
|
115
115
|
ariaLive = 'off';
|
116
116
|
}
|
117
|
+
|
118
|
+
let isPendingProps = isPending ? {
|
119
|
+
onClick: (e) => {
|
120
|
+
if (e.currentTarget instanceof HTMLButtonElement) {
|
121
|
+
e.preventDefault();
|
122
|
+
}
|
123
|
+
}
|
124
|
+
} : {
|
125
|
+
// no-op.
|
126
|
+
// Not sure why, but TypeScript wouldn't allow to have an empty object `{}`.
|
127
|
+
onClick: () => {}
|
128
|
+
};
|
129
|
+
|
117
130
|
return (
|
118
131
|
<FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>
|
119
132
|
<Element
|
120
133
|
{...styleProps}
|
121
|
-
{...mergeProps(buttonProps, hoverProps, focusProps)}
|
134
|
+
{...mergeProps(buttonProps, hoverProps, focusProps, isPendingProps)}
|
122
135
|
id={buttonId}
|
123
136
|
ref={domRef}
|
124
137
|
data-variant={variant}
|
package/src/FieldButton.tsx
CHANGED
@@ -12,10 +12,10 @@
|
|
12
12
|
|
13
13
|
import {ButtonProps} from '@react-types/button';
|
14
14
|
import {classNames, SlotProvider, useFocusableRef, useSlotProps, useStyleProps} from '@react-spectrum/utils';
|
15
|
-
import {DOMProps, FocusableRef, StyleProps} from '@react-types/shared';
|
15
|
+
import {DOMProps, FocusableRef, RefObject, StyleProps} from '@react-types/shared';
|
16
16
|
import {FocusRing} from '@react-aria/focus';
|
17
17
|
import {mergeProps} from '@react-aria/utils';
|
18
|
-
import React
|
18
|
+
import React from 'react';
|
19
19
|
import styles from '@adobe/spectrum-css-temp/components/button/vars.css';
|
20
20
|
import {useButton} from '@react-aria/button';
|
21
21
|
import {useHover} from '@react-aria/interactions';
|
@@ -42,7 +42,7 @@ function FieldButton(props: FieldButtonProps, ref: FocusableRef) {
|
|
42
42
|
focusRingClass,
|
43
43
|
...otherProps
|
44
44
|
} = props;
|
45
|
-
let domRef = useFocusableRef(ref) as RefObject<HTMLButtonElement>;
|
45
|
+
let domRef = useFocusableRef(ref) as RefObject<HTMLButtonElement | null>;
|
46
46
|
let {buttonProps, isPressed} = useButton(props, domRef);
|
47
47
|
let {hoverProps, isHovered} = useHover({isDisabled});
|
48
48
|
let {styleProps} = useStyleProps(otherProps);
|