@react-aria/button 3.9.4 → 3.9.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/useButton.main.js +15 -15
- package/dist/useButton.mjs +16 -16
- package/dist/useButton.module.js +15 -15
- package/dist/useToggleButton.main.js +1 -1
- package/dist/useToggleButton.mjs +2 -2
- package/dist/useToggleButton.module.js +1 -1
- package/package.json +8 -8
package/dist/useButton.main.js
CHANGED
|
@@ -22,24 +22,24 @@ $parcel$export(module.exports, "useButton", () => $988353faa005faf8$export$ea18c
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
function $988353faa005faf8$export$ea18c227d4417cc3(props, ref) {
|
|
25
|
-
let { elementType: elementType =
|
|
25
|
+
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: // @ts-ignore - undocumented
|
|
26
26
|
preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
|
|
27
27
|
allowFocusWhenDisabled, // @ts-ignore
|
|
28
|
-
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type =
|
|
28
|
+
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
|
|
29
29
|
let additionalProps;
|
|
30
|
-
if (elementType ===
|
|
30
|
+
if (elementType === 'button') additionalProps = {
|
|
31
31
|
type: type,
|
|
32
32
|
disabled: isDisabled
|
|
33
33
|
};
|
|
34
34
|
else additionalProps = {
|
|
35
|
-
role:
|
|
35
|
+
role: 'button',
|
|
36
36
|
tabIndex: isDisabled ? undefined : 0,
|
|
37
|
-
href: elementType ===
|
|
38
|
-
target: elementType ===
|
|
39
|
-
type: elementType ===
|
|
40
|
-
disabled: elementType ===
|
|
41
|
-
|
|
42
|
-
rel: elementType ===
|
|
37
|
+
href: elementType === 'a' && isDisabled ? undefined : href,
|
|
38
|
+
target: elementType === 'a' ? target : undefined,
|
|
39
|
+
type: elementType === 'input' ? type : undefined,
|
|
40
|
+
disabled: elementType === 'input' ? isDisabled : undefined,
|
|
41
|
+
'aria-disabled': !isDisabled || elementType === 'input' ? undefined : isDisabled,
|
|
42
|
+
rel: elementType === 'a' ? rel : undefined
|
|
43
43
|
};
|
|
44
44
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $lIlxZ$reactariainteractions.usePress)({
|
|
45
45
|
onPressStart: onPressStart,
|
|
@@ -59,14 +59,14 @@ function $988353faa005faf8$export$ea18c227d4417cc3(props, ref) {
|
|
|
59
59
|
return {
|
|
60
60
|
isPressed: isPressed,
|
|
61
61
|
buttonProps: (0, $lIlxZ$reactariautils.mergeProps)(additionalProps, buttonProps, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
'aria-haspopup': props['aria-haspopup'],
|
|
63
|
+
'aria-expanded': props['aria-expanded'],
|
|
64
|
+
'aria-controls': props['aria-controls'],
|
|
65
|
+
'aria-pressed': props['aria-pressed'],
|
|
66
66
|
onClick: (e)=>{
|
|
67
67
|
if (deprecatedOnClick) {
|
|
68
68
|
deprecatedOnClick(e);
|
|
69
|
-
console.warn(
|
|
69
|
+
console.warn('onClick is deprecated, please use onPress');
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
})
|
package/dist/useButton.mjs
CHANGED
|
@@ -16,24 +16,24 @@ import {usePress as $bwqiF$usePress} from "@react-aria/interactions";
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
19
|
-
let { elementType: elementType =
|
|
19
|
+
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: // @ts-ignore - undocumented
|
|
20
20
|
preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
|
|
21
21
|
allowFocusWhenDisabled, // @ts-ignore
|
|
22
|
-
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type =
|
|
22
|
+
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
|
|
23
23
|
let additionalProps;
|
|
24
|
-
if (elementType ===
|
|
24
|
+
if (elementType === 'button') additionalProps = {
|
|
25
25
|
type: type,
|
|
26
26
|
disabled: isDisabled
|
|
27
27
|
};
|
|
28
28
|
else additionalProps = {
|
|
29
|
-
role:
|
|
29
|
+
role: 'button',
|
|
30
30
|
tabIndex: isDisabled ? undefined : 0,
|
|
31
|
-
href: elementType ===
|
|
32
|
-
target: elementType ===
|
|
33
|
-
type: elementType ===
|
|
34
|
-
disabled: elementType ===
|
|
35
|
-
|
|
36
|
-
rel: elementType ===
|
|
31
|
+
href: elementType === 'a' && isDisabled ? undefined : href,
|
|
32
|
+
target: elementType === 'a' ? target : undefined,
|
|
33
|
+
type: elementType === 'input' ? type : undefined,
|
|
34
|
+
disabled: elementType === 'input' ? isDisabled : undefined,
|
|
35
|
+
'aria-disabled': !isDisabled || elementType === 'input' ? undefined : isDisabled,
|
|
36
|
+
rel: elementType === 'a' ? rel : undefined
|
|
37
37
|
};
|
|
38
38
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $bwqiF$usePress)({
|
|
39
39
|
onPressStart: onPressStart,
|
|
@@ -53,14 +53,14 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
53
53
|
return {
|
|
54
54
|
isPressed: isPressed,
|
|
55
55
|
buttonProps: (0, $bwqiF$mergeProps)(additionalProps, buttonProps, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
'aria-haspopup': props['aria-haspopup'],
|
|
57
|
+
'aria-expanded': props['aria-expanded'],
|
|
58
|
+
'aria-controls': props['aria-controls'],
|
|
59
|
+
'aria-pressed': props['aria-pressed'],
|
|
60
60
|
onClick: (e)=>{
|
|
61
61
|
if (deprecatedOnClick) {
|
|
62
62
|
deprecatedOnClick(e);
|
|
63
|
-
console.warn(
|
|
63
|
+
console.warn('onClick is deprecated, please use onPress');
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
})
|
|
@@ -69,4 +69,4 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
export {$701a24aa0da5b062$export$ea18c227d4417cc3 as useButton};
|
|
72
|
-
//# sourceMappingURL=useButton.
|
|
72
|
+
//# sourceMappingURL=useButton.module.js.map
|
package/dist/useButton.module.js
CHANGED
|
@@ -16,24 +16,24 @@ import {usePress as $bwqiF$usePress} from "@react-aria/interactions";
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
19
|
-
let { elementType: elementType =
|
|
19
|
+
let { elementType: elementType = 'button', isDisabled: isDisabled, onPress: onPress, onPressStart: onPressStart, onPressEnd: onPressEnd, onPressUp: onPressUp, onPressChange: onPressChange, preventFocusOnPress: // @ts-ignore - undocumented
|
|
20
20
|
preventFocusOnPress, allowFocusWhenDisabled: // @ts-ignore - undocumented
|
|
21
21
|
allowFocusWhenDisabled, // @ts-ignore
|
|
22
|
-
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type =
|
|
22
|
+
onClick: deprecatedOnClick, href: href, target: target, rel: rel, type: type = 'button' } = props;
|
|
23
23
|
let additionalProps;
|
|
24
|
-
if (elementType ===
|
|
24
|
+
if (elementType === 'button') additionalProps = {
|
|
25
25
|
type: type,
|
|
26
26
|
disabled: isDisabled
|
|
27
27
|
};
|
|
28
28
|
else additionalProps = {
|
|
29
|
-
role:
|
|
29
|
+
role: 'button',
|
|
30
30
|
tabIndex: isDisabled ? undefined : 0,
|
|
31
|
-
href: elementType ===
|
|
32
|
-
target: elementType ===
|
|
33
|
-
type: elementType ===
|
|
34
|
-
disabled: elementType ===
|
|
35
|
-
|
|
36
|
-
rel: elementType ===
|
|
31
|
+
href: elementType === 'a' && isDisabled ? undefined : href,
|
|
32
|
+
target: elementType === 'a' ? target : undefined,
|
|
33
|
+
type: elementType === 'input' ? type : undefined,
|
|
34
|
+
disabled: elementType === 'input' ? isDisabled : undefined,
|
|
35
|
+
'aria-disabled': !isDisabled || elementType === 'input' ? undefined : isDisabled,
|
|
36
|
+
rel: elementType === 'a' ? rel : undefined
|
|
37
37
|
};
|
|
38
38
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $bwqiF$usePress)({
|
|
39
39
|
onPressStart: onPressStart,
|
|
@@ -53,14 +53,14 @@ function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
|
|
|
53
53
|
return {
|
|
54
54
|
isPressed: isPressed,
|
|
55
55
|
buttonProps: (0, $bwqiF$mergeProps)(additionalProps, buttonProps, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
'aria-haspopup': props['aria-haspopup'],
|
|
57
|
+
'aria-expanded': props['aria-expanded'],
|
|
58
|
+
'aria-controls': props['aria-controls'],
|
|
59
|
+
'aria-pressed': props['aria-pressed'],
|
|
60
60
|
onClick: (e)=>{
|
|
61
61
|
if (deprecatedOnClick) {
|
|
62
62
|
deprecatedOnClick(e);
|
|
63
|
-
console.warn(
|
|
63
|
+
console.warn('onClick is deprecated, please use onPress');
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
})
|
package/dist/useToggleButton.mjs
CHANGED
|
@@ -22,11 +22,11 @@ function $55f54f7887471b58$export$51e84d46ca0bc451(props, state, ref) {
|
|
|
22
22
|
return {
|
|
23
23
|
isPressed: isPressed,
|
|
24
24
|
buttonProps: (0, $h7Tql$mergeProps)(buttonProps, {
|
|
25
|
-
|
|
25
|
+
'aria-pressed': isSelected
|
|
26
26
|
})
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
export {$55f54f7887471b58$export$51e84d46ca0bc451 as useToggleButton};
|
|
32
|
-
//# sourceMappingURL=useToggleButton.
|
|
32
|
+
//# sourceMappingURL=useToggleButton.module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/button",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.5",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/focus": "^3.17.
|
|
26
|
-
"@react-aria/interactions": "^3.21.
|
|
27
|
-
"@react-aria/utils": "^3.24.
|
|
28
|
-
"@react-stately/toggle": "^3.7.
|
|
29
|
-
"@react-types/button": "^3.9.
|
|
30
|
-
"@react-types/shared": "^3.23.
|
|
25
|
+
"@react-aria/focus": "^3.17.1",
|
|
26
|
+
"@react-aria/interactions": "^3.21.3",
|
|
27
|
+
"@react-aria/utils": "^3.24.1",
|
|
28
|
+
"@react-stately/toggle": "^3.7.4",
|
|
29
|
+
"@react-types/button": "^3.9.4",
|
|
30
|
+
"@react-types/shared": "^3.23.1",
|
|
31
31
|
"@swc/helpers": "^0.5.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
40
40
|
}
|