@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
@@ -42,10 +42,10 @@ $parcel$export(module.exports, "ActionButton", () => $65dbde0e8e7aba71$export$cf
|
|
42
42
|
|
43
43
|
function $65dbde0e8e7aba71$var$ActionButton(props, ref) {
|
44
44
|
props = (0, $9HF4v$reactspectrumprovider.useProviderProps)(props);
|
45
|
-
props = (0, $9HF4v$reactspectrumutils.useSlotProps)(props,
|
45
|
+
props = (0, $9HF4v$reactspectrumutils.useSlotProps)(props, 'actionButton');
|
46
46
|
let textProps = (0, $9HF4v$reactspectrumutils.useSlotProps)({
|
47
|
-
UNSAFE_className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
48
|
-
},
|
47
|
+
UNSAFE_className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-ActionButton-label')
|
48
|
+
}, 'text');
|
49
49
|
let { isQuiet: isQuiet, isDisabled: isDisabled, staticColor: staticColor, children: children, autoFocus: autoFocus, holdAffordance: // @ts-ignore (private)
|
50
50
|
holdAffordance, hideButtonText: // @ts-ignore (private)
|
51
51
|
hideButtonText, ...otherProps } = props;
|
@@ -57,36 +57,36 @@ function $65dbde0e8e7aba71$var$ActionButton(props, ref) {
|
|
57
57
|
let { styleProps: styleProps } = (0, $9HF4v$reactspectrumutils.useStyleProps)(otherProps);
|
58
58
|
let isTextOnly = (0, ($parcel$interopDefault($9HF4v$react))).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, ($parcel$interopDefault($9HF4v$react))).isValidElement(c));
|
59
59
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($9HF4v$react))).createElement((0, $9HF4v$reactariafocus.FocusRing), {
|
60
|
-
focusRingClass: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
60
|
+
focusRingClass: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'focus-ring'),
|
61
61
|
autoFocus: autoFocus
|
62
62
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($9HF4v$react))).createElement("button", {
|
63
63
|
...styleProps,
|
64
64
|
...(0, $9HF4v$reactariautils.mergeProps)(buttonProps, hoverProps),
|
65
65
|
ref: domRef,
|
66
|
-
className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
66
|
+
className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-ActionButton', {
|
67
|
+
'spectrum-ActionButton--quiet': isQuiet,
|
68
|
+
'spectrum-ActionButton--staticColor': !!staticColor,
|
69
|
+
'spectrum-ActionButton--staticWhite': staticColor === 'white',
|
70
|
+
'spectrum-ActionButton--staticBlack': staticColor === 'black',
|
71
|
+
'is-active': isPressed,
|
72
|
+
'is-disabled': isDisabled,
|
73
|
+
'is-hovered': isHovered
|
74
74
|
}, styleProps.className)
|
75
75
|
}, holdAffordance && /*#__PURE__*/ (0, ($parcel$interopDefault($9HF4v$react))).createElement((0, ($parcel$interopDefault($9HF4v$spectrumiconsuiCornerTriangle))), {
|
76
|
-
UNSAFE_className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
76
|
+
UNSAFE_className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-ActionButton-hold')
|
77
77
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($9HF4v$react))).createElement((0, $9HF4v$reactspectrumutils.ClearSlots), null, /*#__PURE__*/ (0, ($parcel$interopDefault($9HF4v$react))).createElement((0, $9HF4v$reactspectrumutils.SlotProvider), {
|
78
78
|
slots: {
|
79
79
|
icon: {
|
80
|
-
size:
|
81
|
-
UNSAFE_className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
82
|
-
|
80
|
+
size: 'S',
|
81
|
+
UNSAFE_className: (0, $9HF4v$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-Icon', {
|
82
|
+
'spectrum-ActionGroup-itemIcon': hideButtonText
|
83
83
|
})
|
84
84
|
},
|
85
85
|
text: {
|
86
86
|
...textProps
|
87
87
|
}
|
88
88
|
}
|
89
|
-
}, typeof children ===
|
89
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, ($parcel$interopDefault($9HF4v$react))).createElement((0, $9HF4v$reactspectrumtext.Text), null, children) : children))));
|
90
90
|
}
|
91
91
|
/**
|
92
92
|
* ActionButtons allow users to perform an action.
|
package/dist/ActionButton.mjs
CHANGED
@@ -36,10 +36,10 @@ function $parcel$interopDefault(a) {
|
|
36
36
|
|
37
37
|
function $042ad0b3a4a55b33$var$ActionButton(props, ref) {
|
38
38
|
props = (0, $kfV1G$useProviderProps)(props);
|
39
|
-
props = (0, $kfV1G$useSlotProps)(props,
|
39
|
+
props = (0, $kfV1G$useSlotProps)(props, 'actionButton');
|
40
40
|
let textProps = (0, $kfV1G$useSlotProps)({
|
41
|
-
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
42
|
-
},
|
41
|
+
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-ActionButton-label')
|
42
|
+
}, 'text');
|
43
43
|
let { isQuiet: isQuiet, isDisabled: isDisabled, staticColor: staticColor, children: children, autoFocus: autoFocus, holdAffordance: // @ts-ignore (private)
|
44
44
|
holdAffordance, hideButtonText: // @ts-ignore (private)
|
45
45
|
hideButtonText, ...otherProps } = props;
|
@@ -51,36 +51,36 @@ function $042ad0b3a4a55b33$var$ActionButton(props, ref) {
|
|
51
51
|
let { styleProps: styleProps } = (0, $kfV1G$useStyleProps)(otherProps);
|
52
52
|
let isTextOnly = (0, $kfV1G$react).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, $kfV1G$react).isValidElement(c));
|
53
53
|
return /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$FocusRing), {
|
54
|
-
focusRingClass: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
54
|
+
focusRingClass: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'focus-ring'),
|
55
55
|
autoFocus: autoFocus
|
56
56
|
}, /*#__PURE__*/ (0, $kfV1G$react).createElement("button", {
|
57
57
|
...styleProps,
|
58
58
|
...(0, $kfV1G$mergeProps)(buttonProps, hoverProps),
|
59
59
|
ref: domRef,
|
60
|
-
className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-ActionButton', {
|
61
|
+
'spectrum-ActionButton--quiet': isQuiet,
|
62
|
+
'spectrum-ActionButton--staticColor': !!staticColor,
|
63
|
+
'spectrum-ActionButton--staticWhite': staticColor === 'white',
|
64
|
+
'spectrum-ActionButton--staticBlack': staticColor === 'black',
|
65
|
+
'is-active': isPressed,
|
66
|
+
'is-disabled': isDisabled,
|
67
|
+
'is-hovered': isHovered
|
68
68
|
}, styleProps.className)
|
69
69
|
}, holdAffordance && /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$spectrumiconsuiCornerTriangle), {
|
70
|
-
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
70
|
+
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-ActionButton-hold')
|
71
71
|
}), /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$ClearSlots), null, /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$SlotProvider), {
|
72
72
|
slots: {
|
73
73
|
icon: {
|
74
|
-
size:
|
75
|
-
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
76
|
-
|
74
|
+
size: 'S',
|
75
|
+
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-Icon', {
|
76
|
+
'spectrum-ActionGroup-itemIcon': hideButtonText
|
77
77
|
})
|
78
78
|
},
|
79
79
|
text: {
|
80
80
|
...textProps
|
81
81
|
}
|
82
82
|
}
|
83
|
-
}, typeof children ===
|
83
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$Text), null, children) : children))));
|
84
84
|
}
|
85
85
|
/**
|
86
86
|
* ActionButtons allow users to perform an action.
|
@@ -89,4 +89,4 @@ function $042ad0b3a4a55b33$var$ActionButton(props, ref) {
|
|
89
89
|
|
90
90
|
|
91
91
|
export {$042ad0b3a4a55b33$export$cfc7921d29ef7b80 as ActionButton};
|
92
|
-
//# sourceMappingURL=ActionButton.
|
92
|
+
//# sourceMappingURL=ActionButton.module.js.map
|
@@ -36,10 +36,10 @@ function $parcel$interopDefault(a) {
|
|
36
36
|
|
37
37
|
function $042ad0b3a4a55b33$var$ActionButton(props, ref) {
|
38
38
|
props = (0, $kfV1G$useProviderProps)(props);
|
39
|
-
props = (0, $kfV1G$useSlotProps)(props,
|
39
|
+
props = (0, $kfV1G$useSlotProps)(props, 'actionButton');
|
40
40
|
let textProps = (0, $kfV1G$useSlotProps)({
|
41
|
-
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
42
|
-
},
|
41
|
+
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-ActionButton-label')
|
42
|
+
}, 'text');
|
43
43
|
let { isQuiet: isQuiet, isDisabled: isDisabled, staticColor: staticColor, children: children, autoFocus: autoFocus, holdAffordance: // @ts-ignore (private)
|
44
44
|
holdAffordance, hideButtonText: // @ts-ignore (private)
|
45
45
|
hideButtonText, ...otherProps } = props;
|
@@ -51,36 +51,36 @@ function $042ad0b3a4a55b33$var$ActionButton(props, ref) {
|
|
51
51
|
let { styleProps: styleProps } = (0, $kfV1G$useStyleProps)(otherProps);
|
52
52
|
let isTextOnly = (0, $kfV1G$react).Children.toArray(props.children).every((c)=>!/*#__PURE__*/ (0, $kfV1G$react).isValidElement(c));
|
53
53
|
return /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$FocusRing), {
|
54
|
-
focusRingClass: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
54
|
+
focusRingClass: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'focus-ring'),
|
55
55
|
autoFocus: autoFocus
|
56
56
|
}, /*#__PURE__*/ (0, $kfV1G$react).createElement("button", {
|
57
57
|
...styleProps,
|
58
58
|
...(0, $kfV1G$mergeProps)(buttonProps, hoverProps),
|
59
59
|
ref: domRef,
|
60
|
-
className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-ActionButton', {
|
61
|
+
'spectrum-ActionButton--quiet': isQuiet,
|
62
|
+
'spectrum-ActionButton--staticColor': !!staticColor,
|
63
|
+
'spectrum-ActionButton--staticWhite': staticColor === 'white',
|
64
|
+
'spectrum-ActionButton--staticBlack': staticColor === 'black',
|
65
|
+
'is-active': isPressed,
|
66
|
+
'is-disabled': isDisabled,
|
67
|
+
'is-hovered': isHovered
|
68
68
|
}, styleProps.className)
|
69
69
|
}, holdAffordance && /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$spectrumiconsuiCornerTriangle), {
|
70
|
-
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
70
|
+
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-ActionButton-hold')
|
71
71
|
}), /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$ClearSlots), null, /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$SlotProvider), {
|
72
72
|
slots: {
|
73
73
|
icon: {
|
74
|
-
size:
|
75
|
-
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))),
|
76
|
-
|
74
|
+
size: 'S',
|
75
|
+
UNSAFE_className: (0, $kfV1G$classNames)((0, ($parcel$interopDefault($kfV1G$button_vars_cssmodulejs))), 'spectrum-Icon', {
|
76
|
+
'spectrum-ActionGroup-itemIcon': hideButtonText
|
77
77
|
})
|
78
78
|
},
|
79
79
|
text: {
|
80
80
|
...textProps
|
81
81
|
}
|
82
82
|
}
|
83
|
-
}, typeof children ===
|
83
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $kfV1G$react).createElement((0, $kfV1G$Text), null, children) : children))));
|
84
84
|
}
|
85
85
|
/**
|
86
86
|
* ActionButtons allow users to perform an action.
|
package/dist/Button.main.js
CHANGED
@@ -62,9 +62,9 @@ function $842a195ed1671b15$var$disablePendingProps(props) {
|
|
62
62
|
function $842a195ed1671b15$var$Button(props, ref) {
|
63
63
|
var _buttonProps_arialabelledby;
|
64
64
|
props = (0, $hN0b7$reactspectrumprovider.useProviderProps)(props);
|
65
|
-
props = (0, $hN0b7$reactspectrumutils.useSlotProps)(props,
|
65
|
+
props = (0, $hN0b7$reactspectrumutils.useSlotProps)(props, 'button');
|
66
66
|
props = $842a195ed1671b15$var$disablePendingProps(props);
|
67
|
-
let { elementType: Element =
|
67
|
+
let { elementType: Element = 'button', children: children, variant: variant, style: style = variant === 'accent' || variant === 'cta' ? 'fill' : 'outline', staticColor: staticColor, isDisabled: isDisabled, isPending: isPending, autoFocus: autoFocus, ...otherProps } = props;
|
68
68
|
let domRef = (0, $hN0b7$reactspectrumutils.useFocusableRef)(ref);
|
69
69
|
let { buttonProps: buttonProps, isPressed: isPressed } = (0, $hN0b7$reactariabutton.useButton)(props, domRef);
|
70
70
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $hN0b7$reactariainteractions.useHover)({
|
@@ -75,12 +75,12 @@ function $842a195ed1671b15$var$Button(props, ref) {
|
|
75
75
|
onFocusChange: onFocusChange,
|
76
76
|
isDisabled: isDisabled
|
77
77
|
});
|
78
|
-
let stringFormatter = (0, $hN0b7$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($b2da92ebd9a2bc00$exports))),
|
78
|
+
let stringFormatter = (0, $hN0b7$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($b2da92ebd9a2bc00$exports))), '@react-spectrum/button');
|
79
79
|
let { styleProps: styleProps } = (0, $hN0b7$reactspectrumutils.useStyleProps)(otherProps);
|
80
|
-
let hasLabel = (0, $hN0b7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($afc5a4514aca2340$exports)))[
|
81
|
-
let hasIcon = (0, $hN0b7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($afc5a4514aca2340$exports)))[
|
80
|
+
let hasLabel = (0, $hN0b7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($afc5a4514aca2340$exports)))['spectrum-Button-label']}`, domRef);
|
81
|
+
let hasIcon = (0, $hN0b7$reactspectrumutils.useHasChild)(`.${(0, ($parcel$interopDefault($afc5a4514aca2340$exports)))['spectrum-Icon']}`, domRef);
|
82
82
|
// an aria label will block children and their labels from being read, this is undesirable for pending state
|
83
|
-
let hasAriaLabel = !!buttonProps[
|
83
|
+
let hasAriaLabel = !!buttonProps['aria-label'] || !!buttonProps['aria-labelledby'];
|
84
84
|
let [isProgressVisible, setIsProgressVisible] = (0, $hN0b7$react.useState)(false);
|
85
85
|
let backupButtonId = (0, $hN0b7$reactariautils.useId)();
|
86
86
|
let buttonId = buttonProps.id || backupButtonId;
|
@@ -102,62 +102,71 @@ function $842a195ed1671b15$var$Button(props, ref) {
|
|
102
102
|
}, [
|
103
103
|
isPending
|
104
104
|
]);
|
105
|
-
if (variant ===
|
106
|
-
else if (variant ===
|
107
|
-
variant =
|
108
|
-
staticColor =
|
105
|
+
if (variant === 'cta') variant = 'accent';
|
106
|
+
else if (variant === 'overBackground') {
|
107
|
+
variant = 'primary';
|
108
|
+
staticColor = 'white';
|
109
109
|
}
|
110
|
-
const isPendingAriaLiveLabel = `${hasAriaLabel ? buttonProps[
|
110
|
+
const isPendingAriaLiveLabel = `${hasAriaLabel ? buttonProps['aria-label'] : ''} ${stringFormatter.format('pending')}`.trim();
|
111
111
|
var _buttonProps_arialabelledby_replace;
|
112
|
-
const isPendingAriaLiveLabelledby = hasAriaLabel ? (_buttonProps_arialabelledby_replace = (_buttonProps_arialabelledby = buttonProps[
|
113
|
-
let ariaLive =
|
114
|
-
if ((0, $hN0b7$reactariautils.isAppleDevice)() && (!hasAriaLabel || (0, $hN0b7$reactariautils.isFirefox)())) ariaLive =
|
112
|
+
const isPendingAriaLiveLabelledby = hasAriaLabel ? (_buttonProps_arialabelledby_replace = (_buttonProps_arialabelledby = buttonProps['aria-labelledby']) === null || _buttonProps_arialabelledby === void 0 ? void 0 : _buttonProps_arialabelledby.replace(buttonId, spinnerId)) !== null && _buttonProps_arialabelledby_replace !== void 0 ? _buttonProps_arialabelledby_replace : spinnerId : `${hasIcon ? iconId : ''} ${hasLabel ? textId : ''} ${spinnerId}`.trim();
|
113
|
+
let ariaLive = 'polite';
|
114
|
+
if ((0, $hN0b7$reactariautils.isAppleDevice)() && (!hasAriaLabel || (0, $hN0b7$reactariautils.isFirefox)())) ariaLive = 'off';
|
115
|
+
let isPendingProps = isPending ? {
|
116
|
+
onClick: (e)=>{
|
117
|
+
if (e.currentTarget instanceof HTMLButtonElement) e.preventDefault();
|
118
|
+
}
|
119
|
+
} : {
|
120
|
+
// no-op.
|
121
|
+
// Not sure why, but TypeScript wouldn't allow to have an empty object `{}`.
|
122
|
+
onClick: ()=>{}
|
123
|
+
};
|
115
124
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement((0, $hN0b7$reactariafocus.FocusRing), {
|
116
|
-
focusRingClass: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
125
|
+
focusRingClass: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'focus-ring'),
|
117
126
|
autoFocus: autoFocus
|
118
127
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement(Element, {
|
119
128
|
...styleProps,
|
120
|
-
...(0, $hN0b7$reactariautils.mergeProps)(buttonProps, hoverProps, focusProps),
|
129
|
+
...(0, $hN0b7$reactariautils.mergeProps)(buttonProps, hoverProps, focusProps, isPendingProps),
|
121
130
|
id: buttonId,
|
122
131
|
ref: domRef,
|
123
132
|
"data-variant": variant,
|
124
133
|
"data-style": style,
|
125
134
|
"data-static-color": staticColor || undefined,
|
126
|
-
"aria-disabled": isPending ?
|
127
|
-
"aria-label": isPending ? isPendingAriaLiveLabel : buttonProps[
|
128
|
-
"aria-labelledby": isPending ? isPendingAriaLiveLabelledby : buttonProps[
|
129
|
-
className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
+
"aria-disabled": isPending ? 'true' : undefined,
|
136
|
+
"aria-label": isPending ? isPendingAriaLiveLabel : buttonProps['aria-label'],
|
137
|
+
"aria-labelledby": isPending ? isPendingAriaLiveLabelledby : buttonProps['aria-labelledby'],
|
138
|
+
className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-Button', {
|
139
|
+
'spectrum-Button--iconOnly': hasIcon && !hasLabel,
|
140
|
+
'is-disabled': isDisabled || isProgressVisible,
|
141
|
+
'is-active': isPressed,
|
142
|
+
'is-hovered': isHovered,
|
143
|
+
'spectrum-Button--pending': isProgressVisible
|
135
144
|
}, styleProps.className)
|
136
145
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement((0, $hN0b7$reactspectrumutils.SlotProvider), {
|
137
146
|
slots: {
|
138
147
|
icon: {
|
139
148
|
id: iconId,
|
140
|
-
size:
|
141
|
-
UNSAFE_className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
149
|
+
size: 'S',
|
150
|
+
UNSAFE_className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-Icon')
|
142
151
|
},
|
143
152
|
text: {
|
144
153
|
id: textId,
|
145
|
-
UNSAFE_className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
154
|
+
UNSAFE_className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-Button-label')
|
146
155
|
}
|
147
156
|
}
|
148
|
-
}, typeof children ===
|
157
|
+
}, typeof children === 'string' ? /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement((0, $hN0b7$reactspectrumtext.Text), null, children) : children, isPending && /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement("div", {
|
149
158
|
"aria-hidden": "true",
|
150
159
|
style: {
|
151
|
-
visibility: isProgressVisible ?
|
160
|
+
visibility: isProgressVisible ? 'visible' : 'hidden'
|
152
161
|
},
|
153
|
-
className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))),
|
162
|
+
className: (0, $hN0b7$reactspectrumutils.classNames)((0, ($parcel$interopDefault($afc5a4514aca2340$exports))), 'spectrum-Button-circleLoader')
|
154
163
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement((0, $hN0b7$reactspectrumprogress.ProgressCircle), {
|
155
164
|
"aria-label": isPendingAriaLiveLabel,
|
156
165
|
isIndeterminate: true,
|
157
166
|
size: "S",
|
158
167
|
staticColor: staticColor
|
159
168
|
})), isPending && /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement((0, ($parcel$interopDefault($hN0b7$react))).Fragment, null, /*#__PURE__*/ (0, ($parcel$interopDefault($hN0b7$react))).createElement("div", {
|
160
|
-
"aria-live": isFocused ? ariaLive :
|
169
|
+
"aria-live": isFocused ? ariaLive : 'off'
|
161
170
|
}, isProgressVisible && /*#__PURE__*/ (0, ($parcel$interopDefault($h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,CAAA,GAAA,mDAAK,GAAG;qBAC9B,0DAAC,CAAA,GAAA,2CAAa;QACZ,cAAY;QACZ,iBAAA;QACA,MAAK;QACL,aAAa;SAGlB,2BACC,oIACE,0DAAC;QAAI,aAAW,YAAY,WAAW;OACpC,mCACC,0DAAC;QAAI,MAAK;QAAM,mBAAiB;uBAOrC,0DAAC;QAAI,IAAI;QAAW,MAAK;QAAM,cAAY;;AAOzD;AAEA;;;;CAIC,GACD,IAAI,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/button/src/Button.tsx"],"sourcesContent":["/*\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\nimport {\n classNames,\n SlotProvider,\n useFocusableRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAppleDevice, isFirefox, mergeProps, useId} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ElementType, ReactElement, useEffect, useState} from 'react';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useButton} from '@react-aria/button';\nimport {useFocus, useHover} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n\nfunction Button<T extends ElementType = 'button'>(props: SpectrumButtonProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'button');\n props = disablePendingProps(props);\n let {\n elementType: Element = 'button',\n children,\n variant,\n style = variant === 'accent' || variant === 'cta' ? 'fill' : 'outline',\n staticColor,\n isDisabled,\n isPending,\n autoFocus,\n ...otherProps\n } = props;\n let domRef = useFocusableRef(ref);\n let {buttonProps, isPressed} = useButton(props, domRef);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let [isFocused, onFocusChange] = useState(false);\n let {focusProps} = useFocus({onFocusChange, isDisabled});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/button');\n let {styleProps} = useStyleProps(otherProps);\n let hasLabel = useHasChild(`.${styles['spectrum-Button-label']}`, domRef);\n let hasIcon = useHasChild(`.${styles['spectrum-Icon']}`, domRef);\n // an aria label will block children and their labels from being read, this is undesirable for pending state\n let hasAriaLabel = !!buttonProps['aria-label'] || !!buttonProps['aria-labelledby'];\n let [isProgressVisible, setIsProgressVisible] = useState(false);\n let backupButtonId = useId();\n let buttonId = buttonProps.id || backupButtonId;\n let iconId = useId();\n let textId = useId();\n let spinnerId = useId();\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n\n if (isPending) {\n // Start timer when isPending is set to true.\n timeout = setTimeout(() => {\n setIsProgressVisible(true);\n }, 1000);\n } else {\n // Exit loading state when isPending is set to false. */\n setIsProgressVisible(false);\n }\n return () => {\n // Clean up on unmount or when user removes isPending prop before entering loading state.\n clearTimeout(timeout);\n };\n }, [isPending]);\n\n if (variant === 'cta') {\n variant = 'accent';\n } else if (variant === 'overBackground') {\n variant = 'primary';\n staticColor = 'white';\n }\n\n const isPendingAriaLiveLabel = `${hasAriaLabel ? buttonProps['aria-label'] : ''} ${stringFormatter.format('pending')}`.trim();\n const isPendingAriaLiveLabelledby = hasAriaLabel ? (buttonProps['aria-labelledby']?.replace(buttonId, spinnerId) ?? spinnerId) : `${hasIcon ? iconId : ''} ${hasLabel ? textId : ''} ${spinnerId}`.trim();\n\n let ariaLive: 'off' | 'polite' | 'assertive' = 'polite';\n if (isAppleDevice() && (!hasAriaLabel || isFirefox())) {\n ariaLive = 'off';\n }\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <Element\n {...styleProps}\n {...mergeProps(buttonProps, hoverProps, focusProps)}\n id={buttonId}\n ref={domRef}\n data-variant={variant}\n data-style={style}\n data-static-color={staticColor || undefined}\n aria-disabled={isPending ? 'true' : undefined}\n aria-label={isPending ? isPendingAriaLiveLabel : buttonProps['aria-label']}\n aria-labelledby={isPending ? isPendingAriaLiveLabelledby : buttonProps['aria-labelledby']}\n className={\n classNames(\n styles,\n 'spectrum-Button',\n {\n 'spectrum-Button--iconOnly': hasIcon && !hasLabel,\n 'is-disabled': isDisabled || isProgressVisible,\n 'is-active': isPressed,\n 'is-hovered': isHovered,\n 'spectrum-Button--pending': isProgressVisible\n },\n styleProps.className\n )\n }>\n <SlotProvider\n slots={{\n icon: {\n id: iconId,\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Icon')\n },\n text: {\n id: textId,\n UNSAFE_className: classNames(styles, 'spectrum-Button-label')\n }\n }}>\n {typeof children === 'string'\n ? <Text>{children}</Text>\n : children}\n {isPending && (\n <div\n aria-hidden=\"true\"\n style={{visibility: isProgressVisible ? 'visible' : 'hidden'}}\n className={classNames(styles, 'spectrum-Button-circleLoader')}>\n <ProgressCircle\n aria-label={isPendingAriaLiveLabel}\n isIndeterminate\n size=\"S\"\n staticColor={staticColor} />\n </div>\n )}\n {isPending &&\n <>\n <div aria-live={isFocused ? ariaLive : 'off'}>\n {isProgressVisible &&\n <div role=\"img\" aria-labelledby={isPendingAriaLiveLabelledby} />\n }\n </div>\n {/* Adding the element here with the same labels as the button itself causes aria-live to pick up the change in Safari.\n Safari with VO unfortunately doesn't announce changes to *all* of its labels specifically for button\n https://a11ysupport.io/tests/tech__html__button-name-change#assertion-aria-aria-label_attribute-convey_name_change-html-button_element-vo_macos-safari\n The aria-live may cause extra announcements in other browsers. */}\n <div id={spinnerId} role=\"img\" aria-label={isPendingAriaLiveLabel} />\n </>\n }\n </SlotProvider>\n </Element>\n </FocusRing>\n );\n}\n\n/**\n * Buttons allow users to perform an action or to navigate to another page.\n * They have multiple styles for various needs, and are ideal for calling attention to\n * where a user needs to do something in order to move forward in a flow.\n */\nlet _Button = React.forwardRef(Button) as <T extends ElementType = 'button'>(props: SpectrumButtonProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_Button as Button};\n"],"names":[],"version":3,"file":"Button.main.js.map"}
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAyBD,SAAS,0CAAoB,KAAK;IAChC,kDAAkD;IAClD,IAAI,MAAM,SAAS,EAAE;QACnB,MAAM,OAAO,GAAG;QAChB,MAAM,YAAY,GAAG;QACrB,MAAM,UAAU,GAAG;QACnB,MAAM,aAAa,GAAG;QACtB,MAAM,SAAS,GAAG;QAClB,MAAM,SAAS,GAAG;QAClB,MAAM,OAAO,GAAG;QAChB,MAAM,OAAO,GAAG;QAChB,MAAM,IAAI,GAAG;IACf;IACA,OAAO;AACT;AAEA,SAAS,6BAAyC,KAA6B,EAAE,GAA8B;QA2DzD;IA1DpD,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,QAAQ,0CAAoB;IAC5B,IAAI,EACF,aAAa,UAAU,QAAQ,YAC/B,QAAQ,WACR,OAAO,SACP,QAAQ,YAAY,YAAY,YAAY,QAAQ,SAAS,wBA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A8B,WAAW,CAAC,kBAAkB;QACzF,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,mBACA;YACE,6BAA6B,WAAW,CAAC;YACzC,eAAe,cAAc;YAC7B,aAAa;YACb,cAAc;YACd,4BAA4B;QAC9B,GACA,WAAW,SAAS;qBAGxB,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,MAAM;gBACJ,IAAI;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;YACA,MAAM;gBACJ,IAAI;gBACJ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;QACF;OACC,OAAO,aAAa,yBACjB,0DAAC,CAAA,GAAA,6BAAG,SAAG,YACP,UACH,2BACC,0DAAC;QACC,eAAY;QACZ,OAAO;YAAC,YAAY,oBAAoB,YAAY;QAAQ;QAC5D,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBAC9B,0DAAC,CAAA,GAAA,2CAAa;QACZ,cAAY;QACZ,iBAAA;QACA,MAAK;QACL,aAAa;SAGlB,2BACC,oIACE,0DAAC;QAAI,aAAW,YAAY,WAAW;OACpC,mCACC,0DAAC;QAAI,MAAK;QAAM,mBAAiB;uBAOrC,0DAAC;QAAI,IAAI;QAAW,MAAK;QAAM,cAAY;;AAOzD;AAEA;;;;CAIC,GACD,IAAI,0DAAU,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/button/src/Button.tsx"],"sourcesContent":["/*\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\nimport {\n classNames,\n SlotProvider,\n useFocusableRef,\n useHasChild,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {FocusableRef} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAppleDevice, isFirefox, mergeProps, useId} from '@react-aria/utils';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {ElementType, ReactElement, useEffect, useState} from 'react';\nimport {SpectrumButtonProps} from '@react-types/button';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useButton} from '@react-aria/button';\nimport {useFocus, useHover} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction disablePendingProps(props) {\n // Don't allow interaction while isPending is true\n if (props.isPending) {\n props.onPress = undefined;\n props.onPressStart = undefined;\n props.onPressEnd = undefined;\n props.onPressChange = undefined;\n props.onPressUp = undefined;\n props.onKeyDown = undefined;\n props.onKeyUp = undefined;\n props.onClick = undefined;\n props.href = undefined;\n }\n return props;\n}\n\nfunction Button<T extends ElementType = 'button'>(props: SpectrumButtonProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'button');\n props = disablePendingProps(props);\n let {\n elementType: Element = 'button',\n children,\n variant,\n style = variant === 'accent' || variant === 'cta' ? 'fill' : 'outline',\n staticColor,\n isDisabled,\n isPending,\n autoFocus,\n ...otherProps\n } = props;\n let domRef = useFocusableRef(ref);\n let {buttonProps, isPressed} = useButton(props, domRef);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let [isFocused, onFocusChange] = useState(false);\n let {focusProps} = useFocus({onFocusChange, isDisabled});\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/button');\n let {styleProps} = useStyleProps(otherProps);\n let hasLabel = useHasChild(`.${styles['spectrum-Button-label']}`, domRef);\n let hasIcon = useHasChild(`.${styles['spectrum-Icon']}`, domRef);\n // an aria label will block children and their labels from being read, this is undesirable for pending state\n let hasAriaLabel = !!buttonProps['aria-label'] || !!buttonProps['aria-labelledby'];\n let [isProgressVisible, setIsProgressVisible] = useState(false);\n let backupButtonId = useId();\n let buttonId = buttonProps.id || backupButtonId;\n let iconId = useId();\n let textId = useId();\n let spinnerId = useId();\n\n useEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n\n if (isPending) {\n // Start timer when isPending is set to true.\n timeout = setTimeout(() => {\n setIsProgressVisible(true);\n }, 1000);\n } else {\n // Exit loading state when isPending is set to false. */\n setIsProgressVisible(false);\n }\n return () => {\n // Clean up on unmount or when user removes isPending prop before entering loading state.\n clearTimeout(timeout);\n };\n }, [isPending]);\n\n if (variant === 'cta') {\n variant = 'accent';\n } else if (variant === 'overBackground') {\n variant = 'primary';\n staticColor = 'white';\n }\n\n const isPendingAriaLiveLabel = `${hasAriaLabel ? buttonProps['aria-label'] : ''} ${stringFormatter.format('pending')}`.trim();\n const isPendingAriaLiveLabelledby = hasAriaLabel ? (buttonProps['aria-labelledby']?.replace(buttonId, spinnerId) ?? spinnerId) : `${hasIcon ? iconId : ''} ${hasLabel ? textId : ''} ${spinnerId}`.trim();\n\n let ariaLive: 'off' | 'polite' | 'assertive' = 'polite';\n if (isAppleDevice() && (!hasAriaLabel || isFirefox())) {\n ariaLive = 'off';\n }\n\n let isPendingProps = isPending ? {\n onClick: (e) => {\n if (e.currentTarget instanceof HTMLButtonElement) {\n e.preventDefault();\n }\n }\n } : {\n // no-op. \n // Not sure why, but TypeScript wouldn't allow to have an empty object `{}`.\n onClick: () => {}\n };\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')} autoFocus={autoFocus}>\n <Element\n {...styleProps}\n {...mergeProps(buttonProps, hoverProps, focusProps, isPendingProps)}\n id={buttonId}\n ref={domRef}\n data-variant={variant}\n data-style={style}\n data-static-color={staticColor || undefined}\n aria-disabled={isPending ? 'true' : undefined}\n aria-label={isPending ? isPendingAriaLiveLabel : buttonProps['aria-label']}\n aria-labelledby={isPending ? isPendingAriaLiveLabelledby : buttonProps['aria-labelledby']}\n className={\n classNames(\n styles,\n 'spectrum-Button',\n {\n 'spectrum-Button--iconOnly': hasIcon && !hasLabel,\n 'is-disabled': isDisabled || isProgressVisible,\n 'is-active': isPressed,\n 'is-hovered': isHovered,\n 'spectrum-Button--pending': isProgressVisible\n },\n styleProps.className\n )\n }>\n <SlotProvider\n slots={{\n icon: {\n id: iconId,\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Icon')\n },\n text: {\n id: textId,\n UNSAFE_className: classNames(styles, 'spectrum-Button-label')\n }\n }}>\n {typeof children === 'string'\n ? <Text>{children}</Text>\n : children}\n {isPending && (\n <div\n aria-hidden=\"true\"\n style={{visibility: isProgressVisible ? 'visible' : 'hidden'}}\n className={classNames(styles, 'spectrum-Button-circleLoader')}>\n <ProgressCircle\n aria-label={isPendingAriaLiveLabel}\n isIndeterminate\n size=\"S\"\n staticColor={staticColor} />\n </div>\n )}\n {isPending &&\n <>\n <div aria-live={isFocused ? ariaLive : 'off'}>\n {isProgressVisible &&\n <div role=\"img\" aria-labelledby={isPendingAriaLiveLabelledby} />\n }\n </div>\n {/* Adding the element here with the same labels as the button itself causes aria-live to pick up the change in Safari.\n Safari with VO unfortunately doesn't announce changes to *all* of its labels specifically for button\n https://a11ysupport.io/tests/tech__html__button-name-change#assertion-aria-aria-label_attribute-convey_name_change-html-button_element-vo_macos-safari\n The aria-live may cause extra announcements in other browsers. */}\n <div id={spinnerId} role=\"img\" aria-label={isPendingAriaLiveLabel} />\n </>\n }\n </SlotProvider>\n </Element>\n </FocusRing>\n );\n}\n\n/**\n * Buttons allow users to perform an action or to navigate to another page.\n * They have multiple styles for various needs, and are ideal for calling attention to\n * where a user needs to do something in order to move forward in a flow.\n */\nlet _Button = React.forwardRef(Button) as <T extends ElementType = 'button'>(props: SpectrumButtonProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_Button as Button};\n"],"names":[],"version":3,"file":"Button.main.js.map"}
|
package/dist/Button.mjs
CHANGED
@@ -56,9 +56,9 @@ function $b865a6f0049e2d66$var$disablePendingProps(props) {
|
|
56
56
|
function $b865a6f0049e2d66$var$Button(props, ref) {
|
57
57
|
var _buttonProps_arialabelledby;
|
58
58
|
props = (0, $l1zrX$useProviderProps)(props);
|
59
|
-
props = (0, $l1zrX$useSlotProps)(props,
|
59
|
+
props = (0, $l1zrX$useSlotProps)(props, 'button');
|
60
60
|
props = $b865a6f0049e2d66$var$disablePendingProps(props);
|
61
|
-
let { elementType: Element =
|
61
|
+
let { elementType: Element = 'button', children: children, variant: variant, style: style = variant === 'accent' || variant === 'cta' ? 'fill' : 'outline', staticColor: staticColor, isDisabled: isDisabled, isPending: isPending, autoFocus: autoFocus, ...otherProps } = props;
|
62
62
|
let domRef = (0, $l1zrX$useFocusableRef)(ref);
|
63
63
|
let { buttonProps: buttonProps, isPressed: isPressed } = (0, $l1zrX$useButton)(props, domRef);
|
64
64
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $l1zrX$useHover)({
|
@@ -69,12 +69,12 @@ function $b865a6f0049e2d66$var$Button(props, ref) {
|
|
69
69
|
onFocusChange: onFocusChange,
|
70
70
|
isDisabled: isDisabled
|
71
71
|
});
|
72
|
-
let stringFormatter = (0, $l1zrX$useLocalizedStringFormatter)((0, ($parcel$interopDefault($l1zrX$intlStringsmodulejs))),
|
72
|
+
let stringFormatter = (0, $l1zrX$useLocalizedStringFormatter)((0, ($parcel$interopDefault($l1zrX$intlStringsmodulejs))), '@react-spectrum/button');
|
73
73
|
let { styleProps: styleProps } = (0, $l1zrX$useStyleProps)(otherProps);
|
74
|
-
let hasLabel = (0, $l1zrX$useHasChild)(`.${(0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs)))[
|
75
|
-
let hasIcon = (0, $l1zrX$useHasChild)(`.${(0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs)))[
|
74
|
+
let hasLabel = (0, $l1zrX$useHasChild)(`.${(0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs)))['spectrum-Button-label']}`, domRef);
|
75
|
+
let hasIcon = (0, $l1zrX$useHasChild)(`.${(0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs)))['spectrum-Icon']}`, domRef);
|
76
76
|
// an aria label will block children and their labels from being read, this is undesirable for pending state
|
77
|
-
let hasAriaLabel = !!buttonProps[
|
77
|
+
let hasAriaLabel = !!buttonProps['aria-label'] || !!buttonProps['aria-labelledby'];
|
78
78
|
let [isProgressVisible, setIsProgressVisible] = (0, $l1zrX$useState)(false);
|
79
79
|
let backupButtonId = (0, $l1zrX$useId)();
|
80
80
|
let buttonId = buttonProps.id || backupButtonId;
|
@@ -96,62 +96,71 @@ function $b865a6f0049e2d66$var$Button(props, ref) {
|
|
96
96
|
}, [
|
97
97
|
isPending
|
98
98
|
]);
|
99
|
-
if (variant ===
|
100
|
-
else if (variant ===
|
101
|
-
variant =
|
102
|
-
staticColor =
|
99
|
+
if (variant === 'cta') variant = 'accent';
|
100
|
+
else if (variant === 'overBackground') {
|
101
|
+
variant = 'primary';
|
102
|
+
staticColor = 'white';
|
103
103
|
}
|
104
|
-
const isPendingAriaLiveLabel = `${hasAriaLabel ? buttonProps[
|
104
|
+
const isPendingAriaLiveLabel = `${hasAriaLabel ? buttonProps['aria-label'] : ''} ${stringFormatter.format('pending')}`.trim();
|
105
105
|
var _buttonProps_arialabelledby_replace;
|
106
|
-
const isPendingAriaLiveLabelledby = hasAriaLabel ? (_buttonProps_arialabelledby_replace = (_buttonProps_arialabelledby = buttonProps[
|
107
|
-
let ariaLive =
|
108
|
-
if ((0, $l1zrX$isAppleDevice)() && (!hasAriaLabel || (0, $l1zrX$isFirefox)())) ariaLive =
|
106
|
+
const isPendingAriaLiveLabelledby = hasAriaLabel ? (_buttonProps_arialabelledby_replace = (_buttonProps_arialabelledby = buttonProps['aria-labelledby']) === null || _buttonProps_arialabelledby === void 0 ? void 0 : _buttonProps_arialabelledby.replace(buttonId, spinnerId)) !== null && _buttonProps_arialabelledby_replace !== void 0 ? _buttonProps_arialabelledby_replace : spinnerId : `${hasIcon ? iconId : ''} ${hasLabel ? textId : ''} ${spinnerId}`.trim();
|
107
|
+
let ariaLive = 'polite';
|
108
|
+
if ((0, $l1zrX$isAppleDevice)() && (!hasAriaLabel || (0, $l1zrX$isFirefox)())) ariaLive = 'off';
|
109
|
+
let isPendingProps = isPending ? {
|
110
|
+
onClick: (e)=>{
|
111
|
+
if (e.currentTarget instanceof HTMLButtonElement) e.preventDefault();
|
112
|
+
}
|
113
|
+
} : {
|
114
|
+
// no-op.
|
115
|
+
// Not sure why, but TypeScript wouldn't allow to have an empty object `{}`.
|
116
|
+
onClick: ()=>{}
|
117
|
+
};
|
109
118
|
return /*#__PURE__*/ (0, $l1zrX$react).createElement((0, $l1zrX$FocusRing), {
|
110
|
-
focusRingClass: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))),
|
119
|
+
focusRingClass: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))), 'focus-ring'),
|
111
120
|
autoFocus: autoFocus
|
112
121
|
}, /*#__PURE__*/ (0, $l1zrX$react).createElement(Element, {
|
113
122
|
...styleProps,
|
114
|
-
...(0, $l1zrX$mergeProps)(buttonProps, hoverProps, focusProps),
|
123
|
+
...(0, $l1zrX$mergeProps)(buttonProps, hoverProps, focusProps, isPendingProps),
|
115
124
|
id: buttonId,
|
116
125
|
ref: domRef,
|
117
126
|
"data-variant": variant,
|
118
127
|
"data-style": style,
|
119
128
|
"data-static-color": staticColor || undefined,
|
120
|
-
"aria-disabled": isPending ?
|
121
|
-
"aria-label": isPending ? isPendingAriaLiveLabel : buttonProps[
|
122
|
-
"aria-labelledby": isPending ? isPendingAriaLiveLabelledby : buttonProps[
|
123
|
-
className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))),
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
+
"aria-disabled": isPending ? 'true' : undefined,
|
130
|
+
"aria-label": isPending ? isPendingAriaLiveLabel : buttonProps['aria-label'],
|
131
|
+
"aria-labelledby": isPending ? isPendingAriaLiveLabelledby : buttonProps['aria-labelledby'],
|
132
|
+
className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))), 'spectrum-Button', {
|
133
|
+
'spectrum-Button--iconOnly': hasIcon && !hasLabel,
|
134
|
+
'is-disabled': isDisabled || isProgressVisible,
|
135
|
+
'is-active': isPressed,
|
136
|
+
'is-hovered': isHovered,
|
137
|
+
'spectrum-Button--pending': isProgressVisible
|
129
138
|
}, styleProps.className)
|
130
139
|
}, /*#__PURE__*/ (0, $l1zrX$react).createElement((0, $l1zrX$SlotProvider), {
|
131
140
|
slots: {
|
132
141
|
icon: {
|
133
142
|
id: iconId,
|
134
|
-
size:
|
135
|
-
UNSAFE_className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))),
|
143
|
+
size: 'S',
|
144
|
+
UNSAFE_className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))), 'spectrum-Icon')
|
136
145
|
},
|
137
146
|
text: {
|
138
147
|
id: textId,
|
139
|
-
UNSAFE_className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))),
|
148
|
+
UNSAFE_className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))), 'spectrum-Button-label')
|
140
149
|
}
|
141
150
|
}
|
142
|
-
}, typeof children ===
|
151
|
+
}, typeof children === 'string' ? /*#__PURE__*/ (0, $l1zrX$react).createElement((0, $l1zrX$Text), null, children) : children, isPending && /*#__PURE__*/ (0, $l1zrX$react).createElement("div", {
|
143
152
|
"aria-hidden": "true",
|
144
153
|
style: {
|
145
|
-
visibility: isProgressVisible ?
|
154
|
+
visibility: isProgressVisible ? 'visible' : 'hidden'
|
146
155
|
},
|
147
|
-
className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))),
|
156
|
+
className: (0, $l1zrX$classNames)((0, ($parcel$interopDefault($l1zrX$button_vars_cssmodulejs))), 'spectrum-Button-circleLoader')
|
148
157
|
}, /*#__PURE__*/ (0, $l1zrX$react).createElement((0, $l1zrX$ProgressCircle), {
|
149
158
|
"aria-label": isPendingAriaLiveLabel,
|
150
159
|
isIndeterminate: true,
|
151
160
|
size: "S",
|
152
161
|
staticColor: staticColor
|
153
162
|
})), isPending && /*#__PURE__*/ (0, $l1zrX$react).createElement((0, $l1zrX$react).Fragment, null, /*#__PURE__*/ (0, $l1zrX$react).createElement("div", {
|
154
|
-
"aria-live": isFocused ? ariaLive :
|
163
|
+
"aria-live": isFocused ? ariaLive : 'off'
|
155
164
|
}, isProgressVisible && /*#__PURE__*/ (0, $l1zrX$react).createElement("div", {
|
156
165
|
role: "img",
|
157
166
|
"aria-labelledby": isPendingAriaLiveLabelledby
|
@@ -169,4 +178,4 @@ function $b865a6f0049e2d66$var$Button(props, ref) {
|
|
169
178
|
|
170
179
|
|
171
180
|
export {$b865a6f0049e2d66$export$353f5b6fc5456de1 as Button};
|
172
|
-
//# sourceMappingURL=Button.
|
181
|
+
//# sourceMappingURL=Button.module.js.map
|