@react-spectrum/button 3.14.1 → 3.16.0

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.
Files changed (180) hide show
  1. package/dist/ar-AE.main.js +6 -0
  2. package/dist/ar-AE.main.js.map +1 -0
  3. package/dist/ar-AE.mjs +8 -0
  4. package/dist/ar-AE.module.js +8 -0
  5. package/dist/ar-AE.module.js.map +1 -0
  6. package/dist/bg-BG.main.js +6 -0
  7. package/dist/bg-BG.main.js.map +1 -0
  8. package/dist/bg-BG.mjs +8 -0
  9. package/dist/bg-BG.module.js +8 -0
  10. package/dist/bg-BG.module.js.map +1 -0
  11. package/dist/cs-CZ.main.js +6 -0
  12. package/dist/cs-CZ.main.js.map +1 -0
  13. package/dist/cs-CZ.mjs +8 -0
  14. package/dist/cs-CZ.module.js +8 -0
  15. package/dist/cs-CZ.module.js.map +1 -0
  16. package/dist/da-DK.main.js +6 -0
  17. package/dist/da-DK.main.js.map +1 -0
  18. package/dist/da-DK.mjs +8 -0
  19. package/dist/da-DK.module.js +8 -0
  20. package/dist/da-DK.module.js.map +1 -0
  21. package/dist/de-DE.main.js +6 -0
  22. package/dist/de-DE.main.js.map +1 -0
  23. package/dist/de-DE.mjs +8 -0
  24. package/dist/de-DE.module.js +8 -0
  25. package/dist/de-DE.module.js.map +1 -0
  26. package/dist/el-GR.main.js +6 -0
  27. package/dist/el-GR.main.js.map +1 -0
  28. package/dist/el-GR.mjs +8 -0
  29. package/dist/el-GR.module.js +8 -0
  30. package/dist/el-GR.module.js.map +1 -0
  31. package/dist/en-US.main.js +6 -0
  32. package/dist/en-US.main.js.map +1 -0
  33. package/dist/en-US.mjs +8 -0
  34. package/dist/en-US.module.js +8 -0
  35. package/dist/en-US.module.js.map +1 -0
  36. package/dist/es-ES.main.js +6 -0
  37. package/dist/es-ES.main.js.map +1 -0
  38. package/dist/es-ES.mjs +8 -0
  39. package/dist/es-ES.module.js +8 -0
  40. package/dist/es-ES.module.js.map +1 -0
  41. package/dist/et-EE.main.js +6 -0
  42. package/dist/et-EE.main.js.map +1 -0
  43. package/dist/et-EE.mjs +8 -0
  44. package/dist/et-EE.module.js +8 -0
  45. package/dist/et-EE.module.js.map +1 -0
  46. package/dist/fi-FI.main.js +6 -0
  47. package/dist/fi-FI.main.js.map +1 -0
  48. package/dist/fi-FI.mjs +8 -0
  49. package/dist/fi-FI.module.js +8 -0
  50. package/dist/fi-FI.module.js.map +1 -0
  51. package/dist/fr-FR.main.js +6 -0
  52. package/dist/fr-FR.main.js.map +1 -0
  53. package/dist/fr-FR.mjs +8 -0
  54. package/dist/fr-FR.module.js +8 -0
  55. package/dist/fr-FR.module.js.map +1 -0
  56. package/dist/he-IL.main.js +6 -0
  57. package/dist/he-IL.main.js.map +1 -0
  58. package/dist/he-IL.mjs +8 -0
  59. package/dist/he-IL.module.js +8 -0
  60. package/dist/he-IL.module.js.map +1 -0
  61. package/dist/hr-HR.main.js +6 -0
  62. package/dist/hr-HR.main.js.map +1 -0
  63. package/dist/hr-HR.mjs +8 -0
  64. package/dist/hr-HR.module.js +8 -0
  65. package/dist/hr-HR.module.js.map +1 -0
  66. package/dist/hu-HU.main.js +6 -0
  67. package/dist/hu-HU.main.js.map +1 -0
  68. package/dist/hu-HU.mjs +8 -0
  69. package/dist/hu-HU.module.js +8 -0
  70. package/dist/hu-HU.module.js.map +1 -0
  71. package/dist/import.mjs +86 -182
  72. package/dist/it-IT.main.js +6 -0
  73. package/dist/it-IT.main.js.map +1 -0
  74. package/dist/it-IT.mjs +8 -0
  75. package/dist/it-IT.module.js +8 -0
  76. package/dist/it-IT.module.js.map +1 -0
  77. package/dist/ja-JP.main.js +6 -0
  78. package/dist/ja-JP.main.js.map +1 -0
  79. package/dist/ja-JP.mjs +8 -0
  80. package/dist/ja-JP.module.js +8 -0
  81. package/dist/ja-JP.module.js.map +1 -0
  82. package/dist/ko-KR.main.js +6 -0
  83. package/dist/ko-KR.main.js.map +1 -0
  84. package/dist/ko-KR.mjs +8 -0
  85. package/dist/ko-KR.module.js +8 -0
  86. package/dist/ko-KR.module.js.map +1 -0
  87. package/dist/lt-LT.main.js +6 -0
  88. package/dist/lt-LT.main.js.map +1 -0
  89. package/dist/lt-LT.mjs +8 -0
  90. package/dist/lt-LT.module.js +8 -0
  91. package/dist/lt-LT.module.js.map +1 -0
  92. package/dist/lv-LV.main.js +6 -0
  93. package/dist/lv-LV.main.js.map +1 -0
  94. package/dist/lv-LV.mjs +8 -0
  95. package/dist/lv-LV.module.js +8 -0
  96. package/dist/lv-LV.module.js.map +1 -0
  97. package/dist/main.css +1771 -1
  98. package/dist/main.css.map +1 -0
  99. package/dist/main.js +84 -180
  100. package/dist/main.js.map +1 -1
  101. package/dist/module.js +86 -182
  102. package/dist/module.js.map +1 -1
  103. package/dist/nb-NO.main.js +6 -0
  104. package/dist/nb-NO.main.js.map +1 -0
  105. package/dist/nb-NO.mjs +8 -0
  106. package/dist/nb-NO.module.js +8 -0
  107. package/dist/nb-NO.module.js.map +1 -0
  108. package/dist/nl-NL.main.js +6 -0
  109. package/dist/nl-NL.main.js.map +1 -0
  110. package/dist/nl-NL.mjs +8 -0
  111. package/dist/nl-NL.module.js +8 -0
  112. package/dist/nl-NL.module.js.map +1 -0
  113. package/dist/pl-PL.main.js +6 -0
  114. package/dist/pl-PL.main.js.map +1 -0
  115. package/dist/pl-PL.mjs +8 -0
  116. package/dist/pl-PL.module.js +8 -0
  117. package/dist/pl-PL.module.js.map +1 -0
  118. package/dist/pt-BR.main.js +6 -0
  119. package/dist/pt-BR.main.js.map +1 -0
  120. package/dist/pt-BR.mjs +8 -0
  121. package/dist/pt-BR.module.js +8 -0
  122. package/dist/pt-BR.module.js.map +1 -0
  123. package/dist/pt-PT.main.js +6 -0
  124. package/dist/pt-PT.main.js.map +1 -0
  125. package/dist/pt-PT.mjs +8 -0
  126. package/dist/pt-PT.module.js +8 -0
  127. package/dist/pt-PT.module.js.map +1 -0
  128. package/dist/ro-RO.main.js +6 -0
  129. package/dist/ro-RO.main.js.map +1 -0
  130. package/dist/ro-RO.mjs +8 -0
  131. package/dist/ro-RO.module.js +8 -0
  132. package/dist/ro-RO.module.js.map +1 -0
  133. package/dist/ru-RU.main.js +6 -0
  134. package/dist/ru-RU.main.js.map +1 -0
  135. package/dist/ru-RU.mjs +8 -0
  136. package/dist/ru-RU.module.js +8 -0
  137. package/dist/ru-RU.module.js.map +1 -0
  138. package/dist/sk-SK.main.js +6 -0
  139. package/dist/sk-SK.main.js.map +1 -0
  140. package/dist/sk-SK.mjs +8 -0
  141. package/dist/sk-SK.module.js +8 -0
  142. package/dist/sk-SK.module.js.map +1 -0
  143. package/dist/sl-SI.main.js +6 -0
  144. package/dist/sl-SI.main.js.map +1 -0
  145. package/dist/sl-SI.mjs +8 -0
  146. package/dist/sl-SI.module.js +8 -0
  147. package/dist/sl-SI.module.js.map +1 -0
  148. package/dist/sr-SP.main.js +6 -0
  149. package/dist/sr-SP.main.js.map +1 -0
  150. package/dist/sr-SP.mjs +8 -0
  151. package/dist/sr-SP.module.js +8 -0
  152. package/dist/sr-SP.module.js.map +1 -0
  153. package/dist/sv-SE.main.js +6 -0
  154. package/dist/sv-SE.main.js.map +1 -0
  155. package/dist/sv-SE.mjs +8 -0
  156. package/dist/sv-SE.module.js +8 -0
  157. package/dist/sv-SE.module.js.map +1 -0
  158. package/dist/tr-TR.main.js +6 -0
  159. package/dist/tr-TR.main.js.map +1 -0
  160. package/dist/tr-TR.mjs +8 -0
  161. package/dist/tr-TR.module.js +8 -0
  162. package/dist/tr-TR.module.js.map +1 -0
  163. package/dist/types.d.ts.map +1 -1
  164. package/dist/uk-UA.main.js +6 -0
  165. package/dist/uk-UA.main.js.map +1 -0
  166. package/dist/uk-UA.mjs +8 -0
  167. package/dist/uk-UA.module.js +8 -0
  168. package/dist/uk-UA.module.js.map +1 -0
  169. package/dist/zh-CN.main.js +6 -0
  170. package/dist/zh-CN.main.js.map +1 -0
  171. package/dist/zh-CN.mjs +8 -0
  172. package/dist/zh-CN.module.js +8 -0
  173. package/dist/zh-CN.module.js.map +1 -0
  174. package/dist/zh-TW.main.js +6 -0
  175. package/dist/zh-TW.main.js.map +1 -0
  176. package/dist/zh-TW.mjs +8 -0
  177. package/dist/zh-TW.module.js +8 -0
  178. package/dist/zh-TW.module.js.map +1 -0
  179. package/package.json +14 -15
  180. package/src/Button.tsx +55 -15
package/dist/import.mjs CHANGED
@@ -1,21 +1,59 @@
1
+ "use client";
2
+
3
+ import $3d5058299051dde5$exports from "./ar-AE.mjs";
4
+ import $b09fec806b7b8f22$exports from "./bg-BG.mjs";
5
+ import $ca0549dfb1669363$exports from "./cs-CZ.mjs";
6
+ import $98f2907c0694c5b6$exports from "./da-DK.mjs";
7
+ import $9d6fce77106482c8$exports from "./de-DE.mjs";
8
+ import $db5c63cb8d95d7a4$exports from "./el-GR.mjs";
9
+ import $94e4262f3b79d866$exports from "./en-US.mjs";
10
+ import $16cf2bb6affc1ca9$exports from "./es-ES.mjs";
11
+ import $d2a4cd1ccd3b9660$exports from "./et-EE.mjs";
12
+ import $0aa3ceafb597db1b$exports from "./fi-FI.mjs";
13
+ import $5779b104f19b7b1a$exports from "./fr-FR.mjs";
14
+ import $33aba885fd306c4d$exports from "./he-IL.mjs";
15
+ import $30a099a3f19b59af$exports from "./hr-HR.mjs";
16
+ import $f257504b02c6b23f$exports from "./hu-HU.mjs";
17
+ import $b6e12833733478ab$exports from "./it-IT.mjs";
18
+ import $e69fac8c5f9d6043$exports from "./ja-JP.mjs";
19
+ import $a9b740b7d23548d0$exports from "./ko-KR.mjs";
20
+ import $4d8ca888adc67de0$exports from "./lt-LT.mjs";
21
+ import $5d3a845adaaa328a$exports from "./lv-LV.mjs";
22
+ import $20112446b2d06d6e$exports from "./nb-NO.mjs";
23
+ import $168501f8ff8ad607$exports from "./nl-NL.mjs";
24
+ import $7d885e2935e9ed01$exports from "./pl-PL.mjs";
25
+ import $ece77a10c9739c65$exports from "./pt-BR.mjs";
26
+ import $8dbae7e3487e6fc7$exports from "./pt-PT.mjs";
27
+ import $4ab371254445a3f4$exports from "./ro-RO.mjs";
28
+ import $c5ac7ec630c67dba$exports from "./ru-RU.mjs";
29
+ import $846eaea7e21f7fbf$exports from "./sk-SK.mjs";
30
+ import $dde062d6acd4e43a$exports from "./sl-SI.mjs";
31
+ import $579b7ae9c5494112$exports from "./sr-SP.mjs";
32
+ import $3b62c0bcc6cf3c98$exports from "./sv-SE.mjs";
33
+ import $31f966e58b99834b$exports from "./tr-TR.mjs";
34
+ import $a3d99ea5d46a3d12$exports from "./uk-UA.mjs";
35
+ import $6e4b63af77288b7a$exports from "./zh-CN.mjs";
36
+ import $be993a68bccef72a$exports from "./zh-TW.mjs";
1
37
  import "./main.css";
2
38
  import {useSlotProps as $d7FTw$useSlotProps, useFocusableRef as $d7FTw$useFocusableRef, useStyleProps as $d7FTw$useStyleProps, useHasChild as $d7FTw$useHasChild, classNames as $d7FTw$classNames, SlotProvider as $d7FTw$SlotProvider} from "@react-spectrum/utils";
3
39
  import {FocusRing as $d7FTw$FocusRing} from "@react-aria/focus";
4
- import {mergeProps as $d7FTw$mergeProps} from "@react-aria/utils";
40
+ import {useId as $d7FTw$useId, isAppleDevice as $d7FTw$isAppleDevice, isFirefox as $d7FTw$isFirefox, mergeProps as $d7FTw$mergeProps} from "@react-aria/utils";
5
41
  import {ProgressCircle as $d7FTw$ProgressCircle} from "@react-spectrum/progress";
6
42
  import $d7FTw$react, {useState as $d7FTw$useState, useEffect as $d7FTw$useEffect} from "react";
7
43
  import {Text as $d7FTw$Text} from "@react-spectrum/text";
8
44
  import {useButton as $d7FTw$useButton, useToggleButton as $d7FTw$useToggleButton} from "@react-aria/button";
9
- import {useHover as $d7FTw$useHover} from "@react-aria/interactions";
45
+ import {useHover as $d7FTw$useHover, useFocus as $d7FTw$useFocus} from "@react-aria/interactions";
10
46
  import {useLocalizedStringFormatter as $d7FTw$useLocalizedStringFormatter} from "@react-aria/i18n";
11
47
  import {useProviderProps as $d7FTw$useProviderProps} from "@react-spectrum/provider";
12
48
  import $d7FTw$spectrumiconsuiCornerTriangle from "@spectrum-icons/ui/CornerTriangle";
13
49
  import $d7FTw$spectrumiconsuiCrossSmall from "@spectrum-icons/ui/CrossSmall";
14
50
  import {useToggleState as $d7FTw$useToggleState} from "@react-stately/toggle";
15
51
 
52
+
16
53
  function $parcel$interopDefault(a) {
17
54
  return a && a.__esModule ? a.default : a;
18
55
  }
56
+
19
57
  function $parcel$export(e, n, v, s) {
20
58
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
21
59
  }
@@ -43,208 +81,38 @@ function $parcel$export(e, n, v, s) {
43
81
  */
44
82
 
45
83
  var $94fed84ca44dbd5b$exports = {};
46
- var $3d5058299051dde5$exports = {};
47
- $3d5058299051dde5$exports = {
48
- "loading": `جارٍ التحميل...`
49
- };
50
-
51
-
52
- var $b09fec806b7b8f22$exports = {};
53
- $b09fec806b7b8f22$exports = {
54
- "loading": `Зареждане...`
55
- };
56
-
57
-
58
- var $ca0549dfb1669363$exports = {};
59
- $ca0549dfb1669363$exports = {
60
- "loading": `Načítání...`
61
- };
62
-
63
-
64
- var $98f2907c0694c5b6$exports = {};
65
- $98f2907c0694c5b6$exports = {
66
- "loading": `Indlæser ...`
67
- };
68
-
69
-
70
- var $9d6fce77106482c8$exports = {};
71
- $9d6fce77106482c8$exports = {
72
- "loading": `Wird geladen …`
73
- };
74
-
75
-
76
- var $db5c63cb8d95d7a4$exports = {};
77
- $db5c63cb8d95d7a4$exports = {
78
- "loading": `Φόρτωση…`
79
- };
80
-
81
-
82
- var $94e4262f3b79d866$exports = {};
83
- $94e4262f3b79d866$exports = {
84
- "loading": `Loading…`
85
- };
86
-
87
-
88
- var $16cf2bb6affc1ca9$exports = {};
89
- $16cf2bb6affc1ca9$exports = {
90
- "loading": `Cargando…`
91
- };
92
-
93
-
94
- var $d2a4cd1ccd3b9660$exports = {};
95
- $d2a4cd1ccd3b9660$exports = {
96
- "loading": `Laadimine...`
97
- };
98
-
99
-
100
- var $0aa3ceafb597db1b$exports = {};
101
- $0aa3ceafb597db1b$exports = {
102
- "loading": `Ladataan…`
103
- };
104
-
105
-
106
- var $5779b104f19b7b1a$exports = {};
107
- $5779b104f19b7b1a$exports = {
108
- "loading": `Chargement en cours…`
109
- };
110
-
111
-
112
- var $33aba885fd306c4d$exports = {};
113
- $33aba885fd306c4d$exports = {
114
- "loading": `טוען...`
115
- };
116
-
117
84
 
118
- var $30a099a3f19b59af$exports = {};
119
- $30a099a3f19b59af$exports = {
120
- "loading": `Učitavam...`
121
- };
122
85
 
123
86
 
124
- var $f257504b02c6b23f$exports = {};
125
- $f257504b02c6b23f$exports = {
126
- "loading": `Betöltés folyamatban…`
127
- };
128
87
 
129
88
 
130
- var $b6e12833733478ab$exports = {};
131
- $b6e12833733478ab$exports = {
132
- "loading": `Caricamento...`
133
- };
134
89
 
135
90
 
136
- var $e69fac8c5f9d6043$exports = {};
137
- $e69fac8c5f9d6043$exports = {
138
- "loading": `読み込み中...`
139
- };
140
91
 
141
92
 
142
- var $a9b740b7d23548d0$exports = {};
143
- $a9b740b7d23548d0$exports = {
144
- "loading": `로드 중…`
145
- };
146
93
 
147
94
 
148
- var $4d8ca888adc67de0$exports = {};
149
- $4d8ca888adc67de0$exports = {
150
- "loading": `Įkeliama…`
151
- };
152
95
 
153
96
 
154
- var $5d3a845adaaa328a$exports = {};
155
- $5d3a845adaaa328a$exports = {
156
- "loading": `Notiek ielāde…`
157
- };
158
97
 
159
98
 
160
- var $20112446b2d06d6e$exports = {};
161
- $20112446b2d06d6e$exports = {
162
- "loading": `Laster inn ...`
163
- };
164
99
 
165
100
 
166
- var $168501f8ff8ad607$exports = {};
167
- $168501f8ff8ad607$exports = {
168
- "loading": `Laden...`
169
- };
170
101
 
171
102
 
172
- var $7d885e2935e9ed01$exports = {};
173
- $7d885e2935e9ed01$exports = {
174
- "loading": `Wczytywanie...`
175
- };
176
103
 
177
104
 
178
- var $ece77a10c9739c65$exports = {};
179
- $ece77a10c9739c65$exports = {
180
- "loading": `Carregando...`
181
- };
182
105
 
183
106
 
184
- var $8dbae7e3487e6fc7$exports = {};
185
- $8dbae7e3487e6fc7$exports = {
186
- "loading": `A carregar...`
187
- };
188
107
 
189
108
 
190
- var $4ab371254445a3f4$exports = {};
191
- $4ab371254445a3f4$exports = {
192
- "loading": `Se încarcă...`
193
- };
194
109
 
195
110
 
196
- var $c5ac7ec630c67dba$exports = {};
197
- $c5ac7ec630c67dba$exports = {
198
- "loading": `Загрузка...`
199
- };
200
111
 
201
112
 
202
- var $846eaea7e21f7fbf$exports = {};
203
- $846eaea7e21f7fbf$exports = {
204
- "loading": `Načítava sa...`
205
- };
206
113
 
207
114
 
208
- var $dde062d6acd4e43a$exports = {};
209
- $dde062d6acd4e43a$exports = {
210
- "loading": `Nalaganje ...`
211
- };
212
-
213
115
 
214
- var $579b7ae9c5494112$exports = {};
215
- $579b7ae9c5494112$exports = {
216
- "loading": `Učitavam...`
217
- };
218
-
219
-
220
- var $3b62c0bcc6cf3c98$exports = {};
221
- $3b62c0bcc6cf3c98$exports = {
222
- "loading": `Läser in...`
223
- };
224
-
225
-
226
- var $31f966e58b99834b$exports = {};
227
- $31f966e58b99834b$exports = {
228
- "loading": `Yükleniyor...`
229
- };
230
-
231
-
232
- var $a3d99ea5d46a3d12$exports = {};
233
- $a3d99ea5d46a3d12$exports = {
234
- "loading": `Завантаження…`
235
- };
236
-
237
-
238
- var $6e4b63af77288b7a$exports = {};
239
- $6e4b63af77288b7a$exports = {
240
- "loading": `正在加载...`
241
- };
242
-
243
-
244
- var $be993a68bccef72a$exports = {};
245
- $be993a68bccef72a$exports = {
246
- "loading": `載入中…`
247
- };
248
116
 
249
117
 
250
118
  $94fed84ca44dbd5b$exports = {
@@ -424,20 +292,33 @@ function $b865a6f0049e2d66$var$disablePendingProps(props) {
424
292
  return props;
425
293
  }
426
294
  function $b865a6f0049e2d66$var$Button(props, ref) {
295
+ var _buttonProps_arialabelledby;
427
296
  props = (0, $d7FTw$useProviderProps)(props);
428
297
  props = (0, $d7FTw$useSlotProps)(props, "button");
429
298
  props = $b865a6f0049e2d66$var$disablePendingProps(props);
430
- let { elementType: ElementType = "button", children: children, variant: variant, style: style = variant === "accent" || variant === "cta" ? "fill" : "outline", staticColor: staticColor, isDisabled: isDisabled, isPending: isPending, autoFocus: autoFocus, ...otherProps } = props;
299
+ 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;
431
300
  let domRef = (0, $d7FTw$useFocusableRef)(ref);
432
301
  let { buttonProps: buttonProps, isPressed: isPressed } = (0, $d7FTw$useButton)(props, domRef);
433
302
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $d7FTw$useHover)({
434
303
  isDisabled: isDisabled
435
304
  });
436
- let stringFormatter = (0, $d7FTw$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($94fed84ca44dbd5b$exports))));
305
+ let [isFocused, onFocusChange] = (0, $d7FTw$useState)(false);
306
+ let { focusProps: focusProps } = (0, $d7FTw$useFocus)({
307
+ onFocusChange: onFocusChange,
308
+ isDisabled: isDisabled
309
+ });
310
+ let stringFormatter = (0, $d7FTw$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($94fed84ca44dbd5b$exports))), "@react-spectrum/button");
437
311
  let { styleProps: styleProps } = (0, $d7FTw$useStyleProps)(otherProps);
438
312
  let hasLabel = (0, $d7FTw$useHasChild)(`.${(0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports)))["spectrum-Button-label"]}`, domRef);
439
313
  let hasIcon = (0, $d7FTw$useHasChild)(`.${(0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports)))["spectrum-Icon"]}`, domRef);
314
+ // an aria label will block children and their labels from being read, this is undesirable for pending state
315
+ let hasAriaLabel = !!buttonProps["aria-label"] || !!buttonProps["aria-labelledby"];
440
316
  let [isProgressVisible, setIsProgressVisible] = (0, $d7FTw$useState)(false);
317
+ let backupButtonId = (0, $d7FTw$useId)();
318
+ let buttonId = buttonProps.id || backupButtonId;
319
+ let iconId = (0, $d7FTw$useId)();
320
+ let textId = (0, $d7FTw$useId)();
321
+ let spinnerId = (0, $d7FTw$useId)();
441
322
  (0, $d7FTw$useEffect)(()=>{
442
323
  let timeout;
443
324
  if (isPending) // Start timer when isPending is set to true.
@@ -458,18 +339,25 @@ function $b865a6f0049e2d66$var$Button(props, ref) {
458
339
  variant = "primary";
459
340
  staticColor = "white";
460
341
  }
342
+ const isPendingAriaLiveLabel = `${hasAriaLabel ? buttonProps["aria-label"] : ""} ${stringFormatter.format("pending")}`.trim();
343
+ var _buttonProps_arialabelledby_replace;
344
+ 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();
345
+ let ariaLive = "polite";
346
+ if ((0, $d7FTw$isAppleDevice)() && (!hasAriaLabel || (0, $d7FTw$isFirefox)())) ariaLive = "off";
461
347
  return /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$FocusRing), {
462
348
  focusRingClass: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "focus-ring"),
463
349
  autoFocus: autoFocus
464
- }, /*#__PURE__*/ (0, $d7FTw$react).createElement(ElementType, {
350
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement(Element, {
465
351
  ...styleProps,
466
- ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps),
352
+ ...(0, $d7FTw$mergeProps)(buttonProps, hoverProps, focusProps),
353
+ id: buttonId,
467
354
  ref: domRef,
468
355
  "data-variant": variant,
469
356
  "data-style": style,
470
357
  "data-static-color": staticColor || undefined,
471
- "aria-disabled": isPending || undefined,
472
- "aria-live": isPending ? "polite" : undefined,
358
+ "aria-disabled": isPending ? "true" : undefined,
359
+ "aria-label": isPending ? isPendingAriaLiveLabel : buttonProps["aria-label"],
360
+ "aria-labelledby": isPending ? isPendingAriaLiveLabelledby : buttonProps["aria-labelledby"],
473
361
  className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Button", {
474
362
  "spectrum-Button--iconOnly": hasIcon && !hasLabel,
475
363
  "is-disabled": isDisabled || isProgressVisible,
@@ -480,20 +368,36 @@ function $b865a6f0049e2d66$var$Button(props, ref) {
480
368
  }, /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$SlotProvider), {
481
369
  slots: {
482
370
  icon: {
371
+ id: iconId,
483
372
  size: "S",
484
373
  UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Icon")
485
374
  },
486
375
  text: {
376
+ id: textId,
487
377
  UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Button-label")
488
378
  }
489
379
  }
490
- }, isProgressVisible && /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$ProgressCircle), {
491
- "aria-label": stringFormatter.format("loading"),
380
+ }, typeof children === "string" ? /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$Text), null, children) : children, isPending && /*#__PURE__*/ (0, $d7FTw$react).createElement("div", {
381
+ "aria-hidden": "true",
382
+ style: {
383
+ visibility: isProgressVisible ? "visible" : "hidden"
384
+ },
385
+ className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Button-circleLoader")
386
+ }, /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$ProgressCircle), {
387
+ "aria-label": isPendingAriaLiveLabel,
492
388
  isIndeterminate: true,
493
389
  size: "S",
494
- UNSAFE_className: (0, $d7FTw$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($086e93d2352a4536$exports))), "spectrum-Button-circleLoader"),
495
390
  staticColor: staticColor
496
- }), typeof children === "string" ? /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$Text), null, children) : children)));
391
+ })), isPending && /*#__PURE__*/ (0, $d7FTw$react).createElement((0, $d7FTw$react).Fragment, null, /*#__PURE__*/ (0, $d7FTw$react).createElement("div", {
392
+ "aria-live": isFocused ? ariaLive : "off"
393
+ }, isProgressVisible && /*#__PURE__*/ (0, $d7FTw$react).createElement("div", {
394
+ role: "img",
395
+ "aria-labelledby": isPendingAriaLiveLabelledby
396
+ })), /*#__PURE__*/ (0, $d7FTw$react).createElement("div", {
397
+ id: spinnerId,
398
+ role: "img",
399
+ "aria-label": isPendingAriaLiveLabel
400
+ })))));
497
401
  }
498
402
  /**
499
403
  * Buttons allow users to perform an action or to navigate to another page.
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "pending": `in sospeso`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=it-IT.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,UAAU,CAAC;AAC3C","sources":["packages/@react-spectrum/button/intl/it-IT.json"],"sourcesContent":["{\n \"pending\": \"in sospeso\"\n}\n"],"names":[],"version":3,"file":"it-IT.main.js.map"}
package/dist/it-IT.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $b6e12833733478ab$exports = {};
2
+ $b6e12833733478ab$exports = {
3
+ "pending": `in sospeso`
4
+ };
5
+
6
+
7
+ export {$b6e12833733478ab$exports as default};
8
+ //# sourceMappingURL=it-IT.module.js.map
@@ -0,0 +1,8 @@
1
+ var $b6e12833733478ab$exports = {};
2
+ $b6e12833733478ab$exports = {
3
+ "pending": `in sospeso`
4
+ };
5
+
6
+
7
+ export {$b6e12833733478ab$exports as default};
8
+ //# sourceMappingURL=it-IT.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,UAAU,CAAC;AAC3C","sources":["packages/@react-spectrum/button/intl/it-IT.json"],"sourcesContent":["{\n \"pending\": \"in sospeso\"\n}\n"],"names":[],"version":3,"file":"it-IT.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "pending": `\u{4FDD}\u{7559}`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=ja-JP.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,gBAAE,CAAC;AACnC","sources":["packages/@react-spectrum/button/intl/ja-JP.json"],"sourcesContent":["{\n \"pending\": \"保留\"\n}\n"],"names":[],"version":3,"file":"ja-JP.main.js.map"}
package/dist/ja-JP.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $e69fac8c5f9d6043$exports = {};
2
+ $e69fac8c5f9d6043$exports = {
3
+ "pending": `\u{4FDD}\u{7559}`
4
+ };
5
+
6
+
7
+ export {$e69fac8c5f9d6043$exports as default};
8
+ //# sourceMappingURL=ja-JP.module.js.map
@@ -0,0 +1,8 @@
1
+ var $e69fac8c5f9d6043$exports = {};
2
+ $e69fac8c5f9d6043$exports = {
3
+ "pending": `\u{4FDD}\u{7559}`
4
+ };
5
+
6
+
7
+ export {$e69fac8c5f9d6043$exports as default};
8
+ //# sourceMappingURL=ja-JP.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,gBAAE,CAAC;AACnC","sources":["packages/@react-spectrum/button/intl/ja-JP.json"],"sourcesContent":["{\n \"pending\": \"保留\"\n}\n"],"names":[],"version":3,"file":"ja-JP.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "pending": `\u{BCF4}\u{B958} \u{C911}`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=ko-KR.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,yBAAI,CAAC;AACrC","sources":["packages/@react-spectrum/button/intl/ko-KR.json"],"sourcesContent":["{\n \"pending\": \"보류 중\"\n}\n"],"names":[],"version":3,"file":"ko-KR.main.js.map"}
package/dist/ko-KR.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $a9b740b7d23548d0$exports = {};
2
+ $a9b740b7d23548d0$exports = {
3
+ "pending": `\u{BCF4}\u{B958} \u{C911}`
4
+ };
5
+
6
+
7
+ export {$a9b740b7d23548d0$exports as default};
8
+ //# sourceMappingURL=ko-KR.module.js.map
@@ -0,0 +1,8 @@
1
+ var $a9b740b7d23548d0$exports = {};
2
+ $a9b740b7d23548d0$exports = {
3
+ "pending": `\u{BCF4}\u{B958} \u{C911}`
4
+ };
5
+
6
+
7
+ export {$a9b740b7d23548d0$exports as default};
8
+ //# sourceMappingURL=ko-KR.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,yBAAI,CAAC;AACrC","sources":["packages/@react-spectrum/button/intl/ko-KR.json"],"sourcesContent":["{\n \"pending\": \"보류 중\"\n}\n"],"names":[],"version":3,"file":"ko-KR.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "pending": `laukiama`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=lt-LT.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;AACzC","sources":["packages/@react-spectrum/button/intl/lt-LT.json"],"sourcesContent":["{\n \"pending\": \"laukiama\"\n}\n"],"names":[],"version":3,"file":"lt-LT.main.js.map"}
package/dist/lt-LT.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $4d8ca888adc67de0$exports = {};
2
+ $4d8ca888adc67de0$exports = {
3
+ "pending": `laukiama`
4
+ };
5
+
6
+
7
+ export {$4d8ca888adc67de0$exports as default};
8
+ //# sourceMappingURL=lt-LT.module.js.map
@@ -0,0 +1,8 @@
1
+ var $4d8ca888adc67de0$exports = {};
2
+ $4d8ca888adc67de0$exports = {
3
+ "pending": `laukiama`
4
+ };
5
+
6
+
7
+ export {$4d8ca888adc67de0$exports as default};
8
+ //# sourceMappingURL=lt-LT.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,QAAQ,CAAC;AACzC","sources":["packages/@react-spectrum/button/intl/lt-LT.json"],"sourcesContent":["{\n \"pending\": \"laukiama\"\n}\n"],"names":[],"version":3,"file":"lt-LT.module.js.map"}
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ "pending": `gaida`
3
+ };
4
+
5
+
6
+ //# sourceMappingURL=lv-LV.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,WAAW,CAAC,KAAK,CAAC;AACtC","sources":["packages/@react-spectrum/button/intl/lv-LV.json"],"sourcesContent":["{\n \"pending\": \"gaida\"\n}\n"],"names":[],"version":3,"file":"lv-LV.main.js.map"}
package/dist/lv-LV.mjs ADDED
@@ -0,0 +1,8 @@
1
+ var $5d3a845adaaa328a$exports = {};
2
+ $5d3a845adaaa328a$exports = {
3
+ "pending": `gaida`
4
+ };
5
+
6
+
7
+ export {$5d3a845adaaa328a$exports as default};
8
+ //# sourceMappingURL=lv-LV.module.js.map
@@ -0,0 +1,8 @@
1
+ var $5d3a845adaaa328a$exports = {};
2
+ $5d3a845adaaa328a$exports = {
3
+ "pending": `gaida`
4
+ };
5
+
6
+
7
+ export {$5d3a845adaaa328a$exports as default};
8
+ //# sourceMappingURL=lv-LV.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";AAAA,4BAAiB;IAAG,WAAW,CAAC,KAAK,CAAC;AACtC","sources":["packages/@react-spectrum/button/intl/lv-LV.json"],"sourcesContent":["{\n \"pending\": \"gaida\"\n}\n"],"names":[],"version":3,"file":"lv-LV.module.js.map"}