@react-spectrum/button 3.13.0 → 3.14.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/button",
3
- "version": "3.13.0",
3
+ "version": "3.14.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,19 +36,19 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/button": "^3.8.2",
40
- "@react-aria/focus": "^3.14.1",
41
- "@react-aria/i18n": "^3.8.2",
42
- "@react-aria/interactions": "^3.18.0",
43
- "@react-aria/utils": "^3.20.0",
44
- "@react-spectrum/progress": "^3.6.2",
45
- "@react-spectrum/text": "^3.4.5",
46
- "@react-spectrum/utils": "^3.10.2",
47
- "@react-stately/toggle": "^3.6.2",
48
- "@react-types/button": "^3.8.0",
49
- "@react-types/progress": "^3.4.3",
50
- "@react-types/shared": "^3.20.0",
51
- "@spectrum-icons/ui": "^3.5.5",
39
+ "@react-aria/button": "^3.8.4",
40
+ "@react-aria/focus": "^3.14.3",
41
+ "@react-aria/i18n": "^3.8.4",
42
+ "@react-aria/interactions": "^3.19.1",
43
+ "@react-aria/utils": "^3.21.1",
44
+ "@react-spectrum/progress": "^3.7.1",
45
+ "@react-spectrum/text": "^3.4.7",
46
+ "@react-spectrum/utils": "^3.11.1",
47
+ "@react-stately/toggle": "^3.6.3",
48
+ "@react-types/button": "^3.9.0",
49
+ "@react-types/progress": "^3.5.0",
50
+ "@react-types/shared": "^3.21.0",
51
+ "@spectrum-icons/ui": "^3.6.1",
52
52
  "@swc/helpers": "^0.5.0"
53
53
  },
54
54
  "devDependencies": {
@@ -62,5 +62,5 @@
62
62
  "publishConfig": {
63
63
  "access": "public"
64
64
  },
65
- "gitHead": "54fbaa67cc56867506811819fef765546d403253"
65
+ "gitHead": "3ecf62dcceea437cb12df1851636dd491bb6591c"
66
66
  }
package/src/Button.tsx CHANGED
@@ -34,8 +34,8 @@ import {useLocalizedStringFormatter} from '@react-aria/i18n';
34
34
  import {useProviderProps} from '@react-spectrum/provider';
35
35
 
36
36
  function disablePendingProps(props) {
37
- // Don't allow interaction while UNSTABLE_isPending is true
38
- if (props.UNSTABLE_isPending) {
37
+ // Don't allow interaction while isPending is true
38
+ if (props.isPending) {
39
39
  props.onPress = undefined;
40
40
  props.onPressStart = undefined;
41
41
  props.onPressEnd = undefined;
@@ -60,7 +60,7 @@ function Button<T extends ElementType = 'button'>(props: SpectrumButtonProps<T>,
60
60
  style = variant === 'accent' || variant === 'cta' ? 'fill' : 'outline',
61
61
  staticColor,
62
62
  isDisabled,
63
- UNSTABLE_isPending,
63
+ isPending,
64
64
  autoFocus,
65
65
  ...otherProps
66
66
  } = props;
@@ -76,20 +76,20 @@ function Button<T extends ElementType = 'button'>(props: SpectrumButtonProps<T>,
76
76
  useEffect(() => {
77
77
  let timeout: ReturnType<typeof setTimeout>;
78
78
 
79
- if (UNSTABLE_isPending) {
80
- // Start timer when UNSTABLE_isPending is set to true.
79
+ if (isPending) {
80
+ // Start timer when isPending is set to true.
81
81
  timeout = setTimeout(() => {
82
82
  setIsProgressVisible(true);
83
83
  }, 1000);
84
84
  } else {
85
- // Exit loading state when UNSTABLE_isPending is set to false. */
85
+ // Exit loading state when isPending is set to false. */
86
86
  setIsProgressVisible(false);
87
87
  }
88
88
  return () => {
89
- // Clean up on unmount or when user removes UNSTABLE_isPending prop before entering loading state.
89
+ // Clean up on unmount or when user removes isPending prop before entering loading state.
90
90
  clearTimeout(timeout);
91
91
  };
92
- }, [UNSTABLE_isPending]);
92
+ }, [isPending]);
93
93
 
94
94
  if (variant === 'cta') {
95
95
  variant = 'accent';
@@ -107,8 +107,8 @@ function Button<T extends ElementType = 'button'>(props: SpectrumButtonProps<T>,
107
107
  data-variant={variant}
108
108
  data-style={style}
109
109
  data-static-color={staticColor || undefined}
110
- aria-disabled={UNSTABLE_isPending || undefined}
111
- aria-live={UNSTABLE_isPending ? 'polite' : undefined}
110
+ aria-disabled={isPending || undefined}
111
+ aria-live={isPending ? 'polite' : undefined}
112
112
  className={
113
113
  classNames(
114
114
  styles,
@@ -138,7 +138,7 @@ function Button<T extends ElementType = 'button'>(props: SpectrumButtonProps<T>,
138
138
  isIndeterminate
139
139
  size="S"
140
140
  UNSAFE_className={classNames(styles, 'spectrum-Button-circleLoader')}
141
- variant={staticColor ? 'overBackground' : undefined} />}
141
+ staticColor={staticColor} />}
142
142
  {typeof children === 'string'
143
143
  ? <Text>{children}</Text>
144
144
  : children}